!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).Geoworld={})}(this,function(exports){"use strict";var Base64Encoder=function(){};function defined(e){return null!=e}function DeveloperError(e){var 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(){var e=this.name+": "+this.message;return defined(this.stack)&&(e+="\n"+this.stack.toString()),e},DeveloperError.throwInstantiationError=function(){throw new DeveloperError("This function defines an interface and should not be called directly.")};var Check={},reduceArray,slice,undef,_supportsFullscreen;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}function when(e,t,i,r){return resolve(e).then(t,i,r)}function resolve(e){var t;return e instanceof Promise$1?e:isPromise(e)?(t=defer(),e.then(function(e){t.resolve(e)},function(e){t.reject(e)},function(e){t.progress(e)}),t.promise):fulfilled(e)}function reject(e){return when(e,rejected)}function Promise$1(e){this.then=e}function fulfilled(t){return new Promise$1(function(e){try{return resolve(e?e(t):t)}catch(e){return rejected(e)}})}function rejected(i){return new Promise$1(function(e,t){try{return t?resolve(t(i)):rejected(i)}catch(e){return rejected(e)}})}function defer(){var e,o,s,r,t,i;return e=new Promise$1(n),o=[],s=[],r=function(t,i,r){var n,a;return n=defer(),a="function"==typeof r?function(e){try{n.progress(r(e))}catch(e){n.progress(e)}}:function(e){n.progress(e)},o.push(function(e){e.then(t,i).then(n.resolve,n.reject,a)}),s.push(a),n.promise},t=function(e){return processQueue(s,e),e},i=function(e){return e=resolve(e),r=e.then,i=resolve,t=noop,processQueue(o,e),s=o=undef,e},{then:n,resolve:a,reject:l,progress:u,promise:e,resolver:{resolve:a,reject:l,progress:u}};function n(e,t,i){return r(e,t,i)}function a(e){return i(e)}function l(e){return i(rejected(e))}function u(e){return t(e)}}function isPromise(e){return e&&"function"==typeof e.then}function some(e,p,f,m,g){return checkCallbacks(2,arguments),when(e,function(e){var t,i,r,n,a,o,s,l,u,c;if(u=e.length>>>0,t=Math.max(0,Math.min(p,u)),r=[],i=u-t+1,n=[],a=defer(),t)for(l=a.progress,s=function(e){n.push(e),--i||(o=s=noop,a.reject(n))},o=function(e){r.push(e),--t||(o=s=noop,a.resolve(r))},c=0;c>>0,i=[],o=defer(),r)for(n=function(e,t){when(e,s).then(function(e){i[t]=e,--r||o.resolve(i)},o.reject)},a=0;a>>0,(i=arguments).length<=1)for(;;){if(a in t){r=t[a++];break}if(++a>=n)throw new TypeError}else r=i[1];for(;a>>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.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var i;for(this.mti==this.N+1&&this.init_genrand(5489),i=0;i>>1^t[1&e];for(;i>>1^t[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^t[1&e],this.mti=0}return e=this.mt[this.mti++],e^=e>>>11,e^=e<<7&2636928640,e^=e<<15&4022730752,(e^=e>>>18)>>>0},MersenneTwister.prototype.random=function(){return this.genrand_int32()*(1/4294967296)};var 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?i-t:i},CesiumMath.clampToLatitudeRange=function(e){return CesiumMath.clamp(e,-1*CesiumMath.PI_OVER_TWO,CesiumMath.PI_OVER_TWO)},CesiumMath.negativePiToPi=function(e){return CesiumMath.zeroToTwoPi(e+CesiumMath.PI)-CesiumMath.PI},CesiumMath.zeroToTwoPi=function(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(e%t+t)%t},CesiumMath.equalsEpsilon=function(e,t,i,r){r=defaultValue(r,i);var n=Math.abs(e-t);return n<=r||n<=i*Math.max(Math.abs(e),Math.abs(t))},CesiumMath.lessThan=function(e,t,i){return e-t<-i},CesiumMath.lessThanOrEquals=function(e,t,i){return e-t>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e},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},Color.fromCartesian4=function(e,t){return defined(t)?(t.red=e.x,t.green=e.y,t.blue=e.z,t.alpha=e.w,t):new Color(e.x,e.y,e.z,e.w)},Color.fromBytes=function(e,t,i,r,n){return e=Color.byteToFloat(defaultValue(e,255)),t=Color.byteToFloat(defaultValue(t,255)),i=Color.byteToFloat(defaultValue(i,255)),r=Color.byteToFloat(defaultValue(r,255)),defined(n)?(n.red=e,n.green=t,n.blue=i,n.alpha=r,n):new Color(e,t,i,r)},Color.fromAlpha=function(e,t,i){return defined(i)?(i.red=e.red,i.green=e.green,i.blue=e.blue,i.alpha=t,i):new Color(e.red,e.green,e.blue,t)},FeatureDetection$1.supportsTypedArrays()&&(scratchArrayBuffer=new ArrayBuffer(4),scratchUint32Array=new Uint32Array(scratchArrayBuffer),scratchUint8Array=new Uint8Array(scratchArrayBuffer)),Color.fromRgba=function(e,t){return scratchUint32Array[0]=e,Color.fromBytes(scratchUint8Array[0],scratchUint8Array[1],scratchUint8Array[2],scratchUint8Array[3],t)},Color.fromHsl=function(e,t,i,r,n){e=defaultValue(e,0)%1,t=defaultValue(t,0),i=defaultValue(i,0),r=defaultValue(r,1);var a=i,o=i,s=i;if(0!==t){var l,u=2*i-(l=i<.5?i*(1+t):i+t-i*t);a=hue2rgb(u,l,e+1/3),o=hue2rgb(u,l,e),s=hue2rgb(u,l,e-1/3)}return defined(n)?(n.red=a,n.green=o,n.blue=s,n.alpha=r,n):new Color(a,o,s,r)},Color.fromRandom=function(e,t){var i=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).red;if(!defined(i)){var r=defaultValue(e.minimumRed,0),n=defaultValue(e.maximumRed,1);i=r+CesiumMath.nextRandomNumber()*(n-r)}var a=e.green;if(!defined(a)){var o=defaultValue(e.minimumGreen,0),s=defaultValue(e.maximumGreen,1);a=o+CesiumMath.nextRandomNumber()*(s-o)}var l=e.blue;if(!defined(l)){var u=defaultValue(e.minimumBlue,0),c=defaultValue(e.maximumBlue,1);l=u+CesiumMath.nextRandomNumber()*(c-u)}var d=e.alpha;if(!defined(d)){var h=defaultValue(e.minimumAlpha,0),p=defaultValue(e.maximumAlpha,1);d=h+CesiumMath.nextRandomNumber()*(p-h)}return defined(t)?(t.red=i,t.green=a,t.blue=l,t.alpha=d,t):new Color(i,a,l,d)};var rgbMatcher=/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i,rrggbbMatcher=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i,rgbParenthesesMatcher=/^rgba?\(\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)(?:\s*,\s*([0-9.]+))?\s*\)$/i,hslParenthesesMatcher=/^hsla?\(\s*([0-9.]+)\s*,\s*([0-9.]+%)\s*,\s*([0-9.]+%)(?:\s*,\s*([0-9.]+))?\s*\)$/i;function Event(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}function compareNumber(e,t){return t-e}function ConstantProperty(e){this._value=void 0,this._hasClone=!1,this._hasEquals=!1,this._definitionChanged=new Event,this.setValue(e)}function createProperty(r,n,a,e,o){return{configurable:e,get:function(){return this[n]},set:function(e){var t=this[n],i=this[a];defined(i)&&(i(),this[a]=void 0),!(void 0!==e)||defined(e)&&defined(e.getValue)||!defined(o)||(e=o(e)),t!==e&&(this[n]=e,this._definitionChanged.raiseEvent(this,r,e,t)),defined(e)&&defined(e.definitionChanged)&&(this[a]=e.definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this,r,e,e)},this))}}}function createConstantProperty(e){return new ConstantProperty(e)}function createPropertyDescriptor(e,t,i){return createProperty(e,"_"+e.toString(),"_"+e.toString()+"Subscription",defaultValue(t,!1),defaultValue(i,createConstantProperty))}function Cartesian2(e,t){this.x=defaultValue(e,0),this.y=defaultValue(t,0)}Color.fromCssColorString=function(e,t){defined(t)||(t=new Color);var i=Color[e.toUpperCase()];if(defined(i))return Color.clone(i,t),t;var r=rgbMatcher.exec(e);return null!==r?(t.red=parseInt(r[1],16)/15,t.green=parseInt(r[2],16)/15,t.blue=parseInt(r[3],16)/15,t.alpha=1,t):null!==(r=rrggbbMatcher.exec(e))?(t.red=parseInt(r[1],16)/255,t.green=parseInt(r[2],16)/255,t.blue=parseInt(r[3],16)/255,t.alpha=1,t):null!==(r=rgbParenthesesMatcher.exec(e))?(t.red=parseFloat(r[1])/("%"===r[1].substr(-1)?100:255),t.green=parseFloat(r[2])/("%"===r[2].substr(-1)?100:255),t.blue=parseFloat(r[3])/("%"===r[3].substr(-1)?100:255),t.alpha=parseFloat(defaultValue(r[4],"1.0")),t):null!==(r=hslParenthesesMatcher.exec(e))?Color.fromHsl(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,parseFloat(defaultValue(r[4],"1.0")),t):t=void 0},Color.packedLength=4,Color.pack=function(e,t,i){return i=defaultValue(i,0),t[i++]=e.red,t[i++]=e.green,t[i++]=e.blue,t[i]=e.alpha,t},Color.unpack=function(e,t,i){return t=defaultValue(t,0),defined(i)||(i=new Color),i.red=e[t++],i.green=e[t++],i.blue=e[t++],i.alpha=e[t],i},Color.byteToFloat=function(e){return e/255},Color.floatToByte=function(e){return 1===e?255:256*e|0},Color.clone=function(e,t){if(defined(e))return defined(t)?(t.red=e.red,t.green=e.green,t.blue=e.blue,t.alpha=e.alpha,t):new Color(e.red,e.green,e.blue,e.alpha)},Color.equals=function(e,t){return e===t||defined(e)&&defined(t)&&e.red===t.red&&e.green===t.green&&e.blue===t.blue&&e.alpha===t.alpha},Color.equalsArray=function(e,t,i){return e.red===t[i]&&e.green===t[i+1]&&e.blue===t[i+2]&&e.alpha===t[i+3]},Color.prototype.clone=function(e){return Color.clone(this,e)},Color.prototype.equals=function(e){return Color.equals(this,e)},Color.prototype.equalsEpsilon=function(e,t){return this===e||defined(e)&&Math.abs(this.red-e.red)<=t&&Math.abs(this.green-e.green)<=t&&Math.abs(this.blue-e.blue)<=t&&Math.abs(this.alpha-e.alpha)<=t},Color.prototype.toString=function(){return"("+this.red+", "+this.green+", "+this.blue+", "+this.alpha+")"},Color.prototype.toCssColorString=function(){var e=Color.floatToByte(this.red),t=Color.floatToByte(this.green),i=Color.floatToByte(this.blue);return 1===this.alpha?"rgb("+e+","+t+","+i+")":"rgba("+e+","+t+","+i+","+this.alpha+")"},Color.prototype.toBytes=function(e){var t=Color.floatToByte(this.red),i=Color.floatToByte(this.green),r=Color.floatToByte(this.blue),n=Color.floatToByte(this.alpha);return defined(e)?(e[0]=t,e[1]=i,e[2]=r,e[3]=n,e):[t,i,r,n]},Color.prototype.toRgba=function(){return scratchUint8Array[0]=Color.floatToByte(this.red),scratchUint8Array[1]=Color.floatToByte(this.green),scratchUint8Array[2]=Color.floatToByte(this.blue),scratchUint8Array[3]=Color.floatToByte(this.alpha),scratchUint32Array[0]},Color.prototype.brighten=function(e,t){return e=1-e,t.red=1-(1-this.red)*e,t.green=1-(1-this.green)*e,t.blue=1-(1-this.blue)*e,t.alpha=this.alpha,t},Color.prototype.darken=function(e,t){return e=1-e,t.red=this.red*e,t.green=this.green*e,t.blue=this.blue*e,t.alpha=this.alpha,t},Color.prototype.withAlpha=function(e,t){return Color.fromAlpha(this,e,t)},Color.add=function(e,t,i){return i.red=e.red+t.red,i.green=e.green+t.green,i.blue=e.blue+t.blue,i.alpha=e.alpha+t.alpha,i},Color.subtract=function(e,t,i){return i.red=e.red-t.red,i.green=e.green-t.green,i.blue=e.blue-t.blue,i.alpha=e.alpha-t.alpha,i},Color.multiply=function(e,t,i){return i.red=e.red*t.red,i.green=e.green*t.green,i.blue=e.blue*t.blue,i.alpha=e.alpha*t.alpha,i},Color.divide=function(e,t,i){return i.red=e.red/t.red,i.green=e.green/t.green,i.blue=e.blue/t.blue,i.alpha=e.alpha/t.alpha,i},Color.mod=function(e,t,i){return i.red=e.red%t.red,i.green=e.green%t.green,i.blue=e.blue%t.blue,i.alpha=e.alpha%t.alpha,i},Color.lerp=function(e,t,i,r){return r.red=CesiumMath.lerp(e.red,t.red,i),r.green=CesiumMath.lerp(e.green,t.green,i),r.blue=CesiumMath.lerp(e.blue,t.blue,i),r.alpha=CesiumMath.lerp(e.alpha,t.alpha,i),r},Color.multiplyByScalar=function(e,t,i){return i.red=e.red*t,i.green=e.green*t,i.blue=e.blue*t,i.alpha=e.alpha*t,i},Color.divideByScalar=function(e,t,i){return i.red=e.red/t,i.green=e.green/t,i.blue=e.blue/t,i.alpha=e.alpha/t,i},Color.ALICEBLUE=Object.freeze(Color.fromCssColorString("#F0F8FF")),Color.ANTIQUEWHITE=Object.freeze(Color.fromCssColorString("#FAEBD7")),Color.AQUA=Object.freeze(Color.fromCssColorString("#00FFFF")),Color.AQUAMARINE=Object.freeze(Color.fromCssColorString("#7FFFD4")),Color.AZURE=Object.freeze(Color.fromCssColorString("#F0FFFF")),Color.BEIGE=Object.freeze(Color.fromCssColorString("#F5F5DC")),Color.BISQUE=Object.freeze(Color.fromCssColorString("#FFE4C4")),Color.BLACK=Object.freeze(Color.fromCssColorString("#000000")),Color.BLANCHEDALMOND=Object.freeze(Color.fromCssColorString("#FFEBCD")),Color.BLUE=Object.freeze(Color.fromCssColorString("#0000FF")),Color.BLUEVIOLET=Object.freeze(Color.fromCssColorString("#8A2BE2")),Color.BROWN=Object.freeze(Color.fromCssColorString("#A52A2A")),Color.BURLYWOOD=Object.freeze(Color.fromCssColorString("#DEB887")),Color.CADETBLUE=Object.freeze(Color.fromCssColorString("#5F9EA0")),Color.CHARTREUSE=Object.freeze(Color.fromCssColorString("#7FFF00")),Color.CHOCOLATE=Object.freeze(Color.fromCssColorString("#D2691E")),Color.CORAL=Object.freeze(Color.fromCssColorString("#FF7F50")),Color.CORNFLOWERBLUE=Object.freeze(Color.fromCssColorString("#6495ED")),Color.CORNSILK=Object.freeze(Color.fromCssColorString("#FFF8DC")),Color.CRIMSON=Object.freeze(Color.fromCssColorString("#DC143C")),Color.CYAN=Object.freeze(Color.fromCssColorString("#00FFFF")),Color.DARKBLUE=Object.freeze(Color.fromCssColorString("#00008B")),Color.DARKCYAN=Object.freeze(Color.fromCssColorString("#008B8B")),Color.DARKGOLDENROD=Object.freeze(Color.fromCssColorString("#B8860B")),Color.DARKGRAY=Object.freeze(Color.fromCssColorString("#A9A9A9")),Color.DARKGREEN=Object.freeze(Color.fromCssColorString("#006400")),Color.DARKGREY=Color.DARKGRAY,Color.DARKKHAKI=Object.freeze(Color.fromCssColorString("#BDB76B")),Color.DARKMAGENTA=Object.freeze(Color.fromCssColorString("#8B008B")),Color.DARKOLIVEGREEN=Object.freeze(Color.fromCssColorString("#556B2F")),Color.DARKORANGE=Object.freeze(Color.fromCssColorString("#FF8C00")),Color.DARKORCHID=Object.freeze(Color.fromCssColorString("#9932CC")),Color.DARKRED=Object.freeze(Color.fromCssColorString("#8B0000")),Color.DARKSALMON=Object.freeze(Color.fromCssColorString("#E9967A")),Color.DARKSEAGREEN=Object.freeze(Color.fromCssColorString("#8FBC8F")),Color.DARKSLATEBLUE=Object.freeze(Color.fromCssColorString("#483D8B")),Color.DARKSLATEGRAY=Object.freeze(Color.fromCssColorString("#2F4F4F")),Color.DARKSLATEGREY=Color.DARKSLATEGRAY,Color.DARKTURQUOISE=Object.freeze(Color.fromCssColorString("#00CED1")),Color.DARKVIOLET=Object.freeze(Color.fromCssColorString("#9400D3")),Color.DEEPPINK=Object.freeze(Color.fromCssColorString("#FF1493")),Color.DEEPSKYBLUE=Object.freeze(Color.fromCssColorString("#00BFFF")),Color.DIMGRAY=Object.freeze(Color.fromCssColorString("#696969")),Color.DIMGREY=Color.DIMGRAY,Color.DODGERBLUE=Object.freeze(Color.fromCssColorString("#1E90FF")),Color.FIREBRICK=Object.freeze(Color.fromCssColorString("#B22222")),Color.FLORALWHITE=Object.freeze(Color.fromCssColorString("#FFFAF0")),Color.FORESTGREEN=Object.freeze(Color.fromCssColorString("#228B22")),Color.FUCHSIA=Object.freeze(Color.fromCssColorString("#FF00FF")),Color.GAINSBORO=Object.freeze(Color.fromCssColorString("#DCDCDC")),Color.GHOSTWHITE=Object.freeze(Color.fromCssColorString("#F8F8FF")),Color.GOLD=Object.freeze(Color.fromCssColorString("#FFD700")),Color.GOLDENROD=Object.freeze(Color.fromCssColorString("#DAA520")),Color.GRAY=Object.freeze(Color.fromCssColorString("#808080")),Color.GREEN=Object.freeze(Color.fromCssColorString("#008000")),Color.GREENYELLOW=Object.freeze(Color.fromCssColorString("#ADFF2F")),Color.GREY=Color.GRAY,Color.HONEYDEW=Object.freeze(Color.fromCssColorString("#F0FFF0")),Color.HOTPINK=Object.freeze(Color.fromCssColorString("#FF69B4")),Color.INDIANRED=Object.freeze(Color.fromCssColorString("#CD5C5C")),Color.INDIGO=Object.freeze(Color.fromCssColorString("#4B0082")),Color.IVORY=Object.freeze(Color.fromCssColorString("#FFFFF0")),Color.KHAKI=Object.freeze(Color.fromCssColorString("#F0E68C")),Color.LAVENDER=Object.freeze(Color.fromCssColorString("#E6E6FA")),Color.LAVENDAR_BLUSH=Object.freeze(Color.fromCssColorString("#FFF0F5")),Color.LAWNGREEN=Object.freeze(Color.fromCssColorString("#7CFC00")),Color.LEMONCHIFFON=Object.freeze(Color.fromCssColorString("#FFFACD")),Color.LIGHTBLUE=Object.freeze(Color.fromCssColorString("#ADD8E6")),Color.LIGHTCORAL=Object.freeze(Color.fromCssColorString("#F08080")),Color.LIGHTCYAN=Object.freeze(Color.fromCssColorString("#E0FFFF")),Color.LIGHTGOLDENRODYELLOW=Object.freeze(Color.fromCssColorString("#FAFAD2")),Color.LIGHTGRAY=Object.freeze(Color.fromCssColorString("#D3D3D3")),Color.LIGHTGREEN=Object.freeze(Color.fromCssColorString("#90EE90")),Color.LIGHTGREY=Color.LIGHTGRAY,Color.LIGHTPINK=Object.freeze(Color.fromCssColorString("#FFB6C1")),Color.LIGHTSEAGREEN=Object.freeze(Color.fromCssColorString("#20B2AA")),Color.LIGHTSKYBLUE=Object.freeze(Color.fromCssColorString("#87CEFA")),Color.LIGHTSLATEGRAY=Object.freeze(Color.fromCssColorString("#778899")),Color.LIGHTSLATEGREY=Color.LIGHTSLATEGRAY,Color.LIGHTSTEELBLUE=Object.freeze(Color.fromCssColorString("#B0C4DE")),Color.LIGHTYELLOW=Object.freeze(Color.fromCssColorString("#FFFFE0")),Color.LIME=Object.freeze(Color.fromCssColorString("#00FF00")),Color.LIMEGREEN=Object.freeze(Color.fromCssColorString("#32CD32")),Color.LINEN=Object.freeze(Color.fromCssColorString("#FAF0E6")),Color.MAGENTA=Object.freeze(Color.fromCssColorString("#FF00FF")),Color.MAROON=Object.freeze(Color.fromCssColorString("#800000")),Color.MEDIUMAQUAMARINE=Object.freeze(Color.fromCssColorString("#66CDAA")),Color.MEDIUMBLUE=Object.freeze(Color.fromCssColorString("#0000CD")),Color.MEDIUMORCHID=Object.freeze(Color.fromCssColorString("#BA55D3")),Color.MEDIUMPURPLE=Object.freeze(Color.fromCssColorString("#9370DB")),Color.MEDIUMSEAGREEN=Object.freeze(Color.fromCssColorString("#3CB371")),Color.MEDIUMSLATEBLUE=Object.freeze(Color.fromCssColorString("#7B68EE")),Color.MEDIUMSPRINGGREEN=Object.freeze(Color.fromCssColorString("#00FA9A")),Color.MEDIUMTURQUOISE=Object.freeze(Color.fromCssColorString("#48D1CC")),Color.MEDIUMVIOLETRED=Object.freeze(Color.fromCssColorString("#C71585")),Color.MIDNIGHTBLUE=Object.freeze(Color.fromCssColorString("#191970")),Color.MINTCREAM=Object.freeze(Color.fromCssColorString("#F5FFFA")),Color.MISTYROSE=Object.freeze(Color.fromCssColorString("#FFE4E1")),Color.MOCCASIN=Object.freeze(Color.fromCssColorString("#FFE4B5")),Color.NAVAJOWHITE=Object.freeze(Color.fromCssColorString("#FFDEAD")),Color.NAVY=Object.freeze(Color.fromCssColorString("#000080")),Color.OLDLACE=Object.freeze(Color.fromCssColorString("#FDF5E6")),Color.OLIVE=Object.freeze(Color.fromCssColorString("#808000")),Color.OLIVEDRAB=Object.freeze(Color.fromCssColorString("#6B8E23")),Color.ORANGE=Object.freeze(Color.fromCssColorString("#FFA500")),Color.ORANGERED=Object.freeze(Color.fromCssColorString("#FF4500")),Color.ORCHID=Object.freeze(Color.fromCssColorString("#DA70D6")),Color.PALEGOLDENROD=Object.freeze(Color.fromCssColorString("#EEE8AA")),Color.PALEGREEN=Object.freeze(Color.fromCssColorString("#98FB98")),Color.PALETURQUOISE=Object.freeze(Color.fromCssColorString("#AFEEEE")),Color.PALEVIOLETRED=Object.freeze(Color.fromCssColorString("#DB7093")),Color.PAPAYAWHIP=Object.freeze(Color.fromCssColorString("#FFEFD5")),Color.PEACHPUFF=Object.freeze(Color.fromCssColorString("#FFDAB9")),Color.PERU=Object.freeze(Color.fromCssColorString("#CD853F")),Color.PINK=Object.freeze(Color.fromCssColorString("#FFC0CB")),Color.PLUM=Object.freeze(Color.fromCssColorString("#DDA0DD")),Color.POWDERBLUE=Object.freeze(Color.fromCssColorString("#B0E0E6")),Color.PURPLE=Object.freeze(Color.fromCssColorString("#800080")),Color.RED=Object.freeze(Color.fromCssColorString("#FF0000")),Color.ROSYBROWN=Object.freeze(Color.fromCssColorString("#BC8F8F")),Color.ROYALBLUE=Object.freeze(Color.fromCssColorString("#4169E1")),Color.SADDLEBROWN=Object.freeze(Color.fromCssColorString("#8B4513")),Color.SALMON=Object.freeze(Color.fromCssColorString("#FA8072")),Color.SANDYBROWN=Object.freeze(Color.fromCssColorString("#F4A460")),Color.SEAGREEN=Object.freeze(Color.fromCssColorString("#2E8B57")),Color.SEASHELL=Object.freeze(Color.fromCssColorString("#FFF5EE")),Color.SIENNA=Object.freeze(Color.fromCssColorString("#A0522D")),Color.SILVER=Object.freeze(Color.fromCssColorString("#C0C0C0")),Color.SKYBLUE=Object.freeze(Color.fromCssColorString("#87CEEB")),Color.SLATEBLUE=Object.freeze(Color.fromCssColorString("#6A5ACD")),Color.SLATEGRAY=Object.freeze(Color.fromCssColorString("#708090")),Color.SLATEGREY=Color.SLATEGRAY,Color.SNOW=Object.freeze(Color.fromCssColorString("#FFFAFA")),Color.SPRINGGREEN=Object.freeze(Color.fromCssColorString("#00FF7F")),Color.STEELBLUE=Object.freeze(Color.fromCssColorString("#4682B4")),Color.TAN=Object.freeze(Color.fromCssColorString("#D2B48C")),Color.TEAL=Object.freeze(Color.fromCssColorString("#008080")),Color.THISTLE=Object.freeze(Color.fromCssColorString("#D8BFD8")),Color.TOMATO=Object.freeze(Color.fromCssColorString("#FF6347")),Color.TURQUOISE=Object.freeze(Color.fromCssColorString("#40E0D0")),Color.VIOLET=Object.freeze(Color.fromCssColorString("#EE82EE")),Color.WHEAT=Object.freeze(Color.fromCssColorString("#F5DEB3")),Color.WHITE=Object.freeze(Color.fromCssColorString("#FFFFFF")),Color.WHITESMOKE=Object.freeze(Color.fromCssColorString("#F5F5F5")),Color.YELLOW=Object.freeze(Color.fromCssColorString("#FFFF00")),Color.YELLOWGREEN=Object.freeze(Color.fromCssColorString("#9ACD32")),Color.TRANSPARENT=Object.freeze(new Color(0,0,0,0)),Object.defineProperties(Event.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}}),Event.prototype.addEventListener=function(e,t){this._listeners.push(e),this._scopes.push(t);var i=this;return function(){i.removeEventListener(e,t)}},Event.prototype.removeEventListener=function(e,t){for(var i=this._listeners,r=this._scopes,n=-1,a=0;ae&&0n&&(t=i[n],this._length=n),t},Heap.prototype.pop=function(e){if(e=defaultValue(e,0),0!==this._length){var t=this._array,i=t[e];return swap(t,e,--this._length),this.heapify(e),i}};var statistics={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},priorityHeapLength=20,requestHeap=new Heap({comparator:sortRequests});requestHeap.maximumLength=priorityHeapLength,requestHeap.reserve(priorityHeapLength);var activeRequests=[],numberOfActiveRequestsByServer={},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 serverHasOpenSlots(e){var t=defaultValue(RequestScheduler.requestsByServer[e],RequestScheduler.maximumRequestsPerServer);return numberOfActiveRequestsByServer[e]e;){cancelRequest(requestHeap.pop())}priorityHeapLength=e,requestHeap.maximumLength=e,requestHeap.reserve(e)}}}),RequestScheduler.update=function(){var e,t,i=0,r=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);var i=this;return when(t(this,e)).then(function(e){return++i._retryCount,e})},Resource.prototype.clone=function(e){return defined(e)||(e=new Resource({url:this._url,tilesetType:this._tilesetType})),e._url=this._url,e._queryParameters=clone(this._queryParameters),e._templateValues=clone(this._templateValues),e.headers=clone(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e._tilesetType=this._tilesetType,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){var t=defaultValue((e=defaultValue(e,defaultValue.EMPTY_OBJECT)).preferImageBitmap,!1),i=defaultValue(e.preferBlob,!1),r=defaultValue(e.flipY,!1);if(checkAndResetRequest(this.request),!xhrBlobSupported||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!i)return fetchImage({resource:this,flipY:r,preferImageBitmap:t});var n,a,o,s=this.fetchBlob();return defined(s)?Resource.supportsImageBitmapOptions().then(function(e){return n=e&&t,s}).then(function(e){if(defined(e)){if(o=e,n)return Resource.createImageBitmapFromBlob(e,{flipY:r,premultiplyAlpha:!1});var t=window.URL.createObjectURL(e);return fetchImage({resource:a=new Resource({url:t}),flipY:r,preferImageBitmap:!1})}}).then(function(e){if(defined(e))return e.blob=o,n||window.URL.revokeObjectURL(a.url),e}).otherwise(function(e){return defined(a)&&window.URL.revokeObjectURL(a.url),e.blob=o,when.reject(e)}):void 0},Resource.fetchImage=function(e){return new Resource(e).fetchImage({flipY:e.flipY,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(){var 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){var 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){var l=this;checkAndResetRequest(l.request);var u=l.request;u.url=l.url,u.requestFunction=function(){var e=s.responseType,t=combine(s.headers,l.headers),i=s.overrideMimeType,r=s.method,n=s.data,a=when.defer(),o=Resource._Implementations.loadWithXhr(l.url,e,r,n,t,a,i);return defined(o)&&defined(o.abort)&&(u.cancelFunction=function(){o.abort()}),a.promise};var e=RequestScheduler.request(u);if(defined(e))return e.then(function(e){return e}).otherwise(function(t){return u.state!==RequestState$1.FAILED?when.reject(t):l.retryOnError(t).then(function(e){return e?(u.state=RequestState$1.UNISSUED,u.deferred=void 0,l.fetch(s)):when.reject(t)})})};var dataUriRegex$1=/^data:(.*?)(;base64)?,(.*)$/;function decodeDataUriText(e,t){var i=decodeURIComponent(t);return e?atob(i):i}function decodeDataUriArrayBuffer(e,t){for(var i=decodeDataUriText(e,t),r=new ArrayBuffer(i.length),n=new Uint8Array(r),a=0;a=this._maximumActiveTasks)){++this._activeTasks;var a=this;return when(canTransferArrayBuffer(),function(e){defined(n)?e||(n.length=0):n=emptyTransferableObjectArray;var t=a._nextID++,i=when.defer();return a._deferreds[t]=i,a._worker.postMessage({id:t,parameters:r,canTransferArrayBuffer:e},n),i.promise})}},TaskProcessor.prototype.initWebAssemblyModule=function(e){defined(this._worker)||(this._worker=createWorker(this));var n=when.defer(),a=this,o=this._worker;return getWebAssemblyLoaderConfig(this,e).then(function(r){return when(canTransferArrayBuffer(),function(e){var t,i=r.wasmBinary;defined(i)&&e&&(t=[i]),o.onmessage=function(e){o.onmessage=function(e){completeTask(a,e.data)},n.resolve(e.data)},o.postMessage({webAssemblyConfig:r},t)})}),n},TaskProcessor.prototype.isDestroyed=function(){return!1},TaskProcessor.prototype.destroy=function(){return defined(this._worker)&&this._worker.terminate(),destroyObject(this)},TaskProcessor.taskCompletedEvent=taskCompletedEvent,TaskProcessor._defaultWorkerModulePrefix="Workers/",TaskProcessor._workerModulePrefix=TaskProcessor._defaultWorkerModulePrefix,TaskProcessor._canTransferArrayBuffer=void 0;var transcodeTaskProcessor=new TaskProcessor("transcodeCRNToDXT",Number.POSITIVE_INFINITY);function loadCRN(e){var t;e instanceof ArrayBuffer||ArrayBuffer.isView(e)?t=when.resolve(e):t=Resource.createIfNeeded(e).fetchArrayBuffer();if(defined(t))return t.then(function(e){if(defined(e)){var t=[];return e instanceof ArrayBuffer?t.push(e):(0===e.byteOffset&&e.byteLength===e.buffer.byteLength||(e=e.slice(0,e.length)),t.push(e.buffer)),transcodeTaskProcessor.scheduleTask(e,t)}}).then(function(e){return CompressedTextureBuffer.clone(e)})}var WebGLConstants={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_RGB_PVRTC_4BPPV1_IMG:35840,COMPRESSED_RGB_PVRTC_2BPPV1_IMG:35841,COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:35842,COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:35843,COMPRESSED_RGB_ETC1_WEBGL:36196,HALF_FLOAT_OES:36193,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047},WebGLConstants$1=Object.freeze(WebGLConstants),PixelDatatype={UNSIGNED_BYTE:WebGLConstants$1.UNSIGNED_BYTE,UNSIGNED_SHORT:WebGLConstants$1.UNSIGNED_SHORT,UNSIGNED_INT:WebGLConstants$1.UNSIGNED_INT,FLOAT:WebGLConstants$1.FLOAT,HALF_FLOAT:WebGLConstants$1.HALF_FLOAT_OES,UNSIGNED_INT_24_8:WebGLConstants$1.UNSIGNED_INT_24_8,UNSIGNED_SHORT_4_4_4_4:WebGLConstants$1.UNSIGNED_SHORT_4_4_4_4,UNSIGNED_SHORT_5_5_5_1:WebGLConstants$1.UNSIGNED_SHORT_5_5_5_1,UNSIGNED_SHORT_5_6_5:WebGLConstants$1.UNSIGNED_SHORT_5_6_5,isPacked:function(e){return e===PixelDatatype.UNSIGNED_INT_24_8||e===PixelDatatype.UNSIGNED_SHORT_4_4_4_4||e===PixelDatatype.UNSIGNED_SHORT_5_5_5_1||e===PixelDatatype.UNSIGNED_SHORT_5_6_5},sizeInBytes:function(e){switch(e){case PixelDatatype.UNSIGNED_BYTE:return 1;case PixelDatatype.UNSIGNED_SHORT:case PixelDatatype.UNSIGNED_SHORT_4_4_4_4:case PixelDatatype.UNSIGNED_SHORT_5_5_5_1:case PixelDatatype.UNSIGNED_SHORT_5_6_5:case PixelDatatype.HALF_FLOAT:return 2;case PixelDatatype.UNSIGNED_INT:case PixelDatatype.FLOAT:case PixelDatatype.UNSIGNED_INT_24_8:return 4}},validate:function(e){return e===PixelDatatype.UNSIGNED_BYTE||e===PixelDatatype.UNSIGNED_SHORT||e===PixelDatatype.UNSIGNED_INT||e===PixelDatatype.FLOAT||e===PixelDatatype.HALF_FLOAT||e===PixelDatatype.UNSIGNED_INT_24_8||e===PixelDatatype.UNSIGNED_SHORT_4_4_4_4||e===PixelDatatype.UNSIGNED_SHORT_5_5_5_1||e===PixelDatatype.UNSIGNED_SHORT_5_6_5}},PixelDatatype$1=Object.freeze(PixelDatatype),PixelFormat={DEPTH_COMPONENT:WebGLConstants$1.DEPTH_COMPONENT,DEPTH_STENCIL:WebGLConstants$1.DEPTH_STENCIL,ALPHA:WebGLConstants$1.ALPHA,RGB:WebGLConstants$1.RGB,RGBA:WebGLConstants$1.RGBA,LUMINANCE:WebGLConstants$1.LUMINANCE,LUMINANCE_ALPHA:WebGLConstants$1.LUMINANCE_ALPHA,RGB_DXT1:WebGLConstants$1.COMPRESSED_RGB_S3TC_DXT1_EXT,RGBA_DXT1:WebGLConstants$1.COMPRESSED_RGBA_S3TC_DXT1_EXT,RGBA_DXT3:WebGLConstants$1.COMPRESSED_RGBA_S3TC_DXT3_EXT,RGBA_DXT5:WebGLConstants$1.COMPRESSED_RGBA_S3TC_DXT5_EXT,RGB_PVRTC_4BPPV1:WebGLConstants$1.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,RGB_PVRTC_2BPPV1:WebGLConstants$1.COMPRESSED_RGB_PVRTC_2BPPV1_IMG,RGBA_PVRTC_4BPPV1:WebGLConstants$1.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,RGBA_PVRTC_2BPPV1:WebGLConstants$1.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,RGB_ETC1:WebGLConstants$1.COMPRESSED_RGB_ETC1_WEBGL,componentsLength:function(e){switch(e){case PixelFormat.RGB:return 3;case PixelFormat.RGBA:return 4;case PixelFormat.LUMINANCE_ALPHA:return 2;case PixelFormat.ALPHA:case PixelFormat.LUMINANCE:default:return 1}},validate:function(e){return e===PixelFormat.DEPTH_COMPONENT||e===PixelFormat.DEPTH_STENCIL||e===PixelFormat.ALPHA||e===PixelFormat.RGB||e===PixelFormat.RGBA||e===PixelFormat.LUMINANCE||e===PixelFormat.LUMINANCE_ALPHA||e===PixelFormat.RGB_DXT1||e===PixelFormat.RGBA_DXT1||e===PixelFormat.RGBA_DXT3||e===PixelFormat.RGBA_DXT5||e===PixelFormat.RGB_PVRTC_4BPPV1||e===PixelFormat.RGB_PVRTC_2BPPV1||e===PixelFormat.RGBA_PVRTC_4BPPV1||e===PixelFormat.RGBA_PVRTC_2BPPV1||e===PixelFormat.RGB_ETC1},isColorFormat:function(e){return e===PixelFormat.ALPHA||e===PixelFormat.RGB||e===PixelFormat.RGBA||e===PixelFormat.LUMINANCE||e===PixelFormat.LUMINANCE_ALPHA},isDepthFormat:function(e){return e===PixelFormat.DEPTH_COMPONENT||e===PixelFormat.DEPTH_STENCIL},isCompressedFormat:function(e){return e===PixelFormat.RGB_DXT1||e===PixelFormat.RGBA_DXT1||e===PixelFormat.RGBA_DXT3||e===PixelFormat.RGBA_DXT5||e===PixelFormat.RGB_PVRTC_4BPPV1||e===PixelFormat.RGB_PVRTC_2BPPV1||e===PixelFormat.RGBA_PVRTC_4BPPV1||e===PixelFormat.RGBA_PVRTC_2BPPV1||e===PixelFormat.RGB_ETC1},isDXTFormat:function(e){return e===PixelFormat.RGB_DXT1||e===PixelFormat.RGBA_DXT1||e===PixelFormat.RGBA_DXT3||e===PixelFormat.RGBA_DXT5},isPVRTCFormat:function(e){return e===PixelFormat.RGB_PVRTC_4BPPV1||e===PixelFormat.RGB_PVRTC_2BPPV1||e===PixelFormat.RGBA_PVRTC_4BPPV1||e===PixelFormat.RGBA_PVRTC_2BPPV1},isETC1Format:function(e){return e===PixelFormat.RGB_ETC1},compressedTextureSizeInBytes:function(e,t,i){switch(e){case PixelFormat.RGB_DXT1:case PixelFormat.RGBA_DXT1:case PixelFormat.RGB_ETC1:return Math.floor((t+3)/4)*Math.floor((i+3)/4)*8;case PixelFormat.RGBA_DXT3:case PixelFormat.RGBA_DXT5:return Math.floor((t+3)/4)*Math.floor((i+3)/4)*16;case PixelFormat.RGB_PVRTC_4BPPV1:case PixelFormat.RGBA_PVRTC_4BPPV1:return Math.floor((Math.max(t,8)*Math.max(i,8)*4+7)/8);case PixelFormat.RGB_PVRTC_2BPPV1:case PixelFormat.RGBA_PVRTC_2BPPV1:return Math.floor((Math.max(t,16)*Math.max(i,8)*2+7)/8);default:return 0}},textureSizeInBytes:function(e,t,i,r){var n=PixelFormat.componentsLength(e);return PixelDatatype$1.isPacked(t)&&(n=1),n*PixelDatatype$1.sizeInBytes(t)*i*r},alignmentInBytes:function(e,t,i){var r=PixelFormat.textureSizeInBytes(e,t,i,1)%4;return 0==r?4:2==r?2:1},createTypedArray:function(e,t,i,r){var n=PixelDatatype$1.sizeInBytes(t);return new(n===Uint8Array.BYTES_PER_ELEMENT?Uint8Array:n===Uint16Array.BYTES_PER_ELEMENT?Uint16Array:n===Float32Array.BYTES_PER_ELEMENT&&t===PixelDatatype$1.FLOAT?Float32Array:Uint32Array)(PixelFormat.componentsLength(e)*i*r)},flipY:function(e,t,i,r,n){if(1===n)return e;for(var a=PixelFormat.createTypedArray(t,i,r,n),o=PixelFormat.componentsLength(t),s=r*o,l=0;l>t,E=p>>t,T=PixelFormat$1.isCompressedFormat(c)?PixelFormat$1.compressedTextureSizeInBytes(c,w,E):PixelFormat$1.textureSizeInBytes(c,s,w,E),P=new Uint8Array(_.buffer,x,T);A[faceOrder[S]]=new CompressedTextureBuffer(c,w,E,P),x+=T}x+=3-(x+3)%4+4}var M=b;if(1===g)for(t=0;ti){var d,h=(e[Matrix3.getElementIndex(c,c)]-e[Matrix3.getElementIndex(u,u)])/2/e[Matrix3.getElementIndex(c,u)];l=(d=h<0?-1/(-h+Math.sqrt(1+h*h)):1/(h+Math.sqrt(1+h*h)))*(s=1/Math.sqrt(1+d*d))}return(t=Matrix3.clone(Matrix3.IDENTITY,t))[Matrix3.getElementIndex(u,u)]=t[Matrix3.getElementIndex(c,c)]=s,t[Matrix3.getElementIndex(c,u)]=l,t[Matrix3.getElementIndex(u,c)]=-l,t}var jMatrix=new Matrix3,jMatrixTranspose=new Matrix3;function Cartesian4(e,t,i,r){this.x=defaultValue(e,0),this.y=defaultValue(t,0),this.z=defaultValue(i,0),this.w=defaultValue(r,0)}Matrix3.computeEigenDecomposition=function(e,t){var i=CesiumMath.EPSILON20,r=0,n=0;defined(t)||(t={});for(var a=t.unitary=Matrix3.clone(Matrix3.IDENTITY,t.unitary),o=t.diagonal=Matrix3.clone(e,t.diagonal),s=i*computeFrobeniusNorm(o);n<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<++r&&(++n,r=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],r=e[6],n=e[1],a=e[4],o=e[7],s=e[2],l=e[5],u=e[8];return t*(a*u-l*o)+n*(l*r-i*u)+s*(i*o-a*r)},Matrix3.inverse=function(e,t){var i=e[0],r=e[1],n=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8],d=Matrix3.determinant(e);t[0]=o*c-u*s,t[1]=u*n-r*c,t[2]=r*s-o*n,t[3]=l*s-a*c,t[4]=i*c-l*n,t[5]=a*n-i*s,t[6]=a*u-l*o,t[7]=l*r-i*u,t[8]=i*o-a*r;var h=1/d;return Matrix3.multiplyByScalar(t,h,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 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]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},Cartesian4.fromElements=function(e,t,i,r,n){return defined(n)?(n.x=e,n.y=t,n.z=i,n.w=r,n):new Cartesian4(e,t,i,r)},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),defined(i)||(i=new Cartesian4),i.x=e[t++],i.y=e[t++],i.z=e[t++],i.w=e[t],i},Cartesian4.packArray=function(e,t){var i=e.length,r=4*i;if(defined(t)){if(!Array.isArray(t)&&t.length!==r)throw new DeveloperError("If result is a typed array, it must have exactly array.length * 4 elements");t.length!==r&&(t.length=r)}else t=new Array(r);for(var n=0;nCesiumMath.EPSILON12);return defined(n)?(n.x=a*b,n.y=o*A,n.z=s*S,n):new Cartesian3(a*b,o*A,s*S)}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,r){return i=defaultValue(i,0),defined(r)?(r.longitude=e,r.latitude=t,r.height=i,r):new Cartographic(e,t,i)},Cartographic.fromDegrees=function(e,t,i,r){return e=CesiumMath.toRadians(e),t=CesiumMath.toRadians(t),Cartographic.fromRadians(e,t,i,r)};var cartesianToCartographicN=new Cartesian3,cartesianToCartographicP=new Cartesian3,cartesianToCartographicH=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,t,i,r){t=defaultValue(t,0),i=defaultValue(i,0),r=defaultValue(r,0),e._radii=new Cartesian3(t,i,r),e._radiiSquared=new Cartesian3(t*t,i*i,r*r),e._radiiToTheFourth=new Cartesian3(t*t*t*t,i*i*i*i,r*r*r*r),e._oneOverRadii=new Cartesian3(0===t?0:1/t,0===i?0:1/i,0===r?0:1/r),e._oneOverRadiiSquared=new Cartesian3(0===t?0:1/(t*t),0===i?0:1/(i*i),0===r?0:1/(r*r)),e._minimumRadius=Math.min(t,i,r),e._maximumRadius=Math.max(t,i,r),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(this,e,t,i)}Cartographic.fromCartesian=function(e,t,i){var r=defined(t)?t.oneOverRadii:wgs84OneOverRadii,n=defined(t)?t.oneOverRadiiSquared:wgs84OneOverRadiiSquared,a=scaleToGeodeticSurface(e,r,n,defined(t)?t._centerToleranceSquared:wgs84CenterToleranceSquared,cartesianToCartographicP);if(defined(a)){var o=Cartesian3.multiplyComponents(a,n,cartesianToCartographicN);o=Cartesian3.normalize(o,o);var s=Cartesian3.subtract(e,a,cartesianToCartographicH),l=Math.atan2(o.y,o.x),u=Math.asin(o.z),c=CesiumMath.sign(Cartesian3.dot(s,e))*Cartesian3.magnitude(s);return defined(i)?(i.longitude=l,i.latitude=u,i.height=c,i):new Cartographic(l,u,c)}},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 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(t,e.x,e.y,e.z),t},Ellipsoid.WGS84=Object.freeze(new Ellipsoid(6378137,6378137,6356752.314245179)),Ellipsoid.CGCS2000=Object.freeze(new Ellipsoid(6378137,6378137,6356752.314140356)),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);var r=Cartesian3.unpack(e,t);return Ellipsoid.fromCartesian3(r,i)},Ellipsoid.prototype.geocentricSurfaceNormal=Cartesian3.normalize,Ellipsoid.prototype.geodeticSurfaceNormalCartographic=function(e,t){var i=e.longitude,r=e.latitude,n=Math.cos(r),a=n*Math.cos(i),o=n*Math.sin(i),s=Math.sin(r);return defined(t)||(t=new Cartesian3),t.x=a,t.y=o,t.z=s,Cartesian3.normalize(t,t)},Ellipsoid.prototype.geodeticSurfaceNormal=function(e,t){return defined(t)||(t=new Cartesian3),t=Cartesian3.multiplyComponents(e,this._oneOverRadiiSquared,t),Cartesian3.normalize(t,t)};var cartographicToCartesianNormal=new Cartesian3,cartographicToCartesianK=new Cartesian3;Ellipsoid.prototype.cartographicToCartesian=function(e,t){var i=cartographicToCartesianNormal,r=cartographicToCartesianK;this.geodeticSurfaceNormalCartographic(e,i),Cartesian3.multiplyComponents(this._radiiSquared,i,r);var n=Math.sqrt(Cartesian3.dot(i,r));return Cartesian3.divideByScalar(r,n,r),Cartesian3.multiplyByScalar(i,e.height,i),defined(t)||(t=new Cartesian3),Cartesian3.add(r,i,t)},Ellipsoid.prototype.cartographicArrayToCartesianArray=function(e,t){var i=e.length;defined(t)?t.length=i:t=new Array(i);for(var r=0;r=this._radii.z-t))return i},Object.defineProperties(GeographicProjection.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),GeographicProjection.prototype.project=function(e,t){var i=this._semimajorAxis,r=e.longitude*i,n=e.latitude*i,a=e.height;return defined(t)?(t.x=r,t.y=n,t.z=a,t):new Cartesian3(r,n,a)},GeographicProjection.prototype.unproject=function(e,t){var i=this._oneOverSemimajorAxis,r=e.x*i,n=e.y*i,a=e.z;return defined(t)?(t.longitude=r,t.latitude=n,t.height=a,t):new Cartographic(r,n,a)};var Intersect={OUTSIDE:-1,INTERSECTING:0,INSIDE:1},Intersect$1=Object.freeze(Intersect);function Rectangle(e,t,i,r){this.west=defaultValue(e,0),this.south=defaultValue(t,0),this.east=defaultValue(i,0),this.north=defaultValue(r,0)}Object.defineProperties(Rectangle.prototype,{width:{get:function(){return Rectangle.computeWidth(this)}},height:{get:function(){return Rectangle.computeHeight(this)}}}),Rectangle.packedLength=4,Rectangle.pack=function(e,t,i){return i=defaultValue(i,0),t[i++]=e.west,t[i++]=e.south,t[i++]=e.east,t[i]=e.north,t},Rectangle.unpack=function(e,t,i){return t=defaultValue(t,0),defined(i)||(i=new Rectangle),i.west=e[t++],i.south=e[t++],i.east=e[t++],i.north=e[t],i},Rectangle.computeWidth=function(e){var t=e.east,i=e.west;return tCesiumMath.PI&&(r-=CesiumMath.TWO_PI),i>CesiumMath.PI&&(i-=CesiumMath.TWO_PI)),defined(t)?(t.west=i,t.south=o,t.east=r,t.north=s,t):new Rectangle(i,o,r,s)},Rectangle.fromCartesianArray=function(e,t,i){t=defaultValue(t,Ellipsoid.WGS84);for(var r=Number.MAX_VALUE,n=-Number.MAX_VALUE,a=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=Number.MAX_VALUE,l=-Number.MAX_VALUE,u=0,c=e.length;uCesiumMath.PI&&(n-=CesiumMath.TWO_PI),r>CesiumMath.PI&&(r-=CesiumMath.TWO_PI)),defined(i)?(i.west=r,i.south=s,i.east=n,i.north=l,i):new Rectangle(r,s,n,l)},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 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){var i=e.east,r=e.west;i=e.south&&r<=e.north};var subsampleLlaScratch=new Cartographic;function BoundingRectangle(e,t,i,r){this.x=defaultValue(e,0),this.y=defaultValue(t,0),this.width=defaultValue(i,0),this.height=defaultValue(r,0)}Rectangle.subsample=function(e,t,i,r){t=defaultValue(t,Ellipsoid.WGS84),i=defaultValue(i,0),defined(r)||(r=[]);var n=0,a=e.north,o=e.south,s=e.east,l=e.west,u=subsampleLlaScratch;u.height=i,u.longitude=l,u.latitude=a,r[n]=t.cartographicToCartesian(u,r[n]),n++,u.longitude=s,r[n]=t.cartographicToCartesian(u,r[n]),n++,u.latitude=o,r[n]=t.cartographicToCartesian(u,r[n]),n++,u.longitude=l,r[n]=t.cartographicToCartesian(u,r[n]),n++,u.latitude=a<0?a:0i.width?i.width=r:r<0&&(i.width-=r,i.x=t.x),n>i.height?i.height=n:n<0&&(i.height-=n,i.y=t.y),i},BoundingRectangle.intersect=function(e,t){var i=e.x,r=e.y,n=t.x,a=t.y;return i>n+t.width||i+e.widtha+t.height?Intersect$1.OUTSIDE:Intersect$1.INTERSECTING},BoundingRectangle.equals=function(e,t){return e===t||defined(e)&&defined(t)&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height},BoundingRectangle.prototype.clone=function(e){return BoundingRectangle.clone(this,e)},BoundingRectangle.prototype.intersect=function(e){return BoundingRectangle.intersect(this,e)},BoundingRectangle.prototype.equals=function(e){return BoundingRectangle.equals(this,e)};var fromPointsXMin=new Cartesian3,fromPointsYMin=new Cartesian3,fromPointsZMin=new Cartesian3,fromPointsXMax=new Cartesian3,fromPointsYMax=new Cartesian3,fromPointsZMax=new Cartesian3,fromPointsCurrentPos=new Cartesian3,fromPointsScratch=new Cartesian3,fromPointsRitterCenter=new Cartesian3,fromPointsMinBoxPt=new Cartesian3,fromPointsMaxBoxPt=new Cartesian3,fromPointsNaiveCenterScratch=new Cartesian3,volumeConstant=4/3*CesiumMath.PI;BoundingSphere.fromPoints=function(e,t){if(defined(t)||(t=new BoundingSphere),!defined(e)||0===e.length)return t.center=Cartesian3.clone(Cartesian3.ZERO,t.center),t.radius=0,t;var i,r=Cartesian3.clone(e[0],fromPointsCurrentPos),n=Cartesian3.clone(r,fromPointsXMin),a=Cartesian3.clone(r,fromPointsYMin),o=Cartesian3.clone(r,fromPointsZMin),s=Cartesian3.clone(r,fromPointsXMax),l=Cartesian3.clone(r,fromPointsYMax),u=Cartesian3.clone(r,fromPointsZMax),c=e.length;for(i=1;is.x&&Cartesian3.clone(r,s),hl.y&&Cartesian3.clone(r,l),pu.z&&Cartesian3.clone(r,u)}var f=Cartesian3.magnitudeSquared(Cartesian3.subtract(s,n,fromPointsScratch)),m=Cartesian3.magnitudeSquared(Cartesian3.subtract(l,a,fromPointsScratch)),g=Cartesian3.magnitudeSquared(Cartesian3.subtract(u,o,fromPointsScratch)),y=n,v=s,_=f;_u.x&&Cartesian3.clone(n,u),fc.y&&Cartesian3.clone(n,c),md.z&&Cartesian3.clone(n,d)}var g=Cartesian3.magnitudeSquared(Cartesian3.subtract(u,o,fromPointsScratch)),y=Cartesian3.magnitudeSquared(Cartesian3.subtract(c,s,fromPointsScratch)),v=Cartesian3.magnitudeSquared(Cartesian3.subtract(d,l,fromPointsScratch)),_=o,C=u,x=g;xl.x&&Cartesian3.clone(r,l),pu.y&&Cartesian3.clone(r,u),fc.z&&Cartesian3.clone(r,c)}var m=Cartesian3.magnitudeSquared(Cartesian3.subtract(l,a,fromPointsScratch)),g=Cartesian3.magnitudeSquared(Cartesian3.subtract(u,o,fromPointsScratch)),y=Cartesian3.magnitudeSquared(Cartesian3.subtract(c,s,fromPointsScratch)),v=a,_=l,C=m;Ci.radius&&(i.radius=r),i},BoundingSphere.intersectPlane=function(e,t){var i=e.center,r=e.radius,n=t.normal,a=Cartesian3.dot(n,i)+t.distance;return a<-r?Intersect$1.OUTSIDE:a-t?((r=scratchCameraPositionInScaledSpaceShrunk).x=this._cameraPosition.x/(n.radii.x+t),r.y=this._cameraPosition.y/(n.radii.y+t),r.z=this._cameraPosition.z/(n.radii.z+t),r.x*r.x+r.y*r.y+r.z*r.z-1):(r=this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared),isScaledSpacePointVisible(e,r,i)},EllipsoidalOccluder.prototype.computeHorizonCullingPoint=function(e,t,i){return computeHorizonCullingPointFromPositions(this._ellipsoid,e,t,i)};var scratchEllipsoidShrunk=Ellipsoid.clone(Ellipsoid.UNIT_SPHERE);EllipsoidalOccluder.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(e,t,i,r){return computeHorizonCullingPointFromPositions(getPossiblyShrunkEllipsoid(this._ellipsoid,i,scratchEllipsoidShrunk),e,t,r)},EllipsoidalOccluder.prototype.computeHorizonCullingPointFromVertices=function(e,t,i,r,n){return computeHorizonCullingPointFromVertices(this._ellipsoid,e,t,i,r,n)},EllipsoidalOccluder.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(e,t,i,r,n,a){return computeHorizonCullingPointFromVertices(getPossiblyShrunkEllipsoid(this._ellipsoid,n,scratchEllipsoidShrunk),e,t,i,r,a)};var subsampleScratch=[];EllipsoidalOccluder.prototype.computeHorizonCullingPointFromRectangle=function(e,t,i){var r=Rectangle.subsample(e,t,0,subsampleScratch),n=BoundingSphere.fromPoints(r);if(!(Cartesian3.magnitude(n.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(n.center,r,i)};var scratchEllipsoidShrunkRadii=new Cartesian3;function getPossiblyShrunkEllipsoid(e,t,i){if(defined(t)&&t<0&&e.minimumRadius>-t){var r=Cartesian3.fromElements(e.radii.x+t,e.radii.y+t,e.radii.z+t,scratchEllipsoidShrunkRadii);e=Ellipsoid.fromCartesian3(r,i)}return e}function computeHorizonCullingPointFromPositions(e,t,i,r){defined(r)||(r=new Cartesian3);for(var n=computeScaledSpaceDirectionToPoint(e,t),a=0,o=0,s=i.length;on)}var scaledSpaceScratch=new Cartesian3,directionScratch=new Cartesian3;function computeMagnitude(e,t,i){var r=e.transformPositionToScaledSpace(t,scaledSpaceScratch),n=Cartesian3.magnitudeSquared(r),a=Math.sqrt(n),o=Cartesian3.divideByScalar(r,a,directionScratch);n=Math.max(1,n);var s=1/(a=Math.max(1,a));return 1/(Cartesian3.dot(o,i)*s-Cartesian3.magnitude(Cartesian3.cross(o,i,o))*(Math.sqrt(n-1)*s))}function magnitudeToPoint(e,t,i){if(!(t<=0||t===1/0||t!=t))return Cartesian3.multiplyByScalar(e,t,i)}var directionToPointScratch=new Cartesian3;function computeScaledSpaceDirectionToPoint(e,t){return Cartesian3.equals(t,Cartesian3.ZERO)?t:(e.transformPositionToScaledSpace(t,directionToPointScratch),Cartesian3.normalize(directionToPointScratch,directionToPointScratch))}function DistanceDisplayCondition(e,t){e=defaultValue(e,0),this._near=e,t=defaultValue(t,Number.MAX_VALUE),this._far=t}function NearFarScalar(e,t,i,r){this.near=defaultValue(e,0),this.nearValue=defaultValue(t,0),this.far=defaultValue(i,1),this.farValue=defaultValue(r,0)}Object.defineProperties(DistanceDisplayCondition.prototype,{near:{get:function(){return this._near},set:function(e){this._near=e}},far:{get:function(){return this._far},set:function(e){this._far=e}}}),DistanceDisplayCondition.packedLength=2,DistanceDisplayCondition.pack=function(e,t,i){return i=defaultValue(i,0),t[i++]=e.near,t[i]=e.far,t},DistanceDisplayCondition.unpack=function(e,t,i){return t=defaultValue(t,0),defined(i)||(i=new DistanceDisplayCondition),i.near=e[t++],i.far=e[t],i},DistanceDisplayCondition.equals=function(e,t){return e===t||defined(e)&&defined(t)&&e.near===t.near&&e.far===t.far},DistanceDisplayCondition.clone=function(e,t){if(defined(e))return defined(t)||(t=new DistanceDisplayCondition),t.near=e.near,t.far=e.far,t},DistanceDisplayCondition.prototype.clone=function(e){return DistanceDisplayCondition.clone(this,e)},DistanceDisplayCondition.prototype.equals=function(e){return DistanceDisplayCondition.equals(this,e)},NearFarScalar.clone=function(e,t){if(defined(e))return defined(t)?(t.near=e.near,t.nearValue=e.nearValue,t.far=e.far,t.farValue=e.farValue,t):new NearFarScalar(e.near,e.nearValue,e.far,e.farValue)},NearFarScalar.packedLength=4,NearFarScalar.pack=function(e,t,i){return i=defaultValue(i,0),t[i++]=e.near,t[i++]=e.nearValue,t[i++]=e.far,t[i]=e.farValue,t},NearFarScalar.unpack=function(e,t,i){return t=defaultValue(t,0),defined(i)||(i=new NearFarScalar),i.near=e[t++],i.nearValue=e[t++],i.far=e[t++],i.farValue=e[t],i},NearFarScalar.equals=function(e,t){return e===t||defined(e)&&defined(t)&&e.near===t.near&&e.nearValue===t.nearValue&&e.far===t.far&&e.farValue===t.farValue},NearFarScalar.prototype.clone=function(e){return NearFarScalar.clone(this,e)},NearFarScalar.prototype.equals=function(e){return NearFarScalar.equals(this,e)};var HeightReference={NONE:0,CLAMP_TO_GROUND:1,RELATIVE_TO_GROUND:2},HeightReference$1=Object.freeze(HeightReference),HorizontalOrigin={CENTER:0,LEFT:1,RIGHT:-1},HorizontalOrigin$1=Object.freeze(HorizontalOrigin),SceneMode={MORPHING:0,COLUMBUS_VIEW:1,SCENE2D:2,SCENE3D:3,getMorphTime:function(e){return e===SceneMode.SCENE3D?1:e!==SceneMode.MORPHING?0:void 0}},SceneMode$1=Object.freeze(SceneMode);function Plane(e,t){this.normal=Cartesian3.clone(e),this.distance=t}Plane.fromPointNormal=function(e,t,i){var r=-Cartesian3.dot(t,e);return defined(i)?(Cartesian3.clone(t,i.normal),i.distance=r,i):new Plane(t,r)};var scratchNormal=new Cartesian3;Plane.fromCartesian4=function(e,t){var i=Cartesian3.fromCartesian4(e,scratchNormal),r=e.w;return defined(t)?(Cartesian3.clone(i,t.normal),t.distance=r,t):new Plane(i,r)},Plane.getPointDistance=function(e,t){return Cartesian3.dot(e.normal,t)+e.distance};var scratchCartesian$1=new Cartesian3;Plane.projectPointOntoPlane=function(e,t,i){defined(i)||(i=new Cartesian3);var r=Plane.getPointDistance(e,t),n=Cartesian3.multiplyByScalar(e.normal,r,scratchCartesian$1);return Cartesian3.subtract(t,n,i)};var scratchPosition=new Cartesian3;function CullingVolume(e){this.planes=defaultValue(e,[])}Plane.transform=function(e,t,i){return Matrix4.multiplyByPointAsVector(t,e.normal,scratchNormal),Cartesian3.normalize(scratchNormal,scratchNormal),Cartesian3.multiplyByScalar(e.normal,-e.distance,scratchPosition),Matrix4.multiplyByPoint(t,scratchPosition,scratchPosition),Plane.fromPointNormal(scratchPosition,scratchNormal,i)},Plane.clone=function(e,t){return defined(t)?(Cartesian3.clone(e.normal,t.normal),t.distance=e.distance,t):new Plane(e.normal,e.distance)},Plane.equals=function(e,t){return e.distance===t.distance&&Cartesian3.equals(e.normal,t.normal)},Plane.ORIGIN_XY_PLANE=Object.freeze(new Plane(Cartesian3.UNIT_Z,0)),Plane.ORIGIN_YZ_PLANE=Object.freeze(new Plane(Cartesian3.UNIT_X,0)),Plane.ORIGIN_ZX_PLANE=Object.freeze(new Plane(Cartesian3.UNIT_Y,0));var faces=[new Cartesian3,new Cartesian3,new Cartesian3];Cartesian3.clone(Cartesian3.UNIT_X,faces[0]),Cartesian3.clone(Cartesian3.UNIT_Y,faces[1]),Cartesian3.clone(Cartesian3.UNIT_Z,faces[2]);var scratchPlaneCenter=new Cartesian3,scratchPlaneNormal=new Cartesian3,scratchPlane=new Plane(new Cartesian3(1,0,0),0);function OrthographicOffCenterFrustum(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this.left=e.left,this._left=void 0,this.right=e.right,this._right=void 0,this.top=e.top,this._top=void 0,this.bottom=e.bottom,this._bottom=void 0,this.near=defaultValue(e.near,1),this._near=this.near,this.far=defaultValue(e.far,5e8),this._far=this.far,this._cullingVolume=new CullingVolume,this._orthographicMatrix=new Matrix4}function update(e){e.top===e._top&&e.bottom===e._bottom&&e.left===e._left&&e.right===e._right&&e.near===e._near&&e.far===e._far||(e._left=e.left,e._right=e.right,e._top=e.top,e._bottom=e.bottom,e._near=e.near,e._far=e.far,e._orthographicMatrix=Matrix4.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix))}CullingVolume.fromBoundingSphere=function(e,t){defined(t)||(t=new CullingVolume);var i=faces.length,r=t.planes;r.length=2*i;for(var n=e.center,a=e.radius,o=0,s=0;s=t?"":Array(1+t-e.length>>>0).join(i);return r?e+n:n+e}function C(e,t,i,r,n,a){var o=r-e.length;return 0>>0;return e=(i=i&&s&&{2:"0b",8:"0",16:"0x"}[t]||"")+_(s.toString(t),a||0,"0",!1),C(e,i,r,n,o)}function b(e,t,i,r,n,a){return null!=r&&(e=e.slice(0,r)),C(e,"",t,i,n,a)}var A=arguments,S=0,e=A[S++];return e.replace(/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,function(e,t,i,r,n,a,o){var s,l,u,c,d;if("%%"==e)return"%";for(var h=!1,p="",f=!1,m=!1,g=" ",y=i.length,v=0;i&&v=t.length&&(i=t.length-1);var r=t[i].offset;0=i.length)return JulianDate.addSeconds(e,-i[r-1].offset,t);var n=JulianDate.secondsDifference(i[r].julianDate,e);return 0===n?JulianDate.addSeconds(e,-i[r].offset,t):n<=1?void 0:JulianDate.addSeconds(e,-i[--r].offset,t)}function setComponents(e,t,i){var r=t/TimeConstants$1.SECONDS_PER_DAY|0;return e+=r,(t-=TimeConstants$1.SECONDS_PER_DAY*r)<0&&(e--,t+=TimeConstants$1.SECONDS_PER_DAY),i.dayNumber=e,i.secondsOfDay=t,i}function computeJulianDateComponents(e,t,i,r,n,a,o){var s=(t-14)/12|0,l=e+4800+s,u=(1461*l/4|0)+(367*(t-2-12*s)/12|0)-(3*((l+100)/100|0)/4|0)+i-32075;(r-=12)<0&&(r+=24);var c=a+(r*TimeConstants$1.SECONDS_PER_HOUR+n*TimeConstants$1.SECONDS_PER_MINUTE+o*TimeConstants$1.SECONDS_PER_MILLISECOND);return 43200<=c&&(u-=1),[u,c]}var matchCalendarYear=/^(\d{4})$/,matchCalendarMonth=/^(\d{4})-(\d{2})$/,matchOrdinalDate=/^(\d{4})-?(\d{3})$/,matchWeekDate=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,matchCalendarDate=/^(\d{4})-?(\d{2})-?(\d{2})$/,utcOffset=/([Z+\-])?(\d{2})?:?(\d{2})?$/,matchHours=/^(\d{2})(\.\d+)?/.source+utcOffset.source,matchHoursMinutes=/^(\d{2}):?(\d{2})(\.\d+)?/.source+utcOffset.source,matchHoursMinutesSeconds=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+utcOffset.source;function JulianDate(e,t,i){this.dayNumber=void 0,this.secondsOfDay=void 0,e=defaultValue(e,0),t=defaultValue(t,0),i=defaultValue(i,TimeStandard$1.UTC);var r=0|e;setComponents(r,t+=(e-r)*TimeConstants$1.SECONDS_PER_DAY,this),i===TimeStandard$1.UTC&&convertUtcToTai(this)}JulianDate.fromGregorianDate=function(e,t){var i=computeJulianDateComponents(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return defined(t)?(setComponents(i[0],i[1],t),convertUtcToTai(t),t):new JulianDate(i[0],i[1],TimeStandard$1.UTC)},JulianDate.fromDate=function(e,t){var i=computeJulianDateComponents(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return defined(t)?(setComponents(i[0],i[1],t),convertUtcToTai(t),t):new JulianDate(i[0],i[1],TimeStandard$1.UTC)},JulianDate.fromIso8601=function(e,t){var i,r,n,a,o=(e=e.replace(",",".")).split("T"),s=1,l=1,u=0,c=0,d=0,h=0,p=o[0],f=o[1];if(null!==(o=p.match(matchCalendarDate)))i=+o[1],s=+o[2],l=+o[3];else if(null!==(o=p.match(matchCalendarMonth)))i=+o[1],s=+o[2];else if(null!==(o=p.match(matchCalendarYear)))i=+o[1];else{var m;if(null!==(o=p.match(matchOrdinalDate)))i=+o[1],m=+o[2],n=isLeapYear(i);else if(null!==(o=p.match(matchWeekDate)))i=+o[1],m=7*+o[2]+(+o[3]||0)-new Date(Date.UTC(i,0,4)).getUTCDay()-3;(r=new Date(Date.UTC(i,0,1))).setUTCDate(m),s=r.getUTCMonth()+1,l=r.getUTCDate()}if(n=isLeapYear(i),defined(f)){null!==(o=f.match(matchHoursMinutesSeconds))?(u=+o[1],c=+o[2],d=+o[3],h=1e3*+(o[4]||0),a=5):null!==(o=f.match(matchHoursMinutes))?(u=+o[1],c=+o[2],d=60*+(o[3]||0),a=4):null!==(o=f.match(matchHours))&&(u=+o[1],c=60*+(o[2]||0),a=3);var g=o[a],y=+o[a+1],v=+(o[a+2]||0);switch(g){case"+":u-=y,c-=v;break;case"-":u+=y,c+=v;break;case"Z":break;default:c+=new Date(Date.UTC(i,s-1,l,u,c)).getTimezoneOffset()}}var _=60===d;for(_&&d--;60<=c;)c-=60,u++;for(;24<=u;)u-=24,l++;for(r=n&&2===s?daysInLeapFeburary:daysInMonth[s-1];rt.length-1)return o.xPoleWander=0,o.yPoleWander=0,o.xPoleOffset=0,o.yPoleOffset=0,o.ut1MinusUtc=0,o;var l=t[n],u=t[a];if(l.equals(u)||r.equals(l))return fillResultFromIndex(e,i,n,s,o),o;if(r.equals(u))return fillResultFromIndex(e,i,a,s,o),o;var c=JulianDate.secondsDifference(r,l)/JulianDate.secondsDifference(u,l),d=n*s,h=a*s,p=i[d+e._ut1MinusUtcSecondsColumn],f=i[h+e._ut1MinusUtcSecondsColumn],m=f-p;if(.5=this._totalSamples&&(s=this._totalSamples-1);for(var l=o/this._samplesPerXysFile|0,u=s/this._samplesPerXysFile|0,c=[],d=l;d<=u;++d)c.push(requestXysChunk(this,d));return when.all(c)},Iau2006XysData.prototype.computeXysRadians=function(e,t,i){var r=getDaysSinceEpoch(this,e,t);if(!(r<0)){var n=r/this._stepSizeDays|0;if(!(n>=this._totalSamples)){var a=this._interpolationOrder,o=n-(a/2|0);o<0&&(o=0);var s=o+a;s>=this._totalSamples&&(o=(s=this._totalSamples-1)-a)<0&&(o=0);var l=!1,u=this._samples;if(defined(u[3*o])||(requestXysChunk(this,o/this._samplesPerXysFile|0),l=!0),defined(u[3*s])||(requestXysChunk(this,s/this._samplesPerXysFile|0),l=!0),!l){defined(i)?(i.x=0,i.y=0,i.s=0):i=new Iau2006XysSample(0,0,0);var c,d,h=r-o*this._stepSizeDays,p=this._work,f=this._denominators,m=this._coef,g=this._xTable;for(c=0;c<=a;++c)p[c]=h-g[c];for(c=0;c<=a;++c){for(m[c]=1,d=0;d<=a;++d)d!==c&&(m[c]*=p[d]);m[c]*=f[c];var y=3*(o+c);i.x+=m[c]*u[y++],i.y+=m[c]*u[y++],i.s+=m[c]*u[y]}return i}}}};var fromAxisAngleScratch=new Cartesian3;Quaternion.fromAxisAngle=function(e,t,i){var r=t/2,n=Math.sin(r),a=(fromAxisAngleScratch=Cartesian3.normalize(e,fromAxisAngleScratch)).x*n,o=fromAxisAngleScratch.y*n,s=fromAxisAngleScratch.z*n,l=Math.cos(r);return defined(i)?(i.x=a,i.y=o,i.z=s,i.w=l,i):new Quaternion(a,o,s,l)};var fromRotationMatrixNext=[1,2,0],fromRotationMatrixQuat=new Array(3);Quaternion.fromRotationMatrix=function(e,t){var i,r,n,a,o,s=e[Matrix3.COLUMN0ROW0],l=e[Matrix3.COLUMN1ROW1],u=e[Matrix3.COLUMN2ROW2],c=s+l+u;if(0=o.clientWidth)u=!0;else{if(_.x>.5*o.clientWidth){s.width=_.x,l.frustum.right=h.x-y,positionCC=worldToClip(a,i,l,positionCC),SceneTransforms.clipToGLWindowCoordinates(s,positionCC,scratchWindowCoord0),s.x+=_.x,l.position.x=-l.position.x;var C=l.frustum.right;l.frustum.right=-l.frustum.left,l.frustum.left=-C,positionCC=worldToClip(a,i,l,positionCC),SceneTransforms.clipToGLWindowCoordinates(s,positionCC,scratchWindowCoord1)}else{s.x+=_.x,s.width-=_.x,l.frustum.left=-h.x-y,positionCC=worldToClip(a,i,l,positionCC),SceneTransforms.clipToGLWindowCoordinates(s,positionCC,scratchWindowCoord0),s.x=s.x-s.width,l.position.x=-l.position.x;var x=l.frustum.left;l.frustum.left=-l.frustum.right,l.frustum.right=-x,positionCC=worldToClip(a,i,l,positionCC),SceneTransforms.clipToGLWindowCoordinates(s,positionCC,scratchWindowCoord1)}Cartesian3.clone(p,l.position),l.frustum=f.clone(),((r=Cartesian2.clone(scratchWindowCoord0,r)).x<0||r.x>o.clientWidth)&&(r.x=scratchWindowCoord1.x)}}if(n.mode!==SceneMode$1.SCENE2D||u){if((positionCC=worldToClip(a,i,l,positionCC)).z<0&&!(l.frustum instanceof OrthographicFrustum)&&!(l.frustum instanceof OrthographicOffCenterFrustum))return;r=SceneTransforms.clipToGLWindowCoordinates(s,positionCC,r)}return r.y=o.clientHeight-r.y,r}},SceneTransforms.wgs84ToDrawingBufferCoordinates=function(e,t,i){if(defined(i=SceneTransforms.wgs84ToWindowCoordinates(e,t,i)))return SceneTransforms.transformWindowToDrawingBuffer(e,i,i)};var projectedPosition=new Cartesian3,positionInCartographic=new Cartographic;SceneTransforms.computeActualWgs84Position=function(e,t,i){var r=e.mode;if(r===SceneMode$1.SCENE3D)return Cartesian3.clone(t,i);var n=e.mapProjection,a=n.ellipsoid.cartesianToCartographic(t,positionInCartographic);if(defined(a)){if(n.project(a,projectedPosition),r===SceneMode$1.COLUMBUS_VIEW)return Cartesian3.fromElements(projectedPosition.z,projectedPosition.x,projectedPosition.y,i);if(r===SceneMode$1.SCENE2D)return Cartesian3.fromElements(0,projectedPosition.x,projectedPosition.y,i);var o=e.morphTime;return Cartesian3.fromElements(CesiumMath.lerp(projectedPosition.z,t.x,o),CesiumMath.lerp(projectedPosition.x,t.y,o),CesiumMath.lerp(projectedPosition.y,t.z,o),i)}};var positionNDC=new Cartesian3,positionWC=new Cartesian3,viewportTransform=new Matrix4;SceneTransforms.clipToGLWindowCoordinates=function(e,t,i){return Cartesian3.divideByScalar(t,t.w,positionNDC),Matrix4.computeViewportTransformation(e,0,1,viewportTransform),Matrix4.multiplyByPoint(viewportTransform,positionNDC,positionWC),Cartesian2.fromCartesian3(positionWC,i)},SceneTransforms.transformWindowToDrawingBuffer=function(e,t,i){var r=e.canvas,n=e.drawingBufferWidth/r.clientWidth,a=e.drawingBufferHeight/r.clientHeight;return Cartesian2.fromElements(t.x*n,t.y*a,i)};var scratchNDC=new Cartesian4,scratchWorldCoords=new Cartesian4;SceneTransforms.drawingBufferToWgs84Coordinates=function(e,t,i,r){var n=e.context.uniformState,a=n.currentFrustum,o=a.x,s=a.y;if(e.frameState.useLogDepth){var l=i*n.log2FarDepthFromNearPlusOne;i=s*(1-o/(Math.pow(2,l)-1+o))/(s-o)}var u,c=e.view.passState.viewport,d=Cartesian4.clone(Cartesian4.UNIT_W,scratchNDC);d.x=(t.x-c.x)/c.width*2-1,d.y=(t.y-c.y)/c.height*2-1,d.z=2*i-1,d.w=1;var h=e.camera.frustum;if(defined(h.fovy)){var p=1/(u=Matrix4.multiplyByVector(n.inverseViewProjection,d,scratchWorldCoords)).w;Cartesian3.multiplyByScalar(u,p,u)}else defined(h._offCenterFrustum)&&(h=h._offCenterFrustum),(u=scratchWorldCoords).x=.5*(d.x*(h.right-h.left)+h.left+h.right),u.y=.5*(d.y*(h.top-h.bottom)+h.bottom+h.top),u.z=.5*(d.z*(o-s)-o-s),u.w=1,u=Matrix4.multiplyByVector(n.inverseView,u,u);return Cartesian3.fromCartesian4(u,r)};var VerticalOrigin={CENTER:0,BOTTOM:1,BASELINE:2,TOP:-1},VerticalOrigin$1=Object.freeze(VerticalOrigin);function Billboard(e,t){var i=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).translucencyByDistance,r=e.pixelOffsetScaleByDistance,n=e.scaleByDistance,a=e.distanceDisplayCondition;defined(i)&&(i=NearFarScalar.clone(i)),defined(r)&&(r=NearFarScalar.clone(r)),defined(n)&&(n=NearFarScalar.clone(n)),defined(a)&&(a=DistanceDisplayCondition.clone(a)),this._show=defaultValue(e.show,!0),this._position=Cartesian3.clone(defaultValue(e.position,Cartesian3.ZERO)),this._actualPosition=Cartesian3.clone(this._position),this._pixelOffset=Cartesian2.clone(defaultValue(e.pixelOffset,Cartesian2.ZERO)),this._translate=new Cartesian2(0,0),this._eyeOffset=Cartesian3.clone(defaultValue(e.eyeOffset,Cartesian3.ZERO)),this._heightReference=defaultValue(e.heightReference,HeightReference$1.NONE),this._verticalOrigin=defaultValue(e.verticalOrigin,VerticalOrigin$1.CENTER),this._horizontalOrigin=defaultValue(e.horizontalOrigin,HorizontalOrigin$1.CENTER),this._scale=defaultValue(e.scale,1),this._color=Color.clone(defaultValue(e.color,Color.WHITE)),this._rotation=defaultValue(e.rotation,0),this._alignedAxis=Cartesian3.clone(defaultValue(e.alignedAxis,Cartesian3.ZERO)),this._width=e.width,this._height=e.height,this._scaleByDistance=n,this._translucencyByDistance=i,this._pixelOffsetScaleByDistance=r,this._sizeInMeters=defaultValue(e.sizeInMeters,!1),this._distanceDisplayCondition=a,this._disableDepthTestDistance=e.disableDepthTestDistance,this._id=e.id,this._collection=defaultValue(e.collection,t),this._pickId=void 0,this._pickPrimitive=defaultValue(e._pickPrimitive,this),this._billboardCollection=t,this._dirty=!1,this._index=-1,this._batchIndex=void 0,this._imageIndex=-1,this._imageIndexPromise=void 0,this._imageId=void 0,this._image=void 0,this._imageSubRegion=void 0,this._imageWidth=void 0,this._imageHeight=void 0,this._labelDimensions=void 0,this._labelHorizontalOrigin=void 0,this._labelTranslate=void 0;var o=e.image,s=e.imageId;defined(o)&&(defined(s)||(s="string"==typeof o?o:defined(o.src)?o.src:createGuid()),this._imageId=s,this._image=o),defined(e.imageSubRegion)&&(this._imageId=s,this._imageSubRegion=e.imageSubRegion),defined(this._billboardCollection._textureAtlas)&&this._loadImage(),this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=SceneMode$1.SCENE3D,this._clusterShow=!0,this._outlineColor=Color.clone(defaultValue(e.outlineColor,Color.BLACK)),this._outlineWidth=defaultValue(e.outlineWidth,0),this._updateClamping()}var SHOW_INDEX=Billboard.SHOW_INDEX=0,POSITION_INDEX=Billboard.POSITION_INDEX=1,PIXEL_OFFSET_INDEX=Billboard.PIXEL_OFFSET_INDEX=2,EYE_OFFSET_INDEX=Billboard.EYE_OFFSET_INDEX=3,HORIZONTAL_ORIGIN_INDEX=Billboard.HORIZONTAL_ORIGIN_INDEX=4,VERTICAL_ORIGIN_INDEX=Billboard.VERTICAL_ORIGIN_INDEX=5,SCALE_INDEX=Billboard.SCALE_INDEX=6,IMAGE_INDEX_INDEX=Billboard.IMAGE_INDEX_INDEX=7,COLOR_INDEX=Billboard.COLOR_INDEX=8,ROTATION_INDEX=Billboard.ROTATION_INDEX=9,ALIGNED_AXIS_INDEX=Billboard.ALIGNED_AXIS_INDEX=10,SCALE_BY_DISTANCE_INDEX=Billboard.SCALE_BY_DISTANCE_INDEX=11,TRANSLUCENCY_BY_DISTANCE_INDEX=Billboard.TRANSLUCENCY_BY_DISTANCE_INDEX=12,PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=Billboard.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13,DISTANCE_DISPLAY_CONDITION=Billboard.DISTANCE_DISPLAY_CONDITION=14,DISABLE_DEPTH_DISTANCE=Billboard.DISABLE_DEPTH_DISTANCE=15;Billboard.TEXTURE_COORDINATE_BOUNDS=16;var SDF_INDEX=Billboard.SDF_INDEX=17;function makeDirty(e,t){var i=e._billboardCollection;defined(i)&&(i._updateBillboard(e,t),e._dirty=!0)}Billboard.NUMBER_OF_PROPERTIES=18,Object.defineProperties(Billboard.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,makeDirty(this,SHOW_INDEX))}},position:{get:function(){return this._position},set:function(e){var t=this._position;Cartesian3.equals(t,e)||(Cartesian3.clone(e,t),Cartesian3.clone(e,this._actualPosition),this._updateClamping(),makeDirty(this,POSITION_INDEX))}},heightReference:{get:function(){return this._heightReference},set:function(e){e!==this._heightReference&&(this._heightReference=e,this._updateClamping(),makeDirty(this,POSITION_INDEX))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){var t=this._pixelOffset;Cartesian2.equals(t,e)||(Cartesian2.clone(e,t),makeDirty(this,PIXEL_OFFSET_INDEX))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){var t=this._scaleByDistance;NearFarScalar.equals(t,e)||(this._scaleByDistance=NearFarScalar.clone(e,t),makeDirty(this,SCALE_BY_DISTANCE_INDEX))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){var t=this._translucencyByDistance;NearFarScalar.equals(t,e)||(this._translucencyByDistance=NearFarScalar.clone(e,t),makeDirty(this,TRANSLUCENCY_BY_DISTANCE_INDEX))}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){var t=this._pixelOffsetScaleByDistance;NearFarScalar.equals(t,e)||(this._pixelOffsetScaleByDistance=NearFarScalar.clone(e,t),makeDirty(this,PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX))}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){var t=this._eyeOffset;Cartesian3.equals(t,e)||(Cartesian3.clone(e,t),makeDirty(this,EYE_OFFSET_INDEX))}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,makeDirty(this,HORIZONTAL_ORIGIN_INDEX))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin!==e&&(this._verticalOrigin=e,makeDirty(this,VERTICAL_ORIGIN_INDEX))}},scale:{get:function(){return this._scale},set:function(e){this._scale!==e&&(this._scale=e,makeDirty(this,SCALE_INDEX))}},color:{get:function(){return this._color},set:function(e){var t=this._color;Color.equals(t,e)||(Color.clone(e,t),makeDirty(this,COLOR_INDEX))}},rotation:{get:function(){return this._rotation},set:function(e){this._rotation!==e&&(this._rotation=e,makeDirty(this,ROTATION_INDEX))}},alignedAxis:{get:function(){return this._alignedAxis},set:function(e){var t=this._alignedAxis;Cartesian3.equals(t,e)||(Cartesian3.clone(e,t),makeDirty(this,ALIGNED_AXIS_INDEX))}},width:{get:function(){return defaultValue(this._width,this._imageWidth)},set:function(e){this._width!==e&&(this._width=e,makeDirty(this,IMAGE_INDEX_INDEX))}},height:{get:function(){return defaultValue(this._height,this._imageHeight)},set:function(e){this._height!==e&&(this._height=e,makeDirty(this,IMAGE_INDEX_INDEX))}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters!==e&&(this._sizeInMeters=e,makeDirty(this,COLOR_INDEX))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){DistanceDisplayCondition.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=DistanceDisplayCondition.clone(e,this._distanceDisplayCondition),makeDirty(this,DISTANCE_DISPLAY_CONDITION))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,makeDirty(this,DISABLE_DEPTH_DISTANCE))}},id:{get:function(){return this._id},set:function(e){this._id=e,defined(this._pickId)&&(this._pickId.object.id=e)}},pickPrimitive:{get:function(){return this._pickPrimitive},set:function(e){this._pickPrimitive=e,defined(this._pickId)&&(this._pickId.object.primitive=e)}},pickId:{get:function(){return this._pickId}},image:{get:function(){return this._imageId},set:function(e){defined(e)?"string"==typeof e?this.setImage(e,e):e instanceof Resource?this.setImage(e.url,e):defined(e.src)?this.setImage(e.src,e):this.setImage(createGuid(),e):(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=void 0,this._image=void 0,this._imageIndexPromise=void 0,makeDirty(this,IMAGE_INDEX_INDEX))}},ready:{get:function(){return-1!==this._imageIndex}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=Cartesian3.clone(e,this._actualClampedPosition),makeDirty(this,POSITION_INDEX)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,makeDirty(this,SHOW_INDEX))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){var t=this._outlineColor;Color.equals(t,e)||(Color.clone(e,t),makeDirty(this,SDF_INDEX))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,makeDirty(this,SDF_INDEX))}}}),Billboard.prototype.getPickId=function(e){return defined(this._pickId)||(this._pickId=e.createPickId({primitive:this._pickPrimitive,collection:this._collection,id:this._id})),this._pickId},Billboard.prototype._updateClamping=function(){Billboard._updateClamping(this._billboardCollection,this)};var scratchCartographic$1=new Cartographic,scratchPosition$1=new Cartesian3;Billboard._updateClamping=function(e,i){var t=e._scene;if(defined(t)&&defined(t.globe)){var r=t.globe,n=r.ellipsoid,a=r._surface,o=t.frameState.mode,s=o!==i._mode;if(i._mode=o,(i._heightReference===HeightReference$1.NONE||s)&&defined(i._removeCallbackFunc)&&(i._removeCallbackFunc(),i._removeCallbackFunc=void 0,i._clampedPosition=void 0),i._heightReference!==HeightReference$1.NONE&&defined(i._position)){var l=n.cartesianToCartographic(i._position);if(defined(l)){defined(i._removeCallbackFunc)&&i._removeCallbackFunc(),i._removeCallbackFunc=a.updateHeight(l,c),Cartographic.clone(l,scratchCartographic$1);var u=r.getHeight(l);defined(u)&&(scratchCartographic$1.height=u),n.cartographicToCartesian(scratchCartographic$1,scratchPosition$1),c(scratchPosition$1)}else i._actualClampedPosition=void 0}}function c(e){if(i._heightReference===HeightReference$1.RELATIVE_TO_GROUND)if(i._mode===SceneMode$1.SCENE3D){var t=n.cartesianToCartographic(e,scratchCartographic$1);t.height+=l.height,n.cartographicToCartesian(t,e)}else e.x+=l.height;i._clampedPosition=Cartesian3.clone(e,i._clampedPosition)}},Billboard.prototype._loadImage=function(){var e,i=this._billboardCollection._textureAtlas,r=this._imageId,n=this._image,a=this._imageSubRegion;if(defined(n)&&(e=i.addImage(r,n)),defined(a)&&(e=i.addSubRegion(r,a)),defined(this._imageIndexPromise=e)){var o=this;e.then(function(e){if(o._imageId===r&&o._image===n&&BoundingRectangle.equals(o._imageSubRegion,a)){var t=i.textureCoordinates[e];o._imageWidth=i.texture.width*t.width,o._imageHeight=i.texture.height*t.height,o._imageIndex=e,o._ready=!0,o._image=void 0,o._imageIndexPromise=void 0,makeDirty(o,IMAGE_INDEX_INDEX)}}).otherwise(function(e){console.error("Error loading image for billboard: "+e),o._imageIndexPromise=void 0})}},Billboard.prototype.setImage=function(e,t){this._imageId!==e&&(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=e,this._image=t,defined(this._billboardCollection._textureAtlas)&&this._loadImage())},Billboard.prototype.setImageSubRegion=function(e,t){this._imageId===e&&BoundingRectangle.equals(this._imageSubRegion,t)||(this._imageIndex=-1,this._imageId=e,this._imageSubRegion=BoundingRectangle.clone(t),defined(this._billboardCollection._textureAtlas)&&this._loadImage())},Billboard.prototype._setTranslate=function(e){var t=this._translate;Cartesian2.equals(t,e)||(Cartesian2.clone(e,t),makeDirty(this,PIXEL_OFFSET_INDEX))},Billboard.prototype._getActualPosition=function(){return defined(this._clampedPosition)?this._clampedPosition:this._actualPosition},Billboard.prototype._setActualPosition=function(e){defined(this._clampedPosition)||Cartesian3.clone(e,this._actualPosition),makeDirty(this,POSITION_INDEX)};var tempCartesian3=new Cartesian4;Billboard._computeActualPosition=function(e,t,i,r){return defined(e._clampedPosition)?(i.mode!==e._mode&&e._updateClamping(),e._clampedPosition):i.mode===SceneMode$1.SCENE3D?t:(Matrix4.multiplyByPoint(r,t,tempCartesian3),SceneTransforms.computeActualWgs84Position(i,tempCartesian3))};var scratchCartesian3$1=new Cartesian3;Billboard._computeScreenSpacePosition=function(e,t,i,r,n,a){var o=Matrix4.multiplyByPoint(e,t,scratchCartesian3$1),s=SceneTransforms.wgs84WithEyeOffsetToWindowCoordinates(n,o,i,a);if(defined(s))return Cartesian2.add(s,r,s),s};var scratchPixelOffset=new Cartesian2(0,0);Billboard.prototype.computeScreenSpacePosition=function(e,t){var i=this._billboardCollection;defined(t)||(t=new Cartesian2),Cartesian2.clone(this._pixelOffset,scratchPixelOffset),Cartesian2.add(scratchPixelOffset,this._translate,scratchPixelOffset);var r=i.modelMatrix,n=this._position;if(defined(this._clampedPosition)&&(n=this._clampedPosition,e.mode!==SceneMode$1.SCENE3D)){var a=e.mapProjection,o=a.ellipsoid,s=a.unproject(n,scratchCartographic$1);n=o.cartographicToCartesian(s,scratchCartesian3$1),r=Matrix4.IDENTITY}return Billboard._computeScreenSpacePosition(r,n,this._eyeOffset,scratchPixelOffset,e,t)},Billboard.getScreenSpaceBoundingBox=function(e,t,i){var r=e.width,n=e.height,a=e.scale;r*=a,n*=a;var o=t.x;e.horizontalOrigin===HorizontalOrigin$1.RIGHT?o-=r:e.horizontalOrigin===HorizontalOrigin$1.CENTER&&(o-=.5*r);var s=t.y;return e.verticalOrigin===VerticalOrigin$1.BOTTOM||e.verticalOrigin===VerticalOrigin$1.BASELINE?s-=n:e.verticalOrigin===VerticalOrigin$1.CENTER&&(s-=.5*n),defined(i)||(i=new BoundingRectangle),i.x=o,i.y=s,i.width=r,i.height=n,i},Billboard.prototype.equals=function(e){return this===e||defined(e)&&this._id===e._id&&Cartesian3.equals(this._position,e._position)&&this._imageId===e._imageId&&this._show===e._show&&this._scale===e._scale&&this._verticalOrigin===e._verticalOrigin&&this._horizontalOrigin===e._horizontalOrigin&&this._heightReference===e._heightReference&&BoundingRectangle.equals(this._imageSubRegion,e._imageSubRegion)&&Color.equals(this._color,e._color)&&Cartesian2.equals(this._pixelOffset,e._pixelOffset)&&Cartesian2.equals(this._translate,e._translate)&&Cartesian3.equals(this._eyeOffset,e._eyeOffset)&&NearFarScalar.equals(this._scaleByDistance,e._scaleByDistance)&&NearFarScalar.equals(this._translucencyByDistance,e._translucencyByDistance)&&NearFarScalar.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&DistanceDisplayCondition.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance},Billboard.prototype._destroy=function(){defined(this._customData)&&(this._billboardCollection._scene.globe._surface.removeTileCustomData(this._customData),this._customData=void 0),defined(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this.image=void 0,this._pickId=this._pickId&&this._pickId.destroy(),this._billboardCollection=void 0};var RIGHT_SHIFT=1/256,LEFT_SHIFT=256,AttributeCompression={octEncodeInRange:function(e,t,i){if(i.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),i.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var r=i.x,n=i.y;i.x=(1-Math.abs(n))*CesiumMath.signNotZero(r),i.y=(1-Math.abs(r))*CesiumMath.signNotZero(n)}return i.x=CesiumMath.toSNorm(i.x,t),i.y=CesiumMath.toSNorm(i.y,t),i},octEncode:function(e,t){return AttributeCompression.octEncodeInRange(e,255,t)}},octEncodeScratch=new Cartesian2,uint8ForceArray=new Uint8Array(1);function forceUint8(e){return uint8ForceArray[0]=e,uint8ForceArray[0]}AttributeCompression.octEncodeToCartesian4=function(e,t){return AttributeCompression.octEncodeInRange(e,65535,octEncodeScratch),t.x=forceUint8(octEncodeScratch.x*RIGHT_SHIFT),t.y=forceUint8(octEncodeScratch.x),t.z=forceUint8(octEncodeScratch.y*RIGHT_SHIFT),t.w=forceUint8(octEncodeScratch.y),t},AttributeCompression.octDecodeInRange=function(e,t,i,r){if(r.x=CesiumMath.fromSNorm(e,i),r.y=CesiumMath.fromSNorm(t,i),r.z=1-(Math.abs(r.x)+Math.abs(r.y)),r.z<0){var n=r.x;r.x=(1-Math.abs(r.y))*CesiumMath.signNotZero(n),r.y=(1-Math.abs(n))*CesiumMath.signNotZero(r.y)}return Cartesian3.normalize(r,r)},AttributeCompression.octDecode=function(e,t,i){return AttributeCompression.octDecodeInRange(e,t,255,i)},AttributeCompression.octDecodeFromCartesian4=function(e,t){var i=e.x,r=e.y,n=e.z,a=e.w,o=i*LEFT_SHIFT+r,s=n*LEFT_SHIFT+a;return AttributeCompression.octDecodeInRange(o,s,65535,t)},AttributeCompression.octPackFloat=function(e){return 256*e.x+e.y};var scratchEncodeCart2=new Cartesian2;function zigZagDecode(e){return e>>1^-(1&e)}AttributeCompression.octEncodeFloat=function(e){return AttributeCompression.octEncode(e,scratchEncodeCart2),AttributeCompression.octPackFloat(scratchEncodeCart2)},AttributeCompression.octDecodeFloat=function(e,t){var i=e/256,r=Math.floor(i),n=256*(i-r);return AttributeCompression.octDecode(r,n,t)},AttributeCompression.octPack=function(e,t,i,r){var n=AttributeCompression.octEncodeFloat(e),a=AttributeCompression.octEncodeFloat(t),o=AttributeCompression.octEncode(i,scratchEncodeCart2);return r.x=65536*o.x+n,r.y=65536*o.y+a,r},AttributeCompression.octUnpack=function(e,t,i,r){var n=e.x/65536,a=Math.floor(n),o=65536*(n-a);n=e.y/65536;var s=Math.floor(n),l=65536*(n-s);AttributeCompression.octDecodeFloat(o,t),AttributeCompression.octDecodeFloat(l,i),AttributeCompression.octDecode(a,s,r)},AttributeCompression.compressTextureCoordinates=function(e){return 4096*(4095*e.x|0)+(4095*e.y|0)},AttributeCompression.decompressTextureCoordinates=function(e,t){var i=e/4096,r=Math.floor(i);return t.x=r/4095,t.y=(e-4096*r)/4095,t},AttributeCompression.zigZagDeltaDecode=function(e,t,i){for(var r=e.length,n=0,a=0,o=0,s=0;s=CesiumMath.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},createTypedArrayFromArrayBuffer:function(e,t,i,r){return e>=CesiumMath.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,i,r):new Uint16Array(t,i,r)}},IndexDatatype$1=Object.freeze(IndexDatatype),BufferUsage={STREAM_DRAW:WebGLConstants$1.STREAM_DRAW,STATIC_DRAW:WebGLConstants$1.STATIC_DRAW,DYNAMIC_DRAW:WebGLConstants$1.DYNAMIC_DRAW,validate:function(e){return e===BufferUsage.STREAM_DRAW||e===BufferUsage.STATIC_DRAW||e===BufferUsage.DYNAMIC_DRAW}},BufferUsage$1=Object.freeze(BufferUsage);function Buffer$1(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).context._gl,i=e.bufferTarget,r=e.typedArray,n=e.sizeInBytes,a=e.usage,o=defined(r);o&&(n=r.byteLength);var s=t.createBuffer();t.bindBuffer(i,s),t.bufferData(i,o?r:n,a),t.bindBuffer(i,null),this._gl=t,this._webgl2=e.context._webgl2,this._bufferTarget=i,this._sizeInBytes=n,this._usage=a,this._buffer=s,this.vertexArrayDestroyable=!0}Buffer$1.createVertexBuffer=function(e){return new Buffer$1({context:e.context,bufferTarget:WebGLConstants$1.ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})},Buffer$1.createIndexBuffer=function(e){var t=e.context,i=e.indexDatatype,r=IndexDatatype$1.getSizeInBytes(i),n=new Buffer$1({context:t,bufferTarget:WebGLConstants$1.ELEMENT_ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage}),a=n.sizeInBytes/r;return Object.defineProperties(n,{indexDatatype:{get:function(){return i}},bytesPerIndex:{get:function(){return r}},numberOfIndices:{get:function(){return a}}}),n},Object.defineProperties(Buffer$1.prototype,{sizeInBytes:{get:function(){return this._sizeInBytes}},usage:{get:function(){return this._usage}}}),Buffer$1.prototype._getBuffer=function(){return this._buffer},Buffer$1.prototype.copyFromArrayView=function(e,t){t=defaultValue(t,0);var i=this._gl,r=this._bufferTarget;i.bindBuffer(r,this._buffer),i.bufferSubData(r,t,e),i.bindBuffer(r,null)},Buffer$1.prototype.copyFromBuffer=function(e,t,i,r){var n=WebGLConstants$1.COPY_READ_BUFFER,a=WebGLConstants$1.COPY_WRITE_BUFFER,o=this._gl;o.bindBuffer(a,this._buffer),o.bindBuffer(n,e._buffer),o.copyBufferSubData(n,a,t,i,r),o.bindBuffer(a,null),o.bindBuffer(n,null)},Buffer$1.prototype.getBufferData=function(e,t,i,r){t=defaultValue(t,0),i=defaultValue(i,0);var n=this._gl,a=WebGLConstants$1.COPY_READ_BUFFER;n.bindBuffer(a,this._buffer),n.getBufferSubData(a,t,e,i,r),n.bindBuffer(a,null)},Buffer$1.prototype.isDestroyed=function(){return!1},Buffer$1.prototype.destroy=function(){return this._gl.deleteBuffer(this._buffer),destroyObject(this)};var PrimitiveType={POINTS:WebGLConstants$1.POINTS,LINES:WebGLConstants$1.LINES,LINE_LOOP:WebGLConstants$1.LINE_LOOP,LINE_STRIP:WebGLConstants$1.LINE_STRIP,TRIANGLES:WebGLConstants$1.TRIANGLES,TRIANGLE_STRIP:WebGLConstants$1.TRIANGLE_STRIP,TRIANGLE_FAN:WebGLConstants$1.TRIANGLE_FAN,validate:function(e){return e===PrimitiveType.POINTS||e===PrimitiveType.LINES||e===PrimitiveType.LINE_LOOP||e===PrimitiveType.LINE_STRIP||e===PrimitiveType.TRIANGLES||e===PrimitiveType.TRIANGLE_STRIP||e===PrimitiveType.TRIANGLE_FAN}},PrimitiveType$1=Object.freeze(PrimitiveType);function DrawCommand(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this._boundingVolume=e.boundingVolume,this._orientedBoundingBox=e.orientedBoundingBox,this._cull=defaultValue(e.cull,!0),this._occlude=defaultValue(e.occlude,!0),this._modelMatrix=e.modelMatrix,this._primitiveType=defaultValue(e.primitiveType,PrimitiveType$1.TRIANGLES),this._vertexArray=e.vertexArray,this._count=e.count,this._offset=defaultValue(e.offset,0),this._instanceCount=defaultValue(e.instanceCount,0),this._shaderProgram=e.shaderProgram,this._uniformMap=e.uniformMap,this._renderState=e.renderState,this._framebuffer=e.framebuffer,this._pass=e.pass,this._executeInClosestFrustum=defaultValue(e.executeInClosestFrustum,!1),this._owner=e.owner,this._debugShowBoundingVolume=defaultValue(e.debugShowBoundingVolume,!1),this._debugOverlappingFrustums=0,this._castShadows=defaultValue(e.castShadows,!1),this._receiveShadows=defaultValue(e.receiveShadows,!1),this._receiveTextureProjectionList=defaultValue(e.receiveTextureProjectionList,[]),this._receiveViewShed=defaultValue(e.receiveViewShed,!1),this._pickId=e.pickId,this._pickOnly=defaultValue(e.pickOnly,!1),this.dirty=!0,this.lastDirtyTime=0,this.derivedCommands={}}Object.defineProperties(DrawCommand.prototype,{boundingVolume:{get:function(){return this._boundingVolume},set:function(e){this._boundingVolume!==e&&(this._boundingVolume=e,this.dirty=!0)}},orientedBoundingBox:{get:function(){return this._orientedBoundingBox},set:function(e){this._orientedBoundingBox!==e&&(this._orientedBoundingBox=e,this.dirty=!0)}},cull:{get:function(){return this._cull},set:function(e){this._cull!==e&&(this._cull=e,this.dirty=!0)}},occlude:{get:function(){return this._occlude},set:function(e){this._occlude!==e&&(this._occlude=e,this.dirty=!0)}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix!==e&&(this._modelMatrix=e,this.dirty=!0)}},primitiveType:{get:function(){return this._primitiveType},set:function(e){this._primitiveType!==e&&(this._primitiveType=e,this.dirty=!0)}},vertexArray:{get:function(){return this._vertexArray},set:function(e){this._vertexArray!==e&&(this._vertexArray=e,this.dirty=!0)}},count:{get:function(){return this._count},set:function(e){this._count!==e&&(this._count=e,this.dirty=!0)}},offset:{get:function(){return this._offset},set:function(e){this._offset!==e&&(this._offset=e,this.dirty=!0)}},instanceCount:{get:function(){return this._instanceCount},set:function(e){this._instanceCount!==e&&(this._instanceCount=e,this.dirty=!0)}},shaderProgram:{get:function(){return this._shaderProgram},set:function(e){this._shaderProgram!==e&&(this._shaderProgram=e,this.dirty=!0)}},castShadows:{get:function(){return this._castShadows},set:function(e){this._castShadows!==e&&(this._castShadows=e,this.dirty=!0)}},receiveShadows:{get:function(){return this._receiveShadows},set:function(e){this._receiveShadows!==e&&(this._receiveShadows=e,this.dirty=!0)}},receiveTextureProjectionList:{get:function(){return this._receiveTextureProjectionList},set:function(e){this._receiveTextureProjectionList!==e&&(this._receiveTextureProjectionList=e,this.dirty=!0)}},receiveViewShed:{get:function(){return this._receiveViewShed},set:function(e){this._receiveViewShed!==e&&(this._receiveViewShed=e,this.dirty=!0)}},uniformMap:{get:function(){return this._uniformMap},set:function(e){this._uniformMap!==e&&(this._uniformMap=e,this.dirty=!0)}},renderState:{get:function(){return this._renderState},set:function(e){this._renderState!==e&&(this._renderState=e,this.dirty=!0)}},framebuffer:{get:function(){return this._framebuffer},set:function(e){this._framebuffer!==e&&(this._framebuffer=e,this.dirty=!0)}},pass:{get:function(){return this._pass},set:function(e){this._pass!==e&&(this._pass=e,this.dirty=!0)}},executeInClosestFrustum:{get:function(){return this._executeInClosestFrustum},set:function(e){this._executeInClosestFrustum!==e&&(this._executeInClosestFrustum=e,this.dirty=!0)}},owner:{get:function(){return this._owner},set:function(e){this._owner!==e&&(this._owner=e,this.dirty=!0)}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolume=e,this.dirty=!0)}},debugOverlappingFrustums:{get:function(){return this._debugOverlappingFrustums},set:function(e){this._debugOverlappingFrustums!==e&&(this._debugOverlappingFrustums=e,this.dirty=!0)}},pickId:{get:function(){return this._pickId},set:function(e){this._pickId!==e&&(this._pickId=e,this.dirty=!0)}},pickOnly:{get:function(){return this._pickOnly},set:function(e){this._pickOnly!==e&&(this._pickOnly=e,this.dirty=!0)}}}),DrawCommand.shallowClone=function(e,t){if(defined(e))return defined(t)||(t=new DrawCommand),t._boundingVolume=e._boundingVolume,t._orientedBoundingBox=e._orientedBoundingBox,t._cull=e._cull,t._occlude=e._occlude,t._modelMatrix=e._modelMatrix,t._primitiveType=e._primitiveType,t._vertexArray=e._vertexArray,t._count=e._count,t._offset=e._offset,t._instanceCount=e._instanceCount,t._shaderProgram=e._shaderProgram,t._uniformMap=e._uniformMap,t._renderState=e._renderState,t._framebuffer=e._framebuffer,t._pass=e._pass,t._executeInClosestFrustum=e._executeInClosestFrustum,t._owner=e._owner,t._debugShowBoundingVolume=e._debugShowBoundingVolume,t._debugOverlappingFrustums=e._debugOverlappingFrustums,t._castShadows=e._castShadows,t._receiveShadows=e._receiveShadows,t._pickId=e._pickId,t._pickOnly=e._pickOnly,t._receiveTextureProjectionList=e._receiveTextureProjectionList,t._receiveViewShed=e._receiveViewShed,t.dirty=!0,t.lastDirtyTime=0,t},DrawCommand.prototype.execute=function(e,t){e.draw(this,t)};var Pass={ENVIRONMENT:0,COMPUTE:1,GLOBE:2,TERRAIN_CLASSIFICATION:3,CESIUM_3D_TILE:4,CESIUM_3D_TILE_CLASSIFICATION:5,CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW:6,OPAQUE:7,TRANSLUCENT:8,OVERLAY:9,NUMBER_OF_PASSES:10},Pass$1=Object.freeze(Pass),WindingOrder={CLOCKWISE:WebGLConstants$1.CW,COUNTER_CLOCKWISE:WebGLConstants$1.CCW,validate:function(e){return e===WindingOrder.CLOCKWISE||e===WindingOrder.COUNTER_CLOCKWISE}},WindingOrder$1=Object.freeze(WindingOrder);function freezeRenderState(e){if("object"!=typeof e||null===e)return e;for(var t,i=Object.keys(e),r=0;r=CesiumMath.SIXTY_FOUR_KILOBYTES&&a.elementIndexUint?Buffer$1.createIndexBuffer({context:a,typedArray:new Uint32Array(y),usage:s,indexDatatype:IndexDatatype$1.UNSIGNED_INT}):Buffer$1.createIndexBuffer({context:a,typedArray:new Uint16Array(y),usage:s,indexDatatype:IndexDatatype$1.UNSIGNED_SHORT})),new VertexArray({context:a,attributes:d,indexBuffer:n})},Object.defineProperties(VertexArray.prototype,{numberOfAttributes:{get:function(){return this._attributes.length}},numberOfVertices:{get:function(){return this._numberOfVertices}},indexBuffer:{get:function(){return this._indexBuffer}}}),VertexArray.prototype.getAttribute=function(e){return this._attributes[e]},VertexArray.prototype._bind=function(){defined(this._vao)?(this._context.glBindVertexArray(this._vao),this._context.instancedArrays&&setVertexAttribDivisor(this),this._hasConstantAttributes&&setConstantAttributes(this,this._gl)):bind(this._gl,this._attributes,this._indexBuffer)},VertexArray.prototype._unBind=function(){if(defined(this._vao))this._context.glBindVertexArray(null);else{for(var e=this._attributes,t=this._gl,i=0;i]/,n=[],a="",o=textTypes.LTR,s="",l=e.length,u=0;u";case">":return"<"}}Object.defineProperties(Label.prototype,{show:{get:function(){return this._show},set:function(e){if(this._show!==e){this._show=e;for(var t=this._glyphs,i=0,r=t.length;iu+1?o[u+1].Type===textTypes.RTL?(l=d+l,s=0):(l=spliceWord(l,s,c.Word),s+=c.Word.length):l=spliceWord(l,0,d)):c.Type===textTypes.RTL?l=spliceWord(l,s,d):c.Type===textTypes.LTR?s=(l+=c.Word).length:c.Type!==textTypes.WEAK&&c.Type!==textTypes.BRACKETS||(0u+1?o[u+1].Type===textTypes.RTL?l=spliceWord(l,s,d):s=(l+=c.Word).length:l+=c.Word:s=(l+=c.Word).length)}i+=l,r"+t,document.body.appendChild(c),n.leading=1.2*o;var d=getCSSValue$1(c,"height");if(2*o<=(d=d.replace("px",""))&&(n.leading=d/2|0),document.body.removeChild(c),u)n.ascent=0,n.descent=0,n.bounds={minx:0,maxx:n.width,miny:0,maxy:0},n.height=0;else{var h=document.createElement("canvas");h.width=n.width+100,h.height=3*o,h.style.opacity=1,h.style.fontFamily=a,h.style.fontSize=o,h.style.fontStyle=s,h.style.fontWeight=l;var p=h.getContext("2d");p.font=s+" "+l+" "+o+"px "+a;var f=h.width,m=h.height,g=m/2;p.fillStyle="white",p.fillRect(-1,-1,f+2,m+2),i&&(p.strokeStyle="black",p.lineWidth=e.lineWidth,p.strokeText(t,50,g)),r&&(p.fillStyle="black",p.fillText(t,50,g));for(var y=p.getImageData(0,0,f,m).data,v=0,_=4*f,C=y.length;++v=e.length-1)return e.length;for(var i,r,n=O(l(e,t)),a=[],o=t+1;od&&swapItem(e,t,r,n);hd;)p--}t[2*r+a]===d?swapItem(e,t,r,p):swapItem(e,t,++p,n),p<=i&&(r=p+1),i<=p&&(n=p-1)}}function swapItem(e,t,i,r){swap$1(e,i,r),swap$1(t,2*i,2*r),swap$1(t,2*i+1,2*r+1)}function swap$1(e,t,i){var r=e[t];e[t]=e[i],e[i]=r}function within(e,t,i,r,n,a){for(var o=[0,e.length-1,0],s=[],l=n*n;o.length;){var u=o.pop(),c=o.pop(),d=o.pop();if(c-d<=a)for(var h=d;h<=c;h++)sqDist(t[2*h],t[2*h+1],i,r)<=l&&s.push(e[h]);else{var p=Math.floor((d+c)/2),f=t[2*p],m=t[2*p+1];sqDist(f,m,i,r)<=l&&s.push(e[p]);var g=(u+1)%2;(0===u?i-n<=f:r-n<=m)&&(o.push(d),o.push(p-1),o.push(g)),(0===u?f<=i+n:m<=r+n)&&(o.push(p+1),o.push(c),o.push(g))}}return s}function sqDist(e,t,i,r){var n=e-i,a=t-r;return n*n+a*a}function EntityCluster(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this._enabled=defaultValue(e.enabled,!1),this._pixelRange=defaultValue(e.pixelRange,80),this._minimumClusterSize=defaultValue(e.minimumClusterSize,2),this._clusterBillboards=defaultValue(e.clusterBillboards,!0),this._clusterLabels=defaultValue(e.clusterLabels,!0),this._clusterPoints=defaultValue(e.clusterPoints,!0),this._labelCollection=void 0,this._billboardCollection=void 0,this._pointCollection=void 0,this._clusterBillboardCollection=void 0,this._clusterLabelCollection=void 0,this._clusterPointCollection=void 0,this._collectionIndicesByEntity={},this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._clusterDirty=!1,this._cluster=void 0,this._removeEventListener=void 0,this._clusterEvent=new Event}function getX(e){return e.coord.x}function getY(e){return e.coord.y}function expandBoundingBox(e,t){e.x-=t,e.y-=t,e.width+=2*t,e.height+=2*t}PointPrimitiveCollection.prototype.update=function(e){removePointPrimitives(this),this._maxTotalPointSize=ContextLimits.maximumAliasedPointSize,updateMode$1(this,e);var t,i=this._pointPrimitives.length,r=this._pointPrimitivesToUpdate,n=this._pointPrimitivesToUpdateIndex,a=this._propertiesChanged,o=this._createVertexArray,s=e.context,l=e.passes,u=l.pick;if(o||!u&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(var c=0;c>1)%2;s.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",r[l]+":0",n[u]+":0",r[1-l]+":auto",n[1-u]+":auto",""].join("!important;"),e.appendChild(o),i.push(o)}return i}(t,a),s=function(e,t,i){for(var r=i?"invTrans":"trans",n=t[r],a=t.srcCoords,o=!0,s=[],l=[],u=0;u<4;u++){var c=e[u].getBoundingClientRect(),d=2*u,h=c.left,p=c.top;s.push(h,p),o=o&&a&&h===a[d]&&p===a[1+d],l.push(e[u].offsetLeft,e[u].offsetTop)}return o&&n?n:(t.srcCoords=s,t[r]=i?Ne(l,s):Ne(s,l))}(o,a,n);if(s)return s(e,i,r),!0}return!1}function Ve(e){return"CANVAS"===e.nodeName.toUpperCase()}var ze="undefined"!=typeof window&&!!window.addEventListener,Ue=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Ge=[];function $e(e,t,i,r){return i=i||{},r||!v.canvasSupported?He(e,t,i):v.browser.firefox&&null!=t.layerX&&t.layerX!==t.offsetX?(i.zrX=t.layerX,i.zrY=t.layerY):null!=t.offsetX?(i.zrX=t.offsetX,i.zrY=t.offsetY):He(e,t,i),i}function He(e,t,i){if(v.domSupported&&e.getBoundingClientRect){var r=t.clientX,n=t.clientY;if(Ve(e)){var a=e.getBoundingClientRect();return i.zrX=r-a.left,void(i.zrY=n-a.top)}if(Fe(Ge,e,r,n))return i.zrX=Ge[0],void(i.zrY=Ge[1])}i.zrX=i.zrY=0}function We(e){return e||window.event}function je(e,t,i){if(null!=(t=We(t)).zrX)return t;var r=t.type,n=r&&0<=r.indexOf("touch");if(n){var a="touchend"!==r?t.targetTouches[0]:t.changedTouches[0];a&&$e(e,a,t,i)}else $e(e,t,t,i),t.zrDelta=t.wheelDelta?t.wheelDelta/120:-(t.detail||0)/3;var o=t.button;return null==t.which&&void 0!==o&&Ue.test(t.type)&&(t.which=1&o?1:2&o?3:4&o?2:0),t}function qe(e,t,i,r){ze?e.addEventListener(t,i,r):e.attachEvent("on"+t,i)}function Qe(e,t,i,r){ze?e.removeEventListener(t,i,r):e.detachEvent("on"+t,i)}var Ye=ze?function(e){e.preventDefault(),e.stopPropagation(),e.cancelBubble=!0}:function(e){e.returnValue=!1,e.cancelBubble=!0};function Xe(e){return 2===e.which||3===e.which}var Ze=function(){this._track=[]};function Je(e){var t=e[1][0]-e[0][0],i=e[1][1]-e[0][1];return Math.sqrt(t*t+i*i)}Ze.prototype={constructor:Ze,recognize:function(e,t,i){return this._doTrack(e,t,i),this._recognize(e)},clear:function(){return this._track.length=0,this},_doTrack:function(e,t,i){var r=e.touches;if(r){for(var n={points:[],touches:[],target:t,event:e},a=0,o=r.length;ar.getWidth()||i<0||i>r.getHeight()}nt.prototype={constructor:nt,setHandlerProxy:function(t){this.proxy&&this.proxy.dispose(),t&&(k(rt,function(e){t.on&&t.on(e,this[e],this)},this),t.handler=this),this.proxy=t},mousemove:function(e){var t=e.zrX,i=e.zrY,r=ot(this,t,i),n=this._hovered,a=n.target;a&&!a.__zr&&(n=this.findHover(n.x,n.y),a=n.target);var o=this._hovered=r?{x:t,y:i}:this.findHover(t,i),s=o.target,l=this.proxy;l.setCursor&&l.setCursor(s?s.cursor:"default"),a&&s!==a&&this.dispatchToElement(n,"mouseout",e),this.dispatchToElement(o,"mousemove",e),s&&s!==a&&this.dispatchToElement(o,"mouseover",e)},mouseout:function(e){var t=e.zrEventControl,i=e.zrIsToLocalDOM;"only_globalout"!==t&&this.dispatchToElement(this._hovered,"mouseout",e),"no_globalout"!==t&&(i||this.trigger("globalout",{type:"globalout",event:e}))},resize:function(e){this._hovered={}},dispatch:function(e,t){var i=this[e];i&&i.call(this,t)},dispose:function(){this.proxy.dispose(),this.storage=this.proxy=this.painter=null},setCursorStyle:function(e){var t=this.proxy;t.setCursor&&t.setCursor(e)},dispatchToElement:function(e,t,i){var r=(e=e||{}).target;if(!r||!r.silent){for(var n="on"+t,a=function(e,t,i){return{type:e,event:i,target:t.target,topTarget:t.topTarget,cancelBubble:!1,offsetX:i.zrX,offsetY:i.zrY,gestureEvent:i.gestureEvent,pinchX:i.pinchX,pinchY:i.pinchY,pinchScale:i.pinchScale,wheelDelta:i.zrDelta,zrByTouch:i.zrByTouch,which:i.which,stop:tt}}(t,e,i);r&&(r[n]&&(a.cancelBubble=r[n].call(r,a)),r.trigger(t,a),r=r.parent,!a.cancelBubble););a.cancelBubble||(this.trigger(t,a),this.painter&&this.painter.eachOtherLayer(function(e){"function"==typeof e[n]&&e[n].call(e,a),e.trigger&&e.trigger(t,a)}))}},findHover:function(e,t,i){for(var r=this.storage.getDisplayList(),n={x:e,y:t},a=r.length-1;0<=a;a--){var o;if(r[a]!==i&&!r[a].ignore&&(o=at(r[a],e,t))&&(n.topTarget||(n.topTarget=r[a]),o!==et)){n.target=r[a];break}}return n},processGesture:function(e,t){this._gestureMgr||(this._gestureMgr=new Ze);var i=this._gestureMgr;"start"===t&&i.clear();var r=i.recognize(e,this.findHover(e.zrX,e.zrY,null).target,this.proxy.dom);if("end"===t&&i.clear(),r){var n=r.type;e.gestureEvent=n,this.dispatchToElement({target:r.target},n,r.event)}}},k(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],function(o){nt.prototype[o]=function(e){var t,i,r=e.zrX,n=e.zrY,a=ot(this,r,n);if("mouseup"===o&&a||(t=this.findHover(r,n),i=t.target),"mousedown"===o)this._downEl=i,this._downPoint=[e.zrX,e.zrY],this._upEl=i;else if("mouseup"===o)this._upEl=i;else if("click"===o){if(this._downEl!==this._upEl||!this._downPoint||4=this._maxSize&&0>4|(3840&n)>>8,240&n|(240&n)>>4,15&n|(15&n)<<4,1),$t(e,t),t):void Vt(t,0,0,0,1)}if(7!==r.length)return;var n=parseInt(r.substr(1),16);return 0<=n&&n<=16777215?(Vt(t,(16711680&n)>>16,(65280&n)>>8,255&n,1),$t(e,t),t):void Vt(t,0,0,0,1)}var a=r.indexOf("("),o=r.indexOf(")");if(-1!==a&&o+1===r.length){var s=r.substr(0,a),l=r.substr(a+1,o-(a+1)).split(","),u=1;switch(s){case"rgba":if(4!==l.length)return void Vt(t,0,0,0,1);u=kt(l.pop());case"rgb":return 3!==l.length?void Vt(t,0,0,0,1):(Vt(t,Nt(l[0]),Nt(l[1]),Nt(l[2]),u),$t(e,t),t);case"hsla":return 4!==l.length?void Vt(t,0,0,0,1):(l[3]=kt(l[3]),Wt(l,t),$t(e,t),t);case"hsl":return 3!==l.length?void Vt(t,0,0,0,1):(Wt(l,t),$t(e,t),t);default:return}}Vt(t,0,0,0,1)}}function Wt(e,t){var i=(parseFloat(e[0])%360+360)%360/360,r=kt(e[1]),n=kt(e[2]),a=n<=.5?n*(r+1):n+r-n*r,o=2*n-a;return Vt(t=t||[],Rt(255*Bt(o,a,i+1/3)),Rt(255*Bt(o,a,i)),Rt(255*Bt(o,a,i-1/3)),1),4===e.length&&(t[3]=e[3]),t}function jt(e,t){var i=Ht(e);if(i){for(var r=0;r<3;r++)i[r]=t<0?i[r]*(1-t)|0:(255-i[r])*t+i[r]|0,255=0;i--){if(g[i]<=t){break}}i=Math.min(i,u-2)}else{for(i=D;it){break}}i=Math.min(i-1,u-2)}I=t;var r=g[(D=i)+1]-g[i];if(r===0){return}else{w=(t-g[i])/r}if(l){T=y[i];E=y[i===0?i:i-1];P=y[i>u-2?u-1:i+1];M=y[i>u-3?u-1:i+2];if(h){ci(E,T,P,M,w,w*w,w*w*w,o(e,a),m)}else{var n;if(p){n=ci(E,T,P,M,w,w*w,w*w*w,O,1);n=pi(O)}else if(f){return oi(T,P,w)}else{n=di(E,T,P,M,w,w*w,w*w*w)}s(e,a,n)}}else{if(h){si(y[i],y[i+1],w,o(e,a),m)}else{var n;if(p){si(y[i],y[i+1],w,O,1);n=pi(O)}else if(f){return oi(y[i],y[i+1],w)}else{n=ai(y[i],y[i+1],w)}s(e,a,n)}}},ondestroy:i});return t&&"spline"!==t&&(R.easing=t),R}}}var mi=function(e,t,i,r){this._tracks={},this._target=e,this._loop=t||!1,this._getter=i||ri,this._setter=r||ni,this._clipCount=0,this._delay=0,this._doneList=[],this._onframeList=[],this._clipList=[]};mi.prototype={when:function(e,t){var i=this._tracks;for(var r in t)if(t.hasOwnProperty(r)){if(!i[r]){i[r]=[];var n=this._getter(this._target,r);if(null==n)continue;0!==e&&i[r].push({time:0,value:hi(n)})}i[r].push({time:e,value:t[r]})}return this},during:function(e){return this._onframeList.push(e),this},pause:function(){for(var e=0;e=this.x&&e<=this.x+this.width&&t>=this.y&&t<=this.y+this.height},clone:function(){return new Ei(this.x,this.y,this.width,this.height)},copy:function(e){this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height},plain:function(){return{x:this.x,y:this.y,width:this.width,height:this.height}}},Ei.create=function(e){return new Ei(e.x,e.y,e.width,e.height)};var Ti=function(e){for(var t in e=e||{},bi.call(this,e),e)e.hasOwnProperty(t)&&(this[t]=e[t]);this._children=[],this.__storage=null,this.__dirty=!0};Ti.prototype={constructor:Ti,isGroup:!0,type:"group",silent:!1,children:function(){return this._children.slice()},childAt:function(e){return this._children[e]},childOfName:function(e){for(var t=this._children,i=0;i>>1])<0?l=a:s=1+a;var u=r-s;switch(u){case 3:e[s+3]=e[s+2];case 2:e[s+2]=e[s+1];case 1:e[s+1]=e[s];break;default:for(;0>>1);0>>1);a(e,t[i+c])<0?l=c:o=c+1}return l}function Li(f,m){var o,s,g=Mi,l=0,y=[];function t(e){var t=o[e],i=s[e],r=o[e+1],n=s[e+1];s[e]=i+n,e===l-3&&(o[e+1]=o[e+2],s[e+1]=s[e+2]),l--;var a=Ri(f[r],f,t,i,0,m);t+=a,0!==(i-=a)&&0!==(n=Oi(f[t+i-1],f,r,n,n-1,m))&&(i<=n?function(e,t,i,r){var n=0;for(n=0;ns[e+1])break;t(e)}},this.forceMergeRuns=function(){for(;1>=1;return e+t}(n);do{if((a=Di(e,i,r,t))=t.maxIterations){e+=t.ellipsis;break}var s=0===o?_r(e,n,t.ascCharWidth,t.cnCharWidth):0p)return{lines:[],width:0,height:0};_.textWidth=dr(_.text,b);var S=C.textWidth,w=null==S||"auto"===S;if("string"==typeof S&&"%"===S.charAt(S.length-1))_.percentWidth=S,u.push(_),S=0;else{if(w){S=_.textWidth;var E=C.textBackgroundColor,T=E&&E.image;T&&nr(T=tr(T))&&(S=Math.max(S,T.width*A/T.height))}var P=x?x[1]+x[3]:0;S+=P;var M=null!=h?h-y:null;null!=M&&Mr[0]){for(o=0;oe);o++);a=i[r[o]]}if(r.splice(o+1,0,e),!(i[e]=t).virtual)if(a){var l=a.dom;l.nextSibling?s.insertBefore(t.dom,l.nextSibling):s.appendChild(t.dom)}else s.firstChild?s.insertBefore(t.dom,s.firstChild):s.appendChild(t.dom)}},eachLayer:function(e,t){var i,r,n=this._zlevelList;for(r=0;r=a.length&&a.push({option:e})}}),a}function Vn(e){var o=te();Dn(e,function(e,t){var i=e.exist;i&&o.set(i.id,e)}),Dn(e,function(e,t){var i=e.option;Y(!i||null==i.id||!o.get(i.id)||o.get(i.id)===e,"id duplicates: "+(i&&i.id)),i&&null!=i.id&&o.set(i.id,e),e.keyInfo||(e.keyInfo={})}),Dn(e,function(e,t){var i=e.exist,r=e.option,n=e.keyInfo;if(In(r)){if(n.name=null!=r.name?r.name+"":i?i.name:Rn+t,i)n.id=i.id;else if(null!=r.id)n.id=r.id+"";else for(var a=0;n.id="\0"+n.name+"\0"+a++,o.get(n.id););o.set(n.id,e)}})}function zn(e){var t=e.name;return!(!t||!t.indexOf(Rn))}function Un(e){return In(e)&&e.id&&0===(e.id+"").indexOf("\0_ec_\0")}function Gn(t,e){return null!=e.dataIndexInside?e.dataIndexInside:null!=e.dataIndex?R(e.dataIndex)?B(e.dataIndex,function(e){return t.indexOfRawIndex(e)}):t.indexOfRawIndex(e.dataIndex):null!=e.name?R(e.name)?B(e.name,function(e){return t.indexOfName(e)}):t.indexOfName(e.name):void 0}function $n(){var t="__\0ec_inner_"+Hn+++"_"+Math.random().toFixed(5);return function(e){return e[t]||(e[t]={})}}var Hn=0;function Wn(s,l,u){if(F(l)){var e={};e[l+"Index"]=0,l=e}var t=u&&u.defaultMainType;!t||jn(l,t+"Index")||jn(l,t+"Id")||jn(l,t+"Name")||(l[t+"Index"]=0);var c={};return Dn(l,function(e,t){var e=l[t];if("dataIndex"!==t&&"dataIndexInside"!==t){var i=t.match(/^(\w+)(Index|Id|Name)$/)||[],r=i[1],n=(i[2]||"").toLowerCase();if(!(!r||!n||null==e||"index"===n&&"none"===e||u&&u.includeMainTypes&&x(u.includeMainTypes,r)<0)){var a={mainType:r};"index"===n&&"all"===e||(a[n]=e);var o=s.queryComponents(a);c[r+"Models"]=o,c[r+"Model"]=o[0]}}else c[t]=e}),c}function jn(e,t){return e&&e.hasOwnProperty(t)}function qn(e,t,i){e.setAttribute?e.setAttribute(t,i):e[t]=i}function Qn(e){return"auto"===e?v.domSupported?"html":"richText":e||"html"}function Yn(e,i){var r=te(),n=[];return k(e,function(e){var t=i(e);(r.get(t)||(n.push(t),r.set(t,[]))).push(e)}),{keys:n,buckets:r}}var Xn=".",Zn="___EC__COMPONENT__CONTAINER___";function Jn(e){var t={main:"",sub:""};return e&&(e=e.split(Xn),t.main=e[0]||"",t.sub=e[1]||""),t}function Kn(e,r){(e.$constructor=e).extend=function(t){M&&k(r,function(e){t[e]||console.warn("Method `"+e+"` should be implemented"+(t.type?" in "+t.type:"")+".")});var e=this,i=function(){t.$constructor?t.$constructor.apply(this,arguments):e.apply(this,arguments)};return O(i.prototype,t),i.extend=this.extend,i.superCall=ia,i.superApply=ra,b(i,this),i.superClass=e,i}}var ea=0;function ta(e){var t=["__\0is_clz",ea++,Math.random().toFixed(3)].join("_");e.prototype[t]=!0,M&&Y(!e.isInstance,'The method "is" can not be defined.'),e.isInstance=function(e){return!(!e||!e[t])}}function ia(e,t){var i=q(arguments,2);return this.superClass.prototype[t].apply(e,i)}function ra(e,t,i){return this.superClass.prototype[t].apply(e,i)}function na(i,e){e=e||{};var n={};if(i.registerClass=function(e,t){if(t)if(function(e){Y(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(e),'componentType "'+e+'" illegal')}(t),(t=Jn(t)).sub){if(t.sub!==Zn){var i=function(e){var t=n[e.main];t&&t[Zn]||((t=n[e.main]={})[Zn]=!0);return t}(t);i[t.sub]=e}}else M&&n[t.main]&&console.warn(t.main+" exists."),n[t.main]=e;return e},i.getClass=function(e,t,i){var r=n[e];if(r&&r[Zn]&&(r=t?r[t]:null),i&&!r)throw new Error(t?"Component "+e+"."+(t||"")+" not exists. Load it first.":e+".type should be specified.");return r},i.getClassesByMainType=function(e){e=Jn(e);var i=[],t=n[e.main];return t&&t[Zn]?k(t,function(e,t){t!==Zn&&i.push(e)}):i.push(t),i},i.hasClass=function(e){return e=Jn(e),!!n[e.main]},i.getAllClassMainTypes=function(){var i=[];return k(n,function(e,t){i.push(t)}),i},i.hasSubTypes=function(e){e=Jn(e);var t=n[e.main];return t&&t[Zn]},i.parseClassType=Jn,e.registerWhenExtend){var r=i.extend;r&&(i.extend=function(e){var t=r.call(this,e);return i.registerClass(t,e.type)})}return i}var aa=function(s){for(var e=0;ethis._ux||eo(t-this._yi)>this._uy||this._len<5;return this.addData(Ha.L,e,t),this._ctx&&i&&(this._needsDash()?this._dashedLineTo(e,t):this._ctx.lineTo(e,t)),i&&(this._xi=e,this._yi=t),this},bezierCurveTo:function(e,t,i,r,n,a){return this.addData(Ha.C,e,t,i,r,n,a),this._ctx&&(this._needsDash()?this._dashedBezierTo(e,t,i,r,n,a):this._ctx.bezierCurveTo(e,t,i,r,n,a)),this._xi=n,this._yi=a,this},quadraticCurveTo:function(e,t,i,r){return this.addData(Ha.Q,e,t,i,r),this._ctx&&(this._needsDash()?this._dashedQuadraticTo(e,t,i,r):this._ctx.quadraticCurveTo(e,t,i,r)),this._xi=i,this._yi=r,this},arc:function(e,t,i,r,n,a){return this.addData(Ha.A,e,t,i,i,r,n-r,0,a?0:1),this._ctx&&this._ctx.arc(e,t,i,r,n,a),this._xi=Za(n)*i+e,this._yi=Ja(n)*i+t,this},arcTo:function(e,t,i,r,n){return this._ctx&&this._ctx.arcTo(e,t,i,r,n),this},rect:function(e,t,i,r){return this._ctx&&this._ctx.rect(e,t,i,r),this.addData(Ha.R,e,t,i,r),this},closePath:function(){this.addData(Ha.Z);var e=this._ctx,t=this._x0,i=this._y0;return e&&(this._needsDash()&&this._dashedLineTo(t,i),e.closePath()),this._xi=t,this._yi=i,this},fill:function(e){e&&e.fill(),this.toStatic()},stroke:function(e){e&&e.stroke(),this.toStatic()},setLineDash:function(e){if(e instanceof Array){this._lineDash=e;for(var t=this._dashIdx=0,i=0;it.length&&(this._expandData(),t=this.data);for(var i=0;il||eo(o-n)>u||d===c-1)&&(e.lineTo(a,o),r=a,n=o);break;case Ha.C:e.bezierCurveTo(s[d++],s[d++],s[d++],s[d++],s[d++],s[d++]),r=s[d-2],n=s[d-1];break;case Ha.Q:e.quadraticCurveTo(s[d++],s[d++],s[d++],s[d++]),r=s[d-2],n=s[d-1];break;case Ha.A:var p=s[d++],f=s[d++],m=s[d++],g=s[d++],y=s[d++],v=s[d++],_=s[d++],C=s[d++],x=g=mo[r=0]+e&&o<=mo[1]+e?c:0}if(a){var l=r;r=so(n),n=so(l)}else r=so(r),n=so(n);nMath.PI/2&&f<1.5*Math.PI&&(c=-c),d+=c)}}return d}function xo(e,t,i,r,n){for(var a=0,o=0,s=0,l=0,u=0,c=0;ci-2?i-1:l+1];p=e[l>i-3?i-1:l+2]}else{c=e[(l-1+i)%i];h=e[(l+1)%i];p=e[(l+2)%i]}var f=u*u;var m=u*f;r.push([Yo(c[0],d[0],h[0],p[0],u,f,m),Yo(c[1],d[1],h[1],p[1],u,f,m)])}return r}(r,i)),e.moveTo(r[0][0],r[0][1]);for(var s=1,d=r.length;sMath.abs(a[1])?0=t[1])return i[1]}else{if(e>=t[0])return i[0];if(e<=t[1])return i[1]}else{if(e===t[0])return i[0];if(e===t[1])return i[1]}return(e-t[0])/n*a+i[0]}function Ll(e,t){switch(e){case"center":case"middle":e="50%";break;case"left":case"top":e="0%";break;case"right":case"bottom":e="100%"}return"string"==typeof e?function(e){return e.replace(/^\s+|\s+$/g,"")}(e).match(/%$/)?parseFloat(e)/100*t:parseFloat(e):null==e?NaN:+e}function Nl(e,t,i){return null==t&&(t=10),t=Math.min(Math.max(0,t),20),e=(+e).toFixed(t),i?e:+e}function kl(e){return e.sort(function(e,t){return e-t}),e}function Bl(e){if(e=+e,isNaN(e))return 0;for(var t=1,i=0;Math.round(e*t)/t!==e;)t*=10,i++;return i}function Fl(e){var t=e.toString(),i=t.indexOf("e");if(0c&&(c=u[h],d=h);++s[d],u[d]=0,++l}return s[t]/n}var Ul=9007199254740991;function Gl(e){var t=2*Math.PI;return(e%t+t)%t}function $l(e){return-Ol"'])/g,iu={"&":"&","<":"<",">":">",'"':""","'":"'"};function ru(e){return null==e?"":(e+"").replace(tu,function(e,t){return iu[t]})}var nu=["a","b","c","d","e","f","g"],au=function(e,t){return"{"+e+(null==t?"":t)+"}"};function ou(e,t,i){R(t)||(t=[t]);var r=t.length;if(!r)return"";for(var n=t[0].$vars||[],a=0;a':'':{renderMode:n,content:"{marker"+a+"|} ",style:{color:i}}:""}function uu(e,t){return"0000".substr(0,t-(e+="").length)+e}function cu(e,t,i){"week"!==e&&"month"!==e&&"quarter"!==e&&"half-year"!==e&&"year"!==e||(e="MM-dd\nyyyy");var r=Wl(t),n=i?"UTC":"",a=r["get"+n+"FullYear"](),o=r["get"+n+"Month"]()+1,s=r["get"+n+"Date"](),l=r["get"+n+"Hours"](),u=r["get"+n+"Minutes"](),c=r["get"+n+"Seconds"](),d=r["get"+n+"Milliseconds"]();return e=e.replace("MM",uu(o,2)).replace("M",o).replace("yyyy",a).replace("yy",a%100).replace("dd",uu(s,2)).replace("d",s).replace("hh",uu(l,2)).replace("h",l).replace("mm",uu(u,2)).replace("m",u).replace("ss",uu(c,2)).replace("s",c).replace("SSS",uu(d,3))}function du(e){return e?e.charAt(0).toUpperCase()+e.substr(1):e}var hu=gr;function pu(e,t){if("_blank"===t||"blank"===t){var i=window.open();i.opener=null,i.location=e}else window.open(e,t)}var fu=(Object.freeze||Object)({addCommas:Jl,toCamelCase:Kl,normalizeCssArray:eu,encodeHTML:ru,formatTpl:ou,formatTplSimple:su,getTooltipMarker:lu,formatTime:cu,capitalFirst:du,truncateText:hu,getTextBoundingRect:function(e){return hr(e.text,e.font,e.textAlign,e.textVerticalAlign,e.textPadding,e.textLineHeight,e.rich,e.truncate)},getTextRect:function(e,t,i,r,n,a,o,s){return hr(e,t,i,r,n,s,a,o)},windowOpen:pu}),mu=k,gu=["left","right","top","bottom","width","height"],yu=[["width","left","right"],["height","top","bottom"]];function vu(c,d,h,p,f){var m=0,g=0;null==p&&(p=1/0),null==f&&(f=1/0);var y=0;d.eachChild(function(e,t){var i,r,n=e.position,a=e.getBoundingRect(),o=d.childAt(t+1),s=o&&o.getBoundingRect();if("horizontal"===c){var l=a.width+(s?-s.x+a.x:0);y=p<(i=m+l)||e.newline?(m=0,i=l,g+=y+h,a.height):Math.max(y,a.height)}else{var u=a.height+(s?-s.y+a.y:0);y=f<(r=g+u)||e.newline?(m+=y+h,g=0,r=u,a.width):Math.max(y,a.width)}e.newline||(n[0]=m,n[1]=g,"horizontal"===c?m=i+h:g=r+h)})}var _u=vu;P(vu,"vertical"),P(vu,"horizontal");function Cu(e,t,i){i=eu(i||0);var r=t.width,n=t.height,a=Ll(e.left,r),o=Ll(e.top,n),s=Ll(e.right,r),l=Ll(e.bottom,n),u=Ll(e.width,r),c=Ll(e.height,n),d=i[2]+i[0],h=i[1]+i[3],p=e.aspect;switch(isNaN(u)&&(u=r-s-h-a),isNaN(c)&&(c=n-l-d-o),null!=p&&(isNaN(u)&&isNaN(c)&&(r/nt)return e[r];return e[i-1]}(s,i):o;if((l=l||o)&&l.length){var u=l[n];return e&&(a[e]=u),r.colorIdx=(n+1)%l.length,u}}},Iu="original",Ou="arrayRows",Ru="objectRows",Lu="keyedColumns",Nu="unknown",ku="typedArray",Bu="column",Fu="row";function Vu(e){this.fromDataset=e.fromDataset,this.data=e.data||(e.sourceFormat===Lu?{}:[]),this.sourceFormat=e.sourceFormat||Nu,this.seriesLayoutBy=e.seriesLayoutBy||Bu,this.dimensionsDefine=e.dimensionsDefine,this.encodeDefine=e.encodeDefine&&te(e.encodeDefine),this.startIndex=e.startIndex||0,this.dimensionsDetectCount=e.dimensionsDetectCount}Vu.seriesDataToSource=function(e){return new Vu({data:e,sourceFormat:U(e)?ku:Iu,fromDataset:!1})},ta(Vu);var zu={Must:1,Might:2,Not:3},Uu=$n();function Gu(e){var t=e.option,i=t.data,r=U(i)?ku:Iu,n=!1,a=t.seriesLayoutBy,o=t.sourceHeader,s=t.dimensions,l=qu(e);if(l){var u=l.option;i=u.source,r=Uu(l).sourceFormat,n=!0,a=a||u.seriesLayoutBy,null==o&&(o=u.sourceHeader),s=s||u.dimensions}var c=function(e,t,i,r,n){if(!e)return{dimensionsDefine:$u(n)};var a,o;if(t===Ou)"auto"===r||null==r?Hu(function(e){null!=e&&"-"!==e&&(F(e)?null==o&&(o=1):o=0)},i,e,10):o=r?1:0,n||1!==o||(n=[],Hu(function(e,t){n[t]=null!=e?e:""},i,e)),a=n?n.length:i===Fu?e.length:e[0]?e[0].length:null;else if(t===Ru)n=n||function(e){var t,i=0;for(;i=this._outputDueEnd),this._outputDueEnd=g}else this._dueIndex=this._outputDueEnd=null!=this._settedOutputEnd?this._settedOutputEnd:this._dueEnd;return this.unfinished()};var Wc=function(){var n,a,o,s,l,u={reset:function(e,t,i,r){a=e,n=t,o=i,s=r,l=Math.ceil(s/o),u.next=1":"\n",p="richText"===d,f={},m=0;function i(e){return{renderMode:d,content:ru(Jl(e)),style:f}}var g=this.getData(),a=g.mapDimension("defaultedTooltip",!0),r=a.length,o=this.getRawValue(n),s=R(o),y=g.getItemVisual(n,"color");V(y)&&y.colorStops&&(y=(y.colorStops[0]||{}).color),y=y||"transparent";var l=1":"",r=i+u.join(i||", ");return{renderMode:d,content:r,style:f}}(o):i(r?Fc(g,n,a[0]):s?o[0]:o),u=l.content,v=h.seriesIndex+"at"+m,_=lu({color:y,type:"item",renderMode:d,markerId:v});f[v]=y,++m;var C=g.getName(n),x=this.name;zn(this)||(x=""),x=x?ru(x)+(c?": ":t):"";var b="string"==typeof _?_:_.content,A=c?b+x+u:x+b+(C?ru(C)+": "+u:u);return{html:A,markers:f}},isAnimationEnabled:function(){if(v.node)return!1;var e=this.getShallow("animation");return e&&this.getData().count()>this.getShallow("animationThreshold")&&(e=!1),e},restoreData:function(){this.dataTask.dirty()},getColorFromPalette:function(e,t,i){var r=this.ecModel,n=Du.getColorFromPalette.call(this,e,t,i);return n=n||r.getColorFromPalette(e,t,i)},coordDimToDataDim:function(e){return this.getRawData().mapDimension(e,!0)},getProgressive:function(){return this.get("progressive")},getProgressiveThreshold:function(){return this.get("progressiveThreshold")},getAxisTooltipData:null,getTooltipPosition:null,pipeTask:null,preventIncremental:null,pipelineContext:null});function Yc(e){var t=e.name;zn(e)||(e.name=function(e){var i=e.getRawData(),t=i.mapDimension("seriesName",!0),r=[];return k(t,function(e){var t=i.getDimensionInfo(e);t.displayName&&r.push(t.displayName)}),r.join(" ")}(e)||t)}function Xc(e){return e.model.getRawData().count()}function Zc(e){var t=e.model;return t.setData(t.getRawData().cloneShallow()),Jc}function Jc(e,t){t.outputData&&e.end>t.outputData.count()&&t.model.getRawData().cloneShallow(t.outputData)}function Kc(t,i){k(t.CHANGABLE_METHODS,function(e){t.wrapMethod(e,P(ed,i))})}function ed(e){var t=td(e);t&&t.setOutputEnd(this.count())}function td(e){var t=(e.ecModel||{}).scheduler,i=t&&t.getPipeline(e.uid);if(i){var r=i.currentTask;if(r){var n=r.agentStubMap;n&&(r=n.get(e.uid))}return r}}A(Qc,Uc),A(Qc,Du);var id=function(){this.group=new Ti,this.uid=Il("viewComponent")};id.prototype={constructor:id,init:function(e,t){},render:function(e,t,i,r){},dispose:function(){},filterForExposedEvent:null};var rd=id.prototype;rd.updateView=rd.updateLayout=rd.updateVisual=function(e,t,i,r){},Kn(id),na(id,{registerWhenExtend:!0});var nd=function(){var s=$n();return function(e){var t=s(e),i=e.pipelineContext,r=t.large,n=t.progressiveRender,a=t.large=i&&i.large,o=t.progressiveRender=i&&i.progressiveRender;return!!(r^a||n^o)&&"reset"}},ad=$n(),od=nd();function sd(){this.group=new Ti,this.uid=Il("viewChart"),this.renderTask=Gc({plan:dd,reset:hd}),this.renderTask.context={view:this}}var ld=sd.prototype={type:"chart",init:function(e,t){},render:function(e,t,i,r){},highlight:function(e,t,i,r){cd(e.getData(),r,"emphasis")},downplay:function(e,t,i,r){cd(e.getData(),r,"normal")},remove:function(e,t){this.group.removeAll()},dispose:function(){},incrementalPrepareRender:null,incrementalRender:null,updateTransform:null,filterForExposedEvent:null};function ud(e,t,i){if(e&&(e.trigger(t,i),e.isGroup&&!Zs(e)))for(var r=0,n=e.childCount();rd?i+=f(m("data.partialData"),{displayCnt:d}):i+=m("data.allData");for(var o=[],s=0;si.blockIndex,a=n?i.step:null,o=r&&r.modDataCount,s=null!=o?Math.ceil(o/a):null;return{step:a,modBy:s,modDataCount:o}}},wd.getPipeline=function(e){return this._pipelineMap.get(e)},wd.updateStreamModes=function(e,t){var i=this._pipelineMap.get(e.uid),r=e.getData(),n=r.count(),a=i.progressiveEnabled&&t.incrementalPrepareRender&&n>=i.threshold,o=e.get("large")&&n>=e.get("largeThreshold"),s="mod"===e.get("progressiveChunkMode")?n:null;e.pipelineContext=i.context={progressiveRender:a,modDataCount:s,large:o}},wd.restorePipelines=function(e){var r=this,n=r._pipelineMap=te();e.eachSeries(function(e){var t=e.getProgressive(),i=e.uid;n.set(i,{id:i,head:null,tail:null,threshold:e.getProgressiveThreshold(),progressiveEnabled:t&&!(e.preventIncremental&&e.preventIncremental()),blockIndex:-1,step:Math.round(t||700),count:0}),Bd(r,e,e.dataTask)})},wd.prepareStageTasks=function(){var i=this._stageTaskMap,r=this.ecInstance.getModel(),n=this.api;k(this._allHandlers,function(e){var t=i.get(e.uid)||i.set(e.uid,[]);e.reset&&function(r,n,e,a,o){var s=e.seriesTaskMap||(e.seriesTaskMap=te()),t=n.seriesType,i=n.getTargetSeries;n.createOnAllSeries?a.eachRawSeries(l):t?a.eachRawSeriesByType(t,l):i&&i(a,o).each(l);function l(e){var t=e.uid,i=s.get(t)||s.set(t,Gc({plan:Od,reset:Rd,count:kd}));i.context={model:e,ecModel:a,api:o,useClearVisual:n.isVisual&&!n.isLayout,plan:n.plan,reset:n.reset,scheduler:r},Bd(r,e,i)}var u=r._pipelineMap;s.each(function(e,t){u.get(t)||(e.dispose(),s.removeKey(t))})}(this,e,t,r,n),e.overallReset&&function(r,e,t,i,n){var a=t.overallTask=t.overallTask||Gc({reset:Pd});a.context={ecModel:i,api:n,overallReset:e.overallReset,scheduler:r};var o=a.agentStubMap=a.agentStubMap||te(),s=e.seriesType,l=e.getTargetSeries,u=!0,c=e.modifyOutputEnd;s?i.eachRawSeriesByType(s,d):l?l(i,n).each(d):(u=!1,k(i.getSeries(),d));function d(e){var t=e.uid,i=o.get(t);i||(i=o.set(t,Gc({reset:Md,onDirty:Id})),a.dirty()),i.context={model:e,overallProgress:u,modifyOutputEnd:c},i.agent=a,i.__block=u,Bd(r,e,i)}var h=r._pipelineMap;o.each(function(e,t){h.get(t)||(e.dispose(),a.dirty(),o.removeKey(t))})}(this,e,t,r,n)},this)},wd.prepareView=function(e,t,i,r){var n=e.renderTask,a=n.context;a.model=t,a.ecModel=i,a.api=r,n.__block=!e.incrementalPrepareRender,Bd(this,t,n)},wd.performDataProcessorTasks=function(e,t){Ed(this,this._dataProcessorHandlers,e,t,{block:!0})},wd.performVisualTasks=function(e,t,i){Ed(this,this._visualHandlers,e,t,i)},wd.performSeriesTasks=function(e){var t;e.eachSeries(function(e){t|=e.dataTask.perform()}),this.unfinished|=t},wd.plan=function(){this._pipelineMap.each(function(e){var t=e.tail;do{if(t.__block){e.blockIndex=t.__idxInPipeline;break}t=t.getUpstream()}while(t)})};var Td=wd.updatePayload=function(e,t){"remain"!==t&&(e.context.payload=t)};function Pd(e){e.overallReset(e.ecModel,e.api,e.payload)}function Md(e,t){return e.overallProgress&&Dd}function Dd(){this.agent.dirty(),this.getDownstream().dirty()}function Id(){this.agent&&this.agent.dirty()}function Od(e){return e.plan&&e.plan(e.model,e.ecModel,e.api,e.payload)}function Rd(e){e.useClearVisual&&e.data.clearAllVisual();var t=e.resetDefines=Ln(e.reset(e.model,e.ecModel,e.api,e.payload));return 1'+e.dom+""}),m.painter.getSvgRoot().innerHTML=g,n.connectedBackgroundColor&&m.painter.setBackgroundColor(n.connectedBackgroundColor),m.refreshImmediately(),m.painter.toDataURL()}return n.connectedBackgroundColor&&m.add(new ns({shape:{x:0,y:0,width:t,height:r},style:{fill:n.connectedBackgroundColor}})),ph(p,function(e){var t=new Xr({style:{x:e.left*i-u,y:e.top*i-c,image:e.dom}});m.add(t)}),m.refreshImmediately(),f.toDataURL("image/"+(n&&n.type||"png"))}return this.getDataURL(n)}},wh.convertToPixel=P(Eh,"convertToPixel"),wh.convertFromPixel=P(Eh,"convertFromPixel"),wh.containPixel=function(e,n){if(!this._disposed){var a,t=this._model;return k(e=Wn(t,e),function(e,r){0<=r.indexOf("Models")&&k(e,function(e){var t=e.coordinateSystem;if(t&&t.containPoint)a|=!!t.containPoint(n);else if("seriesModels"===r){var i=this._chartsMap[e.__viewId];i&&i.containPoint?a|=i.containPoint(n,e):M&&console.warn(r+": "+(i?"The found component do not support containPoint.":"No view mapping to the found component."))}else M&&console.warn(r+": containPoint is not supported")},this)},this),!!a}zh(this.id)},wh.getVisual=function(e,t){var i=this._model,r=(e=Wn(i,e,{defaultMainType:"series"})).seriesModel;M&&(r||console.warn("There is no specified seires model"));var n=r.getData(),a=e.hasOwnProperty("dataIndexInside")?e.dataIndexInside:e.hasOwnProperty("dataIndex")?n.indexOfRawIndex(e.dataIndex):null;return null!=a?n.getItemVisual(a,t):n.getVisual(t)},wh.getViewOfComponentModel=function(e){return this._componentsMap[e.__viewId]},wh.getViewOfSeriesModel=function(e){return this._chartsMap[e.__viewId]};var Th={prepareAndUpdate:function(e){Ph(this),Th.update.call(this,e)},update:function(e){var t=this._model,i=this._api,r=this._zr,n=this._coordSysMgr,a=this._scheduler;if(t){a.restoreData(t,e),a.performSeriesTasks(t),n.create(t,i),a.performDataProcessorTasks(t,e),Dh(this,t),n.update(t,i),Nh(t),a.performVisualTasks(t,e),kh(this,t,i,e);var o=t.get("backgroundColor")||"transparent";if(v.canvasSupported)r.setBackgroundColor(o);else{var s=Ht(o);o=ei(s,"rgb"),0===s[3]&&(o="transparent")}Fh(t,i)}},updateTransform:function(n){var a=this._model,o=this,s=this._api;if(a){var l=[];a.eachComponent(function(e,t){var i=o.getViewOfComponentModel(t);if(i&&i.__alive)if(i.updateTransform){var r=i.updateTransform(t,a,s,n);r&&r.update&&l.push(i)}else l.push(i)});var r=te();a.eachSeries(function(e){var t=o._chartsMap[e.__viewId];if(t.updateTransform){var i=t.updateTransform(e,a,s,n);i&&i.update&&r.set(e.uid,1)}else r.set(e.uid,1)}),Nh(a),this._scheduler.performVisualTasks(a,n,{setDirty:!0,dirtyMap:r}),Bh(o,a,s,n,r),Fh(a,this._api)}},updateView:function(e){var t=this._model;t&&(sd.markUpdateMethod(e,"updateView"),Nh(t),this._scheduler.performVisualTasks(t,e,{setDirty:!0}),kh(this,this._model,this._api,e),Fh(t,this._api))},updateVisual:function(e){Th.update.call(this,e)},updateLayout:function(e){Th.update.call(this,e)}};function Ph(e){var t=e._model,i=e._scheduler;i.restorePipelines(t),i.prepareStageTasks(),Lh(e,"component",t,i),Lh(e,"chart",t,i),i.plan()}function Mh(t,i,r,n,e){var a=t._model;if(n){var o={};o[n+"Id"]=r[n+"Id"],o[n+"Index"]=r[n+"Index"],o[n+"Name"]=r[n+"Name"];var s={mainType:n,query:o};e&&(s.subType=e);var l=r.excludeSeriesId;null!=l&&(l=te(Ln(l))),a&&a.eachComponent(s,function(e){l&&null!=l.get(e.id)||u(t["series"===n?"_chartsMap":"_componentsMap"][e.__viewId])},t)}else ph(t._componentsViews.concat(t._chartsViews),u);function u(e){e&&e.__alive&&e[i]&&e[i](e.__model,a,t._api,r)}}function Dh(e,t){var i=e._chartsMap,r=e._scheduler;t.eachSeries(function(e){r.updateStreamModes(e,i[e.__viewId])})}function Ih(t,e){var i=t.type,r=t.escapeConnect,n=$h[i],a=n.actionInfo,o=(a.update||"update").split(":"),s=o.pop();o=null!=o[0]&&gh(o[0]),this[_h]=!0;var l=[t],u=!1;t.batch&&(u=!0,l=B(t.batch,function(e){return(e=D(O({},e),t)).batch=null,e}));var c,d=[],h="highlight"===i||"downplay"===i;ph(l,function(e){(c=(c=n.action(e,this._model,this._api))||O({},e)).type=a.event||c.type,d.push(c),h?Mh(this,s,e,"series"):o&&Mh(this,s,e,o.main,o.sub)},this),"none"===s||h||o||(this[Ch]?(Ph(this),Th.update.call(this,t),this[Ch]=!1):Th[s].call(this,t)),c=u?{type:a.event||i,escapeConnect:r,batch:d}:d[0],this[_h]=!1,e||this._messageCenter.trigger(c.type,c)}function Oh(e){for(var t=this._pendingActions;t.length;){var i=t.shift();Ih.call(this,i,e)}}function Rh(e){e||this.trigger("updated")}function Lh(e,t,a,o){for(var s="component"===t,l=s?e._componentsViews:e._chartsViews,u=s?e._componentsMap:e._chartsMap,c=e._zr,d=e._api,i=0;ie.get("hoverLayerThreshold")&&!v.node&&e.eachSeries(function(e){if(!e.preventUsingHoverLayer){var t=i._chartsMap[e.__viewId];t.__alive&&t.group.traverse(function(e){e.useHoverLayer=!0})}})}(r,e),bd(r._zr.dom,e)}function Fh(t,i){ph(qh,function(e){e(t,i)})}wh.resize=function(e){if(M&&hh(!this[_h],"`resize` should not be called during main process."),this._disposed)zh(this.id);else{this._zr.resize(e);var t=this._model;if(this._loadingFX&&this._loadingFX.resize(),t){var i=t.resetOption("media"),r=e&&e.silent;this[_h]=!0,i&&Ph(this),Th.update.call(this),this[_h]=!1,Oh.call(this,r),Rh.call(this,r)}}},wh.showLoading=function(e,t){if(this._disposed)zh(this.id);else if(mh(e)&&(t=e,e=""),e=e||"default",this.hideLoading(),Xh[e]){var i=Xh[e](this._api,t),r=this._zr;this._loadingFX=i,r.add(i)}else M&&console.warn("Loading effects "+e+" not exists.")},wh.hideLoading=function(){this._disposed?zh(this.id):(this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null)},wh.makeActionFromEvent=function(e){var t=O({},e);return t.type=Hh[e.type],t},wh.dispatchAction=function(e,t){this._disposed?zh(this.id):(mh(t)||(t={silent:!!t}),$h[e.type]&&this._model&&(this[_h]?this._pendingActions.push(e):(Ih.call(this,e,t.silent),t.flush?this._zr.flush(!0):!1!==t.flush&&v.browser.weChat&&this._throttledZrFlush(),Oh.call(this,t.silent),Rh.call(this,t.silent))))},wh.appendData=function(e){if(this._disposed)zh(this.id);else{var t=e.seriesIndex,i=this.getModel(),r=i.getSeriesByIndex(t);M&&hh(e.data&&r),r.appendData(e),this._scheduler.unfinished=!0}},wh.on=bh("on",!1),wh.off=bh("off",!1),wh.one=bh("one",!1);var Vh=["click","dblclick","mouseover","mouseout","mousemove","mousedown","mouseup","globalout","contextmenu"];function zh(e){M&&console.warn("Instance "+e+" has been disposed")}function Uh(e,t){var i=e.get("z"),r=e.get("zlevel");t.group.traverse(function(e){"group"!==e.type&&(null!=i&&(e.z=i),null!=r&&(e.zlevel=r))})}function Gh(){this.eventInfo}wh._initEvents=function(){ph(Vh,function(c){var e=function(e){var t,i=this.getModel(),r=e.target,n="globalout"===c;if(n)t={};else if(r&&null!=r.dataIndex){var a=r.dataModel||i.getSeriesByIndex(r.seriesIndex);t=a&&a.getDataParams(r.dataIndex,r.dataType,r)||{}}else r&&r.eventData&&(t=O({},r.eventData));if(t){var o=t.componentType,s=t.componentIndex;"markLine"!==o&&"markPoint"!==o&&"markArea"!==o||(o="series",s=t.seriesIndex);var l=o&&null!=s&&i.getComponent(o,s),u=l&&this["series"===l.mainType?"_chartsMap":"_componentsMap"][l.__viewId];M&&(n||l&&u||console.warn("model or view can not be found by params")),t.event=e,t.type=c,this._ecEventProcessor.eventInfo={targetEl:r,packedEvent:t,model:l,view:u},this.trigger(c,t)}};e.zrEventfulCallAtLast=!0,this._zr.on(c,e,this)},this),ph(Hh,function(e,t){this._messageCenter.on(t,function(e){this.trigger(t,e)},this)},this)},wh.isDisposed=function(){return this._disposed},wh.clear=function(){this._disposed?zh(this.id):this.setOption({series:[]},!0)},wh.dispose=function(){if(this._disposed)zh(this.id);else{this._disposed=!0,qn(this.getDom(),tp,"");var t=this._api,i=this._model;ph(this._componentsViews,function(e){e.dispose(i,t)}),ph(this._chartsViews,function(e){e.dispose(i,t)}),this._zr.dispose(),delete Zh[this.id]}},A(Sh,Ie),Gh.prototype={constructor:Gh,normalizeQuery:function(e){var s={},l={},u={};if(F(e)){var t=gh(e);s.mainType=t.main||null,s.subType=t.sub||null}else{var c=["Index","Name","Id"],d={name:1,dataIndex:1,dataType:1};k(e,function(e,t){for(var i=!1,r=0;r_[1]&&(_[1]=v)}t&&(this._nameList[p]=t[f])}this._rawCount=this._count=l,this._extent={},Vp(this)},Bp._initDataFromProvider=function(e,t){if(!(t<=e)){for(var i,r=this._chunkSize,n=this._rawData,a=this._storage,o=this.dimensions,s=o.length,l=this._dimensionInfos,u=this._nameList,c=this._idList,d=this._rawExtent,h=this._nameRepeatCount={},p=this._chunkCount,f=0;fS[1]&&(S[1]=A)}if(!n.pure){var w=u[v];if(y&&null==w)if(null!=y.name)u[v]=w=y.name;else if(null!=i){var E=o[i],T=a[E][_];if(T){w=T[C];var P=l[E].ordinalMeta;P&&P.categories.length&&(w=P.categories[w])}}var M=null==y?null:y.id;null==M&&null!=w&&(h[w]=h[w]||0,0=this._rawCount||e<0)return-1;if(!this._indices)return e;var t=this._indices,i=t[e];if(null!=i&&ie))return a;n=a-1}}return-1},Bp.indicesOfNearest=function(e,t,i){var r=this._storage,n=r[e],a=[];if(!n)return a;null==i&&(i=1/0);for(var o=1/0,s=-1,l=0,u=0,c=this.count();ue[E][1])&&(w=!1)}w&&(o[s++]=this.getRawIndex(y))}return sx[1]&&(x[1]=C)}}}return n},Bp.downSample=function(e,t,i,r){for(var n=jp(this,[e]),a=n._storage,o=[],s=Math.floor(1/t),l=a[e],u=this.count(),c=this._chunkSize,d=n._rawExtent[e],h=new(Op(this))(u),p=0,f=0;fd[1]&&(d[1]=_),h[p++]=C}return n._count=p,n._indices=h,n.getRawIndex=Gp,n},Bp.getItemModel=function(e){var t=this.hostModel;return new Tl(this.getRawDataItem(e),t,t&&t.ecModel)},Bp.diff=function(t){var i=this;return new Cp(t?t.getIndices():[],this.getIndices(),function(e){return $p(t,e)},function(e){return $p(i,e)})},Bp.getVisual=function(e){var t=this._visual;return t&&t[e]},Bp.setVisual=function(e,t){if(Ep(e))for(var i in e)e.hasOwnProperty(i)&&this.setVisual(i,e[i]);else this._visual=this._visual||{},this._visual[e]=t},Bp.setLayout=function(e,t){if(Ep(e))for(var i in e)e.hasOwnProperty(i)&&this.setLayout(i,e[i]);else this._layout[e]=t},Bp.getLayout=function(e){return this._layout[e]},Bp.getItemLayout=function(e){return this._itemLayouts[e]},Bp.setItemLayout=function(e,t,i){this._itemLayouts[e]=i?O(this._itemLayouts[e]||{},t):t},Bp.clearItemLayouts=function(){this._itemLayouts.length=0},Bp.getItemVisual=function(e,t,i){var r=this._itemVisuals[e],n=r&&r[t];return null!=n||i?n:this.getVisual(t)},Bp.setItemVisual=function(e,t,i){var r=this._itemVisuals[e]||{},n=this.hasItemVisual;if(this._itemVisuals[e]=r,Ep(t))for(var a in t)t.hasOwnProperty(a)&&(r[a]=t[a],n[a]=!0);else r[t]=i,n[t]=!0},Bp.clearAllVisual=function(){this._visual={},this._itemVisuals=[],this.hasItemVisual={}};var Yp=function(e){e.seriesIndex=this.seriesIndex,e.dataIndex=this.dataIndex,e.dataType=this.dataType};function Xp(e,t,i){Vu.isInstance(t)||(t=Vu.seriesDataToSource(t)),i=i||{},e=(e||[]).slice();for(var r=(i.dimsDef||[]).slice(),n=te(),a=te(),l=[],o=function(e,t,i,r){var n=Math.max(e.dimensionsDetectCount||1,t.length,i.length,r||0);return k(t,function(e){var t=e.dimsDef;t&&(n=Math.max(n,t.length))}),n}(t,e,r,i.dimCount),s=0;s=t[0]&&e<=t[1]},sf.prototype.normalize=function(e){var t=this._extent;return t[1]===t[0]?.5:(e-t[0])/(t[1]-t[0])},sf.prototype.scale=function(e){var t=this._extent;return e*(t[1]-t[0])+t[0]},sf.prototype.unionExtent=function(e){var t=this._extent;e[0]t[1]&&(t[1]=e[1])},sf.prototype.unionExtentFromData=function(e,t){this.unionExtent(e.getApproximateExtent(t))},sf.prototype.getExtent=function(){return this._extent.slice()},sf.prototype.setExtent=function(e,t){var i=this._extent;isNaN(e)||(i[0]=e),isNaN(t)||(i[1]=t)},sf.prototype.isBlank=function(){return this._isBlank},sf.prototype.setBlank=function(e){this._isBlank=e},sf.prototype.getLabel=null,Kn(sf),na(sf,{registerWhenExtend:!0}),lf.createByAxisModel=function(e){var t=e.option,i=t.data,r=i&&B(i,df);return new lf({categories:r,needCollect:!r,deduplication:!1!==t.dedplication})};var uf=lf.prototype;function cf(e){return e._map||(e._map=te(e.categories))}function df(e){return V(e)&&null!=e.value?e.value:e+""}uf.getOrdinal=function(e){return cf(this).get(e)},uf.parseAndCollect=function(e){var t,i=this._needCollect;if("string"!=typeof e&&!i)return e;if(i&&!this._deduplication)return t=this.categories.length,this.categories[t]=e,t;var r=cf(this);return null==(t=r.get(e))&&(i?(t=this.categories.length,this.categories[t]=e,r.set(e,t)):t=NaN),t};var hf=sf.prototype,pf=sf.extend({type:"ordinal",init:function(e,t){e&&!R(e)||(e=new lf({categories:e})),this._ordinalMeta=e,this._extent=t||[0,e.categories.length-1]},parse:function(e){return"string"==typeof e?this._ordinalMeta.getOrdinal(e):Math.round(e)},contain:function(e){return e=this.parse(e),hf.contain.call(this,e)&&null!=this._ordinalMeta.categories[e]},normalize:function(e){return hf.normalize.call(this,this.parse(e))},scale:function(e){return Math.round(hf.scale.call(this,e))},getTicks:function(){for(var e=[],t=this._extent,i=t[0];i<=t[1];)e.push(i),i++;return e},getLabel:function(e){if(!this.isBlank())return this._ordinalMeta.categories[e]},count:function(){return this._extent[1]-this._extent[0]+1},unionExtentFromData:function(e,t){this.unionExtent(e.getApproximateExtent(t))},getOrdinalMeta:function(){return this._ordinalMeta},niceTicks:re,niceExtent:re});pf.create=function(){return new pf};var ff=Nl;function mf(e){return Fl(e)+2}function gf(e,t,i){e[t]=Math.max(Math.min(e[t],i[1]),i[0])}function yf(e,t){isFinite(e[0])||(e[0]=t[0]),isFinite(e[1])||(e[1]=t[1]),gf(e,0,t),gf(e,1,t),e[0]>e[1]&&(e[0]=e[1])}var vf=Nl,_f=sf.extend({type:"interval",_interval:0,_intervalPrecision:2,setExtent:function(e,t){var i=this._extent;isNaN(e)||(i[0]=parseFloat(e)),isNaN(t)||(i[1]=parseFloat(t))},unionExtent:function(e){var t=this._extent;e[0]t[1]&&(t[1]=e[1]),_f.prototype.setExtent.call(this,t[0],t[1])},getInterval:function(){return this._interval},setInterval:function(e){this._interval=e,this._niceExtent=this._extent.slice(),this._intervalPrecision=mf(e)},getTicks:function(e){var t=this._interval,i=this._extent,r=this._niceExtent,n=this._intervalPrecision,a=[];if(!t)return a;i[0]s&&(e?a.push(vf(s+t,n)):a.push(i[1])),a},getMinorTicks:function(e){for(var t=this.getTicks(!0),i=[],r=this.getExtent(),n=1;nr[0]&&d>>1;if(e[n][1]>1^-(1&s),l=l>>1^-(1&l),n=s+=n,a=l+=a,r.push([s/i,l/i])}return r}ym.prototype={constructor:ym,properties:null,getBoundingRect:function(){var e=this._rect;if(e)return e;for(var t=Number.MAX_VALUE,i=[t,t],r=[-t,-t],n=[],a=[],o=this.geometries,s=0;ss[1];h(t[0].coord,s[0])&&(r?t[0].coord=s[0]:t.shift());r&&h(s[0],t[0].coord)&&t.unshift({coord:s[0]});h(s[1],a.coord)&&(r?a.coord=s[1]:t.pop());r&&h(a.coord,s[1])&&t.push({coord:s[1]});function h(e,t){return e=Nl(e),t=Nl(t),d?tr[0]&&(r[0]=a[0]),a[1]>r[1]&&(r[1]=a[1])}return{min:t?i:r,max:t?r:i}}var cg=wo.extend({type:"ec-polyline",shape:{points:[],smooth:0,smoothConstraint:!0,smoothMonotone:null,connectNulls:!1},style:{fill:null,stroke:"#000"},brush:jo(wo.prototype.brush),buildPath:function(e,t){var i=t.points,r=0,n=i.length,a=ug(i,t.smoothConstraint);if(t.connectNulls){for(;0r)return!1;return!0}(a,t))){var o=t.mapDimension(a.dim),s={};return k(a.getViewLabels(),function(e){s[e.tickValue]=1}),function(e){return!s.hasOwnProperty(t.get(o,e))}}}}function Cg(e,t,i){if("cartesian2d"!==e.type)return pg(e,t,i);var r=e.getBaseAxis().isHorizontal(),n=hg(e,t,i);if(!i.get("clip",!0)){var a=n.shape,o=Math.max(a.width,a.height);r?(a.y-=o,a.height+=2*o):(a.x-=o,a.width+=2*o)}return n}sd.extend({type:"line",init:function(){var e=new Ti,t=new jm;this.group.add(t.group),this._symbolDraw=t,this._lineGroup=e},render:function(e,t,i){var r=e.coordinateSystem,n=this.group,a=e.getData(),o=e.getModel("lineStyle"),s=e.getModel("areaStyle"),l=a.mapArray(a.getItemLayout),u="polar"===r.type,c=this._coordSys,d=this._symbolDraw,h=this._polyline,p=this._polygon,f=this._lineGroup,m=e.get("animation"),g=!s.isEmpty(),y=s.get("origin"),v=Zm(r,a,y),_=function(e,t,i){if(!i.valueDim)return[];for(var r=[],n=0,a=t.count();nc[d-1].coord&&(c.reverse(),h.reverse());var p=c[0].coord-10,f=c[d-1].coord+10,m=f-p;if(m<.001)return"transparent";k(c,function(e){e.offset=(e.coord-p)/m}),c.push({offset:d?c[d-1].offset:.5,color:h[1]||"transparent"}),c.unshift({offset:d?c[0].offset:.5,color:h[0]||"transparent"});var g=new ps(0,0,0,0,c,!0);return g[i]=p,g[i+"2"]=f,g}(a,r)||a.getVisual("color");h.useStyle(D(o.getLineStyle(),{fill:"none",stroke:w,lineJoin:"bevel"}));var E=e.get("smooth");if(E=yg(e.get("smooth")),h.setShape({smooth:E,smoothMonotone:e.get("smoothMonotone"),connectNulls:e.get("connectNulls")}),p){var T=a.getCalculationInfo("stackedOnSeries"),P=0;p.useStyle(D(s.getAreaStyle(),{fill:w,opacity:.7,lineJoin:"bevel"})),T&&(P=yg(T.get("smooth"))),p.setShape({smooth:E,stackedOnSmooth:P,smoothMonotone:e.get("smoothMonotone"),connectNulls:e.get("connectNulls")})}this._data=a,this._coordSys=r,this._stackedOnPoints=_,this._points=l,this._step=S,this._valueOrigin=y},dispose:function(){},highlight:function(e,t,i,r){var n=e.getData(),a=Gn(n,r);if(!(a instanceof Array)&&null!=a&&0<=a){var o=n.getItemGraphicEl(a);if(!o){var s=n.getItemLayout(a);if(!s)return;if(this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(s[0],s[1]))return;(o=new km(n,a)).position=s,o.setZ(e.get("zlevel"),e.get("z")),o.ignore=isNaN(s[0])||isNaN(s[1]),o.__temp=!0,n.setItemGraphicEl(a,o),o.stopSymbolAnimation(!0),this.group.add(o)}o.highlight()}else sd.prototype.highlight.call(this,e,t,i,r)},downplay:function(e,t,i,r){var n=e.getData(),a=Gn(n,r);if(null!=a&&0<=a){var o=n.getItemGraphicEl(a);o&&(o.__temp?(n.setItemGraphicEl(a,null),this.group.remove(o)):o.downplay())}else sd.prototype.downplay.call(this,e,t,i,r)},_newPolyline:function(e){var t=this._polyline;return t&&this._lineGroup.remove(t),t=new cg({shape:{points:e},silent:!0,z2:10}),this._lineGroup.add(t),this._polyline=t},_newPolygon:function(e,t){var i=this._polygon;return i&&this._lineGroup.remove(i),i=new dg({shape:{points:e,stackedOnPoints:t},silent:!0}),this._lineGroup.add(i),this._polygon=i},_updateAnimation:function(e,t,i,r,n,a){var o=this._polyline,s=this._polygon,l=e.hostModel,u=function(e,t,i,r,n,a,o,s){for(var l=Km(e,t),u=[],c=[],d=[],h=[],p=[],f=[],m=[],g=Zm(n,t,o),y=Zm(a,e,s),v=0;vt&&(t=e[i]);return isFinite(t)?t:NaN},min:function(e){for(var t=1/0,i=0;it[1]&&t.reverse(),t},getOtherAxis:function(){this.grid.getOtherAxis()},pointToData:function(e,t){return this.coordToData(this.toLocalCoord(e["x"===this.dim?0:1]),t)},toLocalCoord:null,toGlobalCoord:null},b(Pg,Dm);var Mg={show:!0,zlevel:0,z:0,inverse:!1,name:"",nameLocation:"end",nameRotate:null,nameTruncate:{maxWidth:null,ellipsis:"...",placeholder:"."},nameTextStyle:{},nameGap:15,silent:!1,triggerEvent:!1,tooltip:{show:!1},axisPointer:{},axisLine:{show:!0,onZero:!0,onZeroAxisIndex:null,lineStyle:{color:"#333",width:1,type:"solid"},symbol:["none","none"],symbolSize:[10,15]},axisTick:{show:!0,inside:!1,length:5,lineStyle:{width:1}},axisLabel:{show:!0,inside:!1,rotate:0,showMinLabel:null,showMaxLabel:null,margin:8,fontSize:12},splitLine:{show:!0,lineStyle:{color:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"]}}},Dg={};Dg.categoryAxis=g({boundaryGap:!0,deduplication:null,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"}},Mg),Dg.valueAxis=g({boundaryGap:[0,0],splitNumber:5,minorTick:{show:!1,splitNumber:5,length:3,lineStyle:{}},minorSplitLine:{show:!1,lineStyle:{color:"#eee",width:1}}},Mg),Dg.timeAxis=D({scale:!0,min:"dataMin",max:"dataMax"},Dg.valueAxis),Dg.logAxis=D({scale:!0,logBase:10},Dg.valueAxis);var Ig=["value","category","time","log"],Og=function(o,e,s,t){k(Ig,function(a){e.extend({type:o+"Axis."+a,mergeDefaultAndTheme:function(e,t){var i=this.layoutMode,r=i?Au(e):{},n=t.getTheme();g(e,n.get(a+"Axis")),g(e,this.getDefaultOption()),e.type=s(o,e),i&&bu(e,r,i)},optionUpdated:function(){var e=this.option;"category"===e.type&&(this.__ordinalMeta=lf.createByAxisModel(this))},getCategories:function(e){var t=this.option;if("category"===t.type)return e?t.data:this.__ordinalMeta.categories},getOrdinalMeta:function(){return this.__ordinalMeta},defaultOption:m([{},Dg[a+"Axis"],t],!0)})}),Eu.registerSubTypeDefaulter(o+"Axis",P(s,o))},Rg=Eu.extend({type:"cartesian2dAxis",axis:null,init:function(){Rg.superApply(this,"init",arguments),this.resetRange()},mergeOption:function(){Rg.superApply(this,"mergeOption",arguments),this.resetRange()},restoreData:function(){Rg.superApply(this,"restoreData",arguments),this.resetRange()},getCoordSysModel:function(){return this.ecModel.queryComponents({mainType:"grid",index:this.option.gridIndex,id:this.option.gridId})[0]}});function Lg(e,t){return t.type||(t.data?"category":"value")}g(Rg.prototype,im);var Ng={offset:0};function kg(e,t,i){return e.getCoordSysModel()===t}function Bg(e,t,i){this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this._initCartesian(e,t,i),this.model=e}Og("x",Rg,Lg,Ng),Og("y",Rg,Lg,Ng),Eu.extend({type:"grid",dependencies:["xAxis","yAxis"],layoutMode:"box",coordinateSystem:null,defaultOption:{show:!1,zlevel:0,z:0,left:"10%",top:60,right:"10%",bottom:60,containLabel:!1,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"}});var Fg=Bg.prototype;function Vg(e,t,i,r){i.getAxesOnZeroOf=function(){return n?[n]:[]};var n,a=e[t],o=i.model,s=o.get("axisLine.onZero"),l=o.get("axisLine.onZeroAxisIndex");if(s){if(null!=l)zg(a[l])&&(n=a[l]);else for(var u in a)if(a.hasOwnProperty(u)&&zg(a[u])&&!r[c(a[u])]){n=a[u];break}n&&(r[c(n)]=!0)}function c(e){return e.dim+"_"+e.index}}function zg(e){return e&&"category"!==e.type&&"time"!==e.type&&function(e){var t=e.scale.getExtent(),i=t[0],r=t[1];return!(0u[1]?-1:1,d=["start"===a?u[0]-c*l:"end"===a?u[1]+c*l:(u[0]+u[1])/2,Jg(a)?e.labelOffset+o*l:0],h=t.get("nameRotate");null!=h&&(h=h*Hg/180),Jg(a)?r=Qg(e.rotation,null!=h?h:e.rotation,o):(r=function(e,t,i,r){var n,a,o=Gl(i-e.rotation),s=r[0]>r[1],l="start"===t&&!s||"start"!==t&&s;n=$l(o-Hg/2)?(a=l?"bottom":"top","center"):$l(o-1.5*Hg)?(a=l?"top":"bottom","center"):(a="middle",o<1.5*Hg&&Hg/2l[1]&&l.reverse(),(null==o||o>l[1])&&(o=l[1]);o1){var d;if(typeof n==="string"){d=Ag[n]}else if(typeof n==="function"){d=n}if(d){e.setData(r.downSample(r.mapDimension(s.dim),1/c,d,Sg))}}}}}}("line"));var yy=Qc.extend({type:"series.__base_bar__",getInitialData:function(e,t){return of(this.getSource(),this,{useEncodeDefaulter:!0})},getMarkerPosition:function(e){var t=this.coordinateSystem;if(t){var i=t.dataToPoint(t.clampData(e)),r=this.getData(),n=r.getLayout("offset"),a=r.getLayout("size"),o=t.getBaseAxis().isHorizontal()?0:1;return i[o]+=n+a/2,i}return[NaN,NaN]},defaultOption:{zlevel:0,z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,barMinHeight:0,barMinAngle:0,large:!1,largeThreshold:400,progressive:3e3,progressiveChunkMode:"mod",itemStyle:{},emphasis:{}}});function vy(e,t,i,r,n,a,o){var s=i.getModel("label"),l=i.getModel("emphasis.label");Ks(e,t,s,l,{labelFetcher:n,labelDataIndex:a,defaultText:Nm(n.getData(),a),isRectText:!0,autoColor:r}),_y(e),_y(t)}function _y(e,t){"outside"===e.textPosition&&(e.textPosition=t)}yy.extend({type:"series.bar",dependencies:["grid","polar"],brushSelector:"rect",getProgressive:function(){return!!this.get("large")&&this.get("progressive")},getProgressiveThreshold:function(){var e=this.get("progressiveThreshold"),t=this.get("largeThreshold");return e=r.r0}}});var jy=function(i,e){k(e,function(a){a.update="updateView",up(a,function(e,t){var n={};return t.eachComponent({mainType:"series",subType:i,query:e},function(i){i[a.method]&&i[a.method](e.name,e.dataIndex);var r=i.getData();r.each(function(e){var t=r.getName(e);n[t]=i.isSelected(t)||!1})}),{name:e.name,selected:n,seriesId:e.seriesId}})})},qy=function(r){return{getTargetSeries:function(e){var t={},i=te();return e.eachSeriesByType(r,function(e){e.__paletteScope=t,i.set(e.uid,e)}),i},reset:function(s,e){var l=s.getRawData(),u={},c=s.getData();c.each(function(e){var t=c.getRawIndex(e);u[t]=e}),l.each(function(e){var t,i=u[e],r=null!=i&&c.getItemVisual(i,"color",!0),n=null!=i&&c.getItemVisual(i,"borderColor",!0);if(r&&n||(t=l.getItemModel(e)),!r){var a=t.get("itemStyle.color")||s.getColorFromPalette(l.getName(e)||e+"",s.__paletteScope,l.count());null!=i&&c.setItemVisual(i,"color",a)}if(!n){var o=t.get("itemStyle.borderColor");null!=i&&c.setItemVisual(i,"borderColor",o)}})}}},Qy=Math.PI/180;function Yy(a,e,t,i,r,n,o,s,l,u){function c(e,t,i,r){for(var n=e;nl+o);n++)if(a[n].y+=i,ea[n].y+a[n].height)return void d(n,i/2);d(t-1,i/2)}function d(e,t){for(var i=e;0<=i&&!(a[i].y-ta[i-1].y+a[i-1].height));i--);}function h(e,t,i,r,n,a){for(var o=t?Number.MAX_VALUE:0,s=0,l=e.length;s=t?y.push(a[v]):g.push(a[v]);h(g,!1,e,t,i,r),h(y,!0,e,t,i,r)}function Xy(e){return"center"===e.position}var Zy=function(I,O,R,e,L,t){var N,k,B=I.getData(),F=[],V=!1,z=(I.get("minShowLabelAngle")||0)*Qy;B.each(function(e){var t=B.getItemLayout(e),i=B.getItemModel(e),r=i.getModel("label"),n=r.get("position")||i.get("emphasis.label.position"),a=r.get("distanceToLabelLine"),o=r.get("alignTo"),s=Ll(r.get("margin"),R),l=r.get("bleedMargin"),u=r.getFont(),c=i.getModel("labelLine"),d=c.get("length");d=Ll(d,R);var h=c.get("length2");if(h=Ll(h,R),!(t.anglei[0]&&isFinite(c)&&isFinite(i[0]););else{var l=n.getTicks().length-1;d"+B(t,function(e,t){var i=n.get(n.mapDimension(e.dim),r);return ru(e.name+" : "+i)}).join("
")},getTooltipPosition:function(e){if(null!=e)for(var t=this.getData(),i=this.coordinateSystem,r=t.getValues(B(i.dimensions,function(e){return t.mapDimension(e)}),e,!0),n=0,a=r.length;n"+ru(r+" : "+i)},getTooltipPosition:function(e){if(null!=e){var t=this.getData().getName(e),i=this.coordinateSystem,r=i.getRegion(t);return r&&i.dataToPoint(r.center)}},setZoom:function(e){this.option.zoom=e},setCenter:function(e){this.option.center=e},defaultOption:{zlevel:0,z:2,coordinateSystem:"geo",map:"",left:"center",top:"center",aspectScale:.75,showLegendSymbol:!0,dataRangeHoverLink:!0,boundingCoords:null,center:null,zoom:1,scaleLimit:null,label:{show:!1,color:"#000"},itemStyle:{borderWidth:.5,borderColor:"#444",areaColor:"#eee"},emphasis:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{areaColor:"rgba(255,215,0,0.8)"}},nameProperty:"name"}}),Vy);var Pv="\0_ec_interaction_mutex";function Mv(e,t){return!!Dv(e)[t]}function Dv(e){return e[Pv]||(e[Pv]={})}function Iv(i){this.pointerChecker,this._zr=i,this._opt={};var e=T,r=e(Ov,this),n=e(Rv,this),a=e(Lv,this),o=e(Nv,this),s=e(kv,this);Ie.call(this),this.setPointerChecker=function(e){this.pointerChecker=e},this.enable=function(e,t){this.disable(),this._opt=D(I(t)||{},{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),null==e&&(e=!0),!0!==e&&"move"!==e&&"pan"!==e||(i.on("mousedown",r),i.on("mousemove",n),i.on("mouseup",a)),!0!==e&&"scale"!==e&&"zoom"!==e||(i.on("mousewheel",o),i.on("pinch",s))},this.disable=function(){i.off("mousedown",r),i.off("mousemove",n),i.off("mouseup",a),i.off("mousewheel",o),i.off("pinch",s)},this.dispose=this.disable,this.isDragging=function(){return this._dragging},this.isPinching=function(){return this._pinching}}function Ov(e){if(!(Xe(e)||e.target&&e.target.draggable)){var t=e.offsetX,i=e.offsetY;this.pointerChecker&&this.pointerChecker(e,t,i)&&(this._x=t,this._y=i,this._dragging=!0)}}function Rv(e){if(this._dragging&&Vv("moveOnMouseMove",e,this._opt)&&"pinch"!==e.gestureEvent&&!Mv(this._zr,"globalPan")){var t=e.offsetX,i=e.offsetY,r=this._x,n=this._y,a=t-r,o=i-n;this._x=t,this._y=i,this._opt.preventDefaultMouseMove&&Ye(e.event),Fv(this,"pan","moveOnMouseMove",e,{dx:a,dy:o,oldX:r,oldY:n,newX:t,newY:i})}}function Lv(e){Xe(e)||(this._dragging=!1)}function Nv(e){var t=Vv("zoomOnMouseWheel",e,this._opt),i=Vv("moveOnMouseWheel",e,this._opt),r=e.wheelDelta,n=Math.abs(r),a=e.offsetX,o=e.offsetY;if(0!==r&&(t||i)){if(t){var s=3t&&(t=r.height)}this.height=t+1},getNodeById:function(e){if(this.getId()===e)return this;for(var t=0,i=this.children,r=i.length;ta&&(a=e.depth)});var o=e.expandAndCollapse,s=o&&0<=e.initialTreeDepth?e.initialTreeDepth:a;return n.root.eachNode("preorder",function(e){var t=e.hostTree.data.getRawDataItem(e.dataIndex);e.isExpand=t&&null!=t.collapsed?!t.collapsed:e.depth<=s}),n.data},getOrient:function(){var e=this.get("orient");return"horizontal"===e?e="LR":"vertical"===e&&(e="TB"),e},setZoom:function(e){this.option.zoom=e},setCenter:function(e){this.option.center=e},formatTooltip:function(e){for(var t=this.getData().tree,i=t.root.children[0],r=t.getNodeByDataIndex(e),n=r.getValue(),a=r.name;r&&r!==i;)a=r.parentNode.name+"."+a,r=r.parentNode;return ru(a+(isNaN(n)||null==n?"":" : "+n))},defaultOption:{zlevel:0,z:2,coordinateSystem:"view",left:"12%",top:"12%",right:"12%",bottom:"12%",layout:"orthogonal",edgeShape:"curve",edgeForkPosition:"50%",roam:!1,nodeScaleRatio:.4,center:null,zoom:1,orient:"LR",symbol:"emptyCircle",symbolSize:7,expandAndCollapse:!0,initialTreeDepth:2,lineStyle:{color:"#ccc",width:1.5,curveness:.5},itemStyle:{color:"lightsteelblue",borderColor:"#c23531",borderWidth:1.5},label:{show:!0,color:"#555"},leaves:{label:{show:!0}},animationEasing:"linear",animationDuration:700,animationDurationUpdate:1e3}});var D_=Ts({shape:{parentPoint:[],childPoints:[],orient:"",forkPosition:""},style:{stroke:"#000",fill:null},buildPath:function(e,t){var i=t.childPoints,r=i.length,n=t.parentPoint,a=i[0],o=i[r-1];if(1===r)return e.moveTo(n[0],n[1]),void e.lineTo(a[0],a[1]);var s=t.orient,l="TB"===s||"BT"===s?0:1,u=1-l,c=Ll(t.forkPosition,1),d=[];d[l]=n[l],d[u]=n[u]+(o[u]-n[u])*c,e.moveTo(n[0],n[1]),e.lineTo(d[0],d[1]),e.moveTo(a[0],a[1]),d[l]=a[l],e.lineTo(d[0],d[1]),d[l]=o[l],e.lineTo(d[0],d[1]),e.lineTo(o[0],o[1]);for(var h=1;h_.x)||(g-=Math.PI);var b=y?"left":"right",A=a.labelModel.get("rotate"),S=A*(Math.PI/180);m.setStyle({textPosition:a.labelModel.get("position")||b,textRotation:null==A?-g:S,textOrigin:"center",verticalAlign:"middle"})}!function(e,t,i,r,n,a,o,s,l){var u=l.edgeShape,c=r.__edge;if("curve"===u)t.parentNode&&t.parentNode!==i&&ul(c=c||(r.__edge=new us({shape:N_(l,n,n),style:D({opacity:0,strokeNoScale:!0},l.lineStyle)})),{shape:N_(l,a,o),style:{opacity:1}},e);else if("polyline"===u)if("orthogonal"===l.layout){if(t!==i&&t.children&&0!==t.children.length&&!0===t.isExpand){for(var d=t.children,h=[],p=0;pd.getLayout().x&&(d=e),e.depth>h.depth&&(h=e)});var p=c===d?1:s(c,d)/2,f=p-c.getLayout().x,m=0,g=0,y=0,v=0;if("radial"===n)m=a/(d.getLayout().x+p+f),g=o/(h.depth-1||1),B_(u,function(e){y=(e.getLayout().x+f)*m,v=(e.depth-1)*g;var t=w_(y,v);e.setLayout({x:t.x,y:t.y,rawX:y,rawY:v},!0)});else{var _=e.getOrient();"RL"===_||"LR"===_?(g=o/(d.getLayout().x+p+f),m=a/(h.depth-1||1),B_(u,function(e){v=(e.getLayout().x+f)*g,y="LR"===_?(e.depth-1)*m:a-(e.depth-1)*m,e.setLayout({x:y,y:v},!0)})):"TB"!==_&&"BT"!==_||(m=a/(d.getLayout().x+p+f),g=o/(h.depth-1||1),B_(u,function(e){y=(e.getLayout().x+f)*m,v="TB"===_?(e.depth-1)*g:o-(e.depth-1)*g,e.setLayout({x:y,y:v},!0)}))}}}function V_(e,t,i){if(e&&0<=x(t,e.type)){var r=i.getData().tree.root,n=e.targetNode;if("string"==typeof n&&(n=r.getNodeById(n)),n&&r.contains(n))return{node:n};var a=e.targetNodeId;if(null!=a&&(n=r.getNodeById(a)))return{node:n}}}function z_(e){for(var t=[];e;)(e=e.parentNode)&&t.push(e);return t.reverse()}function U_(e,t){var i=z_(e);return 0<=x(i,t)}function G_(e,t){for(var i=[];e;){var r=e.dataIndex;i.push({name:e.name,dataIndex:r,value:t.getRawValue(r)}),e=e.parentNode}return i.reverse(),i}hp(xg("tree","circle")),dp(function(e,t){e.eachSeriesByType("tree",function(e){F_(e,t)})}),Qc.extend({type:"series.treemap",layoutMode:"box",dependencies:["grid","polar"],preventUsingHoverLayer:!0,_viewRoot:null,defaultOption:{progressive:0,left:"center",top:"middle",right:null,bottom:null,width:"80%",height:"80%",sort:!0,clipWindow:"origin",squareRatio:.5*(1+Math.sqrt(5)),leafDepth:null,drillDownIcon:"▶",zoomToNodeRatio:.1024,roam:!0,nodeClick:"zoomToNode",animation:!0,animationDurationUpdate:900,animationEasing:"quinticInOut",breadcrumb:{show:!0,height:22,left:"center",top:"bottom",emptyItemWidth:25,itemStyle:{color:"rgba(0,0,0,0.7)",borderColor:"rgba(255,255,255,0.7)",borderWidth:1,shadowColor:"rgba(150,150,150,1)",shadowBlur:3,shadowOffsetX:0,shadowOffsetY:0,textStyle:{color:"#fff"}},emphasis:{textStyle:{}}},label:{show:!0,distance:0,padding:5,position:"inside",color:"#fff",ellipsis:!0},upperLabel:{show:!1,position:[0,"50%"],height:20,color:"#fff",ellipsis:!0,verticalAlign:"middle"},itemStyle:{color:null,colorAlpha:null,colorSaturation:null,borderWidth:0,gapWidth:0,borderColor:"#fff",borderColorSaturation:null},emphasis:{upperLabel:{show:!0,position:[0,"50%"],color:"#fff",ellipsis:!0,verticalAlign:"middle"}},visualDimension:0,visualMin:null,visualMax:null,color:[],colorAlpha:null,colorSaturation:null,colorMappingBy:"index",visibleMin:10,childrenVisibleMin:null,levels:[]},getInitialData:function(e,t){var i={name:e.name,children:e.data};!function i(e){var r=0;k(e.children,function(e){i(e);var t=e.value;R(t)&&(t=t[0]),r+=t});var t=e.value;R(t)&&(t=t[0]);null!=t&&!isNaN(t)||(t=r);t<0&&(t=0);R(e.value)?e.value[0]=t:e.value=t}(i);var r=e.levels||[],n=B((r=e.levels=function(e,t){var r,i=t.get("color");if(!i)return;if(k(e=e||[],function(e){var t=new Tl(e),i=t.get("color");(t.get("itemStyle.color")||i&&"none"!==i)&&(r=!0)}),!r){(e[0]||(e[0]={})).color=i.slice()}return e}(r,t))||[],function(e){return new Tl(e,this,t)},this),a=__.createTree(i,this,null,function(e){e.wrapMethod("getItemModel",function(e,t){var i=a.getNodeByDataIndex(t),r=n[i.depth];return r&&(e.parentModel=r),e})});return a.data},optionUpdated:function(){this.resetViewRoot()},formatTooltip:function(e){var t=this.getData(),i=this.getRawValue(e),r=R(i)?Jl(i[0]):Jl(i),n=t.getName(e);return ru(n+": "+r)},getDataParams:function(e){var t=Qc.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(e);return t.treePathInfo=G_(i,this),t},setLayoutInfo:function(e){this.layoutInfo=this.layoutInfo||{},O(this.layoutInfo,e)},mapIdToIndex:function(e){var t=this._idIndexMap;t||(t=this._idIndexMap=te(),this._idIndexMapCount=0);var i=t.get(e);return null==i&&t.set(e,i=this._idIndexMapCount++),i},getViewRoot:function(){return this._viewRoot},resetViewRoot:function(e){e?this._viewRoot=e:e=this._viewRoot;var t=this.getRawData().tree.root;e&&(e===t||t.contains(e))||(this._viewRoot=t)}});var $_=5;function H_(e){this.group=new Ti,e.add(this.group)}function W_(e,t,i,r,n,a){var o=[[n?e:e-$_,t],[e+i,t],[e+i,t+r],[n?e:e-$_,t+r]];return a||o.splice(2,0,[e+i+$_,t+r/2]),n||o.push([e,t+r/2]),o}H_.prototype={constructor:H_,render:function(e,t,i,r){var n=e.getModel("breadcrumb"),a=this.group;if(a.removeAll(),n.get("show")&&i){var o=n.getModel("itemStyle"),s=o.getModel("textStyle"),l={pos:{left:n.get("left"),right:n.get("right"),top:n.get("top"),bottom:n.get("bottom")},box:{width:t.getWidth(),height:t.getHeight()},emptyItemWidth:n.get("emptyItemWidth"),totalWidth:0,renderList:[]};this._prepare(i,l,s),this._renderContent(e,l,o,s,r),xu(a,l.pos,l.box)}},_prepare:function(e,t,i){for(var r=e;r;r=r.parentNode){var n=r.getModel().get("name"),a=i.getTextRect(n),o=Math.max(a.width+16,t.emptyItemWidth);t.totalWidth+=o+8,t.renderList.push({node:r,text:n,width:o})}},_renderContent:function(e,t,i,r,n){for(var a,o,s=0,l=t.emptyItemWidth,u=e.get("breadcrumb.height"),c=function(e,t,i){var r=t.width,n=t.height,a=Ll(e.x,r),o=Ll(e.y,n),s=Ll(e.x2,r),l=Ll(e.y2,n);return(isNaN(a)||isNaN(parseFloat(e.x)))&&(a=0),(isNaN(s)||isNaN(parseFloat(e.x2)))&&(s=r),(isNaN(o)||isNaN(parseFloat(e.y)))&&(o=0),(isNaN(l)||isNaN(parseFloat(e.y2)))&&(l=n),i=eu(i||0),{width:Math.max(s-a-i[1]-i[3],0),height:Math.max(l-o-i[0]-i[2],0)}}(t.pos,t.box),d=t.totalWidth,h=t.renderList,p=h.length-1;0<=p;p--){var f=h[p],m=f.node,g=f.width,y=f.text;d>c.width&&(d-=g-l,g=l,y=null);var v=new Zo({shape:{points:W_(s,0,g,u,p===h.length-1,0===p)},style:D(i.getItemStyle(),{lineJoin:"bevel",text:y,textFill:r.getTextColor(),textFont:r.getFont()}),z:10,onclick:P(n,m)});this.group.add(v),a=e,o=m,v.eventData={componentType:"series",componentSubType:"treemap",componentIndex:a.componentIndex,seriesIndex:a.componentIndex,seriesName:a.name,seriesType:"treemap",selfType:"breadcrumb",nodeData:{dataIndex:o&&o.dataIndex,name:o&&o.name},treePathInfo:o&&G_(o,a)},s+=g+8}},remove:function(){this.group.removeAll()}};var j_=T,q_=Ti,Q_=ns,Y_=k,X_=["label"],Z_=["emphasis","label"],J_=["upperLabel"],K_=["emphasis","upperLabel"],eC=10,tC=aa([["fill","color"],["stroke","strokeColor"],["lineWidth","strokeWidth"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"]]),iC=function(e){var t=tC(e);return t.stroke=t.fill=t.lineWidth=null,t};function rC(c,o,s,l,u,t,d,e,i,r){if(d){var h=d.getLayout(),n=c.getData();if(n.setItemGraphicEl(d.dataIndex,null),h&&h.isInView){var p=h.width,f=h.height,m=h.borderWidth,g=h.invisible,y=d.getRawIndex(),v=e&&e.getRawIndex(),a=d.viewChildren,_=h.upperHeight,C=a&&a.length,x=d.getModel("itemStyle"),b=d.getModel("emphasis.itemStyle"),A=D("nodeGroup",q_);if(A){if(i.add(A),A.attr("position",[h.x||0,h.y||0]),A.__tmNodeWidth=p,A.__tmNodeHeight=f,h.isAboveViewRoot)return A;var S=d.getModel(),w=D("background",Q_,r,1);if(w&&function(e,t,i){if(t.dataIndex=d.dataIndex,t.seriesIndex=c.seriesIndex,t.setShape({x:0,y:0,width:p,height:f}),g)T(t);else{t.invisible=!1;var r=d.getVisual("borderColor",!0),n=b.get("borderColor"),a=iC(x);a.fill=r;var o=tC(b);if(o.fill=n,i){var s=p-2*m;P(a,o,r,s,_,{x:m,y:0,width:s,height:_})}else a.text=o.text=null;t.setStyle(a),$s(t,o)}e.add(t)}(A,w,C&&h.upperLabelHeight),C)Zs(A)&&Xs(A,!1),w&&(Xs(w,!0),n.setItemGraphicEl(d.dataIndex,w));else{var E=D("content",Q_,r,2);E&&function(e,t){t.dataIndex=d.dataIndex,t.seriesIndex=c.seriesIndex;var i=Math.max(p-2*m,0),r=Math.max(f-2*m,0);if(t.culling=!0,t.setShape({x:m,y:m,width:i,height:r}),g)T(t);else{t.invisible=!1;var n=d.getVisual("color",!0),a=iC(x);a.fill=n;var o=tC(b);P(a,o,n,i,r),t.setStyle(a),$s(t,o)}e.add(t)}(A,E),w&&Zs(w)&&Xs(w,!1),Xs(A,!0),n.setItemGraphicEl(d.dataIndex,A)}return A}}}function T(e){e.invisible||t.push(e)}function P(e,t,i,r,n,a){var o=S.get("name"),s=S.getModel(a?J_:X_),l=S.getModel(a?K_:Z_),u=s.getShallow("show");Ks(e,t,s,l,{defaultText:u?o:null,autoColor:i,isRectText:!0,labelFetcher:c,labelDataIndex:d.dataIndex,labelProp:a?"upperLabel":"label"}),M(e,a,h),M(t,a,h),a&&(e.textRect=I(a)),e.truncate=u&&s.get("ellipsis")?{outerWidth:r,outerHeight:n,minChar:2}:null}function M(e,t,i){var r=e.text;if(!t&&i.isLeafRoot&&null!=r){var n=c.get("drillDownIcon",!0);e.text=n?n+" "+r:r}}function D(e,t,i,r){var n=null!=v&&s[e][v],a=u[e];return n?(s[e][v]=null,function(e,t,i){(e[y]={}).old="nodeGroup"===i?t.position.slice():O({},t.shape)}(a,n,e)):g||((n=new t({z:function(e,t){var i=e*eC+t;return(i-1)/i}(i,r)})).__tmDepth=i,n.__tmStorageName=e,function(e,t,i){var r=e[y]={},n=d.parentNode;if(n&&(!l||"drillDown"===l.direction)){var a=0,o=0,s=u.background[n.getRawIndex()];!l&&s&&s.old&&(a=s.old.width,o=s.old.height),r.old="nodeGroup"===i?[0,o]:{x:a,y:o,width:0,height:0}}r.fadein="nodeGroup"!==i}(a,0,e)),o[e][y]=n}}vp({type:"treemap",init:function(e,t){this._containerGroup,this._storage={nodeGroup:[],background:[],content:[]},this._oldTree,this._breadcrumb,this._controller,this._state="ready"},render:function(e,t,i,r){var n=t.findComponents({mainType:"series",subType:"treemap",query:r});if(!(x(n,e)<0)){this.seriesModel=e,this.api=i,this.ecModel=t;var a=V_(r,["treemapZoomToNode","treemapRootToNode"],e),o=r&&r.type,s=e.layoutInfo,l=!this._oldTree,u=this._storage,c="treemapRootToNode"===o&&a&&u?{rootNodeGroup:u.nodeGroup[a.node.getRawIndex()],direction:r.direction}:null,d=this._giveContainerGroup(s),h=this._doRender(d,e,c);l||o&&"treemapZoomToNode"!==o&&"treemapRootToNode"!==o?h.renderFinally():this._doAnimation(d,h,e,c),this._resetController(i),this._renderBreadcrumb(e,i,a)}},_giveContainerGroup:function(e){var t=this._containerGroup;return t||(t=this._containerGroup=new q_,this._initEvents(t),this.group.add(t)),t.attr("position",[e.x,e.y]),t},_doRender:function(e,t,i){var r=t.getData().tree,n=this._oldTree,a={nodeGroup:[],background:[],content:[]},o={nodeGroup:[],background:[],content:[]},s=this._storage,l=[],d=P(rC,t,o,s,i,a,l);!function a(o,s,l,u,c){u?Y_(s=o,function(e,t){e.isRemoved()||i(t,t)}):new Cp(s,o,e,e).add(i).update(i).remove(P(i,null)).execute();function e(e){return e.getId()}function i(e,t){var i=null!=e?o[e]:null,r=null!=t?s[t]:null,n=d(i,r,l,c);n&&a(i&&i.viewChildren||[],r&&r.viewChildren||[],n,u,c+1)}}(r.root?[r.root]:[],n&&n.root?[n.root]:[],e,r===n||!n,0);var u=function(e){var r={nodeGroup:[],background:[],content:[]};return e&&Y_(e,function(e,t){var i=r[t];Y_(e,function(e){e&&(i.push(e),e.__tmWillDelete=1)})}),r}(s);return this._oldTree=r,this._storage=o,{lastsForAnimation:a,willDeleteEls:u,renderFinally:function(){Y_(u,function(e){Y_(e,function(e){e.parent&&e.parent.remove(e)})}),Y_(l,function(e){e.invisible=!0,e.dirty()})}}},_doAnimation:function(e,a,t,s){if(t.get("animation")){var l=t.get("animationDurationUpdate"),u=t.get("animationEasing"),c=function(){var a,o=[],s={};return{add:function(e,t,i,r,n){return F(r)&&(n=r,r=0),!s[e.id]&&(s[e.id]=1,o.push({el:e,target:t,time:i,delay:r,easing:n}),!0)},done:function(e){return a=e,this},start:function(){for(var e=o.length,t=0,i=o.length;t=o.length||e===o[e.depth]){var i=IC(l,d,e,t,v,s);r(e,i,n,a,o,s)}})}else f=TC(d),e.setVisual("color",f)}(a,{},s,o,e.getViewRoot().getAncestors(),e)}}};function EC(i,r,n,a){var o=O({},r);return k(["color","colorAlpha","colorSaturation"],function(e){var t=i.get(e,!0);null==t&&n&&(t=n[e]),null==t&&(t=r[e]),null==t&&(t=a.get(e)),null!=t&&(o[e]=t)}),o}function TC(e){var t=PC(e,"color");if(t){var i=PC(e,"colorAlpha"),r=PC(e,"colorSaturation");return r&&(t=Jt(t,null,null,r)),i&&(t=Kt(t,i)),t}}function PC(e,t){var i=e[t];if(null!=i&&"none"!==i)return i}function MC(e,t,i,r,n,a){if(a&&a.length){var o=DC(t,"color")||null!=n.color&&"none"!==n.color&&(DC(t,"colorAlpha")||DC(t,"colorSaturation"));if(o){var s=t.get("visualMin"),l=t.get("visualMax"),u=i.dataExtent.slice();null!=s&&su[1]&&(u[1]=l);var c=t.get("colorMappingBy"),d={type:o.name,dataExtent:u,visual:o.range};"color"!==d.type||"index"!==c&&"id"!==c?d.mappingMethod="linear":(d.mappingMethod="category",d.loop=!0);var h=new cC(d);return h.__drColorMappingBy=c,h}}}function DC(e,t){var i=e.get(t);return AC(i)&&i.length?{name:t,range:i}:null}function IC(e,t,i,r,n,a){var o=O({},t);if(n){var s=n.type,l="color"===s&&n.__drColorMappingBy,u="index"===l?r:"id"===l?a.mapIdToIndex(i.getId()):i.getValue(e.get("visualDimension"));o[s]=n.mapValueToVisual(u)}return o}var OC=Math.max,RC=Math.min,LC=H,NC=k,kC=["itemStyle","borderWidth"],BC=["itemStyle","gapWidth"],FC=["upperLabel","show"],VC=["upperLabel","height"],zC={seriesType:"treemap",reset:function(e,t,i,r){var n=i.getWidth(),a=i.getHeight(),o=e.option,s=Cu(e.getBoxLayoutParams(),{width:i.getWidth(),height:i.getHeight()}),l=o.size||[],u=Ll(LC(s.width,l[0]),n),c=Ll(LC(s.height,l[1]),a),d=r&&r.type,h=V_(r,["treemapZoomToNode","treemapRootToNode"],e),p="treemapRender"===d||"treemapMove"===d?r.rootRect:null,f=e.getViewRoot(),m=z_(f);if("treemapMove"!==d){var g="treemapZoomToNode"===d?function(e,t,i,r,n){var a,o=(t||{}).node,s=[r,n];if(!o||o===i)return s;var l=r*n,u=l*e.option.zoomToNodeRatio;for(;a=o.parentNode;){for(var c=0,d=a.children,h=0,p=d.length;hs[1]&&(s[1]=t)})}else s=[NaN,NaN];return{sum:r,dataExtent:s}}(t,o,s);if(0===u.sum)return e.viewChildren=[];if(u.sum=function(e,t,i,r,n){if(!r)return i;for(var a=e.get("visibleMin"),o=n.length,s=o,l=o-1;0<=l;l--){var u=n["asc"===r?o-l-1:l].getValue();u/i*ti[l[o]])&&(c=i[l[o]]);for(var d=0,h=e.length;d "+h)),u++)}var p,f=i.get("coordinateSystem");if("cartesian2d"===f||"polar"===f)p=of(e,i);else{var m=rc.get(f),g=m&&"view"!==m.type&&m.dimensions||[];x(g,"value")<0&&g.concat(["value"]);var y=Jp(e,{coordDimensions:g});(p=new kp(y,i)).initData(e)}var v=new kp(["value"],i);return v.initData(l,s),n&&n(p,v),d_({mainData:p,struct:a,structAttr:"graph",datas:{node:p,edge:v},datasAttr:{node:"data",edge:"edgeData"}}),a.update(),a},JC=yp({type:"series.graph",init:function(e){JC.superApply(this,"init",arguments);var t=this;function i(){return t._categoriesData}this.legendVisualProvider=new zy(i,i),this.fillDataTextStyle(e.edges||e.links),this._updateCategoriesData()},mergeOption:function(e){JC.superApply(this,"mergeOption",arguments),this.fillDataTextStyle(e.edges||e.links),this._updateCategoriesData()},mergeDefaultAndTheme:function(e){JC.superApply(this,"mergeDefaultAndTheme",arguments),Nn(e,["edgeLabel"],["show"])},getInitialData:function(e,s){var t=e.edges||e.links||[],i=e.data||e.nodes||[],l=this;if(i&&t)return ZC(i,t,this,!0,function(e,t){e.wrapMethod("getItemModel",function(e){var t=l._categoriesModels[e.getShallow("category")];return t&&(t.parentModel=e.parentModel,e.parentModel=t),e});var i=l.getModel("edgeLabel"),r=new Tl({label:i.option},i.parentModel,s),n=l.getModel("emphasis.edgeLabel"),a=new Tl({emphasis:{label:n.option}},n.parentModel,s);function o(e){return(e=this.parsePath(e))&&"label"===e[0]?r:e&&"emphasis"===e[0]&&"label"===e[1]?a:this.parentModel}t.wrapMethod("getItemModel",function(e){return e.customizeGetParent(o),e})}).data},getGraph:function(){return this.getData().graph},getEdgeData:function(){return this.getGraph().edgeData},getCategoriesData:function(){return this._categoriesData},formatTooltip:function(e,t,i){if("edge"!==i)return JC.superApply(this,"formatTooltip",arguments);var r=this.getData(),n=this.getDataParams(e,i),a=r.graph.getEdgeByIndex(e),o=r.getName(a.node1.dataIndex),s=r.getName(a.node2.dataIndex),l=[];return null!=o&&l.push(o),null!=s&&l.push(s),l=ru(l.join(" > ")),n.value&&(l+=" : "+ru(n.value)),l},_updateCategoriesData:function(){var e=B(this.option.categories||[],function(e){return null!=e.value?e:O({value:0},e)}),t=new kp(["value"],this);t.initData(e),this._categoriesData=t,this._categoriesModels=t.mapArray(function(e){return t.getItemModel(e,!0)})},setZoom:function(e){this.option.zoom=e},setCenter:function(e){this.option.center=e},isAnimationEnabled:function(){return JC.superCall(this,"isAnimationEnabled")&&!("force"===this.get("layout")&&this.get("force.layoutAnimation"))},defaultOption:{zlevel:0,z:2,coordinateSystem:"view",legendHoverLink:!0,hoverAnimation:!0,layout:null,focusNodeAdjacency:!1,circular:{rotateLabel:!1},force:{initLayout:null,repulsion:[0,50],gravity:.1,friction:.6,edgeLength:30,layoutAnimation:!0},left:"center",top:"center",symbol:"circle",symbolSize:10,edgeSymbol:["none","none"],edgeSymbolSize:10,edgeLabel:{position:"middle",distance:5},draggable:!1,roam:!1,center:null,zoom:1,nodeScaleRatio:.6,label:{show:!1,formatter:"{b}"},itemStyle:{},lineStyle:{color:"#aaa",width:1,curveness:0,opacity:.5},emphasis:{label:{show:!0}}}}),KC=os.prototype,ex=us.prototype;function tx(e){return isNaN(+e.cpx1)||isNaN(+e.cpy1)}var ix=Ts({type:"ec-line",style:{stroke:"#000",fill:null},shape:{x1:0,y1:0,x2:0,y2:0,percent:1,cpx1:null,cpy1:null},buildPath:function(e,t){this[tx(t)?"_buildPathLine":"_buildPathCurve"](e,t)},_buildPathLine:KC.buildPath,_buildPathCurve:ex.buildPath,pointAt:function(e){return this[tx(this.shape)?"_pointAtLine":"_pointAtCurve"](e)},_pointAtLine:KC.pointAt,_pointAtCurve:ex.pointAt,tangentAt:function(e){var t=this.shape,i=tx(t)?[t.x2-t.x1,t.y2-t.y1]:this._tangentAtCurve(e);return ve(i,i)},_tangentAtCurve:ex.tangentAt}),rx=["fromSymbol","toSymbol"];function nx(e){return"_"+e+"Type"}function ax(e,t,i){var r=t.getItemVisual(i,"color"),n=t.getItemVisual(i,e),a=t.getItemVisual(i,e+"Size");if(n&&"none"!==n){R(a)||(a=[a,a]);var o=dm(n,-a[0]/2,-a[1]/2,a[0],a[1],r);return o.name=e,o}}function ox(e,t){e.x1=t[0][0],e.y1=t[0][1],e.x2=t[1][0],e.y2=t[1][1],e.percent=1;var i=t[2];i?(e.cpx1=i[0],e.cpy1=i[1]):(e.cpx1=NaN,e.cpy1=NaN)}function sx(e,t,i){Ti.call(this),this._createLine(e,t,i)}var lx=sx.prototype;function ux(e){this._ctor=e||sx,this.group=new Ti}lx.beforeUpdate=function(){var e=this.childOfName("fromSymbol"),t=this.childOfName("toSymbol"),i=this.childOfName("label");if(!e&&!t&&i.ignore)return;var r=1,n=this.parent;for(;n;)n.scale&&(r/=n.scale[0]),n=n.parent;var a=this.childOfName("line");if(!this.__dirty&&!a.__dirty)return;var o=a.shape.percent,s=a.pointAt(0),l=a.pointAt(o),u=he([],l,s);if(ve(u,u),e){e.attr("position",s);var c=a.tangentAt(0);e.attr("rotation",Math.PI/2-Math.atan2(c[1],c[0])),e.attr("scale",[r*o,r*o])}if(t){t.attr("position",l);c=a.tangentAt(1);t.attr("rotation",-Math.PI/2-Math.atan2(c[1],c[0])),t.attr("scale",[r*o,r*o])}if(!i.ignore){var d,h,p,f;i.attr("position",l);var m=i.__labelDistance,g=m[0]*r,y=m[1]*r,v=o/2,_=[(c=a.tangentAt(v))[1],-c[0]],C=a.pointAt(v);0<_[1]&&(_[0]=-_[0],_[1]=-_[1]);var x,b=c[0]<0?-1:1;if("start"!==i.__position&&"end"!==i.__position){var A=-Math.atan2(c[1],c[0]);l[0]=e&&(0===t?0:r[t-1][0])a&&(t[1-r]=t[r]+d.sign*a),t};function tb(e,t){var i=e[t]-e[1-t];return{span:Math.abs(i),sign:0n*(1-c[0])?(l="jump",o=s-n*(1-c[2])):0<=(o=s-n*c[1])&&(o=s-n*(1-c[1]))<=0&&(o=0),(o*=t.axisExpandWidth/u)?eb(o,r,a,"all"):l="none";else{var n=r[1]-r[0],h=a[1]*s/n;(r=[ab(0,h-n/2)])[1]=nb(a[1],r[0]+n),r[0]=r[1]-n}return{axisExpandWindow:r,behavior:l}}},rc.register("parallel",{create:function(r,n){var a=[];return r.eachComponent("parallel",function(e,t){var i=new cb(e,r,n);i.name="parallel_"+t,i.resize(e,n),(e.coordinateSystem=i).model=e,a.push(i)}),r.eachSeries(function(e){if("parallel"===e.get("coordinateSystem")){var t=r.queryComponents({mainType:"parallel",index:e.get("parallelIndex"),id:e.get("parallelId")})[0];e.coordinateSystem=t.coordinateSystem}}),a}});var hb=Eu.extend({type:"baseParallelAxis",axis:null,activeIntervals:[],getAreaSelectStyle:function(){return aa([["fill","color"],["lineWidth","borderWidth"],["stroke","borderColor"],["width","width"],["opacity","opacity"]])(this.getModel("areaSelectStyle"))},setActiveIntervals:function(e){var t=this.activeIntervals=I(e);if(t)for(var i=t.length-1;0<=i;i--)kl(t[i])},getActiveState:function(e){var t=this.activeIntervals;if(!t.length)return"normal";if(null==e||isNaN(e))return"inactive";if(1===t.length){var i=t[0];if(i[0]<=e&&e<=i[1])return"active"}else for(var r=0,n=t.length;rCb}(e)||a){if(o&&!a){"single"===s.brushMode&&Bb(e);var l=I(s);l.brushType=Kb(l.brushType,o),l.panelId=!0===o?null:o.panelId,a=e._creatingCover=Mb(e,l),e._covers.push(a)}if(a){var u=iA[Kb(e._brushType,o)],c=a.__brushOption;c.range=u.getCreatingRange(Yb(e,a,e._track)),r&&(Db(e,a),u.updateCommon(e,a)),Ib(e,a),n={isEnd:r}}}else r&&"single"===s.brushMode&&s.removeOnClick&&Nb(e,t,i)&&Bb(e)&&(n={isEnd:r,removeOnClick:!0});return n}function Kb(e,t){return"auto"===e?(M&&Y(t&&t.defaultBrushType,'MUST have defaultBrushType when brushType is "atuo"'),t.defaultBrushType):e}Eb.prototype={constructor:Eb,enableBrush:function(e){return M&&Y(this._mounted),this._brushType&&Pb(this),e.brushType&&Tb(this,e),this},setPanels:function(e){if(e&&e.length){var t=this._panels={};k(e,function(e){t[e.panelId]=I(e)})}else this._panels=null;return this},mount:function(e){e=e||{},M&&(this._mounted=!0),this._enableGlobalPan=e.enableGlobalPan;var t=this.group;return this._zr.add(t),t.attr({position:e.position||[0,0],rotation:e.rotation||0,scale:e.scale||[1,1]}),this._transform=t.getLocalTransform(),this},eachCover:function(e,t){fb(this._covers,e,t)},updateCovers:function(n){M&&Y(this._mounted),n=B(n,function(e){return g(I(Sb),e,!0)});var i="\0-brush-index-",a=this._covers,o=this._covers=[],s=this,l=this._creatingCover;return new Cp(a,n,function(e,t){return r(e.__brushOption,t)},r).add(e).update(e).remove(function(e){a[e]!==l&&s.group.remove(a[e])}).execute(),this;function r(e,t){return(null!=e.id?e.id:i+t)+"-"+e.brushType}function e(e,t){var i=n[e];if(null!=t&&a[t]===l)o[e]=a[t];else{var r=o[e]=null!=t?(a[t].__brushOption=i,a[t]):Db(s,Mb(s,i));Rb(s,r)}}},unmount:function(){if(!M||this._mounted)return this.enableBrush(!1),Bb(this),this._zr.remove(this.group),M&&(this._mounted=!1),this},dispose:function(){this.unmount(),this.off()}},A(Eb,Ie);var eA={mousedown:function(e){if(this._dragging)tA(this,e);else if(!e.target||!e.target.draggable){Xb(e);var t=this.group.transformCoordToLocal(e.offsetX,e.offsetY);this._creatingCover=null;var i=this._creatingPanel=Nb(this,e,t);i&&(this._dragging=!0,this._track=[t.slice()])}},mousemove:function(e){var t=e.offsetX,i=e.offsetY,r=this.group.transformCoordToLocal(t,i);if(function(e,t,i){if(!e._brushType||(r=e,n=t,o=r._zr,n<0||n>o.getWidth()||a<0||a>o.getHeight()))return;var r,n,a,o;var s=e._zr,l=e._covers,u=Nb(e,t,i);if(!e._dragging)for(var c=0;cp&&(p=g.depth),m.setLayout({depth:y?g.depth:d},!0),"vertical"===a?m.setLayout({dy:i},!0):m.setLayout({dx:i},!0);for(var v=0;vo){o=t}});k(t,function(e){var t=new cC({type:"color",mappingMethod:"linear",dataExtent:[a,o],visual:n.get("color")});var i=t.mapValueToVisual(e.getLayout().value);var r=e.getModel().get("itemStyle.color");r!=null?e.setVisual("color",r):e.setVisual("color",i)})}})});var FA={_baseAxisDim:null,getInitialData:function(e,t){var i,r,n=t.getComponent("xAxis",this.get("xAxisIndex")),a=t.getComponent("yAxis",this.get("yAxisIndex")),o=n.get("type"),s=a.get("type");"category"===o?(e.layout="horizontal",i=n.getOrdinalMeta(),r=!0):"category"===s?(e.layout="vertical",i=a.getOrdinalMeta(),r=!0):e.layout=e.layout||"horizontal";var l=["x","y"],u="horizontal"===e.layout?0:1,c=this._baseAxisDim=l[u],d=l[1-u],h=[n,a],p=h[u].get("type"),f=h[1-u].get("type"),m=e.data;if(m&&r){var g=[];k(m,function(e,t){var i;e.value&&R(e.value)?(i=e.value.slice(),e.value.unshift(t)):R(e)?(i=e.slice(),e.unshift(t)):i=e,g.push(i)}),e.data=g}var y=this.defaultValueDimensions,v=[{name:c,type:Sp(p),ordinalMeta:i,otherDims:{tooltip:!1,itemName:0},dimsDef:["base"]},{name:d,type:Sp(f),dimsDef:y.slice()}];return Fy(this,{coordDimensions:v,dimensionsCount:y.length+1,encodeDefaulter:P(Wu,v,this)})},getBaseAxis:function(){var e=this._baseAxisDim;return this.ecModel.getComponent(e+"Axis",this.get(e+"AxisIndex")).axis}};A(Qc.extend({type:"series.boxplot",dependencies:["xAxis","yAxis","grid"],defaultValueDimensions:[{name:"min",defaultTooltip:!0},{name:"Q1",defaultTooltip:!0},{name:"median",defaultTooltip:!0},{name:"Q3",defaultTooltip:!0},{name:"max",defaultTooltip:!0}],dimensions:null,defaultOption:{zlevel:0,z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,hoverAnimation:!0,layout:null,boxWidth:[7,50],itemStyle:{color:"#fff",borderWidth:1},emphasis:{itemStyle:{borderWidth:2,shadowBlur:5,shadowOffsetX:2,shadowOffsetY:2,shadowColor:"rgba(0,0,0,0.4)"}},animationEasing:"elasticOut",animationDuration:800}}),FA,!0);var VA=["itemStyle"],zA=["emphasis","itemStyle"],UA=(sd.extend({type:"boxplot",render:function(e,t,i){var n=e.getData(),a=this.group,o=this._data;this._data||a.removeAll();var s="horizontal"===e.get("layout")?1:0;n.diff(o).add(function(e){if(n.hasValue(e)){var t=n.getItemLayout(e),i=GA(t,n,e,s,!0);n.setItemGraphicEl(e,i),a.add(i)}}).update(function(e,t){var i=o.getItemGraphicEl(t);if(n.hasValue(e)){var r=n.getItemLayout(e);i?$A(r,i,n,e):i=GA(r,n,e,s),a.add(i),n.setItemGraphicEl(e,i)}else a.remove(i)}).remove(function(e){var t=o.getItemGraphicEl(e);t&&a.remove(t)}).execute(),this._data=n},remove:function(e){var t=this.group,i=this._data;this._data=null,i&&i.eachItemGraphicEl(function(e){e&&t.remove(e)})},dispose:re}),wo.extend({type:"boxplotBoxPath",shape:{},buildPath:function(e,t){var i=t.points,r=0;for(e.moveTo(i[r][0],i[r][1]),r++;r<4;r++)e.lineTo(i[r][0],i[r][1]);for(e.closePath();r "))},preventIncremental:function(){return!!this.get("effect.show")},getProgressive:function(){var e=this.option.progressive;return null==e?this.option.large?1e4:this.get("progressive"):e},getProgressiveThreshold:function(){var e=this.option.progressiveThreshold;return null==e?this.option.large?2e4:this.get("progressiveThreshold"):e},defaultOption:{coordinateSystem:"geo",zlevel:0,z:2,legendHoverLink:!0,hoverAnimation:!0,xAxisIndex:0,yAxisIndex:0,symbol:["none","none"],symbolSize:[10,10],geoIndex:0,effect:{show:!1,period:4,constantSpeed:0,symbol:"circle",symbolSize:3,loop:!0,trailLength:.2},large:!1,largeThreshold:2e3,polyline:!1,clip:!0,label:{show:!1,position:"end"},lineStyle:{opacity:.5}}});function CS(e,t,i){Ti.call(this),this.add(this.createLine(e,t,i)),this._updateEffectSymbol(e,t)}var xS=CS.prototype;function bS(e,t,i){Ti.call(this),this._createPolyline(e,t,i)}xS.createLine=function(e,t,i){return new sx(e,t,i)},xS._updateEffectSymbol=function(e,t){var i=e.getItemModel(t),r=i.getModel("effect"),n=r.get("symbolSize"),a=r.get("symbol");R(n)||(n=[n,n]);var o=r.get("color")||e.getItemVisual(t,"color"),s=this.childAt(1);this._symbolType!==a&&(this.remove(s),(s=dm(a,-.5,-.5,1,1,o)).z2=100,s.culling=!0,this.add(s)),s&&(s.setStyle("shadowColor",o),s.setStyle(r.getItemStyle(["color"])),s.attr("scale",n),s.setColor(o),s.attr("scale",n),this._symbolType=a,this._symbolScale=n,this._updateEffectAnimation(e,r,t))},xS._updateEffectAnimation=function(t,e,i){var r=this.childAt(1);if(r){var n=this,a=t.getItemLayout(i),o=1e3*e.get("period"),s=e.get("loop"),l=e.get("constantSpeed"),u=H(e.get("delay"),function(e){return e/t.count()*o/3}),c="function"==typeof u;if(r.ignore=!0,this.updateAnimationPoints(r,a),0t);s++);s=Math.min(s-1,n-2)}Ae(e.position,i[s],i[s+1],(t-r[s])/(r[s+1]-r[s]));var l=i[s+1][0]-i[s][0],u=i[s+1][1]-i[s][1];e.rotation=-Math.atan2(u,l)-Math.PI/2,this._lastFrame=s,this._lastFramePercent=t,e.ignore=!1}},b(SS,CS);var ES=Ts({shape:{polyline:!1,curveness:0,segs:[]},buildPath:function(e,t){var i=t.segs,r=t.curveness;if(t.polyline)for(var n=0;n=t[0]&&e<=t[1]}}(v,t.option.range):function(t,r,n){var i=t[1]-t[0],a=(r=B(r,function(e){return{interval:[(e.interval[0]-t[0])/i,(e.interval[1]-t[0])/i]}})).length,o=0;return function(e){for(var t=o;t=t.y&&e[1]<=t.y+t.height:i.contain(i.toLocalCoord(e[1]))&&e[0]>=t.y&&e[0]<=t.y+t.height},pointToData:function(e){var t=this.getAxis();return[t.coordToData(t.toLocalCoord(e["horizontal"===t.orient?0:1]))]},dataToPoint:function(e){var t=this.getAxis(),i=this.getRect(),r=[],n="horizontal"===t.orient?0:1;return e instanceof Array&&(e=e[0]),r[n]=t.toGlobalCoord(t.dataToCoord(+e)),r[1-n]=0==n?i.y+i.height/2:i.x+i.width/2,r}}).dimensions});var aw=["axisLine","axisTickLabel","axisName"],ow=["splitArea","splitLine"],sw=sy.extend({type:"singleAxis",axisPointerClass:"SingleAxisPointer",render:function(t,e,i,r){var n=this.group;n.removeAll();var a=this._axisGroup;this._axisGroup=new Ti;var o=nw(t),s=new Wg(t,o);k(aw,s.add,s),n.add(this._axisGroup),n.add(s.getGroup()),k(ow,function(e){t.get(e+".show")&&this["_"+e](t)},this),fl(a,this._axisGroup,t),sw.superCall(this,"render",t,e,i,r)},remove:function(){py(this)},_splitLine:function(e){var t=e.axis;if(!t.scale.isBlank()){var i=e.getModel("splitLine"),r=i.getModel("lineStyle"),n=r.get("width"),a=r.get("color");a=a instanceof Array?a:[a];for(var o=e.coordinateSystem.getRect(),s=t.isHorizontal(),l=[],u=0,c=t.getTicksCoords({tickModel:i}),d=[],h=[],p=0;po)return!0;if(a){var s=ny(e).seriesDataCount,l=r.getExtent();return Math.abs(l[0]-l[1])/s>o}return!1},makeElOption:function(e,t,i,r,n){},createPointerEl:function(e,t,i,r){var n=t.pointer;if(n){var a=Mw(e).pointerEl=new Cl[n.type](Dw(t.pointer));e.add(a)}},createLabelEl:function(e,t,i,r){if(t.label){var n=Mw(e).labelEl=new ns(Dw(t.label));e.add(n),Lw(n,r)}},updatePointerEl:function(e,t,i){var r=Mw(e).pointerEl;r&&t.pointer&&(r.setStyle(t.pointer.style),i(r,{shape:t.pointer.shape}))},updateLabelEl:function(e,t,i,r){var n=Mw(e).labelEl;n&&(n.setStyle(t.label.style),i(n,{shape:t.label.shape,position:t.label.position}),Lw(n,r))},_renderHandle:function(e){if(!this._dragging&&this.updateHandleTransform){var t,i=this._axisPointerModel,r=this._api.getZr(),n=this._handle,a=i.getModel("handle"),o=i.get("status");if(!a.get("show")||!o||"hide"===o)return n&&r.remove(n),void(this._handle=null);this._handle||(t=!0,n=this._handle=gl(a.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(e){Ye(e.event)},onmousedown:Iw(this._onHandleDragMove,this,0,0),drift:Iw(this._onHandleDragMove,this),ondragend:Iw(this._onHandleDragEnd,this)}),r.add(n)),kw(n,i,!1);n.setStyle(a.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));var s=a.get("size");R(s)||(s=[s,s]),n.attr("scale",[s[0]/2,s[1]/2]),vd(this,"_doDispatchAxisPointer",a.get("throttle")||0,"fixRate"),this._moveHandleToValue(e,t)}},_moveHandleToValue:function(e,t){Rw(this._axisPointerModel,!t&&this._moveAnimation,this._handle,Nw(this.getHandleTransform(e,this._axisModel,this._axisPointerModel)))},_onHandleDragMove:function(e,t){var i=this._handle;if(i){this._dragging=!0;var r=this.updateHandleTransform(Nw(i),[e,t],this._axisModel,this._axisPointerModel);this._payloadInfo=r,i.stopAnimation(),i.attr(Nw(r)),Mw(i).lastProp=null,this._doDispatchAxisPointer()}},_doDispatchAxisPointer:function(){var e=this._handle;if(e){var t=this._payloadInfo,i=this._axisModel;this._api.dispatchAction({type:"updateAxisPointer",x:t.cursorPoint[0],y:t.cursorPoint[1],tooltipOption:t.tooltipOption,axesInfo:[{axisDim:i.axis.dim,axisIndex:i.componentIndex}]})}},_onHandleDragEnd:function(e){this._dragging=!1;var t=this._handle;if(t){var i=this._axisPointerModel.get("value");this._moveHandleToValue(i),this._api.dispatchAction({type:"hideTip"})}},getHandleTransform:null,updateHandleTransform:null,clear:function(e){this._lastValue=null,this._lastStatus=null;var t=e.getZr(),i=this._group,r=this._handle;t&&i&&(this._lastGraphicKey=null,i&&t.remove(i),r&&t.remove(r),this._group=null,this._handle=null,this._payloadInfo=null)},doClear:function(){},buildLabel:function(e,t,i){return{x:e[i=i||0],y:e[1-i],width:t[i],height:t[1-i]}}}).constructor=Ow);var Ww=Ow.extend({makeElOption:function(e,t,i,r,n){var a=i.axis,o=a.grid,s=r.get("type"),l=jw(o,a).getOtherAxis(a).getGlobalExtent(),u=a.toGlobalCoord(a.dataToCoord(t,!0));if(s&&"none"!==s){var c=Bw(r),d=qw[s](a,u,l);d.style=c,e.graphicKey=d.type,e.pointer=d}var h=dy(o.model,i);Uw(t,e,h,i,r,n)},getHandleTransform:function(e,t,i){var r=dy(t.axis.grid.model,t,{labelInside:!1});return r.labelMargin=i.get("handle.margin"),{position:zw(t.axis,e,r),rotation:r.rotation+(r.labelDirection<0?Math.PI:0)}},updateHandleTransform:function(e,t,i,r){var n=i.axis,a=n.grid,o=n.getGlobalExtent(!0),s=jw(a,n).getOtherAxis(n).getGlobalExtent(),l="x"===n.dim?0:1,u=e.position;u[l]+=t[l],u[l]=Math.min(o[1],u[l]),u[l]=Math.max(o[0],u[l]);var c=(s[1]+s[0])/2,d=[c,c];d[l]=u[l];return{position:u,rotation:e.rotation,cursorPoint:d,tooltipOption:[{verticalAlign:"middle"},{align:"center"}][l]}}});function jw(e,t){var i={};return i[t.dim+"AxisIndex"]=t.index,e.getCartesian(i)}var qw={line:function(e,t,i){var r=Gw([t,i[0]],[t,i[1]],Qw(e));return{type:"Line",subPixelOptimize:!0,shape:r}},shadow:function(e,t,i){var r=Math.max(1,e.getBandWidth()),n=i[1]-i[0];return{type:"Rect",shape:$w([t-r/2,i[0]],[r,n],Qw(e))}}};function Qw(e){return"x"===e.dim?0:1}sy.registerAxisPointerClass("CartesianAxisPointer",Ww),sp(function(e){if(e){e.axisPointer&&0!==e.axisPointer.length||(e.axisPointer={});var t=e.axisPointer.link;t&&!R(t)&&(e.axisPointer.link=[t])}}),lp(vh.PROCESSOR.STATISTIC,function(e,t){e.getComponent("axisPointer").coordSysAxesInfo=iy(e,t)}),up({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},function(e,t,i){var r=e.currTrigger,o=[e.x,e.y],n=e,a=e.dispatchAction||T(i.dispatchAction,i),s=t.getComponent("axisPointer").coordSysAxesInfo;if(!s){return}if(xw(o)){o=uw({seriesIndex:n.seriesIndex,dataIndex:n.dataIndex},t).point}var l=xw(o),u=n.axesInfo,c=s.axesInfo,d=r==="leave"||xw(o),h={},p={},f={list:[],map:{}},m={showPointer:dw(fw,p),showTooltip:dw(mw,f)};cw(s.coordSysMap,function(e,t){var a=l||e.containPoint(o);cw(s.coordSysAxesInfo[t],function(e,t){var i=e.axis;var r=_w(u,e);if(!d&&a&&(!u||r)){var n=r&&r.value;if(n==null&&!l){n=i.pointToData(o)}n!=null&&pw(e,n,m,false,h)}})});var g={};return cw(c,function(n,e){var a=n.linkGroup;a&&!p[e]&&cw(a.axesInfo,function(e,t){var i=p[t];if(e!==n&&i){var r=i.value;a.mapper&&(r=n.axis.scale.parse(a.mapper(r,Cw(e),Cw(n)))),g[n.key]=r}})}),cw(g,function(e,t){pw(c[t],e,m,!0,h)}),gw(p,c,h),yw(f,o,e,a),vw(c,0,i),h});var Yw=["x","y"],Xw=["width","height"],Zw=Ow.extend({makeElOption:function(e,t,i,r,n){var a=i.axis,o=a.coordinateSystem,s=eE(o,1-Kw(a)),l=o.dataToPoint(t)[0],u=r.get("type");if(u&&"none"!==u){var c=Bw(r),d=Jw[u](a,l,s);d.style=c,e.graphicKey=d.type,e.pointer=d}var h=nw(i);Uw(t,e,h,i,r,n)},getHandleTransform:function(e,t,i){var r=nw(t,{labelInside:!1});return r.labelMargin=i.get("handle.margin"),{position:zw(t.axis,e,r),rotation:r.rotation+(r.labelDirection<0?Math.PI:0)}},updateHandleTransform:function(e,t,i,r){var n=i.axis,a=n.coordinateSystem,o=Kw(n),s=eE(a,o),l=e.position;l[o]+=t[o],l[o]=Math.min(s[1],l[o]),l[o]=Math.max(s[0],l[o]);var u=eE(a,1-o),c=(u[1]+u[0])/2,d=[c,c];return d[o]=l[o],{position:l,rotation:e.rotation,cursorPoint:d,tooltipOption:{verticalAlign:"middle"}}}}),Jw={line:function(e,t,i){var r=Gw([t,i[0]],[t,i[1]],Kw(e));return{type:"Line",subPixelOptimize:!0,shape:r}},shadow:function(e,t,i){var r=e.getBandWidth(),n=i[1]-i[0];return{type:"Rect",shape:$w([t-r/2,i[0]],[r,n],Kw(e))}}};function Kw(e){return e.isHorizontal()?0:1}function eE(e,t){var i=e.getRect();return[i[Yw[t]],i[Yw[t]]+i[Xw[t]]]}sy.registerAxisPointerClass("SingleAxisPointer",Zw),gp({type:"single"});var tE=Qc.extend({type:"series.themeRiver",dependencies:["singleAxis"],nameMap:null,init:function(e){tE.superApply(this,"init",arguments),this.legendVisualProvider=new zy(T(this.getData,this),T(this.getRawData,this))},fixData:function(e){var t=e.length,i=Yn(e,function(e){return e[2]}),r=[];i.buckets.each(function(e,t){r.push({name:t,dataList:e})});for(var n=r.length,a=-1,o=-1,s=0;sMath.PI/2?"right":"left"):v&&"center"!==v?"left"===v?(h=l.r0+y,p>Math.PI/2&&(v="right")):"right"===v&&(h=l.r-y,p>Math.PI/2&&(v="left")):(h=(l.r+l.r0)/2,v="center"),d.attr("style",{text:s,textAlign:v,textVerticalAlign:A("verticalAlign")||"middle",opacity:A("opacity")});var _=h*f+l.cx,C=h*m+l.cy;d.attr("position",[_,C]);var x=A("rotate"),b=0;function A(e){var t=a.get(e);return null==t?n.get(e):t}"radial"===x?(b=-p)<-Math.PI/2&&(b+=Math.PI):"tangential"===x?(b=Math.PI/2-p)>Math.PI/2?b-=Math.PI:b<-Math.PI/2&&(b+=Math.PI):"number"==typeof x&&(b=x*Math.PI/180),d.attr("rotation",b)},sE._initEvents=function(e,t,i,r){e.off("mouseover").off("mouseout").off("emphasis").off("normal");var n=this,a=function(){n.onEmphasis(r)},o=function(){n.onNormal()};i.isAnimationEnabled()&&e.on("mouseover",a).on("mouseout",o).on("emphasis",a).on("normal",o).on("downplay",function(){n.onDownplay()}).on("highlight",function(){n.onHighlight()})},b(oE,Ti);sd.extend({type:"sunburst",init:function(){},render:function(n,a,e,t){var r=this;this.seriesModel=n,this.api=e,this.ecModel=a;var o=n.getData(),s=o.tree.root,i=n.getViewRoot(),l=this.group,u=n.get("renderLabelForZeroData"),c=[];i.eachNode(function(e){c.push(e)});var d=this._oldChildren||[];if(function(i,r){if(0===i.length&&0===r.length)return;function e(e){return e.getId()}function t(e,t){!function(e,t){u||!e||e.getValue()||(e=null);if(e!==s&&t!==s)if(t&&t.piece)e?(t.piece.updateData(!1,e,"normal",n,a),o.setItemGraphicEl(e.dataIndex,t.piece)):function(e){if(!e)return;e.piece&&(l.remove(e.piece),e.piece=null)}(t);else if(e){var i=new oE(e,n,a);l.add(i),o.setItemGraphicEl(e.dataIndex,i)}}(null==e?null:i[e],null==t?null:r[t])}new Cp(r,i,e,e).add(t).update(t).remove(P(t,null)).execute()}(c,d),function(e,t){if(0=r.r0}}});var uE="sunburstRootToNode";up({type:uE,update:"updateView"},function(n,e){e.eachComponent({mainType:"series",subType:"sunburst",query:n},function(e,t){var i=V_(n,[uE],e);if(i){var r=e.getViewRoot();r&&(n.direction=U_(r,i.node)?"rollUp":"drillDown"),e.resetViewRoot(i.node)}})});var cE="sunburstHighlight";up({type:cE,update:"updateView"},function(r,e){e.eachComponent({mainType:"series",subType:"sunburst",query:r},function(e,t){var i=V_(r,[cE],e);i&&(r.highlight=i.node)})}),up({type:"sunburstUnhighlight",update:"updateView"},function(i,e){e.eachComponent({mainType:"series",subType:"sunburst",query:i},function(e,t){i.unhighlight=!0})});var dE=Math.PI/180;function hE(e,t){var i=e.children||[];e.children=pE(i,t),i.length&&k(e.children,function(e){hE(e,t)})}function pE(e,t){if("function"==typeof t)return e.sort(t);var r="asc"===t;return e.sort(function(e,t){var i=(e.getValue()-t.getValue())*(r?1:-1);return 0==i?(e.dataIndex-t.dataIndex)*(r?-1:1):i})}function fE(a,o){return o=o||[0,0],B(["x","y"],function(e,t){var i=this.getAxis(e),r=o[t],n=a[t]/2;return"category"===i.type?i.getBandWidth():Math.abs(i.dataToCoord(r-n)-i.dataToCoord(r+n))},this)}function mE(a,o){return o=o||[0,0],B([0,1],function(e){var t=o[e],i=a[e]/2,r=[],n=[];return r[e]=t-i,n[e]=t+i,r[1-e]=n[1-e]=o[1-e],Math.abs(this.dataToPoint(r)[e]-this.dataToPoint(n)[e])},this)}function gE(e,t){var i=this.getAxis(),r=t instanceof Array?t[0]:t,n=(e instanceof Array?e[0]:e)/2;return"category"===i.type?i.getBandWidth():Math.abs(i.dataToCoord(r-n)-i.dataToCoord(r+n))}function yE(s,l){return B(["Radius","Angle"],function(e,t){var i=this["get"+e+"Axis"](),r=l[t],n=s[t]/2,a="dataTo"+e,o="category"===i.type?i.getBandWidth():Math.abs(i[a](r-n)-i[a](r+n));return"Angle"===e&&(o=o*Math.PI/180),o},this)}hp(P(qy,"sunburst")),dp(P(function(e,t,M,i){t.eachSeriesByType(e,function(e){var t=e.get("center");var i=e.get("radius");if(!R(i)){i=[0,i]}if(!R(t)){t=[t,t]}var r=M.getWidth();var n=M.getHeight();var c=Math.min(r,n);var d=Ll(t[0],r);var h=Ll(t[1],n);var p=Ll(i[0],c/2);var a=Ll(i[1],c/2);var o=-e.get("startAngle")*dE;var f=e.get("minAngle")*dE;var m=e.getData().tree.root;var s=e.getViewRoot();var g=s.depth;var l=e.get("sort");if(l!=null){hE(s,l)}var u=0;k(s.children,function(e){!isNaN(e.getValue())&&u++});var y=s.getValue();var v=Math.PI/(y||u)*2;var _=s.depth>0;var C=s.height-(_?-1:1);var x=(a-p)/(C||1);var b=e.get("clockwise");var A=e.get("stillShowZeroSum");var S=b?1:-1;var w=function(e,t){if(!e){return}var i=t;if(e!==m){var r=e.getValue();var n=y===0&&A?v:r*v;if(ne[1]&&e.reverse(),{coordSys:{type:"polar",cx:n.cx,cy:n.cy,r:e[1],r0:e[0]},api:{coord:T(function(e){var t=a.dataToRadius(e[0]),i=o.dataToAngle(e[1]),r=n.coordToPoint([t,i]);return r.push(t,i*Math.PI/180),r}),size:T(yE,n)}}},calendar:function(i){var e=i.getRect(),t=i.getRangeInfo();return{coordSys:{type:"calendar",x:e.x,y:e.y,width:e.width,height:e.height,cellWidth:i.getCellWidth(),cellHeight:i.getCellHeight(),rangeInfo:{start:t.start,end:t.end,weeks:t.weeks,dayCount:t.allDay}},api:{coord:function(e,t){return i.dataToPoint(e,t)}}}}};function wE(e,t,i,r,n){null==i[e]||n||(t[e]=i[e],i[e]=r[e])}function EE(a,o,t,e){var i=a.get("renderItem"),r=a.coordinateSystem,n={};r&&(M&&(Y(i,"series.render is required."),Y(r.prepareCustoms||SE[r.type],"This coordSys does not support custom series.")),n=r.prepareCustoms?r.prepareCustoms():SE[r.type](r));var s,l,u,c,d,h=D({getWidth:e.getWidth,getHeight:e.getHeight,getZr:e.getZr,getDevicePixelRatio:e.getDevicePixelRatio,value:function(e,t){return null==t&&(t=s),o.get(o.getDimension(e||0),t)},style:function(e,t){null==t&&(t=s),m(t);var i=l.getModel(_E).getItemStyle();null!=d&&(i.fill=d);var r=o.getItemVisual(t,"opacity");null!=r&&(i.opacity=r);var n=e?IE(e,u):u;return tl(i,n,null,{autoColor:d,isRectText:!0}),i.text=n.getShallow("show")?W(a.getFormattedLabel(t,"normal"),Nm(o,t)):null,e&&OE(i,e),i},styleEmphasis:function(e,t){null==t&&(t=s),m(t);var i=l.getModel(CE).getItemStyle(),r=e?IE(e,c):c;return tl(i,r,null,{isRectText:!0},!0),i.text=r.getShallow("show")?j(a.getFormattedLabel(t,"emphasis"),a.getFormattedLabel(t,"normal"),Nm(o,t)):null,e&&OE(i,e),i},visual:function(e,t){return null==t&&(t=s),o.getItemVisual(t,e)},barLayout:function(e){if(r.getBaseAxis){return function(e){var t=[],i=e.axis;if("category"!==i.type)return;for(var r=i.getBandWidth(),n=0;ni[1]&&i.reverse();var r=e.getExtent(),n=Math.PI/180;return{cx:this.cx,cy:this.cy,r0:i[0],r:i[1],startAngle:-r[0]*n,endAngle:-r[1]*n,clockwise:e.inverse,contain:function(e,t){var i=e-this.cx,r=t-this.cy,n=i*i+r*r,a=this.r,o=this.r0;return n<=a*a&&o*o<=n}}}};var $E=Eu.extend({type:"polarAxis",axis:null,getCoordSysModel:function(){return this.ecModel.queryComponents({mainType:"polar",index:this.option.polarIndex,id:this.option.polarId})[0]}});g($E.prototype,im);var HE={angle:{startAngle:90,clockwise:!0,splitNumber:12,axisLabel:{rotate:!1}},radius:{splitNumber:5}};function WE(e,t){return t.type||(t.data?"category":"value")}function jE(e,t){var i=this,r=i.getAngleAxis(),n=i.getRadiusAxis();if(r.scale.setExtent(1/0,-1/0),n.scale.setExtent(1/0,-1/0),e.eachSeries(function(e){if(e.coordinateSystem===i){var t=e.getData();k(t.mapDimension("radius",!0),function(e){n.scale.unionExtentFromData(t,af(t,e))}),k(t.mapDimension("angle",!0),function(e){r.scale.unionExtentFromData(t,af(t,e))})}}),Xf(r.scale,r.model),Xf(n.scale,n.model),"category"===r.type&&!r.onBand){var a=r.getExtent(),o=360/r.scale.count();r.inverse?a[1]+=o:a[1]-=o,r.setExtent(a[0],a[1])}}function qE(e,t){if(e.type=t.get("type"),e.scale=Zf(t),e.onBand=t.get("boundaryGap")&&"category"===e.type,e.inverse=t.get("inverse"),"angleAxis"===t.mainType){e.inverse^=t.get("clockwise");var i=t.get("startAngle");e.setExtent(i,i+(e.inverse?-360:360))}(t.axis=e).model=t}Og("angle",$E,WE,HE.angle),Og("radius",$E,WE,HE.radius),mp({type:"polar",dependencies:["polarAxis","angleAxis"],coordinateSystem:null,findAxisModel:function(e){var t,i=this.ecModel;return i.eachComponent(e,function(e){e.getCoordSysModel()===this&&(t=e)},this),t},defaultOption:{zlevel:0,z:0,center:["50%","50%"],radius:"80%"}}),rc.register("polar",{dimensions:GE.prototype.dimensions,create:function(i,s){var l=[];return i.eachComponent("polar",function(e,t){var i=new GE(t);i.update=jE;var r=i.getRadiusAxis(),n=i.getAngleAxis(),a=e.findAxisModel("radiusAxis"),o=e.findAxisModel("angleAxis");qE(r,a),qE(n,o),function(e,t,i){var r=t.get("center"),n=i.getWidth(),a=i.getHeight();e.cx=Ll(r[0],n),e.cy=Ll(r[1],a);var o=e.getRadiusAxis(),s=Math.min(n,a)/2,l=t.get("radius");null==l?l=[0,"100%"]:R(l)||(l=[0,l]);l=[Ll(l[0],s),Ll(l[1],s)],o.inverse?o.setExtent(l[1],l[0]):o.setExtent(l[0],l[1])}(i,e,s),l.push(i),(e.coordinateSystem=i).model=e}),i.eachSeries(function(e){if("polar"===e.get("coordinateSystem")){var t=i.queryComponents({mainType:"polar",index:e.get("polarIndex"),id:e.get("polarId")})[0];if(M&&!t)throw new Error('Polar "'+H(e.get("polarIndex"),e.get("polarId"),0)+'" not found');e.coordinateSystem=t.coordinateSystem}}),l}});var QE=["axisLine","axisLabel","axisTick","minorTick","splitLine","minorSplitLine","splitArea"];function YE(e,t,i){t[1]>t[0]&&(t=t.slice().reverse());var r=e.coordToPoint([t[0],i]),n=e.coordToPoint([t[1],i]);return{x1:r[0],y1:r[1],x2:n[0],y2:n[1]}}function XE(e){var t=e.getRadiusAxis();return t.inverse?0:1}function ZE(e){var t=e[0],i=e[e.length-1];t&&i&&Math.abs(Math.abs(t.coord-i.coord)-360)<1e-4&&e.pop()}sy.extend({type:"angleAxis",axisPointerClass:"PolarAxisPointer",render:function(t,e){if(this.group.removeAll(),t.get("show")){var i=t.axis,r=i.polar,n=r.getRadiusAxis().getExtent(),a=i.getTicksCoords(),o=i.getMinorTicksCoords(),s=B(i.getViewLabels(),function(e){var e=I(e);return e.coord=i.dataToCoord(e.tickValue),e});ZE(s),ZE(a),k(QE,function(e){!t.get(e+".show")||i.scale.isBlank()&&"axisLine"!==e||this["_"+e](t,r,a,o,n,s)},this)}},_axisLine:function(e,t,i,r,n){var a,o=e.getModel("axisLine.lineStyle"),s=XE(t),l=s?0:1;(a=0===n[l]?new Ho({shape:{cx:t.cx,cy:t.cy,r:n[s]},style:o.getLineStyle(),z2:1,silent:!0}):new Qo({shape:{cx:t.cx,cy:t.cy,r:n[s],r0:n[l]},style:o.getLineStyle(),z2:1,silent:!0})).style.fill=null,this.group.add(a)},_axisTick:function(e,t,i,r,n){var a=e.getModel("axisTick"),o=(a.get("inside")?-1:1)*a.get("length"),s=n[XE(t)],l=B(i,function(e){return new os({shape:YE(t,[s,s+o],e.coord)})});this.group.add(Rs(l,{style:D(a.getModel("lineStyle").getLineStyle(),{stroke:e.get("axisLine.lineStyle.color")})}))},_minorTick:function(e,t,i,r,n){if(r.length){for(var a=e.getModel("axisTick"),o=e.getModel("minorTick"),s=(a.get("inside")?-1:1)*o.get("length"),l=n[XE(t)],u=[],c=0;co?"left":"right",u=Math.abs(a[1]-s)/n<.3?"middle":a[1]>s?"top":"bottom";f&&f[r]&&f[r].textStyle&&(i=new Tl(f[r].textStyle,m,m.ecModel));var c=new $o({silent:Wg.isLabelSilent(d)});this.group.add(c),tl(c.style,i,{x:a[0],y:a[1],textFill:i.getTextColor()||d.get("axisLine.lineStyle.color"),text:e.formattedLabel,textAlign:l,textVerticalAlign:u}),y&&(c.eventData=Wg.makeAxisEventDataBase(d),c.eventData.targetType="axisLabel",c.eventData.value=e.rawLabel)},this)},_splitLine:function(e,t,i,r,n){var a=e.getModel("splitLine"),o=a.getModel("lineStyle"),s=o.get("color"),l=0;s=s instanceof Array?s:[s];for(var u=[],c=0;cg?"left":"right",c=Math.abs(l[1]-y)/m<.3?"middle":l[1]>y?"top":"bottom"}return{position:l,align:u,verticalAlign:c}}(t,i,0,s,p);Fw(e,i,r,n,f)}});var tT={line:function(e,t,i,r,n){return"angle"===e.dim?{type:"Line",shape:Gw(t.coordToPoint([r[0],i]),t.coordToPoint([r[1],i]))}:{type:"Circle",shape:{cx:t.cx,cy:t.cy,r:i}}},shadow:function(e,t,i,r,n){var a=Math.max(1,e.getBandWidth()),o=Math.PI/180;return"angle"===e.dim?{type:"Sector",shape:Hw(t.cx,t.cy,r[0],r[1],(-i-a/2)*o,(a/2-i)*o)}:{type:"Sector",shape:Hw(t.cx,t.cy,i-a/2,i+a/2,0,2*Math.PI)}}};function iT(n,e){e.update="updateView",up(e,function(i,e){var r={};return e.eachComponent({mainType:"geo",query:i},function(t){t[n](i.name);var e=t.coordinateSystem;k(e.regions,function(e){r[e.name]=t.isSelected(e.name)||!1})}),{selected:r,name:i.name}})}sy.registerAxisPointerClass("PolarAxisPointer",eT),dp(P(function(e,t,i){var R={},L=FE(w(t.getSeriesByType(e),function(e){return!t.isSeriesFiltered(e)&&e.coordinateSystem&&"polar"===e.coordinateSystem.type}));t.eachSeriesByType(e,function(e){if("polar"===e.coordinateSystem.type){var t=e.getData(),i=e.coordinateSystem,r=i.getBaseAxis(),n=BE(i,r),a=kE(e),o=L[n][a],s=o.offset,l=o.width,u=i.getOtherAxis(r),c=e.coordinateSystem.cx,d=e.coordinateSystem.cy,h=e.get("barMinHeight")||0,p=e.get("barMinAngle")||0;R[a]=R[a]||[];for(var f=t.mapDimension(u.dim),m=t.mapDimension(r.dim),g=nf(t,f),y="radius"!==r.dim||!e.get("roundCap",!0),v=u.getExtent()[0],_=0,C=t.count();_=r.start.time&&i.timea.end.time&&e.reverse(),e},_getRangeInfo:function(e){var t;(e=[this.getDateInfo(e[0]),this.getDateInfo(e[1])])[0].time>e[1].time&&(t=!0,e.reverse());var i=Math.floor(e[1].time/864e5)-Math.floor(e[0].time/864e5)+1,r=new Date(e[0].time),n=r.getDate(),a=e[1].date.getDate();r.setDate(n+i-1);var o=r.getDate();if(o!==a)for(var s=0r.weeks||0===e&&tr.lweek)return!1;var n=7*(e-1)-r.fweek+t,a=new Date(r.start.time);return a.setDate(r.start.d+n),this.getDateInfo(a)}},rT.dimensions=rT.prototype.dimensions,rT.getDimensionsInfo=rT.prototype.getDimensionsInfo,rT.create=function(i,r){var n=[];return i.eachComponent("calendar",function(e){var t=new rT(e,i,r);n.push(t),e.coordinateSystem=t}),i.eachSeries(function(e){"calendar"===e.get("coordinateSystem")&&(e.coordinateSystem=n[e.get("calendarIndex")||0])}),n},rc.register("calendar",rT);var aT=Eu.extend({type:"calendar",coordinateSystem:null,defaultOption:{zlevel:0,z:2,left:80,top:60,cellSize:20,orient:"horizontal",splitLine:{show:!0,lineStyle:{color:"#000",width:1,type:"solid"}},itemStyle:{color:"#fff",borderWidth:1,borderColor:"#ccc"},dayLabel:{show:!0,firstDay:0,position:"start",margin:"50%",nameMap:"en",color:"#000"},monthLabel:{show:!0,position:"start",margin:5,align:"center",nameMap:"en",formatter:null,color:"#000"},yearLabel:{show:!0,position:null,margin:30,formatter:null,color:"#ccc",fontFamily:"sans-serif",fontWeight:"bolder",fontSize:20}},init:function(e,t,i,r){var n=Au(e);aT.superApply(this,"init",arguments),oT(e,n)},mergeOption:function(e,t){aT.superApply(this,"mergeOption",arguments),oT(this.option,e)}});function oT(e,t){var i=e.cellSize;R(i)?1===i.length&&(i[1]=i[0]):i=e.cellSize=[i,i];var r=B([0,1],function(e){return function(e,t){return null!=e[yu[t][0]]||null!=e[yu[t][1]]&&null!=e[yu[t][2]]}(t,e)&&(i[e]="auto"),null!=i[e]&&"auto"!==i[e]});bu(e,t,{type:"box",ignoreSize:r})}var sT={EN:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],CN:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]},lT={EN:["S","M","T","W","T","F","S"],CN:["日","一","二","三","四","五","六"]};gp({type:"calendar",_tlpoints:null,_blpoints:null,_firstDayOfMonth:null,_firstDayPoints:null,render:function(e,t,i){var r=this.group;r.removeAll();var n=e.coordinateSystem,a=n.getRangeInfo(),o=n.getOrient();this._renderDayRect(e,a,r),this._renderLines(e,a,o,r),this._renderYearText(e,a,o,r),this._renderMonthText(e,o,r),this._renderWeekText(e,a,o,r)},_renderDayRect:function(e,t,i){for(var r=e.coordinateSystem,n=e.getModel("itemStyle").getItemStyle(),a=r.getCellWidth(),o=r.getCellHeight(),s=t.start.time;s<=t.end.time;s=r.getNextNDay(s,1).time){var l=r.dataToRect([s],!1).tl,u=new ns({shape:{x:l[0],y:l[1],width:a,height:o},cursor:"default",style:n});i.add(u)}},_renderLines:function(i,e,r,n){var a=this,o=i.coordinateSystem,s=i.getModel("splitLine.lineStyle").getLineStyle(),l=i.get("splitLine.show"),t=s.lineWidth;this._tlpoints=[],this._blpoints=[],this._firstDayOfMonth=[],this._firstDayPoints=[];for(var u=e.start,c=0;u.time<=e.end.time;c++){h(u.formatedDate),0===c&&(u=o.getDateInfo(e.start.y+"-"+e.start.m));var d=u.date;d.setMonth(d.getMonth()+1),u=o.getDateInfo(d)}function h(e){a._firstDayOfMonth.push(o.getDateInfo(e)),a._firstDayPoints.push(o.dataToRect([e],!1).tl);var t=a._getLinePointsOfOneWeek(i,e,r);a._tlpoints.push(t[0]),a._blpoints.push(t[t.length-1]),l&&a._drawSplitline(t,s,n)}h(o.getNextNDay(e.end.time,1).formatedDate),l&&this._drawSplitline(a._getEdgesPoints(a._tlpoints,t,r),s,n),l&&this._drawSplitline(a._getEdgesPoints(a._blpoints,t,r),s,n)},_getEdgesPoints:function(e,t,i){var r=[e[0].slice(),e[e.length-1].slice()],n="horizontal"===i?0:1;return r[0][n]=r[0][n]-t/2,r[1][n]=r[1][n]+t/2,r},_drawSplitline:function(e,t,i){var r=new Jo({z2:20,shape:{points:e},style:t});i.add(r)},_getLinePointsOfOneWeek:function(e,t,i){var r=e.coordinateSystem;t=r.getDateInfo(t);for(var n=[],a=0;a<7;a++){var o=r.getNextNDay(t.time,a),s=r.dataToRect([o.time],!1);n[2*o.day]=s.tl,n[2*o.day+1]=s["horizontal"===i?"bl":"tr"]}return n},_formatterLabel:function(e,t){return"string"==typeof e&&e?su(e,t):"function"==typeof e?e(t):t.nameMap},_yearTextPositionControl:function(e,t,i,r,n){t=t.slice();var a=["center","bottom"];"bottom"===r?(t[1]+=n,a=["center","top"]):"left"===r?t[0]-=n:"right"===r?(t[0]+=n,a=["center","top"]):t[1]-=n;var o=0;return"left"!==r&&"right"!==r||(o=Math.PI/2),{rotation:o,position:t,style:{textAlign:a[0],textVerticalAlign:a[1]}}},_renderYearText:function(e,t,i,r){var n=e.getModel("yearLabel");if(n.get("show")){var a=n.get("margin"),o=n.get("position");o=o||("horizontal"!==i?"top":"left");var s=[this._tlpoints[this._tlpoints.length-1],this._blpoints[0]],l=(s[0][0]+s[1][0])/2,u=(s[0][1]+s[1][1])/2,c="horizontal"===i?0:1,d={top:[l,s[c][1]],bottom:[l,s[1-c][1]],left:[s[1-c][0],u],right:[s[c][0],u]},h=t.start.y;+t.end.y>+t.start.y&&(h=h+"-"+t.end.y);var p=n.get("formatter"),f={start:t.start.y,end:t.end.y,nameMap:h},m=this._formatterLabel(p,f),g=new $o({z2:30});tl(g.style,n,{text:m}),g.attr(this._yearTextPositionControl(g,d[o],i,o,a)),r.add(g)}},_monthTextPositionControl:function(e,t,i,r,n){var a="left",o="top",s=e[0],l=e[1];return"horizontal"===i?(l+=n,t&&(a="center"),"start"===r&&(o="bottom")):(s+=n,t&&(o="middle"),"start"===r&&(a="right")),{x:s,y:l,textAlign:a,textVerticalAlign:o}},_renderMonthText:function(e,t,i){var r=e.getModel("monthLabel");if(r.get("show")){var n=r.get("nameMap"),a=r.get("margin"),o=r.get("position"),s=r.get("align"),l=[this._tlpoints,this._blpoints];F(n)&&(n=sT[n.toUpperCase()]||[]);var u="start"===o?0:1,c="horizontal"===t?0:1;a="start"===o?-a:a;for(var d="center"===s,h=0;hh.getHeight()&&(i.textPosition="top",o=!0);var s=o?-5-r.height:f+8;n+r.width/2>h.getWidth()?(i.textPosition=["100%",s],i.textAlign="right"):n-r.width/2<0&&(i.textPosition=[0,s],i.textAlign="left")}})}function e(e,t){var i,r=g[e],n=g[t],a=u[r],o=new Tl(a,c,c.ecModel);if(l&&null!=l.newTitle&&l.featureName===r&&(a.title=l.newTitle),r&&!n){if(function(e){return 0===e.indexOf("my")}(r))i={model:o,onclick:o.option.onclick,featureName:r};else{var s=gT(r);if(!s)return;i=new s(o,d,h)}m[r]=i}else{if(!(i=m[n]))return;i.model=o,i.ecModel=d,i.api=h}r||!n?o.get("show")&&!i.unusable?(function(n,a,e){var o=n.getModel("iconStyle"),s=n.getModel("emphasis.iconStyle"),t=a.getIcons?a.getIcons():n.get("icon"),l=n.get("title")||{};if("string"==typeof t){var i=t,r=l;l={},(t={})[e]=i,l[e]=r}var u=n.iconPaths={};k(t,function(e,t){var i=gl(e,{},{x:-f/2,y:-f/2,width:f,height:f});i.setStyle(o.getItemStyle()),i.hoverStyle=s.getItemStyle(),i.setStyle({text:l[t],textAlign:s.get("textAlign"),textBorderRadius:s.get("textBorderRadius"),textPadding:s.get("textPadding"),textFill:null});var r=c.getModel("tooltip");r&&r.get("show")&&i.attr("tooltip",O({content:l[t],formatter:r.get("formatter",!0)||function(){return l[t]},formatterParams:{componentType:"toolbox",name:t,title:l[t],$vars:["name","title"]},position:r.get("position",!0)||"bottom"},r.option)),Ys(i),c.get("showTitle")&&(i.__title=l[t],i.on("mouseover",function(){var e=s.getItemStyle(),t="vertical"===c.get("orient")?null==c.get("right")?"right":"left":null==c.get("bottom")?"bottom":"top";i.setStyle({textFill:s.get("textFill")||e.fill||e.stroke||"#000",textBackgroundColor:s.get("textBackgroundColor"),textPosition:s.get("textPosition")||t})}).on("mouseout",function(){i.setStyle({textFill:null,textBackgroundColor:null})})),i.trigger(n.get("iconStatus."+t)||"normal"),p.add(i),i.on("click",T(a.onclick,a,d,h,t)),u[t]=i})}(o,i,r),o.setIconStatus=function(e,t){var i=this.option,r=this.iconPaths;i.iconStatus=i.iconStatus||{},i.iconStatus[e]=t,r[e]&&r[e].trigger(t)},i.render&&i.render(o,d,h,l)):i.remove&&i.remove(d,h):i.dispose&&i.dispose(d,h)}},updateView:function(e,t,i,r){k(this._features,function(e){e.updateView&&e.updateView(e.model,t,i,r)})},remove:function(t,i){k(this._features,function(e){e.remove&&e.remove(t,i)}),this.group.removeAll()},dispose:function(t,i){k(this._features,function(e){e.dispose&&e.dispose(t,i)})}});var _T=xd.toolbox.saveAsImage;function CT(e){this.model=e}CT.defaultOption={show:!0,icon:"M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0",title:_T.title,type:"png",connectedBackgroundColor:"#fff",name:"",excludeComponents:["toolbox"],pixelRatio:1,lang:_T.lang.slice()},CT.prototype.unusable=!v.canvasSupported,CT.prototype.onclick=function(e,t){var i=this.model,r=i.get("name")||e.get("title.0.text")||"echarts",n="svg"===t.getZr().painter.getType(),a=n?"svg":i.get("type",!0)||"png",o=t.getConnectedDataURL({type:a,backgroundColor:i.get("backgroundColor",!0)||e.get("backgroundColor")||"#fff",connectedBackgroundColor:i.get("connectedBackgroundColor"),excludeComponents:i.get("excludeComponents"),pixelRatio:i.get("pixelRatio")});if("function"!=typeof MouseEvent||v.browser.ie||v.browser.edge)if(window.navigator.msSaveOrOpenBlob){for(var s=atob(o.split(",")[1]),l=s.length,u=new Uint8Array(l);l--;)u[l]=s.charCodeAt(l);var c=new Blob([u]);window.navigator.msSaveOrOpenBlob(c,r+"."+a)}else{var d=i.get("lang"),h='',p=window.open();p.document.write(h)}else{var f=document.createElement("a");f.download=r+"."+a,f.target="_blank",f.href=o;var m=new MouseEvent("click",{view:window,bubbles:!0,cancelable:!1});f.dispatchEvent(m)}},mT("saveAsImage",CT);var xT=xd.toolbox.magicType,bT="__ec_magicType_stack__";function AT(e){this.model=e}AT.defaultOption={show:!0,type:[],icon:{line:"M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4",bar:"M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7",stack:"M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z"},title:I(xT.title),option:{},seriesIndex:{}};var ST=AT.prototype;ST.getIcons=function(){var e=this.model,t=e.get("icon"),i={};return k(e.get("type"),function(e){t[e]&&(i[e]=t[e])}),i};var wT={line:function(e,t,i,r){if("bar"===e)return g({id:t,type:"line",data:i.get("data"),stack:i.get("stack"),markPoint:i.get("markPoint"),markLine:i.get("markLine")},r.get("option.line")||{},!0)},bar:function(e,t,i,r){if("line"===e)return g({id:t,type:"bar",data:i.get("data"),stack:i.get("stack"),markPoint:i.get("markPoint"),markLine:i.get("markLine")},r.get("option.bar")||{},!0)},stack:function(e,t,i,r){var n=i.get("stack")===bT;if("line"===e||"bar"===e)return r.setIconStatus("stack",n?"normal":"emphasis"),g({id:t,stack:n?"":bT},r.get("option.stack")||{},!0)}},ET=[["line","bar"],["stack"]];ST.onclick=function(d,e,h){var p=this.model,t=p.get("seriesIndex."+h);if(wT[h]){var i,f={series:[]};if(k(ET,function(e){0<=x(e,h)&&k(e,function(e){p.setIconStatus(e,"normal")})}),p.setIconStatus(h,"emphasis"),d.eachComponent({mainType:"series",query:null==t?null:{seriesIndex:t}},function(e){var t=e.subType,i=e.id,r=wT[h](t,i,e,p);if(r){D(r,e.option);f.series.push(r)}var n=e.coordinateSystem;if(n&&n.type==="cartesian2d"&&(h==="line"||h==="bar")){var a=n.getAxesByScale("ordinal")[0];if(a){var o=a.dim;var s=o+"Axis";var l=d.queryComponents({mainType:s,index:e.get(name+"Index"),id:e.get(name+"Id")})[0];var u=l.componentIndex;f[s]=f[s]||[];for(var c=0;c<=u;c++){f[s][u]=f[s][u]||{}}f[s][u].boundaryGap=h==="bar"}}}),"stack"===h){var r=f.series&&f.series[0]&&f.series[0].stack===bT;i=r?g({stack:xT.title.tiled},xT.title):I(xT.title)}e.dispatchAction({type:"changeMagicType",currentType:h,newOption:f,newTitle:i,featureName:"magicType"})}},up({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},function(e,t){t.mergeOption(e.newOption)}),mT("magicType",AT);var TT=xd.toolbox.dataView,PT=new Array(60).join("-"),MT="\t";function DT(e){var t=function(e){var n={},a=[],o=[];return e.eachRawSeries(function(e){var t=e.coordinateSystem;if(!t||"cartesian2d"!==t.type&&"polar"!==t.type)a.push(e);else{var i=t.getBaseAxis();if("category"===i.type){var r=i.dim+"_"+i.index;n[r]||(n[r]={categoryAxis:i,valueAxis:t.getOtherAxis(i),series:[]},o.push({axisDim:i.dim,axisIndex:i.index})),n[r].series.push(e)}else a.push(e)}}),{seriesGroupByCategoryAxis:n,other:a,meta:o}}(e);return{value:w([function(e){var c=[];return k(e,function(e,t){var i=e.categoryAxis,r=e.valueAxis.dim,n=[" "].concat(B(e.series,function(e){return e.name})),a=[i.model.getCategories()];k(e.series,function(e){a.push(e.getRawData().mapArray(r,function(e){return e}))});for(var o=[n.join(MT)],s=0;se[1]&&e.reverse(),e}function $T(e,t){return Wn(e,t,{includeMainTypes:VT})}UT.setOutputRanges=function(e,t){this.matchOutputRanges(e,t,function(e,t,i){if((e.coordRanges||(e.coordRanges=[])).push(t),!e.coordRange){e.coordRange=t;var r=qT[e.brushType](0,i,t);e.__rangeOffset={offset:YT[e.brushType](r.values,e.range,[1,1]),xyMinMax:r.xyMinMax}}})},UT.matchOutputRanges=function(e,r,n){NT(e,function(i){var e=this.findTargetInfo(i,r);e&&!0!==e&&k(e.coordSyses,function(e){var t=qT[i.brushType](1,e,i.range);n(i,t.values,e,r)})},this)},UT.setInputRanges=function(e,n){NT(e,function(e){var t=this.findTargetInfo(e,n);if(M&&(Y(!t||!0===t||e.coordRange,"coordRange must be specified when coord index specified."),Y(!t||!0!==t||e.range,"range must be specified in global brush.")),e.range=e.range||[],t&&!0!==t){e.panelId=t.panelId;var i=qT[e.brushType](0,t.coordSys,e.coordRange),r=e.__rangeOffset;e.range=r?YT[e.brushType](i.values,r.offset,function(e,t){var i=ZT(e),r=ZT(t),n=[i[0]/r[0],i[1]/r[1]];return isNaN(n[0])&&(n[0]=1),isNaN(n[1])&&(n[1]=1),n}(i.xyMinMax,r.xyMinMax)):i.values}},this)},UT.makePanelOpts=function(i,r){return B(this._targetInfoList,function(e){var t=e.getPanelRect();return{panelId:e.panelId,defaultBrushType:r&&r(e),clipPath:nA(t),isTargetByCursor:oA(t,i,e.coordSysModel),getLinearBrushOtherExtent:aA(t)}})},UT.controlSeries=function(e,t,i){var r=this.findTargetInfo(e,i);return!0===r||r&&0<=kT(r.coordSyses,t.coordinateSystem)},UT.findTargetInfo=function(e,t){for(var i=this._targetInfoList,r=$T(t,e),n=0;nr[1]&&(r[1]=t[1])})}),r[1]d[1];if(o&&!s&&!l)return!0;o&&(r=!0),s&&(t=!0),l&&(i=!0)}return r&&t&&i}):nP(c,function(e){if("empty"===n)i.setData(u=u.map(e,function(e){return function(e){return e>=d[0]&&e<=d[1]}(e)?e:NaN}));else{var t={};t[e]=d,u.selectRange(t)}}),nP(c,function(e){u.setApproximateExtent(d,e)}))})}}};var uP=k,cP=iP,dP=mp({type:"dataZoom",dependencies:["xAxis","yAxis","zAxis","radiusAxis","angleAxis","singleAxis","series"],defaultOption:{zlevel:0,z:4,orient:null,xAxisIndex:null,yAxisIndex:null,filterMode:"filter",throttle:null,start:0,end:100,startValue:null,endValue:null,minSpan:null,maxSpan:null,minValueSpan:null,maxValueSpan:null,rangeMode:null},init:function(e,t,i){this._dataIntervalByAxis={},this._dataInfo={},this._axisProxies={},this.textStyleModel,this._autoThrottle=!0,this._rangePropMode=["percent","percent"];var r=hP(e);this.settledOption=r,this.mergeDefaultAndTheme(e,i),this.doInit(r)},mergeOption:function(e){var t=hP(e);g(this.option,e,!0),g(this.settledOption,t,!0),this.doInit(t)},doInit:function(e){var i=this.option;v.canvasSupported||(i.realtime=!1),this._setDefaultThrottle(e),pP(this,e);var r=this.settledOption;uP([["start","startValue"],["end","endValue"]],function(e,t){"value"===this._rangePropMode[t]&&(i[e[0]]=r[e[0]]=null)},this),this.textStyleModel=this.getModel("textStyle"),this._resetTarget(),this._giveAxisProxies()},_giveAxisProxies:function(){var o=this._axisProxies;this.eachTargetAxis(function(e,t,i,r){var n=this.dependentModels[e.axis][t],a=n.__dzAxisProxy||(n.__dzAxisProxy=new oP(e.name,t,this,r));o[e.name+"_"+t]=a},this)},_resetTarget:function(){var i=this.option,e=this._judgeAutoMode();cP(function(e){var t=e.axisIndex;i[t]=Ln(i[t])},this),"axisIndex"===e?this._autoSetAxisIndex():"orient"===e&&this._autoSetOrient()},_judgeAutoMode:function(){var t=this.option,i=!1;cP(function(e){null!=t[e.axisIndex]&&(i=!0)},this);var e=t.orient;return null==e&&i?"orient":i?void 0:(null==e&&(t.orient="horizontal"),"axisIndex")},_autoSetAxisIndex:function(){var a=!0,t=this.get("orient",!0),o=this.option,e=this.dependentModels;if(a){var i="vertical"===t?"y":"x";e[i+"Axis"].length?(o[i+"AxisIndex"]=[0],a=!1):uP(e.singleAxis,function(e){a&&e.get("orient",!0)===t&&(o.singleAxisIndex=[e.componentIndex],a=!1)})}a&&cP(function(e){if(a){var t=[],i=this.dependentModels[e.axis];if(i.length&&!t.length)for(var r=0,n=i.length;rt[0][1]&&(t[0][1]=a[0]),a[1]t[1][1]&&(t[1][1]=a[1])}return t&&tM(t)}};function tM(e){return new Ei(e[0][0],e[1][0],e[0][1]-e[0][0],e[1][1]-e[1][0])}var iM=["#ddd"];mp({type:"brush",dependencies:["geo","grid","xAxis","yAxis","parallel","series"],defaultOption:{toolbox:null,brushLink:null,seriesIndex:"all",geoIndex:null,xAxisIndex:null,yAxisIndex:null,brushType:"rect",brushMode:"single",transformable:!0,brushStyle:{borderWidth:1,color:"rgba(120,140,180,0.3)",borderColor:"rgba(120,140,180,0.8)"},throttleType:"fixRate",throttleDelay:0,removeOnClick:!0,z:1e4},areas:[],brushType:null,brushOption:{},coordInfoList:[],optionUpdated:function(e,t){var i=this.option;t||GP(i,e,["inBrush","outOfBrush"]);var r=i.inBrush=i.inBrush||{};i.outOfBrush=i.outOfBrush||{color:iM},r.hasOwnProperty("liftZ")||(r.liftZ=5)},setAreas:function(e){M&&(Y(R(e)),k(e,function(e){Y(e.brushType,"Illegal areas")})),e&&(this.areas=B(e,function(e){return rM(this.option,e)},this))},setBrushOption:function(e){this.brushOption=rM(this.option,e),this.brushType=this.brushOption.brushType}});function rM(e,t){return g({brushType:e.brushType,brushMode:e.brushMode,transformable:e.transformable,brushStyle:new Tl(e.brushStyle).getItemStyle(),removeOnClick:e.removeOnClick,z:e.z},t,!0)}function nM(e,t,i,r){r&&r.$from===e.id||this._brushController.setPanels(e.brushTargetManager.makePanelOpts(i)).enableBrush(e.brushOption).updateCovers(e.areas.slice())}gp({type:"brush",init:function(e,t){this.ecModel=e,this.api=t,this.model,(this._brushController=new Eb(t.getZr())).on("brush",T(this._onBrush,this)).mount()},render:function(e){return this.model=e,nM.apply(this,arguments)},updateTransform:function(e,t){return XP(t),nM.apply(this,arguments)},updateView:nM,dispose:function(){this._brushController.dispose()},_onBrush:function(e,t){var i=this.model.id;this.model.brushTargetManager.setOutputRanges(e,this.ecModel),t.isEnd&&!t.removeOnClick||this.api.dispatchAction({type:"brush",brushId:i,areas:I(e),$from:i}),t.isEnd&&this.api.dispatchAction({type:"brushEnd",brushId:i,areas:I(e),$from:i})}}),up({type:"brush",event:"brush"},function(t,e){e.eachComponent({mainType:"brush",query:t},function(e){e.setAreas(t.areas)})}),up({type:"brushSelect",event:"brushSelected",update:"none"},function(){}),up({type:"brushEnd",event:"brushEnd",update:"none"},function(){});var aM=xd.toolbox.brush;function oM(e,t,i){this.model=e,this.ecModel=t,this.api=i,this._brushType,this._brushMode}oM.defaultOption={show:!0,type:["rect","polygon","lineX","lineY","keep","clear"],icon:{rect:"M7.3,34.7 M0.4,10V-0.2h9.8 M89.6,10V-0.2h-9.8 M0.4,60v10.2h9.8 M89.6,60v10.2h-9.8 M12.3,22.4V10.5h13.1 M33.6,10.5h7.8 M49.1,10.5h7.8 M77.5,22.4V10.5h-13 M12.3,31.1v8.2 M77.7,31.1v8.2 M12.3,47.6v11.9h13.1 M33.6,59.5h7.6 M49.1,59.5 h7.7 M77.5,47.6v11.9h-13",polygon:"M55.2,34.9c1.7,0,3.1,1.4,3.1,3.1s-1.4,3.1-3.1,3.1 s-3.1-1.4-3.1-3.1S53.5,34.9,55.2,34.9z M50.4,51c1.7,0,3.1,1.4,3.1,3.1c0,1.7-1.4,3.1-3.1,3.1c-1.7,0-3.1-1.4-3.1-3.1 C47.3,52.4,48.7,51,50.4,51z M55.6,37.1l1.5-7.8 M60.1,13.5l1.6-8.7l-7.8,4 M59,19l-1,5.3 M24,16.1l6.4,4.9l6.4-3.3 M48.5,11.6 l-5.9,3.1 M19.1,12.8L9.7,5.1l1.1,7.7 M13.4,29.8l1,7.3l6.6,1.6 M11.6,18.4l1,6.1 M32.8,41.9 M26.6,40.4 M27.3,40.2l6.1,1.6 M49.9,52.1l-5.6-7.6l-4.9-1.2",lineX:"M15.2,30 M19.7,15.6V1.9H29 M34.8,1.9H40.4 M55.3,15.6V1.9H45.9 M19.7,44.4V58.1H29 M34.8,58.1H40.4 M55.3,44.4 V58.1H45.9 M12.5,20.3l-9.4,9.6l9.6,9.8 M3.1,29.9h16.5 M62.5,20.3l9.4,9.6L62.3,39.7 M71.9,29.9H55.4",lineY:"M38.8,7.7 M52.7,12h13.2v9 M65.9,26.6V32 M52.7,46.3h13.2v-9 M24.9,12H11.8v9 M11.8,26.6V32 M24.9,46.3H11.8v-9 M48.2,5.1l-9.3-9l-9.4,9.2 M38.9-3.9V12 M48.2,53.3l-9.3,9l-9.4-9.2 M38.9,62.3V46.4",keep:"M4,10.5V1h10.3 M20.7,1h6.1 M33,1h6.1 M55.4,10.5V1H45.2 M4,17.3v6.6 M55.6,17.3v6.6 M4,30.5V40h10.3 M20.7,40 h6.1 M33,40h6.1 M55.4,30.5V40H45.2 M21,18.9h62.9v48.6H21V18.9z",clear:"M22,14.7l30.9,31 M52.9,14.7L22,45.7 M4.7,16.8V4.2h13.1 M26,4.2h7.8 M41.6,4.2h7.8 M70.3,16.8V4.2H57.2 M4.7,25.9v8.6 M70.3,25.9v8.6 M4.7,43.2v12.6h13.1 M26,55.8h7.8 M41.6,55.8h7.8 M70.3,43.2v12.6H57.2"},title:I(aM.title)};var sM=oM.prototype;sM.render=sM.updateView=function(t,e,i){var r,n,a;e.eachComponent({mainType:"brush"},function(e){r=e.brushType,n=e.brushOption.brushMode||"single",a|=e.areas.length}),this._brushType=r,this._brushMode=n,k(t.get("type",!0),function(e){t.setIconStatus(e,("keep"===e?"multiple"===n:"clear"===e?a:e===r)?"emphasis":"normal")})},sM.getIcons=function(){var e=this.model,t=e.get("icon",!0),i={};return k(e.get("type",!0),function(e){t[e]&&(i[e]=t[e])}),i},sM.onclick=function(e,t,i){var r=this._brushType,n=this._brushMode;"clear"===i?(t.dispatchAction({type:"axisAreaSelect",intervals:[]}),t.dispatchAction({type:"brush",command:"clear",areas:[]})):t.dispatchAction({type:"takeGlobalCursor",key:"brush",brushOption:{brushType:"keep"===i?r:r!==i&&i,brushMode:"keep"===i?"multiple"===n?"single":"multiple":n}})},mT("brush",oM),sp(function(e,t){var i=e&&e.brush;if(!R(i)){i=i?[i]:[]}if(!i.length){return}var r=[];k(i,function(e){var t=e.hasOwnProperty("toolbox")?e.toolbox:[];if(t instanceof Array){r=r.concat(t)}});var n=e&&e.toolbox;if(R(n)){n=n[0]}if(!n){n={feature:{}};e.toolbox=[n]}var a=n.feature||(n.feature={}),o=a.brush||(a.brush={}),s=o.type||(o.type=[]);if(s.push.apply(s,r),FP(s),t&&!s.length){s.push.apply(s,BP)}}),mp({type:"title",layoutMode:{type:"box",ignoreSize:!0},defaultOption:{zlevel:0,z:6,show:!0,text:"",target:"blank",subtext:"",subtarget:"blank",left:0,top:0,backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,itemGap:10,textStyle:{fontSize:18,fontWeight:"bolder",color:"#333"},subtextStyle:{color:"#aaa"}}}),gp({type:"title",render:function(e,t,i){if(this.group.removeAll(),e.get("show")){var r=this.group,n=e.getModel("textStyle"),a=e.getModel("subtextStyle"),o=e.get("textAlign"),s=W(e.get("textBaseline"),e.get("textVerticalAlign")),l=new $o({style:tl({},n,{text:e.get("text"),textFill:n.getTextColor()},{disableBox:!0}),z2:10}),u=l.getBoundingRect(),c=e.get("subtext"),d=new $o({style:tl({},a,{text:c,textFill:a.getTextColor(),y:u.height+e.get("itemGap"),textVerticalAlign:"top"},{disableBox:!0}),z2:10}),h=e.get("link"),p=e.get("sublink"),f=e.get("triggerEvent",!0);l.silent=!h&&!f,d.silent=!p&&!f,h&&l.on("click",function(){pu(h,"_"+e.get("target"))}),p&&d.on("click",function(){pu(h,"_"+e.get("subtarget"))}),l.eventData=d.eventData=f?{componentType:"title",componentIndex:e.componentIndex}:null,r.add(l),c&&r.add(d);var m=r.getBoundingRect(),g=e.getBoxLayoutParams();g.width=m.width,g.height=m.height;var y=Cu(g,{width:i.getWidth(),height:i.getHeight()},e.get("padding"));o||("middle"===(o=e.get("left")||e.get("right"))&&(o="center"),"right"===o?y.x+=y.width:"center"===o&&(y.x+=y.width/2)),s||("center"===(s=e.get("top")||e.get("bottom"))&&(s="middle"),"bottom"===s?y.y+=y.height:"middle"===s&&(y.y+=y.height/2),s=s||"top"),r.attr("position",[y.x,y.y]);var v={textAlign:o,textVerticalAlign:s};l.setStyle(v),d.setStyle(v),m=r.getBoundingRect();var _=y.margin,C=e.getItemStyle(["color","opacity"]);C.fill=e.get("backgroundColor");var x=new ns({shape:{x:m.x-_[3],y:m.y-_[0],width:m.width+_[1]+_[3],height:m.height+_[0]+_[2],r:e.get("borderRadius")},style:C,subPixelOptimize:!0,silent:!0});r.add(x)}}});function lM(e){var t=e.type,i={number:"value",time:"time"};if(i[t]&&(e.axisType=i[t],delete e.type),uM(e),cM(e,"controlPosition")){var r=e.controlStyle||(e.controlStyle={});cM(r,"position")||(r.position=e.controlPosition),"none"!==r.position||cM(r,"show")||(r.show=!1,delete r.position),delete e.controlPosition}k(e.data||[],function(e){V(e)&&!R(e)&&(!cM(e,"value")&&cM(e,"name")&&(e.value=e.name),uM(e))})}function uM(e){var t=e.itemStyle||(e.itemStyle={}),i=t.emphasis||(t.emphasis={}),r=e.label||e.label||{},n=r.normal||(r.normal={}),a={normal:1,emphasis:1};k(r,function(e,t){a[t]||cM(n,t)||(n[t]=e)}),i.label&&!cM(r,"emphasis")&&(r.emphasis=i.label,delete i.label)}function cM(e,t){return e.hasOwnProperty(t)}Eu.registerSubTypeDefaulter("timeline",function(){return"slider"}),up({type:"timelineChange",event:"timelineChanged",update:"prepareAndUpdate"},function(e,t){var i=t.getComponent("timeline");return i&&null!=e.currentIndex&&(i.setCurrentIndex(e.currentIndex),!i.get("loop",!0)&&i.isIndexMax()&&i.setPlayState(!1)),t.resetOption("timeline"),D({currentIndex:i.option.currentIndex},e)}),up({type:"timelinePlayChange",event:"timelinePlayChanged",update:"update"},function(e,t){var i=t.getComponent("timeline");i&&null!=e.playState&&i.setPlayState(e.playState)});var dM=Eu.extend({type:"timeline",layoutMode:"box",defaultOption:{zlevel:0,z:4,show:!0,axisType:"time",realtime:!0,left:"20%",top:null,right:"20%",bottom:0,width:null,height:40,padding:5,controlPosition:"left",autoPlay:!1,rewind:!1,loop:!0,playInterval:2e3,currentIndex:0,itemStyle:{},label:{color:"#000"},data:[]},init:function(e,t,i){this._data,this._names,this.mergeDefaultAndTheme(e,i),this._initData()},mergeOption:function(e){dM.superApply(this,"mergeOption",arguments),this._initData()},setCurrentIndex:function(e){null==e&&(e=this.option.currentIndex);var t=this._data.count();this.option.loop?e=(e%t+t)%t:(t<=e&&(e=t-1),e<0&&(e=0)),this.option.currentIndex=e},getCurrentIndex:function(){return this.option.currentIndex},isIndexMax:function(){return this.getCurrentIndex()>=this._data.count()-1},setPlayState:function(e){this.option.autoPlay=!!e},getPlayState:function(){return!!this.option.autoPlay},_initData:function(){var e=this.option,t=e.data||[],i=e.axisType,n=this._names=[];if("category"===i){var a=[];k(t,function(e,t){var i,r=Bn(e);V(e)?(i=I(e)).value=t:i=t,a.push(i),F(r)||null!=r&&!isNaN(r)||(r=""),n.push(r+"")}),t=a}var r={category:"ordinal",time:"time"}[i]||"number",o=this._data=new kp([{name:"value",type:r}],this);o.initData(t,n)},getData:function(){return this._data},getCategories:function(){if("category"===this.get("axisType"))return this._names.slice()}});A(dM.extend({type:"timeline.slider",defaultOption:{backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,orient:"horizontal",inverse:!1,tooltip:{trigger:"item"},symbol:"emptyCircle",symbolSize:10,lineStyle:{show:!0,width:2,color:"#304654"},label:{position:"auto",show:!0,interval:"auto",rotate:0,color:"#304654"},itemStyle:{color:"#304654",borderWidth:1},checkpointStyle:{symbol:"circle",symbolSize:13,color:"#c23531",borderWidth:5,borderColor:"rgba(194,53,49, 0.5)",animation:!0,animationDuration:300,animationEasing:"quinticInOut"},controlStyle:{show:!0,showPlayBtn:!0,showPrevBtn:!0,showNextBtn:!0,itemSize:22,itemGap:12,position:"left",playIcon:"path://M31.6,53C17.5,53,6,41.5,6,27.4S17.5,1.8,31.6,1.8C45.7,1.8,57.2,13.3,57.2,27.4S45.7,53,31.6,53z M31.6,3.3 C18.4,3.3,7.5,14.1,7.5,27.4c0,13.3,10.8,24.1,24.1,24.1C44.9,51.5,55.7,40.7,55.7,27.4C55.7,14.1,44.9,3.3,31.6,3.3z M24.9,21.3 c0-2.2,1.6-3.1,3.5-2l10.5,6.1c1.899,1.1,1.899,2.9,0,4l-10.5,6.1c-1.9,1.1-3.5,0.2-3.5-2V21.3z",stopIcon:"path://M30.9,53.2C16.8,53.2,5.3,41.7,5.3,27.6S16.8,2,30.9,2C45,2,56.4,13.5,56.4,27.6S45,53.2,30.9,53.2z M30.9,3.5C17.6,3.5,6.8,14.4,6.8,27.6c0,13.3,10.8,24.1,24.101,24.1C44.2,51.7,55,40.9,55,27.6C54.9,14.4,44.1,3.5,30.9,3.5z M36.9,35.8c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H36c0.5,0,0.9,0.4,0.9,1V35.8z M27.8,35.8 c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H27c0.5,0,0.9,0.4,0.9,1L27.8,35.8L27.8,35.8z",nextIcon:"path://M18.6,50.8l22.5-22.5c0.2-0.2,0.3-0.4,0.3-0.7c0-0.3-0.1-0.5-0.3-0.7L18.7,4.4c-0.1-0.1-0.2-0.3-0.2-0.5 c0-0.4,0.3-0.8,0.8-0.8c0.2,0,0.5,0.1,0.6,0.3l23.5,23.5l0,0c0.2,0.2,0.3,0.4,0.3,0.7c0,0.3-0.1,0.5-0.3,0.7l-0.1,0.1L19.7,52 c-0.1,0.1-0.3,0.2-0.5,0.2c-0.4,0-0.8-0.3-0.8-0.8C18.4,51.2,18.5,51,18.6,50.8z",prevIcon:"path://M43,52.8L20.4,30.3c-0.2-0.2-0.3-0.4-0.3-0.7c0-0.3,0.1-0.5,0.3-0.7L42.9,6.4c0.1-0.1,0.2-0.3,0.2-0.5 c0-0.4-0.3-0.8-0.8-0.8c-0.2,0-0.5,0.1-0.6,0.3L18.3,28.8l0,0c-0.2,0.2-0.3,0.4-0.3,0.7c0,0.3,0.1,0.5,0.3,0.7l0.1,0.1L41.9,54 c0.1,0.1,0.3,0.2,0.5,0.2c0.4,0,0.8-0.3,0.8-0.8C43.2,53.2,43.1,53,43,52.8z",color:"#304654",borderColor:"#304654",borderWidth:1},emphasis:{label:{show:!0,color:"#c23531"},itemStyle:{color:"#c23531"},controlStyle:{color:"#c23531",borderColor:"#c23531",borderWidth:2}},data:[]}}),Uc);var hM=id.extend({type:"timeline"}),pM=function(e,t,i,r){Dm.call(this,e,t,i),this.type=r||"value",this.model=null};pM.prototype={constructor:pM,getLabelModel:function(){return this.model.getModel("label")},isHorizontal:function(){return"horizontal"===this.model.get("orient")}},b(pM,Dm);var fM=T,mM=k,gM=Math.PI;function yM(e,t,i,r,n,a){var o=t.get("color");if(n)n.setColor(o),i.add(n),a&&a.onUpdate(n);else{var s=e.get("symbol");(n=dm(s,-1,-1,2,2,o)).setStyle("strokeNoScale",!0),i.add(n),a&&a.onCreate(n)}var l=t.getItemStyle(["color","symbol","symbolSize"]);n.setStyle(l),r=g({rectHover:!0,z2:100},r,!0);var u=e.get("symbolSize");(u=u instanceof Array?u.slice():[+u,+u])[0]/=2,u[1]/=2,r.scale=u;var c=e.get("symbolOffset");if(c){var d=r.position=r.position||[0,0];d[0]+=Ll(c[0],u[0]),d[1]+=Ll(c[1],u[1])}var h=e.get("symbolRotate");return r.rotation=(h||0)*Math.PI/180||0,n.attr(r),n.updateTransform(),n}function vM(e,t,i,r,n){if(!e.dragging){var a=r.getModel("checkpointStyle"),o=i.dataToCoord(r.getData().get(["value"],t));n||!a.get("animation",!0)?e.attr({position:[o,0]}):(e.stopAnimation(!0),e.animateTo({position:[o,0]},a.get("animationDuration",!0),a.get("animationEasing",!0)))}}hM.extend({type:"timeline.slider",init:function(e,t){this.api=t,this._axis,this._viewRect,this._timer,this._currentPointer,this._mainGroup,this._labelGroup},render:function(t,e,i,r){if(this.model=t,this.api=i,this.ecModel=e,this.group.removeAll(),t.get("show",!0)){var n=this._layout(t,i),a=this._createGroup("mainGroup"),o=this._createGroup("labelGroup"),s=this._axis=this._createAxis(n,t);t.formatTooltip=function(e){return ru(s.scale.getLabel(e))},mM(["AxisLine","AxisTick","Control","CurrentPointer"],function(e){this["_render"+e](n,a,s,t)},this),this._renderAxisLabel(n,o,s,t),this._position(n,t)}this._doPlayStop()},remove:function(){this._clearTimer(),this.group.removeAll()},dispose:function(){this._clearTimer()},_layout:function(e,t){var i=e.get("label.position"),r=e.get("orient"),n=function(e,t){return Cu(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()},e.get("padding"))}(e,t);null==i||"auto"===i?i="horizontal"===r?n.y+n.height/2n[1]&&(i=n[1]),i"),n&&(a+=CM(n),null!=i&&(a+=" : ")),null!=i&&(a+=CM(r)),a},getData:function(){return this._data},setData:function(e){this._data=e}});A(bM,Uc),bM.extend({type:"markPoint",defaultOption:{zlevel:0,z:5,symbol:"pin",symbolSize:50,tooltip:{trigger:"item"},label:{show:!0,position:"inside"},itemStyle:{borderWidth:2},emphasis:{label:{show:!0}}}});var AM=x;function SM(e,t,i,r,n,a){var o=[],s=nf(t,r),l=s?t.getCalculationInfo("stackResultDimension"):r,u=IM(t,l,e),c=t.indicesOfNearest(l,u)[0];o[n]=t.get(i,c),o[a]=t.get(l,c);var d=t.get(r,c),h=Bl(t.get(r,c));return 0<=(h=Math.min(h,20))&&(o[a]=+o[a].toFixed(h)),[o,d]}var wM=P,EM={min:wM(SM,"min"),max:wM(SM,"max"),average:wM(SM,"average")};function TM(e,t){var i=e.getData(),r=e.coordinateSystem;if(t&&!function(e){return!isNaN(parseFloat(e.x))&&!isNaN(parseFloat(e.y))}(t)&&!R(t.coord)&&r){var n=r.dimensions,a=PM(t,i,r,e);if((t=I(t)).type&&EM[t.type]&&a.baseAxis&&a.valueAxis){var o=AM(n,a.baseAxis.dim),s=AM(n,a.valueAxis.dim),l=EM[t.type](i,a.baseDataDim,a.valueDataDim,o,s);t.coord=l[0],t.value=l[1]}else{for(var u=[null!=t.xAxis?t.xAxis:t.radiusAxis,null!=t.yAxis?t.yAxis:t.angleAxis],c=0;c<2;c++)EM[u[c]]&&(u[c]=IM(i,i.mapDimension(n[c]),u[c]));t.coord=u}}return t}function PM(e,t,i,r){var n={};return null!=e.valueIndex||null!=e.valueDim?(n.valueDataDim=null!=e.valueIndex?t.getDimension(e.valueIndex):e.valueDim,n.valueAxis=i.getAxis(function(e,t){var i=e.getData(),r=i.dimensions;t=i.getDimension(t);for(var n=0;ni[n],p=[-c.x,-c.y];t||(p[r]=s.position[r]);var f=[0,0],m=[-d.x,-d.y],g=W(e.get("pageButtonGap",!0),e.get("itemGap",!0));if(h){var y=e.get("pageButtonPosition",!0);"end"===y?m[r]+=i[n]-d[n]:f[r]+=d[n]+g}m[1-r]+=c[a]/2-d[a]/2,s.attr("position",p),l.attr("position",f),u.attr("position",m);var v={x:0,y:0};if(v[n]=h?i[n]:c[n],v[a]=Math.max(c[a],d[a]),v[o]=Math.min(0,d[o]+m[1-r]),l.__rectSize=i[n],h){var _={x:0,y:0};_[n]=Math.max(i[n]-d[n]-g,0),_[a]=v[a],l.setClipPath(new ns({shape:_})),l.__rectSize=_[n]}else u.eachChild(function(e){e.attr({invisible:!0,silent:!0})});var C=this._getPageInfo(e);return null!=C.pageIndex&&ul(s,{position:C.contentPosition},h&&e),this._updatePageInfoView(e,C),v},_pageGo:function(e,t,i){var r=this._getPageInfo(t)[e];null!=r&&i.dispatchAction({type:"legendScroll",scrollDataIndex:r,legendId:t.id})},_updatePageInfoView:function(r,n){var a=this._controllerGroup;k(["pagePrev","pageNext"],function(e){var t=null!=n[e+"DataIndex"],i=a.childOfName(e);i&&(i.setStyle("fill",t?r.get("pageIconColor",!0):r.get("pageIconInactiveColor",!0)),i.cursor=t?"pointer":"default")});var e=a.childOfName("pageText"),t=r.get("pageFormatter"),i=n.pageIndex,o=null!=i?i+1:0,s=n.pageCount;e&&t&&e.setStyle("text",F(t)?t.replace("{current}",o).replace("{total}",s):t({current:o,total:s}))},_getPageInfo:function(e){var t=e.get("scrollDataIndex",!0),i=this.getContentGroup(),r=this._containerGroup.__rectSize,n=e.getOrient().index,a=oD[n],o=sD[n],s=this._findTargetItemIndex(t),l=i.children(),u=l[s],c=l.length,d=c?1:0,h={contentPosition:i.position.slice(),pageCount:d,pageIndex:d-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!u)return h;var p=v(u);h.contentPosition[n]=-p.s;for(var f=s+1,m=p,g=p,y=null;f<=c;++f)(!(y=v(l[f]))&&g.e>m.s+r||y&&!_(y,m.s))&&(m=g.i>m.i?g:y)&&(null==h.pageNextDataIndex&&(h.pageNextDataIndex=m.i),++h.pageCount),g=y;for(var f=s-1,m=p,g=p,y=null;-1<=f;--f)(y=v(l[f]))&&_(g,y.s)||!(m.i=t&&e.s<=t+r}},_findTargetItemIndex:function(r){if(!this._showController)return 0;var n,a,e=this.getContentGroup();return e.eachChild(function(e,t){var i=e.__legendDataIndex;null==a&&null!=i&&(a=t),i===r&&(n=t)}),null!=n?n:a}});up("legendScroll","legendscroll",function(e,t){var i=e.scrollDataIndex;null!=i&&t.eachComponent({mainType:"legend",subType:"scroll",query:e},function(e){e.setScrollDataIndex(i)})});dP.extend({type:"dataZoom.slider",layoutMode:"box",defaultOption:{show:!0,right:"ph",top:"ph",width:"ph",height:"ph",left:null,bottom:null,backgroundColor:"rgba(47,69,84,0)",dataBackground:{lineStyle:{color:"#2f4554",width:.5,opacity:.3},areaStyle:{color:"rgba(47,69,84,0.3)",opacity:.3}},borderColor:"#ddd",fillerColor:"rgba(167,183,204,0.4)",handleIcon:"M8.2,13.6V3.9H6.3v9.7H3.1v14.9h3.3v9.7h1.8v-9.7h3.3V13.6H8.2z M9.7,24.4H4.8v-1.4h4.9V24.4z M9.7,19.1H4.8v-1.4h4.9V19.1z",handleSize:"100%",handleStyle:{color:"#a7b7cc"},labelPrecision:null,labelFormatter:null,showDetail:!0,showDataShadow:"auto",realtime:!0,zoomLock:!1,textStyle:{color:"#333"}}});var uD=ns,cD=Rl,dD=kl,hD=T,pD=k,fD="horizontal",mD=["line","bar","candlestick","scatter"],gD=fP.extend({type:"dataZoom.slider",init:function(e,t){this._displayables={},this._orient,this._range,this._handleEnds,this._size,this._handleWidth,this._handleHeight,this._location,this._dragging,this._dataShadowInfo,this.api=t},render:function(e,t,i,r){gD.superApply(this,"render",arguments),vd(this,"_dispatchZoomAction",this.dataZoomModel.get("throttle"),"fixRate"),this._orient=e.get("orient"),!1!==this.dataZoomModel.get("show")?(r&&"dataZoom"===r.type&&r.from===this.uid||this._buildView(),this._updateView()):this.group.removeAll()},remove:function(){gD.superApply(this,"remove",arguments),_d(this,"_dispatchZoomAction")},dispose:function(){gD.superApply(this,"dispose",arguments),_d(this,"_dispatchZoomAction")},_buildView:function(){var e=this.group;e.removeAll(),this._resetLocation(),this._resetInterval();var t=this._displayables.barGroup=new Ti;this._renderBackground(),this._renderHandle(),this._renderDataShadow(),e.add(t),this._positionGroup()},_resetLocation:function(){var e=this.dataZoomModel,t=this.api,i=this._findCoordRect(),r={width:t.getWidth(),height:t.getHeight()},n=this._orient===fD?{right:r.width-i.x-i.width,top:r.height-30-7,width:i.width,height:30}:{right:7,top:i.y,width:30,height:i.height},a=Au(e.option);k(["right","top","width","height"],function(e){"ph"===a[e]&&(a[e]=n[e])});var o=Cu(a,r,e.padding);this._location={x:o.x,y:o.y},this._size=[o.width,o.height],"vertical"===this._orient&&this._size.reverse()},_positionGroup:function(){var e=this.group,t=this._location,i=this._orient,r=this.dataZoomModel.getFirstTargetAxisModel(),n=r&&r.get("inverse"),a=this._displayables.barGroup,o=(this._dataShadowInfo||{}).otherAxisInverse;a.attr(i!==fD||n?i===fD&&n?{scale:o?[-1,1]:[-1,-1]}:"vertical"!==i||n?{scale:o?[-1,-1]:[-1,1],rotation:Math.PI/2}:{scale:o?[1,-1]:[1,1],rotation:Math.PI/2}:{scale:o?[1,1]:[1,-1]});var s=e.getBoundingRect([a]);e.attr("position",[t.x-s.x,t.y-s.y])},_getViewExtent:function(){return[0,this._size[0]]},_renderBackground:function(){var e=this.dataZoomModel,t=this._size,i=this._displayables.barGroup;i.add(new uD({silent:!0,shape:{x:0,y:0,width:t[0],height:t[1]},style:{fill:e.get("backgroundColor")},z2:-40})),i.add(new uD({shape:{x:0,y:0,width:t[0],height:t[1]},style:{fill:"transparent"},z2:0,onclick:T(this._onClickPanelClick,this)}))},_renderDataShadow:function(){var e=this._dataShadowInfo=this._prepareDataShadowInfo();if(e){var t=this._size,i=e.series,r=i.getRawData(),n=i.getShadowDim?i.getShadowDim():e.otherDim;if(null!=n){var a=r.getDataExtent(n),o=.3*(a[1]-a[0]);a=[a[0]-o,a[1]+o];var s,l=[0,t[1]],u=[0,t[0]],c=[[t[0],0],[0,0]],d=[],h=u[1]/(r.count()-1),p=0,f=Math.round(r.count()/t[0]);r.each([n],function(e,t){if(0t[0]||i[1]<0||i[1]>t[1])){var r=this._handleEnds,n=(r[0]+r[1])/2,a=this._updateInterval("all",i[0]-n);this._updateView(),a&&this._dispatchZoomAction()}},_dispatchZoomAction:function(){var e=this._range;this.api.dispatchAction({type:"dataZoom",from:this.uid,dataZoomId:this.dataZoomModel.id,start:e[0],end:e[1]})},_findCoordRect:function(){var i;if(pD(this.getTargetCoordInfo(),function(e){if(!i&&e.length){var t=e[0].model.coordinateSystem;i=t.getRect&&t.getRect()}}),!i){var e=this.api.getWidth(),t=this.api.getHeight();i={x:.2*e,y:.2*t,width:.6*e,height:.6*t}}return i}});function yD(e){return"vertical"===e?"ns-resize":"ew-resize"}dP.extend({type:"dataZoom.inside",defaultOption:{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}});var vD="\0_ec_dataZoom_roams";function _D(e,r){var t=xD(e),n=r.dataZoomId,a=r.coordId;k(t,function(e,t){var i=e.dataZoomInfos;i[n]&&x(r.allCoordIds,a)<0&&(delete i[n],e.count--)}),bD(t);var i=t[a];i||((i=t[a]={coordId:a,dataZoomInfos:{},count:0}).controller=function(e,o){var t=new Iv(e.getZr());return k(["pan","zoom","scrollMove"],function(a){t.on(a,function(r){var n=[];k(o.dataZoomInfos,function(e){if(r.isAvailableBehavior(e.dataZoomModel.option)){var t=(e.getRange||{})[a],i=t&&t(o.controller,r);!e.dataZoomModel.get("disabled",!0)&&i&&n.push({dataZoomId:e.dataZoomId,start:i[0],end:i[1]})}}),n.length&&o.dispatchAction(n)})}),t}(e,i),i.dispatchAction=P(AD,e)),i.dataZoomInfos[n]||i.count++,i.dataZoomInfos[n]=r;var o=function(e){var r,n={type_true:2,type_move:1,type_false:0,type_undefined:-1},a=!0;return k(e,function(e){var t=e.dataZoomModel,i=!t.get("disabled",!0)&&(!t.get("zoomLock",!0)||"move");n["type_"+r]"],R(e)&&(e=e.slice(),r=!0),n=t?e:r?[u(e[0]),u(e[1])]:u(e),F(l)?l.replace("{value}",r?n[0]:n).replace("{value2}",r?n[1]:n):N(l)?r?l(e[0],e[1]):l(e):r?e[0]===s[0]?i[0]+" "+n[1]:e[1]===s[1]?i[1]+" "+n[0]:n[0]+" - "+n[1]:n;function u(e){return e===s[0]?"min":e===s[1]?"max":(+e).toFixed(Math.min(o,20))}},resetExtent:function(){var e=this.option,t=zD([e.min,e.max]);this._dataExtent=t},getDataDimension:function(e){var t=this.option.dimension,i=e.dimensions;if(null!=t||i.length){if(null!=t)return e.getDimension(t);for(var r=e.dimensions,n=r.length-1;0<=n;n--){var a=r[n],o=e.getDimensionInfo(a);if(!o.isCalculationCoord)return a}}},getExtent:function(){return this._dataExtent.slice()},completeVisualOption:function(){var e=this.ecModel,t=this.option,i={inRange:t.inRange,outOfRange:t.outOfRange},r=t.target||(t.target={}),n=t.controller||(t.controller={});g(r,i),g(n,i);var u=this.isCategory();function a(r){FD(t.color)&&!r.inRange&&(r.inRange={color:t.color.slice().reverse()}),r.inRange=r.inRange||{color:e.get("gradientColor")},VD(this.stateList,function(e){var t=r[e];if(F(t)){var i=LD.get(t,"active",u);i?(r[e]={},r[e][t]=i):delete r[e]}},this)}a.call(this,r),a.call(this,n),function(e,t,i){var r=e[t],n=e[i];r&&!n&&(n=e[i]={},VD(r,function(e,t){if(cC.isValidType(t)){var i=LD.get(t,"inactive",u);null!=i&&(n[t]=i,"color"!==t||n.hasOwnProperty("opacity")||n.hasOwnProperty("colorAlpha")||(n.opacity=[0,0]))}}))}.call(this,r,"inRange","outOfRange"),function(a){var o=(a.inRange||{}).symbol||(a.outOfRange||{}).symbol,s=(a.inRange||{}).symbolSize||(a.outOfRange||{}).symbolSize,l=this.get("inactiveColor");VD(this.stateList,function(e){var t=this.itemSize,i=a[e];null==(i=i||(a[e]={color:u?l:[l]})).symbol&&(i.symbol=o&&I(o)||(u?"roundRect":["roundRect"])),null==i.symbolSize&&(i.symbolSize=s&&I(s)||(u?t[0]:[t[0],t[0]])),i.symbol=kD(i.symbol,function(e){return"none"===e||"square"===e?"roundRect":e});var r=i.symbolSize;if(null!=r){var n=-1/0;BD(r,function(e){nt[1]&&t.reverse(),t[0]=Math.max(t[0],e[0]),t[1]=Math.min(t[1],e[1]))},completeVisualOption:function(){GD.prototype.completeVisualOption.apply(this,arguments),k(this.stateList,function(e){var t=this.option.controller[e].symbolSize;t&&t[0]!==t[1]&&(t[0]=0)},this)},setSelected:function(e){this.option.range=e.slice(),this._resetRange()},getSelected:function(){var e=this.getExtent(),t=kl((this.get("range")||[]).slice());return t[0]>e[1]&&(t[0]=e[1]),t[1]>e[1]&&(t[1]=e[1]),t[0]=i[1]||e<=t[1])?"inRange":"outOfRange"},findTargetDataIndices:function(r){var n=[];return this.eachTargetSeries(function(e){var i=[],t=e.getData();t.each(this.getDataDimension(t),function(e,t){r[0]<=e&&e<=r[1]&&i.push(t)},this),n.push({seriesId:e.id,dataIndex:i})},this),n},getVisualMeta:function(i){var e=WD(this,"outOfRange",this.getExtent()),t=WD(this,"inRange",this.option.range.slice()),r=[];function n(e,t){r.push({value:e,color:i(e,t)})}for(var a=0,o=0,s=t.length,l=e.length;oe[1])break;i.push({color:this.getControllerVisual(a,"color",t),offset:n/100})}return i.push({color:this.getControllerVisual(e[1],"color",t),offset:1}),i},_createBarPoints:function(e,t){var i=this.visualMapModel.itemSize;return[[i[0]-t[0],e[0]],[i[0],e[0]],[i[0],e[1]],[i[0]-t[1],e[1]]]},_createBarGroup:function(e){var t=this._orient,i=this.visualMapModel.get("inverse");return new Ti("horizontal"!==t||i?"horizontal"===t&&i?{scale:"bottom"===e?[-1,1]:[1,1],rotation:-Math.PI/2}:"vertical"!==t||i?{scale:"left"===e?[1,1]:[-1,1]}:{scale:"left"===e?[1,-1]:[-1,-1]}:{scale:"bottom"===e?[1,1]:[-1,1],rotation:Math.PI/2})},_updateHandle:function(r,n){if(this._useHandle){var a=this._shapes,o=this.visualMapModel,s=a.handleThumbs,l=a.handleLabels;XD([0,1],function(e){var t=s[e];t.setStyle("fill",n.handlesColor[e]),t.position[1]=r[e];var i=hl(a.handleLabelPoints[e],dl(t,this.group));l[e].setStyle({x:i[0],y:i[1],text:o.formatValueText(this._dataInterval[e]),textVerticalAlign:"middle",textAlign:this._applyTransform("horizontal"===this._orient?0===e?"bottom":"top":"left",a.barGroup)})},this)}},_showIndicator:function(e,t,i,r){var n=this.visualMapModel,a=n.getExtent(),o=n.itemSize,s=[0,o[1]],l=YD(e,a,s,!0),u=this._shapes,c=u.indicator;if(c){c.position[1]=l,c.attr("invisible",!1),c.setShape("points",function(e,t,i,r){return e?[[0,-ZD(t,JD(i,0))],[6,0],[0,ZD(t,JD(r-i,0))]]:[[0,0],[5,-5],[5,5]]}(!!i,r,l,o[1]));var d=this.getControllerVisual(e,"color",{convertOpacityToAlpha:true});c.setStyle("fill",d);var h=hl(u.indicatorLabelPoint,dl(c,this.group)),p=u.indicatorLabel;p.attr("invisible",!1);var f=this._applyTransform("left",u.barGroup),m=this._orient;p.setStyle({text:(i||"")+n.formatValueText(t),textVerticalAlign:"horizontal"===m?f:"middle",textAlign:"horizontal"===m?"center":f,x:h[0],y:h[1]})}},_enableHoverLinkToSeries:function(){var r=this;this._shapes.barGroup.on("mousemove",function(e){if(r._hovering=!0,!r._dragging){var t=r.visualMapModel.itemSize,i=r._applyTransform([e.offsetX,e.offsetY],r._shapes.barGroup,!0,!0);i[1]=ZD(JD(0,i[1]),t[1]),r._doHoverLinkToSeries(i[1],0<=i[0]&&i[0]<=t[0])}}).on("mouseout",function(){r._hovering=!1,r._dragging||r._clearHoverLinkToSeries()})},_enableHoverLinkFromSeries:function(){var e=this.api.getZr();this.visualMapModel.option.hoverLink?(e.on("mouseover",this._hoverLinkFromSeriesMouseOver,this),e.on("mouseout",this._hideIndicator,this)):this._clearHoverLinkFromSeries()},_doHoverLinkToSeries:function(e,t){var i=this.visualMapModel,r=i.itemSize;if(i.option.hoverLink){var n=[0,r[1]],a=i.getExtent();e=ZD(JD(n[0],e),n[1]);var o=function(e,t,i){var r=6,n=e.get("hoverLinkDataSize");n&&(r=YD(n,t,i,!0)/2);return r}(i,a,n),s=[e-o,e+o],l=YD(e,n,a,!0),u=[YD(s[0],n,a,!0),YD(s[1],n,a,!0)];s[0] ",o):this._showIndicator(l,l,"≈ ",o));var c=this._hoverLinkDataIndices,d=[];(t||tI(i))&&(d=this._hoverLinkDataIndices=i.findTargetDataIndices(u));var h=function(e,t){var i={},r={};return n(e||[],i),n(t||[],r,i),[a(i),a(r)];function n(e,t,i){for(var r=0,n=e.length;ri&&r([i,t[0]],"outOfRange"),r(t.slice()),i=t[1])},this),{stops:a,outerColors:o}}function r(e,t){var i=s.getRepresentValue({interval:e});t=t||s.getValueState(i);var r=n(i,t);e[0]===-1/0?o[0]=r:e[1]===1/0?o[1]=r:a.push({value:e[0],color:r},{value:e[1],color:r})}}}),nI={splitNumber:function(){var e=this.option,t=this._pieceList,i=Math.min(e.precision,20),r=this.getExtent(),n=e.splitNumber;n=Math.max(parseInt(n,10),1),e.splitNumber=n;for(var a=(r[1]-r[0])/n;+a.toFixed(i)!==a&&i<5;)i++;e.precision=i,a=+a.toFixed(i),e.minOpen&&t.push({interval:[-1/0,r[0]],close:[0,0]});for(var o=0,s=r[0];on[1]&&console.warn("Piece "+t+"is illegal: "+n+" lower bound should not greater then uppper bound."),n[0]===n[1]&&a[0]&&a[1]&&(i.value=n[0])}i.visual=cC.retrieveVisuals(e),h.push(i)},this),aI(e,h),Yl(h),k(h,function(e){var t=e.close,i=[["<","≤"][t[1]],[">","≥"][t[0]]];e.text=e.text||this.formatValueText(null!=e.value?e.value:e.interval,!1,i)},this)}};function aI(e,t){var i=e.inverse;("vertical"===e.orient?!i:i)&&t.reverse()}jD.extend({type:"visualMap.piecewise",doRender:function(){var a=this.group;a.removeAll();var o=this.visualMapModel,s=o.get("textGap"),e=o.textStyleModel,l=e.getFont(),u=e.getTextColor(),c=this._getItemAlign(),d=o.itemSize,t=this._getViewData(),i=t.endsText,h=H(o.get("showLabel",!0),!i);i&&this._renderEndsText(a,i[0],d,h,c),k(t.viewPieceList,function(e){var t=e.piece,i=new Ti;i.onclick=T(this._onItemClick,this,t),this._enableHoverLink(i,e.indexInModelPieceList);var r=o.getRepresentValue(t);if(this._createItemSymbol(i,r,[0,0,d[0],d[1]]),h){var n=this.visualMapModel.getValueState(r);i.add(new $o({style:{x:"right"===c?-s:d[0]+s,y:d[1]/2,text:t.text,textVerticalAlign:"middle",textAlign:c,textFont:l,textFill:u,opacity:"outOfRange"===n?.5:1}}))}a.add(i)},this),i&&this._renderEndsText(a,i[1],d,h,c),_u(o.get("orient"),a,o.get("itemGap")),this.renderBackground(a),this.positionGroup(a)},_enableHoverLink:function(e,i){function t(e){var t=this.visualMapModel;t.option.hoverLink&&this.api.dispatchAction({type:e,batch:QD(t.findTargetDataIndices(i),t)})}e.on("mouseover",T(t,this,"highlight")).on("mouseout",T(t,this,"downplay"))},_getItemAlign:function(){var e=this.visualMapModel,t=e.option;if("vertical"===t.orient)return qD(e,this.api,e.itemSize);var i=t.align;return i&&"auto"!==i||(i="left"),i},_renderEndsText:function(e,t,i,r,n){if(t){var a=new Ti,o=this.visualMapModel.textStyleModel;a.add(new $o({style:{x:r?"right"===n?i[0]:0:i[0]/2,y:i[1]/2,textVerticalAlign:"middle",textAlign:r?n:"center",text:t,textFont:o.getFont(),textFill:o.getTextColor()}})),e.add(a)}},_getViewData:function(){var e=this.visualMapModel,t=B(e.getPieceList(),function(e,t){return{piece:e,indexInModelPieceList:t}}),i=e.get("text"),r=e.get("orient"),n=e.get("inverse");return("horizontal"===r?n:!n)?t.reverse():i=i&&i.slice().reverse(),{viewPieceList:t,endsText:i}},_createItemSymbol:function(e,t,i){e.add(dm(this.getControllerVisual(t,"symbol"),i[0],i[1],i[2],i[3],this.getControllerVisual(t,"color")))},_onItemClick:function(e){var t=this.visualMapModel,i=t.option,r=I(i.selected),n=t.getSelectedMapKey(e);"single"===i.selectedMode?(r[n]=!0,k(r,function(e,t){r[t]=t===n})):r[n]=!r[n],this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:r})}});sp(DD);var oI,sI="urn:schemas-microsoft-com:vml",lI="undefined"==typeof window?null:window,uI=!1,cI=lI&&lI.document;function dI(e){return oI(e)}if(cI&&!v.canvasSupported)try{cI.namespaces.zrvml||cI.namespaces.add("zrvml",sI),oI=function(e){return cI.createElement("')}}catch(e){oI=function(e){return cI.createElement("<"+e+' xmlns="'+sI+'" class="zrvml">')}}var hI=io.CMD,pI=Math.round,fI=Math.sqrt,mI=Math.abs,gI=Math.cos,yI=Math.sin,vI=Math.max;if(!v.canvasSupported){var _I=",",CI="progid:DXImageTransform.Microsoft",xI=21600,bI=10800,AI=function(e){e.style.cssText="position:absolute;left:0;top:0;width:1px;height:1px;",e.coordsize=xI+","+xI,e.coordorigin="0,0"},SI=function(e,t,i){return"rgb("+[e,t,i].join(",")+")"},wI=function(e,t){t&&e&&t.parentNode!==e&&e.appendChild(t)},EI=function(e,t){t&&e&&t.parentNode===e&&e.removeChild(t)},TI=function(e,t,i){return 1e5*(parseFloat(e)||0)+1e3*(parseFloat(t)||0)+i},PI=Hr,MI=function(e,t,i){var r=Ht(t);i=+i,isNaN(i)&&(i=1),r&&(e.color=SI(r[0],r[1],r[2]),e.opacity=i*r[3])},DI=function(e){var t=Ht(e);return[SI(t[0],t[1],t[2]),t[3]]},II=function(e,t,i,r){var n="fill"===t,a=e.getElementsByTagName(t)[0];null!=i[t]&&"none"!==i[t]&&(n||!n&&i.lineWidth)?(e[n?"filled":"stroked"]="true",i[t]instanceof hs&&EI(e,a),a=a||dI(t),n?function(e,t,i){var r=t.fill;if(r!=null){if(r instanceof hs){var n;var a=0;var o=[0,0];var s=0;var l=1;var u=i.getBoundingRect();var c=u.width;var d=u.height;if(r.type==="linear"){n="gradient";var h=i.transform;var p=[r.x*c,r.y*d];var f=[r.x2*c,r.y2*d];if(h){Se(p,p,h);Se(f,f,h)}var m=f[0]-p[0];var g=f[1]-p[1];a=Math.atan2(m,g)*180/Math.PI;if(a<0){a+=360}if(a<1e-6){a=0}}else{n="gradientradial";var p=[r.x*c,r.y*d];var h=i.transform;var y=i.scale;var v=c;var _=d;o=[(p[0]-u.x)/v,(p[1]-u.y)/_];if(h){Se(p,p,h)}v/=y[0]*xI;_/=y[1]*xI;var C=vI(v,_);s=2*0/C;l=2*r.r/C-s}var x=r.colorStops.slice();x.sort(function(e,t){return e.offset-t.offset});var b=x.length;var A=[];var S=[];for(var w=0;w=2){var P=A[0][0];var M=A[1][0];var D=A[0][1]*t.opacity;var I=A[1][1]*t.opacity;e.type=n;e.method="none";e.focus="100%";e.angle=a;e.color=P;e.color2=M;e.colors=S.join(",");e.opacity=I;e.opacity2=D}if(n==="radial"){e.focusposition=o.join(",")}}else{MI(e,r,t.opacity)}}}(a,i,r):function(e,t){if(t.lineDash){e.dashstyle=t.lineDash.join(" ")}if(t.stroke!=null&&!(t.stroke instanceof hs)){MI(e,t.stroke,t.opacity)}}(a,i),wI(e,a)):(e[n?"filled":"stroked"]="false",EI(e,a))},OI=[[],[],[]];wo.prototype.brushVML=function(e){var t=this.style,i=this._vmlEl;i||(i=dI("shape"),AI(i),this._vmlEl=i),II(i,"fill",t,this),II(i,"stroke",t,this);var r=this.transform,n=null!=r,a=i.getElementsByTagName("stroke")[0];if(a){var o=t.lineWidth;if(n&&!t.strokeNoScale){var s=r[0]*r[3]-r[1]*r[2];o*=fI(mI(s))}a.weight=o+"px"}var l=this.path||(this.path=new io);this.__dirtyPath&&(l.beginPath(),l.subPixelOptimize=!1,this.buildPath(l,this.shape),l.toStatic(),this.__dirtyPath=!1),i.path=function(e,t){var i=hI.M,r=hI.C,n=hI.L,a=hI.A,o=hI.Q,s=[],l,u,c,d,h,p,f=e.data,m=e.len();for(d=0;d.01){if(R){L+=270/xI}}else{if(Math.abs(N-P)<1e-4){if(R&&LT){y-=270/xI}else{y+=270/xI}}else if(R&&NP){g+=270/xI}else{g-=270/xI}}}s.push(k,pI(((T-M)*S+b)*xI-bI),_I,pI(((P-D)*w+A)*xI-bI),_I,pI(((T+M)*S+b)*xI-bI),_I,pI(((P+D)*w+A)*xI-bI),_I,pI((L*S+b)*xI-bI),_I,pI((N*w+A)*xI-bI),_I,pI((g*S+b)*xI-bI),_I,pI((y*w+A)*xI-bI));h=g;p=y;break;case hI.R:var B=OI[0];var F=OI[1];B[0]=f[d++];B[1]=f[d++];F[0]=B[0]+f[d++];F[1]=B[1]+f[d++];if(t){Se(B,B,t);Se(F,F,t)}B[0]=pI(B[0]*xI-bI);F[0]=pI(F[0]*xI-bI);B[1]=pI(B[1]*xI-bI);F[1]=pI(F[1]*xI-bI);s.push(" m ",B[0],_I,B[1]," l ",F[0],_I,B[1]," l ",F[0],_I,F[1]," l ",B[0],_I,F[1]);break;case hI.Z:s.push(" x ")}if(l>0){s.push(u);for(var V=0;VBI){kI=0;NI={}}var i=FI.style;var r;try{i.font=e;r=i.fontFamily.split(",")[0]}catch(e){}t={style:i.fontStyle||LI,variant:i.fontVariant||LI,weight:i.fontWeight||LI,size:parseFloat(i.fontSize||12)|0,family:r||"Microsoft YaHei"};NI[e]=t;kI++}return t}(n.font),g=m.style+" "+m.variant+" "+m.weight+" "+m.size+'px "'+m.family+'"';i=i||hr(a,g,p,f,n.textPadding,n.textLineHeight);var y=this.transform;if(y&&!r&&(VI.copy(t),VI.applyTransform(y),t=VI),r)d=t.x,h=t.y;else{var v=n.textPosition;if(v instanceof Array)d=t.x+PI(v[0],t.width),h=t.y+PI(v[1],t.height),p=p||"left";else{var _=this.calculateTextPosition?this.calculateTextPosition({},n,t):mr({},n,t);d=_.x,h=_.y,p=p||_.textAlign,f=f||_.textVerticalAlign}}d=pr(d,i.width,p),h=fr(h,i.height,f),h+=i.height/2;var C,x,b,A=dI,S=this._textVmlEl;S?(b=S.firstChild,C=b.nextSibling,x=C.nextSibling):(S=A("line"),C=A("path"),x=A("textpath"),b=A("skew"),x.style["v-text-align"]="left",AI(S),C.textpathok=!0,x.on=!0,S.from="0 0",S.to="1000 0.05",wI(S,b),wI(S,C),wI(S,x),this._textVmlEl=S);var w=[d,h],E=S.style;y&&r?(Se(w,w,y),b.on=!0,b.matrix=y[0].toFixed(3)+","+y[2].toFixed(3)+","+y[1].toFixed(3)+","+y[3].toFixed(3)+",0,0",b.offset=(pI(w[0])||0)+","+(pI(w[1])||0),b.origin="0 0",E.left="0px",E.top="0px"):(b.on=!1,E.left=pI(d)+"px",E.top=pI(h)+"px"),x.string=function(e){return String(e).replace(/&/g,"&").replace(/"/g,""")}(a);try{x.style.font=g}catch(e){}II(S,"fill",{fill:n.textFill,opacity:n.opacity},this),II(S,"stroke",{stroke:n.textStroke,opacity:n.opacity,lineDash:n.lineDash||null},this),S.style.zIndex=TI(this.zlevel,this.z,this.z2),wI(e,S)}},UI=function(e){EI(e,this._textVmlEl),this._textVmlEl=null},GI=function(e){wI(e,this._textVmlEl)},$I=[Qr,Yr,Xr,wo,$o],HI=0;HI<$I.length;HI++){var WI=$I[HI].prototype;WI.drawRectText=zI,WI.removeRectText=UI,WI.appendRectText=GI}$o.prototype.brushVML=function(e){var t=this.style;null!=t.text?this.drawRectText(e,{x:t.x||0,y:t.y||0,width:0,height:0},this.getBoundingRect(),!0):this.removeRectText(e)},$o.prototype.onRemove=function(e){this.removeRectText(e)},$o.prototype.onAdd=function(e){this.appendRectText(e)}}function jI(e){return parseInt(e,10)}function qI(e,t){!function(){if(uI||!cI)return;uI=!0;var e=cI.styleSheets;e.length<31?cI.createStyleSheet().addRule(".zrvml","behavior:url(#default#VML)"):e[0].addRule(".zrvml","behavior:url(#default#VML)")}(),this.root=e,this.storage=t;var i=document.createElement("div"),r=document.createElement("div");i.style.cssText="display:inline-block;overflow:hidden;position:relative;width:300px;height:150px;",r.style.cssText="position:absolute;left:0;top:0;",e.appendChild(i),this._vmlRoot=r,this._vmlViewport=i,this.resize();var n=t.delFromStorage,a=t.addToStorage;t.delFromStorage=function(e){n.call(t,e),e&&e.onRemove&&e.onRemove(r)},t.addToStorage=function(e){e.onAdd&&e.onAdd(r),a.call(t,e)},this._firstPaint=!0}qI.prototype={constructor:qI,getType:function(){return"vml"},getViewportRoot:function(){return this._vmlViewport},getViewportRootOffset:function(){var e=this.getViewportRoot();if(e)return{offsetLeft:e.offsetLeft||0,offsetTop:e.offsetTop||0}},refresh:function(){var e=this.storage.getDisplayList(!0,!0);this._paintList(e)},_paintList:function(e){for(var t=this._vmlRoot,i=0;i=d&&h<=i+1){for(var r=[],n=0;n=d&&h<=n+1)return xO(c,t.components);f[e]=t}else f[e]=void 0}var s;p++}for(;p<=t;){var o=a();if(o)return o}},pushComponent:function(e,t,i){var r=e[e.length-1];r&&r.added===t&&r.removed===i?e[e.length-1]={count:r.count+1,added:t,removed:i}:e.push({count:1,added:t,removed:i})},extractCommon:function(e,t,i,r){for(var n=t.length,a=i.length,o=e.newPos,s=o-r,l=0;o+1\n\r<"));return"data:image/svg+xml;charset=UTF-8,"+e}},k(["getLayer","insertLayer","eachLayer","eachBuiltinLayer","eachOtherLayer","getLayers","modLayer","delLayer","clearLayer","pathToImage"],function(e){kO.prototype[e]=function(){}}),Tn("svg",kO),e.version="4.8.0",e.dependencies=yh,e.PRIORITY=vh,e.init=function(e,t,i){if(M){if("4.3.1".replace(".","")-0CesiumMath.EPSILON12);var D=c*(t*t-i*i)/(i*i),I=D*(256+D*(D*(74-47*D)-128))/1024,O=d*d,R=i*(1+D*(4096+D*(D*(320-175*D)-768))/16384)*(s-I*u*(d+I*(l*(2*O-1)-I*d*(4*u*u-3)*(4*O-3)/6)/4)),L=Math.atan2(v*T,x-A*E),N=Math.atan2(g*T,x*E-A);e._distance=R,e._startHeading=L,e._endHeading=N,e._uSquared=D}var scratchCart1=new Cartesian3,scratchCart2=new Cartesian3;function computeProperties(e,t,i,r){Cartesian3.normalize(r.cartographicToCartesian(t,scratchCart2),scratchCart1),Cartesian3.normalize(r.cartographicToCartesian(i,scratchCart2),scratchCart2);vincentyInverseFormula(e,r.maximumRadius,r.minimumRadius,t.longitude,t.latitude,i.longitude,i.latitude),e._start=Cartographic.clone(t,e._start),e._end=Cartographic.clone(i,e._end),e._start.height=0,e._end.height=0,setConstants(e)}function EllipsoidGeodesic(e,t,i){var r=defaultValue(i,Ellipsoid.WGS84);this._ellipsoid=r,this._start=new Cartographic,this._end=new Cartographic,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,defined(e)&&defined(t)&&computeProperties(this,e,t,r)}function calculateM(e,t,i){if(0===e)return t*i;var r=e*e,n=r*r,a=n*r,o=a*r,s=o*r,l=s*r,u=i;return t*((1-r/4-3*n/64-5*a/256-175*o/16384-441*s/65536-4851*l/1048576)*u-(3*r/8+3*n/32+45*a/1024+105*o/4096+2205*s/131072+6237*l/524288)*Math.sin(2*u)+(15*n/256+45*a/1024+525*o/16384+1575*s/65536+155925*l/8388608)*Math.sin(4*u)-(35*a/3072+175*o/12288+3675*s/262144+13475*l/1048576)*Math.sin(6*u)+(315*o/131072+2205*s/524288+43659*l/8388608)*Math.sin(8*u)-(693*s/1310720+6237*l/5242880)*Math.sin(10*u)+1001*l/8388608*Math.sin(12*u))}function calculateInverseM(e,t,i){var r=e/i;if(0===t)return r;var n=r*r,a=n*r,o=a*r,s=t*t,l=s*s,u=l*s,c=u*s,d=c*s,h=d*s,p=Math.sin(2*r),f=Math.cos(2*r),m=Math.sin(4*r),g=Math.cos(4*r),y=Math.sin(6*r),v=Math.cos(6*r),_=Math.sin(8*r),C=Math.cos(8*r),x=Math.sin(10*r);return r+r*s/4+7*r*l/64+15*r*u/256+579*r*c/16384+1515*r*d/65536+16837*r*h/1048576+(3*r*l/16+45*r*u/256-r*(32*n-561)*c/4096-r*(232*n-1677)*d/16384+r*(399985-90560*n+512*o)*h/5242880)*f+(21*r*u/256+483*r*c/4096-r*(224*n-1969)*d/16384-r*(33152*n-112599)*h/1048576)*g+(151*r*c/4096+4681*r*d/65536+1479*r*h/16384-453*a*h/32768)*v+(1097*r*d/65536+42783*r*h/1048576)*C+8011*r*h/1048576*Math.cos(10*r)+(3*s/8+3*l/16+213*u/2048-3*n*u/64+255*c/4096-33*n*c/512+20861*d/524288-33*n*d/512+o*d/1024+28273*h/1048576-471*n*h/8192+9*o*h/4096)*p+(21*l/256+21*u/256+533*c/8192-21*n*c/512+197*d/4096-315*n*d/4096+584039*h/16777216-12517*n*h/131072+7*o*h/2048)*m+(151*u/6144+151*c/4096+5019*d/131072-453*n*d/16384+26965*h/786432-8607*n*h/131072)*y+(1097*c/131072+1097*d/65536+225797*h/10485760-1097*n*h/65536)*_+(8011*d/2621440+8011*h/1048576)*x+293393*h/251658240*Math.sin(12*r)}function calculateSigma(e,t){if(0===e)return Math.log(Math.tan(.5*(CesiumMath.PI_OVER_TWO+t)));var i=e*Math.sin(t);return Math.log(Math.tan(.5*(CesiumMath.PI_OVER_TWO+t)))-e/2*Math.log((1+i)/(1-i))}function calculateHeading(e,t,i,r,n){var a=calculateSigma(e._ellipticity,i),o=calculateSigma(e._ellipticity,n);return Math.atan2(CesiumMath.negativePiToPi(r-t),o-a)}function calculateArcLength(e,t,i,r,n,a,o){var s=e._heading,l=a-r,u=0;if(CesiumMath.equalsEpsilon(Math.abs(s),CesiumMath.PI_OVER_TWO,CesiumMath.EPSILON8))if(t===i)u=t*Math.cos(n)*CesiumMath.negativePiToPi(l);else{var c=Math.sin(n);u=t*Math.cos(n)*CesiumMath.negativePiToPi(l)/Math.sqrt(1-e._ellipticitySquared*c*c)}else{var d=calculateM(e._ellipticity,t,n);u=(calculateM(e._ellipticity,t,o)-d)/Math.cos(s)}return Math.abs(u)}Object.defineProperties(EllipsoidGeodesic.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},startHeading:{get:function(){return this._startHeading}},endHeading:{get:function(){return this._endHeading}}}),EllipsoidGeodesic.prototype.setEndPoints=function(e,t){computeProperties(this,e,t,this._ellipsoid)},EllipsoidGeodesic.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)},EllipsoidGeodesic.prototype.interpolateUsingSurfaceDistance=function(e,t){var i=this._constants,r=i.distanceRatio+e/i.b,n=Math.cos(2*r),a=Math.cos(4*r),o=Math.cos(6*r),s=Math.sin(2*r),l=Math.sin(4*r),u=Math.sin(6*r),c=Math.sin(8*r),d=r*r,h=r*d,p=i.u8Over256,f=i.u2Over4,m=i.u6Over64,g=i.u4Over16,y=2*h*p*n/3+r*(1-f+7*g/4-15*m/4+579*p/64-(g-15*m/4+187*p/16)*n-(5*m/4-115*p/16)*a-29*p*o/16)+(f/2-g+71*m/32-85*p/16)*s+(5*g/16-5*m/4+383*p/96)*l-d*((m-11*p/2)*s+5*p*l/2)+(29*m/96-29*p/16)*u+539*p*c/1536,v=Math.asin(Math.sin(y)*i.cosineAlpha),_=Math.atan(i.a/i.b*Math.tan(v));y-=i.sigma;var C=Math.cos(2*i.sigma+y),x=Math.sin(y),b=Math.cos(y),A=i.cosineU*b,S=i.sineU*x,w=Math.atan2(x*i.sineHeading,A-S*i.cosineHeading)-computeDeltaLambda(i.f,i.sineAlpha,i.cosineSquaredAlpha,y,x,b,C);return defined(t)?(t.longitude=this._start.longitude+w,t.latitude=_,t.height=0,t):new Cartographic(this._start.longitude+w,_,0)};var scratchCart1$1=new Cartesian3,scratchCart2$1=new Cartesian3;function computeProperties$1(e,t,i,r){Cartesian3.normalize(r.cartographicToCartesian(t,scratchCart2$1),scratchCart1$1),Cartesian3.normalize(r.cartographicToCartesian(i,scratchCart2$1),scratchCart2$1);var n=r.maximumRadius,a=r.minimumRadius,o=n*n,s=a*a;e._ellipticitySquared=(o-s)/o,e._ellipticity=Math.sqrt(e._ellipticitySquared),e._start=Cartographic.clone(t,e._start),e._start.height=0,e._end=Cartographic.clone(i,e._end),e._end.height=0,e._heading=calculateHeading(e,t.longitude,t.latitude,i.longitude,i.latitude),e._distance=calculateArcLength(e,r.maximumRadius,r.minimumRadius,t.longitude,t.latitude,i.longitude,i.latitude)}function interpolateUsingSurfaceDistance(e,t,i,r,n,a){var o,s,l,u=n*n;if(Math.abs(CesiumMath.PI_OVER_TWO-Math.abs(t))>CesiumMath.EPSILON8){s=calculateInverseM(calculateM(n,r,e.latitude)+i*Math.cos(t),n,r);var c=calculateSigma(n,e.latitude),d=calculateSigma(n,s);l=Math.tan(t)*(d-c),o=CesiumMath.negativePiToPi(e.longitude+l)}else{var h;if(s=e.latitude,0===n)h=r*Math.cos(e.latitude);else{var p=Math.sin(e.latitude);h=r*Math.cos(e.latitude)/Math.sqrt(1-u*p*p)}l=i/h,o=0=x[0]&&C[1]<=x[1]?[x[0],C[0],C[1],x[1]]:x[0]>=C[0]&&x[1]<=C[1]?[C[0],x[0],x[1],C[1]]:C[0]>x[0]&&C[0]=T[0]&&E[1]<=T[1]?[T[0],E[0],E[1],T[1]]:T[0]>=E[0]&&T[1]<=E[1]?[E[0],T[0],T[1],E[1]]:E[0]>T[0]&&E[0]Cartesian3.distance(e,t)))return defined(o)||(o=new Cartesian3),Cartesian3.multiplyByScalar(s.direction,l,o),Cartesian3.add(s.origin,o,o)};var raySphereRoots={root0:0,root1:0};function raySphere(e,t,i){defined(i)||(i=new Interval);var r=e.origin,n=e.direction,a=t.center,o=t.radius*t.radius,s=Cartesian3.subtract(r,a,scratchPVec),l=solveQuadratic(Cartesian3.dot(n,n),2*Cartesian3.dot(n,s),Cartesian3.magnitudeSquared(s)-o,raySphereRoots);if(defined(l))return i.start=l.root0,i.stop=l.root1,i}IntersectionTests.raySphere=function(e,t,i){if(defined(i=raySphere(e,t,i))&&!(i.stop<0))return i.start=Math.max(i.start,0),i};var scratchLineSegmentRay=new Ray;IntersectionTests.lineSegmentSphere=function(e,t,i,r){var n=scratchLineSegmentRay;Cartesian3.clone(e,n.origin);var a=Cartesian3.subtract(t,e,n.direction),o=Cartesian3.magnitude(a);if(Cartesian3.normalize(a,a),!(!defined(r=raySphere(n,i,r))||r.stop<0||r.start>o))return r.start=Math.max(r.start,0),r.stop=Math.min(r.stop,o),r};var scratchQ=new Cartesian3,scratchW=new Cartesian3;function addWithCancellationCheck$1(e,t,i){var r=e+t;return CesiumMath.sign(e)!==CesiumMath.sign(t)&&Math.abs(r/Math.max(Math.abs(e),Math.abs(t)))WebMercatorProjection.MaximumLatitude?e=WebMercatorProjection.MaximumLatitude:e<-WebMercatorProjection.MaximumLatitude&&(e=-WebMercatorProjection.MaximumLatitude);var t=Math.sin(e);return.5*Math.log((1+t)/(1-t))},WebMercatorProjection.MaximumLatitude=WebMercatorProjection.mercatorAngleToGeodeticLatitude(Math.PI),WebMercatorProjection.prototype.project=function(e,t){var i=this._semimajorAxis,r=e.longitude*i,n=WebMercatorProjection.geodeticLatitudeToMercatorAngle(e.latitude)*i,a=e.height;return defined(t)?(t.x=r,t.y=n,t.z=a,t):new Cartesian3(r,n,a)},WebMercatorProjection.prototype.unproject=function(e,t){var i=this._oneOverSemimajorAxis,r=e.x*i,n=WebMercatorProjection.mercatorAngleToGeodeticLatitude(e.y*i),a=e.z;return defined(t)?(t.longitude=r,t.latitude=n,t.height=a,t):new Cartographic(r,n,a)};var PROJECTIONS=[GeographicProjection,WebMercatorProjection],PROJECTION_COUNT=PROJECTIONS.length,MITER_BREAK_SMALL=Math.cos(CesiumMath.toRadians(30)),MITER_BREAK_LARGE=Math.cos(CesiumMath.toRadians(150)),WALL_INITIAL_MIN_HEIGHT=0,WALL_INITIAL_MAX_HEIGHT=1e3;function GroundPolylineGeometry(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).positions;this.width=defaultValue(e.width,1),this._positions=t,this.granularity=defaultValue(e.granularity,9999),this.loop=defaultValue(e.loop,!1),this.arcType=defaultValue(e.arcType,ArcType$1.GEODESIC),this._ellipsoid=Ellipsoid.WGS84,this._projectionIndex=0,this._workerName="createGroundPolylineGeometry",this._scene3DOnly=!1}Object.defineProperties(GroundPolylineGeometry.prototype,{packedLength:{get:function(){return 1+3*this._positions.length+1+1+1+Ellipsoid.packedLength+1+1}}}),GroundPolylineGeometry.setProjectionAndEllipsoid=function(e,t){for(var i=0,r=0;rCesiumMath.PI_OVER_TWO&&(s=!0,o=Cartesian3.subtract(a,i,normalEndpointScratch),u=l.cartesianToCartographic(o,endPosCartographicScratch)),u.height=0;var c=e.project(u,n);return(n=Cartesian3.subtract(c,r,n)).z=0,n=Cartesian3.normalize(n,n),s&&Cartesian3.negate(n,n),n}var adjustHeightNormalScratch=new Cartesian3,adjustHeightOffsetScratch=new Cartesian3;function adjustHeights(e,t,i,r,n,a){var o=Cartesian3.subtract(t,e,adjustHeightNormalScratch);Cartesian3.normalize(o,o);var s=i-WALL_INITIAL_MIN_HEIGHT,l=Cartesian3.multiplyByScalar(o,s,adjustHeightOffsetScratch);Cartesian3.add(e,l,n);var u=r-WALL_INITIAL_MAX_HEIGHT;l=Cartesian3.multiplyByScalar(o,u,adjustHeightOffsetScratch),Cartesian3.add(t,l,a)}var nudgeDirectionScratch=new Cartesian3;function nudgeXZ(e,t){var i=Plane.getPointDistance(XZ_PLANE,e),r=Plane.getPointDistance(XZ_PLANE,t),n=nudgeDirectionScratch;CesiumMath.equalsEpsilon(i,0,CesiumMath.EPSILON2)?(n=direction(t,e,n),Cartesian3.multiplyByScalar(n,CesiumMath.EPSILON2,n),Cartesian3.add(e,n,e)):CesiumMath.equalsEpsilon(r,0,CesiumMath.EPSILON2)&&(n=direction(e,t,n),Cartesian3.multiplyByScalar(n,CesiumMath.EPSILON2,n),Cartesian3.add(t,n,t))}function nudgeCartographic(e,t){var i=Math.abs(e.longitude),r=Math.abs(t.longitude);if(CesiumMath.equalsEpsilon(i,CesiumMath.PI,CesiumMath.EPSILON11)){var n=CesiumMath.sign(t.longitude);return e.longitude=n*(i-CesiumMath.EPSILON11),1}if(CesiumMath.equalsEpsilon(r,CesiumMath.PI,CesiumMath.EPSILON11)){var a=CesiumMath.sign(e.longitude);return t.longitude=a*(r-CesiumMath.EPSILON11),2}return 0}var startCartographicScratch=new Cartographic,endCartographicScratch=new Cartographic,segmentStartTopScratch=new Cartesian3,segmentEndTopScratch=new Cartesian3,segmentStartBottomScratch=new Cartesian3,segmentEndBottomScratch=new Cartesian3,segmentStartNormalScratch=new Cartesian3,segmentEndNormalScratch=new Cartesian3,getHeightCartographics=[startCartographicScratch,endCartographicScratch],getHeightRectangleScratch=new Rectangle,adjustHeightStartTopScratch=new Cartesian3,adjustHeightEndTopScratch=new Cartesian3,adjustHeightStartBottomScratch=new Cartesian3,adjustHeightEndBottomScratch=new Cartesian3,segmentStart2DScratch=new Cartesian3,segmentEnd2DScratch=new Cartesian3,segmentStartNormal2DScratch=new Cartesian3,segmentEndNormal2DScratch=new Cartesian3,offsetScratch=new Cartesian3,startUpScratch=new Cartesian3,endUpScratch=new Cartesian3,rightScratch$1=new Cartesian3,startPlaneNormalScratch=new Cartesian3,endPlaneNormalScratch=new Cartesian3,encodeScratch=new EncodedCartesian3,encodeScratch2D=new EncodedCartesian3,forwardOffset2DScratch=new Cartesian3,right2DScratch=new Cartesian3,normalNudgeScratch=new Cartesian3,scratchBoundingSpheres=[new BoundingSphere,new BoundingSphere],REFERENCE_INDICES=[0,2,1,0,3,2,0,7,3,0,4,7,0,5,4,0,1,5,5,7,4,5,6,7,5,2,6,5,1,2,3,6,2,3,7,6],REFERENCE_INDICES_LENGTH=REFERENCE_INDICES.length;function generateGeometryAttributes(e,t,i,r,n,a,o){var s,l,u,c,d,h,p=t._ellipsoid,f=i.length/3-1,m=8*f,g=4*m,y=36*f,v=65535MITER_BREAK_SMALL?(q=projectNormal(t,T,Z,W,segmentStartNormal2DScratch),Q=projectNormal(t,P,U,j,segmentEndNormal2DScratch)):1===J?(Q=projectNormal(t,P,U,j,segmentEndNormal2DScratch),q.x=0,q.y=CesiumMath.sign(T.longitude-Math.abs(P.longitude)),q.z=0):(q=projectNormal(t,T,Z,W,segmentStartNormal2DScratch),Q.x=0,Q.y=CesiumMath.sign(T.longitude-P.longitude),Q.z=0)}var ee=Cartesian3.distance(X,z),te=EncodedCartesian3.fromCartesian(Y,encodeScratch),ie=Cartesian3.subtract(V,Y,offsetScratch),re=Cartesian3.normalize(ie,rightScratch$1),ne=Cartesian3.subtract(X,Y,startUpScratch);ne=Cartesian3.normalize(ne,ne);var ae=Cartesian3.cross(re,ne,rightScratch$1);ae=Cartesian3.normalize(ae,ae);var oe=Cartesian3.cross(ne,Z,startPlaneNormalScratch);oe=Cartesian3.normalize(oe,oe);var se=Cartesian3.subtract(z,V,endUpScratch);se=Cartesian3.normalize(se,se);var le=Cartesian3.cross(U,se,endPlaneNormalScratch);le=Cartesian3.normalize(le,le);var ue,ce,de,he=ee/R,pe=G/R,fe=0,me=0,ge=0;if(o){fe=Cartesian3.distance(W,j),ue=EncodedCartesian3.fromCartesian(W,encodeScratch2D),ce=Cartesian3.subtract(j,W,forwardOffset2DScratch);var ye=(de=Cartesian3.normalize(ce,right2DScratch)).x;de.x=de.y,de.y=-ye,me=fe/E,ge=$/E}for(O=0;O<8;O++){var ve=B+4*O,_e=N+2*O,Ce=ve+3,xe=O<4?1:-1,be=2===O||3===O||6===O||7===O?1:-1;Cartesian3.pack(te.high,C,ve),C[Ce]=ie.x,Cartesian3.pack(te.low,x,ve),x[Ce]=ie.y,Cartesian3.pack(oe,b,ve),b[Ce]=ie.z,Cartesian3.pack(le,A,ve),A[Ce]=he*xe,Cartesian3.pack(ae,S,ve);var Ae=pe*be;0===Ae&&be<0&&(Ae=9),S[Ce]=Ae,o&&(u[ve]=ue.high.x,u[ve+1]=ue.high.y,u[ve+2]=ue.low.x,u[ve+3]=ue.low.y,d[ve]=-q.y,d[ve+1]=q.x,d[ve+2]=Q.y,d[ve+3]=-Q.x,c[ve]=ce.x,c[ve+1]=ce.y,c[ve+2]=de.x,c[ve+3]=de.y,h[_e]=me*xe,0===(Ae=ge*be)&&be<0&&(Ae=9),h[_e+1]=Ae)}var Se=adjustHeightStartBottomScratch,we=adjustHeightEndBottomScratch,Ee=adjustHeightStartTopScratch,Te=adjustHeightEndTopScratch,Pe=Rectangle.fromCartographicArray(getHeightCartographics,getHeightRectangleScratch),Me=ApproximateTerrainHeights.getMinimumMaximumHeights(Pe,p),De=Me.minimumTerrainHeight,Ie=Me.maximumTerrainHeight;H+=De,H+=Ie,adjustHeights(Y,X,De,Ie,Se,Ee),adjustHeights(V,z,De,Ie,we,Te);var Oe=Cartesian3.multiplyByScalar(ae,CesiumMath.EPSILON5,normalNudgeScratch);Cartesian3.add(Se,Oe,Se),Cartesian3.add(we,Oe,we),Cartesian3.add(Ee,Oe,Ee),Cartesian3.add(Te,Oe,Te),nudgeXZ(Se,we),nudgeXZ(Ee,Te),Cartesian3.pack(Se,_,k),Cartesian3.pack(we,_,k+3),Cartesian3.pack(Te,_,k+6),Cartesian3.pack(Ee,_,k+9),Oe=Cartesian3.multiplyByScalar(ae,-2*CesiumMath.EPSILON5,normalNudgeScratch),Cartesian3.add(Se,Oe,Se),Cartesian3.add(we,Oe,we),Cartesian3.add(Ee,Oe,Ee),Cartesian3.add(Te,Oe,Te),nudgeXZ(Se,we),nudgeXZ(Ee,Te),Cartesian3.pack(Se,_,k+12),Cartesian3.pack(we,_,k+15),Cartesian3.pack(Te,_,k+18),Cartesian3.pack(Ee,_,k+21),L+=2,l+=3,N+=16,k+=24,B+=32,G+=ee,$+=fe}var Re=l=0;for(s=0;sr&&(s[t[c]]=u,++u);return(u-r+1)/(n/3)}};Tipsify.tipsify=function(e){var h,t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).indices,i=e.maximumIndex,r=defaultValue(e.cacheSize,24);function n(e,t,i,r,n,a,o){for(var s,l=-1,u=-1,c=0;cr&&(g.timeStamp=m,++m),++s}f=n(0,r,C,d,m,x,o)}return A};var GeometryPipeline={};function addTriangle(e,t,i,r,n){e[t++]=i,e[t++]=r,e[t++]=r,e[t++]=n,e[t++]=n,e[t]=i}function trianglesToLines(e){for(var t=e.length,i=t/3*6,r=IndexDatatype$1.createTypedArray(t,i),n=0,a=0;an&&(n=i[a]);e.indices=Tipsify.tipsify({indices:i,maximumIndex:n,cacheSize:t})}return e},GeometryPipeline.fitToUnsignedShortIndices=function(e){var t=[],i=Geometry.computeNumberOfVertices(e);if(defined(e.indices)&&i>=CesiumMath.SIXTY_FOUR_KILOBYTES){var r,n=[],a=[],o=0,s=copyAttributesDescriptions(e.attributes),l=e.indices,u=l.length;e.primitiveType===PrimitiveType$1.TRIANGLES?r=3:e.primitiveType===PrimitiveType$1.LINES?r=2:e.primitiveType===PrimitiveType$1.POINTS&&(r=1);for(var c=0;c=CesiumMath.SIXTY_FOUR_KILOBYTES&&(t.push(new Geometry({attributes:s,indices:a,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),n=[],a=[],o=0,s=copyAttributesDescriptions(e.attributes))}0!==a.length&&t.push(new Geometry({attributes:s,indices:a,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var scratchProjectTo2DCartesian3=new Cartesian3,scratchProjectTo2DCartographic=new Cartographic;GeometryPipeline.projectTo2D=function(e,t,i,r,n){for(var a=e.attributes[t],o=(n=defined(n)?n:new GeographicProjection).ellipsoid,s=a.values,l=new Float64Array(s.length),u=0,c=0;cCesiumMath.EPSILON6?1:0},p0Scratch=new Cartesian3,p1Scratch=new Cartesian3,p2Scratch=new Cartesian3,barycentricScratch=new Cartesian3;function computeTriangleAttributes(e,t,i,r,n,a,o,s,l,u,c,d,h,p,f,m){if(defined(a)||defined(o)||defined(s)||defined(l)||defined(u)||0!==p){var g=barycentricCoordinates(r,Cartesian3.fromArray(n,3*e,p0Scratch),Cartesian3.fromArray(n,3*t,p1Scratch),Cartesian3.fromArray(n,3*i,p2Scratch),barycentricScratch);if(defined(a)&&interpolateAndPackCartesian3(e,t,i,g,a,d.normal.values,m,!0),defined(u)){var y,v=Cartesian3.fromArray(u,3*e,p0Scratch),_=Cartesian3.fromArray(u,3*t,p1Scratch),C=Cartesian3.fromArray(u,3*i,p2Scratch);Cartesian3.multiplyByScalar(v,g.x,v),Cartesian3.multiplyByScalar(_,g.y,_),Cartesian3.multiplyByScalar(C,g.z,C),Cartesian3.equals(v,Cartesian3.ZERO)&&Cartesian3.equals(_,Cartesian3.ZERO)&&Cartesian3.equals(C,Cartesian3.ZERO)?((y=p0Scratch).x=0,y.y=0,y.z=0):(y=Cartesian3.add(v,_,v),Cartesian3.add(y,C,y),Cartesian3.normalize(y,y)),Cartesian3.pack(y,d.extrudeDirection.values,3*m)}if(defined(c)&&interpolateAndPackBoolean(e,t,i,g,c,d.applyOffset.values,m),defined(o)&&interpolateAndPackCartesian3(e,t,i,g,o,d.tangent.values,m,!0),defined(s)&&interpolateAndPackCartesian3(e,t,i,g,s,d.bitangent.values,m,!0),defined(l)&&interpolateAndPackCartesian2(e,t,i,g,l,d.st.values,m),0s&&(h+=(d=c.x-s)*d),c.y<-l?h+=(d=c.y+l)*d:c.y>l&&(h+=(d=c.y-l)*d),c.z<-u?h+=(d=c.z+u)*d:c.z>u&&(h+=(d=c.z-u)*d),h};var scratchCorner=new Cartesian3,scratchToCenter=new Cartesian3;OrientedBoundingBox.computePlaneDistances=function(e,t,i,r){defined(r)||(r=new Interval);var n=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY,o=e.center,s=e.halfAxes,l=Matrix3.getColumn(s,0,scratchCartesianU),u=Matrix3.getColumn(s,1,scratchCartesianV),c=Matrix3.getColumn(s,2,scratchCartesianW),d=Cartesian3.add(l,u,scratchCorner);Cartesian3.add(d,c,d),Cartesian3.add(d,o,d);var h=Cartesian3.subtract(d,t,scratchToCenter),p=Cartesian3.dot(i,h);return n=Math.min(p,n),a=Math.max(p,a),Cartesian3.add(o,l,d),Cartesian3.add(d,u,d),Cartesian3.subtract(d,c,d),Cartesian3.subtract(d,t,h),p=Cartesian3.dot(i,h),n=Math.min(p,n),a=Math.max(p,a),Cartesian3.add(o,l,d),Cartesian3.subtract(d,u,d),Cartesian3.add(d,c,d),Cartesian3.subtract(d,t,h),p=Cartesian3.dot(i,h),n=Math.min(p,n),a=Math.max(p,a),Cartesian3.add(o,l,d),Cartesian3.subtract(d,u,d),Cartesian3.subtract(d,c,d),Cartesian3.subtract(d,t,h),p=Cartesian3.dot(i,h),n=Math.min(p,n),a=Math.max(p,a),Cartesian3.subtract(o,l,d),Cartesian3.add(d,u,d),Cartesian3.add(d,c,d),Cartesian3.subtract(d,t,h),p=Cartesian3.dot(i,h),n=Math.min(p,n),a=Math.max(p,a),Cartesian3.subtract(o,l,d),Cartesian3.add(d,u,d),Cartesian3.subtract(d,c,d),Cartesian3.subtract(d,t,h),p=Cartesian3.dot(i,h),n=Math.min(p,n),a=Math.max(p,a),Cartesian3.subtract(o,l,d),Cartesian3.subtract(d,u,d),Cartesian3.add(d,c,d),Cartesian3.subtract(d,t,h),p=Cartesian3.dot(i,h),n=Math.min(p,n),a=Math.max(p,a),Cartesian3.subtract(o,l,d),Cartesian3.subtract(d,u,d),Cartesian3.subtract(d,c,d),Cartesian3.subtract(d,t,h),p=Cartesian3.dot(i,h),n=Math.min(p,n),a=Math.max(p,a),r.start=n,r.stop=a,r};var scratchBoundingSphere$2=new BoundingSphere;function ColorGeometryInstanceAttribute(e,t,i,r){e=defaultValue(e,1),t=defaultValue(t,1),i=defaultValue(i,1),r=defaultValue(r,1),this.value=new Uint8Array([Color.floatToByte(e),Color.floatToByte(t),Color.floatToByte(i),Color.floatToByte(r)])}OrientedBoundingBox.isOccluded=function(e,t){var i=BoundingSphere.fromOrientedBoundingBox(e,scratchBoundingSphere$2);return!t.isBoundingSphereVisible(i)},OrientedBoundingBox.prototype.intersectPlane=function(e){return OrientedBoundingBox.intersectPlane(this,e)},OrientedBoundingBox.prototype.distanceSquaredTo=function(e){return OrientedBoundingBox.distanceSquaredTo(this,e)},OrientedBoundingBox.prototype.computePlaneDistances=function(e,t,i){return OrientedBoundingBox.computePlaneDistances(this,e,t,i)},OrientedBoundingBox.prototype.isOccluded=function(e){return OrientedBoundingBox.isOccluded(this,e)},OrientedBoundingBox.equals=function(e,t){return e===t||defined(e)&&defined(t)&&Cartesian3.equals(e.center,t.center)&&Matrix3.equals(e.halfAxes,t.halfAxes)},OrientedBoundingBox.prototype.clone=function(e){return OrientedBoundingBox.clone(this,e)},OrientedBoundingBox.prototype.equals=function(e){return OrientedBoundingBox.equals(this,e)},Object.defineProperties(ColorGeometryInstanceAttribute.prototype,{componentDatatype:{get:function(){return ComponentDatatype$1.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 4}},normalize:{get:function(){return!0}}}),ColorGeometryInstanceAttribute.fromColor=function(e){return new ColorGeometryInstanceAttribute(e.red,e.green,e.blue,e.alpha)},ColorGeometryInstanceAttribute.toValue=function(e,t){return defined(t)?e.toBytes(t):new Uint8Array(e.toBytes())},ColorGeometryInstanceAttribute.equals=function(e,t){return e===t||defined(e)&&defined(t)&&e.value[0]===t.value[0]&&e.value[1]===t.value[1]&&e.value[2]===t.value[2]&&e.value[3]===t.value[3]};var ShadowVolumeAppearanceVS="attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute float batchId;\n#ifdef EXTRUDED_GEOMETRY\nattribute vec3 extrudeDirection;\nuniform float u_globeMinimumAltitude;\n#endif // EXTRUDED_GEOMETRY\n#ifdef PER_INSTANCE_COLOR\nvarying vec4 v_color;\n#endif // PER_INSTANCE_COLOR\n#ifdef TEXTURE_COORDINATES\n#ifdef SPHERICAL\nvarying vec4 v_sphericalExtents;\n#else // SPHERICAL\nvarying vec2 v_inversePlaneExtents;\nvarying vec4 v_westPlane;\nvarying vec4 v_southPlane;\n#endif // SPHERICAL\nvarying vec3 v_uvMinAndSphericalLongitudeRotation;\nvarying vec3 v_uMaxAndInverseDistance;\nvarying vec3 v_vMaxAndInverseDistance;\n#endif // TEXTURE_COORDINATES\n#if defined(TEXTURE_COORDINATES) && !defined(SPHERICAL) && defined(UINT8_PACKING)\nvec4 clampAndMagnitude(vec4 sd)\n{\nvec4 d = sd;\nd.x = czm_branchFreeTernary(sd.x < 128.0, d.x, (255.0 - sd.x));\nd.x = floor(0.5 + d.x);\nd.y = floor(0.5 + d.y);\nd.z = floor(0.5 + d.z);\nd.w = floor(0.5 + d.w);\nreturn d;\n}\nfloat unpackLowLessThan100k(vec4 sd)\n{\nvec4 d = clampAndMagnitude(sd);\nreturn (1000.0 * d.x + 10.0 * d.y + 0.1 * d.z + 0.001 * d.w) * czm_branchFreeTernary(sd.x < 128.0, 1.0, -1.0);\n}\nvec3 southwest_LOW(vec4 x, vec4 y, vec4 z)\n{\nvec3 value;\nvalue.x = unpackLowLessThan100k(x);\nvalue.y = unpackLowLessThan100k(y);\nvalue.z = unpackLowLessThan100k(z);\nreturn value;\n}\nfloat unpackHighMagLessThan100Million(vec4 sd)\n{\nvec4 d = clampAndMagnitude(sd);\nreturn (1000000.0 * d.x + 10000.0 * d.y + 100.0 * d.z + d.w) * czm_branchFreeTernary(sd.x < 128.0, 1.0, -1.0);\n}\nvec3 southwest_HIGH(vec4 x, vec4 y, vec4 z)\n{\nvec3 value;\nvalue.x = unpackHighMagLessThan100Million(x);\nvalue.y = unpackHighMagLessThan100Million(y);\nvalue.z = unpackHighMagLessThan100Million(z);\nreturn value;\n}\n#ifdef COLUMBUS_VIEW_2D\nvec4 unpackPlanes2D_HIGH(vec4 x, vec4 y, vec4 z, vec4 w)\n{\nvec4 value;\nvalue.x = unpackHighMagLessThan100Million(x);\nvalue.y = unpackHighMagLessThan100Million(y);\nvalue.z = unpackHighMagLessThan100Million(z);\nvalue.w = unpackHighMagLessThan100Million(w);\nreturn value;\n}\nvec4 unpackPlanes2D_LOW(vec4 x, vec4 y, vec4 z, vec4 w)\n{\nvec4 value;\nvalue.x = unpackLowLessThan100k(x);\nvalue.y = unpackLowLessThan100k(y);\nvalue.z = unpackLowLessThan100k(z);\nvalue.w = unpackLowLessThan100k(w);\nreturn value;\n}\n#else\nfloat unpackLowLessThan1000k(vec4 sd)\n{\nvec4 d = clampAndMagnitude(sd);\nreturn (10000.0 * d.x + 100.0 * d.y + d.z + 0.01 * d.w) * czm_branchFreeTernary(sd.x < 128.0, 1.0, -1.0);\n}\nvec3 unpackExtent(vec4 x, vec4 y, vec4 z)\n{\nvec3 value;\nvalue.x = unpackLowLessThan1000k(x);\nvalue.y = unpackLowLessThan1000k(y);\nvalue.z = unpackLowLessThan1000k(z);\nreturn value;\n}\n#endif\n#endif\nvoid main()\n{\nvec4 position = czm_computePosition();\n#ifdef EXTRUDED_GEOMETRY\nfloat delta = min(u_globeMinimumAltitude, czm_geometricToleranceOverMeter * length(position.xyz));\ndelta *= czm_sceneMode == czm_sceneMode3D ? 1.0 : 0.0;\nposition = position + vec4(extrudeDirection * delta, 0.0);\n#endif\n#ifdef TEXTURE_COORDINATES\n#ifdef SPHERICAL\nv_sphericalExtents = czm_batchTable_sphericalExtents(batchId);\nv_uvMinAndSphericalLongitudeRotation.z = czm_batchTable_longitudeRotation(batchId);\n#else // SPHERICAL\n#ifdef COLUMBUS_VIEW_2D\n#ifdef UINT8_PACKING\nvec4 planes2D_high = unpackPlanes2D_HIGH(czm_batchTable_planes2D_HIGH_x(batchId),\nczm_batchTable_planes2D_HIGH_y(batchId),\nczm_batchTable_planes2D_HIGH_z(batchId),\nczm_batchTable_planes2D_HIGH_w(batchId));\nvec4 planes2D_low = unpackPlanes2D_LOW(czm_batchTable_planes2D_LOW_x(batchId),\nczm_batchTable_planes2D_LOW_y(batchId),\nczm_batchTable_planes2D_LOW_z(batchId),\nczm_batchTable_planes2D_LOW_w(batchId));\n#else // UINT8_PACKING\nvec4 planes2D_high = czm_batchTable_planes2D_HIGH(batchId);\nvec4 planes2D_low = czm_batchTable_planes2D_LOW(batchId);\n#endif // UINT8_PACKING\nvec2 idlSplitNewPlaneHiLow = vec2(EAST_MOST_X_HIGH - (WEST_MOST_X_HIGH - planes2D_high.w), EAST_MOST_X_LOW - (WEST_MOST_X_LOW - planes2D_low.w));\nbool idlSplit = planes2D_high.x > planes2D_high.w && position3DLow.y > 0.0;\nplanes2D_high.w = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.w);\nplanes2D_low.w = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.w);\nidlSplit = planes2D_high.x > planes2D_high.w && position3DLow.y < 0.0;\nidlSplitNewPlaneHiLow = vec2(WEST_MOST_X_HIGH - (EAST_MOST_X_HIGH - planes2D_high.x), WEST_MOST_X_LOW - (EAST_MOST_X_LOW - planes2D_low.x));\nplanes2D_high.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.x);\nplanes2D_low.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.x);\nvec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.xy), vec3(0.0, planes2D_low.xy))).xyz;\nvec3 northWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.x, planes2D_high.z), vec3(0.0, planes2D_low.x, planes2D_low.z))).xyz;\nvec3 southEastCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.w, planes2D_high.y), vec3(0.0, planes2D_low.w, planes2D_low.y))).xyz;\n#else // COLUMBUS_VIEW_2D\n#ifdef UINT8_PACKING\nvec3 low = southwest_LOW(czm_batchTable_southWest_LOW_x(batchId), czm_batchTable_southWest_LOW_y(batchId), czm_batchTable_southWest_LOW_z(batchId));\nvec3 high = southwest_HIGH(czm_batchTable_southWest_HIGH_x(batchId), czm_batchTable_southWest_HIGH_y(batchId), czm_batchTable_southWest_HIGH_z(batchId));\nvec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(high, low)).xyz;\nvec3 northWestCorner = czm_normal * unpackExtent(\nczm_batchTable_northward_x(batchId),\nczm_batchTable_northward_y(batchId),\nczm_batchTable_northward_z(batchId)) + southWestCorner;\nvec3 southEastCorner = czm_normal * unpackExtent(\nczm_batchTable_eastward_x(batchId),\nczm_batchTable_eastward_y(batchId),\nczm_batchTable_eastward_z(batchId)) + southWestCorner;\n#else // UINT8_PACKING\nvec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(czm_batchTable_southWest_HIGH(batchId), czm_batchTable_southWest_LOW(batchId))).xyz;\nvec3 northWestCorner = czm_normal * czm_batchTable_northward(batchId) + southWestCorner;\nvec3 southEastCorner = czm_normal * czm_batchTable_eastward(batchId) + southWestCorner;\n#endif // UINT8_PACKING\n#endif // COLUMBUS_VIEW_2D\nvec3 eastWard = southEastCorner - southWestCorner;\nfloat eastExtent = length(eastWard);\neastWard /= eastExtent;\nvec3 northWard = northWestCorner - southWestCorner;\nfloat northExtent = length(northWard);\nnorthWard /= northExtent;\nv_westPlane = vec4(eastWard, -dot(eastWard, southWestCorner));\nv_southPlane = vec4(northWard, -dot(northWard, southWestCorner));\nv_inversePlaneExtents = vec2(1.0 / eastExtent, 1.0 / northExtent);\n#endif // SPHERICAL\nvec4 uvMinAndExtents = czm_batchTable_uvMinAndExtents(batchId);\nvec4 uMaxVmax = czm_batchTable_uMaxVmax(batchId);\nv_uMaxAndInverseDistance = vec3(uMaxVmax.xy, uvMinAndExtents.z);\nv_vMaxAndInverseDistance = vec3(uMaxVmax.zw, uvMinAndExtents.w);\nv_uvMinAndSphericalLongitudeRotation.xy = uvMinAndExtents.xy;\n#endif // TEXTURE_COORDINATES\n#ifdef PER_INSTANCE_COLOR\nv_color = czm_batchTable_color(batchId);\n#endif\ngl_Position = czm_depthClampFarPlane(czm_modelViewProjectionRelativeToEye * position);\n}\n",ShadowVolumeFS="#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n#endif\n#ifdef VECTOR_TILE\nuniform vec4 u_highlightColor;\n#endif\nvoid main(void)\n{\n#ifdef VECTOR_TILE\ngl_FragColor = czm_gammaCorrect(u_highlightColor);\n#else\ngl_FragColor = vec4(1.0);\n#endif\nczm_writeDepthClampedToFarPlane();\n}\n",PerInstanceColorAppearanceFS="varying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec4 v_color;\nvoid main()\n{\nvec3 positionToEyeEC = -v_positionEC;\nvec3 normalEC = normalize(v_normalEC);\n#ifdef FACE_FORWARD\nnormalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n#endif\nvec4 color = czm_gammaCorrect(v_color);\nczm_materialInput materialInput;\nmaterialInput.normalEC = normalEC;\nmaterialInput.positionToEyeEC = positionToEyeEC;\nczm_material material = czm_getDefaultMaterial(materialInput);\nmaterial.diffuse = color.rgb;\nmaterial.alpha = color.a;\ngl_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);\n}\n",PerInstanceColorAppearanceVS="attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 normal;\nattribute vec4 color;\nattribute float batchId;\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec4 v_color;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\nv_normalEC = czm_normal * normal;\nv_color = color;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n",PerInstanceFlatColorAppearanceVS="attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec4 color;\nattribute float batchId;\nvarying vec4 v_color;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_color = color;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n";function PerInstanceColorAppearance(e){var t=defaultValue((e=defaultValue(e,defaultValue.EMPTY_OBJECT)).translucent,!0),i=defaultValue(e.closed,!1),r=defaultValue(e.flat,!1),n=r?PerInstanceFlatColorAppearanceVS:PerInstanceColorAppearanceVS,a=r?PerInstanceFlatColorAppearanceFS:PerInstanceColorAppearanceFS,o=r?PerInstanceColorAppearance.FLAT_VERTEX_FORMAT:PerInstanceColorAppearance.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=defaultValue(e.vertexShaderSource,n),this._fragmentShaderSource=defaultValue(e.fragmentShaderSource,a),this._renderState=Appearance.getDefaultRenderState(t,i,e.renderState),this._closed=i,this._vertexFormat=o,this._flat=r,this._faceForward=defaultValue(e.faceForward,!i)}Object.defineProperties(PerInstanceColorAppearance.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}}}),PerInstanceColorAppearance.VERTEX_FORMAT=VertexFormat.POSITION_AND_NORMAL,PerInstanceColorAppearance.FLAT_VERTEX_FORMAT=VertexFormat.POSITION_ONLY,PerInstanceColorAppearance.prototype.getFragmentShaderSource=Appearance.prototype.getFragmentShaderSource,PerInstanceColorAppearance.prototype.isTranslucent=Appearance.prototype.isTranslucent,PerInstanceColorAppearance.prototype.getRenderState=Appearance.prototype.getRenderState;var ShadowVolumeAppearanceFS="#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n#endif\n#ifdef TEXTURE_COORDINATES\n#ifdef SPHERICAL\nvarying vec4 v_sphericalExtents;\n#else // SPHERICAL\nvarying vec2 v_inversePlaneExtents;\nvarying vec4 v_westPlane;\nvarying vec4 v_southPlane;\n#endif // SPHERICAL\nvarying vec3 v_uvMinAndSphericalLongitudeRotation;\nvarying vec3 v_uMaxAndInverseDistance;\nvarying vec3 v_vMaxAndInverseDistance;\n#endif // TEXTURE_COORDINATES\n#ifdef PER_INSTANCE_COLOR\nvarying vec4 v_color;\n#endif\n#ifdef NORMAL_EC\nvec3 getEyeCoordinate3FromWindowCoordinate(vec2 fragCoord, float logDepthOrDepth)\n{\nvec4 eyeCoordinate = czm_windowToEyeCoordinates(fragCoord, logDepthOrDepth);\nreturn eyeCoordinate.xyz / eyeCoordinate.w;\n}\nvec3 vectorFromOffset(vec4 eyeCoordinate, vec2 positiveOffset)\n{\nvec2 glFragCoordXY = gl_FragCoord.xy;\nfloat upOrRightLogDepth = czm_unpackDepth(texture2D(czm_globeDepthTexture, (glFragCoordXY + positiveOffset) / czm_viewport.zw));\nfloat downOrLeftLogDepth = czm_unpackDepth(texture2D(czm_globeDepthTexture, (glFragCoordXY - positiveOffset) / czm_viewport.zw));\nbvec2 upOrRightInBounds = lessThan(glFragCoordXY + positiveOffset, czm_viewport.zw);\nfloat useUpOrRight = float(upOrRightLogDepth > 0.0 && upOrRightInBounds.x && upOrRightInBounds.y);\nfloat useDownOrLeft = float(useUpOrRight == 0.0);\nvec3 upOrRightEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY + positiveOffset, upOrRightLogDepth);\nvec3 downOrLeftEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY - positiveOffset, downOrLeftLogDepth);\nreturn (upOrRightEC - (eyeCoordinate.xyz / eyeCoordinate.w)) * useUpOrRight + ((eyeCoordinate.xyz / eyeCoordinate.w) - downOrLeftEC) * useDownOrLeft;\n}\n#endif // NORMAL_EC\nvoid main(void)\n{\n#ifdef REQUIRES_EC\nfloat logDepthOrDepth = czm_unpackDepth(texture2D(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw));\nvec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);\n#endif\n#ifdef REQUIRES_WC\nvec4 worldCoordinate4 = czm_inverseView * eyeCoordinate;\nvec3 worldCoordinate = worldCoordinate4.xyz / worldCoordinate4.w;\n#endif\n#ifdef TEXTURE_COORDINATES\nvec2 uv;\n#ifdef SPHERICAL\nvec2 sphericalLatLong = czm_approximateSphericalCoordinates(worldCoordinate);\nsphericalLatLong.y += v_uvMinAndSphericalLongitudeRotation.z;\nsphericalLatLong.y = czm_branchFreeTernary(sphericalLatLong.y < czm_pi, sphericalLatLong.y, sphericalLatLong.y - czm_twoPi);\nuv.x = (sphericalLatLong.y - v_sphericalExtents.y) * v_sphericalExtents.w;\nuv.y = (sphericalLatLong.x - v_sphericalExtents.x) * v_sphericalExtents.z;\n#else // SPHERICAL\nuv.x = czm_planeDistance(v_westPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.x;\nuv.y = czm_planeDistance(v_southPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.y;\n#endif // SPHERICAL\n#endif // TEXTURE_COORDINATES\n#ifdef PICK\n#ifdef CULL_FRAGMENTS\nif (0.0 <= uv.x && uv.x <= 1.0 && 0.0 <= uv.y && uv.y <= 1.0)\n{\ngl_FragColor.a = 1.0;\nczm_writeDepthClampedToFarPlane();\n}\n#else // CULL_FRAGMENTS\ngl_FragColor.a = 1.0;\n#endif // CULL_FRAGMENTS\n#else // PICK\n#ifdef CULL_FRAGMENTS\nif (uv.x <= 0.0 || 1.0 <= uv.x || uv.y <= 0.0 || 1.0 <= uv.y)\n{\ndiscard;\n}\n#endif\n#ifdef NORMAL_EC\nvec3 downUp = vectorFromOffset(eyeCoordinate, vec2(0.0, 1.0));\nvec3 leftRight = vectorFromOffset(eyeCoordinate, vec2(1.0, 0.0));\nvec3 normalEC = normalize(cross(leftRight, downUp));\n#endif\n#ifdef PER_INSTANCE_COLOR\nvec4 color = czm_gammaCorrect(v_color);\n#ifdef FLAT\ngl_FragColor = color;\n#else // FLAT\nczm_materialInput materialInput;\nmaterialInput.normalEC = normalEC;\nmaterialInput.positionToEyeEC = -eyeCoordinate.xyz;\nczm_material material = czm_getDefaultMaterial(materialInput);\nmaterial.diffuse = color.rgb;\nmaterial.alpha = color.a;\ngl_FragColor = czm_phong(normalize(-eyeCoordinate.xyz), material, czm_lightDirectionEC);\n#endif // FLAT\n#else // PER_INSTANCE_COLOR\nczm_materialInput materialInput;\n#ifdef USES_NORMAL_EC\nmaterialInput.normalEC = normalEC;\n#endif\n#ifdef USES_POSITION_TO_EYE_EC\nmaterialInput.positionToEyeEC = -eyeCoordinate.xyz;\n#endif\n#ifdef USES_TANGENT_TO_EYE\nmaterialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(worldCoordinate, normalEC);\n#endif\n#ifdef USES_ST\nmaterialInput.st.x = czm_lineDistance(v_uvMinAndSphericalLongitudeRotation.xy, v_uMaxAndInverseDistance.xy, uv) * v_uMaxAndInverseDistance.z;\nmaterialInput.st.y = czm_lineDistance(v_uvMinAndSphericalLongitudeRotation.xy, v_vMaxAndInverseDistance.xy, uv) * v_vMaxAndInverseDistance.z;\n#endif\nczm_material material = czm_getMaterial(materialInput);\n#ifdef FLAT\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#else // FLAT\ngl_FragColor = czm_phong(normalize(-eyeCoordinate.xyz), material, czm_lightDirectionEC);\n#endif // FLAT\n#endif // PER_INSTANCE_COLOR\nczm_writeDepthClampedToFarPlane();\n#endif // PICK\n}\n";function ShadowVolumeAppearance(e,t,i,r){this._projectionExtentDefines={eastMostYhighDefine:"",eastMostYlowDefine:"",westMostYhighDefine:"",westMostYlowDefine:""},this._useFloatBatchTable=r;var n=new ShaderDependencies;n.requiresTextureCoordinates=e,n.requiresEC=!i.flat;var a=new ShaderDependencies;if(a.requiresTextureCoordinates=e,i instanceof PerInstanceColorAppearance)n.requiresNormalEC=!i.flat;else{var o=i.material.shaderSource+"\n"+i.fragmentShaderSource;n.normalEC=-1!==o.indexOf("materialInput.normalEC")||-1!==o.indexOf("czm_getDefaultMaterial"),n.positionToEyeEC=-1!==o.indexOf("materialInput.positionToEyeEC"),n.tangentToEyeMatrix=-1!==o.indexOf("materialInput.tangentToEyeMatrix"),n.st=-1!==o.indexOf("materialInput.st")}this._colorShaderDependencies=n,this._pickShaderDependencies=a,this._appearance=i,this._extentsCulling=e,this._planarExtents=t}ShadowVolumeAppearance.prototype.createFragmentShader=function(e){var t=this._appearance,i=this._colorShaderDependencies,r=[];e||this._planarExtents||r.push("SPHERICAL"),i.requiresEC&&r.push("REQUIRES_EC"),i.requiresWC&&r.push("REQUIRES_WC"),i.requiresTextureCoordinates&&r.push("TEXTURE_COORDINATES"),this._extentsCulling&&r.push("CULL_FRAGMENTS"),i.requiresNormalEC&&r.push("NORMAL_EC"),t instanceof PerInstanceColorAppearance&&r.push("PER_INSTANCE_COLOR"),i.normalEC&&r.push("USES_NORMAL_EC"),i.positionToEyeEC&&r.push("USES_POSITION_TO_EYE_EC"),i.tangentToEyeMatrix&&r.push("USES_TANGENT_TO_EYE"),i.st&&r.push("USES_ST"),t.flat&&r.push("FLAT");var n="";return t instanceof PerInstanceColorAppearance||(n=t.material.shaderSource),new ShaderSource({defines:r,sources:[n,ShadowVolumeAppearanceFS]})},ShadowVolumeAppearance.prototype.createPickFragmentShader=function(e){var t=this._pickShaderDependencies,i=["PICK"];return e||this._planarExtents||i.push("SPHERICAL"),t.requiresEC&&i.push("REQUIRES_EC"),t.requiresWC&&i.push("REQUIRES_WC"),t.requiresTextureCoordinates&&i.push("TEXTURE_COORDINATES"),this._extentsCulling&&i.push("CULL_FRAGMENTS"),new ShaderSource({defines:i,sources:[ShadowVolumeAppearanceFS],pickColorQualifier:"varying"})},ShadowVolumeAppearance.prototype.createVertexShader=function(e,t,i,r){return createShadowVolumeAppearanceVS(this._colorShaderDependencies,this._planarExtents,i,e,t,this._appearance,r,this._useFloatBatchTable,this._projectionExtentDefines)},ShadowVolumeAppearance.prototype.createPickVertexShader=function(e,t,i,r){return createShadowVolumeAppearanceVS(this._pickShaderDependencies,this._planarExtents,i,e,t,void 0,r,this._useFloatBatchTable,this._projectionExtentDefines)};var longitudeExtentsCartesianScratch=new Cartesian3,longitudeExtentsCartographicScratch=new Cartographic,longitudeExtentsEncodeScratch={high:0,low:0};function createShadowVolumeAppearanceVS(e,t,i,r,n,a,o,s,l){var u=r.slice();if(""===l.eastMostYhighDefine){var c=longitudeExtentsCartographicScratch;c.longitude=CesiumMath.PI,c.latitude=0,c.height=0;var d=o.project(c,longitudeExtentsCartesianScratch),h=EncodedCartesian3.encode(d.x,longitudeExtentsEncodeScratch);l.eastMostYhighDefine="EAST_MOST_X_HIGH "+h.high.toFixed((h.high+"").length+1),l.eastMostYlowDefine="EAST_MOST_X_LOW "+h.low.toFixed((h.low+"").length+1);var p=longitudeExtentsCartographicScratch;p.longitude=-CesiumMath.PI,p.latitude=0,p.height=0;var f=o.project(p,longitudeExtentsCartesianScratch);h=EncodedCartesian3.encode(f.x,longitudeExtentsEncodeScratch),l.westMostYhighDefine="WEST_MOST_X_HIGH "+h.high.toFixed((h.high+"").length+1),l.westMostYlowDefine="WEST_MOST_X_LOW "+h.low.toFixed((h.low+"").length+1)}return i&&(u.push(l.eastMostYhighDefine),u.push(l.eastMostYlowDefine),u.push(l.westMostYhighDefine),u.push(l.westMostYlowDefine)),defined(a)&&a instanceof PerInstanceColorAppearance&&u.push("PER_INSTANCE_COLOR"),e.requiresTextureCoordinates&&(u.push("TEXTURE_COORDINATES"),t||i||u.push("SPHERICAL"),i&&u.push("COLUMBUS_VIEW_2D")),s||u.push("UINT8_PACKING"),new ShaderSource({defines:u,sources:[n]})}function ShaderDependencies(){this._requiresEC=!1,this._requiresWC=!1,this._requiresNormalEC=!1,this._requiresTextureCoordinates=!1,this._usesNormalEC=!1,this._usesPositionToEyeEC=!1,this._usesTangentToEyeMat=!1,this._usesSt=!1}function pointLineDistance(e,t,i){return Math.abs((t.y-e.y)*i.x-(t.x-e.x)*i.y+t.x*e.y-t.y*e.x)/Cartesian2.distance(t,e)}Object.defineProperties(ShaderDependencies.prototype,{requiresEC:{get:function(){return this._requiresEC},set:function(e){this._requiresEC=e||this._requiresEC}},requiresWC:{get:function(){return this._requiresWC},set:function(e){this._requiresWC=e||this._requiresWC,this.requiresEC=this._requiresWC}},requiresNormalEC:{get:function(){return this._requiresNormalEC},set:function(e){this._requiresNormalEC=e||this._requiresNormalEC,this.requiresEC=this._requiresNormalEC}},requiresTextureCoordinates:{get:function(){return this._requiresTextureCoordinates},set:function(e){this._requiresTextureCoordinates=e||this._requiresTextureCoordinates,this.requiresWC=this._requiresTextureCoordinates}},normalEC:{set:function(e){this.requiresNormalEC=e,this._usesNormalEC=e},get:function(){return this._usesNormalEC}},tangentToEyeMatrix:{set:function(e){this.requiresWC=e,this.requiresNormalEC=e,this._usesTangentToEyeMat=e},get:function(){return this._usesTangentToEyeMat}},positionToEyeEC:{set:function(e){this.requiresEC=e,this._usesPositionToEyeEC=e},get:function(){return this._usesPositionToEyeEC}},st:{set:function(e){this.requiresTextureCoordinates=e,this._usesSt=e},get:function(){return this._usesSt}}});var points2DScratch$1=[new Cartesian2,new Cartesian2,new Cartesian2,new Cartesian2];function addTextureCoordinateRotationAttributes(e,t){var i=points2DScratch$1,r=Cartesian2.unpack(t,0,i[0]),n=Cartesian2.unpack(t,2,i[1]),a=Cartesian2.unpack(t,4,i[2]);e.uMaxVmax=new GeometryInstanceAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:4,normalize:!1,value:[n.x,n.y,a.x,a.y]});var o=1/pointLineDistance(r,n,a),s=1/pointLineDistance(r,a,n);e.uvMinAndExtents=new GeometryInstanceAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:4,normalize:!1,value:[r.x,r.y,o,s]})}function encodeLowLessThan100k(e,t,i){var r=Math.abs(e),n=Math.floor(r/1e3);r-=1e3*n;var a=Math.floor(r/10);r-=10*a;var o=Math.floor(10*r);r-=.1*o;var s=Math.floor(1e3*r);e<0&&(n=255-n),i[t]=new GeometryInstanceAttribute({componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!1,value:[n,a,o,s]})}function encodeHighLessThan100Million(e,t,i){var r=Math.abs(e),n=Math.floor(r/1e6);r-=1e6*n;var a=Math.floor(r/1e4);r-=1e4*a;var o=Math.floor(r/100);r-=100*o;var s=Math.floor(r);e<0&&(n=255-n),i[t]=new GeometryInstanceAttribute({componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!1,value:[n,a,o,s]})}function encodeLessThan1000k(e,t,i){var r=Math.abs(e),n=Math.floor(r/1e4);r-=1e4*n;var a=Math.floor(r/100);r-=100*a;var o=Math.floor(r);r-=o;var s=Math.floor(r/.001);e<0&&(n=255-n),i[t]=new GeometryInstanceAttribute({componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!1,value:[n,a,o,s]})}var cartographicScratch=new Cartographic,cornerScratch=new Cartesian3,northWestScratch=new Cartesian3,southEastScratch=new Cartesian3,highLowScratch={high:0,low:0};function add2DTextureCoordinateAttributes(e,t,i,r){var n=cartographicScratch;n.height=0,n.longitude=e.west,n.latitude=e.south;var a=t.project(n,cornerScratch);n.latitude=e.north;var o=t.project(n,northWestScratch);n.longitude=e.east,n.latitude=e.south;var s,l=t.project(n,southEastScratch);if(!r)return encodeHighLessThan100Million((s=EncodedCartesian3.encode(a.x,highLowScratch)).high,"planes2D_HIGH_x",i),encodeLowLessThan100k(s.low,"planes2D_LOW_x",i),encodeHighLessThan100Million((s=EncodedCartesian3.encode(a.y,highLowScratch)).high,"planes2D_HIGH_y",i),encodeLowLessThan100k(s.low,"planes2D_LOW_y",i),encodeHighLessThan100Million((s=EncodedCartesian3.encode(o.y,highLowScratch)).high,"planes2D_HIGH_z",i),encodeLowLessThan100k(s.low,"planes2D_LOW_z",i),encodeHighLessThan100Million((s=EncodedCartesian3.encode(l.x,highLowScratch)).high,"planes2D_HIGH_w",i),void encodeLowLessThan100k(s.low,"planes2D_LOW_w",i);var u=[0,0,0,0],c=[0,0,0,0];s=EncodedCartesian3.encode(a.x,highLowScratch),u[0]=s.high,c[0]=s.low,s=EncodedCartesian3.encode(a.y,highLowScratch),u[1]=s.high,c[1]=s.low,s=EncodedCartesian3.encode(o.y,highLowScratch),u[2]=s.high,c[2]=s.low,s=EncodedCartesian3.encode(l.x,highLowScratch),u[3]=s.high,c[3]=s.low,i.planes2D_HIGH=new GeometryInstanceAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:4,normalize:!1,value:u}),i.planes2D_LOW=new GeometryInstanceAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:4,normalize:!1,value:c})}var enuMatrixScratch=new Matrix4,inverseEnuScratch=new Matrix4,rectanglePointCartesianScratch=new Cartesian3,rectangleCenterScratch$1=new Cartographic,pointsCartographicScratch=[new Cartographic,new Cartographic,new Cartographic,new Cartographic,new Cartographic,new Cartographic,new Cartographic,new Cartographic];function computeRectangleBounds(e,t,i,r,n,a){var o=Rectangle.center(e,rectangleCenterScratch$1);o.height=i;var s=Cartographic.toCartesian(o,t,rectanglePointCartesianScratch),l=Transforms.eastNorthUpToFixedFrame(s,t,enuMatrixScratch),u=Matrix4.inverse(l,inverseEnuScratch),c=e.west,d=e.east,h=e.north,p=e.south,f=pointsCartographicScratch;f[0].latitude=p,f[0].longitude=c,f[1].latitude=h,f[1].longitude=c,f[2].latitude=h,f[2].longitude=d,f[3].latitude=p;var m=.5*(c+(f[3].longitude=d)),g=.5*(h+p);f[4].latitude=p,f[4].longitude=m,f[5].latitude=h,f[5].longitude=m,f[6].latitude=g,f[6].longitude=c,f[7].latitude=g,f[7].longitude=d;for(var y=Number.POSITIVE_INFINITY,v=Number.NEGATIVE_INFINITY,_=Number.POSITIVE_INFINITY,C=Number.NEGATIVE_INFINITY,x=0;x<8;x++){f[x].height=i;var b=Cartographic.toCartesian(f[x],t,rectanglePointCartesianScratch);Matrix4.multiplyByPoint(u,b,b),b.z=0,y=Math.min(y,b.x),v=Math.max(v,b.x),_=Math.min(_,b.y),C=Math.max(C,b.y)}var A=r;A.x=y,A.y=_,A.z=0,Matrix4.multiplyByPoint(l,A,A);var S=n;S.x=v,S.y=_,S.z=0,Matrix4.multiplyByPoint(l,S,S),Cartesian3.subtract(S,A,n);var w=a;w.x=y,w.y=C,w.z=0,Matrix4.multiplyByPoint(l,w,w),Cartesian3.subtract(w,A,a)}var eastwardScratch=new Cartesian3,northwardScratch=new Cartesian3,encodeScratch$1=new EncodedCartesian3;ShadowVolumeAppearance.getPlanarTextureCoordinateAttributes=function(e,t,i,r,n,a){var o=cornerScratch,s=eastwardScratch,l=northwardScratch;computeRectangleBounds(e,i,defaultValue(a,0),o,s,l);var u={};addTextureCoordinateRotationAttributes(u,t);var c=EncodedCartesian3.fromCartesian(o,encodeScratch$1);if(n)return u.southWest_HIGH=new GeometryInstanceAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,normalize:!1,value:Cartesian3.pack(c.high,[0,0,0])}),u.southWest_LOW=new GeometryInstanceAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,normalize:!1,value:Cartesian3.pack(c.low,[0,0,0])}),u.eastward=new GeometryInstanceAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,normalize:!1,value:Cartesian3.pack(s,[0,0,0])}),u.northward=new GeometryInstanceAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,normalize:!1,value:Cartesian3.pack(l,[0,0,0])}),add2DTextureCoordinateAttributes(e,r,u,!0),u;var d=c.high;encodeHighLessThan100Million(d.x,"southWest_HIGH_x",u),encodeHighLessThan100Million(d.y,"southWest_HIGH_y",u),encodeHighLessThan100Million(d.z,"southWest_HIGH_z",u);var h=c.low;return encodeLowLessThan100k(h.x,"southWest_LOW_x",u),encodeLowLessThan100k(h.y,"southWest_LOW_y",u),encodeLowLessThan100k(h.z,"southWest_LOW_z",u),encodeLessThan1000k(s.x,"eastward_x",u),encodeLessThan1000k(s.y,"eastward_y",u),encodeLessThan1000k(s.z,"eastward_z",u),encodeLessThan1000k(l.x,"northward_x",u),encodeLessThan1000k(l.y,"northward_y",u),encodeLessThan1000k(l.z,"northward_z",u),add2DTextureCoordinateAttributes(e,r,u,!1),u};var spherePointScratch=new Cartesian3;function latLongToSpherical(e,t,i,r){var n=cartographicScratch;n.latitude=e,n.longitude=t,n.height=0;var a=Cartographic.toCartesian(n,i,spherePointScratch),o=Math.sqrt(a.x*a.x+a.y*a.y),s=CesiumMath.fastApproximateAtan2(o,a.z),l=CesiumMath.fastApproximateAtan2(a.x,a.y);return r.x=s,r.y=l,r}var sphericalScratch=new Cartesian2;function shouldUseSpherical(e){return Math.max(e.width,e.height)>ShadowVolumeAppearance.MAX_WIDTH_FOR_PLANAR_EXTENTS}function ClassificationPrimitive(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).geometryInstances;this.geometryInstances=t,this.show=defaultValue(e.show,!0),this.classificationType=defaultValue(e.classificationType,ClassificationType$1.BOTH),this.debugShowBoundingVolume=defaultValue(e.debugShowBoundingVolume,!1),this.debugShowShadowVolume=defaultValue(e.debugShowShadowVolume,!1),this._debugShowShadowVolume=!1,this._extruded=defaultValue(e._extruded,!1),this._uniformMap=e._uniformMap,this._sp=void 0,this._spStencil=void 0,this._spPick=void 0,this._spColor=void 0,this._spPick2D=void 0,this._spColor2D=void 0,this._rsStencilPreloadPass=void 0,this._rsStencilPreloadPass3DTiles=void 0,this._rsStencilDepthPass=void 0,this._rsStencilDepthPass3DTiles=void 0,this._rsColorPass=void 0,this._rsPickPass=void 0,this._commandsIgnoreShow=[],this._ready=!1,this._readyPromise=when.defer(),this._primitive=void 0,this._pickPrimitive=e._pickPrimitive,this._hasSphericalExtentsAttribute=!1,this._hasPlanarExtentsAttributes=!1,this._hasPerColorAttribute=!1,this.appearance=e.appearance,this._createBoundingVolumeFunction=e._createBoundingVolumeFunction,this._updateAndQueueCommandsFunction=e._updateAndQueueCommandsFunction,this._usePickOffsets=!1,this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:defaultValue(e.vertexCacheOptimize,!1),interleave:defaultValue(e.interleave,!1),releaseGeometryInstances:defaultValue(e.releaseGeometryInstances,!0),allowPicking:defaultValue(e.allowPicking,!0),asynchronous:defaultValue(e.asynchronous,!0),compressVertices:defaultValue(e.compressVertices,!0),_createBoundingVolumeFunction:void 0,_createRenderStatesFunction:void 0,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0,_createPickOffsets:!0,enableFrameBuffer:defaultValue(e.enableFrameBuffer,!1)}}function getStencilPreloadRenderState(e,t){var i=t?StencilFunction$1.EQUAL:StencilFunction$1.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:e,frontFunction:i,frontOperation:{fail:StencilOperation$1.KEEP,zFail:StencilOperation$1.DECREMENT_WRAP,zPass:StencilOperation$1.DECREMENT_WRAP},backFunction:i,backOperation:{fail:StencilOperation$1.KEEP,zFail:StencilOperation$1.INCREMENT_WRAP,zPass:StencilOperation$1.INCREMENT_WRAP},reference:StencilConstants$1.CESIUM_3D_TILE_MASK,mask:StencilConstants$1.CESIUM_3D_TILE_MASK},stencilMask:StencilConstants$1.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1}}function getStencilDepthRenderState(e,t){var i=t?StencilFunction$1.EQUAL:StencilFunction$1.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:e,frontFunction:i,frontOperation:{fail:StencilOperation$1.KEEP,zFail:StencilOperation$1.KEEP,zPass:StencilOperation$1.INCREMENT_WRAP},backFunction:i,backOperation:{fail:StencilOperation$1.KEEP,zFail:StencilOperation$1.KEEP,zPass:StencilOperation$1.DECREMENT_WRAP},reference:StencilConstants$1.CESIUM_3D_TILE_MASK,mask:StencilConstants$1.CESIUM_3D_TILE_MASK},stencilMask:StencilConstants$1.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:DepthFunction$1.LESS_OR_EQUAL},depthMask:!1}}function getColorRenderState(e){return{stencilTest:{enabled:e,frontFunction:StencilFunction$1.NOT_EQUAL,frontOperation:{fail:StencilOperation$1.KEEP,zFail:StencilOperation$1.KEEP,zPass:StencilOperation$1.DECREMENT_WRAP},backFunction:StencilFunction$1.NOT_EQUAL,backOperation:{fail:StencilOperation$1.KEEP,zFail:StencilOperation$1.KEEP,zPass:StencilOperation$1.DECREMENT_WRAP},reference:0,mask:StencilConstants$1.CLASSIFICATION_MASK},stencilMask:StencilConstants$1.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:BlendingState$1.ALPHA_BLEND}}ShadowVolumeAppearance.getSphericalExtentGeometryInstanceAttributes=function(e,t,i,r,n){var a=latLongToSpherical(e.south,e.west,i,sphericalScratch),o=a.x,s=a.y,l=latLongToSpherical(e.north,e.east,i,sphericalScratch),u=l.x,c=l.y,d=0;c/gm,DATA_ATTR=/^data-[\-\w.\u00B7-\uFFFF]/,ARIA_ATTR=/^aria-[\-\w]+$/,IS_ALLOWED_URI=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,IS_SCRIPT_OR_DATA=/^(?:\w+script|data):/i,ATTR_WHITESPACE=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,_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(e){if(Array.isArray(e)){for(var t=0,i=Array(e.length);t

').querySelector("svg img")&&(a=!0)}catch(e){}}(),function(){try{E("</title><img>").querySelector("title").textContent.match(/<\/title/)&&(o=!0)}catch(e){}}());function oe(e){return v.call(e.ownerDocument||e,e,t.SHOW_ELEMENT|t.SHOW_COMMENT|t.SHOW_TEXT,function(){return t.FILTER_ACCEPT},!1)}function se(e){return"object"===(void 0===d?"undefined":_typeof(d))?e instanceof d:e&&"object"===(void 0===e?"undefined":_typeof(e))&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName}function le(e,t,i){b[e]&&b[e].forEach(function(e){e.call(h,t,i,ne)})}function ue(e){var t=void 0;if(le("beforeSanitizeElements",e,null),function(e){return!(e instanceof n||e instanceof p)&&!("string"==typeof e.nodeName&&"string"==typeof e.textContent&&"function"==typeof e.removeChild&&e.attributes instanceof r&&"function"==typeof e.removeAttribute&&"function"==typeof e.setAttribute)}(e))return S(e),!0;var i=e.nodeName.toLowerCase();if(le("uponSanitizeElement",e,{tagName:i,allowedTags:L}),L[i]&&!F[i])return!$||e.firstElementChild||e.content&&e.content.firstElementChild||!/</g.test(e.textContent)||(h.removed.push({element:e.cloneNode()}),e.innerHTML?e.innerHTML=e.innerHTML.replace(/</g,"<"):e.innerHTML=e.textContent.replace(/</g,"<")),H&&3===e.nodeType&&(t=(t=(t=e.textContent).replace(T," ")).replace(P," "),e.textContent!==t&&(h.removed.push({element:e.cloneNode()}),e.textContent=t)),le("afterSanitizeElements",e,null),!1;if(J&&!te[i]&&"function"==typeof e.insertAdjacentHTML)try{e.insertAdjacentHTML("AfterEnd",e.innerHTML)}catch(e){}return S(e),!0}function ce(e,t,i){if(Z&&("id"===t||"name"===t)&&(i in s||i in ae))return!1;if(H&&(i=(i=i.replace(T," ")).replace(P," ")),U&&M.test(t));else if(z&&D.test(t));else{if(!k[t]||V[t])return!1;if(re[t]);else if(R.test(i.replace(O,"")));else if("src"!==t&&"xlink:href"!==t||"script"===e||0!==i.indexOf("data:")||!ie[e]){if(G&&!I.test(i.replace(O,"")));else if(i)return!1}else;}return!0}function de(e){var t=void 0,i=void 0,r=void 0,n=void 0,a=void 0;le("beforeSanitizeAttributes",e,null);var o=e.attributes;if(o){var s={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:k};for(a=o.length;a--;){var l=t=o[a],u=l.name,c=l.namespaceURI;if(i=t.value.trim(),r=u.toLowerCase(),s.attrName=r,s.attrValue=i,s.keepAttr=!0,le("uponSanitizeAttribute",e,s),i=s.attrValue,"name"===r&&"IMG"===e.nodeName&&o.id)n=o.id,o=Array.prototype.slice.apply(o),w("id",e),w(u,e),o.indexOf(n)>a&&e.setAttribute("id",n.value);else{if("INPUT"===e.nodeName&&"type"===r&&"file"===i&&(k[r]||!V[r]))continue;"id"===u&&e.setAttribute(u,""),w(u,e)}if(s.keepAttr){var d=e.nodeName.toLowerCase();if(ce(d,r,i))try{c?e.setAttributeNS(c,u,i):e.setAttribute(u,i),h.removed.pop()}catch(e){}}}le("afterSanitizeAttributes",e,null)}}function he(e){var t=void 0,i=oe(e);for(le("beforeSanitizeShadowDOM",e,null);t=i.nextNode();)le("uponSanitizeShadowNode",t,null),ue(t)||(t.content instanceof c&&he(t.content),de(t));le("afterSanitizeShadowDOM",e,null)}return h.sanitize=function(e,t){var i=void 0,r=void 0,n=void 0,a=void 0,o=void 0;if("string"!=typeof(e=e||"\x3c!--\x3e")&&!se(e)){if("function"!=typeof e.toString)throw new TypeError("toString is not a function");if("string"!=typeof(e=e.toString()))throw new TypeError("dirty is not a string, aborting")}if(!h.isSupported){if("object"===_typeof(l.toStaticHTML)||"function"==typeof l.toStaticHTML){if("string"==typeof e)return l.toStaticHTML(e);if(se(e))return l.toStaticHTML(e.outerHTML)}return e}if(j||A(t),h.removed=[],K);else if(e instanceof d)1===(r=(i=E("\x3c!--\x3e")).ownerDocument.importNode(e,!0)).nodeType&&"BODY"===r.nodeName?i=r:i.appendChild(r);else{if(!Q&&!W&&-1===e.indexOf("<"))return e;if(!(i=E(e)))return Q?null:""}i&&q&&S(i.firstChild);for(var s=oe(K?e:i);n=s.nextNode();)3===n.nodeType&&n===a||ue(n)||(n.content instanceof c&&he(n.content),de(n),a=n);if(K)return e;if(Q){if(Y)for(o=C.call(i.ownerDocument);i.firstChild;)o.appendChild(i.firstChild);else o=i;return X&&(o=x.call(u,o,!0)),o}return W?i.outerHTML:i.innerHTML},h.setConfig=function(e){A(e),j=!0},h.clearConfig=function(){ne=null,j=!1},h.isValidAttribute=function(e,t,i){ne||A({});var r=e.toLowerCase(),n=t.toLowerCase();return ce(r,n,i)},h.addHook=function(e,t){"function"==typeof t&&(b[e]=b[e]||[],b[e].push(t))},h.removeHook=function(e){b[e]&&b[e].pop()},h.removeHooks=function(e){b[e]&&(b[e]=[])},h.removeAllHooks=function(){b={}},h}var purify=createDOMPurify(),nextCreditId=0,creditToId={};function Credit(e,t){var i,r=e;defined(creditToId[r])?i=creditToId[r]:(i=nextCreditId++,creditToId[r]=i),t=defaultValue(t,!1),this._id=i,this._html=e,this._showOnScreen=t,this._element=void 0}function getFilenameFromUri(e){var t=new URI(e);t.normalize();var i=t.path,r=i.lastIndexOf("/");return-1!==r&&(i=i.substr(r+1)),i}function PinBuilder(){this._cache={}}Object.defineProperties(Credit.prototype,{html:{get:function(){return this._html}},id:{get:function(){return this._id}},showOnScreen:{get:function(){return this._showOnScreen}},element:{get:function(){if(!defined(this._element)){var e=purify.sanitize(this._html),t=document.createElement("div");t._creditId=this._id,t.style.display="inline",t.innerHTML=e;for(var i=t.querySelectorAll("a"),r=0;r<i.length;r++)i[r].setAttribute("target","_blank");this._element=t}return this._element}}}),Credit.equals=function(e,t){return e===t||defined(e)&&defined(t)&&e._id===t._id},Credit.prototype.equals=function(e){return Credit.equals(this,e)},Credit.getIonCredit=function(e){var t=defined(e.collapsible)&&!e.collapsible,i=new Credit(e.html,t);return i._isIon=-1!==i.html.indexOf("ion-credit.png"),i},Credit.clone=function(e){if(defined(e))return new Credit(e.html,e.showOnScreen)},PinBuilder.prototype.fromColor=function(e,t){return createPin(void 0,void 0,e,t,this._cache)},PinBuilder.prototype.fromUrl=function(e,t,i){return createPin(e,void 0,t,i,this._cache)},PinBuilder.prototype.fromMakiIconId=function(e,t,i){return createPin(buildModuleUrl("Assets/Textures/maki/"+encodeURIComponent(e)+".png"),void 0,t,i,this._cache)},PinBuilder.prototype.fromText=function(e,t,i){return createPin(void 0,e,t,i,this._cache)},PinBuilder.prototype.fromTextWithImage=function(e,t,i){return createPinWithImg(t,e,i,this._cache)};var colorScratch=new Color;function drawPin(e,t,i){e.save(),e.scale(i/24,i/24),e.fillStyle=t.toCssColorString(),e.strokeStyle=t.brighten(.6,colorScratch).toCssColorString(),e.lineWidth=.846,e.beginPath(),e.moveTo(6.72,.422),e.lineTo(17.28,.422),e.bezierCurveTo(18.553,.422,19.577,1.758,19.577,3.415),e.lineTo(19.577,10.973),e.bezierCurveTo(19.577,12.63,18.553,13.966,17.282,13.966),e.lineTo(14.386,14.008),e.lineTo(11.826,23.578),e.lineTo(9.614,14.008),e.lineTo(6.719,13.965),e.bezierCurveTo(5.446,13.983,4.422,12.629,4.422,10.972),e.lineTo(4.422,3.416),e.bezierCurveTo(4.423,1.76,5.447,.423,6.718,.423),e.closePath(),e.fill(),e.stroke(),e.restore()}function drawBubblePin(e,t,i){e.save(),e.scale(i/24,i/24),e.fillStyle="#CCCCCC",e.beginPath(),e.moveTo(10.2,21.8),e.bezierCurveTo(10.2,22.3,11.299999999999999,22.7,12.7,22.7),e.bezierCurveTo(14.1,22.7,15.2,22.3,15.2,21.8),e.bezierCurveTo(15.2,21.3,14.1,20.900000000000002,12.7,20.900000000000002),e.bezierCurveTo(11.299999999999999,20.900000000000002,10.2,21.3,10.2,21.8),e.closePath(),e.fill(),e.stroke(),e.restore(),e.save(),e.scale(i/24,i/24),e.fillStyle=t.toCssColorString(),e.strokeStyle=t.brighten(.6,colorScratch).toCssColorString(),e.lineWidth=.846,e.beginPath(),e.moveTo(20,9.2),e.lineTo(20,9.2),e.bezierCurveTo(20,9.1,20,9,20,9),e.bezierCurveTo(20,4.9,16.7,1.5,12.7,1.5),e.bezierCurveTo(8.7,1.5,5.4,4.9,5.4,9),e.bezierCurveTo(5.4,9.1,5.4,9.2,5.4,9.2),e.lineTo(5.4,9.2),e.bezierCurveTo(5.4,9.2,5.300000000000001,9.899999999999999,5.800000000000001,11.399999999999999),e.bezierCurveTo(6.000000000000001,11.899999999999999,6.200000000000001,12.299999999999999,6.4,12.7),e.bezierCurveTo(6.4,12.7,6.4,12.799999999999999,6.5,12.799999999999999),e.bezierCurveTo(6.7,13.1,6.9,13.499999999999998,7.2,13.799999999999999),e.bezierCurveTo(7.4,13.999999999999998,7.6000000000000005,14.2,7.7,14.399999999999999),e.bezierCurveTo(7.8,14.499999999999998,7.8,14.499999999999998,7.9,14.599999999999998),e.bezierCurveTo(10.9,17.499999999999996,12.600000000000001,21.699999999999996,12.600000000000001,21.699999999999996),e.bezierCurveTo(12.600000000000001,21.699999999999996,12.8,22.099999999999994,12.900000000000002,21.699999999999996),e.bezierCurveTo(13.000000000000002,21.399999999999995,15.200000000000003,17.199999999999996,17.700000000000003,14.299999999999995),e.bezierCurveTo(18.000000000000004,13.999999999999995,18.300000000000004,13.699999999999996,18.6,13.299999999999995),e.bezierCurveTo(18.8,13.099999999999996,18.900000000000002,12.899999999999995,19,12.699999999999996),e.bezierCurveTo(19,12.699999999999996,19,12.599999999999996,19,12.599999999999996),e.bezierCurveTo(19.3,12.099999999999996,19.5,11.499999999999996,19.7,10.899999999999997),e.bezierCurveTo(20.1,9.8,20,9.2,20,9.2),e.lineTo(20,9.2),e.closePath(),e.fill(),e.stroke(),e.restore(),e.restore()}function drawIcon(e,t,i){var r=i/2.5,n=r,a=r;t.width>t.height?a=r*(t.height/t.width):t.width<t.height&&(n=r*(t.width/t.height));var o=Math.round((i-n)/2),s=Math.round(7/24*i-a/2);e.globalCompositeOperation="destination-out",e.drawImage(t,o-1,s,n,a),e.drawImage(t,o,s-1,n,a),e.drawImage(t,o+1,s,n,a),e.drawImage(t,o,s+1,n,a),e.globalCompositeOperation="destination-over",e.fillStyle=Color.BLACK.toCssColorString(),e.fillRect(o-1,s-1,n+2,a+2),e.globalCompositeOperation="destination-out",e.drawImage(t,o,s,n,a),e.globalCompositeOperation="destination-over",e.fillStyle=Color.WHITE.toCssColorString(),e.fillRect(o-1,s-2,n+2,a+2)}var stringifyScratch=new Array(4);function createPin(e,t,i,r,n){stringifyScratch[0]=e,stringifyScratch[1]=t,stringifyScratch[2]=i,stringifyScratch[3]=r;var a=JSON.stringify(stringifyScratch),o=n[a];if(defined(o))return o;var s=document.createElement("canvas");s.width=r,s.height=r;var l=s.getContext("2d");if(drawPin(l,i,r),defined(e)){var u=Resource.createIfNeeded(e).fetchImage().then(function(e){return drawIcon(l,e,r),n[a]=s});return n[a]=u}if(defined(t)){var c=writeTextToCanvas(t,{font:"bold "+r+"px sans-serif"});drawIcon(l,c,r)}return n[a]=s}function drawImageIcon(e,t,i){var r=i/2.5,n=r,a=r;t.width>t.height?a=r*(t.height/t.width):t.width<t.height&&(n=r*(t.width/t.height));var o=Math.round(13/24*i-n/2),s=Math.round(.375*i-a/2);e.globalCompositeOperation="destination-out",e.drawImage(t,o-1,s,n,a),e.drawImage(t,o,s-1,n,a),e.drawImage(t,o+1,s,n,a),e.drawImage(t,o,s+1,n,a),e.globalCompositeOperation="destination-over",e.fillStyle=Color.BLACK.toCssColorString(),e.fillRect(o-1,s-1,n+2,a+2),e.globalCompositeOperation="destination-out",e.drawImage(t,o,s,n,a),e.globalCompositeOperation="destination-over",e.fillStyle=Color.WHITE.toCssColorString(),e.fillRect(o-1,s-2,n+2,a+2)}function createPinWithImg(e,t,i,r){stringifyScratch[0]=e,stringifyScratch[1]=t,stringifyScratch[2]=void 0,stringifyScratch[3]=i;var n=JSON.stringify(stringifyScratch),a=r[n];if(defined(a))return a;var o=document.createElement("canvas");o.width=i,o.height=i;var s=o.getContext("2d");drawBubblePin(s,e,i);var l=i;return drawImageIcon(s,writeTextToCanvas(t,{font:"bold "+l+"px Microsoft YaHei"}),l),r[n]=o}var tmp$1={},sZh,tZh;sZh=tmp$1,tZh=function(e){function t(e){return e}function f(e){var t,n=h(e.transform),a=1/0,o=a,s=-a,l=-a;function i(e){(e=n(e))[0]<a&&(a=e[0]),e[0]>s&&(s=e[0]),e[1]<o&&(o=e[1]),e[1]>l&&(l=e[1])}function r(e){switch(e.type){case"GeometryCollection":e.geometries.forEach(r);break;case"Point":i(e.coordinates);break;case"MultiPoint":e.coordinates.forEach(i)}}for(t in e.arcs.forEach(function(e){for(var t,i=-1,r=e.length;++i<r;)(t=n(e[i],i))[0]<a&&(a=t[0]),t[0]>s&&(s=t[0]),t[1]<o&&(o=t[1]),t[1]>l&&(l=t[1])}),e.objects)r(e.objects[t]);return[a,o,s,l]}function a(t,e){return"GeometryCollection"===e.type?{type:"FeatureCollection",features:e.geometries.map(function(e){return i(t,e)})}:i(t,e)}var h=function(e){if(null==e)return t;var a,o,s=e.scale[0],l=e.scale[1],u=e.translate[0],c=e.translate[1];return function(e,t){t||(a=o=0);var i=2,r=e.length,n=new Array(r);for(n[0]=(a+=e[0])*s+u,n[1]=(o+=e[1])*l+c;i<r;)n[i]=e[i],++i;return n}},c=function(e,t){for(var i,r=e.length,n=r-t;n<--r;)i=e[n],e[n++]=e[r],e[r]=i};function i(e,t){var i=t.id,r=t.bbox,n=null==t.properties?{}:t.properties,a=o(e,t);return null==i&&null==r?{type:"Feature",properties:n,geometry:a}:null==r?{type:"Feature",id:i,properties:n,geometry:a}:{type:"Feature",id:i,bbox:r,properties:n,geometry:a}}function o(e,t){var a=h(e.transform),o=e.arcs;function n(e,t){t.length&&t.pop();for(var i=o[e<0?~e:e],r=0,n=i.length;r<n;++r)t.push(a(i[r],r));e<0&&c(t,n)}function s(e){return a(e)}function l(e){for(var t=[],i=0,r=e.length;i<r;++i)n(e[i],t);return t.length<2&&t.push(t[0]),t}function i(e){for(var t=l(e);t.length<4;)t.push(t[0]);return t}function u(e){return e.map(i)}return function e(t){var i,r=t.type;switch(r){case"GeometryCollection":return{type:r,geometries:t.geometries.map(e)};case"Point":i=s(t.coordinates);break;case"MultiPoint":i=t.coordinates.map(s);break;case"LineString":i=l(t.arcs);break;case"MultiLineString":i=t.arcs.map(l);break;case"Polygon":i=u(t.arcs);break;case"MultiPolygon":i=t.arcs.map(u);break;default:return null}return{type:r,coordinates:i}}(t)}function d(l,n){var a={},u={},c={},o=[],s=-1;function e(e,t){for(var i in e){var r=e[i];delete t[r.start],delete r.start,delete r.end,r.forEach(function(e){a[e<0?~e:e]=1}),o.push(r)}}return n.forEach(function(e,t){var i,r=l.arcs[e<0?~e:e];r.length<3&&!r[1][0]&&!r[1][1]&&(i=n[++s],n[s]=e,n[t]=i)}),n.forEach(function(e){var t,i,r=function(e){var t,i=l.arcs[e<0?~e:e],r=i[0];l.transform?(t=[0,0],i.forEach(function(e){t[0]+=e[0],t[1]+=e[1]})):t=i[i.length-1];return e<0?[t,r]:[r,t]}(e),n=r[0],a=r[1];if(t=c[n])if(delete c[t.end],t.push(e),t.end=a,i=u[a]){delete u[i.start];var o=i===t?t:t.concat(i);u[o.start=t.start]=c[o.end=i.end]=o}else u[t.start]=c[t.end]=t;else if(t=u[a])if(delete u[t.start],t.unshift(e),t.start=n,i=c[n]){delete c[i.end];var s=i===t?t:i.concat(t);u[s.start=i.start]=c[s.end=t.end]=s}else u[t.start]=c[t.end]=t;else u[(t=[e]).start=n]=c[t.end=a]=t}),e(c,u),e(u,c),n.forEach(function(e){a[e<0?~e:e]||o.push([e])}),o}function r(e,t,i){var r,n,a;if(1<arguments.length)r=function(e,t,i){var r,n=[],a=[];function o(e){var t=e<0?~e:e;(a[t]||(a[t]=[])).push({i:e,g:r})}function s(e){e.forEach(o)}function l(e){e.forEach(s)}return function e(t){switch(r=t,t.type){case"GeometryCollection":t.geometries.forEach(e);break;case"LineString":s(t.arcs);break;case"MultiLineString":case"Polygon":l(t.arcs);break;case"MultiPolygon":t.arcs.forEach(l)}}(t),a.forEach(null==i?function(e){n.push(e[0].i)}:function(e){i(e[0].g,e[e.length-1].g)&&n.push(e[0].i)}),n}(0,t,i);else for(n=0,r=new Array(a=e.arcs.length);n<a;++n)r[n]=n;return{type:"MultiLineString",arcs:d(e,r)}}function n(s,e){var l={},i=[],r=[];function n(t){t.forEach(function(e){e.forEach(function(e){(l[e=e<0?~e:e]||(l[e]=[])).push(t)})}),i.push(t)}function u(e){return function(e){for(var t,i=-1,r=e.length,n=e[r-1],a=0;++i<r;)t=n,n=e[i],a+=t[0]*n[1]-t[1]*n[0];return Math.abs(a)}(o(s,{type:"Polygon",arcs:[e]}).coordinates[0])}return e.forEach(function e(t){switch(t.type){case"GeometryCollection":t.geometries.forEach(e);break;case"Polygon":n(t.arcs);break;case"MultiPolygon":t.arcs.forEach(n)}}),i.forEach(function(e){if(!e._){var t=[],i=[e];for(e._=1,r.push(t);e=i.pop();)t.push(e),e.forEach(function(e){e.forEach(function(e){l[e<0?~e:e].forEach(function(e){e._||(e._=1,i.push(e))})})})}}),i.forEach(function(e){delete e._}),{type:"MultiPolygon",arcs:r.map(function(e){var t,i=[];if(e.forEach(function(e){e.forEach(function(e){e.forEach(function(e){l[e<0?~e:e].length<2&&i.push(e)})})}),1<(t=(i=d(s,i)).length))for(var r,n,a=1,o=u(i[0]);a<t;++a)(r=u(i[a]))>o&&(n=i[0],i[0]=i[a],i[a]=n,o=r);return i})}}function m(e,t){for(var i=0,r=e.length;i<r;){var n=i+r>>>1;e[n]<t?i=1+n:r=n}return i}function g(e){if(null==e)return t;var s,l,u=e.scale[0],c=e.scale[1],d=e.translate[0],h=e.translate[1];return function(e,t){t||(s=l=0);var i=2,r=e.length,n=new Array(r),a=Math.round((e[0]-d)/u),o=Math.round((e[1]-h)/c);for(n[0]=a-s,s=a,n[1]=o-l,l=o;i<r;)n[i]=e[i],++i;return n}}function w(a,o,s,e,l,t){3===arguments.length&&(e=t=Array,l=null);for(var u=new e(a=1<<Math.max(4,Math.ceil(Math.log(a)/Math.LN2))),c=new t(a),d=a-1,i=0;i<a;++i)u[i]=l;return{set:function(e,t){for(var i=o(e)&d,r=u[i],n=0;r!=l;){if(s(r,e))return c[i]=t;if(++n>=a)throw new Error("full hashmap");r=u[i=i+1&d]}return u[i]=e,c[i]=t},maybeSet:function(e,t){for(var i=o(e)&d,r=u[i],n=0;r!=l;){if(s(r,e))return c[i];if(++n>=a)throw new Error("full hashmap");r=u[i=i+1&d]}return u[i]=e,c[i]=t},get:function(e,t){for(var i=o(e)&d,r=u[i],n=0;r!=l;){if(s(r,e))return c[i];if(++n>=a)break;r=u[i=i+1&d]}return t},keys:function(){for(var e=[],t=0,i=u.length;t<i;++t){var r=u[t];r!=l&&e.push(r)}return e}}}function E(e,t){return e[0]===t[0]&&e[1]===t[1]}function T(e){var t=l[0]^l[1];return 2147483647&(t=t<<5^t>>7^l[2]^l[3])}function y(e){var t,i,r,n,a=e.coordinates,o=e.lines,s=e.rings,l=function(){for(var e=w(1.4*a.length,x,b,Int32Array,-1,Int32Array),t=new Int32Array(a.length),i=0,r=a.length;i<r;++i)t[i]=e.maybeSet(i,i);return t}(),u=new Int32Array(a.length),c=new Int32Array(a.length),d=new Int32Array(a.length),h=new Int8Array(a.length),p=0;for(t=0,i=a.length;t<i;++t)u[t]=c[t]=d[t]=-1;for(t=0,i=o.length;t<i;++t){var f=o[t],m=f[0],g=f[1];for(r=l[m],n=l[++m],++p,h[r]=1;++m<=g;)C(t,r,r=n,n=l[m]);++p,h[n]=1}for(t=0,i=a.length;t<i;++t)u[t]=-1;for(t=0,i=s.length;t<i;++t){var y=s[t],v=y[0]+1,_=y[1];for(C(t,l[_-1],r=l[v-1],n=l[v]);++v<=_;)C(t,r,r=n,n=l[v])}function C(e,t,i,r){if(u[i]!==e){u[i]=e;var n=c[i];if(0<=n){var a=d[i];n===t&&a===r||n===r&&a===t||(++p,h[i]=1)}else c[i]=t,d[i]=r}}function x(e){return T(a[e])}function b(e,t){return E(a[e],a[t])}u=c=d=null;var A,S=function(n,a,o,e,s){3===arguments.length&&(e=Array,s=null);for(var l=new e(n=1<<Math.max(4,Math.ceil(Math.log(n)/Math.LN2))),u=n-1,t=0;t<n;++t)l[t]=s;return{add:function(e){for(var t=a(e)&u,i=l[t],r=0;i!=s;){if(o(i,e))return!0;if(++r>=n)throw new Error("full hashset");i=l[t=t+1&u]}return l[t]=e,!0},has:function(e){for(var t=a(e)&u,i=l[t],r=0;i!=s;){if(o(i,e))return!0;if(++r>=n)break;i=l[t=t+1&u]}return!1},values:function(){for(var e=[],t=0,i=l.length;t<i;++t){var r=l[t];r!=s&&e.push(r)}return e}}}(1.4*p,T,E);for(t=0,i=a.length;t<i;++t)h[A=l[t]]&&S.add(a[A]);return S}var s=new ArrayBuffer(16),l=new Uint32Array(s);function v(e,t,i,r){u(e,t,i),u(e,t,t+r),u(e,t+r,i)}function u(e,t,i){for(var r,n=t+(i---t>>1);t<n;++t,--i)r=e[t],e[t]=e[i],e[i]=r}function p(e){var t,i=_(e.geometry);for(t in null!=e.id&&(i.id=e.id),null!=e.bbox&&(i.bbox=e.bbox),e.properties){i.properties=e.properties;break}return i}function _(e){if(null==e)return{type:null};var t="GeometryCollection"===e.type?{type:"GeometryCollection",geometries:e.geometries.map(_)}:"Point"===e.type||"MultiPoint"===e.type?{type:e.type,coordinates:e.coordinates}:{type:e.type,arcs:e.coordinates};return null!=e.bbox&&(t.bbox=e.bbox),t}function C(e){var t,i=e[0],r=e[1];return r<i&&(t=i,i=r,r=t),i+31*r}function x(e,t){var i,r=e[0],n=e[1],a=t[0],o=t[1];return n<r&&(i=r,r=n,n=i),o<a&&(i=a,a=o,o=i),r===a&&n===o}function b(){return!0}function A(e){return e}function S(e){return null!=e.type}function P(e){var t,l=new Array(e.arcs.length),u=0;function i(e){switch(e.type){case"GeometryCollection":e.geometries.forEach(i);break;case"Polygon":r(e.arcs);break;case"MultiPolygon":e.arcs.forEach(r)}}function r(e){for(var t=0,i=e.length;t<i;++t,++u)for(var r=e[t],n=0,a=r.length;n<a;++n){var o=r[n];o<0&&(o=~o);var s=l[o];null==s?l[o]=u:s!==u&&(l[o]=-1)}}for(t in e.objects)i(e.objects[t]);return function(e){for(var t,i=0,r=e.length;i<r;++i)if(-1===l[(t=e[i])<0?~t:t])return!0;return!1}}function M(e){var t=e[0],i=e[1],r=e[2];return Math.abs((t[0]-r[0])*(i[1]-t[1])-(t[0]-i[0])*(r[1]-t[1]))/2}function D(e){for(var t,i=-1,r=e.length,n=e[r-1],a=0;++i<r;)t=n,n=e[i],a+=t[0]*n[1]-t[1]*n[0];return Math.abs(a)/2}function I(i,r,n){return r=null==r?Number.MIN_VALUE:+r,null==n&&(n=D),function(e,t){return n(a(i,{type:"Polygon",arcs:[e]}).geometry.coordinates[0],t)>=r}}function O(e,t){return e[1][2]-t[1][2]}function R(e){return[e[0],e[1],0]}function L(e,t){return t-e}var N=Math.PI,k=2*N,B=N/4,F=N/180,V=Math.abs,z=Math.atan2,U=Math.cos,G=Math.sin;function $(e,t){for(var i,r,n=0,a=e.length,o=0,s=e[t?n++:a-1],l=s[0]*F,u=s[1]*F/2+B,c=U(u),d=G(u);n<a;++n){i=l,l=(s=e[n])[0]*F,u=s[1]*F/2+B,r=c,c=U(u);var h=l-i,p=0<=h?1:-1,f=p*h,m=d*(d=G(u)),g=r*c+m*U(f),y=m*p*G(f);o+=z(y,g)}return o}e.bbox=f,e.feature=a,e.mesh=function(e){return o(e,r.apply(this,arguments))},e.meshArcs=r,e.merge=function(e){return o(e,n.apply(this,arguments))},e.mergeArcs=n,e.neighbors=function(e){var r={},t=e.map(function(){return[]});function i(e,i){e.forEach(function(e){e<0&&(e=~e);var t=r[e];t?t.push(i):r[e]=[i]})}function n(e,t){e.forEach(function(e){i(e,t)})}var a={LineString:i,MultiLineString:n,Polygon:n,MultiPolygon:function(e,t){e.forEach(function(e){n(e,t)})}};for(var o in e.forEach(function t(e,i){"GeometryCollection"===e.type?e.geometries.forEach(function(e){t(e,i)}):e.type in a&&a[e.type](e.arcs,i)}),r)for(var s=r[o],l=s.length,u=0;u<l;++u)for(var c=u+1;c<l;++c){var d,h=s[u],p=s[c];(d=t[h])[o=m(d,p)]!==p&&d.splice(o,0,p),(d=t[p])[o=m(d,h)]!==h&&d.splice(o,0,h)}return t},e.quantize=function(e,t){if(e.transform)throw new Error("already quantized");if(t&&t.scale)s=e.bbox;else{if(!(2<=(i=Math.floor(t))))throw new Error("n must be ≥2");var i,r=(s=e.bbox||f(e))[0],n=s[1],a=s[2],o=s[3];t={scale:[a-r?(a-r)/(i-1):1,o-n?(o-n)/(i-1):1],translate:[r,n]}}var s,l,u=g(t),c=e.objects,d={};function h(e){return u(e)}function p(e){var t;switch(e.type){case"GeometryCollection":t={type:"GeometryCollection",geometries:e.geometries.map(p)};break;case"Point":t={type:"Point",coordinates:h(e.coordinates)};break;case"MultiPoint":t={type:"MultiPoint",coordinates:e.coordinates.map(h)};break;default:return e}return null!=e.id&&(t.id=e.id),null!=e.bbox&&(t.bbox=e.bbox),null!=e.properties&&(t.properties=e.properties),t}for(l in c)d[l]=p(c[l]);return{type:"Topology",bbox:s,transform:t,objects:d,arcs:e.arcs.map(function(e){var t,i=0,r=1,n=e.length,a=new Array(n);for(a[0]=u(e[0],0);++i<n;)((t=u(e[i],i))[0]||t[1])&&(a[r++]=t);return 1===r&&(a[r++]=[0,0]),a.length=r,a})}},e.transform=h,e.untransform=g,e.topology=function(e,t){var i=function(e){var r=1/0,n=1/0,a=-1/0,o=-1/0;function t(e){null!=e&&i.hasOwnProperty(e.type)&&i[e.type](e)}var i={GeometryCollection:function(e){e.geometries.forEach(t)},Point:function(e){s(e.coordinates)},MultiPoint:function(e){e.coordinates.forEach(s)},LineString:function(e){l(e.arcs)},MultiLineString:function(e){e.arcs.forEach(l)},Polygon:function(e){e.arcs.forEach(l)},MultiPolygon:function(e){e.arcs.forEach(u)}};function s(e){var t=e[0],i=e[1];t<r&&(r=t),a<t&&(a=t),i<n&&(n=i),o<i&&(o=i)}function l(e){e.forEach(s)}function u(e){e.forEach(l)}for(var c in e)t(e[c]);return r<=a&&n<=o?[r,n,a,o]:void 0}(e=function(e){var t,i,r={};for(t in e)r[t]=null==(i=e[t])?{type:null}:("FeatureCollection"===i.type?function(e){var t={type:"GeometryCollection",geometries:e.features.map(p)};null!=e.bbox&&(t.bbox=e.bbox);return t}:"Feature"===i.type?p:_)(i);return r}(e)),r=0<t&&i&&function(e,t,i){var d=t[0],h=t[1],r=t[2],n=t[3],p=r-d?(i-1)/(r-d):1,f=n-h?(i-1)/(n-h):1;function a(e){return[Math.round((e[0]-d)*p),Math.round((e[1]-h)*f)]}function o(e,t){for(var i,r,n,a,o,s=-1,l=0,u=e.length,c=new Array(u);++s<u;)i=e[s],a=Math.round((i[0]-d)*p),o=Math.round((i[1]-h)*f),a===r&&o===n||(c[l++]=[r=a,n=o]);for(c.length=l;l<t;)l=c.push([c[0][0],c[0][1]]);return c}function s(e){return o(e,2)}function l(e){return o(e,4)}function u(e){return e.map(l)}function c(e){null!=e&&m.hasOwnProperty(e.type)&&m[e.type](e)}var m={GeometryCollection:function(e){e.geometries.forEach(c)},Point:function(e){e.coordinates=a(e.coordinates)},MultiPoint:function(e){e.coordinates=e.coordinates.map(a)},LineString:function(e){e.arcs=s(e.arcs)},MultiLineString:function(e){e.arcs=e.arcs.map(s)},Polygon:function(e){e.arcs=u(e.arcs)},MultiPolygon:function(e){e.arcs=e.arcs.map(u)}};for(var g in e)c(e[g]);return{scale:[1/p,1/f],translate:[d,h]}}(e,i,t),n=function(e){var t,i,r,n,c=e.coordinates,a=e.lines,o=e.rings,s=a.length+o.length;for(delete e.lines,delete e.rings,r=0,n=a.length;r<n;++r)for(t=a[r];t=t.next;)++s;for(r=0,n=o.length;r<n;++r)for(i=o[r];i=i.next;)++s;var u=w(2*s*1.4,T,E),d=e.arcs=[];for(r=0,n=a.length;r<n;++r)for(t=a[r];l(t),t=t.next;);for(r=0,n=o.length;r<n;++r)if((i=o[r]).next)for(;l(i),i=i.next;);else h(i);function l(e){var t,i,r,n,a,o,s,l;if(r=u.get(t=c[e[0]]))for(s=0,l=r.length;s<l;++s)if(p(n=r[s],e))return e[0]=n[0],void(e[1]=n[1]);if(a=u.get(i=c[e[1]]))for(s=0,l=a.length;s<l;++s)if(f(o=a[s],e))return e[1]=o[0],void(e[0]=o[1]);r?r.push(e):u.set(t,[e]),a?a.push(e):u.set(i,[e]),d.push(e)}function h(e){var t,i,r,n,a;if(i=u.get(c[e[0]]))for(n=0,a=i.length;n<a;++n){if(m(r=i[n],e))return e[0]=r[0],void(e[1]=r[1]);if(g(r,e))return e[0]=r[1],void(e[1]=r[0])}if(i=u.get(t=c[e[0]+y(e)]))for(n=0,a=i.length;n<a;++n){if(m(r=i[n],e))return e[0]=r[0],void(e[1]=r[1]);if(g(r,e))return e[0]=r[1],void(e[1]=r[0])}i?i.push(e):u.set(t,[e]),d.push(e)}function p(e,t){var i=e[0],r=t[0],n=e[1];if(i-n!=r-t[1])return!1;for(;i<=n;++i,++r)if(!E(c[i],c[r]))return!1;return!0}function f(e,t){var i=e[0],r=t[0],n=e[1],a=t[1];if(i-n!=r-a)return!1;for(;i<=n;++i,--a)if(!E(c[i],c[a]))return!1;return!0}function m(e,t){var i=e[0],r=t[0],n=e[1]-i;if(n!=t[1]-r)return!1;for(var a=y(e),o=y(t),s=0;s<n;++s)if(!E(c[i+(s+a)%n],c[r+(s+o)%n]))return!1;return!0}function g(e,t){var i=e[0],r=t[0],n=e[1],a=t[1],o=n-i;if(o!=a-r)return!1;for(var s=y(e),l=o-y(t),u=0;u<o;++u)if(!E(c[i+(u+s)%o],c[a-(u+l)%o]))return!1;return!0}function y(e){for(var t=e[0],i=e[1],r=t,n=r,a=c[r];++r<i;){var o=c[r];(o[0]<a[0]||o[0]===a[0]&&o[1]<a[1])&&(n=r,a=o)}return n-t}return e}(function(e){var t,i,r,n=y(e),a=e.coordinates,o=e.lines,s=e.rings;for(i=0,r=o.length;i<r;++i)for(var l=o[i],u=l[0],c=l[1];++u<c;)n.has(a[u])&&(t={0:u,1:l[1]},l[1]=u,l=l.next=t);for(i=0,r=s.length;i<r;++i)for(var d=s[i],h=d[0],p=h,f=d[1],m=n.has(a[h]);++p<f;)n.has(a[p])&&(m?(t={0:p,1:d[1]},d[1]=p,d=d.next=t):(v(a,h,f,f-p),a[f]=a[h],m=!0,p=h));return e}(function(e){var n=-1,a=[],o=[],s=[];function t(e){e&&i.hasOwnProperty(e.type)&&i[e.type](e)}var i={GeometryCollection:function(e){e.geometries.forEach(t)},LineString:function(e){e.arcs=r(e.arcs)},MultiLineString:function(e){e.arcs=e.arcs.map(r)},Polygon:function(e){e.arcs=e.arcs.map(l)},MultiPolygon:function(e){e.arcs=e.arcs.map(u)}};function r(e){for(var t=0,i=e.length;t<i;++t)s[++n]=e[t];var r={0:n-i+1,1:n};return a.push(r),r}function l(e){for(var t=0,i=e.length;t<i;++t)s[++n]=e[t];var r={0:n-i+1,1:n};return o.push(r),r}function u(e){return e.map(l)}for(var c in e)t(e[c]);return{type:"Topology",coordinates:s,lines:a,rings:o,objects:e}}(e))),a=n.coordinates,o=w(1.4*n.arcs.length,C,x);function s(e){e&&l.hasOwnProperty(e.type)&&l[e.type](e)}e=n.objects,n.bbox=i,n.arcs=n.arcs.map(function(e,t){return o.set(e,t),a.slice(e[0],e[1]+1)}),delete n.coordinates,a=null;var l={GeometryCollection:function(e){e.geometries.forEach(s)},LineString:function(e){e.arcs=u(e.arcs)},MultiLineString:function(e){e.arcs=e.arcs.map(u)},Polygon:function(e){e.arcs=e.arcs.map(u)},MultiPolygon:function(e){e.arcs=e.arcs.map(c)}};function u(e){var t=[];do{var i=o.get(e);t.push(e[0]<e[1]?i:~i)}while(e=e.next);return t}function c(e){return e.map(u)}for(var d in e)s(e[d]);return r&&(n.transform=r,n.arcs=function(e){for(var t=-1,i=e.length;++t<i;){for(var r,n,a=e[t],o=0,s=1,l=a.length,u=a[0],c=u[0],d=u[1];++o<l;)r=(u=a[o])[0],n=u[1],r===c&&n===d||(a[s++]=[r-c,n-d],c=r,d=n);1===s&&(a[s++]=[0,0]),a.length=s}return e}(n.arcs)),n},e.filter=function(e,t){var i,r=e.objects,n={};function a(e){var t,i;switch(e.type){case"Polygon":t=(i=o(e.arcs))?{type:"Polygon",arcs:i}:{type:null};break;case"MultiPolygon":t=(i=e.arcs.map(o).filter(A)).length?{type:"MultiPolygon",arcs:i}:{type:null};break;case"GeometryCollection":t=(i=e.geometries.map(a).filter(S)).length?{type:"GeometryCollection",geometries:i}:{type:null};break;default:return e}return null!=e.id&&(t.id=e.id),null!=e.bbox&&(t.bbox=e.bbox),null!=e.properties&&(t.properties=e.properties),t}function o(e){return e.length&&function(e){return t(e,!1)}(e[0])?[e[0]].concat(e.slice(1).filter(s)):null}function s(e){return t(e,!0)}for(i in null==t&&(t=b),r)n[i]=a(r[i]);return function(e){var t,i,r=e.objects,n={},a=e.arcs,o=a.length,s=-1,l=new Array(o),u=0,c=-1;function d(e){switch(e.type){case"GeometryCollection":e.geometries.forEach(d);break;case"LineString":p(e.arcs);break;case"MultiLineString":case"Polygon":e.arcs.forEach(p);break;case"MultiPolygon":e.arcs.forEach(f)}}function h(e){e<0&&(e=~e),l[e]||(l[e]=1,++u)}function p(e){e.forEach(h)}function f(e){e.forEach(p)}function m(e){var t;switch(e.type){case"GeometryCollection":t={type:"GeometryCollection",geometries:e.geometries.map(m)};break;case"LineString":t={type:"LineString",arcs:y(e.arcs)};break;case"MultiLineString":t={type:"MultiLineString",arcs:e.arcs.map(y)};break;case"Polygon":t={type:"Polygon",arcs:e.arcs.map(y)};break;case"MultiPolygon":t={type:"MultiPolygon",arcs:e.arcs.map(v)};break;default:return e}return null!=e.id&&(t.id=e.id),null!=e.bbox&&(t.bbox=e.bbox),null!=e.properties&&(t.properties=e.properties),t}function g(e){return e<0?~l[~e]:l[e]}function y(e){return e.map(g)}function v(e){return e.map(y)}for(i in r)d(r[i]);for(t=new Array(u);++s<o;)l[s]&&(l[s]=++c,t[c]=a[s]);for(i in r)n[i]=m(r[i]);return{type:"Topology",bbox:e.bbox,transform:e.transform,objects:n,arcs:t}}({type:"Topology",bbox:e.bbox,transform:e.transform,objects:n,arcs:e.arcs})},e.filterAttached=P,e.filterAttachedWeight=function(e,t,i){var r=P(e),n=I(e,t,i);return function(e,t){return r(e,t)||n(e,t)}},e.filterWeight=I,e.planarRingArea=D,e.planarTriangleArea=M,e.presimplify=function(e,l){var u=e.transform?h(e.transform):R,c=function(){var e={},o=[],s=0;function r(e,t){for(;0<t;){var i=(t+1>>1)-1,r=o[i];if(0<=O(e,r))break;o[r._=t]=r,o[e._=t=i]=e}}function n(e,t){for(;;){var i=t+1<<1,r=i-1,n=t,a=o[n];if(r<s&&O(o[r],a)<0&&(a=o[n=r]),i<s&&O(o[i],a)<0&&(a=o[n=i]),n===t)break;o[a._=t]=a,o[e._=t=n]=e}}return e.push=function(e){return r(o[e._=s]=e,s++),s},e.pop=function(){if(!(s<=0)){var e,t=o[0];return 0<--s&&(e=o[s],n(o[e._=0]=e,0)),t}},e.remove=function(e){var t,i=e._;if(o[i]===e)return i!==--s&&(O(t=o[s],e)<0?r:n)(o[t._=i]=t,i),i},e}();null==l&&(l=M);var t=e.arcs.map(function(e){var t,i,r,n=[],a=0;for(i=1,r=(e=e.map(u)).length-1;i<r;++i)(t=[e[i-1],e[i],e[i+1]])[1][2]=l(t),n.push(t),c.push(t);for(e[0][2]=e[r][2]=1/0,i=0,r=n.length;i<r;++i)(t=n[i]).previous=n[i-1],t.next=n[i+1];for(;t=c.pop();){var o=t.previous,s=t.next;t[1][2]<a?t[1][2]=a:a=t[1][2],o&&(o.next=s,o[2]=t[2],d(o)),s&&(s.previous=o,s[0]=t[0],d(s))}return e});function d(e){c.remove(e),e[1][2]=l(e),c.push(e)}return{type:"Topology",bbox:e.bbox,objects:e.objects,arcs:t}},e.quantile=function(e,t){var i=[];return e.arcs.forEach(function(e){e.forEach(function(e){isFinite(e[2])&&i.push(e[2])})}),i.length&&function(e,t){if(!(i=e.length))return;if((t=+t)<=0||i<2)return e[0];if(1<=t)return e[i-1];var i,r=(i-1)*t,n=Math.floor(r),a=e[n],o=e[n+1];return a+(o-a)*(r-n)}(i.sort(L),t)},e.simplify=function(e,o){o=null==o?Number.MIN_VALUE:+o;var t=e.arcs.map(function(e){for(var t,i=-1,r=0,n=e.length,a=new Array(n);++i<n;)(t=e[i])[2]>=o&&(a[r++]=[t[0],t[1]]);return a.length=r,a});return{type:"Topology",transform:e.transform,bbox:e.bbox,objects:e.objects,arcs:t}},e.sphericalRingArea=function(e,t){var i=$(e,!0);return t&&(i*=-1),2*(i<0?k+i:i)},e.sphericalTriangleArea=function(e){return 2*V($(e,!1))},Object.defineProperty(e,"__esModule",{value:!0})},"object"==typeof exports&&"undefined"!=typeof module?tZh(exports):tZh(sZh.topojson=sZh.topojson||{});var topojson=tmp$1.topojson;function CallbackProperty(e,t){this._callback=void 0,this._isConstant=void 0,this._definitionChanged=new Event,this.setCallback(e,t)}function defaultCrsFunction(e){return Cartesian3.fromDegrees(e[0],e[1],e[2])}Object.defineProperties(CallbackProperty.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}}}),CallbackProperty.prototype.getValue=function(e,t){return this._callback(e,t)},CallbackProperty.prototype.setCallback=function(e,t){var i=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,i&&this._definitionChanged.raiseEvent(this)},CallbackProperty.prototype.equals=function(e){return this===e||e instanceof CallbackProperty&&this._callback===e._callback&&this._isConstant===e._isConstant};var el=Ellipsoid.CGCS2000;function changeCrsFunction(e){return Cartesian3.fromDegrees(e[0],e[1],e[2],el)}var crsNames={"urn:ogc:def:crs:OGC:1.3:CRS84":defaultCrsFunction,"EPSG:4326":defaultCrsFunction,"EPSG:4490":changeCrsFunction,"urn:ogc:def:crs:EPSG::4326":defaultCrsFunction,"urn:ogc:def:crs:EPSG::4490":changeCrsFunction},crsLinkHrefs={},crsLinkTypes={},defaultMarkerSize=48,defaultMarkerSymbol,defaultMarkerColor=Color.ROYALBLUE,defaultStroke=Color.YELLOW,defaultStrokeWidth=2,defaultFill=Color.fromBytes(255,255,0,100),defaultClampToGround=!1,sizes={small:24,medium:48,large:64},simpleStyleIdentifiers=["title","description","marker-size","marker-symbol","marker-color","stroke","stroke-opacity","stroke-width","fill","fill-opacity"];function defaultDescribe(e,t){var i="";for(var r in e)if(e.hasOwnProperty(r)){if(r===t||-1!==simpleStyleIdentifiers.indexOf(r))continue;var n=e[r];defined(n)&&(i+="object"==typeof n?"<tr><th>"+r+"</th><td>"+defaultDescribe(n)+"</td></tr>":"<tr><th>"+r+"</th><td>"+n+"</td></tr>")}return 0<i.length&&(i='<table class="cesium-infoBox-defaultTable"><tbody>'+i+"</tbody></table>"),i}function createDescriptionCallback(i,r,n){var a;return function(e,t){return defined(a)||(a=i(r,n)),a}}function defaultDescribeProperty(e,t){return new CallbackProperty(createDescriptionCallback(defaultDescribe,e,t),!0)}function createObject(e,t,i){var r=e.id;if(defined(r)&&"Feature"===e.type){for(var n=2,a=r;defined(t.getById(a));)a=r+"_"+n,n++;r=a}else r=createGuid();var o=t.getOrCreateEntity(r),s=e.properties;if(defined(s)){var l,u=(o.properties=s).title;if(defined(u))o.name=u,l="title";else{var c=Number.MAX_VALUE;for(var d in s)if(s.hasOwnProperty(d)&&s[d]){var h=d.toLowerCase();if(1<c&&"title"===h){c=1,l=d;break}2<c&&"name"===h?(c=2,l=d):3<c&&/title/i.test(d)?(c=3,l=d):4<c&&/name/i.test(d)&&(c=4,l=d)}defined(l)&&(o.name=s[l])}var p=s.description;null!==p&&(o.description=defined(p)?new ConstantProperty(p):i(s,l))}return o}function coordinatesArrayToCartesianArray(e,t){for(var i=new Array(e.length),r=0;r<e.length;r++)i[r]=t(e[r]);return i}var geoJsonObjectTypes={Feature:processFeature,FeatureCollection:processFeatureCollection,GeometryCollection:processGeometryCollection,LineString:processLineString,MultiLineString:processMultiLineString,MultiPoint:processMultiPoint,MultiPolygon:processMultiPolygon,Point:processPoint,Polygon:processPolygon,Topology:processTopology},geometryTypes={GeometryCollection:processGeometryCollection,LineString:processLineString,MultiLineString:processMultiLineString,MultiPoint:processMultiPoint,MultiPolygon:processMultiPolygon,Point:processPoint,Polygon:processPolygon,Topology:processTopology};function processFeature(e,t,i,r,n){if(null!==t.geometry){if(!defined(t.geometry))throw new RuntimeError("feature.geometry is required.");var a=t.geometry.type,o=geometryTypes[a];if(!defined(o))throw new RuntimeError("Unknown geometry type: "+a);o(e,t,t.geometry,r,n)}else createObject(t,e._entityCollection,n.describe)}function processFeatureCollection(e,t,i,r,n){for(var a=t.features,o=0,s=a.length;o<s;o++)processFeature(e,a[o],void 0,r,n)}function processGeometryCollection(e,t,i,r,n){for(var a=i.geometries,o=0,s=a.length;o<s;o++){var l=a[o],u=l.type,c=geometryTypes[u];if(!defined(c))throw new RuntimeError("Unknown geometry type: "+u);c(e,t,l,r,n)}}function createPoint(e,t,i,r,n){var a,o=n.markerSymbol,s=n.markerColor,l=n.markerSize,u=t.properties;if(defined(u)){var c=u["marker-color"];defined(c)&&(s=Color.fromCssColorString(c)),l=defaultValue(sizes[u["marker-size"]],l);var d=u["marker-symbol"];defined(d)&&(o=d)}a=defined(o)?1===o.length?e._pinBuilder.fromText(o.toUpperCase(),s,l):e._pinBuilder.fromMakiIconId(o,s,l):e._pinBuilder.fromColor(s,l);var h=new BillboardGraphics;h.verticalOrigin=new ConstantProperty(VerticalOrigin$1.BOTTOM),2===r.length&&n.clampToGround&&(h.heightReference=HeightReference$1.CLAMP_TO_GROUND);var p=createObject(t,e._entityCollection,n.describe);p.billboard=h,p.position=new ConstantPositionProperty(i(r));var f=when(a).then(function(e){h.image=new ConstantProperty(e)}).otherwise(function(){h.image=new ConstantProperty(e._pinBuilder.fromColor(s,l))});e._promises.push(f)}function processPoint(e,t,i,r,n){createPoint(e,t,r,i.coordinates,n)}function processMultiPoint(e,t,i,r,n){for(var a=i.coordinates,o=0;o<a.length;o++)createPoint(e,t,r,a[o],n)}function createLineString(e,t,i,r,n){var a=n.strokeMaterialProperty,o=n.strokeWidthProperty,s=t.properties;if(defined(s)){var l,u=s["stroke-width"];defined(u)&&(o=new ConstantProperty(u));var c=s.stroke;defined(c)&&(l=Color.fromCssColorString(c));var d=s["stroke-opacity"];defined(d)&&1!==d&&(defined(l)||(l=a.color.clone()),l.alpha=d),defined(l)&&(a=new ColorMaterialProperty(l))}var h=createObject(t,e._entityCollection,n.describe),p=new PolylineGraphics;(h.polyline=p).clampToGround=n.clampToGround,p.material=a,p.width=o,p.positions=new ConstantProperty(coordinatesArrayToCartesianArray(r,i)),p.arcType=ArcType$1.RHUMB}function processLineString(e,t,i,r,n){createLineString(e,t,r,i.coordinates,n)}function processMultiLineString(e,t,i,r,n){for(var a=i.coordinates,o=0;o<a.length;o++)createLineString(e,t,r,a[o],n)}function createPolygon(e,t,i,r,n){if(0!==r.length&&0!==r[0].length){var a=n.strokeMaterialProperty.color,o=n.fillMaterialProperty,s=n.strokeWidthProperty,l=t.properties;if(defined(l)){var u,c=l["stroke-width"];defined(c)&&(s=new ConstantProperty(c));var d=l.stroke;defined(d)&&(u=Color.fromCssColorString(d));var h,p=l["stroke-opacity"];defined(p)&&1!==p&&(defined(u)||(u=n.strokeMaterialProperty.color.clone()),u.alpha=p),defined(u)&&(a=new ConstantProperty(u));var f=l.fill;defined(f)&&((h=Color.fromCssColorString(f)).alpha=o.color.alpha),defined(p=l["fill-opacity"])&&p!==o.color.alpha&&(defined(h)||(h=o.color.clone()),h.alpha=p),defined(h)&&(o=new ColorMaterialProperty(h))}var m=new PolygonGraphics;m.outline=new ConstantProperty(!0),m.outlineColor=a,m.outlineWidth=s,m.material=o,m.arcType=ArcType$1.RHUMB;for(var g=[],y=1,v=r.length;y<v;y++)g.push(new PolygonHierarchy(coordinatesArrayToCartesianArray(r[y],i)));var _=r[0];m.hierarchy=new ConstantProperty(new PolygonHierarchy(coordinatesArrayToCartesianArray(_,i),g)),2<_[0].length?m.perPositionHeight=new ConstantProperty(!0):n.clampToGround||(m.height=0),createObject(t,e._entityCollection,n.describe).polygon=m}}function processPolygon(e,t,i,r,n){createPolygon(e,t,r,i.coordinates,n)}function processMultiPolygon(e,t,i,r,n){for(var a=i.coordinates,o=0;o<a.length;o++)createPolygon(e,t,r,a[o],n)}function processTopology(e,t,i,r,n){for(var a in i.objects)if(i.objects.hasOwnProperty(a)){var o=topojson.feature(i,i.objects[a]);(0,geoJsonObjectTypes[o.type])(e,o,o,r,n)}}function GeoJsonDataSource(e){this._name=e,this._changed=new Event,this._error=new Event,this._isLoading=!1,this._loading=new Event,this._entityCollection=new EntityCollection(this),this._promises=[],this._pinBuilder=new PinBuilder,this._entityCluster=new EntityCluster,this._credit=void 0,this._resourceCredits=[]}function load(t,i,r,e){var n;defined(e)&&(n=getFilenameFromUri(e)),defined(n)&&t._name!==n&&(t._name=n,t._changed.raiseEvent(t));var a=geoJsonObjectTypes[i.type];if(!defined(a))throw new RuntimeError("Unsupported GeoJSON object type: "+i.type);var o=i.crs,s=null!==o?defaultCrsFunction:null;if(defined(o)){if(!defined(o.properties))throw new RuntimeError("crs.properties is undefined.");var l=o.properties;if("name"===o.type){if(!defined(s=crsNames[l.name])){if("urn:ogc:def:crs:EPSG::4490"!==l.name)throw new RuntimeError("Unknown crs name: "+l.name);s=changeCrsFunction}}else if("link"===o.type){var u=crsLinkHrefs[l.href];if(defined(u)||(u=crsLinkTypes[l.type]),!defined(u))throw new RuntimeError("Unable to resolve crs link: "+JSON.stringify(l));s=u(l)}else{if("EPSG"!==o.type)throw new RuntimeError("Unknown crs type: "+o.type);if(!defined(s=crsNames["EPSG:"+l.code]))throw new RuntimeError("Unknown crs EPSG code: "+l.code)}}return when(s,function(e){return t._entityCollection.removeAll(),null!==e&&a(t,i,i,e,r),when.all(t._promises,function(){return t._promises.length=0,DataSource.setLoading(t,!1),t})})}GeoJsonDataSource.load=function(e,t){return(new GeoJsonDataSource).load(e,t)},Object.defineProperties(GeoJsonDataSource,{markerSize:{get:function(){return defaultMarkerSize},set:function(e){defaultMarkerSize=e}},markerSymbol:{get:function(){return defaultMarkerSymbol},set:function(e){defaultMarkerSymbol=e}},markerColor:{get:function(){return defaultMarkerColor},set:function(e){defaultMarkerColor=e}},stroke:{get:function(){return defaultStroke},set:function(e){defaultStroke=e}},strokeWidth:{get:function(){return defaultStrokeWidth},set:function(e){defaultStrokeWidth=e}},fill:{get:function(){return defaultFill},set:function(e){defaultFill=e}},clampToGround:{get:function(){return defaultClampToGround},set:function(e){defaultClampToGround=e}},crsNames:{get:function(){return crsNames}},crsLinkHrefs:{get:function(){return crsLinkHrefs}},crsLinkTypes:{get:function(){return crsLinkTypes}}}),Object.defineProperties(GeoJsonDataSource.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{value:void 0,writable:!1},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}},credit:{get:function(){return this._credit}}}),GeoJsonDataSource.prototype.load=function(e,t){DataSource.setLoading(this,!0);var i=(t=defaultValue(t,defaultValue.EMPTY_OBJECT)).credit;"string"==typeof i&&(i=new Credit(i)),this._credit=i;var r=e,n=t.sourceUri;if("string"==typeof e||e instanceof Resource){r=(e=Resource.createIfNeeded(e)).fetchJson(),n=defaultValue(n,e.getUrlComponent());var a=this._resourceCredits,o=e.credits;if(defined(o))for(var s=o.length,l=0;l<s;l++)a.push(o[l])}t={describe:defaultValue(t.describe,defaultDescribeProperty),markerSize:defaultValue(t.markerSize,defaultMarkerSize),markerSymbol:defaultValue(t.markerSymbol,defaultMarkerSymbol),markerColor:defaultValue(t.markerColor,defaultMarkerColor),strokeWidthProperty:new ConstantProperty(defaultValue(t.strokeWidth,defaultStrokeWidth)),strokeMaterialProperty:new ColorMaterialProperty(defaultValue(t.stroke,defaultStroke)),fillMaterialProperty:new ColorMaterialProperty(defaultValue(t.fill,defaultFill)),clampToGround:defaultValue(t.clampToGround,defaultClampToGround)};var u=this;return when(r,function(e){return load(u,e,t,n)}).otherwise(function(e){return DataSource.setLoading(u,!1),u._error.raiseEvent(u,e),console.log(e),when.reject(e)})};var ClockRange={UNBOUNDED:0,CLAMPED:1,LOOP_STOP:2},ClockRange$1=Object.freeze(ClockRange),ClockStep={TICK_DEPENDENT:0,SYSTEM_CLOCK_MULTIPLIER:1,SYSTEM_CLOCK:2},ClockStep$1=Object.freeze(ClockStep),getTimestamp;getTimestamp="undefined"!=typeof performance&&"function"==typeof performance.now&&isFinite(performance.now())?function(){return performance.now()}:function(){return Date.now()};var getTimestamp$1=getTimestamp;function HeadingPitchRange(e,t,i){this.heading=defaultValue(e,0),this.pitch=defaultValue(t,0),this.range=defaultValue(i,0)}HeadingPitchRange.clone=function(e,t){if(defined(e))return defined(t)||(t=new HeadingPitchRange),t.heading=e.heading,t.pitch=e.pitch,t.range=e.range,t};var warnings={};function oneTimeWarning(e,t){defined(warnings[e])||(warnings[e]=!0,console.warn(defaultValue(t,e)))}function compareIntervalStartTimes(e,t){return JulianDate.compare(e.start,t.start)}function TimeIntervalCollection(e){if(this._intervals=[],this._changedEvent=new Event,defined(e))for(var t=e.length,i=0;i<t;i++)this.addInterval(e[i])}oneTimeWarning.geometryOutlines="Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.",oneTimeWarning.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored",oneTimeWarning.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored",oneTimeWarning.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored",Object.defineProperties(TimeIntervalCollection.prototype,{changedEvent:{get:function(){return this._changedEvent}},start:{get:function(){var e=this._intervals;return 0===e.length?void 0:e[0].start}},isStartIncluded:{get:function(){var e=this._intervals;return 0!==e.length&&e[0].isStartIncluded}},stop:{get:function(){var e=this._intervals,t=e.length;return 0===t?void 0:e[t-1].stop}},isStopIncluded:{get:function(){var e=this._intervals,t=e.length;return 0!==t&&e[t-1].isStopIncluded}},length:{get:function(){return this._intervals.length}},isEmpty:{get:function(){return 0===this._intervals.length}}}),TimeIntervalCollection.prototype.equals=function(e,t){if(this===e)return!0;if(!(e instanceof TimeIntervalCollection))return!1;var i=this._intervals,r=e._intervals,n=i.length;if(n!==r.length)return!1;for(var a=0;a<n;a++)if(!TimeInterval.equals(i[a],r[a],t))return!1;return!0},TimeIntervalCollection.prototype.get=function(e){return this._intervals[e]},TimeIntervalCollection.prototype.removeAll=function(){0<this._intervals.length&&(this._intervals.length=0,this._changedEvent.raiseEvent(this))},TimeIntervalCollection.prototype.findIntervalContainingDate=function(e){var t=this.indexOf(e);return 0<=t?this._intervals[t]:void 0},TimeIntervalCollection.prototype.findDataForIntervalContainingDate=function(e){var t=this.indexOf(e);return 0<=t?this._intervals[t].data:void 0},TimeIntervalCollection.prototype.contains=function(e){return 0<=this.indexOf(e)};var indexOfScratch=new TimeInterval;TimeIntervalCollection.prototype.indexOf=function(e){var t=this._intervals;indexOfScratch.start=e,indexOfScratch.stop=e;var i=binarySearch(t,indexOfScratch,compareIntervalStartTimes);return 0<=i?t[i].isStartIncluded?i:0<i&&t[i-1].stop.equals(e)&&t[i-1].isStopIncluded?i-1:~i:0<(i=~i)&&i-1<t.length&&TimeInterval.contains(t[i-1],e)?i-1:~i},TimeIntervalCollection.prototype.findInterval=function(e){for(var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).start,i=e.stop,r=e.isStartIncluded,n=e.isStopIncluded,a=this._intervals,o=0,s=a.length;o<s;o++){var l=a[o];if((!defined(t)||l.start.equals(t))&&(!defined(i)||l.stop.equals(i))&&(!defined(r)||l.isStartIncluded===r)&&(!defined(n)||l.isStopIncluded===n))return a[o]}},TimeIntervalCollection.prototype.addInterval=function(e,t){if(!e.isEmpty){var i=this._intervals;if(0===i.length||JulianDate.greaterThan(e.start,i[i.length-1].stop))return i.push(e),void this._changedEvent.raiseEvent(this);var r,n=binarySearch(i,e,compareIntervalStartTimes);for(n<0?n=~n:0<n&&e.isStartIncluded&&i[n-1].isStartIncluded&&i[n-1].start.equals(e.start)?--n:n<i.length&&!e.isStartIncluded&&i[n].isStartIncluded&&i[n].start.equals(e.start)&&++n,0<n&&(0<(r=JulianDate.compare(i[n-1].stop,e.start))||0===r&&(i[n-1].isStopIncluded||e.isStartIncluded))&&((defined(t)?t(i[n-1].data,e.data):i[n-1].data===e.data)?(e=JulianDate.greaterThan(e.stop,i[n-1].stop)?new TimeInterval({start:i[n-1].start,stop:e.stop,isStartIncluded:i[n-1].isStartIncluded,isStopIncluded:e.isStopIncluded,data:e.data}):new TimeInterval({start:i[n-1].start,stop:i[n-1].stop,isStartIncluded:i[n-1].isStartIncluded,isStopIncluded:i[n-1].isStopIncluded||e.stop.equals(i[n-1].stop)&&e.isStopIncluded,data:e.data}),i.splice(n-1,1),--n):((0<(r=JulianDate.compare(i[n-1].stop,e.stop))||0===r&&i[n-1].isStopIncluded&&!e.isStopIncluded)&&i.splice(n,0,new TimeInterval({start:e.stop,stop:i[n-1].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:i[n-1].isStopIncluded,data:i[n-1].data})),i[n-1]=new TimeInterval({start:i[n-1].start,stop:e.start,isStartIncluded:i[n-1].isStartIncluded,isStopIncluded:!e.isStartIncluded,data:i[n-1].data})));n<i.length&&(0<(r=JulianDate.compare(e.stop,i[n].start))||0===r&&(e.isStopIncluded||i[n].isStartIncluded));)if(defined(t)?t(i[n].data,e.data):i[n].data===e.data)e=new TimeInterval({start:e.start,stop:JulianDate.greaterThan(i[n].stop,e.stop)?i[n].stop:e.stop,isStartIncluded:e.isStartIncluded,isStopIncluded:JulianDate.greaterThan(i[n].stop,e.stop)?i[n].isStopIncluded:e.isStopIncluded,data:e.data}),i.splice(n,1);else{if(i[n]=new TimeInterval({start:e.stop,stop:i[n].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:i[n].isStopIncluded,data:i[n].data}),!i[n].isEmpty)break;i.splice(n,1)}i.splice(n,0,e),this._changedEvent.raiseEvent(this)}},TimeIntervalCollection.prototype.removeInterval=function(e){if(e.isEmpty)return!1;var t=this._intervals,i=binarySearch(t,e,compareIntervalStartTimes);i<0&&(i=~i);var r=!1;for(0<i&&(JulianDate.greaterThan(t[i-1].stop,e.start)||t[i-1].stop.equals(e.start)&&t[i-1].isStopIncluded&&e.isStartIncluded)&&(r=!0,(JulianDate.greaterThan(t[i-1].stop,e.stop)||t[i-1].isStopIncluded&&!e.isStopIncluded&&t[i-1].stop.equals(e.stop))&&t.splice(i,0,new TimeInterval({start:e.stop,stop:t[i-1].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:t[i-1].isStopIncluded,data:t[i-1].data})),t[i-1]=new TimeInterval({start:t[i-1].start,stop:e.start,isStartIncluded:t[i-1].isStartIncluded,isStopIncluded:!e.isStartIncluded,data:t[i-1].data})),i<t.length&&!e.isStartIncluded&&t[i].isStartIncluded&&e.start.equals(t[i].start)&&(r=!0,t.splice(i,0,new TimeInterval({start:t[i].start,stop:t[i].start,isStartIncluded:!0,isStopIncluded:!0,data:t[i].data})),++i);i<t.length&&JulianDate.greaterThan(e.stop,t[i].stop);)r=!0,t.splice(i,1);return i<t.length&&e.stop.equals(t[i].stop)&&(r=!0,!e.isStopIncluded&&t[i].isStopIncluded?i+1<t.length&&t[i+1].start.equals(e.stop)&&t[i].data===t[i+1].data?(t.splice(i,1),t[i]=new TimeInterval({start:t[i].start,stop:t[i].stop,isStartIncluded:!0,isStopIncluded:t[i].isStopIncluded,data:t[i].data})):t[i]=new TimeInterval({start:e.stop,stop:e.stop,isStartIncluded:!0,isStopIncluded:!0,data:t[i].data}):t.splice(i,1)),i<t.length&&(JulianDate.greaterThan(e.stop,t[i].start)||e.stop.equals(t[i].start)&&e.isStopIncluded&&t[i].isStartIncluded)&&(r=!0,t[i]=new TimeInterval({start:e.stop,stop:t[i].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:t[i].isStopIncluded,data:t[i].data})),r&&this._changedEvent.raiseEvent(this),r},TimeIntervalCollection.prototype.intersect=function(e,t,i){for(var r=new TimeIntervalCollection,n=0,a=0,o=this._intervals,s=e._intervals;n<o.length&&a<s.length;){var l=o[n],u=s[a];if(JulianDate.lessThan(l.stop,u.start))++n;else if(JulianDate.lessThan(u.stop,l.start))++a;else{if(defined(i)||defined(t)&&t(l.data,u.data)||!defined(t)&&u.data===l.data){var c=TimeInterval.intersect(l,u,new TimeInterval,i);c.isEmpty||r.addInterval(c,t)}JulianDate.lessThan(l.stop,u.stop)||l.stop.equals(u.stop)&&!l.isStopIncluded&&u.isStopIncluded?++n:++a}}return r},TimeIntervalCollection.fromJulianDateArray=function(e,t){defined(t)||(t=new TimeIntervalCollection);var i,r=e.julianDates,n=r.length,a=e.dataCallback,o=defaultValue(e.isStartIncluded,!0),s=defaultValue(e.isStopIncluded,!0),l=defaultValue(e.leadingInterval,!1),u=defaultValue(e.trailingInterval,!1),c=0;l&&(++c,(i=new TimeInterval({start:Iso8601.MINIMUM_VALUE,stop:r[0],isStartIncluded:!0,isStopIncluded:!o})).data=defined(a)?a(i,t.length):t.length,t.addInterval(i));for(var d=0;d<n-1;++d){var h=r[d],p=r[d+1];(i=new TimeInterval({start:h,stop:p,isStartIncluded:t.length!==c||o,isStopIncluded:d===n-2&&s})).data=defined(a)?a(i,t.length):t.length,t.addInterval(i),h=p}return u&&((i=new TimeInterval({start:r[n-1],stop:Iso8601.MAXIMUM_VALUE,isStartIncluded:!s,isStopIncluded:!0})).data=defined(a)?a(i,t.length):t.length,t.addInterval(i)),t};var scratchGregorianDate=new GregorianDate,monthLengths=[0,31,28,31,30,31,30,31,31,30,31,30,31];function addToDate(e,t,i){defined(i)||(i=new JulianDate),JulianDate.toGregorianDate(e,scratchGregorianDate);var r=scratchGregorianDate.millisecond+t.millisecond,n=scratchGregorianDate.second+t.second,a=scratchGregorianDate.minute+t.minute,o=scratchGregorianDate.hour+t.hour,s=scratchGregorianDate.day+t.day,l=scratchGregorianDate.month+t.month,u=scratchGregorianDate.year+t.year;for(1e3<=r&&(n+=Math.floor(r/1e3),r%=1e3),60<=n&&(a+=Math.floor(n/60),n%=60),60<=a&&(o+=Math.floor(a/60),a%=60),24<=o&&(s+=Math.floor(o/24),o%=24),monthLengths[2]=isLeapYear(u)?29:28;s>monthLengths[l]||13<=l;)s>monthLengths[l]&&(s-=monthLengths[l],++l),13<=l&&(--l,u+=Math.floor(l/12),l%=12,++l),monthLengths[2]=isLeapYear(u)?29:28;return scratchGregorianDate.millisecond=r,scratchGregorianDate.second=n,scratchGregorianDate.minute=a,scratchGregorianDate.hour=o,scratchGregorianDate.day=s,scratchGregorianDate.month=l,scratchGregorianDate.year=u,JulianDate.fromGregorianDate(scratchGregorianDate,i)}var scratchJulianDate=new JulianDate,durationRegex=/P(?:([\d.,]+)Y)?(?:([\d.,]+)M)?(?:([\d.,]+)W)?(?:([\d.,]+)D)?(?:T(?:([\d.,]+)H)?(?:([\d.,]+)M)?(?:([\d.,]+)S)?)?/;function parseDuration(e,t){if(!defined(e)||0===e.length)return!1;if(t.year=0,t.month=0,t.day=0,t.hour=0,t.minute=0,t.second=0,"P"===e[t.millisecond=0]){var i=e.match(durationRegex);if(!defined(i))return!1;if(defined(i[1])&&(t.year=Number(i[1].replace(",","."))),defined(i[2])&&(t.month=Number(i[2].replace(",","."))),defined(i[3])&&(t.day=7*Number(i[3].replace(",","."))),defined(i[4])&&(t.day+=Number(i[4].replace(",","."))),defined(i[5])&&(t.hour=Number(i[5].replace(",","."))),defined(i[6])&&(t.minute=Number(i[6].replace(",","."))),defined(i[7])){var r=Number(i[7].replace(",","."));t.second=Math.floor(r),t.millisecond=r%1*1e3}}else"Z"!==e[e.length-1]&&(e+="Z"),JulianDate.toGregorianDate(JulianDate.fromIso8601(e,scratchJulianDate),t);return t.year||t.month||t.day||t.hour||t.minute||t.second||t.millisecond}var scratchDuration=new GregorianDate;TimeIntervalCollection.fromIso8601=function(e,t){var i=e.iso8601.split("/"),r=JulianDate.fromIso8601(i[0]),n=JulianDate.fromIso8601(i[1]),a=[];if(parseDuration(i[2],scratchDuration)){var o=JulianDate.clone(r);for(a.push(o);JulianDate.compare(o,n)<0;){o=addToDate(o,scratchDuration),JulianDate.compare(n,o)<=0&&JulianDate.clone(n,o),a.push(o)}}else a.push(r,n);return TimeIntervalCollection.fromJulianDateArray({julianDates:a,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)},TimeIntervalCollection.fromIso8601DateArray=function(e,t){return TimeIntervalCollection.fromJulianDateArray({julianDates:e.iso8601Dates.map(function(e){return JulianDate.fromIso8601(e)}),isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)},TimeIntervalCollection.fromIso8601DurationArray=function(e,t){for(var i,r,n=e.epoch,a=e.iso8601Durations,o=defaultValue(e.relativeToPrevious,!1),s=[],l=a.length,u=0;u<l;++u)!parseDuration(a[u],scratchDuration)&&0!==u||(i=o&&defined(r)?addToDate(r,scratchDuration):addToDate(n,scratchDuration),s.push(i),r=i);return TimeIntervalCollection.fromJulianDateArray({julianDates:s,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};var tmp$2={},yii,Cii,Dii,Eii,Gii,Hii,Iii,Jii,Kii,Lii,Mii,Nii,Oii,Pii,Qii,Rii,Sii,Vii,Wii,Xii,Yii,Zii,$ii,_ii,aji,bji,cji,dji,eji,fji,gji,hji,iji,jji,lji;function tii(e,t,i){var r;return e.length>t&&(r=null==i?(i="…",3):i.length,e=e.substring(0,t-r)+i),e}function uii(e,t){if(Array.prototype.indexOf)return e.indexOf(t);for(var i=0,r=e.length;i<r;i++)if(e[i]===t)return i;return-1}function vii(e,t){for(var i=e.length-1;0<=i;i--)!0===t(e[i])&&e.splice(i,1)}function xii(e){throw new Error("Unhandled case for value: '"+e+"'")}function Fii(e,t){function i(){this.constructor=e}Eii(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}function kji(t,e){for(var i=e.onOpenTag,r=e.onCloseTag,n=e.onText,a=e.onComment,o=e.onDoctype,s=new lji,l=0,u=t.length,c=0,d=0,h=s;l<u;){var p=t.charAt(l);switch(c){case 0:f(p);break;case 1:m(p);break;case 2:y(p);break;case 3:g(p);break;case 4:v(p);break;case 5:_(p);break;case 6:C(p);break;case 7:x(p);break;case 8:b(p);break;case 9:A(p);break;case 10:S(p);break;case 11:w(p);break;case 12:E(p);break;case 13:T();break;case 14:P(p);break;case 15:M(p);break;case 16:D(p);break;case 17:I(p);break;case 18:O(p);break;case 19:R(p);break;case 20:L(p);break;default:xii(c)}l++}function f(e){"<"===e&&k()}function m(e){"!"===e?c=13:"/"===e?(c=2,h=new lji(Gii({},h,{isClosing:!0}))):"<"===e?k():h=Nii.test(e)?(c=3,new lji(Gii({},h,{isOpening:!0}))):(c=0,s)}function g(e){Pii.test(e)?(h=new lji(Gii({},h,{name:F()})),c=4):"<"===e?k():"/"===e?(h=new lji(Gii({},h,{name:F()})),c=12):">"===e?(h=new lji(Gii({},h,{name:F()})),B()):Nii.test(e)||Oii.test(e)||":"===e||N()}function y(e){">"===e?N():Nii.test(e)?c=3:N()}function v(e){Pii.test(e)||("/"===e?c=12:">"===e?B():"<"===e?k():"="===e||Qii.test(e)||Rii.test(e)?N():c=5)}function _(e){Pii.test(e)?c=6:"/"===e?c=12:"="===e?c=7:">"===e?B():"<"===e?k():Qii.test(e)&&N()}function C(e){Pii.test(e)||("/"===e?c=12:"="===e?c=7:">"===e?B():"<"===e?k():Qii.test(e)?N():c=5)}function x(e){Pii.test(e)||('"'===e?c=8:"'"===e?c=9:/[>=`]/.test(e)?N():"<"===e?k():c=10)}function b(e){'"'===e&&(c=11)}function A(e){"'"===e&&(c=11)}function S(e){Pii.test(e)?c=4:">"===e?B():"<"===e&&k()}function w(e){Pii.test(e)?c=4:"/"===e?c=12:">"===e?B():"<"===e?k():(c=4,l--)}function E(e){">"===e?(h=new lji(Gii({},h,{isClosing:!0})),B()):c=4}function T(e){"--"===t.substr(l,2)?(l+=2,h=new lji(Gii({},h,{type:"comment"})),c=14):"DOCTYPE"===t.substr(l,7).toUpperCase()?(l+=7,h=new lji(Gii({},h,{type:"doctype"})),c=20):N()}function P(e){"-"===e?c=15:">"===e?N():c=16}function M(e){"-"===e?c=18:">"===e?N():c=16}function D(e){"-"===e&&(c=17)}function I(e){c="-"===e?18:16}function O(e){">"===e?B():"!"===e?c=19:"-"===e||(c=16)}function R(e){"-"===e?c=17:">"===e?B():c=16}function L(e){">"===e?B():"<"===e&&k()}function N(){c=0,h=s}function k(){c=1,h=new lji({idx:l})}function B(){var e=t.slice(d,h.idx);e&&n(e,d),"comment"===h.type?a(h.idx):"doctype"===h.type?o(h.idx):(h.isOpening&&i(h.name,h.idx),h.isClosing&&r(h.name,h.idx)),N(),d=l+1}function F(){var e=h.idx+(h.isClosing?2:1);return t.slice(e,l).toLowerCase()}d<l&&function(){var e=t.slice(d,l);n(e,d),d=l+1}()}tmp$2.Autolinker=(yii=function(){function e(e){void 0===e&&(e={}),this.tagName="",this.attrs={},this.innerHTML="",this.whitespaceRegex=/\s+/,this.tagName=e.tagName||"",this.attrs=e.attrs||{},this.innerHTML=e.innerHtml||e.innerHTML||""}return e.prototype.setTagName=function(e){return this.tagName=e,this},e.prototype.getTagName=function(){return this.tagName||""},e.prototype.setAttr=function(e,t){var i=this.getAttrs();return i[e]=t,this},e.prototype.getAttr=function(e){return this.getAttrs()[e]},e.prototype.setAttrs=function(e){return Object.assign(this.getAttrs(),e),this},e.prototype.getAttrs=function(){return this.attrs||(this.attrs={})},e.prototype.setClass=function(e){return this.setAttr("class",e)},e.prototype.addClass=function(e){for(var t,i=this.getClass(),r=this.whitespaceRegex,n=i?i.split(r):[],a=e.split(r);t=a.shift();)-1===uii(n,t)&&n.push(t);return this.getAttrs().class=n.join(" "),this},e.prototype.removeClass=function(e){for(var t,i=this.getClass(),r=this.whitespaceRegex,n=i?i.split(r):[],a=e.split(r);n.length&&(t=a.shift());){var o=uii(n,t);-1!==o&&n.splice(o,1)}return this.getAttrs().class=n.join(" "),this},e.prototype.getClass=function(){return this.getAttrs().class||""},e.prototype.hasClass=function(e){return-1!==(" "+this.getClass()+" ").indexOf(" "+e+" ")},e.prototype.setInnerHTML=function(e){return this.innerHTML=e,this},e.prototype.setInnerHtml=function(e){return this.setInnerHTML(e)},e.prototype.getInnerHTML=function(){return this.innerHTML||""},e.prototype.getInnerHtml=function(){return this.getInnerHTML()},e.prototype.toAnchorString=function(){var e=this.getTagName(),t=this.buildAttrsStr();return["<",e,t=t?" "+t:"",">",this.getInnerHtml(),"</",e,">"].join("")},e.prototype.buildAttrsStr=function(){if(!this.attrs)return"";var e=this.getAttrs(),t=[];for(var i in e)e.hasOwnProperty(i)&&t.push(i+'="'+e[i]+'"');return t.join(" ")},e}(),Cii=function(){function e(e){void 0===e&&(e={}),this.newWindow=!1,this.truncate={},this.className="",this.newWindow=e.newWindow||!1,this.truncate=e.truncate||{},this.className=e.className||""}return e.prototype.build=function(e){return new yii({tagName:"a",attrs:this.createAttrs(e),innerHtml:this.processAnchorText(e.getAnchorText())})},e.prototype.createAttrs=function(e){var t={href:e.getAnchorHref()},i=this.createCssClass(e);return i&&(t.class=i),this.newWindow&&(t.target="_blank",t.rel="noopener noreferrer"),this.truncate&&this.truncate.length&&this.truncate.length<e.getAnchorText().length&&(t.title=e.getAnchorHref()),t},e.prototype.createCssClass=function(e){var t=this.className;if(t){for(var i=[t],r=e.getCssClassSuffixes(),n=0,a=r.length;n<a;n++)i.push(t+"-"+r[n]);return i.join(" ")}return""},e.prototype.processAnchorText=function(e){return e=this.doTruncate(e)},e.prototype.doTruncate=function(e){var t=this.truncate;if(!t||!t.length)return e;var i=t.length,r=t.location;return"smart"===r?function(e,t,o){var i,r;i=null==o?(o="…",r=3,8):(r=o.length,o.length);function n(e){var t={},i=e,r=i.match(/^([a-z]+):\/\//i);return r&&(t.scheme=r[1],i=i.substr(r[0].length)),(r=i.match(/^(.*?)(?=(\?|#|\/|$))/i))&&(t.host=r[1],i=i.substr(r[0].length)),(r=i.match(/^\/(.*?)(?=(\?|#|$))/i))&&(t.path=r[1],i=i.substr(r[0].length)),(r=i.match(/^\?(.*?)(?=(#|$))/i))&&(t.query=r[1],i=i.substr(r[0].length)),(r=i.match(/^#(.*?)$/i))&&(t.fragment=r[1]),t}function a(e){var t="";return e.scheme&&e.host&&(t+=e.scheme+"://"),e.host&&(t+=e.host),e.path&&(t+="/"+e.path),e.query&&(t+="?"+e.query),e.fragment&&(t+="#"+e.fragment),t}function s(e,t){var i=t/2,r=Math.ceil(i),n=-1*Math.floor(i),a="";return n<0&&(a=e.substr(n)),e.substr(0,r)+o+a}if(e.length<=t)return e;var l=t-r,u=n(e);if(u.query){var c=u.query.match(/^(.*?)(?=(\?|\#))(.*?)$/i);c&&(u.query=u.query.substr(0,c[1].length),e=a(u))}if(e.length<=t)return e;u.host&&(u.host=u.host.replace(/^www\./,""),e=a(u));if(e.length<=t)return e;var d="";u.host&&(d+=u.host);if(d.length>=l)return u.host.length==t?(u.host.substr(0,t-r)+o).substr(0,l+i):s(d,l).substr(0,l+i);var h="";u.path&&(h+="/"+u.path);u.query&&(h+="?"+u.query);if(h){if(l<=(d+h).length){if((d+h).length==t)return(d+h).substr(0,t);var p=l-d.length;return(d+s(h,p)).substr(0,l+i)}d+=h}if(u.fragment){var f="#"+u.fragment;if(l<=(d+f).length){if((d+f).length==t)return(d+f).substr(0,t);var m=l-d.length;return(d+s(f,m)).substr(0,l+i)}d+=f}if(u.scheme&&u.host){var g=u.scheme+"://";if((d+g).length<l)return(g+d).substr(0,t)}if(d.length<=t)return d;var y="";0<l&&(y=d.substr(-1*Math.floor(l/2)));return(d.substr(0,Math.ceil(l/2))+o+y).substr(0,l+i)}(e,i):"middle"===r?function(e,t,i){if(e.length<=t)return e;var r,n;n=null==i?(i="…",r=8,3):(r=i.length,i.length);var a=t-n,o="";0<a&&(o=e.substr(-1*Math.floor(a/2)));return(e.substr(0,Math.ceil(a/2))+i+o).substr(0,a+r)}(e,i):function(e,t,i){return tii(e,t,i)}(e,i)},e}(),Dii=function(){function e(e){this.__jsduckDummyDocProp=null,this.matchedText="",this.offset=0,this.tagBuilder=e.tagBuilder,this.matchedText=e.matchedText,this.offset=e.offset}return e.prototype.getMatchedText=function(){return this.matchedText},e.prototype.setOffset=function(e){this.offset=e},e.prototype.getOffset=function(){return this.offset},e.prototype.getCssClassSuffixes=function(){return[this.getType()]},e.prototype.buildTag=function(){return this.tagBuilder.build(this)},e}(),Eii=function(e,t){return(Eii=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},Gii=function(){return(Gii=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++)for(var n in t=arguments[i])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},Hii=function(i){function e(e){var t=i.call(this,e)||this;return t.email="",t.email=e.email,t}return Fii(e,i),e.prototype.getType=function(){return"email"},e.prototype.getEmail=function(){return this.email},e.prototype.getAnchorHref=function(){return"mailto:"+this.email},e.prototype.getAnchorText=function(){return this.email},e}(Dii),Iii=function(i){function e(e){var t=i.call(this,e)||this;return t.serviceName="",t.hashtag="",t.serviceName=e.serviceName,t.hashtag=e.hashtag,t}return Fii(e,i),e.prototype.getType=function(){return"hashtag"},e.prototype.getServiceName=function(){return this.serviceName},e.prototype.getHashtag=function(){return this.hashtag},e.prototype.getAnchorHref=function(){var e=this.serviceName,t=this.hashtag;switch(e){case"twitter":return"https://twitter.com/hashtag/"+t;case"facebook":return"https://www.facebook.com/hashtag/"+t;case"instagram":return"https://instagram.com/explore/tags/"+t;default:throw new Error("Unknown service name to point hashtag to: "+e)}},e.prototype.getAnchorText=function(){return"#"+this.hashtag},e}(Dii),Jii=function(i){function e(e){var t=i.call(this,e)||this;return t.serviceName="twitter",t.mention="",t.mention=e.mention,t.serviceName=e.serviceName,t}return Fii(e,i),e.prototype.getType=function(){return"mention"},e.prototype.getMention=function(){return this.mention},e.prototype.getServiceName=function(){return this.serviceName},e.prototype.getAnchorHref=function(){switch(this.serviceName){case"twitter":return"https://twitter.com/"+this.mention;case"instagram":return"https://instagram.com/"+this.mention;case"soundcloud":return"https://soundcloud.com/"+this.mention;default:throw new Error("Unknown service name to point mention to: "+this.serviceName)}},e.prototype.getAnchorText=function(){return"@"+this.mention},e.prototype.getCssClassSuffixes=function(){var e=i.prototype.getCssClassSuffixes.call(this),t=this.getServiceName();return t&&e.push(t),e},e}(Dii),Kii=function(i){function e(e){var t=i.call(this,e)||this;return t.number="",t.plusSign=!1,t.number=e.number,t.plusSign=e.plusSign,t}return Fii(e,i),e.prototype.getType=function(){return"phone"},e.prototype.getPhoneNumber=function(){return this.number},e.prototype.getNumber=function(){return this.getPhoneNumber()},e.prototype.getAnchorHref=function(){return"tel:"+(this.plusSign?"+":"")+this.number},e.prototype.getAnchorText=function(){return this.matchedText},e}(Dii),Lii=function(i){function e(e){var t=i.call(this,e)||this;return t.url="",t.urlMatchType="scheme",t.protocolUrlMatch=!1,t.protocolRelativeMatch=!1,t.stripPrefix={scheme:!0,www:!0},t.stripTrailingSlash=!0,t.decodePercentEncoding=!0,t.schemePrefixRegex=/^(https?:\/\/)?/i,t.wwwPrefixRegex=/^(https?:\/\/)?(www\.)?/i,t.protocolRelativeRegex=/^\/\//,t.protocolPrepended=!1,t.urlMatchType=e.urlMatchType,t.url=e.url,t.protocolUrlMatch=e.protocolUrlMatch,t.protocolRelativeMatch=e.protocolRelativeMatch,t.stripPrefix=e.stripPrefix,t.stripTrailingSlash=e.stripTrailingSlash,t.decodePercentEncoding=e.decodePercentEncoding,t}return Fii(e,i),e.prototype.getType=function(){return"url"},e.prototype.getUrlMatchType=function(){return this.urlMatchType},e.prototype.getUrl=function(){var e=this.url;return this.protocolRelativeMatch||this.protocolUrlMatch||this.protocolPrepended||(e=this.url="http://"+e,this.protocolPrepended=!0),e},e.prototype.getAnchorHref=function(){var e=this.getUrl();return e.replace(/&/g,"&")},e.prototype.getAnchorText=function(){var e=this.getMatchedText();return this.protocolRelativeMatch&&(e=this.stripProtocolRelativePrefix(e)),this.stripPrefix.scheme&&(e=this.stripSchemePrefix(e)),this.stripPrefix.www&&(e=this.stripWwwPrefix(e)),this.stripTrailingSlash&&(e=this.removeTrailingSlash(e)),this.decodePercentEncoding&&(e=this.removePercentEncoding(e)),e},e.prototype.stripSchemePrefix=function(e){return e.replace(this.schemePrefixRegex,"")},e.prototype.stripWwwPrefix=function(e){return e.replace(this.wwwPrefixRegex,"$1")},e.prototype.stripProtocolRelativePrefix=function(e){return e.replace(this.protocolRelativeRegex,"")},e.prototype.removeTrailingSlash=function(e){return"/"===e.charAt(e.length-1)&&(e=e.slice(0,-1)),e},e.prototype.removePercentEncoding=function(e){var t=e.replace(/%22/gi,""").replace(/%26/gi,"&").replace(/%27/gi,"'").replace(/%3C/gi,"<").replace(/%3E/gi,">");try{return decodeURIComponent(t)}catch(e){return t}},e}(Dii),Mii=function(e){this.__jsduckDummyDocProp=null,this.tagBuilder=e.tagBuilder},Nii=/[A-Za-z]/,Oii=/[0-9]/,Pii=/\s/,Qii=/['"]/,Rii=/[\x00-\x1F\x7F]/,Sii=/A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC/.source,Vii=Sii+/\u00a9\u00ae\u2000-\u3300\ud83c\ud000-\udfff\ud83d\ud000-\udfff\ud83e\ud000-\udfff/.source+/\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D4-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D01-\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F/.source,Wii=/0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19/.source,Xii=Vii+Wii,Yii=Vii+Wii,Zii="(?:["+Wii+"]{1,3}\\.){3}["+Wii+"]{1,3}",$ii="["+Yii+"](?:["+Yii+"\\-]{0,61}["+Yii+"])?",_ii=function(e){return"(?=("+$ii+"))\\"+e},aji=function(e){return"(?:"+_ii(e)+"(?:\\."+_ii(e+1)+"){0,126}|"+Zii+")"},bji=new RegExp("["+Yii+"]"),cji=/(?:xn--vermgensberatung-pwb|xn--vermgensberater-ctb|xn--clchc0ea0b2g2a9gcd|xn--w4r85el8fhu5dnra|northwesternmutual|travelersinsurance|vermögensberatung|xn--3oq18vl8pn36a|xn--5su34j936bgsg|xn--bck1b9a5dre4c|xn--mgbai9azgqp6j|xn--mgberp4a5d4ar|xn--xkc2dl3a5ee0h|vermögensberater|xn--fzys8d69uvgm|xn--mgba7c0bbn0a|xn--xkc2al3hye2a|americanexpress|kerryproperties|sandvikcoromant|xn--i1b6b1a6a2e|xn--kcrx77d1x4a|xn--lgbbat1ad8j|xn--mgba3a4f16a|xn--mgbaakc7dvf|xn--mgbc0a9azcg|xn--nqv7fs00ema|afamilycompany|americanfamily|bananarepublic|cancerresearch|cookingchannel|kerrylogistics|weatherchannel|xn--54b7fta0cc|xn--6qq986b3xl|xn--80aqecdr1a|xn--b4w605ferd|xn--fiq228c5hs|xn--h2breg3eve|xn--jlq61u9w7b|xn--mgba3a3ejt|xn--mgbaam7a8h|xn--mgbayh7gpa|xn--mgbb9fbpob|xn--mgbbh1a71e|xn--mgbca7dzdo|xn--mgbi4ecexp|xn--mgbx4cd0ab|xn--rvc1e0am3e|international|lifeinsurance|spreadbetting|travelchannel|wolterskluwer|xn--eckvdtc9d|xn--fpcrj9c3d|xn--fzc2c9e2c|xn--h2brj9c8c|xn--tiq49xqyj|xn--yfro4i67o|xn--ygbi2ammx|construction|lplfinancial|scholarships|versicherung|xn--3e0b707e|xn--45br5cyl|xn--80adxhks|xn--80asehdb|xn--8y0a063a|xn--gckr3f0f|xn--mgb9awbf|xn--mgbab2bd|xn--mgbgu82a|xn--mgbpl2fh|xn--mgbt3dhd|xn--mk1bu44c|xn--ngbc5azd|xn--ngbe9e0a|xn--ogbpf8fl|xn--qcka1pmc|accountants|barclaycard|blackfriday|blockbuster|bridgestone|calvinklein|contractors|creditunion|engineering|enterprises|foodnetwork|investments|kerryhotels|lamborghini|motorcycles|olayangroup|photography|playstation|productions|progressive|redumbrella|rightathome|williamhill|xn--11b4c3d|xn--1ck2e1b|xn--1qqw23a|xn--2scrj9c|xn--3bst00m|xn--3ds443g|xn--3hcrj9c|xn--42c2d9a|xn--45brj9c|xn--55qw42g|xn--6frz82g|xn--80ao21a|xn--9krt00a|xn--cck2b3b|xn--czr694b|xn--d1acj3b|xn--efvy88h|xn--estv75g|xn--fct429k|xn--fjq720a|xn--flw351e|xn--g2xx48c|xn--gecrj9c|xn--gk3at1e|xn--h2brj9c|xn--hxt814e|xn--imr513n|xn--j6w193g|xn--jvr189m|xn--kprw13d|xn--kpry57d|xn--kpu716f|xn--mgbbh1a|xn--mgbtx2b|xn--mix891f|xn--nyqy26a|xn--otu796d|xn--pbt977c|xn--pgbs0dh|xn--q9jyb4c|xn--rhqv96g|xn--rovu88b|xn--s9brj9c|xn--ses554g|xn--t60b56a|xn--vuq861b|xn--w4rs40l|xn--xhq521b|xn--zfr164b|சிங்கப்பூர்|accountant|apartments|associates|basketball|bnpparibas|boehringer|capitalone|consulting|creditcard|cuisinella|eurovision|extraspace|foundation|healthcare|immobilien|industries|management|mitsubishi|nationwide|newholland|nextdirect|onyourside|properties|protection|prudential|realestate|republican|restaurant|schaeffler|swiftcover|tatamotors|technology|telefonica|university|vistaprint|vlaanderen|volkswagen|xn--30rr7y|xn--3pxu8k|xn--45q11c|xn--4gbrim|xn--55qx5d|xn--5tzm5g|xn--80aswg|xn--90a3ac|xn--9dbq2a|xn--9et52u|xn--c2br7g|xn--cg4bki|xn--czrs0t|xn--czru2d|xn--fiq64b|xn--fiqs8s|xn--fiqz9s|xn--io0a7i|xn--kput3i|xn--mxtq1m|xn--o3cw4h|xn--pssy2u|xn--unup4y|xn--wgbh1c|xn--wgbl6a|xn--y9a3aq|accenture|alfaromeo|allfinanz|amsterdam|analytics|aquarelle|barcelona|bloomberg|christmas|community|directory|education|equipment|fairwinds|financial|firestone|fresenius|frontdoor|fujixerox|furniture|goldpoint|hisamitsu|homedepot|homegoods|homesense|honeywell|institute|insurance|kuokgroup|ladbrokes|lancaster|landrover|lifestyle|marketing|marshalls|melbourne|microsoft|panasonic|passagens|pramerica|richardli|scjohnson|shangrila|solutions|statebank|statefarm|stockholm|travelers|vacations|xn--90ais|xn--c1avg|xn--d1alf|xn--e1a4c|xn--fhbei|xn--j1aef|xn--j1amh|xn--l1acc|xn--ngbrx|xn--nqv7f|xn--p1acf|xn--tckwe|xn--vhquv|yodobashi|abudhabi|airforce|allstate|attorney|barclays|barefoot|bargains|baseball|boutique|bradesco|broadway|brussels|budapest|builders|business|capetown|catering|catholic|chrysler|cipriani|cityeats|cleaning|clinique|clothing|commbank|computer|delivery|deloitte|democrat|diamonds|discount|discover|download|engineer|ericsson|esurance|etisalat|everbank|exchange|feedback|fidelity|firmdale|football|frontier|goodyear|grainger|graphics|guardian|hdfcbank|helsinki|holdings|hospital|infiniti|ipiranga|istanbul|jpmorgan|lighting|lundbeck|marriott|maserati|mckinsey|memorial|merckmsd|mortgage|movistar|observer|partners|pharmacy|pictures|plumbing|property|redstone|reliance|saarland|samsclub|security|services|shopping|showtime|softbank|software|stcgroup|supplies|symantec|training|uconnect|vanguard|ventures|verisign|woodside|xn--90ae|xn--node|xn--p1ai|xn--qxam|yokohama|السعودية|abogado|academy|agakhan|alibaba|android|athleta|auction|audible|auspost|avianca|banamex|bauhaus|bentley|bestbuy|booking|brother|bugatti|capital|caravan|careers|cartier|channel|charity|chintai|citadel|clubmed|college|cologne|comcast|company|compare|contact|cooking|corsica|country|coupons|courses|cricket|cruises|dentist|digital|domains|exposed|express|farmers|fashion|ferrari|ferrero|finance|fishing|fitness|flights|florist|flowers|forsale|frogans|fujitsu|gallery|genting|godaddy|grocery|guitars|hamburg|hangout|hitachi|holiday|hosting|hoteles|hotmail|hyundai|iselect|ismaili|jewelry|juniper|kitchen|komatsu|lacaixa|lancome|lanxess|lasalle|latrobe|leclerc|liaison|limited|lincoln|markets|metlife|monster|netbank|netflix|network|neustar|okinawa|oldnavy|organic|origins|philips|pioneer|politie|realtor|recipes|rentals|reviews|rexroth|samsung|sandvik|schmidt|schwarz|science|shiksha|shriram|singles|staples|starhub|storage|support|surgery|systems|temasek|theater|theatre|tickets|tiffany|toshiba|trading|walmart|wanggou|watches|weather|website|wedding|whoswho|windows|winners|xfinity|yamaxun|youtube|zuerich|католик|اتصالات|الجزائر|العليان|پاکستان|كاثوليك|موبايلي|இந்தியா|abarth|abbott|abbvie|active|africa|agency|airbus|airtel|alipay|alsace|alstom|anquan|aramco|author|bayern|beauty|berlin|bharti|blanco|bostik|boston|broker|camera|career|caseih|casino|center|chanel|chrome|church|circle|claims|clinic|coffee|comsec|condos|coupon|credit|cruise|dating|datsun|dealer|degree|dental|design|direct|doctor|dunlop|dupont|durban|emerck|energy|estate|events|expert|family|flickr|futbol|gallup|garden|george|giving|global|google|gratis|health|hermes|hiphop|hockey|hotels|hughes|imamat|insure|intuit|jaguar|joburg|juegos|kaufen|kinder|kindle|kosher|lancia|latino|lawyer|lefrak|living|locker|london|luxury|madrid|maison|makeup|market|mattel|mobile|mobily|monash|mormon|moscow|museum|mutual|nagoya|natura|nissan|nissay|norton|nowruz|office|olayan|online|oracle|orange|otsuka|pfizer|photos|physio|piaget|pictet|quebec|racing|realty|reisen|repair|report|review|rocher|rogers|ryukyu|safety|sakura|sanofi|school|schule|search|secure|select|shouji|soccer|social|stream|studio|supply|suzuki|swatch|sydney|taipei|taobao|target|tattoo|tennis|tienda|tjmaxx|tkmaxx|toyota|travel|unicom|viajes|viking|villas|virgin|vision|voting|voyage|vuelos|walter|warman|webcam|xihuan|yachts|yandex|zappos|москва|онлайн|ابوظبي|ارامكو|الاردن|المغرب|امارات|فلسطين|مليسيا|भारतम्|இலங்கை|ファッション|actor|adult|aetna|amfam|amica|apple|archi|audio|autos|azure|baidu|beats|bible|bingo|black|boats|bosch|build|canon|cards|chase|cheap|cisco|citic|click|cloud|coach|codes|crown|cymru|dabur|dance|deals|delta|dodge|drive|dubai|earth|edeka|email|epost|epson|faith|fedex|final|forex|forum|gallo|games|gifts|gives|glade|glass|globo|gmail|green|gripe|group|gucci|guide|homes|honda|horse|house|hyatt|ikano|intel|irish|iveco|jetzt|koeln|kyoto|lamer|lease|legal|lexus|lilly|linde|lipsy|lixil|loans|locus|lotte|lotto|lupin|macys|mango|media|miami|money|mopar|movie|nadex|nexus|nikon|ninja|nokia|nowtv|omega|osaka|paris|parts|party|phone|photo|pizza|place|poker|praxi|press|prime|promo|quest|radio|rehab|reise|ricoh|rocks|rodeo|rugby|salon|sener|seven|sharp|shell|shoes|skype|sling|smart|smile|solar|space|sport|stada|store|study|style|sucks|swiss|tatar|tires|tirol|tmall|today|tokyo|tools|toray|total|tours|trade|trust|tunes|tushu|ubank|vegas|video|vodka|volvo|wales|watch|weber|weibo|works|world|xerox|yahoo|zippo|ایران|بازار|بھارت|سودان|سورية|همراه|भारोत|संगठन|বাংলা|భారత్|ഭാരതം|嘉里大酒店|aarp|able|adac|aero|aigo|akdn|ally|amex|arab|army|arpa|arte|asda|asia|audi|auto|baby|band|bank|bbva|beer|best|bike|bing|blog|blue|bofa|bond|book|buzz|cafe|call|camp|care|cars|casa|case|cash|cbre|cern|chat|citi|city|club|cool|coop|cyou|data|date|dclk|deal|dell|desi|diet|dish|docs|doha|duck|duns|dvag|erni|fage|fail|fans|farm|fast|fiat|fido|film|fire|fish|flir|food|ford|free|fund|game|gbiz|gent|ggee|gift|gmbh|gold|golf|goog|guge|guru|hair|haus|hdfc|help|here|hgtv|host|hsbc|icbc|ieee|imdb|immo|info|itau|java|jeep|jobs|jprs|kddi|kiwi|kpmg|kred|land|lego|lgbt|lidl|life|like|limo|link|live|loan|loft|love|ltda|luxe|maif|meet|meme|menu|mini|mint|mobi|moda|moto|name|navy|news|next|nico|nike|ollo|open|page|pars|pccw|pics|ping|pink|play|plus|pohl|porn|post|prod|prof|qpon|raid|read|reit|rent|rest|rich|rmit|room|rsvp|ruhr|safe|sale|sarl|save|saxo|scor|scot|seat|seek|sexy|shaw|shia|shop|show|silk|sina|site|skin|sncf|sohu|song|sony|spot|star|surf|talk|taxi|team|tech|teva|tiaa|tips|town|toys|tube|vana|visa|viva|vivo|vote|voto|wang|weir|wien|wiki|wine|work|xbox|yoga|zara|zero|zone|дети|сайт|بارت|بيتك|ڀارت|تونس|شبكة|عراق|عمان|موقع|भारत|ভারত|ভাৰত|ਭਾਰਤ|ભારત|ଭାରତ|ಭಾರತ|ලංකා|グーグル|クラウド|ポイント|大众汽车|组织机构|電訊盈科|香格里拉|aaa|abb|abc|aco|ads|aeg|afl|aig|anz|aol|app|art|aws|axa|bar|bbc|bbt|bcg|bcn|bet|bid|bio|biz|bms|bmw|bnl|bom|boo|bot|box|buy|bzh|cab|cal|cam|car|cat|cba|cbn|cbs|ceb|ceo|cfa|cfd|com|crs|csc|dad|day|dds|dev|dhl|diy|dnp|dog|dot|dtv|dvr|eat|eco|edu|esq|eus|fan|fit|fly|foo|fox|frl|ftr|fun|fyi|gal|gap|gdn|gea|gle|gmo|gmx|goo|gop|got|gov|hbo|hiv|hkt|hot|how|ibm|ice|icu|ifm|inc|ing|ink|int|ist|itv|jcb|jcp|jio|jll|jmp|jnj|jot|joy|kfh|kia|kim|kpn|krd|lat|law|lds|llc|lol|lpl|ltd|man|map|mba|med|men|mil|mit|mlb|mls|mma|moe|moi|mom|mov|msd|mtn|mtr|nab|nba|nec|net|new|nfl|ngo|nhk|now|nra|nrw|ntt|nyc|obi|off|one|ong|onl|ooo|org|ott|ovh|pay|pet|phd|pid|pin|pnc|pro|pru|pub|pwc|qvc|red|ren|ril|rio|rip|run|rwe|sap|sas|sbi|sbs|sca|scb|ses|sew|sex|sfr|ski|sky|soy|srl|srt|stc|tab|tax|tci|tdk|tel|thd|tjx|top|trv|tui|tvs|ubs|uno|uol|ups|vet|vig|vin|vip|wed|win|wme|wow|wtc|wtf|xin|xxx|xyz|you|yun|zip|бел|ком|қаз|мкд|мон|орг|рус|срб|укр|հայ|קום|عرب|قطر|كوم|مصر|कॉम|नेट|คอม|ไทย|ストア|セール|みんな|中文网|天主教|我爱你|新加坡|淡马锡|诺基亚|飞利浦|ac|ad|ae|af|ag|ai|al|am|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cw|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw|ελ|бг|ею|рф|გე|닷넷|닷컴|삼성|한국|コム|世界|中信|中国|中國|企业|佛山|信息|健康|八卦|公司|公益|台湾|台灣|商城|商店|商标|嘉里|在线|大拿|娱乐|家電|工行|广东|微博|慈善|手机|手表|招聘|政务|政府|新闻|时尚|書籍|机构|游戏|澳門|点看|珠宝|移动|网址|网店|网站|网络|联通|谷歌|购物|通販|集团|食品|餐厅|香港)/,dji=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.localPartCharRegex=new RegExp("["+Yii+"!#$%&'*+/=?^_`{|}~-]"),e.strictTldRegex=new RegExp("^"+cji.source+"$"),e}return Fii(e,t),e.prototype.parseMatches=function(i){for(var r=this.tagBuilder,n=this.localPartCharRegex,a=this.strictTldRegex,o=[],e=i.length,t=new eji,s={m:"a",a:"i",i:"l",l:"t",t:"o",o:":"},l=0,u=0,c=t;l<e;){var d=i.charAt(l);switch(u){case 0:h(d);break;case 1:p(i.charAt(l-1),d);break;case 2:f(d);break;case 3:m(d);break;case 4:g(d);break;case 5:y(d);break;case 6:v(d);break;case 7:_(d);break;default:xii(u)}l++}return b(),o;function h(e){"m"===e?C(1):n.test(e)&&C()}function p(e,t){":"===e?n.test(t)?(u=2,c=new eji(Gii({},c,{hasMailtoPrefix:!0}))):x():s[e]===t||(n.test(t)?u=2:"."===t?u=3:"@"===t?u=4:x())}function f(e){"."===e?u=3:"@"===e?u=4:n.test(e)||x()}function m(e){"."===e?x():"@"===e?x():n.test(e)?u=2:x()}function g(e){bji.test(e)?u=5:x()}function y(e){"."===e?u=7:"-"===e?u=6:bji.test(e)||b()}function v(e){"-"===e||"."===e?b():bji.test(e)?u=5:b()}function _(e){"."===e||"-"===e?b():bji.test(e)?(u=5,c=new eji(Gii({},c,{hasDomainDot:!0}))):b()}function C(e){void 0===e&&(e=2),u=e,c=new eji({idx:l})}function x(){u=0,c=t}function b(){if(c.hasDomainDot){var e=i.slice(c.idx,l);/[-.]$/.test(e)&&(e=e.slice(0,-1));var t=c.hasMailtoPrefix?e.slice("mailto:".length):e;!function(e){var t=(e.split(".").pop()||"").toLowerCase();return a.test(t)}(t)||o.push(new Hii({tagBuilder:r,matchedText:e,offset:c.idx,email:t}))}x()}},e}(Mii),eji=function(e){void 0===e&&(e={}),this.idx=void 0!==e.idx?e.idx:-1,this.hasMailtoPrefix=!!e.hasMailtoPrefix,this.hasDomainDot=!!e.hasDomainDot},fji=function(){function e(){}return e.isValid=function(e,t){return!(t&&!this.isValidUriScheme(t)||this.urlMatchDoesNotHaveProtocolOrDot(e,t)||this.urlMatchDoesNotHaveAtLeastOneWordChar(e,t)&&!this.isValidIpAddress(e)||this.containsMultipleDots(e))},e.isValidIpAddress=function(e){var t=new RegExp(this.hasFullProtocolRegex.source+this.ipRegex.source),i=e.match(t);return null!==i},e.containsMultipleDots=function(e){var t=e;return this.hasFullProtocolRegex.test(e)&&(t=e.split("://")[1]),-1<t.split("/")[0].indexOf("..")},e.isValidUriScheme=function(e){var t=e.match(this.uriSchemeRegex),i=t&&t[0].toLowerCase();return"javascript:"!==i&&"vbscript:"!==i},e.urlMatchDoesNotHaveProtocolOrDot=function(e,t){return!(!e||t&&this.hasFullProtocolRegex.test(t)||-1!==e.indexOf("."))},e.urlMatchDoesNotHaveAtLeastOneWordChar=function(e,t){return!(!e||!t)&&!this.hasWordCharAfterProtocolRegex.test(e)},e.hasFullProtocolRegex=/^[A-Za-z][-.+A-Za-z0-9]*:\/\//,e.uriSchemeRegex=/^[A-Za-z][-.+A-Za-z0-9]*:/,e.hasWordCharAfterProtocolRegex=new RegExp(":[^\\s]*?["+Sii+"]"),e.ipRegex=/[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?(:[0-9]*)?\/?$/,e}(),gji=function(i){function e(e){var t=i.call(this,e)||this;return t.stripPrefix={scheme:!0,www:!0},t.stripTrailingSlash=!0,t.decodePercentEncoding=!0,t.matcherRegex=function(){var e=new RegExp("[/?#](?:["+Yii+"\\-+&@#/%=~_()|'$*\\[\\]?!:,.;✓]*["+Yii+"\\-+&@#/%=~_()|'$*\\[\\]✓])?");return new RegExp(["(?:","(",/(?:[A-Za-z][-.+A-Za-z0-9]{0,63}:(?![A-Za-z][-.+A-Za-z0-9]{0,63}:\/\/)(?!\d+\/?)(?:\/\/)?)/.source,aji(2),")","|","(","(//)?",/(?:www\.)/.source,aji(6),")","|","(","(//)?",aji(10)+"\\.",cji.source,"(?![-"+Xii+"])",")",")","(?::[0-9]+)?","(?:"+e.source+")?"].join(""),"gi")}(),t.wordCharRegExp=new RegExp("["+Yii+"]"),t.stripPrefix=e.stripPrefix,t.stripTrailingSlash=e.stripTrailingSlash,t.decodePercentEncoding=e.decodePercentEncoding,t}return Fii(e,i),e.prototype.parseMatches=function(p){for(var f,e=this.matcherRegex,m=this.stripPrefix,g=this.stripTrailingSlash,y=this.decodePercentEncoding,v=this.tagBuilder,_=[],t=function(){var e=f[0],t=f[1],i=f[4],r=f[5],n=f[9],a=f.index,o=r||n,s=p.charAt(a-1);if(!fji.isValid(e,t))return"continue";if(0<a&&"@"===s)return"continue";if(0<a&&o&&C.wordCharRegExp.test(s))return"continue";if(/\?$/.test(e)&&(e=e.substr(0,e.length-1)),C.matchHasUnbalancedClosingParen(e))e=e.substr(0,e.length-1);else{var l=C.matchHasInvalidCharAfterTld(e,t);-1<l&&(e=e.substr(0,l))}var u=["http://","https://"].find(function(e){return!!t&&-1!==t.indexOf(e)});if(u){var c=e.indexOf(u);e=e.substr(c),t=t.substr(c),a+=c}var d=t?"scheme":i?"www":"tld",h=!!t;_.push(new Lii({tagBuilder:v,matchedText:e,offset:a,urlMatchType:d,url:e,protocolUrlMatch:h,protocolRelativeMatch:!!o,stripPrefix:m,stripTrailingSlash:g,decodePercentEncoding:y}))},C=this;null!==(f=e.exec(p));)t();return _},e.prototype.matchHasUnbalancedClosingParen=function(e){var t,i=e.charAt(e.length-1);if(")"===i)t="(";else{if("]"!==i)return!1;t="["}for(var r=0,n=0,a=e.length-1;n<a;n++){var o=e.charAt(n);o===t?r++:o===i&&(r=Math.max(r-1,0))}return 0===r},e.prototype.matchHasInvalidCharAfterTld=function(e,t){if(!e)return-1;var i=0;t&&(i=e.indexOf(":"),e=e.slice(i));var r=new RegExp("^((.?//)?[-."+Yii+"]*[-"+Yii+"]\\.[-"+Yii+"]+)"),n=r.exec(e);return null===n?-1:(i+=n[1].length,e=e.slice(n[1].length),/^[^-.A-Za-z0-9:\/?#]/.test(e)?i:-1)},e}(Mii),hji=function(i){function e(e){var t=i.call(this,e)||this;return t.serviceName="twitter",t.matcherRegex=new RegExp("#[_"+Yii+"]{1,139}(?![_"+Yii+"])","g"),t.nonWordCharRegex=new RegExp("[^"+Yii+"]"),t.serviceName=e.serviceName,t}return Fii(e,i),e.prototype.parseMatches=function(e){for(var t,i=this.matcherRegex,r=this.nonWordCharRegex,n=this.serviceName,a=this.tagBuilder,o=[];null!==(t=i.exec(e));){var s=t.index,l=e.charAt(s-1);if(0===s||r.test(l)){var u=t[0],c=t[0].slice(1);o.push(new Iii({tagBuilder:a,matchedText:u,offset:s,serviceName:n,hashtag:c}))}}return o},e}(Mii),iji=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.matcherRegex=/(?:(?:(?:(\+)?\d{1,3}[-\040.]?)?\(?\d{3}\)?[-\040.]?\d{3}[-\040.]?\d{4})|(?:(\+)(?:9[976]\d|8[987530]\d|6[987]\d|5[90]\d|42\d|3[875]\d|2[98654321]\d|9[8543210]|8[6421]|6[6543210]|5[87654321]|4[987654310]|3[9643210]|2[70]|7|1)[-\040.]?(?:\d[-\040.]?){6,12}\d+))([,;]+[0-9]+#?)*/g,e}return Fii(e,t),e.prototype.parseMatches=function(e){for(var t,i=this.matcherRegex,r=this.tagBuilder,n=[];null!==(t=i.exec(e));){var a=t[0],o=a.replace(/[^0-9,;#]/g,""),s=!(!t[1]&&!t[2]),l=0==t.index?"":e.substr(t.index-1,1),u=e.substr(t.index+a.length,1),c=!l.match(/\d/)&&!u.match(/\d/);this.testMatch(t[3])&&this.testMatch(a)&&c&&n.push(new Kii({tagBuilder:r,matchedText:a,offset:t.index,number:o,plusSign:s}))}return n},e.prototype.testMatch=function(e){return/\D/.test(e)},e}(Mii),jji=function(i){function e(e){var t=i.call(this,e)||this;return t.serviceName="twitter",t.matcherRegexes={twitter:new RegExp("@[_"+Yii+"]{1,50}(?![_"+Yii+"])","g"),instagram:new RegExp("@[_."+Yii+"]{1,30}(?![_"+Yii+"])","g"),soundcloud:new RegExp("@[-_."+Yii+"]{1,50}(?![-_"+Yii+"])","g")},t.nonWordCharRegex=new RegExp("[^"+Yii+"]"),t.serviceName=e.serviceName,t}return Fii(e,i),e.prototype.parseMatches=function(e){var t,i=this.serviceName,r=this.matcherRegexes[this.serviceName],n=this.nonWordCharRegex,a=this.tagBuilder,o=[];if(!r)return o;for(;null!==(t=r.exec(e));){var s=t.index,l=e.charAt(s-1);if(0===s||n.test(l)){var u=t[0].replace(/\.+$/g,""),c=u.slice(1);o.push(new Jii({tagBuilder:a,matchedText:u,offset:s,serviceName:i,mention:c}))}}return o},e}(Mii),lji=function(e){void 0===e&&(e={}),this.idx=void 0!==e.idx?e.idx:-1,this.type=e.type||"tag",this.name=e.name||"",this.isOpening=!!e.isOpening,this.isClosing=!!e.isClosing},function(){function r(e){void 0===e&&(e={}),this.version=r.version,this.urls={},this.email=!0,this.phone=!0,this.hashtag=!1,this.mention=!1,this.newWindow=!0,this.stripPrefix={scheme:!0,www:!0},this.stripTrailingSlash=!0,this.decodePercentEncoding=!0,this.truncate={length:0,location:"end"},this.className="",this.replaceFn=null,this.context=void 0,this.matchers=null,this.tagBuilder=null,this.urls=this.normalizeUrlsCfg(e.urls),this.email="boolean"==typeof e.email?e.email:this.email,this.phone="boolean"==typeof e.phone?e.phone:this.phone,this.hashtag=e.hashtag||this.hashtag,this.mention=e.mention||this.mention,this.newWindow="boolean"==typeof e.newWindow?e.newWindow:this.newWindow,this.stripPrefix=this.normalizeStripPrefixCfg(e.stripPrefix),this.stripTrailingSlash="boolean"==typeof e.stripTrailingSlash?e.stripTrailingSlash:this.stripTrailingSlash,this.decodePercentEncoding="boolean"==typeof e.decodePercentEncoding?e.decodePercentEncoding:this.decodePercentEncoding;var t=this.mention;if(!1!==t&&"twitter"!==t&&"instagram"!==t&&"soundcloud"!==t)throw new Error("invalid `mention` cfg - see docs");var i=this.hashtag;if(!1!==i&&"twitter"!==i&&"facebook"!==i&&"instagram"!==i)throw new Error("invalid `hashtag` cfg - see docs");this.truncate=this.normalizeTruncateCfg(e.truncate),this.className=e.className||this.className,this.replaceFn=e.replaceFn||this.replaceFn,this.context=e.context||this}return r.link=function(e,t){var i=new r(t);return i.link(e)},r.parse=function(e,t){var i=new r(t);return i.parse(e)},r.prototype.normalizeUrlsCfg=function(e){return null==e&&(e=!0),"boolean"==typeof e?{schemeMatches:e,wwwMatches:e,tldMatches:e}:{schemeMatches:"boolean"!=typeof e.schemeMatches||e.schemeMatches,wwwMatches:"boolean"!=typeof e.wwwMatches||e.wwwMatches,tldMatches:"boolean"!=typeof e.tldMatches||e.tldMatches}},r.prototype.normalizeStripPrefixCfg=function(e){return null==e&&(e=!0),"boolean"==typeof e?{scheme:e,www:e}:{scheme:"boolean"!=typeof e.scheme||e.scheme,www:"boolean"!=typeof e.www||e.www}},r.prototype.normalizeTruncateCfg=function(e){return"number"==typeof e?{length:e,location:"end"}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&void 0===e[i]&&(e[i]=t[i]);return e}(e||{},{length:Number.POSITIVE_INFINITY,location:"end"})},r.prototype.parse=function(e){var n=this,t=["a","style","script"],a=0,o=[];return kji(e,{onOpenTag:function(e){0<=t.indexOf(e)&&a++},onText:function(e,t){if(0===a){var i=function(e,t){if(!t.global)throw new Error("`splitRegex` must have the 'g' flag set");for(var i,r=[],n=0;i=t.exec(e);)r.push(e.substring(n,i.index)),r.push(i[0]),n=i.index+i[0].length;return r.push(e.substring(n)),r}(e,/( | |<|<|>|>|"|"|')/gi),r=t;i.forEach(function(e,t){if(t%2==0){var i=n.parseText(e,r);o.push.apply(o,i)}r+=e.length})}},onCloseTag:function(e){0<=t.indexOf(e)&&(a=Math.max(a-1,0))},onComment:function(e){},onDoctype:function(e){}}),o=this.compactMatches(o),o=this.removeUnwantedMatches(o)},r.prototype.compactMatches=function(e){e.sort(function(e,t){return e.getOffset()-t.getOffset()});for(var t=0;t<e.length-1;t++){var i=e[t],r=i.getOffset(),n=i.getMatchedText().length,a=r+n;if(t+1<e.length){if(e[t+1].getOffset()===r){var o=e[t+1].getMatchedText().length>n?t:t+1;e.splice(o,1);continue}e[t+1].getOffset()<a&&e.splice(t+1,1)}}return e},r.prototype.removeUnwantedMatches=function(e){return this.hashtag||vii(e,function(e){return"hashtag"===e.getType()}),this.email||vii(e,function(e){return"email"===e.getType()}),this.phone||vii(e,function(e){return"phone"===e.getType()}),this.mention||vii(e,function(e){return"mention"===e.getType()}),this.urls.schemeMatches||vii(e,function(e){return"url"===e.getType()&&"scheme"===e.getUrlMatchType()}),this.urls.wwwMatches||vii(e,function(e){return"url"===e.getType()&&"www"===e.getUrlMatchType()}),this.urls.tldMatches||vii(e,function(e){return"url"===e.getType()&&"tld"===e.getUrlMatchType()}),e},r.prototype.parseText=function(e,t){void 0===t&&(t=0),t=t||0;for(var i=this.getMatchers(),r=[],n=0,a=i.length;n<a;n++){for(var o=i[n].parseMatches(e),s=0,l=o.length;s<l;s++)o[s].setOffset(t+o[s].getOffset());r.push.apply(r,o)}return r},r.prototype.link=function(e){if(!e)return"";for(var t=this.parse(e),i=[],r=0,n=0,a=t.length;n<a;n++){var o=t[n];i.push(e.substring(r,o.getOffset())),i.push(this.createMatchReturnVal(o)),r=o.getOffset()+o.getMatchedText().length}return i.push(e.substring(r)),i.join("")},r.prototype.createMatchReturnVal=function(e){var t;if(this.replaceFn&&(t=this.replaceFn.call(this.context,e)),"string"==typeof t)return t;if(!1===t)return e.getMatchedText();if(t instanceof yii)return t.toAnchorString();var i=e.buildTag();return i.toAnchorString()},r.prototype.getMatchers=function(){if(this.matchers)return this.matchers;var e=this.getTagBuilder(),t=[new hji({tagBuilder:e,serviceName:this.hashtag}),new dji({tagBuilder:e}),new iji({tagBuilder:e}),new jji({tagBuilder:e,serviceName:this.mention}),new gji({tagBuilder:e,stripPrefix:this.stripPrefix,stripTrailingSlash:this.stripTrailingSlash,decodePercentEncoding:this.decodePercentEncoding})];return this.matchers=t},r.prototype.getTagBuilder=function(){var e=this.tagBuilder;return e=e||(this.tagBuilder=new Cii({newWindow:this.newWindow,truncate:this.truncate,className:this.className}))},r.version="3.11.0",r.AnchorTagBuilder=Cii,r.HtmlTag=yii,r.matcher={Email:dji,Hashtag:hji,Matcher:Mii,Mention:jji,Phone:iji,Url:gji},r.match={Email:Hii,Hashtag:Iii,Match:Dii,Mention:Jii,Phone:Kii,Url:Lii},r}());var Autolinker=tmp$2.Autolinker,tmp$3={};!function(C){var a,e,f="File format is not recognized.",o="File contains encrypted entry.",s="File is using Zip64 (4gb+ file size).",d="Error while reading zip file.",t="Error while reading file data.",g=524288,m="inflate.js",x="deflate.js",l="text/plain",b="message";try{a=0===new Blob([new DataView(new ArrayBuffer(0))]).size}catch(e){}function A(){var r=-1,n=this;n.append=function(e){var t,i=n.table;for(t=0;t<e.length;t++)r=r>>>8^i[255&(r^e[t])]},n.get=function(){return~r}}function S(e,t){var i,r;return i=new ArrayBuffer(e),r=new Uint8Array(i),t&&r.set(t,0),{buffer:i,array:r,view:new DataView(i)}}function i(){}function r(r){var n,a=this;a.size=0,a.init=function(e,t){var i=new Blob([r],{type:l});(n=new u(i)).init(function(){a.size=n.size,e()},t)},a.readUint8Array=function(e,t,i,r){n.readUint8Array(e,t,i,r)}}function n(u){var c,i=this;i.size=0,i.init=function(e){for(var t=u.length;"="==u.charAt(t-1);)t--;c=u.indexOf(",")+1,i.size=Math.floor(.75*(t-c)),e()},i.readUint8Array=function(e,t,i){var r,n=S(t),a=4*Math.floor(e/3),o=4*Math.ceil((e+t)/3),s=window.atob(u.substring(a+c,o+c)),l=e-3*Math.floor(a/4);for(r=l;r<l+t;r++)n.array[r-l]=s.charCodeAt(r);i(n.array)}}function u(a){this.size=0,this.init=function(e){this.size=a.size,e()},this.readUint8Array=function(e,t,i,r){var n=new FileReader;n.onload=function(e){i(new Uint8Array(e.target.result))},n.onerror=r,n.readAsArrayBuffer(function(e,t,i){return e.slice?e.slice(t,t+i):e.webkitSlice?e.webkitSlice(t,t+i):e.mozSlice?e.mozSlice(t,t+i):e.msSlice?e.msSlice(t,t+i):void 0}(a,e,t))}}function c(){}function h(r){var n;this.init=function(e){n=new Blob([],{type:l}),e()},this.writeUint8Array=function(e,t){n=new Blob([n,a?e:e.buffer],{type:l}),t()},this.getData=function(t,e){var i=new FileReader;i.onload=function(e){t(e.target.result)},i.onerror=e,i.readAsText(n,r)}}function p(t){var a="",o="";this.init=function(e){a+="data:"+(t||"")+";base64,",e()},this.writeUint8Array=function(e,t){var i,r=o.length,n=o;for(o="",i=0;i<3*Math.floor((r+e.length)/3)-r;i++)n+=String.fromCharCode(e[i]);for(;i<e.length;i++)o+=String.fromCharCode(e[i]);2<n.length?a+=window.btoa(n):o=n,t()},this.getData=function(e){e(a+window.btoa(o))}}function y(i){var r;this.init=function(e){r=new Blob([],{type:i}),e()},this.writeUint8Array=function(e,t){r=new Blob([r,a?e:e.buffer],{type:i}),t()},this.getData=function(e){e(r)}}function w(t,e,r,i,n,a,o,s,l,u){var c,d,h=0;function p(){t.removeEventListener(b,f,!1),s(d)}function f(e){var t=e.data,i=t.data;t.onappend&&(d+=i.length,r.writeUint8Array(i,function(){a(!1,i),m()},u)),t.onflush&&(i?(d+=i.length,r.writeUint8Array(i,function(){a(!1,i),p()},u)):p()),t.progress&&o&&o(c+t.current,n)}function m(){(c=h*g)<n?e.readUint8Array(i+c,Math.min(g,n-c),function(e){t.postMessage({append:!0,data:e}),h++,o&&o(c,n),a(!0,e)},l):t.postMessage({flush:!0})}d=0,t.addEventListener(b,f,!1),m()}function E(r,t,n,a,o,s,l,u,c,d){var h,p=0,f=0;!function i(){var e;(h=p*g)<o?t.readUint8Array(a+h,Math.min(g,o-h),function(e){var t=r.append(e,function(){l&&l(a+h,o)});f+=t.length,s(!0,e),n.writeUint8Array(t,function(){s(!1,t),p++,setTimeout(i,1)},d),l&&l(h,o)},c):(e=r.flush())?(f+=e.length,n.writeUint8Array(e,function(){s(!1,e),u(f)},d)):u(f)}()}function T(e,r,n,a,o,s,l,u,c){var d=0,h=new A;!function t(){var i=d*g;i<a?e.readUint8Array(n+i,Math.min(g,a-i),function(e){o&&h.append(e),l&&l(i,a,e),r.writeUint8Array(e,function(){d++,t()},c)},u):s(a,h.get())}()}function v(e){var t,i,r="",n=["Ç","ü","é","â","ä","à","å","ç","ê","ë","è","ï","î","ì","Ä","Å","É","æ","Æ","ô","ö","ò","û","ù","ÿ","Ö","Ü","ø","£","Ø","×","ƒ","á","í","ó","ú","ñ","Ñ","ª","º","¿","®","¬","½","¼","¡","«","»","_","_","_","¦","¦","Á","Â","À","©","¦","¦","+","+","¢","¥","+","+","-","-","+","-","+","ã","Ã","+","+","-","-","¦","-","+","¤","ð","Ð","Ê","Ë","È","i","Í","Î","Ï","+","+","_","_","¦","Ì","_","Ó","ß","Ô","Ò","õ","Õ","µ","þ","Þ","Ú","Û","Ù","ý","Ý","¯","´","­","±","_","¾","¶","§","÷","¸","°","¨","·","¹","³","²","_"," "];for(t=0;t<e.length;t++)r+=127<(i=255&e.charCodeAt(t))?n[i-128]:String.fromCharCode(i);return r}function _(e){return decodeURIComponent(escape(e))}function P(e){var t,i="";for(t=0;t<e.length;t++)i+=String.fromCharCode(e[t]);return i}function M(e,t,i,r,n){e.version=t.view.getUint16(i,!0),e.bitFlag=t.view.getUint16(i+2,!0),e.compressionMethod=t.view.getUint16(i+4,!0),e.lastModDateRaw=t.view.getUint32(i+6,!0),e.lastModDate=function(e){var t=(4294901760&e)>>16,i=65535&e;try{return new Date(1980+((65024&t)>>9),((480&t)>>5)-1,31&t,(63488&i)>>11,(2016&i)>>5,2*(31&i),0)}catch(e){}}(e.lastModDateRaw),1!=(1&e.bitFlag)?(!r&&8==(8&e.bitFlag)||(e.crc32=t.view.getUint32(i+10,!0),e.compressedSize=t.view.getUint32(i+14,!0),e.uncompressedSize=t.view.getUint32(i+18,!0)),4294967295!==e.compressedSize&&4294967295!==e.uncompressedSize?(e.filenameLength=t.view.getUint16(i+22,!0),e.extraFieldLength=t.view.getUint16(i+24,!0)):n(s)):n(o)}function D(h,p){function c(){}return c.prototype.getData=function(r,i,n,a){var o,s=this;function l(e,t){o&&o.terminate(),o=null,e&&e(t)}function u(e,t){a&&!function(e){var t=S(4);return t.view.setUint32(0,e),s.crc32==t.view.getUint32(0)}(t)?c():r.getData(function(e){l(i,e)})}function c(){l(p,t)}function d(){l(p,"Error while writing file data.")}h.readUint8Array(s.offset,30,function(e){var t,i=S(e.length,e);1347093252==i.view.getUint32(0)?(M(s,i,4,!1,p),t=s.offset+30+s.filenameLength+s.extraFieldLength,r.init(function(){0===s.compressionMethod?T(h,r,t,s.compressedSize,a,u,n,c,d):o=function(e,t,i,r,n,a,o,s,l){var u,c=new A;function d(e,t){n&&!e&&c.append(t)}function h(e){a(e,c.get())}return C.zip.useWebWorkers?w(u=new Worker(C.zip.workerScriptsPath+m),e,t,i,r,d,o,h,s,l):E(new C.zip.Inflater,e,t,i,r,d,o,h,s,l),u}(h,r,t,s.compressedSize,a,u,n,c,d)},d)):p(f)},c)},{getEntries:function(u){h.size<22?p(f):function i(r,n){h.readUint8Array(h.size-r,r,function(e){var t=S(e.length,e).view;1347093766!=t.getUint32(0)?i(r+1,n):n(t)},function(){p(d)})}(22,function(e){var t,l;t=e.getUint32(16,!0),l=e.getUint16(8,!0),h.readUint8Array(t,h.size-t,function(e){var t,i,r,n,a=0,o=[],s=S(e.length,e);for(t=0;t<l;t++){if(i=new c,1347092738!=s.view.getUint32(a))return void p(f);M(i,s,a+6,!0,p),i.commentLength=s.view.getUint16(a+32,!0),i.directory=16==(16&s.view.getUint8(a+38)),i.offset=s.view.getUint32(a+42,!0),r=P(s.array.subarray(a+46,a+46+i.filenameLength)),i.filename=2048==(2048&i.bitFlag)?_(r):v(r),i.directory||"/"!=i.filename.charAt(i.filename.length-1)||(i.directory=!0),n=P(s.array.subarray(a+46+i.filenameLength+i.extraFieldLength,a+46+i.filenameLength+i.extraFieldLength+i.commentLength)),i.comment=2048==(2048&i.bitFlag)?_(n):v(n),o.push(i),a+=46+i.filenameLength+i.extraFieldLength+i.commentLength}u(o)},function(){p(d)})})},close:function(e){e&&e()}}}function I(e){return unescape(encodeURIComponent(e))}function O(e){var t,i=[];for(t=0;t<e.length;t++)i.push(e.charCodeAt(t));return i}function R(c,d,h){var p,f={},m=[],g=0;function y(e,t){p&&p.terminate(),p=null,e&&e(t)}function v(){y(d,"Error while writing zip file.")}function _(){y(d,t)}return{add:function(i,r,n,e,a){var o,s,l;function t(e,t){var i=S(16);g+=e||0,i.view.setUint32(0,1347094280),void 0!==t&&(o.view.setUint32(10,t,!0),i.view.setUint32(4,t,!0)),r&&(i.view.setUint32(8,e,!0),o.view.setUint32(14,e,!0),i.view.setUint32(12,r.size,!0),o.view.setUint32(18,r.size,!0)),c.writeUint8Array(i.array,function(){g+=16,y(n)},v)}function u(){a=a||{},i=i.trim(),a.directory&&"/"!=i.charAt(i.length-1)&&(i+="/"),f.hasOwnProperty(i)?d("File already exists."):(s=O(I(i)),m.push(i),function(e){var t;l=a.lastModDate||new Date,o=S(26),f[i]={headerArray:o.array,directory:a.directory,filename:s,offset:g,comment:O(I(a.comment||""))},o.view.setUint32(0,335546376),a.version&&o.view.setUint8(0,a.version),h||0===a.level||a.directory||o.view.setUint16(4,2048),o.view.setUint16(6,(l.getHours()<<6|l.getMinutes())<<5|l.getSeconds()/2,!0),o.view.setUint16(8,(l.getFullYear()-1980<<4|l.getMonth()+1)<<5|l.getDate(),!0),o.view.setUint16(22,s.length,!0),(t=S(30+s.length)).view.setUint32(0,1347093252),t.array.set(o.array,4),t.array.set(s,30),g+=t.array.length,c.writeUint8Array(t.array,e,v)}(function(){r?h||0===a.level?T(r,c,0,r.size,!0,t,e,_,v):p=function(t,i,e,r,n,a,o){var s,l=new A;function u(e,t){e&&l.append(t)}function c(e){r(e,l.get())}return C.zip.useWebWorkers?((s=new Worker(C.zip.workerScriptsPath+x)).addEventListener(b,function e(){s.removeEventListener(b,e,!1),w(s,t,i,0,t.size,u,n,c,a,o)},!1),s.postMessage({init:!0,level:e})):E(new C.zip.Deflater,t,i,0,t.size,u,n,c,a,o),s}(r,c,a.level,t,e,_,v):t()}))}r?r.init(u,_):u()},close:function(e){var t,i,r,n=0,a=0;for(i=0;i<m.length;i++)n+=46+(r=f[m[i]]).filename.length+r.comment.length;for(t=S(n+22),i=0;i<m.length;i++)r=f[m[i]],t.view.setUint32(a,1347092738),t.view.setUint16(a+4,5120),t.array.set(r.headerArray,a+6),t.view.setUint16(a+32,r.comment.length,!0),r.directory&&t.view.setUint8(a+38,16),t.view.setUint32(a+42,r.offset,!0),t.array.set(r.filename,a+46),t.array.set(r.comment,a+46+r.filename.length),a+=46+r.filename.length+r.comment.length;t.view.setUint32(a,1347093766),t.view.setUint16(a+8,m.length,!0),t.view.setUint16(a+10,m.length,!0),t.view.setUint32(a+12,n,!0),t.view.setUint32(a+16,g,!0),c.writeUint8Array(t.array,function(){y(function(){c.getData(e)})},v)}}}A.prototype.table=function(){var e,t,i,r=[];for(e=0;e<256;e++){for(i=e,t=0;t<8;t++)1&i?i=i>>>1^3988292384:i>>>=1;r[e]=i}return r}(),(r.prototype=new i).constructor=r,(n.prototype=new i).constructor=n,(u.prototype=new i).constructor=u,c.prototype.getData=function(e){e(this.data)},(h.prototype=new c).constructor=h,(p.prototype=new c).constructor=p,(y.prototype=new c).constructor=y,C.zip={Reader:i,Writer:c,BlobReader:u,Data64URIReader:n,TextReader:r,BlobWriter:y,Data64URIWriter:p,TextWriter:h,createReader:function(e,t,i){e.init(function(){t(D(e,i))},i)},createWriter:function(e,t,i,r){e.init(function(){t(R(e,i,r))},i)},useWebWorkers:!0},Object.defineProperties(C.zip,{workerScriptsPath:{get:function(){return void 0===e&&(e=buildModuleUrl("ThirdParty/Workers/")),e}}})}(tmp$3);var zip=tmp$3.zip;function EventHelper(){this._removalFunctions=[]}function subscribeAll(e,t,i,r){function n(){i.raiseEvent(e)}var a=[];t.removeAll();for(var o=r.length,s=0;s<o;s++){var l=r.get(s);defined(l.data)&&-1===a.indexOf(l.data)&&t.add(l.data.definitionChanged,n)}}function CompositeProperty(){this._eventHelper=new EventHelper,this._definitionChanged=new Event,this._intervals=new TimeIntervalCollection,this._intervals.changedEvent.addEventListener(CompositeProperty.prototype._intervalsChanged,this)}function CompositePositionProperty(e){this._referenceFrame=defaultValue(e,ReferenceFrame$1.FIXED),this._definitionChanged=new Event,this._composite=new CompositeProperty,this._composite.definitionChanged.addEventListener(CompositePositionProperty.prototype._raiseDefinitionChanged,this)}function Clock(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).currentTime,i=e.startTime,r=e.stopTime;t=defined(t)?JulianDate.clone(t):defined(i)?JulianDate.clone(i):defined(r)?JulianDate.addDays(r,-1,new JulianDate):JulianDate.now(),i=defined(i)?JulianDate.clone(i):JulianDate.clone(t),r=defined(r)?JulianDate.clone(r):JulianDate.addDays(i,1,new JulianDate),this.startTime=i,this.stopTime=r,this.clockRange=defaultValue(e.clockRange,ClockRange$1.UNBOUNDED),this.canAnimate=defaultValue(e.canAnimate,!0),this.onTick=new Event,this.onStop=new Event,this._currentTime=void 0,this._multiplier=void 0,this._clockStep=void 0,this._shouldAnimate=void 0,this._lastSystemTime=getTimestamp$1(),this.currentTime=t,this.multiplier=defaultValue(e.multiplier,1),this.shouldAnimate=defaultValue(e.shouldAnimate,!1),this.clockStep=defaultValue(e.clockStep,ClockStep$1.SYSTEM_CLOCK_MULTIPLIER)}function DataSourceClock(){this._definitionChanged=new Event,this._startTime=void 0,this._stopTime=void 0,this._currentTime=void 0,this._clockRange=void 0,this._clockStep=void 0,this._multiplier=void 0}function KmlCamera(e,t){this.position=e,this.headingPitchRoll=t}function KmlLookAt(e,t){this.position=e,this.headingPitchRange=t}function KmlTour(e,t){this.id=t,this.name=e,this.playlistIndex=0,this.playlist=[],this.tourStart=new Event,this.tourEnd=new Event,this.entryStart=new Event,this.entryEnd=new Event,this._activeEntries=[]}function cancelAllEntries(e){for(var t=e.pop();void 0!==t;t=e.pop())t.stop()}function playEntry(e,t,i){var r=this.playlist[this.playlistIndex];if(r){var n=playNext.bind(this,e,t,i);if(this._activeEntries.push(r),this.entryStart.raiseEvent(r),r.blocking)r.play(n,e.scene.camera,t);else{var a=this;r.play(function(){a.entryEnd.raiseEvent(r);var e=a._activeEntries.indexOf(r);0<=e&&a._activeEntries.splice(e,1)}),n(e,t,i)}}else defined(i)&&i(!1)}function playNext(e,t,i,r){var n=this.playlist[this.playlistIndex];if(this.entryEnd.raiseEvent(n,r),r)i(r);else{var a=this._activeEntries.indexOf(n);0<=a&&this._activeEntries.splice(a,1),this.playlistIndex++,playEntry.call(this,e,t,i)}}EventHelper.prototype.add=function(e,t,i){var r=e.addEventListener(t,i);this._removalFunctions.push(r);var n=this;return function(){r();var e=n._removalFunctions;e.splice(e.indexOf(r),1)}},EventHelper.prototype.removeAll=function(){for(var e=this._removalFunctions,t=0,i=e.length;t<i;++t)e[t]();e.length=0},Object.defineProperties(CompositeProperty.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}}),CompositeProperty.prototype.getValue=function(e,t){var i=this._intervals.findDataForIntervalContainingDate(e);if(defined(i))return i.getValue(e,t)},CompositeProperty.prototype.equals=function(e){return this===e||e instanceof CompositeProperty&&this._intervals.equals(e._intervals,Property.equals)},CompositeProperty.prototype._intervalsChanged=function(){subscribeAll(this,this._eventHelper,this._definitionChanged,this._intervals),this._definitionChanged.raiseEvent(this)},Object.defineProperties(CompositePositionProperty.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite.intervals}},referenceFrame:{get:function(){return this._referenceFrame},set:function(e){this._referenceFrame=e}}}),CompositePositionProperty.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,ReferenceFrame$1.FIXED,t)},CompositePositionProperty.prototype.getValueInReferenceFrame=function(e,t,i){var r=this._composite._intervals.findDataForIntervalContainingDate(e);if(defined(r))return r.getValueInReferenceFrame(e,t,i)},CompositePositionProperty.prototype.equals=function(e){return this===e||e instanceof CompositePositionProperty&&this._referenceFrame===e._referenceFrame&&this._composite.equals(e._composite,Property.equals)},CompositePositionProperty.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)},Object.defineProperties(Clock.prototype,{currentTime:{get:function(){return this._currentTime},set:function(e){JulianDate.equals(this._currentTime,e)||(this._clockStep===ClockStep$1.SYSTEM_CLOCK&&(this._clockStep=ClockStep$1.SYSTEM_CLOCK_MULTIPLIER),this._currentTime=e)}},multiplier:{get:function(){return this._multiplier},set:function(e){this._multiplier!==e&&(this._clockStep===ClockStep$1.SYSTEM_CLOCK&&(this._clockStep=ClockStep$1.SYSTEM_CLOCK_MULTIPLIER),this._multiplier=e)}},clockStep:{get:function(){return this._clockStep},set:function(e){e===ClockStep$1.SYSTEM_CLOCK&&(this._multiplier=1,this._shouldAnimate=!0,this._currentTime=JulianDate.now()),this._clockStep=e}},shouldAnimate:{get:function(){return this._shouldAnimate},set:function(e){this._shouldAnimate!==e&&(this._clockStep===ClockStep$1.SYSTEM_CLOCK&&(this._clockStep=ClockStep$1.SYSTEM_CLOCK_MULTIPLIER),this._shouldAnimate=e)}}}),Clock.prototype.tick=function(){var e=getTimestamp$1(),t=JulianDate.clone(this._currentTime);if(this.canAnimate&&this._shouldAnimate){var i=this._clockStep;if(i===ClockStep$1.SYSTEM_CLOCK)t=JulianDate.now(t);else{var r=this._multiplier;if(i===ClockStep$1.TICK_DEPENDENT)t=JulianDate.addSeconds(t,r,t);else{var n=e-this._lastSystemTime;t=JulianDate.addSeconds(t,r*(n/1e3),t)}var a=this.clockRange,o=this.startTime,s=this.stopTime;if(a===ClockRange$1.CLAMPED)JulianDate.lessThan(t,o)?t=JulianDate.clone(o,t):JulianDate.greaterThan(t,s)&&(t=JulianDate.clone(s,t),this.onStop.raiseEvent(this));else if(a===ClockRange$1.LOOP_STOP)for(JulianDate.lessThan(t,o)&&(t=JulianDate.clone(o,t));JulianDate.greaterThan(t,s);)t=JulianDate.addSeconds(o,JulianDate.secondsDifference(t,s),t),this.onStop.raiseEvent(this)}}return this._currentTime=t,this._lastSystemTime=e,this.onTick.raiseEvent(this),t},Object.defineProperties(DataSourceClock.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},startTime:createRawPropertyDescriptor("startTime"),stopTime:createRawPropertyDescriptor("stopTime"),currentTime:createRawPropertyDescriptor("currentTime"),clockRange:createRawPropertyDescriptor("clockRange"),clockStep:createRawPropertyDescriptor("clockStep"),multiplier:createRawPropertyDescriptor("multiplier")}),DataSourceClock.prototype.clone=function(e){return defined(e)||(e=new DataSourceClock),e.startTime=this.startTime,e.stopTime=this.stopTime,e.currentTime=this.currentTime,e.clockRange=this.clockRange,e.clockStep=this.clockStep,e.multiplier=this.multiplier,e},DataSourceClock.prototype.equals=function(e){return this===e||defined(e)&&JulianDate.equals(this.startTime,e.startTime)&&JulianDate.equals(this.stopTime,e.stopTime)&&JulianDate.equals(this.currentTime,e.currentTime)&&this.clockRange===e.clockRange&&this.clockStep===e.clockStep&&this.multiplier===e.multiplier},DataSourceClock.prototype.merge=function(e){this.startTime=defaultValue(this.startTime,e.startTime),this.stopTime=defaultValue(this.stopTime,e.stopTime),this.currentTime=defaultValue(this.currentTime,e.currentTime),this.clockRange=defaultValue(this.clockRange,e.clockRange),this.clockStep=defaultValue(this.clockStep,e.clockStep),this.multiplier=defaultValue(this.multiplier,e.multiplier)},DataSourceClock.prototype.getValue=function(e){return defined(e)||(e=new Clock),e.startTime=defaultValue(this.startTime,e.startTime),e.stopTime=defaultValue(this.stopTime,e.stopTime),e.currentTime=defaultValue(this.currentTime,e.currentTime),e.clockRange=defaultValue(this.clockRange,e.clockRange),e.multiplier=defaultValue(this.multiplier,e.multiplier),e.clockStep=defaultValue(this.clockStep,e.clockStep),e},KmlTour.prototype.addPlaylistEntry=function(e){this.playlist.push(e)},KmlTour.prototype.play=function(e,t){this.tourStart.raiseEvent();var i=this;playEntry.call(this,e,t,function(e){i.playlistIndex=0,e||cancelAllEntries(i._activeEntries),i.tourEnd.raiseEvent(e)})},KmlTour.prototype.stop=function(){cancelAllEntries(this._activeEntries)},void 0===Date.now&&(Date.now=function(){return(new Date).valueOf()});var TWEEN=TWEEN||(Yyi=[],{REVISION:"13",getAll:function(){return Yyi},removeAll:function(){Yyi=[]},add:function(e){Yyi.push(e)},remove:function(e){var t=Yyi.indexOf(e);-1!==t&&Yyi.splice(t,1)},update:function(e){if(0===Yyi.length)return!1;var t=0;for(e=void 0!==e?e:"undefined"!=typeof window&&void 0!==window.performance&&void 0!==window.performance.now?window.performance.now():Date.now();t<Yyi.length;)Yyi[t].update(e)?t++:Yyi.splice(t,1);return!0}}),Yyi,gBi;TWEEN.Tween=function(e){var u=e,c={},d={},h={},p=1e3,f=0,m=!1,i=!1,g=0,y=null,v=TWEEN.Easing.Linear.None,_=TWEEN.Interpolation.Linear,C=[],x=null,b=!1,A=null,S=null,t=null;for(var r in e)c[r]=parseFloat(e[r],10);this.to=function(e,t){return void 0!==t&&(p=t),d=e,this},this.start=function(e){for(var t in TWEEN.add(this),b=!(i=!0),y=void 0!==e?e:"undefined"!=typeof window&&void 0!==window.performance&&void 0!==window.performance.now?window.performance.now():Date.now(),y+=g,d){if(d[t]instanceof Array){if(0===d[t].length)continue;d[t]=[u[t]].concat(d[t])}c[t]=u[t],c[t]instanceof Array==!1&&(c[t]*=1),h[t]=c[t]||0}return this},this.stop=function(){return i&&(TWEEN.remove(this),i=!1,null!==t&&t.call(u),this.stopChainedTweens()),this},this.stopChainedTweens=function(){for(var e=0,t=C.length;e<t;e++)C[e].stop()},this.delay=function(e){return g=e,this},this.repeat=function(e){return f=e,this},this.yoyo=function(e){return m=e,this},this.easing=function(e){return v=e,this},this.interpolation=function(e){return _=e,this},this.chain=function(){return C=arguments,this},this.onStart=function(e){return x=e,this},this.onUpdate=function(e){return A=e,this},this.onComplete=function(e){return S=e,this},this.onStop=function(e){return t=e,this},this.update=function(e){var t;if(e<y)return!0;!1===b&&(null!==x&&x.call(u),b=!0);var i=(e-y)/p,r=v(i=1<i?1:i);for(t in d){var n=c[t]||0,a=d[t];a instanceof Array?u[t]=_(a,r):("string"==typeof a&&(a=n+parseFloat(a,10)),"number"==typeof a&&(u[t]=n+(a-n)*r))}if(null!==A&&A.call(u,r),1!=i)return!0;if(0<f){for(t in isFinite(f)&&f--,h){if("string"==typeof d[t]&&(h[t]=h[t]+parseFloat(d[t],10)),m){var o=h[t];h[t]=d[t],d[t]=o}c[t]=h[t]}return y=e+g,!0}null!==S&&S.call(u);for(var s=0,l=C.length;s<l;s++)C[s].start(e);return!1}},TWEEN.Easing={Linear:{None:function(e){return e}},Quadratic:{In:function(e){return e*e},Out:function(e){return e*(2-e)},InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}},Cubic:{In:function(e){return e*e*e},Out:function(e){return--e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}},Quartic:{In:function(e){return e*e*e*e},Out:function(e){return 1- --e*e*e*e},InOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}},Quintic:{In:function(e){return e*e*e*e*e},Out:function(e){return--e*e*e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}},Sinusoidal:{In:function(e){return 1-Math.cos(e*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return.5*(1-Math.cos(Math.PI*e))}},Exponential:{In:function(e){return 0===e?0:Math.pow(1024,e-1)},Out:function(e){return 1===e?1:1-Math.pow(2,-10*e)},InOut:function(e){return 0===e?0:1===e?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(2-Math.pow(2,-10*(e-1)))}},Circular:{In:function(e){return 1-Math.sqrt(1-e*e)},Out:function(e){return Math.sqrt(1- --e*e)},InOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}},Elastic:{In:function(e){var t,i=.1;return 0===e?0:1===e?1:(t=!i||i<1?(i=1,.1):.4*Math.asin(1/i)/(2*Math.PI),-i*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/.4))},Out:function(e){var t,i=.1;return 0===e?0:1===e?1:(t=!i||i<1?(i=1,.1):.4*Math.asin(1/i)/(2*Math.PI),i*Math.pow(2,-10*e)*Math.sin((e-t)*(2*Math.PI)/.4)+1)},InOut:function(e){var t,i=.1;return 0===e?0:1===e?1:(t=!i||i<1?(i=1,.1):.4*Math.asin(1/i)/(2*Math.PI),(e*=2)<1?i*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/.4)*-.5:i*Math.pow(2,-10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/.4)*.5+1)}},Back:{In:function(e){return e*e*(2.70158*e-1.70158)},Out:function(e){return--e*e*(2.70158*e+1.70158)+1},InOut:function(e){var t=2.5949095;return(e*=2)<1?e*e*((1+t)*e-t)*.5:.5*((e-=2)*e*((1+t)*e+t)+2)}},Bounce:{In:function(e){return 1-TWEEN.Easing.Bounce.Out(1-e)},Out:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},InOut:function(e){return e<.5?.5*TWEEN.Easing.Bounce.In(2*e):.5*TWEEN.Easing.Bounce.Out(2*e-1)+.5}}},TWEEN.Interpolation={Linear:function(e,t){var i=e.length-1,r=i*t,n=Math.floor(r),a=TWEEN.Interpolation.Utils.Linear;return t<0?a(e[0],e[1],r):1<t?a(e[i],e[i-1],i-r):a(e[n],e[i<n+1?i:n+1],r-n)},Bezier:function(e,t){var i,r=0,n=e.length-1,a=Math.pow,o=TWEEN.Interpolation.Utils.Bernstein;for(i=0;i<=n;i++)r+=a(1-t,n-i)*a(t,i)*e[i]*o(n,i);return r},CatmullRom:function(e,t){var i=e.length-1,r=i*t,n=Math.floor(r),a=TWEEN.Interpolation.Utils.CatmullRom;return e[0]===e[i]?(t<0&&(n=Math.floor(r=i*(1+t))),a(e[(n-1+i)%i],e[n],e[(n+1)%i],e[(n+2)%i],r-n)):t<0?e[0]-(a(e[0],e[0],e[1],e[1],-r)-e[0]):1<t?e[i]-(a(e[i],e[i],e[i-1],e[i-1],r-i)-e[i]):a(e[n?n-1:0],e[n],e[i<n+1?i:n+1],e[i<n+2?i:n+2],r-n)},Utils:{Linear:function(e,t,i){return(t-e)*i+e},Bernstein:function(e,t){var i=TWEEN.Interpolation.Utils.Factorial;return i(e)/i(t)/i(e-t)},Factorial:(gBi=[1],function(e){var t,i=1;if(gBi[e])return gBi[e];for(t=e;1<t;t--)i*=t;return gBi[e]=i}),CatmullRom:function(e,t,i,r,n){var a=.5*(i-e),o=.5*(r-t),s=n*n;return(2*t-2*i+a+o)*(n*s)+(-3*t+3*i-2*a-o)*s+a*n+t}}};var EasingFunction={LINEAR_NONE:TWEEN.Easing.Linear.None,QUADRACTIC_IN:TWEEN.Easing.Quadratic.In,QUADRACTIC_OUT:TWEEN.Easing.Quadratic.Out,QUADRACTIC_IN_OUT:TWEEN.Easing.Quadratic.InOut,CUBIC_IN:TWEEN.Easing.Cubic.In,CUBIC_OUT:TWEEN.Easing.Cubic.Out,CUBIC_IN_OUT:TWEEN.Easing.Cubic.InOut,QUARTIC_IN:TWEEN.Easing.Quartic.In,QUARTIC_OUT:TWEEN.Easing.Quartic.Out,QUARTIC_IN_OUT:TWEEN.Easing.Quartic.InOut,QUINTIC_IN:TWEEN.Easing.Quintic.In,QUINTIC_OUT:TWEEN.Easing.Quintic.Out,QUINTIC_IN_OUT:TWEEN.Easing.Quintic.InOut,SINUSOIDAL_IN:TWEEN.Easing.Sinusoidal.In,SINUSOIDAL_OUT:TWEEN.Easing.Sinusoidal.Out,SINUSOIDAL_IN_OUT:TWEEN.Easing.Sinusoidal.InOut,EXPONENTIAL_IN:TWEEN.Easing.Exponential.In,EXPONENTIAL_OUT:TWEEN.Easing.Exponential.Out,EXPONENTIAL_IN_OUT:TWEEN.Easing.Exponential.InOut,CIRCULAR_IN:TWEEN.Easing.Circular.In,CIRCULAR_OUT:TWEEN.Easing.Circular.Out,CIRCULAR_IN_OUT:TWEEN.Easing.Circular.InOut,ELASTIC_IN:TWEEN.Easing.Elastic.In,ELASTIC_OUT:TWEEN.Easing.Elastic.Out,ELASTIC_IN_OUT:TWEEN.Easing.Elastic.InOut,BACK_IN:TWEEN.Easing.Back.In,BACK_OUT:TWEEN.Easing.Back.Out,BACK_IN_OUT:TWEEN.Easing.Back.InOut,BOUNCE_IN:TWEEN.Easing.Bounce.In,BOUNCE_OUT:TWEEN.Easing.Bounce.Out,BOUNCE_IN_OUT:TWEEN.Easing.Bounce.InOut},EasingFunction$1=Object.freeze(EasingFunction);function KmlTourFlyTo(e,t,i){this.type="KmlTourFlyTo",this.blocking=!0,this.activeCamera=null,this.activeCallback=null,this.duration=e,this.view=i,this.flyToMode=t}function KmlTourWait(e){this.type="KmlTourWait",this.blocking=!0,this.duration=e,this.timeout=null}function PositionPropertyArray(e,t){this._value=void 0,this._definitionChanged=new Event,this._eventHelper=new EventHelper,this._referenceFrame=defaultValue(t,ReferenceFrame$1.FIXED),this.setValue(e)}function resolve$1(e){var t=e._targetProperty;if(!defined(t)){var i=e._targetEntity;if(!defined(i)){if(!defined(i=e._targetCollection.getById(e._targetId)))return void(e._targetEntity=e._targetProperty=void 0);i.definitionChanged.addEventListener(ReferenceProperty.prototype._onTargetEntityDefinitionChanged,e),e._targetEntity=i}var r=e._targetPropertyNames;t=e._targetEntity;for(var n=0,a=r.length;n<a&&defined(t);++n)t=t[r[n]];e._targetProperty=t}return t}function ReferenceProperty(e,t,i){this._targetCollection=e,this._targetId=t,this._targetPropertyNames=i,this._targetProperty=void 0,this._targetEntity=void 0,this._definitionChanged=new Event,e.collectionChanged.addEventListener(ReferenceProperty.prototype._onCollectionChanged,this)}KmlTourFlyTo.prototype.play=function(t,e,i){if(this.activeCamera=e,defined(t)&&null!==t){var r=this;this.activeCallback=function(e){delete r.activeCallback,delete r.activeCamera,t(!defined(e)&&e)}}var n=this.getCameraOptions(i);if(this.view.headingPitchRoll)e.flyTo(n);else if(this.view.headingPitchRange){var a=new BoundingSphere(this.view.position);e.flyToBoundingSphere(a,n)}},KmlTourFlyTo.prototype.stop=function(){defined(this.activeCamera)&&this.activeCamera.cancelFlight(),defined(this.activeCallback)&&this.activeCallback(!0)},KmlTourFlyTo.prototype.getCameraOptions=function(e){var t={duration:this.duration};return defined(this.activeCallback)&&(t.complete=this.activeCallback),"smooth"===this.flyToMode&&(t.easingFunction=EasingFunction$1.LINEAR_NONE),this.view.headingPitchRoll?(t.destination=this.view.position,t.orientation=this.view.headingPitchRoll):this.view.headingPitchRange&&(t.offset=this.view.headingPitchRange),defined(e)&&(t=combine(t,e)),t},KmlTourWait.prototype.play=function(e){var t=this;this.activeCallback=e,this.timeout=setTimeout(function(){delete t.activeCallback,e(!1)},1e3*this.duration)},KmlTourWait.prototype.stop=function(){clearTimeout(this.timeout),defined(this.activeCallback)&&this.activeCallback(!0)},Object.defineProperties(PositionPropertyArray.prototype,{isConstant:{get:function(){var e=this._value;if(!defined(e))return!0;for(var t=e.length,i=0;i<t;i++)if(!Property.isConstant(e[i]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}}),PositionPropertyArray.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,ReferenceFrame$1.FIXED,t)},PositionPropertyArray.prototype.getValueInReferenceFrame=function(e,t,i){var r=this._value;if(defined(r)){var n=r.length;defined(i)||(i=new Array(n));for(var a=0,o=0;a<n;){var s=r[a].getValueInReferenceFrame(e,t,i[a]);defined(s)&&(i[o]=s,o++),a++}return i.length=o,i}},PositionPropertyArray.prototype.setValue=function(e){var t=this._eventHelper;if(t.removeAll(),defined(e)){this._value=e.slice();for(var i=e.length,r=0;r<i;r++){var n=e[r];defined(n)&&t.add(n.definitionChanged,PositionPropertyArray.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)},PositionPropertyArray.prototype.equals=function(e){return this===e||e instanceof PositionPropertyArray&&this._referenceFrame===e._referenceFrame&&Property.arrayEquals(this._value,e._value)},PositionPropertyArray.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)},Object.defineProperties(ReferenceProperty.prototype,{isConstant:{get:function(){return Property.isConstant(resolve$1(this))}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){var e=resolve$1(this);return defined(e)?e.referenceFrame:void 0}},targetId:{get:function(){return this._targetId}},targetCollection:{get:function(){return this._targetCollection}},targetPropertyNames:{get:function(){return this._targetPropertyNames}},resolvedProperty:{get:function(){return resolve$1(this)}}}),ReferenceProperty.fromString=function(e,t){for(var i,r=[],n=!0,a=!1,o="",s=0;s<t.length;++s){var l=t.charAt(s);a?(o+=l,a=!1):"\\"===l?a=!0:n&&"#"===l?(i=o,n=!1,o=""):n||"."!==l?o+=l:(r.push(o),o="")}return r.push(o),new ReferenceProperty(e,i,r)},ReferenceProperty.prototype.getValue=function(e,t){var i=resolve$1(this);return defined(i)?i.getValue(e,t):void 0},ReferenceProperty.prototype.getValueInReferenceFrame=function(e,t,i){var r=resolve$1(this);return defined(r)?r.getValueInReferenceFrame(e,t,i):void 0},ReferenceProperty.prototype.getType=function(e){var t=resolve$1(this);return defined(t)?t.getType(e):void 0},ReferenceProperty.prototype.equals=function(e){if(this===e)return!0;var t=this._targetPropertyNames,i=e._targetPropertyNames;if(this._targetCollection!==e._targetCollection||this._targetId!==e._targetId||t.length!==i.length)return!1;for(var r=this._targetPropertyNames.length,n=0;n<r;n++)if(t[n]!==i[n])return!1;return!0},ReferenceProperty.prototype._onTargetEntityDefinitionChanged=function(e,t,i,r){defined(this._targetProperty)&&this._targetPropertyNames[0]===t&&(this._targetProperty=void 0,this._definitionChanged.raiseEvent(this))},ReferenceProperty.prototype._onCollectionChanged=function(e,t,i){var r=this._targetEntity;defined(r)&&-1!==i.indexOf(r)?(r.definitionChanged.removeEventListener(ReferenceProperty.prototype._onTargetEntityDefinitionChanged,this),this._targetEntity=this._targetProperty=void 0):defined(r)||defined(r=resolve$1(this))&&this._definitionChanged.raiseEvent(this)};var ExtrapolationType={NONE:0,HOLD:1,EXTRAPOLATE:2},ExtrapolationType$1=Object.freeze(ExtrapolationType),LinearApproximation={type:"Linear",getRequiredDataPoints:function(e){return 2},interpolateOrderZero:function(e,t,i,r,n){var a,o,s;defined(n)||(n=new Array(r));var l=t[0],u=t[1];for(a=0;a<r;a++)o=i[a],s=i[a+r],n[a]=((s-o)*e+u*o-l*s)/(u-l);return n}},PackableNumber={packedLength:1,pack:function(e,t,i){t[i=defaultValue(i,0)]=e},unpack:function(e,t,i){return e[t=defaultValue(t,0)]}};function arrayInsert(e,t,i){var r,n=e.length,a=i.length,o=n+a;if(e.length=o,n!==t){var s=n-1;for(r=o-1;t<=r;r--)e[r]=e[s--]}for(r=0;r<a;r++)e[t++]=i[r]}function convertDate(e,t){return e instanceof JulianDate?e:"string"==typeof e?JulianDate.fromIso8601(e):JulianDate.addSeconds(t,e,new JulianDate)}var timesSpliceArgs=[],valuesSpliceArgs=[];function mergeNewSamples(e,t,i,r,n){for(var a,o,s,l,u,c,d=0;d<r.length;){var h=0,p=0;if((s=binarySearch(t,u=convertDate(r[d],e),JulianDate.compare))<0){for(l=(s=~s)*n,o=void 0,c=t[s];d<r.length&&(u=convertDate(r[d],e),!(defined(o)&&0<=JulianDate.compare(o,u)||defined(c)&&0<=JulianDate.compare(u,c)));){for(timesSpliceArgs[h++]=u,d+=1,a=0;a<n;a++)valuesSpliceArgs[p++]=r[d],d+=1;o=u}0<h&&(valuesSpliceArgs.length=p,arrayInsert(i,l,valuesSpliceArgs),timesSpliceArgs.length=h,arrayInsert(t,s,timesSpliceArgs))}else{for(a=0;a<n;a++)d++,i[s*n+a]=r[d];d++}}}function SampledProperty(e,t){var i=e;i===Number&&(i=PackableNumber);var r,n=i.packedLength,a=defaultValue(i.packedInterpolationLength,n),o=0;if(defined(t)){var s=t.length;r=new Array(s);for(var l=0;l<s;l++){var u=t[l];u===Number&&(u=PackableNumber);var c=u.packedLength;n+=c,a+=defaultValue(u.packedInterpolationLength,c),r[l]=u}o=s}this._type=e,this._innerType=i,this._interpolationDegree=1,this._interpolationAlgorithm=LinearApproximation,this._numberOfPoints=0,this._times=[],this._values=[],this._xTable=[],this._yTable=[],this._packedLength=n,this._packedInterpolationLength=a,this._updateTableLength=!0,this._interpolationResult=new Array(a),this._definitionChanged=new Event,this._derivativeTypes=t,this._innerDerivativeTypes=r,this._inputOrder=o,this._forwardExtrapolationType=ExtrapolationType$1.NONE,this._forwardExtrapolationDuration=0,this._backwardExtrapolationType=ExtrapolationType$1.NONE,this._backwardExtrapolationDuration=0}function removeSamples(e,t,i){var r=e._packedLength;e._times.splice(t,i),e._values.splice(t*r,i*r),e._updateTableLength=!0,e._definitionChanged.raiseEvent(e)}function SampledPositionProperty(e,t){var i;if(0<(t=defaultValue(t,0))){i=new Array(t);for(var r=0;r<t;r++)i[r]=Cartesian3}this._numberOfDerivatives=t,this._property=new SampledProperty(Cartesian3,i),this._definitionChanged=new Event,this._referenceFrame=defaultValue(e,ReferenceFrame$1.FIXED),this._property._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)}function ScaledPositionProperty(e){this._definitionChanged=new Event,this._value=void 0,this._removeSubscription=void 0,this.setValue(e)}function TimeIntervalCollectionProperty(){this._definitionChanged=new Event,this._intervals=new TimeIntervalCollection,this._intervals.changedEvent.addEventListener(TimeIntervalCollectionProperty.prototype._intervalsChanged,this)}Object.defineProperties(SampledProperty.prototype,{isConstant:{get:function(){return 0===this._values.length}},definitionChanged:{get:function(){return this._definitionChanged}},type:{get:function(){return this._type}},derivativeTypes:{get:function(){return this._derivativeTypes}},interpolationDegree:{get:function(){return this._interpolationDegree}},interpolationAlgorithm:{get:function(){return this._interpolationAlgorithm}},forwardExtrapolationType:{get:function(){return this._forwardExtrapolationType},set:function(e){this._forwardExtrapolationType!==e&&(this._forwardExtrapolationType=e,this._definitionChanged.raiseEvent(this))}},forwardExtrapolationDuration:{get:function(){return this._forwardExtrapolationDuration},set:function(e){this._forwardExtrapolationDuration!==e&&(this._forwardExtrapolationDuration=e,this._definitionChanged.raiseEvent(this))}},backwardExtrapolationType:{get:function(){return this._backwardExtrapolationType},set:function(e){this._backwardExtrapolationType!==e&&(this._backwardExtrapolationType=e,this._definitionChanged.raiseEvent(this))}},backwardExtrapolationDuration:{get:function(){return this._backwardExtrapolationDuration},set:function(e){this._backwardExtrapolationDuration!==e&&(this._backwardExtrapolationDuration=e,this._definitionChanged.raiseEvent(this))}}}),SampledProperty.prototype.getValue=function(e,t){var i=this._times,r=i.length;if(0!==r){var n,a=this._innerType,o=this._values,s=binarySearch(i,e,JulianDate.compare);if(s<0){if(0===(s=~s)){var l=i[s];if(n=this._backwardExtrapolationDuration,this._backwardExtrapolationType===ExtrapolationType$1.NONE||0!==n&&JulianDate.secondsDifference(l,e)>n)return;if(this._backwardExtrapolationType===ExtrapolationType$1.HOLD)return a.unpack(o,0,t)}if(r<=s){var u=i[s=r-1];if(n=this._forwardExtrapolationDuration,this._forwardExtrapolationType===ExtrapolationType$1.NONE||0!==n&&JulianDate.secondsDifference(e,u)>n)return;if(this._forwardExtrapolationType===ExtrapolationType$1.HOLD)return s=r-1,a.unpack(o,s*a.packedLength,t)}var c=this._xTable,d=this._yTable,h=this._interpolationAlgorithm,p=this._packedInterpolationLength,f=this._inputOrder;if(this._updateTableLength){this._updateTableLength=!1;var m=Math.min(h.getRequiredDataPoints(this._interpolationDegree,f),r);m!==this._numberOfPoints&&(this._numberOfPoints=m,c.length=m,d.length=m*p)}var g=this._numberOfPoints-1;if(g<1)return;var y=0,v=r-1;if(1+g<=v-y+1){var _=s-(g/2|0)-1;_<y&&(_=y);var C=_+g;v<C&&(_=(C=v)-g)<y&&(_=y),y=_,v=C}for(var x=v-y+1,b=0;b<x;++b)c[b]=JulianDate.secondsDifference(i[y+b],i[v]);if(defined(a.convertPackedArrayForInterpolation))a.convertPackedArrayForInterpolation(o,y,v,d);else for(var A=0,S=this._packedLength,w=y*S,E=(v+1)*S;w<E;)d[A]=o[w],w++,A++;var T,P=JulianDate.secondsDifference(e,i[v]);if(0!==f&&defined(h.interpolate)){var M=Math.floor(p/(f+1));T=h.interpolate(P,c,d,M,f,f,this._interpolationResult)}else T=h.interpolateOrderZero(P,c,d,p,this._interpolationResult);return defined(a.unpackInterpolationResult)?a.unpackInterpolationResult(T,o,y,v,t):a.unpack(T,0,t)}return a.unpack(o,s*this._packedLength,t)}},SampledProperty.prototype.setInterpolationOptions=function(e){if(defined(e)){var t=!1,i=e.interpolationAlgorithm,r=e.interpolationDegree;defined(i)&&this._interpolationAlgorithm!==i&&(this._interpolationAlgorithm=i,t=!0),defined(r)&&this._interpolationDegree!==r&&(this._interpolationDegree=r,t=!0),t&&(this._updateTableLength=!0,this._definitionChanged.raiseEvent(this))}},SampledProperty.prototype.addSample=function(e,t,i){var r=this._innerDerivativeTypes,n=defined(r),a=this._innerType,o=[];if(o.push(e),a.pack(t,o,o.length),n)for(var s=r.length,l=0;l<s;l++)r[l].pack(i[l],o,o.length);mergeNewSamples(void 0,this._times,this._values,o,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)},SampledProperty.prototype.addSamples=function(e,t,i){for(var r=this._innerDerivativeTypes,n=defined(r),a=this._innerType,o=e.length,s=[],l=0;l<o;l++)if(s.push(e[l]),a.pack(t[l],s,s.length),n)for(var u=i[l],c=r.length,d=0;d<c;d++)r[d].pack(u[d],s,s.length);mergeNewSamples(void 0,this._times,this._values,s,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)},SampledProperty.prototype.addSamplesPackedArray=function(e,t){mergeNewSamples(t,this._times,this._values,e,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)},SampledProperty.prototype.removeSample=function(e){var t=binarySearch(this._times,e,JulianDate.compare);return!(t<0)&&(removeSamples(this,t,1),!0)},SampledProperty.prototype.removeSamples=function(e){var t=this._times,i=binarySearch(t,e.start,JulianDate.compare);i<0?i=~i:e.isStartIncluded||++i;var r=binarySearch(t,e.stop,JulianDate.compare);r<0?r=~r:e.isStopIncluded&&++r,removeSamples(this,i,r-i)},SampledProperty.prototype.equals=function(e){if(this===e)return!0;if(!defined(e))return!1;if(this._type!==e._type||this._interpolationDegree!==e._interpolationDegree||this._interpolationAlgorithm!==e._interpolationAlgorithm)return!1;var t,i,r=this._derivativeTypes,n=defined(r),a=e._derivativeTypes;if(n!==defined(a))return!1;if(n){if((i=r.length)!==a.length)return!1;for(t=0;t<i;t++)if(r[t]!==a[t])return!1}var o=this._times,s=e._times;if((i=o.length)!==s.length)return!1;for(t=0;t<i;t++)if(!JulianDate.equals(o[t],s[t]))return!1;var l=this._values,u=e._values;for(t=0;t<i;t++)if(l[t]!==u[t])return!1;return!0},SampledProperty._mergeNewSamples=mergeNewSamples,Object.defineProperties(SampledPositionProperty.prototype,{isConstant:{get:function(){return this._property.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}},interpolationDegree:{get:function(){return this._property.interpolationDegree}},interpolationAlgorithm:{get:function(){return this._property.interpolationAlgorithm}},numberOfDerivatives:{get:function(){return this._numberOfDerivatives}},forwardExtrapolationType:{get:function(){return this._property.forwardExtrapolationType},set:function(e){this._property.forwardExtrapolationType=e}},forwardExtrapolationDuration:{get:function(){return this._property.forwardExtrapolationDuration},set:function(e){this._property.forwardExtrapolationDuration=e}},backwardExtrapolationType:{get:function(){return this._property.backwardExtrapolationType},set:function(e){this._property.backwardExtrapolationType=e}},backwardExtrapolationDuration:{get:function(){return this._property.backwardExtrapolationDuration},set:function(e){this._property.backwardExtrapolationDuration=e}}}),SampledPositionProperty.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,ReferenceFrame$1.FIXED,t)},SampledPositionProperty.prototype.getValueInReferenceFrame=function(e,t,i){if(defined(i=this._property.getValue(e,i)))return PositionProperty.convertToReferenceFrame(e,i,this._referenceFrame,t,i)},SampledPositionProperty.prototype.setInterpolationOptions=function(e){this._property.setInterpolationOptions(e)},SampledPositionProperty.prototype.addSample=function(e,t,i){this._numberOfDerivatives;this._property.addSample(e,t,i)},SampledPositionProperty.prototype.addSamples=function(e,t,i){this._property.addSamples(e,t,i)},SampledPositionProperty.prototype.addSamplesPackedArray=function(e,t){this._property.addSamplesPackedArray(e,t)},SampledPositionProperty.prototype.removeSample=function(e){this._property.removeSample(e)},SampledPositionProperty.prototype.removeSamples=function(e){this._property.removeSamples(e)},SampledPositionProperty.prototype.equals=function(e){return this===e||e instanceof SampledPositionProperty&&Property.equals(this._property,e._property)&&this._referenceFrame===e._referenceFrame},Object.defineProperties(ScaledPositionProperty.prototype,{isConstant:{get:function(){return Property.isConstant(this._value)}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return defined(this._value)?this._value.referenceFrame:ReferenceFrame$1.FIXED}}}),ScaledPositionProperty.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,ReferenceFrame$1.FIXED,t)},ScaledPositionProperty.prototype.setValue=function(e){this._value!==e&&(this._value=e,defined(this._removeSubscription)&&(this._removeSubscription(),this._removeSubscription=void 0),defined(e)&&(this._removeSubscription=e.definitionChanged.addEventListener(this._raiseDefinitionChanged,this)),this._definitionChanged.raiseEvent(this))},ScaledPositionProperty.prototype.getValueInReferenceFrame=function(e,t,i){if(defined(this._value))return defined(i=this._value.getValueInReferenceFrame(e,t,i))?Ellipsoid.WGS84.scaleToGeodeticSurface(i,i):void 0},ScaledPositionProperty.prototype.equals=function(e){return this===e||e instanceof ScaledPositionProperty&&this._value===e._value},ScaledPositionProperty.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)},Object.defineProperties(TimeIntervalCollectionProperty.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}}),TimeIntervalCollectionProperty.prototype.getValue=function(e,t){var i=this._intervals.findDataForIntervalContainingDate(e);return defined(i)&&"function"==typeof i.clone?i.clone(t):i},TimeIntervalCollectionProperty.prototype.equals=function(e){return this===e||e instanceof TimeIntervalCollectionProperty&&this._intervals.equals(e._intervals,Property.equals)},TimeIntervalCollectionProperty.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var MimeTypes={avi:"video/x-msvideo",bmp:"image/bmp",bz2:"application/x-bzip2",chm:"application/vnd.ms-htmlhelp",css:"text/css",csv:"text/csv",doc:"application/msword",dvi:"application/x-dvi",eps:"application/postscript",flv:"video/x-flv",gif:"image/gif",gz:"application/x-gzip",htm:"text/html",html:"text/html",ico:"image/vnd.microsoft.icon",jnlp:"application/x-java-jnlp-file",jpeg:"image/jpeg",jpg:"image/jpeg",m3u:"audio/x-mpegurl",m4v:"video/mp4",mathml:"application/mathml+xml",mid:"audio/midi",midi:"audio/midi",mov:"video/quicktime",mp3:"audio/mpeg",mp4:"video/mp4",mp4v:"video/mp4",mpeg:"video/mpeg",mpg:"video/mpeg",odp:"application/vnd.oasis.opendocument.presentation",ods:"application/vnd.oasis.opendocument.spreadsheet",odt:"application/vnd.oasis.opendocument.text",ogg:"application/ogg",pdf:"application/pdf",png:"image/png",pps:"application/vnd.ms-powerpoint",ppt:"application/vnd.ms-powerpoint",ps:"application/postscript",qt:"video/quicktime",rdf:"application/rdf+xml",rss:"application/rss+xml",rtf:"application/rtf",svg:"image/svg+xml",swf:"application/x-shockwave-flash",text:"text/plain",tif:"image/tiff",tiff:"image/tiff",txt:"text/plain",wav:"audio/x-wav",wma:"audio/x-ms-wma",wmv:"video/x-ms-wmv",xml:"application/xml",zip:"application/zip",detectFromFilename:function(e){var t=e.toLowerCase();return t=getExtensionFromUri(t),MimeTypes[t]}},NORMAL="normal",parser;"undefined"!=typeof DOMParser&&(parser=new DOMParser);var autolinker=new Autolinker({stripPrefix:!1,email:!1,replaceFn:function(e){if(!e.protocolUrlMatch)return!1}}),BILLBOARD_SIZE=32,BILLBOARD_NEAR_DISTANCE=2414016,BILLBOARD_NEAR_RATIO=1,BILLBOARD_FAR_DISTANCE=16093e3,BILLBOARD_FAR_RATIO=.1,kmlNamespaces=[null,void 0,"http://www.opengis.net/kml/2.2","http://earth.google.com/kml/2.2","http://earth.google.com/kml/2.1","http://earth.google.com/kml/2.0"],gxNamespaces=["http://www.google.com/kml/ext/2.2"],atomNamespaces=["http://www.w3.org/2005/Atom"],namespaces={kml:kmlNamespaces,gx:gxNamespaces,atom:atomNamespaces,kmlgx:kmlNamespaces.concat(gxNamespaces)},featureTypes={Document:processDocument,Folder:processFolder,Placemark:processPlacemark,NetworkLink:processNetworkLink,GroundOverlay:processGroundOverlay,PhotoOverlay:processUnsupportedFeature,ScreenOverlay:processUnsupportedFeature,Tour:processTour};function DeferredLoading(e){this._dataSource=e,this._deferred=when.defer(),this._stack=[],this._promises=[],this._timeoutSet=!1,this._used=!1,this._started=0,this._timeThreshold=1e3}function isZipFile(e){var t=e.slice(0,Math.min(4,e.size)),i=when.defer(),r=new FileReader;return r.addEventListener("load",function(){i.resolve(1347093252===new DataView(r.result).getUint32(0,!1))}),r.addEventListener("error",function(){i.reject(r.error)}),r.readAsArrayBuffer(t),i.promise}function readBlobAsText(e){var t=when.defer(),i=new FileReader;return i.addEventListener("load",function(){t.resolve(i.result)}),i.addEventListener("error",function(){t.reject(i.error)}),i.readAsText(e),t.promise}function insertNamespaces(e){var t,i,r,n={xsi:"http://www.w3.org/2001/XMLSchema-instance"};for(var a in n)n.hasOwnProperty(a)&&(r="xmlns:"+a+"=",RegExp("[< ]"+a+":").test(e)&&-1===e.indexOf(r)&&(defined(t)||(t=e.substr(0,e.indexOf("<kml")+4),i=e.substr(t.length)),t+=" "+r+'"'+n[a]+'"'));return defined(t)&&(e=t+i),e}function removeDuplicateNamespaces(e){for(var t,i,r,n=e.indexOf("xmlns:"),a=e.indexOf(">",n);-1!==n&&n<a;)t=e.slice(n,e.indexOf('"',n)),i=n,n=-1!==(n=e.indexOf(t,n+1))?(r=e.indexOf('"',e.indexOf('"',n)+1),(e=e.slice(0,n-1)+e.slice(r+1,e.length)).indexOf("xmlns:",i-1)):e.indexOf("xmlns:",i+1);return e}function loadXmlFromZip(e,t,i){e.getData(new zip.TextWriter,function(e){e=removeDuplicateNamespaces(e=insertNamespaces(e)),t.kml=parser.parseFromString(e,"application/xml"),i.resolve()})}function loadDataUriFromZip(t,i,r){var e=defaultValue(MimeTypes.detectFromFilename(t.filename),"application/octet-stream");t.getData(new zip.Data64URIWriter(e),function(e){i[t.filename]=e,r.resolve()})}function embedDataUris(e,t,i,r){for(var n=r.keys,a=new URI("."),o=e.querySelectorAll(t),s=0;s<o.length;s++){var l=o[s],u=new URI(l.getAttribute(i)).resolve(a).toString(),c=n.indexOf(u);if(-1!==c){var d=n[c];l.setAttribute(i,r[d]),"a"===t&&null===l.getAttribute("download")&&l.setAttribute("download",d)}}}function applyBasePath(e,t,i,r){for(var n=e.querySelectorAll(t),a=0;a<n.length;a++){var o=n[a],s=resolveHref(o.getAttribute(i),r);o.setAttribute(i,s.url)}}function createEntity(e,t,i){var r=queryStringAttribute(e,"id");r=defined(r)&&0!==r.length?r:createGuid(),defined(i)&&(r=i+r);var n=t.getById(r);return defined(n)&&(r=createGuid(),defined(i)&&(r=i+r)),defined((n=t.add(new Entity({id:r}))).kml)||(n.addProperty("kml"),n.kml=new KmlFeatureData),n}function isExtrudable(e,t){return"absolute"===e||"relativeToGround"===e||"relativeToSeaFloor"===t}function readCoordinate(e,t){if(!defined(e))return Cartesian3.fromDegrees(0,0,0,t);var i=e.match(/[^\s,\n]+/g);if(!defined(i))return Cartesian3.fromDegrees(0,0,0,t);var r=parseFloat(i[0]),n=parseFloat(i[1]),a=parseFloat(i[2]);return r=isNaN(r)?0:r,n=isNaN(n)?0:n,a=isNaN(a)?0:a,Cartesian3.fromDegrees(r,n,a,t)}function readCoordinates(e,t){if(defined(e)){var i=e.textContent.match(/[^\s\n]+/g);if(defined(i)){for(var r=i.length,n=new Array(r),a=0,o=0;o<r;o++)n[a++]=readCoordinate(i[o],t);return n}}}function queryNumericAttribute(e,t){if(defined(e)){var i=e.getAttribute(t);if(null!==i){var r=parseFloat(i);return isNaN(r)?void 0:r}}}function queryStringAttribute(e,t){if(defined(e)){var i=e.getAttribute(t);return null!==i?i:void 0}}function queryFirstNode(e,t,i){if(defined(e))for(var r=e.childNodes,n=r.length,a=0;a<n;a++){var o=r[a];if(o.localName===t&&-1!==i.indexOf(o.namespaceURI))return o}}function queryNodes(e,t,i){if(defined(e)){for(var r=[],n=e.getElementsByTagNameNS("*",t),a=n.length,o=0;o<a;o++){var s=n[o];s.localName===t&&-1!==i.indexOf(s.namespaceURI)&&r.push(s)}return r}}function queryChildNodes(e,t,i){if(!defined(e))return[];for(var r=[],n=e.childNodes,a=n.length,o=0;o<a;o++){var s=n[o];s.localName===t&&-1!==i.indexOf(s.namespaceURI)&&r.push(s)}return r}function queryNumericValue(e,t,i){var r=queryFirstNode(e,t,i);if(defined(r)){var n=parseFloat(r.textContent);return isNaN(n)?void 0:n}}function queryStringValue(e,t,i){var r=queryFirstNode(e,t,i);if(defined(r))return r.textContent.trim()}function queryBooleanValue(e,t,i){var r=queryFirstNode(e,t,i);if(defined(r)){var n=r.textContent.trim();return"1"===n||/^true$/i.test(n)}}function resolveHref(e,t,i){if(defined(e)){var r;if(defined(i)){var n=i[e=e.replace(/\\/g,"/")];if(defined(n))r=new Resource({url:n});else{var a=new URI(t.getUrlComponent());defined(n=i[new URI(e).resolve(a)])&&(r=new Resource({url:n}))}}return defined(r)||(r=t.getDerivedResource({url:e})),r}}Object.defineProperties(DeferredLoading.prototype,{dataSource:{get:function(){return this._dataSource}}}),DeferredLoading.prototype.addNodes=function(e,t){this._stack.push({nodes:e,index:0,processingData:t}),this._used=!0},DeferredLoading.prototype.addPromise=function(e){this._promises.push(e)},DeferredLoading.prototype.wait=function(){var e=this._deferred;return this._used||e.resolve(),when.join(e.promise,when.all(this._promises))},DeferredLoading.prototype.process=function(){var e=1===this._stack.length;return e&&(this._started=KmlDataSource._getTimestamp()),this._process(e)},DeferredLoading.prototype._giveUpTime=function(){if(!this._timeoutSet){this._timeoutSet=!0,this._timeThreshold=50;var e=this;setTimeout(function(){e._timeoutSet=!1,e._started=KmlDataSource._getTimestamp(),e._process(!0)},0)}},DeferredLoading.prototype._nextNode=function(){var e=this._stack,t=e[e.length-1],i=t.index,r=t.nodes;if(i!==r.length)return++t.index,r[i]},DeferredLoading.prototype._pop=function(){var e=this._stack;return e.pop(),0!==e.length||(this._deferred.resolve(),!1)},DeferredLoading.prototype._process=function(e){for(var t=this.dataSource,i=this._stack[this._stack.length-1].processingData,r=this._nextNode();defined(r);){var n=featureTypes[r.localName];if(defined(n)&&(-1!==namespaces.kml.indexOf(r.namespaceURI)||-1!==namespaces.gx.indexOf(r.namespaceURI))&&(n(t,r,i,this),this._timeoutSet||KmlDataSource._getTimestamp()>this._started+this._timeThreshold))return void this._giveUpTime();r=this._nextNode()}this._pop()&&e&&this._process(!0)};var colorOptions={maximumRed:void 0,red:void 0,maximumGreen:void 0,green:void 0,maximumBlue:void 0,blue:void 0};function parseColorString(e,t){if(defined(e)&&!/^\s*$/gm.test(e)){"#"===e[0]&&(e=e.substring(1));var i=parseInt(e.substring(0,2),16)/255,r=parseInt(e.substring(2,4),16)/255,n=parseInt(e.substring(4,6),16)/255,a=parseInt(e.substring(6,8),16)/255;return t?(0<a?(colorOptions.maximumRed=a,colorOptions.red=void 0):(colorOptions.maximumRed=void 0,colorOptions.red=0),0<n?(colorOptions.maximumGreen=n,colorOptions.green=void 0):(colorOptions.maximumGreen=void 0,colorOptions.green=0),0<r?(colorOptions.maximumBlue=r,colorOptions.blue=void 0):(colorOptions.maximumBlue=void 0,colorOptions.blue=0),colorOptions.alpha=i,Color.fromRandom(colorOptions)):new Color(a,n,r,i)}}function queryColorValue(e,t,i){var r=queryStringValue(e,t,i);if(defined(r))return parseColorString(r,"random"===queryStringValue(e,"colorMode",i))}function processTimeStamp(e){var t=queryFirstNode(e,"TimeStamp",namespaces.kmlgx),i=queryStringValue(t,"when",namespaces.kmlgx);if(defined(t)&&defined(i)&&0!==i.length){var r=JulianDate.fromIso8601(i),n=new TimeIntervalCollection;return n.addInterval(new TimeInterval({start:r,stop:Iso8601.MAXIMUM_VALUE})),n}}function processTimeSpan(e){var t=queryFirstNode(e,"TimeSpan",namespaces.kmlgx);if(defined(t)){var i,r=queryFirstNode(t,"begin",namespaces.kmlgx),n=defined(r)?JulianDate.fromIso8601(r.textContent):void 0,a=queryFirstNode(t,"end",namespaces.kmlgx),o=defined(a)?JulianDate.fromIso8601(a.textContent):void 0;if(defined(n)&&defined(o)){if(JulianDate.lessThan(o,n)){var s=n;n=o,o=s}(i=new TimeIntervalCollection).addInterval(new TimeInterval({start:n,stop:o}))}else defined(n)?(i=new TimeIntervalCollection).addInterval(new TimeInterval({start:n,stop:Iso8601.MAXIMUM_VALUE})):defined(o)&&(i=new TimeIntervalCollection).addInterval(new TimeInterval({start:Iso8601.MINIMUM_VALUE,stop:o}));return i}}function createDefaultBillboard(){var e=new BillboardGraphics;return e.width=BILLBOARD_SIZE,e.height=BILLBOARD_SIZE,e.scaleByDistance=new NearFarScalar(BILLBOARD_NEAR_DISTANCE,BILLBOARD_NEAR_RATIO,BILLBOARD_FAR_DISTANCE,BILLBOARD_FAR_RATIO),e.pixelOffsetScaleByDistance=new NearFarScalar(BILLBOARD_NEAR_DISTANCE,BILLBOARD_NEAR_RATIO,BILLBOARD_FAR_DISTANCE,BILLBOARD_FAR_RATIO),e}function createDefaultPolygon(){var e=new PolygonGraphics;return e.outline=!0,e.outlineColor=Color.WHITE,e}function createDefaultLabel(){var e=new LabelGraphics;return e.translucencyByDistance=new NearFarScalar(3e6,1,5e6,0),e.pixelOffset=new Cartesian2(17,0),e.horizontalOrigin=HorizontalOrigin$1.LEFT,e.font="16px sans-serif",e.style=LabelStyle$1.FILL_AND_OUTLINE,e}function getIconHref(e,t,i,r,n){var a=queryStringValue(e,"href",namespaces.kml);if(defined(a)&&0!==a.length){if(0===a.indexOf("root://icons/palette-")){var o=a.charAt(21),s=defaultValue(queryNumericValue(e,"x",namespaces.gx),0),l=defaultValue(queryNumericValue(e,"y",namespaces.gx),0);s=Math.min(s/32,7),a="https://maps.google.com/mapfiles/kml/pal"+o+"/icon"+(8*(l=7-Math.min(l/32,7))+s)+".png"}var u=resolveHref(a,i,r);if(n){var c=queryStringValue(e,"refreshMode",namespaces.kml),d=queryStringValue(e,"viewRefreshMode",namespaces.kml);"onInterval"===c||"onExpire"===c?oneTimeWarning("kml-refreshMode-"+c,"KML - Unsupported Icon refreshMode: "+c):"onStop"!==d&&"onRegion"!==d||oneTimeWarning("kml-refreshMode-"+d,"KML - Unsupported Icon viewRefreshMode: "+d);var h=defaultValue(queryStringValue(e,"viewBoundScale",namespaces.kml),1),p="onStop"===d?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",f=defaultValue(queryStringValue(e,"viewFormat",namespaces.kml),p),m=queryStringValue(e,"httpQuery",namespaces.kml);defined(f)&&u.setQueryParameters(queryToObject(cleanupString(f))),defined(m)&&u.setQueryParameters(queryToObject(cleanupString(m)));var g=t._ellipsoid;return processNetworkLinkQueryString(u,t._camera,t._canvas,h,t._lastCameraView.bbox,g),u}return u}}function processBillboardIcon(e,t,i,r,n){var a=queryNumericValue(t,"scale",namespaces.kml),o=queryNumericValue(t,"heading",namespaces.kml),s=queryColorValue(t,"color",namespaces.kml),l=queryFirstNode(t,"Icon",namespaces.kml),u=getIconHref(l,e,r,n,!1);defined(l)&&!defined(u)&&(u=!1);var c,d,h=queryNumericValue(l,"x",namespaces.gx),p=queryNumericValue(l,"y",namespaces.gx),f=queryNumericValue(l,"w",namespaces.gx),m=queryNumericValue(l,"h",namespaces.gx),g=queryFirstNode(t,"hotSpot",namespaces.kml),y=queryNumericAttribute(g,"x"),v=queryNumericAttribute(g,"y"),_=queryStringAttribute(g,"xunits"),C=queryStringAttribute(g,"yunits"),x=i.billboard;defined(x)||(x=createDefaultBillboard(),i.billboard=x),x.image=u,x.scale=a,x.color=s,(defined(h)||defined(p)||defined(f)||defined(m))&&(x.imageSubRegion=new BoundingRectangle(h,p,f,m)),defined(o)&&0!==o&&(x.rotation=CesiumMath.toRadians(-o),x.alignedAxis=Cartesian3.UNIT_Z),a=defaultValue(a,1),defined(y)&&("pixels"===_?c=-y*a:"insetPixels"===_?c=(y-BILLBOARD_SIZE)*a:"fraction"===_&&(c=-y*BILLBOARD_SIZE*a),c+=.5*BILLBOARD_SIZE*a),defined(v)&&("pixels"===C?d=v*a:"insetPixels"===C?d=(-v+BILLBOARD_SIZE)*a:"fraction"===C&&(d=v*BILLBOARD_SIZE*a),d-=.5*BILLBOARD_SIZE*a),(defined(c)||defined(d))&&(x.pixelOffset=new Cartesian2(c,d))}function applyStyle(e,t,i,r,n){for(var a=0,o=t.childNodes.length;a<o;a++){var s=t.childNodes.item(a);if("IconStyle"===s.localName)processBillboardIcon(e,s,i,r,n);else if("LabelStyle"===s.localName){var l=i.label;defined(l)||(l=createDefaultLabel(),i.label=l),l.scale=defaultValue(queryNumericValue(s,"scale",namespaces.kml),l.scale),l.fillColor=defaultValue(queryColorValue(s,"color",namespaces.kml),l.fillColor),l.text=i.name}else if("LineStyle"===s.localName){var u=i.polyline;defined(u)||(u=new PolylineGraphics,i.polyline=u),u.width=queryNumericValue(s,"width",namespaces.kml),u.material=queryColorValue(s,"color",namespaces.kml),defined(queryColorValue(s,"outerColor",namespaces.gx))&&oneTimeWarning("kml-gx:outerColor","KML - gx:outerColor is not supported in a LineStyle"),defined(queryNumericValue(s,"outerWidth",namespaces.gx))&&oneTimeWarning("kml-gx:outerWidth","KML - gx:outerWidth is not supported in a LineStyle"),defined(queryNumericValue(s,"physicalWidth",namespaces.gx))&&oneTimeWarning("kml-gx:physicalWidth","KML - gx:physicalWidth is not supported in a LineStyle"),defined(queryBooleanValue(s,"labelVisibility",namespaces.gx))&&oneTimeWarning("kml-gx:labelVisibility","KML - gx:labelVisibility is not supported in a LineStyle")}else if("PolyStyle"===s.localName){var c=i.polygon;defined(c)||(c=createDefaultPolygon(),i.polygon=c),c.material=defaultValue(queryColorValue(s,"color",namespaces.kml),c.material),c.fill=defaultValue(queryBooleanValue(s,"fill",namespaces.kml),c.fill),c.outline=defaultValue(queryBooleanValue(s,"outline",namespaces.kml),c.outline)}else if("BalloonStyle"===s.localName){var d=defaultValue(parseColorString(queryStringValue(s,"bgColor",namespaces.kml)),Color.WHITE),h=defaultValue(parseColorString(queryStringValue(s,"textColor",namespaces.kml)),Color.BLACK),p=queryStringValue(s,"text",namespaces.kml);i.addProperty("balloonStyle"),i.balloonStyle={bgColor:d,textColor:h,text:p}}else if("ListStyle"===s.localName){var f=queryStringValue(s,"listItemType",namespaces.kml);"radioFolder"!==f&&"checkOffOnly"!==f||oneTimeWarning("kml-listStyle-"+f,"KML - Unsupported ListStyle with listItemType: "+f)}}}function computeFinalStyle(e,t,i,r,n){for(var a,o=new Entity,s=-1,l=t.childNodes,u=l.length,c=0;c<u;c++){var d=l[c];"Style"!==d.localName&&"StyleMap"!==d.localName||(s=c)}if(-1!==s){var h=l[s];if("Style"===h.localName)applyStyle(e,h,o,r,n);else for(var p=queryChildNodes(h,"Pair",namespaces.kml),f=0;f<p.length;f++){var m=p[f],g=queryStringValue(m,"key",namespaces.kml);if(g===NORMAL){var y=queryStringValue(m,"styleUrl",namespaces.kml);if(defined(y))defined(a=i.getById(y))||(a=i.getById("#"+y)),defined(a)&&o.merge(a);else applyStyle(e,queryFirstNode(m,"Style",namespaces.kml),o,r,n)}else oneTimeWarning("kml-styleMap-"+g,"KML - Unsupported StyleMap key: "+g)}}var v=queryStringValue(t,"styleUrl",namespaces.kml);if(defined(v)){var _=v;if("#"!==v[0]&&-1!==v.indexOf("#")){var C=v.split("#"),x=C[0];_=r.getDerivedResource({url:x}).getUrlComponent()+"#"+C[1]}defined(a=i.getById(_))||(a=i.getById("#"+_)),defined(a)&&o.merge(a)}return o}function processExternalStyles(t,i,r){return i.fetchXML().then(function(e){return processStyles(t,e,r,i,!0)})}function processStyles(e,t,i,r,n,a){var o,s,l,u,c=queryNodes(t,"Style",namespaces.kml);if(defined(c)){var d=c.length;for(o=0;o<d;o++)defined(s=queryStringAttribute(u=c[o],"id"))&&(s="#"+s,n&&defined(r)&&(s=r.getUrlComponent()+s),defined(i.getById(s))||(l=new Entity({id:s}),i.add(l),applyStyle(e,u,l,r,a)))}var h=queryNodes(t,"StyleMap",namespaces.kml);if(defined(h)){var p=h.length;for(o=0;o<p;o++){var f=h[o];if(defined(s=queryStringAttribute(f,"id")))for(var m=queryChildNodes(f,"Pair",namespaces.kml),g=0;g<m.length;g++){var y=m[g],v=queryStringValue(y,"key",namespaces.kml);if(v===NORMAL){if(s="#"+s,n&&defined(r)&&(s=r.getUrlComponent()+s),!defined(i.getById(s))){l=i.getOrCreateEntity(s);var _=queryStringValue(y,"styleUrl",namespaces.kml);if(defined(_)){"#"!==_[0]&&(_="#"+_),n&&defined(r)&&(_=r.getUrlComponent()+_);var C=i.getById(_);defined(C)&&l.merge(C)}else applyStyle(e,u=queryFirstNode(y,"Style",namespaces.kml),l,r,a)}}else oneTimeWarning("kml-styleMap-"+v,"KML - Unsupported StyleMap key: "+v)}}}var x=[],b=t.getElementsByTagName("styleUrl"),A=b.length;for(o=0;o<A;o++){var S=b[o].textContent;if("#"!==S[0]){var w=S.split("#");if(2===w.length){var E=w[0],T=r.getDerivedResource({url:E});x.push(processExternalStyles(e,T,i))}}}return x}function createDropLine(e,t,i){var r=new ReferenceProperty(e,t.id,["position"]),n=new ScaledPositionProperty(t.position);t.polyline=defined(i.polyline)?i.polyline.clone():new PolylineGraphics,t.polyline.positions=new PositionPropertyArray([r,n])}function heightReferenceFromAltitudeMode(e,t){return!defined(e)&&!defined(t)||"clampToGround"===e?HeightReference$1.CLAMP_TO_GROUND:"relativeToGround"===e?HeightReference$1.RELATIVE_TO_GROUND:"absolute"===e?HeightReference$1.NONE:"clampToSeaFloor"===t?(oneTimeWarning("kml-gx:altitudeMode-clampToSeaFloor","KML - <gx:altitudeMode>:clampToSeaFloor is currently not supported, using <kml:altitudeMode>:clampToGround."),HeightReference$1.CLAMP_TO_GROUND):"relativeToSeaFloor"===t?(oneTimeWarning("kml-gx:altitudeMode-relativeToSeaFloor","KML - <gx:altitudeMode>:relativeToSeaFloor is currently not supported, using <kml:altitudeMode>:relativeToGround."),HeightReference$1.RELATIVE_TO_GROUND):(defined(e)?oneTimeWarning("kml-altitudeMode-unknown","KML - Unknown <kml:altitudeMode>:"+e+", using <kml:altitudeMode>:CLAMP_TO_GROUND."):oneTimeWarning("kml-gx:altitudeMode-unknown","KML - Unknown <gx:altitudeMode>:"+t+", using <kml:altitudeMode>:CLAMP_TO_GROUND."),HeightReference$1.CLAMP_TO_GROUND)}function createPositionPropertyFromAltitudeMode(e,t,i){return"relativeToSeaFloor"===i||"absolute"===t||"relativeToGround"===t?e:((defined(t)&&"clampToGround"!==t||defined(i)&&"clampToSeaFloor"!==i)&&oneTimeWarning("kml-altitudeMode-unknown","KML - Unknown altitudeMode: "+defaultValue(t,i)),new ScaledPositionProperty(e))}function createPositionPropertyArrayFromAltitudeMode(e,t,i,r){if(defined(e)){if("relativeToSeaFloor"===i||"absolute"===t||"relativeToGround"===t)return e;(defined(t)&&"clampToGround"!==t||defined(i)&&"clampToSeaFloor"!==i)&&oneTimeWarning("kml-altitudeMode-unknown","KML - Unknown altitudeMode: "+defaultValue(t,i));for(var n=e.length,a=0;a<n;a++){var o=e[a];r.scaleToGeodeticSurface(o,o)}return e}}function processPositionGraphics(e,t,i,r){var n=t.label;defined(n)||(n=defined(i.label)?i.label.clone():createDefaultLabel(),t.label=n),n.text=t.name;var a=t.billboard;defined(a)||(a=defined(i.billboard)?i.billboard.clone():createDefaultBillboard(),t.billboard=a),defined(a.image)?a.image.getValue()||(a.image=void 0):a.image=e._pinBuilder.fromColor(Color.YELLOW,64);var o=1;defined(a.scale)&&(0!==(o=a.scale.getValue())?n.pixelOffset=new Cartesian2(16*o+1,0):(n.pixelOffset=void 0,n.horizontalOrigin=void 0)),defined(r)&&e._clampToGround&&(a.heightReference=r,n.heightReference=r)}function processPathGraphics(e,t){var i=e.path;defined(i)||((i=new PathGraphics).leadTime=0,e.path=i);var r=t.polyline;defined(r)&&(i.material=r.material,i.width=r.width)}function processPoint$1(e,t,i,r,n){var a=queryStringValue(i,"coordinates",namespaces.kml),o=queryStringValue(i,"altitudeMode",namespaces.kml),s=queryStringValue(i,"altitudeMode",namespaces.gx),l=queryBooleanValue(i,"extrude",namespaces.kml),u=readCoordinate(a,e._ellipsoid);return r.position=u,processPositionGraphics(e,r,n,heightReferenceFromAltitudeMode(o,s)),l&&isExtrudable(o,s)&&createDropLine(t,r,n),!0}function processLineStringOrLinearRing(e,t,i,r,n){var a=queryFirstNode(i,"coordinates",namespaces.kml),o=queryStringValue(i,"altitudeMode",namespaces.kml),s=queryStringValue(i,"altitudeMode",namespaces.gx),l=queryBooleanValue(i,"extrude",namespaces.kml),u=queryBooleanValue(i,"tessellate",namespaces.kml),c=isExtrudable(o,s),d=queryNumericValue(i,"drawOrder",namespaces.gx),h=e._ellipsoid,p=readCoordinates(a,h),f=n.polyline;if(c&&l){var m=new WallGraphics;(r.wall=m).positions=p;var g=n.polygon;defined(g)&&(m.fill=g.fill,m.material=g.material),m.outline=!0,defined(f)?(m.outlineColor=defined(f.material)?f.material.color:Color.WHITE,m.outlineWidth=f.width):defined(g)&&(m.outlineColor=defined(g.material)?g.material.color:Color.WHITE)}else if(e._clampToGround&&!c&&u){var y=new PolylineGraphics;y.clampToGround=!0,(r.polyline=y).positions=p,defined(f)?(y.material=defined(f.material)?f.material.color.getValue(Iso8601.MINIMUM_VALUE):Color.WHITE,y.width=defaultValue(f.width,1)):(y.material=Color.WHITE,y.width=1),y.zIndex=d}else defined(d)&&oneTimeWarning("kml-gx:drawOrder","KML - gx:drawOrder is not supported in LineStrings when clampToGround is false"),e._clampToGround&&!u&&oneTimeWarning("kml-line-tesselate","Ignoring clampToGround for KML lines without the tessellate flag."),f=defined(f)?f.clone():new PolylineGraphics,(r.polyline=f).positions=createPositionPropertyArrayFromAltitudeMode(p,o,s,h),u&&!c||(f.arcType=ArcType$1.NONE);return!0}function processPolygon$1(e,t,i,r,n){var a=queryFirstNode(queryFirstNode(i,"outerBoundaryIs",namespaces.kml),"LinearRing",namespaces.kml),o=queryFirstNode(a,"coordinates",namespaces.kml),s=e._ellipsoid,l=readCoordinates(o,s),u=queryBooleanValue(i,"extrude",namespaces.kml),c=isExtrudable(queryStringValue(i,"altitudeMode",namespaces.kml),queryStringValue(i,"altitudeMode",namespaces.gx)),d=defined(n.polygon)?n.polygon.clone():createDefaultPolygon(),h=n.polyline;if(defined(h)&&(d.outlineColor=defined(h.material)?h.material.color:Color.WHITE,d.outlineWidth=h.width),r.polygon=d,c?(d.perPositionHeight=!0,d.extrudedHeight=u?0:void 0):e._clampToGround||(d.height=0),defined(l)){for(var p=new PolygonHierarchy(l),f=queryChildNodes(i,"innerBoundaryIs",namespaces.kml),m=0;m<f.length;m++){a=queryChildNodes(f[m],"LinearRing",namespaces.kml);for(var g=0;g<a.length;g++)defined(l=readCoordinates(o=queryFirstNode(a[g],"coordinates",namespaces.kml),s))&&p.holes.push(new PolygonHierarchy(l))}d.hierarchy=p}return!0}function processTrack(e,t,i,r,n){var a=queryStringValue(i,"altitudeMode",namespaces.kml),o=queryStringValue(i,"altitudeMode",namespaces.gx),s=queryChildNodes(i,"coord",namespaces.gx),l=queryChildNodes(i,"angles",namespaces.gx),u=queryChildNodes(i,"when",namespaces.kml),c=queryBooleanValue(i,"extrude",namespaces.kml),d=isExtrudable(a,o),h=e._ellipsoid;0<l.length&&oneTimeWarning("kml-gx:angles","KML - gx:angles are not supported in gx:Tracks");for(var p=Math.min(s.length,u.length),f=[],m=[],g=0;g<p;g++){var y=readCoordinate(s[g].textContent,h);f.push(y),m.push(JulianDate.fromIso8601(u[g].textContent))}var v=new SampledPositionProperty;return v.addSamples(m,f),r.position=v,processPositionGraphics(e,r,n,heightReferenceFromAltitudeMode(a,o)),processPathGraphics(r,n),r.availability=new TimeIntervalCollection,0<u.length&&r.availability.addInterval(new TimeInterval({start:m[0],stop:m[m.length-1]})),d&&c&&createDropLine(t,r,n),!0}function addToMultiTrack(e,t,i,r,n,a,o,s,l){var u=e[0],c=e[e.length-1],d=new SampledPositionProperty;d.addSamples(e,t),i.intervals.addInterval(new TimeInterval({start:u,stop:c,isStartIncluded:l,isStopIncluded:l,data:createPositionPropertyFromAltitudeMode(d,o,s)})),r.addInterval(new TimeInterval({start:u,stop:c,isStartIncluded:l,isStopIncluded:l})),n.intervals.addInterval(new TimeInterval({start:u,stop:c,isStartIncluded:l,isStopIncluded:l,data:a}))}function processMultiTrack(e,t,i,r,n){for(var a,o,s,l=queryBooleanValue(i,"interpolate",namespaces.gx),u=queryChildNodes(i,"Track",namespaces.gx),c=!1,d=new TimeIntervalCollectionProperty,h=new TimeIntervalCollection,p=new CompositePositionProperty,f=e._ellipsoid,m=0,g=u.length;m<g;m++){var y=u[m],v=queryChildNodes(y,"when",namespaces.kml),_=queryChildNodes(y,"coord",namespaces.gx),C=queryStringValue(y,"altitudeMode",namespaces.kml),x=queryStringValue(y,"altitudeMode",namespaces.gx),b=isExtrudable(C,x),A=queryBooleanValue(y,"extrude",namespaces.kml),S=Math.min(_.length,v.length),w=[];a=[];for(var E=0;E<S;E++){var T=readCoordinate(_[E].textContent,f);w.push(T),a.push(JulianDate.fromIso8601(v[E].textContent))}l&&(defined(o)&&addToMultiTrack([o,a[0]],[s,w[0]],p,h,d,!1,"absolute",void 0,!1),o=a[S-1],s=w[w.length-1]),addToMultiTrack(a,w,p,h,d,b&&A,C,x,!0),c=c||b&&A}return r.availability=h,r.position=p,processPositionGraphics(e,r,n),processPathGraphics(r,n),c&&(createDropLine(t,r,n),r.polyline.show=d),!0}var geometryTypes$1={Point:processPoint$1,LineString:processLineStringOrLinearRing,LinearRing:processLineStringOrLinearRing,Polygon:processPolygon$1,Track:processTrack,MultiTrack:processMultiTrack,MultiGeometry:processMultiGeometry,Model:processUnsupportedGeometry},scratchDiv;function processMultiGeometry(e,t,i,r,n,a){for(var o=i.childNodes,s=!1,l=0,u=o.length;l<u;l++){var c=o.item(l),d=geometryTypes$1[c.localName];if(defined(d)){var h=createEntity(c,t,a);h.parent=r,h.name=r.name,h.availability=r.availability,h.description=r.description,h.kml=r.kml,d(e,t,c,h,n)&&(s=!0)}}return s}function processUnsupportedGeometry(e,t,i,r,n){return oneTimeWarning("kml-unsupportedGeometry","KML - Unsupported geometry: "+i.localName),!1}function processExtendedData(e,t){var i=queryFirstNode(e,"ExtendedData",namespaces.kml);if(defined(i)){defined(queryFirstNode(i,"SchemaData",namespaces.kml))&&oneTimeWarning("kml-schemaData","KML - SchemaData is unsupported"),defined(queryStringAttribute(i,"xmlns:prefix"))&&oneTimeWarning("kml-extendedData","KML - ExtendedData with xmlns:prefix is unsupported");var r={},n=queryChildNodes(i,"Data",namespaces.kml);if(defined(n))for(var a=n.length,o=0;o<a;o++){var s=n[o],l=queryStringAttribute(s,"name");defined(l)&&(r[l]={displayName:queryStringValue(s,"displayName",namespaces.kml),value:queryStringValue(s,"value",namespaces.kml)})}t.kml.extendedData=r}}function processDescription(e,t,i,r,n){var a,o,s,l,u=t.kml,c=u.extendedData,d=queryStringValue(e,"description",namespaces.kml),h=defaultValue(t.balloonStyle,i.balloonStyle),p=Color.WHITE,f=Color.BLACK,m=d;if(defined(h)&&(p=defaultValue(h.bgColor,Color.WHITE),f=defaultValue(h.textColor,Color.BLACK),m=defaultValue(h.text,d)),defined(m)){if(m=(m=(m=(m=(m=(m=m.replace("$[name]",defaultValue(t.name,""))).replace("$[description]",defaultValue(d,""))).replace("$[address]",defaultValue(u.address,""))).replace("$[Snippet]",defaultValue(u.snippet,""))).replace("$[id]",t.id)).replace("$[geDirections]",""),defined(c)){var g=m.match(/\$\[.+?\]/g);if(null!==g)for(a=0;a<g.length;a++){var y=g[a],v=y.substr(2,y.length-3),_=/\/displayName$/.test(v);defined(l=c[v=v.replace(/\/displayName$/,"")])&&(l=_?l.displayName:l.value),defined(l)&&(m=m.replace(y,defaultValue(l,"")))}}}else if(defined(c)&&0<(s=Object.keys(c)).length){for(m='<table class="cesium-infoBox-defaultTable cesium-infoBox-defaultTable-lighter"><tbody>',a=0;a<s.length;a++)m+="<tr><th>"+defaultValue((l=c[o=s[a]]).displayName,o)+"</th><td>"+defaultValue(l.value,"")+"</td></tr>";m+="</tbody></table>"}if(defined(m)){m=autolinker.link(m),scratchDiv.innerHTML=m;var C=scratchDiv.querySelectorAll("a");for(a=0;a<C.length;a++)C[a].setAttribute("target","_blank");defined(r)&&1<r.keys.length&&(embedDataUris(scratchDiv,"a","href",r),embedDataUris(scratchDiv,"img","src",r)),applyBasePath(scratchDiv,"a","href",n),applyBasePath(scratchDiv,"img","src",n);var x='<div class="cesium-infoBox-description-lighter" style="';x+="overflow:auto;",x+="word-wrap:break-word;",x+="background-color:"+p.toCssColorString()+";",x+="color:"+f.toCssColorString()+";",x+='">',x+=scratchDiv.innerHTML+"</div>",scratchDiv.innerHTML="",t.description=x}}function processFeature$1(e,t,i){var r=i.entityCollection,n=i.parentEntity,a=i.sourceResource,o=i.uriResolver,s=createEntity(t,r,i.context),l=s.kml,u=computeFinalStyle(e,t,i.styleCollection,a,o),c=queryStringValue(t,"name",namespaces.kml);s.name=c,s.parent=n;var d=processTimeSpan(t);defined(d)||(d=processTimeStamp(t)),s.availability=d,mergeAvailabilityWithParent(s);var h=queryBooleanValue(t,"visibility",namespaces.kml);s.show=function e(t){return!t||t.show&&e(t.parent)}(n)&&defaultValue(h,!0);var p=queryFirstNode(t,"author",namespaces.atom),f=l.author;f.name=queryStringValue(p,"name",namespaces.atom),f.uri=queryStringValue(p,"uri",namespaces.atom),f.email=queryStringValue(p,"email",namespaces.atom);var m=queryFirstNode(t,"link",namespaces.atom),g=l.link;g.href=queryStringAttribute(m,"href"),g.hreflang=queryStringAttribute(m,"hreflang"),g.rel=queryStringAttribute(m,"rel"),g.type=queryStringAttribute(m,"type"),g.title=queryStringAttribute(m,"title"),g.length=queryStringAttribute(m,"length"),l.address=queryStringValue(t,"address",namespaces.kml),l.phoneNumber=queryStringValue(t,"phoneNumber",namespaces.kml),l.snippet=queryStringValue(t,"Snippet",namespaces.kml),processExtendedData(t,s),processDescription(t,s,u,o,a);var y=e._ellipsoid;return processLookAt(t,s,y),processCamera(t,s,y),defined(queryFirstNode(t,"Region",namespaces.kml))&&oneTimeWarning("kml-region","KML - Placemark Regions are unsupported"),{entity:s,styleEntity:u}}function processDocument(e,t,i,r){r.addNodes(t.childNodes,i),r.process()}function processFolder(e,t,i,r){var n=processFeature$1(e,t,i),a=clone(i);a.parentEntity=n.entity,processDocument(e,t,a,r)}function processPlacemark(e,t,i,r){for(var n=processFeature$1(e,t,i),a=n.entity,o=n.styleEntity,s=!1,l=t.childNodes,u=0,c=l.length;u<c&&!s;u++){var d=l.item(u),h=geometryTypes$1[d.localName];defined(h)&&(h(e,i.entityCollection,d,a,o,a.id),s=!0)}s||(a.merge(o),processPositionGraphics(e,a,o))}"undefined"!=typeof document&&(scratchDiv=document.createElement("div"));var playlistNodeProcessors={FlyTo:processTourFlyTo,Wait:processTourWait,SoundCue:processTourUnsupportedNode,AnimatedUpdate:processTourUnsupportedNode,TourControl:processTourUnsupportedNode};function processTour(e,t,i,r){var n=new KmlTour(queryStringValue(t,"name",namespaces.kml),queryStringAttribute(t,"id")),a=queryFirstNode(t,"Playlist",namespaces.gx);if(a)for(var o=e._ellipsoid,s=a.childNodes,l=0;l<s.length;l++){var u=s[l];if(u.localName){var c=playlistNodeProcessors[u.localName];c?c(n,u,o):console.log("Unknown KML Tour playlist entry type "+u.localName)}}defined(e.kmlTours)||(e.kmlTours=[]),e.kmlTours.push(n)}function processTourUnsupportedNode(e,t){oneTimeWarning("KML Tour unsupported node "+t.localName)}function processTourWait(e,t){var i=queryNumericValue(t,"duration",namespaces.gx);e.addPlaylistEntry(new KmlTourWait(i))}function processTourFlyTo(e,t,i){var r=queryNumericValue(t,"duration",namespaces.gx),n=queryStringValue(t,"flyToMode",namespaces.gx),a={kml:{}};processLookAt(t,a,i),processCamera(t,a,i);var o=new KmlTourFlyTo(r,n,a.kml.lookAt||a.kml.camera);e.addPlaylistEntry(o)}function processCamera(e,t,i){var r=queryFirstNode(e,"Camera",namespaces.kml);if(defined(r)){var n=defaultValue(queryNumericValue(r,"longitude",namespaces.kml),0),a=defaultValue(queryNumericValue(r,"latitude",namespaces.kml),0),o=defaultValue(queryNumericValue(r,"altitude",namespaces.kml),0),s=defaultValue(queryNumericValue(r,"heading",namespaces.kml),0),l=defaultValue(queryNumericValue(r,"tilt",namespaces.kml),0),u=defaultValue(queryNumericValue(r,"roll",namespaces.kml),0),c=Cartesian3.fromDegrees(n,a,o,i),d=HeadingPitchRoll.fromDegrees(s,l-90,u);t.kml.camera=new KmlCamera(c,d)}}function processLookAt(e,t,i){var r=queryFirstNode(e,"LookAt",namespaces.kml);if(defined(r)){var n=defaultValue(queryNumericValue(r,"longitude",namespaces.kml),0),a=defaultValue(queryNumericValue(r,"latitude",namespaces.kml),0),o=defaultValue(queryNumericValue(r,"altitude",namespaces.kml),0),s=queryNumericValue(r,"heading",namespaces.kml),l=queryNumericValue(r,"tilt",namespaces.kml),u=defaultValue(queryNumericValue(r,"range",namespaces.kml),0);l=CesiumMath.toRadians(defaultValue(l,0));var c=new HeadingPitchRange(s=CesiumMath.toRadians(defaultValue(s,0)),l-CesiumMath.PI_OVER_TWO,u),d=Cartesian3.fromDegrees(n,a,o,i);t.kml.lookAt=new KmlLookAt(d,c)}}function processGroundOverlay(e,t,i,r){var n,a=processFeature$1(e,t,i).entity,o=!1,s=e._ellipsoid,l=readCoordinates(queryFirstNode(t,"LatLonQuad",namespaces.gx),s),u=queryNumericValue(t,"drawOrder",namespaces.kml);if(defined(l))(n=createDefaultPolygon()).hierarchy=new PolygonHierarchy(l),n.zIndex=u,a.polygon=n,o=!0;else{(n=new RectangleGraphics).zIndex=u,a.rectangle=n;var c=queryFirstNode(t,"LatLonBox",namespaces.kml);if(defined(c)){var d=queryNumericValue(c,"west",namespaces.kml),h=queryNumericValue(c,"south",namespaces.kml),p=queryNumericValue(c,"east",namespaces.kml),f=queryNumericValue(c,"north",namespaces.kml);defined(d)&&(d=CesiumMath.negativePiToPi(CesiumMath.toRadians(d))),defined(h)&&(h=CesiumMath.clampToLatitudeRange(CesiumMath.toRadians(h))),defined(p)&&(p=CesiumMath.negativePiToPi(CesiumMath.toRadians(p))),defined(f)&&(f=CesiumMath.clampToLatitudeRange(CesiumMath.toRadians(f))),n.coordinates=new Rectangle(d,h,p,f);var m=queryNumericValue(c,"rotation",namespaces.kml);if(defined(m)){var g=CesiumMath.toRadians(m);n.rotation=g,n.stRotation=g}}}var y=queryFirstNode(t,"Icon",namespaces.kml),v=getIconHref(y,e,i.sourceResource,i.uriResolver,!0);if(defined(v)){o&&oneTimeWarning("kml-gx:LatLonQuad","KML - gx:LatLonQuad Icon does not support texture projection.");var _=queryNumericValue(y,"x",namespaces.gx),C=queryNumericValue(y,"y",namespaces.gx),x=queryNumericValue(y,"w",namespaces.gx),b=queryNumericValue(y,"h",namespaces.gx);(defined(_)||defined(C)||defined(x)||defined(b))&&oneTimeWarning("kml-groundOverlay-xywh","KML - gx:x, gx:y, gx:w, gx:h aren't supported for GroundOverlays"),n.material=v,n.material.color=queryColorValue(t,"color",namespaces.kml),n.material.transparent=!0}else n.material=queryColorValue(t,"color",namespaces.kml);var A=queryStringValue(t,"altitudeMode",namespaces.kml);defined(A)?"absolute"===A?(n.height=queryNumericValue(t,"altitude",namespaces.kml),n.zIndex=void 0):"clampToGround"!==A&&oneTimeWarning("kml-altitudeMode-unknown","KML - Unknown altitudeMode: "+A):"relativeToSeaFloor"===(A=queryStringValue(t,"altitudeMode",namespaces.gx))?(oneTimeWarning("kml-altitudeMode-relativeToSeaFloor","KML - altitudeMode relativeToSeaFloor is currently not supported, treating as absolute."),n.height=queryNumericValue(t,"altitude",namespaces.kml),n.zIndex=void 0):"clampToSeaFloor"===A?oneTimeWarning("kml-altitudeMode-clampToSeaFloor","KML - altitudeMode clampToSeaFloor is currently not supported, treating as clampToGround."):defined(A)&&oneTimeWarning("kml-altitudeMode-unknown","KML - Unknown altitudeMode: "+A)}function processUnsupportedFeature(e,t,i,r){e._unsupportedNode.raiseEvent(e,i.parentEntity,t,i.entityCollection,i.styleCollection,i.sourceResource,i.uriResolver),oneTimeWarning("kml-unsupportedFeature-"+t.nodeName,"KML - Unsupported feature: "+t.nodeName)}var RefreshMode={INTERVAL:0,EXPIRE:1,STOP:2};function cleanupString(e){if(!defined(e)||0===e.length)return"";var t=e[0];return"&"!==t&&"?"!==t||(e=e.substring(1)),e}var zeroRectangle=new Rectangle,scratchCartographic$2=new Cartographic,scratchCartesian2$4=new Cartesian2,scratchCartesian3$5=new Cartesian3;function processNetworkLinkQueryString(e,t,i,r,n,a){function o(e){return e<-CesiumMath.PI_OVER_TWO?-CesiumMath.PI_OVER_TWO:e>CesiumMath.PI_OVER_TWO?CesiumMath.PI_OVER_TWO:e}function s(e){return e>CesiumMath.PI?e-CesiumMath.TWO_PI:e<-CesiumMath.PI?e+CesiumMath.TWO_PI:e}var l=objectToQuery(e.queryParameters);if(l=l.replace(/%5B/g,"[").replace(/%5D/g,"]"),defined(t)&&t._mode!==SceneMode$1.MORPHING){var u,c;if(n=defaultValue(n,zeroRectangle),defined(i)&&(scratchCartesian2$4.x=.5*i.clientWidth,scratchCartesian2$4.y=.5*i.clientHeight,u=t.pickEllipsoid(scratchCartesian2$4,a,scratchCartesian3$5)),defined(u)?c=a.cartesianToCartographic(u,scratchCartographic$2):(c=Rectangle.center(n,scratchCartographic$2),u=a.cartographicToCartesian(c)),defined(r)&&!CesiumMath.equalsEpsilon(r,1,CesiumMath.EPSILON9)){var d=n.width*r*.5,h=n.height*r*.5;n=new Rectangle(s(c.longitude-d),o(c.latitude-h),s(c.longitude+d),o(c.latitude+h))}l=(l=(l=(l=l.replace("[bboxWest]",CesiumMath.toDegrees(n.west).toString())).replace("[bboxSouth]",CesiumMath.toDegrees(n.south).toString())).replace("[bboxEast]",CesiumMath.toDegrees(n.east).toString())).replace("[bboxNorth]",CesiumMath.toDegrees(n.north).toString());var p=CesiumMath.toDegrees(c.longitude).toString(),f=CesiumMath.toDegrees(c.latitude).toString();l=(l=(l=(l=(l=(l=(l=(l=l.replace("[lookatLon]",p)).replace("[lookatLat]",f)).replace("[lookatTilt]",CesiumMath.toDegrees(t.pitch).toString())).replace("[lookatHeading]",CesiumMath.toDegrees(t.heading).toString())).replace("[lookatRange]",Cartesian3.distance(t.positionWC,u))).replace("[lookatTerrainLon]",p)).replace("[lookatTerrainLat]",f)).replace("[lookatTerrainAlt]",c.height.toString()),a.cartesianToCartographic(t.positionWC,scratchCartographic$2),l=(l=(l=l.replace("[cameraLon]",CesiumMath.toDegrees(scratchCartographic$2.longitude).toString())).replace("[cameraLat]",CesiumMath.toDegrees(scratchCartographic$2.latitude).toString())).replace("[cameraAlt]",CesiumMath.toDegrees(scratchCartographic$2.height).toString());var m=t.frustum,g=m.aspectRatio,y="",v="";if(defined(g)){var _=CesiumMath.toDegrees(m.fov);1<g?v=(y=_)/g:y=(v=_)*g}l=(l=l.replace("[horizFov]",y.toString())).replace("[vertFov]",v.toString())}else l=(l=(l=(l=(l=(l=(l=(l=(l=(l=(l=(l=(l=(l=(l=(l=(l=l.replace("[bboxWest]","-180")).replace("[bboxSouth]","-90")).replace("[bboxEast]","180")).replace("[bboxNorth]","90")).replace("[lookatLon]","")).replace("[lookatLat]","")).replace("[lookatRange]","")).replace("[lookatTilt]","")).replace("[lookatHeading]","")).replace("[lookatTerrainLon]","")).replace("[lookatTerrainLat]","")).replace("[lookatTerrainAlt]","")).replace("[cameraLon]","")).replace("[cameraLat]","")).replace("[cameraAlt]","")).replace("[horizFov]","")).replace("[vertFov]","");l=(l=(l=(l=(l=(l=defined(i)?(l=l.replace("[horizPixels]",i.clientWidth)).replace("[vertPixels]",i.clientHeight):(l=l.replace("[horizPixels]","")).replace("[vertPixels]","")).replace("[terrainEnabled]","1")).replace("[clientVersion]","1")).replace("[kmlVersion]","2.2")).replace("[clientName]","Cesium")).replace("[language]","English"),e.setQueryParameters(queryToObject(l))}function processNetworkLink(m,e,t,i){var g=processFeature$1(m,e,t).entity,r=t.sourceResource,n=t.uriResolver,y=queryFirstNode(e,"Link",namespaces.kml);if(defined(y)||(y=queryFirstNode(e,"Url",namespaces.kml)),defined(y)){var v,_,C=queryStringValue(y,"href",namespaces.kml);if(defined(C)){var a=C;if(C=resolveHref(C,r,t.uriResolver),/^data:/.test(C.getUrlComponent()))/\.kmz/i.test(r.getUrlComponent())||(a=r.getDerivedResource({url:a}));else{a=C.clone(),v=queryStringValue(y,"viewRefreshMode",namespaces.kml),_=defaultValue(queryStringValue(y,"viewBoundScale",namespaces.kml),1);var o="onStop"===v?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",s=defaultValue(queryStringValue(y,"viewFormat",namespaces.kml),o),l=queryStringValue(y,"httpQuery",namespaces.kml);defined(s)&&C.setQueryParameters(queryToObject(cleanupString(s))),defined(l)&&C.setQueryParameters(queryToObject(cleanupString(l)));var u=m._ellipsoid;processNetworkLinkQueryString(C,m._camera,m._canvas,_,m._lastCameraView.bbox,u)}var c={sourceUri:a,uriResolver:n,context:g.id},x=new EntityCollection,d=load$1(m,x,C,c).then(function(e){var t=m._entityCollection,i=x.values;t.suspendEvents();for(var r=0;r<i.length;r++){var n=i[r];defined(n.parent)||(n.parent=g,mergeAvailabilityWithParent(n)),t.add(n)}t.resumeEvents();var a=queryStringValue(y,"refreshMode",namespaces.kml),o=defaultValue(queryNumericValue(y,"refreshInterval",namespaces.kml),0);if("onInterval"===a&&0<o||"onExpire"===a||"onStop"===v){var s=queryFirstNode(e,"NetworkLinkControl",namespaces.kml),l=defined(s),u=JulianDate.now(),c={id:createGuid(),href:C,cookie:{},lastUpdated:u,updating:!1,entity:g,viewBoundScale:_,needsUpdate:!1,cameraUpdateTime:u},d=0;if(l&&(c.cookie=queryToObject(defaultValue(queryStringValue(s,"cookie",namespaces.kml),"")),d=defaultValue(queryNumericValue(s,"minRefreshPeriod",namespaces.kml),0)),"onInterval"===a)l&&(o=Math.max(d,o)),c.refreshMode=RefreshMode.INTERVAL,c.time=o;else if("onExpire"===a){var h;if(l&&(h=queryStringValue(s,"expires",namespaces.kml)),defined(h))try{var p=JulianDate.fromIso8601(h),f=JulianDate.secondsDifference(p,u);0<f&&f<d&&JulianDate.addSeconds(u,d,p),c.refreshMode=RefreshMode.EXPIRE,c.time=p}catch(e){oneTimeWarning("kml-refreshMode-onInterval-onExpire","KML - NetworkLinkControl expires is not a valid date")}else oneTimeWarning("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element")}else m._camera?(c.refreshMode=RefreshMode.STOP,c.time=defaultValue(queryNumericValue(y,"viewRefreshTime",namespaces.kml),0)):oneTimeWarning("kml-refrehMode-onStop-noCamera","A NetworkLink with viewRefreshMode=onStop requires a camera be passed in when creating the KmlDataSource");defined(c.refreshMode)&&m._networkLinks.set(c.id,c)}else"onRegion"===v&&oneTimeWarning("kml-refrehMode-onRegion","KML - Unsupported viewRefreshMode: onRegion")}).otherwise(function(e){oneTimeWarning("An error occured during loading "+C.url),m._error.raiseEvent(m,e)});i.addPromise(d)}}}function processFeatureNode(e,t,i,r){var n=featureTypes[t.localName];return defined(n)?n(e,t,i,r):processUnsupportedFeature(e,t,i)}function loadKml(a,o,s,l,u,c){o.removeAll();var e=s.documentElement,t=queryStringValue("Document"===e.localName?e:queryFirstNode(e,"Document",namespaces.kml),"name",namespaces.kml);defined(t)||(t=getFilenameFromUri(l.getUrlComponent())),defined(a._name)||(a._name=t);var d=new KmlDataSource._DeferredLoading(a),h=new EntityCollection(a);return when.all(processStyles(a,s,h,l,!1,u)).then(function(){var e=s.documentElement;if("kml"===e.localName)for(var t=e.childNodes,i=0;i<t.length;i++){var r=t[i];if(defined(featureTypes[r.localName])){e=r;break}}var n={parentEntity:void 0,entityCollection:o,styleCollection:h,sourceResource:l,uriResolver:u,context:c};return o.suspendEvents(),processFeatureNode(a,e,n,d),o.resumeEvents(),d.wait().then(function(){return s.documentElement})})}function loadKmz(u,c,e,d){var h=when.defer();return zip.createReader(new zip.BlobReader(e),function(l){l.getEntries(function(e){for(var t,i,r=[],n={},a=0;a<e.length;a++){var o=e[a];if(!o.directory){var s=when.defer();r.push(s.promise),/\.kml$/i.test(o.filename)?defined(t)&&/\//i.test(o.filename)?loadDataUriFromZip(o,n,s):(defined(t)&&loadDataUriFromZip(t,n,i),t=o,i=s):loadDataUriFromZip(o,n,s)}}defined(t)&&loadXmlFromZip(t,n,i),when.all(r).then(function(){if(l.close(),defined(n.kml))return n.keys=Object.keys(n),loadKml(u,c,n.kml,d,n);h.reject(new RuntimeError("KMZ file does not contain a KML document."))}).then(h.resolve).otherwise(h.reject)})},function(e){h.reject(e)}),h.promise}function load$1(n,a,e,t){var o=(t=defaultValue(t,defaultValue.EMPTY_OBJECT)).sourceUri,s=t.uriResolver,l=t.context,i=e;if("string"==typeof e||e instanceof Resource){i=(e=Resource.createIfNeeded(e)).fetchBlob(),o=defaultValue(o,e.clone());var r=n._resourceCredits,u=e.credits;if(defined(u))for(var c=u.length,d=0;d<c;d++)r.push(u[d])}else o=defaultValue(o,Resource.DEFAULT.clone());return o=Resource.createIfNeeded(o),when(i).then(function(t){return t instanceof Blob?isZipFile(t).then(function(e){return e?loadKmz(n,a,t,o):readBlobAsText(t).then(function(e){var t,i;e=removeDuplicateNamespaces(e=insertNamespaces(e));try{t=parser.parseFromString(e,"application/xml")}catch(e){i=e.toString()}if(defined(i)||t.body||"parsererror"===t.documentElement.tagName){var r=defined(i)?i:t.documentElement.firstChild.nodeValue;throw new RuntimeError(r=r||t.body.innerText)}return loadKml(n,a,t,o,s,l)})}):loadKml(n,a,t,o,s,l)}).otherwise(function(e){return n._error.raiseEvent(n,e),console.log(e),when.reject(e)})}function KmlDataSource(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).camera,i=e.canvas;this._changed=new Event,this._error=new Event,this._loading=new Event,this._refresh=new Event,this._unsupportedNode=new Event,this._clock=void 0,this._entityCollection=new EntityCollection(this),this._name=void 0,this._isLoading=!1,this._pinBuilder=new PinBuilder,this._networkLinks=new AssociativeArray,this._entityCluster=new EntityCluster,this._canvas=i,this._camera=t,this._lastCameraView={position:defined(t)?Cartesian3.clone(t.positionWC):void 0,direction:defined(t)?Cartesian3.clone(t.directionWC):void 0,up:defined(t)?Cartesian3.clone(t.upWC):void 0,bbox:defined(t)?t.computeViewRectangle():Rectangle.clone(Rectangle.MAX_VALUE)},this._ellipsoid=defaultValue(e.ellipsoid,Ellipsoid.WGS84);var r=e.credit;"string"==typeof r&&(r=new Credit(r)),this._credit=r,this._resourceCredits=[]}function mergeAvailabilityWithParent(e){var t=e.parent;if(defined(t)){var i=t.availability;if(defined(i)){var r=e.availability;defined(r)?r.intersect(i):e.availability=i}}}function getNetworkLinkUpdateCallback(A,S,w,E,T){return function(e){if(E.contains(S.id)){var t=!1,i=queryFirstNode(e,"NetworkLinkControl",namespaces.kml),r=0;if(defined(i)){if(defined(queryFirstNode(i,"Update",namespaces.kml)))return oneTimeWarning("kml-networkLinkControl-update","KML - NetworkLinkControl updates aren't supported."),S.updating=!1,void E.remove(S.id);S.cookie=queryToObject(defaultValue(queryStringValue(i,"cookie",namespaces.kml),"")),r=defaultValue(queryNumericValue(i,"minRefreshPeriod",namespaces.kml),0)}var n=JulianDate.now(),a=S.refreshMode;if(a===RefreshMode.INTERVAL)defined(i)&&(S.time=Math.max(r,S.time));else if(a===RefreshMode.EXPIRE){var o;if(defined(i)&&(o=queryStringValue(i,"expires",namespaces.kml)),defined(o))try{var s=JulianDate.fromIso8601(o),l=JulianDate.secondsDifference(s,n);0<l&&l<r&&JulianDate.addSeconds(n,r,s),S.time=s}catch(e){oneTimeWarning("kml-networkLinkControl-expires","KML - NetworkLinkControl expires is not a valid date"),t=!0}else oneTimeWarning("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element"),t=!0}var u=S.entity,c=A._entityCollection,d=w.values;c.suspendEvents();var h,p=c.values.slice();for(h=0;h<p.length;++h){var f=p[h];f.parent===u&&(f.parent=void 0,b(f))}for(c.resumeEvents(),c.suspendEvents(),h=0;h<d.length;h++){var m=d[h];defined(m.parent)||(m.parent=u,mergeAvailabilityWithParent(m)),c.add(m)}c.resumeEvents(),t?E.remove(S.id):S.lastUpdated=n;var g=c.computeAvailability(),y=g.start,v=g.stop,_=JulianDate.equals(y,Iso8601.MINIMUM_VALUE),C=JulianDate.equals(v,Iso8601.MAXIMUM_VALUE);if(!_||!C){var x=A._clock;x.startTime===y&&x.stopTime===v||(x.startTime=y,x.stopTime=v,A._changed.raiseEvent(A))}S.updating=!1,S.needsUpdate=!1,A._refresh.raiseEvent(A,T.getUrlComponent(!0))}function b(e){c.remove(e);for(var t=e._children,i=t.length,r=0;r<i;++r)b(t[r])}}}KmlDataSource.load=function(e,t){return new KmlDataSource(t=defaultValue(t,defaultValue.EMPTY_OBJECT)).load(e,t)},Object.defineProperties(KmlDataSource.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{get:function(){return this._clock}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},refreshEvent:{get:function(){return this._refresh}},unsupportedNodeEvent:{get:function(){return this._unsupportedNode}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}},credit:{get:function(){return this._credit}}}),KmlDataSource.prototype.load=function(e,t){t=defaultValue(t,defaultValue.EMPTY_OBJECT),DataSource.setLoading(this,!0);var l=this._name;this._name=void 0,this._clampToGround=defaultValue(t.clampToGround,!1);var u=this;return load$1(this,this._entityCollection,e,t).then(function(){var e,t,i=u._entityCollection.computeAvailability(),r=i.start,n=i.stop,a=JulianDate.equals(r,Iso8601.MINIMUM_VALUE),o=JulianDate.equals(n,Iso8601.MAXIMUM_VALUE);a&&o||(a&&((t=new Date).setHours(0,0,0,0),r=JulianDate.fromDate(t)),o&&((t=new Date).setHours(24,0,0,0),n=JulianDate.fromDate(t)),(e=new DataSourceClock).startTime=r,e.stopTime=n,e.currentTime=JulianDate.clone(r),e.clockRange=ClockRange$1.LOOP_STOP,e.clockStep=ClockStep$1.SYSTEM_CLOCK_MULTIPLIER,e.multiplier=Math.round(Math.min(Math.max(JulianDate.secondsDifference(n,r)/60,1),31556900)));var s=!1;return e!==u._clock&&(u._clock=e,s=!0),l!==u._name&&(s=!0),s&&u._changed.raiseEvent(u),DataSource.setLoading(u,!1),u}).otherwise(function(e){return DataSource.setLoading(u,!1),u._error.raiseEvent(u,e),console.log(e),when.reject(e)})};var entitiesToIgnore=new AssociativeArray;function KmlFeatureData(){this.author={name:void 0,uri:void 0,email:void 0},this.link={href:void 0,hreflang:void 0,rel:void 0,type:void 0,title:void 0,length:void 0},this.address=void 0,this.phoneNumber=void 0,this.snippet=void 0,this.extendedData=void 0}function FeatureDataProvider(e,t){this._earthCtrl=e,this._id=t.id||"",this._name=t.id||"",this._coreMap=e.coreMap,this._options=t,this._dataSource=null,this._isAddToMap=!1,this._isShow=!0,this._dataSourceType="feature",this.initialize()}KmlDataSource.prototype.update=function(e){var t=this._networkLinks;if(0===t.length)return!0;var o=JulianDate.now(),s=this;entitiesToIgnore.removeAll();var l=!1,u=this._lastCameraView,i=this._camera;!defined(i)||i.positionWC.equalsEpsilon(u.position,CesiumMath.EPSILON7)&&i.directionWC.equalsEpsilon(u.direction,CesiumMath.EPSILON7)&&i.upWC.equalsEpsilon(u.up,CesiumMath.EPSILON7)||(u.position=Cartesian3.clone(i.positionWC),u.direction=Cartesian3.clone(i.directionWC),u.up=Cartesian3.clone(i.upWC),u.bbox=i.computeViewRectangle(),l=!0);var c=new AssociativeArray,d=!1;return t.values.forEach(function(i){var e=i.entity;if(!entitiesToIgnore.contains(e.id)){if(!i.updating){var t=!1;if(i.refreshMode===RefreshMode.INTERVAL?JulianDate.secondsDifference(o,i.lastUpdated)>i.time&&(t=!0):i.refreshMode===RefreshMode.EXPIRE?JulianDate.greaterThan(o,i.time)&&(t=!0):i.refreshMode===RefreshMode.STOP&&(l&&(i.needsUpdate=!0,i.cameraUpdateTime=o),i.needsUpdate&&JulianDate.secondsDifference(o,i.cameraUpdateTime)>=i.time&&(t=!0)),t){!function e(t){for(var i=t._children,r=i.length,n=0;n<r;++n){var a=i[n];entitiesToIgnore.set(a.id,a),e(a)}}(e),i.updating=!0;var r=new EntityCollection,n=i.href.clone();n.setQueryParameters(i.cookie);var a=defaultValue(s._ellipsoid,Ellipsoid.WGS84);processNetworkLinkQueryString(n,s._camera,s._canvas,i.viewBoundScale,u.bbox,a),load$1(s,r,n,{context:e.id}).then(getNetworkLinkUpdateCallback(s,i,r,c,n)).otherwise(function(e){var t="NetworkLink "+i.href+" refresh failed: "+e;console.log(t),s._error.raiseEvent(s,t)}),d=!0}}c.set(i.id,i)}}),d&&(this._networkLinks=c,this._changed.raiseEvent(this)),!0},KmlDataSource._DeferredLoading=DeferredLoading,KmlDataSource._getTimestamp=getTimestamp$1;var geometryTypeMap={esriGeometryPoint:"Point",esriGeometryPolyline:"MultiLineString",esriGeometryPolygon:"Polygon"};function arrayFill(e,t,i,r){if("function"==typeof e.fill)return e.fill(t,i,r);for(var n=e.length>>>0,a=defaultValue(i,0),o=a<0?Math.max(n+a,0):Math.min(a,n),s=defaultValue(r,n),l=s<0?Math.max(n+s,0):Math.min(s,n);o<l;)e[o]=t,o++;return e}function earcut(e,t,i){i=i||2;var r,n,a,o,s,l,u,c=t&&t.length,d=c?t[0]*i:e.length,h=linkedList(e,0,d,i,!0),p=[];if(!h||h.next===h.prev)return p;if(c&&(h=eliminateHoles(e,t,h,i)),e.length>80*i){r=a=e[0],n=o=e[1];for(var f=i;f<d;f+=i)(s=e[f])<r&&(r=s),(l=e[f+1])<n&&(n=l),a<s&&(a=s),o<l&&(o=l);u=0!==(u=Math.max(a-r,o-n))?1/u:0}return earcutLinked(h,p,i,r,n,u),p}function linkedList(e,t,i,r,n){var a,o;if(n===0<signedArea(e,t,i,r))for(a=t;a<i;a+=r)o=insertNode(a,e[a],e[a+1],o);else for(a=i-r;t<=a;a-=r)o=insertNode(a,e[a],e[a+1],o);return o&&equals(o,o.next)&&(removeNode(o),o=o.next),o}function filterPoints(e,t){if(!e)return e;t=t||e;var i,r=e;do{if(i=!1,r.steiner||!equals(r,r.next)&&0!==area(r.prev,r,r.next))r=r.next;else{if(removeNode(r),(r=t=r.prev)===r.next)break;i=!0}}while(i||r!==t);return t}function earcutLinked(e,t,i,r,n,a,o){if(e){!o&&a&&indexCurve(e,r,n,a);for(var s,l,u=e;e.prev!==e.next;)if(s=e.prev,l=e.next,a?isEarHashed(e,r,n,a):isEar(e))t.push(s.i/i),t.push(e.i/i),t.push(l.i/i),removeNode(e),e=l.next,u=l.next;else if((e=l)===u){o?1===o?earcutLinked(e=cureLocalIntersections(filterPoints(e),t,i),t,i,r,n,a,2):2===o&&splitEarcut(e,t,i,r,n,a):earcutLinked(filterPoints(e),t,i,r,n,a,1);break}}}function isEar(e){var t=e.prev,i=e,r=e.next;if(0<=area(t,i,r))return!1;for(var n=e.next.next;n!==e.prev;){if(pointInTriangle(t.x,t.y,i.x,i.y,r.x,r.y,n.x,n.y)&&0<=area(n.prev,n,n.next))return!1;n=n.next}return!0}function isEarHashed(e,t,i,r){var n=e.prev,a=e,o=e.next;if(0<=area(n,a,o))return!1;for(var s=n.x<a.x?n.x<o.x?n.x:o.x:a.x<o.x?a.x:o.x,l=n.y<a.y?n.y<o.y?n.y:o.y:a.y<o.y?a.y:o.y,u=n.x>a.x?n.x>o.x?n.x:o.x:a.x>o.x?a.x:o.x,c=n.y>a.y?n.y>o.y?n.y:o.y:a.y>o.y?a.y:o.y,d=zOrder(s,l,t,i,r),h=zOrder(u,c,t,i,r),p=e.prevZ,f=e.nextZ;p&&p.z>=d&&f&&f.z<=h;){if(p!==e.prev&&p!==e.next&&pointInTriangle(n.x,n.y,a.x,a.y,o.x,o.y,p.x,p.y)&&0<=area(p.prev,p,p.next))return!1;if(p=p.prevZ,f!==e.prev&&f!==e.next&&pointInTriangle(n.x,n.y,a.x,a.y,o.x,o.y,f.x,f.y)&&0<=area(f.prev,f,f.next))return!1;f=f.nextZ}for(;p&&p.z>=d;){if(p!==e.prev&&p!==e.next&&pointInTriangle(n.x,n.y,a.x,a.y,o.x,o.y,p.x,p.y)&&0<=area(p.prev,p,p.next))return!1;p=p.prevZ}for(;f&&f.z<=h;){if(f!==e.prev&&f!==e.next&&pointInTriangle(n.x,n.y,a.x,a.y,o.x,o.y,f.x,f.y)&&0<=area(f.prev,f,f.next))return!1;f=f.nextZ}return!0}function cureLocalIntersections(e,t,i){var r=e;do{var n=r.prev,a=r.next.next;!equals(n,a)&&intersects(n,r,r.next,a)&&locallyInside(n,a)&&locallyInside(a,n)&&(t.push(n.i/i),t.push(r.i/i),t.push(a.i/i),removeNode(r),removeNode(r.next),r=e=a),r=r.next}while(r!==e);return filterPoints(r)}function splitEarcut(e,t,i,r,n,a){var o=e;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&isValidDiagonal(o,s)){var l=splitPolygon(o,s);return o=filterPoints(o,o.next),l=filterPoints(l,l.next),earcutLinked(o,t,i,r,n,a),void earcutLinked(l,t,i,r,n,a)}s=s.next}o=o.next}while(o!==e)}function eliminateHoles(e,t,i,r){var n,a,o,s=[];for(n=0,a=t.length;n<a;n++)(o=linkedList(e,t[n]*r,n<a-1?t[n+1]*r:e.length,r,!1))===o.next&&(o.steiner=!0),s.push(getLeftmost(o));for(s.sort(compareX),n=0;n<s.length;n++)eliminateHole(s[n],i),i=filterPoints(i,i.next);return i}function compareX(e,t){return e.x-t.x}function eliminateHole(e,t){if(t=findHoleBridge(e,t)){var i=splitPolygon(t,e);filterPoints(i,i.next)}}function findHoleBridge(e,t){var i,r=t,n=e.x,a=e.y,o=-1/0;do{if(a<=r.y&&a>=r.next.y&&r.next.y!==r.y){var s=r.x+(a-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=n&&o<s){if((o=s)===n){if(a===r.y)return r;if(a===r.next.y)return r.next}i=r.x<r.next.x?r:r.next}}r=r.next}while(r!==t);if(!i)return null;if(n===o)return i;var l,u=i,c=i.x,d=i.y,h=1/0;for(r=i;n>=r.x&&r.x>=c&&n!==r.x&&pointInTriangle(a<d?n:o,a,c,d,a<d?o:n,a,r.x,r.y)&&(l=Math.abs(a-r.y)/(n-r.x),locallyInside(r,e)&&(l<h||l===h&&(r.x>i.x||r.x===i.x&§orContainsSector(i,r)))&&(i=r,h=l)),(r=r.next)!==u;);return i}function sectorContainsSector(e,t){return area(e.prev,e,t.prev)<0&&area(t.next,e,e.next)<0}function indexCurve(e,t,i,r){for(var n=e;null===n.z&&(n.z=zOrder(n.x,n.y,t,i,r)),n.prevZ=n.prev,n.nextZ=n.next,(n=n.next)!==e;);n.prevZ.nextZ=null,n.prevZ=null,sortLinked(n)}function sortLinked(e){var t,i,r,n,a,o,s,l,u=1;do{for(i=e,a=e=null,o=0;i;){for(o++,r=i,t=s=0;t<u&&(s++,r=r.nextZ);t++);for(l=u;0<s||0<l&&r;)0!==s&&(0===l||!r||i.z<=r.z)?(i=(n=i).nextZ,s--):(r=(n=r).nextZ,l--),a?a.nextZ=n:e=n,n.prevZ=a,a=n;i=r}a.nextZ=null,u*=2}while(1<o);return e}function zOrder(e,t,i,r,n){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)*n)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*n)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function getLeftmost(e){for(var t=e,i=e;(t.x<i.x||t.x===i.x&&t.y<i.y)&&(i=t),(t=t.next)!==e;);return i}function pointInTriangle(e,t,i,r,n,a,o,s){return 0<=(n-o)*(t-s)-(e-o)*(a-s)&&0<=(e-o)*(r-s)-(i-o)*(t-s)&&0<=(i-o)*(a-s)-(n-o)*(r-s)}function isValidDiagonal(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!intersectsPolygon(e,t)&&(locallyInside(e,t)&&locallyInside(t,e)&&middleInside(e,t)&&(area(e.prev,e,t.prev)||area(e,t.prev,t))||equals(e,t)&&0<area(e.prev,e,e.next)&&0<area(t.prev,t,t.next))}function area(e,t,i){return(t.y-e.y)*(i.x-t.x)-(t.x-e.x)*(i.y-t.y)}function equals(e,t){return e.x===t.x&&e.y===t.y}function intersects(e,t,i,r){var n=sign(area(e,t,i)),a=sign(area(e,t,r)),o=sign(area(i,r,e)),s=sign(area(i,r,t));return n!==a&&o!==s||(!(0!==n||!onSegment(e,i,t))||(!(0!==a||!onSegment(e,r,t))||(!(0!==o||!onSegment(i,e,r))||!(0!==s||!onSegment(i,t,r)))))}function onSegment(e,t,i){return t.x<=Math.max(e.x,i.x)&&t.x>=Math.min(e.x,i.x)&&t.y<=Math.max(e.y,i.y)&&t.y>=Math.min(e.y,i.y)}function sign(e){return 0<e?1:e<0?-1:0}function intersectsPolygon(e,t){var i=e;do{if(i.i!==e.i&&i.next.i!==e.i&&i.i!==t.i&&i.next.i!==t.i&&intersects(i,i.next,e,t))return!0;i=i.next}while(i!==e);return!1}function locallyInside(e,t){return area(e.prev,e,e.next)<0?0<=area(e,t,e.next)&&0<=area(e,e.prev,t):area(e,t,e.prev)<0||area(e,e.next,t)<0}function middleInside(e,t){for(var i=e,r=!1,n=(e.x+t.x)/2,a=(e.y+t.y)/2;i.y>a!=i.next.y>a&&i.next.y!==i.y&&n<(i.next.x-i.x)*(a-i.y)/(i.next.y-i.y)+i.x&&(r=!r),(i=i.next)!==e;);return r}function splitPolygon(e,t){var i=new Node$1(e.i,e.x,e.y),r=new Node$1(t.i,t.x,t.y),n=e.next,a=t.prev;return(e.next=t).prev=e,(i.next=n).prev=i,(r.next=i).prev=r,(a.next=r).prev=a,r}function insertNode(e,t,i,r){var n=new Node$1(e,t,i);return r?(n.next=r.next,(n.prev=r).next.prev=n,r.next=n):(n.prev=n).next=n,n}function removeNode(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function Node$1(e,t,i){this.i=e,this.x=t,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function signedArea(e,t,i,r){for(var n=0,a=t,o=i-r;a<i;a+=r)n+=(e[o]-e[a])*(e[a+1]+e[o+1]),o=a;return n}FeatureDataProvider.prototype.initialize=function(){var o=this,s=defaultValue(this._options.addToMap,!0),r=defaultValue(o._options.sourceType,"geojson");function n(e){if(o._dataSource=e,s&&o.addToMap(),"feature"===o._dataSourceType&&o._options.distanceDisplayCondition)for(var t=e.entities.values,i=0;i<t.length;i++)for(var r=t[i],n=0;n<r.propertyNames.length;n++){var a=r.propertyNames[n];r[a]&&(r[a].distanceDisplayCondition=o._options.distanceDisplayCondition)}o._options.success&&o._options.success(o)}if("custom"===r)n(new CustomDataSource);else if("kml"===r){KmlDataSource.load(o._options.url,{camera:o._earthCtrl.coreMap.scene.camera,canvas:o._earthCtrl.coreMap.scene.canvas}).then(function(e){n(e)})}else{var t=o._options.url;defined(this._options.adapterUrl)&&(t=this._options.adapterUrl+"?service="+Base64Encoder.encode(o._options.url,"base64"),defined(o._options.crs)&&(t+="&crs="+Base64Encoder.encode(o._options.crs,"base64"))),$.ajax({url:t,cache:defaultValue(this._options.cache,!1),async:defaultValue(this._options.async,!0),success:function(t){var i=null;if("geojson"===r){if("raster"===o._options.renderMode)return void console.warn("unsupport renderMode "+o._options.renderMode);i=GeoJsonDataSource.load(t)}else if("arcgis_json"===r){if("raster"===o._options.renderMode)return void console.warn("unsupport renderMode "+o._options.renderMode);i=GeoJsonDataSource.load(function(e,t,i){for(var r=JSON.parse(e),n={type:"FeatureCollection",features:[]},a=r.geometryType,o=geometryTypeMap[a],s=0;s<r.features.length;s++)if(!(i&&i<s)){var l=r.features[s],u={type:"Feature"};u.properties=l.attributes,u.geometry={},"Point"===o?u.geometry.coordinates=[l.geometry.x,l.geometry.y]:"MultiLineString"===o?u.geometry.coordinates=l.geometry.paths:"Polygon"===o&&(u.geometry.coordinates=l.geometry.rings),u.geometry.type=o,n.features.push(u)}return defined(t)&&(n.crs={type:"name",properties:{name:t}}),n.totalFeatures=n.features.length,n}(t,o._options.crs,o._options.maxFeatureCount))}defined(i)?i.then(function(e){n(e)}).otherwise(function(e){o._options.error&&o._options.error(e)}):o._options.error&&o._options.error(e)},error:function(e){console.log("error"),o._options.error&&o._options.error(e)}})}},FeatureDataProvider.prototype.addToMap=function(){defined(this._earthCtrl)&&!1===this._isAddToMap&&("feature"===this._dataSourceType?this._earthCtrl.dataSources.add(this._dataSource):"raster"===this._dataSourceType&&(this._dataSource=this._earthCtrl.imageryLayers.addImageryProvider(this._dataSource)),this._isAddToMap=!0)},FeatureDataProvider.prototype.removeFromMap=function(e){defined(this._earthCtrl)&&!0===this._isAddToMap&&("feature"===this._dataSourceType?this._earthCtrl.dataSources.remove(this._dataSource,e):"raster"===this._dataSourceType&&this._earthCtrl.imageryLayers.remove(this._dataSource),this._isAddToMap=!1)},FeatureDataProvider.prototype.destory=function(){this.removeFromMap(!0)},Object.defineProperties(FeatureDataProvider.prototype,{id:{get:function(){return this._id}},name:{get:function(){return this._name},set:function(e){this._name=e}},entities:{get:function(){return defined(this._dataSource)?this._dataSource.entities:null}},dataSource:{get:function(){return this._dataSource}},isAddToMap:{get:function(){return this._isAddToMap}},show:{get:function(){return this._isShow},set:function(e){e?this.addToMap():this.removeFromMap(!1),this._isShow=e}}}),earcut.deviation=function(e,t,i,r){var n=t&&t.length,a=n?t[0]*i:e.length,o=Math.abs(signedArea(e,0,a,i));if(n)for(var s=0,l=t.length;s<l;s++){var u=t[s]*i,c=s<l-1?t[s+1]*i:e.length;o-=Math.abs(signedArea(e,u,c,i))}var d=0;for(s=0;s<r.length;s+=3){var h=r[s]*i,p=r[s+1]*i,f=r[s+2]*i;d+=Math.abs((e[h]-e[f])*(e[1+p]-e[1+h])-(e[h]-e[p])*(e[1+f]-e[1+h]))}return 0===o&&0===d?0:Math.abs((d-o)/o)},earcut.flatten=function(e){for(var t=e[0][0].length,i={vertices:[],holes:[],dimensions:t},r=0,n=0;n<e.length;n++){for(var a=0;a<e[n].length;a++)for(var o=0;o<t;o++)i.vertices.push(e[n][a][o]);0<n&&(r+=e[n-1].length,i.holes.push(r))}return i};var scaleToGeodeticHeightN=new Cartesian3,scaleToGeodeticHeightP=new Cartesian3,PolygonPipeline={computeArea2D:function(e){for(var t=e.length,i=0,r=t-1,n=0;n<t;r=n++){var a=e[r],o=e[n];i+=a.x*o.y-o.x*a.y}return.5*i},computeWindingOrder2D:function(e){return 0<PolygonPipeline.computeArea2D(e)?WindingOrder$1.COUNTER_CLOCKWISE:WindingOrder$1.CLOCKWISE},triangulate:function(e,t){return earcut(Cartesian2.packArray(e),t,2)}},subdivisionV0Scratch=new Cartesian3,subdivisionV1Scratch=new Cartesian3,subdivisionV2Scratch=new Cartesian3,subdivisionS0Scratch=new Cartesian3,subdivisionS1Scratch=new Cartesian3,subdivisionS2Scratch=new Cartesian3,subdivisionMidScratch=new Cartesian3;PolygonPipeline.computeSubdivision=function(e,t,i,r){r=defaultValue(r,CesiumMath.RADIANS_PER_DEGREE);var n,a=i.slice(0),o=t.length,s=new Array(3*o),l=0;for(n=0;n<o;n++){var u=t[n];s[l++]=u.x,s[l++]=u.y,s[l++]=u.z}for(var c=[],d={},h=e.maximumRadius,p=CesiumMath.chordLength(r,h),f=p*p;0<a.length;){var m,g,y=a.pop(),v=a.pop(),_=a.pop(),C=Cartesian3.fromArray(s,3*_,subdivisionV0Scratch),x=Cartesian3.fromArray(s,3*v,subdivisionV1Scratch),b=Cartesian3.fromArray(s,3*y,subdivisionV2Scratch),A=Cartesian3.multiplyByScalar(Cartesian3.normalize(C,subdivisionS0Scratch),h,subdivisionS0Scratch),S=Cartesian3.multiplyByScalar(Cartesian3.normalize(x,subdivisionS1Scratch),h,subdivisionS1Scratch),w=Cartesian3.multiplyByScalar(Cartesian3.normalize(b,subdivisionS2Scratch),h,subdivisionS2Scratch),E=Cartesian3.magnitudeSquared(Cartesian3.subtract(A,S,subdivisionMidScratch)),T=Cartesian3.magnitudeSquared(Cartesian3.subtract(S,w,subdivisionMidScratch)),P=Cartesian3.magnitudeSquared(Cartesian3.subtract(w,A,subdivisionMidScratch)),M=Math.max(E,T,P);f<M?E===M?(defined(n=d[m=Math.min(_,v)+" "+Math.max(_,v)])||(g=Cartesian3.add(C,x,subdivisionMidScratch),Cartesian3.multiplyByScalar(g,.5,g),s.push(g.x,g.y,g.z),n=s.length/3-1,d[m]=n),a.push(_,n,y),a.push(n,v,y)):T===M?(defined(n=d[m=Math.min(v,y)+" "+Math.max(v,y)])||(g=Cartesian3.add(x,b,subdivisionMidScratch),Cartesian3.multiplyByScalar(g,.5,g),s.push(g.x,g.y,g.z),n=s.length/3-1,d[m]=n),a.push(v,n,_),a.push(n,y,_)):P===M&&(defined(n=d[m=Math.min(y,_)+" "+Math.max(y,_)])||(g=Cartesian3.add(b,C,subdivisionMidScratch),Cartesian3.multiplyByScalar(g,.5,g),s.push(g.x,g.y,g.z),n=s.length/3-1,d[m]=n),a.push(y,n,v),a.push(n,_,v)):(c.push(_),c.push(v),c.push(y))}return new Geometry({attributes:{position:new GeometryAttribute({componentDatatype:ComponentDatatype$1.DOUBLE,componentsPerAttribute:3,values:s})},indices:c,primitiveType:PrimitiveType$1.TRIANGLES})};var subdivisionC0Scratch=new Cartographic,subdivisionC1Scratch=new Cartographic,subdivisionC2Scratch=new Cartographic,subdivisionCartographicScratch=new Cartographic;function Queue(){this._array=[],this._offset=0,this._length=0}PolygonPipeline.computeRhumbLineSubdivision=function(e,t,i,r){r=defaultValue(r,CesiumMath.RADIANS_PER_DEGREE);var n,a=i.slice(0),o=t.length,s=new Array(3*o),l=0;for(n=0;n<o;n++){var u=t[n];s[l++]=u.x,s[l++]=u.y,s[l++]=u.z}for(var c=[],d={},h=e.maximumRadius,p=CesiumMath.chordLength(r,h),f=new EllipsoidRhumbLine(void 0,void 0,e),m=new EllipsoidRhumbLine(void 0,void 0,e),g=new EllipsoidRhumbLine(void 0,void 0,e);0<a.length;){var y=a.pop(),v=a.pop(),_=a.pop(),C=Cartesian3.fromArray(s,3*_,subdivisionV0Scratch),x=Cartesian3.fromArray(s,3*v,subdivisionV1Scratch),b=Cartesian3.fromArray(s,3*y,subdivisionV2Scratch),A=e.cartesianToCartographic(C,subdivisionC0Scratch),S=e.cartesianToCartographic(x,subdivisionC1Scratch),w=e.cartesianToCartographic(b,subdivisionC2Scratch);f.setEndPoints(A,S);var E=f.surfaceDistance;m.setEndPoints(S,w);var T=m.surfaceDistance;g.setEndPoints(w,A);var P,M,D,I,O=g.surfaceDistance,R=Math.max(E,T,O);p<R?E===R?(defined(n=d[P=Math.min(_,v)+" "+Math.max(_,v)])||(M=f.interpolateUsingFraction(.5,subdivisionCartographicScratch),D=.5*(A.height+S.height),I=Cartesian3.fromRadians(M.longitude,M.latitude,D,e,subdivisionMidScratch),s.push(I.x,I.y,I.z),n=s.length/3-1,d[P]=n),a.push(_,n,y),a.push(n,v,y)):T===R?(defined(n=d[P=Math.min(v,y)+" "+Math.max(v,y)])||(M=m.interpolateUsingFraction(.5,subdivisionCartographicScratch),D=.5*(S.height+w.height),I=Cartesian3.fromRadians(M.longitude,M.latitude,D,e,subdivisionMidScratch),s.push(I.x,I.y,I.z),n=s.length/3-1,d[P]=n),a.push(v,n,_),a.push(n,y,_)):O===R&&(defined(n=d[P=Math.min(y,_)+" "+Math.max(y,_)])||(M=g.interpolateUsingFraction(.5,subdivisionCartographicScratch),D=.5*(w.height+A.height),I=Cartesian3.fromRadians(M.longitude,M.latitude,D,e,subdivisionMidScratch),s.push(I.x,I.y,I.z),n=s.length/3-1,d[P]=n),a.push(y,n,v),a.push(n,_,v)):(c.push(_),c.push(v),c.push(y))}return new Geometry({attributes:{position:new GeometryAttribute({componentDatatype:ComponentDatatype$1.DOUBLE,componentsPerAttribute:3,values:s})},indices:c,primitiveType:PrimitiveType$1.TRIANGLES})},PolygonPipeline.scaleToGeodeticHeight=function(e,t,i,r){i=defaultValue(i,Ellipsoid.WGS84);var n=scaleToGeodeticHeightN,a=scaleToGeodeticHeightP;if(t=defaultValue(t,0),r=defaultValue(r,!0),defined(e))for(var o=e.length,s=0;s<o;s+=3)Cartesian3.fromArray(e,s,a),r&&(a=i.scaleToGeodeticSurface(a,a)),0!==t&&(n=i.geodeticSurfaceNormal(a,n),Cartesian3.multiplyByScalar(n,t,n),Cartesian3.add(a,n,a)),e[s]=a.x,e[s+1]=a.y,e[s+2]=a.z;return e},Object.defineProperties(Queue.prototype,{length:{get:function(){return this._length}}}),Queue.prototype.enqueue=function(e){this._array.push(e),this._length++},Queue.prototype.dequeue=function(){if(0!==this._length){var e=this._array,t=this._offset,i=e[t];return e[t]=void 0,10<++t&&2*t>e.length&&(this._array=e.slice(t),t=0),this._offset=t,this._length--,i}},Queue.prototype.peek=function(){if(0!==this._length)return this._array[this._offset]},Queue.prototype.contains=function(e){return-1!==this._array.indexOf(e)},Queue.prototype.clear=function(){this._array.length=this._offset=this._length=0},Queue.prototype.sort=function(e){0<this._offset&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)};var PolygonGeometryLibrary={computeHierarchyPackedLength:function(e){for(var t=0,i=[e];0<i.length;){var r=i.pop();if(defined(r)){t+=2;var n=r.positions,a=r.holes;if(defined(n)&&(t+=n.length*Cartesian3.packedLength),defined(a))for(var o=a.length,s=0;s<o;++s)i.push(a[s])}}return t},packPolygonHierarchy:function(e,t,i){for(var r=[e];0<r.length;){var n=r.pop();if(defined(n)){var a=n.positions,o=n.holes;if(t[i++]=defined(a)?a.length:0,t[i++]=defined(o)?o.length:0,defined(a))for(var s=a.length,l=0;l<s;++l,i+=3)Cartesian3.pack(a[l],t,i);if(defined(o))for(var u=o.length,c=0;c<u;++c)r.push(o[c])}}return i},unpackPolygonHierarchy:function(e,t){for(var i=e[t++],r=e[t++],n=new Array(i),a=0<r?new Array(r):void 0,o=0;o<i;++o,t+=Cartesian3.packedLength)n[o]=Cartesian3.unpack(e,t);for(var s=0;s<r;++s)a[s]=PolygonGeometryLibrary.unpackPolygonHierarchy(e,t),t=a[s].startingIndex,delete a[s].startingIndex;return{positions:n,holes:a,startingIndex:t}}},distanceScratch$3=new Cartesian3;function getPointAtDistance(e,t,i,r){return Cartesian3.subtract(t,e,distanceScratch$3),Cartesian3.multiplyByScalar(distanceScratch$3,i/r,distanceScratch$3),Cartesian3.add(e,distanceScratch$3,distanceScratch$3),[distanceScratch$3.x,distanceScratch$3.y,distanceScratch$3.z]}PolygonGeometryLibrary.subdivideLineCount=function(e,t,i){var r=Cartesian3.distance(e,t)/i,n=Math.max(0,Math.ceil(CesiumMath.log2(r)));return Math.pow(2,n)};var scratchCartographic0=new Cartographic,scratchCartographic1=new Cartographic,scratchCartographic2=new Cartographic,scratchCartesian0=new Cartesian3;PolygonGeometryLibrary.subdivideRhumbLineCount=function(e,t,i,r){var n=new EllipsoidRhumbLine(e.cartesianToCartographic(t,scratchCartographic0),e.cartesianToCartographic(i,scratchCartographic1),e).surfaceDistance/r,a=Math.max(0,Math.ceil(CesiumMath.log2(n)));return Math.pow(2,a)},PolygonGeometryLibrary.subdivideLine=function(e,t,i,r){var n=PolygonGeometryLibrary.subdivideLineCount(e,t,i),a=Cartesian3.distance(e,t),o=a/n;defined(r)||(r=[]);var s=r;s.length=3*n;for(var l=0,u=0;u<n;u++){var c=getPointAtDistance(e,t,u*o,a);s[l++]=c[0],s[l++]=c[1],s[l++]=c[2]}return s},PolygonGeometryLibrary.subdivideRhumbLine=function(e,t,i,r,n){var a=new EllipsoidRhumbLine(e.cartesianToCartographic(t,scratchCartographic0),e.cartesianToCartographic(i,scratchCartographic1),e),o=a.surfaceDistance/r,s=Math.max(0,Math.ceil(CesiumMath.log2(o))),l=Math.pow(2,s),u=a.surfaceDistance/l;defined(n)||(n=[]);var c=n;c.length=3*l;for(var d=0,h=0;h<l;h++){var p=a.interpolateUsingSurfaceDistance(h*u,scratchCartographic2),f=e.cartographicToCartesian(p,scratchCartesian0);c[d++]=f.x,c[d++]=f.y,c[d++]=f.z}return c};var scaleToGeodeticHeightN1=new Cartesian3,scaleToGeodeticHeightN2=new Cartesian3,scaleToGeodeticHeightP1=new Cartesian3,scaleToGeodeticHeightP2=new Cartesian3;PolygonGeometryLibrary.scaleToGeodeticHeightExtruded=function(e,t,i,r,n){r=defaultValue(r,Ellipsoid.WGS84);var a=scaleToGeodeticHeightN1,o=scaleToGeodeticHeightN2,s=scaleToGeodeticHeightP1,l=scaleToGeodeticHeightP2;if(defined(e)&&defined(e.attributes)&&defined(e.attributes.position))for(var u=e.attributes.position.values,c=u.length/2,d=0;d<c;d+=3)Cartesian3.fromArray(u,d,s),r.geodeticSurfaceNormal(s,a),l=r.scaleToGeodeticSurface(s,l),o=Cartesian3.multiplyByScalar(a,i,o),o=Cartesian3.add(l,o,o),u[d+c]=o.x,u[d+1+c]=o.y,u[d+2+c]=o.z,n&&(l=Cartesian3.clone(s,l)),o=Cartesian3.multiplyByScalar(a,t,o),o=Cartesian3.add(l,o,o),u[d]=o.x,u[d+1]=o.y,u[d+2]=o.z;return e},PolygonGeometryLibrary.polygonOutlinesFromHierarchy=function(e,t,i){var r,n,a,o=[],s=new Queue;for(s.enqueue(e);0!==s.length;){var l=s.dequeue(),u=l.positions;if(t)for(a=u.length,r=0;r<a;r++)i.scaleToGeodeticSurface(u[r],u[r]);if(!((u=arrayRemoveDuplicates(u,Cartesian3.equalsEpsilon,!0)).length<3)){var c=l.holes?l.holes.length:0;for(r=0;r<c;r++){var d=l.holes[r],h=d.positions;if(t)for(a=h.length,n=0;n<a;++n)i.scaleToGeodeticSurface(h[n],h[n]);if(!((h=arrayRemoveDuplicates(h,Cartesian3.equalsEpsilon,!0)).length<3)){o.push(h);var p=0;for(defined(d.holes)&&(p=d.holes.length),n=0;n<p;n++)s.enqueue(d.holes[n])}}o.push(u)}}return o},PolygonGeometryLibrary.polygonsFromHierarchy=function(e,t,i,r){var n=[],a=[],o=new Queue;for(o.enqueue(e);0!==o.length;){var s,l,u=o.dequeue(),c=u.positions,d=u.holes;if(i)for(l=c.length,s=0;s<l;s++)r.scaleToGeodeticSurface(c[s],c[s]);if(!((c=arrayRemoveDuplicates(c,Cartesian3.equalsEpsilon,!0)).length<3)){var h=t(c);if(defined(h)){var p=[],f=PolygonPipeline.computeWindingOrder2D(h);f===WindingOrder$1.CLOCKWISE&&(h.reverse(),c=c.slice().reverse());var m,g=c.slice(),y=defined(d)?d.length:0,v=[];for(s=0;s<y;s++){var _=d[s],C=_.positions;if(i)for(l=C.length,m=0;m<l;++m)r.scaleToGeodeticSurface(C[m],C[m]);if(!((C=arrayRemoveDuplicates(C,Cartesian3.equalsEpsilon,!0)).length<3)){var x=t(C);if(defined(x)){(f=PolygonPipeline.computeWindingOrder2D(x))===WindingOrder$1.CLOCKWISE&&(x.reverse(),C=C.slice().reverse()),v.push(C),p.push(g.length),g=g.concat(C),h=h.concat(x);var b=0;for(defined(_.holes)&&(b=_.holes.length),m=0;m<b;m++)o.enqueue(_.holes[m])}}}n.push({outerRing:c,holes:v}),a.push({positions:g,positions2D:h,holes:p})}}}return{hierarchy:n,polygons:a}};var computeBoundingRectangleCartesian2=new Cartesian2,computeBoundingRectangleCartesian3=new Cartesian3,computeBoundingRectangleQuaternion=new Quaternion,computeBoundingRectangleMatrix3=new Matrix3;PolygonGeometryLibrary.computeBoundingRectangle=function(e,t,i,r,n){for(var a=Quaternion.fromAxisAngle(e,r,computeBoundingRectangleQuaternion),o=Matrix3.fromQuaternion(a,computeBoundingRectangleMatrix3),s=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,u=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,d=i.length,h=0;h<d;++h){var p=Cartesian3.clone(i[h],computeBoundingRectangleCartesian3);Matrix3.multiplyByVector(o,p,p);var f=t(p,computeBoundingRectangleCartesian2);defined(f)&&(s=Math.min(s,f.x),l=Math.max(l,f.x),u=Math.min(u,f.y),c=Math.max(c,f.y))}return n.x=s,n.y=u,n.width=l-s,n.height=c-u,n},PolygonGeometryLibrary.createGeometryFromPositions=function(e,t,i,r,n,a){var o=PolygonPipeline.triangulate(t.positions2D,t.holes);o.length<3&&(o=[0,1,2]);var s=t.positions;if(r){for(var l=s.length,u=new Array(3*l),c=0,d=0;d<l;d++){var h=s[d];u[c++]=h.x,u[c++]=h.y,u[c++]=h.z}var p=new Geometry({attributes:{position:new GeometryAttribute({componentDatatype:ComponentDatatype$1.DOUBLE,componentsPerAttribute:3,values:u})},indices:o,primitiveType:PrimitiveType$1.TRIANGLES});return n.normal?GeometryPipeline.computeNormal(p):p}return a===ArcType$1.GEODESIC?PolygonPipeline.computeSubdivision(e,s,o,i):a===ArcType$1.RHUMB?PolygonPipeline.computeRhumbLineSubdivision(e,s,o,i):void 0};var computeWallIndicesSubdivided=[],p1Scratch$1=new Cartesian3,p2Scratch$1=new Cartesian3;PolygonGeometryLibrary.computeWallGeometry=function(e,t,i,r,n){var a,o,s,l,u,c=e.length,d=0;if(r)for(o=3*c*2,a=new Array(2*o),s=0;s<c;s++)l=e[s],u=e[(s+1)%c],a[d]=a[d+o]=l.x,a[++d]=a[d+o]=l.y,a[++d]=a[d+o]=l.z,a[++d]=a[d+o]=u.x,a[++d]=a[d+o]=u.y,a[++d]=a[d+o]=u.z,++d;else{var h=CesiumMath.chordLength(i,t.maximumRadius),p=0;if(n===ArcType$1.GEODESIC)for(s=0;s<c;s++)p+=PolygonGeometryLibrary.subdivideLineCount(e[s],e[(s+1)%c],h);else if(n===ArcType$1.RHUMB)for(s=0;s<c;s++)p+=PolygonGeometryLibrary.subdivideRhumbLineCount(t,e[s],e[(s+1)%c],h);for(o=3*(p+c),a=new Array(2*o),s=0;s<c;s++){var f;l=e[s],u=e[(s+1)%c],n===ArcType$1.GEODESIC?f=PolygonGeometryLibrary.subdivideLine(l,u,h,computeWallIndicesSubdivided):n===ArcType$1.RHUMB&&(f=PolygonGeometryLibrary.subdivideRhumbLine(t,l,u,h,computeWallIndicesSubdivided));for(var m=f.length,g=0;g<m;++g,++d)a[d]=f[g],a[d+o]=f[g];a[d]=u.x,a[d+o]=u.x,a[++d]=u.y,a[d+o]=u.y,a[++d]=u.z,a[d+o]=u.z,++d}}c=a.length;var y=IndexDatatype$1.createTypedArray(c/3,c-6*e.length),v=0;for(c/=6,s=0;s<c;s++){var _=s,C=_+1,x=_+c,b=x+1;l=Cartesian3.fromArray(a,3*_,p1Scratch$1),u=Cartesian3.fromArray(a,3*C,p2Scratch$1),Cartesian3.equalsEpsilon(l,u,CesiumMath.EPSILON10,CesiumMath.EPSILON10)||(y[v++]=_,y[v++]=x,y[v++]=C,y[v++]=C,y[v++]=x,y[v++]=b)}return new Geometry({attributes:new GeometryAttributes({position:new GeometryAttribute({componentDatatype:ComponentDatatype$1.DOUBLE,componentsPerAttribute:3,values:a})}),indices:y,primitiveType:PrimitiveType$1.TRIANGLES})};var scratchCarto1=new Cartographic,scratchCarto2=new Cartographic;function adjustPosHeightsForNormal(e,t,i,r){var n=r.cartesianToCartographic(e,scratchCarto1).height,a=r.cartesianToCartographic(t,scratchCarto2);a.height=n,r.cartographicToCartesian(a,t);var o=r.cartesianToCartographic(i,scratchCarto2);o.height=n-100,r.cartographicToCartesian(o,i)}var scratchBoundingRectangle=new BoundingRectangle,scratchPosition$2=new Cartesian3,scratchNormal$1=new Cartesian3,scratchTangent=new Cartesian3,scratchBitangent=new Cartesian3,p1Scratch$2=new Cartesian3,p2Scratch$2=new Cartesian3,scratchPerPosNormal=new Cartesian3,scratchPerPosTangent=new Cartesian3,scratchPerPosBitangent=new Cartesian3,appendTextureCoordinatesOrigin=new Cartesian2,appendTextureCoordinatesCartesian2=new Cartesian2,appendTextureCoordinatesCartesian3=new Cartesian3,appendTextureCoordinatesQuaternion=new Quaternion,appendTextureCoordinatesMatrix3=new Matrix3,tangentMatrixScratch=new Matrix3;function computeAttributes(e){var t=e.vertexFormat,i=e.geometry,r=e.shadowVolume,n=i.attributes.position.values,a=n.length,o=e.wall,s=e.top||o,l=e.bottom||o;if(t.st||t.normal||t.tangent||t.bitangent||r){var u=e.boundingRectangle,c=e.tangentPlane,d=e.ellipsoid,h=e.stRotation,p=e.perPositionHeight,f=appendTextureCoordinatesOrigin;f.x=u.x,f.y=u.y;var m,g=t.st?new Float32Array(a/3*2):void 0,y=new Float32Array(a/3),v=0;t.normal&&(m=p&&s&&!o?i.attributes.normal.values:new Float32Array(a));var _=t.tangent?new Float32Array(a):void 0,C=t.bitangent?new Float32Array(a):void 0,x=r?new Float32Array(a):void 0,b=0,A=0,S=scratchNormal$1,w=scratchTangent,E=scratchBitangent,T=!0,P=appendTextureCoordinatesMatrix3,M=tangentMatrixScratch;if(0!==h){var D=Quaternion.fromAxisAngle(c._plane.normal,h,appendTextureCoordinatesQuaternion);P=Matrix3.fromQuaternion(D,P),D=Quaternion.fromAxisAngle(c._plane.normal,-h,appendTextureCoordinatesQuaternion),M=Matrix3.fromQuaternion(D,M)}else P=Matrix3.clone(Matrix3.IDENTITY,P),M=Matrix3.clone(Matrix3.IDENTITY,M);var I=0,O=0;s&&l&&(I=a/2,O=a/3,a/=2);for(var R=0;R<a;R+=3){var L=Cartesian3.fromArray(n,R,appendTextureCoordinatesCartesian3);if(t.st){var N=Matrix3.multiplyByVector(P,L,scratchPosition$2);N=d.scaleToGeodeticSurface(N,N);var k=c.projectPointOntoPlane(N,appendTextureCoordinatesCartesian2);Cartesian2.subtract(k,f,k);var B=CesiumMath.clamp(k.x/u.width,0,1),F=CesiumMath.clamp(k.y/u.height,0,1);l&&(g[b+O]=B,g[b+1+O]=F),s&&(g[b]=B,g[b+1]=F);var V=Cartographic.fromCartesian(L);y[v++]=Math.floor(V.height+1e-5),b+=2}if(t.normal||t.tangent||t.bitangent||r){var z=A+1,U=A+2;if(o){if(R+3<a){var G=Cartesian3.fromArray(n,R+3,p1Scratch$2);if(T){var $=Cartesian3.fromArray(n,R+a,p2Scratch$2);p&&adjustPosHeightsForNormal(L,G,$,d),Cartesian3.subtract(G,L,G),Cartesian3.subtract($,L,$),S=Cartesian3.normalize(Cartesian3.cross($,G,S),S),T=!1}Cartesian3.equalsEpsilon(G,L,CesiumMath.EPSILON10)&&(T=!0)}(t.tangent||t.bitangent)&&(E=d.geodeticSurfaceNormal(L,E),t.tangent&&(w=Cartesian3.normalize(Cartesian3.cross(E,S,w),w)))}else S=d.geodeticSurfaceNormal(L,S),(t.tangent||t.bitangent)&&(p&&(scratchPerPosNormal=Cartesian3.fromArray(m,A,scratchPerPosNormal),scratchPerPosTangent=Cartesian3.cross(Cartesian3.UNIT_Z,scratchPerPosNormal,scratchPerPosTangent),scratchPerPosTangent=Cartesian3.normalize(Matrix3.multiplyByVector(M,scratchPerPosTangent,scratchPerPosTangent),scratchPerPosTangent),t.bitangent&&(scratchPerPosBitangent=Cartesian3.normalize(Cartesian3.cross(scratchPerPosNormal,scratchPerPosTangent,scratchPerPosBitangent),scratchPerPosBitangent))),w=Cartesian3.cross(Cartesian3.UNIT_Z,S,w),w=Cartesian3.normalize(Matrix3.multiplyByVector(M,w,w),w),t.bitangent&&(E=Cartesian3.normalize(Cartesian3.cross(S,w,E),E)));t.normal&&(e.wall?(m[A+I]=S.x,m[z+I]=S.y,m[U+I]=S.z):l&&(m[A+I]=-S.x,m[z+I]=-S.y,m[U+I]=-S.z),(s&&!p||o)&&(m[A]=S.x,m[z]=S.y,m[U]=S.z)),r&&(o&&(S=d.geodeticSurfaceNormal(L,S)),x[A+I]=-S.x,x[z+I]=-S.y,x[U+I]=-S.z),t.tangent&&(e.wall?(_[A+I]=w.x,_[z+I]=w.y,_[U+I]=w.z):l&&(_[A+I]=-w.x,_[z+I]=-w.y,_[U+I]=-w.z),s&&(p?(_[A]=scratchPerPosTangent.x,_[z]=scratchPerPosTangent.y,_[U]=scratchPerPosTangent.z):(_[A]=w.x,_[z]=w.y,_[U]=w.z))),t.bitangent&&(l&&(C[A+I]=E.x,C[z+I]=E.y,C[U+I]=E.z),s&&(p?(C[A]=scratchPerPosBitangent.x,C[z]=scratchPerPosBitangent.y,C[U]=scratchPerPosBitangent.z):(C[A]=E.x,C[z]=E.y,C[U]=E.z))),A+=3}}t.st&&(i.attributes.st=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:2,values:g}),i.attributes.height=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:1,values:y})),t.normal&&(i.attributes.normal=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:m})),t.tangent&&(i.attributes.tangent=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:_})),t.bitangent&&(i.attributes.bitangent=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:C})),r&&(i.attributes.extrudeDirection=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:x}))}if(e.extrude&&defined(e.offsetAttribute)){var H=n.length/3,W=new Uint8Array(H);if(e.offsetAttribute===GeometryOffsetAttribute$1.TOP)s&&l||o?W=arrayFill(W,1,0,H/2):s&&(W=arrayFill(W,1));else W=arrayFill(W,e.offsetAttribute===GeometryOffsetAttribute$1.NONE?0:1);i.attributes.applyOffset=new GeometryAttribute({componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE,componentsPerAttribute:1,values:W})}return i}var startCartographicScratch$1=new Cartographic,endCartographicScratch$1=new Cartographic,idlCross={westOverIDL:0,eastOverIDL:0},ellipsoidGeodesic=new EllipsoidGeodesic;function computeRectangle(e,t,i,r,n){if(n=defaultValue(n,new Rectangle),!defined(e)||e.length<3)return n.west=0,n.north=0,n.south=0,n.east=0,n;if(i===ArcType$1.RHUMB)return Rectangle.fromCartesianArray(e,t,n);ellipsoidGeodesic.ellipsoid.equals(t)||(ellipsoidGeodesic=new EllipsoidGeodesic(void 0,void 0,t)),n.west=Number.POSITIVE_INFINITY,n.east=Number.NEGATIVE_INFINITY,n.south=Number.POSITIVE_INFINITY,n.north=Number.NEGATIVE_INFINITY,idlCross.westOverIDL=Number.POSITIVE_INFINITY,idlCross.eastOverIDL=Number.NEGATIVE_INFINITY;for(var a,o=1/CesiumMath.chordLength(r,t.maximumRadius),s=e.length,l=t.cartesianToCartographic(e[0],endCartographicScratch$1),u=startCartographicScratch$1,c=1;c<s;c++)a=u,u=l,l=t.cartesianToCartographic(e[c],a),ellipsoidGeodesic.setEndPoints(u,l),interpolateAndGrowRectangle(ellipsoidGeodesic,o,n,idlCross);return a=u,u=l,l=t.cartesianToCartographic(e[0],a),ellipsoidGeodesic.setEndPoints(u,l),interpolateAndGrowRectangle(ellipsoidGeodesic,o,n,idlCross),n.east-n.west>idlCross.eastOverIDL-idlCross.westOverIDL&&(n.west=idlCross.westOverIDL,n.east=idlCross.eastOverIDL,n.east>CesiumMath.PI&&(n.east=n.east-CesiumMath.TWO_PI),n.west>CesiumMath.PI&&(n.west=n.west-CesiumMath.TWO_PI)),n}var interpolatedCartographicScratch$1=new Cartographic;function interpolateAndGrowRectangle(e,t,i,r){for(var n=e.surfaceDistance,a=Math.ceil(n*t),o=0<a?n/(a-1):Number.POSITIVE_INFINITY,s=0,l=0;l<a;l++){var u=e.interpolateUsingSurfaceDistance(s,interpolatedCartographicScratch$1);s+=o;var c=u.longitude,d=u.latitude;i.west=Math.min(i.west,c),i.east=Math.max(i.east,c),i.south=Math.min(i.south,d),i.north=Math.max(i.north,d);var h=0<=c?c:c+CesiumMath.TWO_PI;r.westOverIDL=Math.min(r.westOverIDL,h),r.eastOverIDL=Math.max(r.eastOverIDL,h)}}var createGeometryFromPositionsExtrudedPositions=[];function createGeometryFromPositionsExtruded(e,t,i,r,n,a,o,s,l){var u,c={walls:[]};if(a||o){var d,h,p=PolygonGeometryLibrary.createGeometryFromPositions(e,t,i,n,s,l),f=p.attributes.position.values,m=p.indices;if(a&&o){var g=f.concat(f);d=g.length/3,(h=IndexDatatype$1.createTypedArray(d,2*m.length)).set(m);var y=m.length,v=d/2;for(u=0;u<y;u+=3){var _=h[u]+v,C=h[u+1]+v,x=h[u+2]+v;h[u+y]=x,h[u+1+y]=C,h[u+2+y]=_}if(p.attributes.position.values=g,n&&s.normal){var b=p.attributes.normal.values;p.attributes.normal.values=new Float32Array(g.length),p.attributes.normal.values.set(b)}p.indices=h}else if(o){for(d=f.length/3,h=IndexDatatype$1.createTypedArray(d,m.length),u=0;u<m.length;u+=3)h[u]=m[u+2],h[u+1]=m[u+1],h[u+2]=m[u];p.indices=h}c.topAndBottom=new GeometryInstance({geometry:p})}var A=r.outerRing,S=EllipsoidTangentPlane.fromPoints(A,e),w=S.projectPointsOntoPlane(A,createGeometryFromPositionsExtrudedPositions),E=PolygonPipeline.computeWindingOrder2D(w);E===WindingOrder$1.CLOCKWISE&&(A=A.slice().reverse());var T=PolygonGeometryLibrary.computeWallGeometry(A,e,i,n,l);c.walls.push(new GeometryInstance({geometry:T}));var P=r.holes;for(u=0;u<P.length;u++){var M=P[u];w=(S=EllipsoidTangentPlane.fromPoints(M,e)).projectPointsOntoPlane(M,createGeometryFromPositionsExtrudedPositions),(E=PolygonPipeline.computeWindingOrder2D(w))===WindingOrder$1.COUNTER_CLOCKWISE&&(M=M.slice().reverse()),T=PolygonGeometryLibrary.computeWallGeometry(M,e,i,n,l),c.walls.push(new GeometryInstance({geometry:T}))}return c}function PolygonGeometry(e){var t=e.polygonHierarchy,i=defaultValue(e.vertexFormat,VertexFormat.DEFAULT),r=defaultValue(e.ellipsoid,Ellipsoid.WGS84),n=defaultValue(e.granularity,CesiumMath.RADIANS_PER_DEGREE),a=defaultValue(e.stRotation,0),o=defaultValue(e.perPositionHeight,!1),s=o&&defined(e.extrudedHeight),l=defaultValue(e.height,0),u=defaultValue(e.extrudedHeight,l);if(!s){var c=Math.max(l,u);u=Math.min(l,u),l=c}this._vertexFormat=VertexFormat.clone(i),this._ellipsoid=Ellipsoid.clone(r),this._granularity=n,this._stRotation=a,this._height=l,this._extrudedHeight=u,this._closeTop=defaultValue(e.closeTop,!0),this._closeBottom=defaultValue(e.closeBottom,!0),this._polygonHierarchy=t,this._perPositionHeight=o,this._perPositionHeightExtrude=s,this._shadowVolume=defaultValue(e.shadowVolume,!1),this._workerName="createPolygonGeometry",this._offsetAttribute=e.offsetAttribute,this._arcType=defaultValue(e.arcType,ArcType$1.GEODESIC),this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0,this.packedLength=PolygonGeometryLibrary.computeHierarchyPackedLength(t)+Ellipsoid.packedLength+VertexFormat.packedLength+12}PolygonGeometry.fromPositions=function(e){return new PolygonGeometry({polygonHierarchy:{positions:(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).positions},height:e.height,extrudedHeight:e.extrudedHeight,vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight,closeTop:e.closeTop,closeBottom:e.closeBottom,offsetAttribute:e.offsetAttribute,arcType:e.arcType})},PolygonGeometry.pack=function(e,t,i){return i=defaultValue(i,0),i=PolygonGeometryLibrary.packPolygonHierarchy(e._polygonHierarchy,t,i),Ellipsoid.pack(e._ellipsoid,t,i),i+=Ellipsoid.packedLength,VertexFormat.pack(e._vertexFormat,t,i),i+=VertexFormat.packedLength,t[i++]=e._height,t[i++]=e._extrudedHeight,t[i++]=e._granularity,t[i++]=e._stRotation,t[i++]=e._perPositionHeightExtrude?1:0,t[i++]=e._perPositionHeight?1:0,t[i++]=e._closeTop?1:0,t[i++]=e._closeBottom?1:0,t[i++]=e._shadowVolume?1:0,t[i++]=defaultValue(e._offsetAttribute,-1),t[i++]=e._arcType,t[i]=e.packedLength,t};var scratchEllipsoid=Ellipsoid.clone(Ellipsoid.UNIT_SPHERE),scratchVertexFormat=new VertexFormat,dummyOptions={polygonHierarchy:{}};function textureCoordinateRotationPoints(e){var t=-e._stRotation;if(0==t)return[0,0,0,1,1,0];var i=e._ellipsoid,r=e._polygonHierarchy.positions,n=e.rectangle;return Geometry._textureCoordinateRotationPoints(r,t,i,n)}PolygonGeometry.unpack=function(e,t,i){t=defaultValue(t,0);var r=PolygonGeometryLibrary.unpackPolygonHierarchy(e,t);t=r.startingIndex,delete r.startingIndex;var n=Ellipsoid.unpack(e,t,scratchEllipsoid);t+=Ellipsoid.packedLength;var a=VertexFormat.unpack(e,t,scratchVertexFormat);t+=VertexFormat.packedLength;var o=e[t++],s=e[t++],l=e[t++],u=e[t++],c=1===e[t++],d=1===e[t++],h=1===e[t++],p=1===e[t++],f=1===e[t++],m=e[t++],g=e[t++],y=e[t];return defined(i)||(i=new PolygonGeometry(dummyOptions)),i._polygonHierarchy=r,i._ellipsoid=Ellipsoid.clone(n,i._ellipsoid),i._vertexFormat=VertexFormat.clone(a,i._vertexFormat),i._height=o,i._extrudedHeight=s,i._granularity=l,i._stRotation=u,i._perPositionHeightExtrude=c,i._perPositionHeight=d,i._closeTop=h,i._closeBottom=p,i._shadowVolume=f,i._offsetAttribute=-1===m?void 0:m,i._arcType=g,i.packedLength=y,i},PolygonGeometry.computeRectangle=function(e,t){var i=defaultValue(e.granularity,CesiumMath.RADIANS_PER_DEGREE),r=defaultValue(e.arcType,ArcType$1.GEODESIC),n=e.polygonHierarchy,a=defaultValue(e.ellipsoid,Ellipsoid.WGS84);return computeRectangle(n.positions,a,r,i,t)},PolygonGeometry.createGeometry=function(e){var t=e._vertexFormat,i=e._ellipsoid,r=e._granularity,n=e._stRotation,a=e._polygonHierarchy,o=e._perPositionHeight,s=e._closeTop,l=e._closeBottom,u=e._arcType,c=a.positions;if(!(c.length<3)){var d=EllipsoidTangentPlane.fromPoints(c,i),h=PolygonGeometryLibrary.polygonsFromHierarchy(a,d.projectPointsOntoPlane.bind(d),!o,i),p=h.hierarchy,f=h.polygons;if(0!==p.length){c=p[0].outerRing;var m,g=PolygonGeometryLibrary.computeBoundingRectangle(d.plane.normal,d.projectPointOntoPlane.bind(d),c,n,scratchBoundingRectangle),y=[],v=e._height,_=e._extrudedHeight,C={perPositionHeight:o,vertexFormat:t,geometry:void 0,tangentPlane:d,boundingRectangle:g,ellipsoid:i,stRotation:n,bottom:!1,top:!0,wall:!1,extrude:!1,arcType:u};if(e._perPositionHeightExtrude||!CesiumMath.equalsEpsilon(v,_,0,CesiumMath.EPSILON2))for(C.extrude=!0,C.top=s,C.bottom=l,C.shadowVolume=e._shadowVolume,C.offsetAttribute=e._offsetAttribute,m=0;m<f.length;m++){var x,b=createGeometryFromPositionsExtruded(i,f[m],r,p[m],o,s,l,t,u);s&&l?(x=b.topAndBottom,C.geometry=PolygonGeometryLibrary.scaleToGeodeticHeightExtruded(x.geometry,v,_,i,o)):s?((x=b.topAndBottom).geometry.attributes.position.values=PolygonPipeline.scaleToGeodeticHeight(x.geometry.attributes.position.values,v,i,!o),C.geometry=x.geometry):l&&((x=b.topAndBottom).geometry.attributes.position.values=PolygonPipeline.scaleToGeodeticHeight(x.geometry.attributes.position.values,_,i,!0),C.geometry=x.geometry),(s||l)&&(C.wall=!1,x.geometry=computeAttributes(C),y.push(x));var A=b.walls;C.wall=!0;for(var S=0;S<A.length;S++){var w=A[S];C.geometry=PolygonGeometryLibrary.scaleToGeodeticHeightExtruded(w.geometry,v,_,i,o),w.geometry=computeAttributes(C),y.push(w)}}else for(m=0;m<f.length;m++){var E=new GeometryInstance({geometry:PolygonGeometryLibrary.createGeometryFromPositions(i,f[m],r,o,t,u)});if(E.geometry.attributes.position.values=PolygonPipeline.scaleToGeodeticHeight(E.geometry.attributes.position.values,v,i,!o),C.geometry=E.geometry,E.geometry=computeAttributes(C),defined(e._offsetAttribute)){var T=E.geometry.attributes.position.values.length,P=new Uint8Array(T/3);arrayFill(P,e._offsetAttribute===GeometryOffsetAttribute$1.NONE?0:1),E.geometry.attributes.applyOffset=new GeometryAttribute({componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE,componentsPerAttribute:1,values:P})}y.push(E)}var M=GeometryPipeline.combineInstances(y)[0];M.attributes.position.values=new Float64Array(M.attributes.position.values),M.indices=IndexDatatype$1.createTypedArray(M.attributes.position.values.length/3,M.indices);var D=M.attributes,I=BoundingSphere.fromVertices(D.position.values);return t.position||delete D.position,new Geometry({attributes:D,indices:M.indices,primitiveType:M.primitiveType,boundingSphere:I,offsetAttribute:e._offsetAttribute})}}},PolygonGeometry.createShadowVolume=function(e,t,i){var r=e._granularity,n=e._ellipsoid,a=t(r,n),o=i(r,n);return new PolygonGeometry({polygonHierarchy:e._polygonHierarchy,ellipsoid:n,stRotation:e._stRotation,granularity:r,perPositionHeight:!1,extrudedHeight:a,height:o,vertexFormat:VertexFormat.POSITION_ONLY,shadowVolume:!0,arcType:e._arcType})},Object.defineProperties(PolygonGeometry.prototype,{rectangle:{get:function(){if(!defined(this._rectangle)){var e=this._polygonHierarchy.positions;this._rectangle=computeRectangle(e,this._ellipsoid,this._arcType,this._granularity)}return this._rectangle}},textureCoordinateRotationPoints:{get:function(){return defined(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=textureCoordinateRotationPoints(this)),this._textureCoordinateRotationPoints}}});var PolylinePipeline={numberOfPoints:function(e,t,i){var r=Cartesian3.distance(e,t);return Math.ceil(r/i)},numberOfPointsRhumbLine:function(e,t,i){var r=Math.pow(e.longitude-t.longitude,2)+Math.pow(e.latitude-t.latitude,2);return Math.ceil(Math.sqrt(r/(i*i)))}},cartoScratch$1=new Cartographic;PolylinePipeline.extractHeights=function(e,t){for(var i=e.length,r=new Array(i),n=0;n<i;n++){var a=e[n];r[n]=t.cartesianToCartographic(a,cartoScratch$1).height}return r};var wrapLongitudeInversMatrix=new Matrix4,wrapLongitudeOrigin=new Cartesian3,wrapLongitudeXZNormal=new Cartesian3,wrapLongitudeXZPlane=new Plane(Cartesian3.UNIT_X,0),wrapLongitudeYZNormal=new Cartesian3,wrapLongitudeYZPlane=new Plane(Cartesian3.UNIT_X,0),wrapLongitudeIntersection=new Cartesian3,wrapLongitudeOffset=new Cartesian3,subdivideHeightsScratchArray=[];function subdivideHeights(e,t,i){var r,n=subdivideHeightsScratchArray;if(n.length=e,t===i){for(r=0;r<e;r++)n[r]=t;return n}var a=(i-t)/e;for(r=0;r<e;r++){var o=t+r*a;n[r]=o}return n}var carto1=new Cartographic,carto2=new Cartographic,cartesian=new Cartesian3,scaleFirst=new Cartesian3,scaleLast=new Cartesian3,ellipsoidGeodesic$1=new EllipsoidGeodesic,ellipsoidRhumb=new EllipsoidRhumbLine;function generateCartesianArc(e,t,i,r,n,a,o,s){var l=r.scaleToGeodeticSurface(e,scaleFirst),u=r.scaleToGeodeticSurface(t,scaleLast),c=PolylinePipeline.numberOfPoints(e,t,i),d=r.cartesianToCartographic(l,carto1),h=r.cartesianToCartographic(u,carto2),p=subdivideHeights(c,n,a);ellipsoidGeodesic$1.setEndPoints(d,h);var f=ellipsoidGeodesic$1.surfaceDistance/c,m=s;d.height=n;var g=r.cartographicToCartesian(d,cartesian);Cartesian3.pack(g,o,m),m+=3;for(var y=1;y<c;y++){var v=ellipsoidGeodesic$1.interpolateUsingSurfaceDistance(y*f,carto2);v.height=p[y],g=r.cartographicToCartesian(v,cartesian),Cartesian3.pack(g,o,m),m+=3}return m}function generateCartesianRhumbArc(e,t,i,r,n,a,o,s){var l=r.scaleToGeodeticSurface(e,scaleFirst),u=r.scaleToGeodeticSurface(t,scaleLast),c=r.cartesianToCartographic(l,carto1),d=r.cartesianToCartographic(u,carto2),h=PolylinePipeline.numberOfPointsRhumbLine(c,d,i),p=subdivideHeights(h,n,a);ellipsoidRhumb.ellipsoid.equals(r)||(ellipsoidRhumb=new EllipsoidRhumbLine(void 0,void 0,r)),ellipsoidRhumb.setEndPoints(c,d);var f=ellipsoidRhumb.surfaceDistance/h,m=s;c.height=n;var g=r.cartographicToCartesian(c,cartesian);Cartesian3.pack(g,o,m),m+=3;for(var y=1;y<h;y++){var v=ellipsoidRhumb.interpolateUsingSurfaceDistance(y*f,carto2);v.height=p[y],g=r.cartographicToCartesian(v,cartesian),Cartesian3.pack(g,o,m),m+=3}return m}PolylinePipeline.wrapLongitude=function(e,t){var i=[],r=[];if(defined(e)&&0<e.length){t=defaultValue(t,Matrix4.IDENTITY);var n=Matrix4.inverseTransformation(t,wrapLongitudeInversMatrix),a=Matrix4.multiplyByPoint(n,Cartesian3.ZERO,wrapLongitudeOrigin),o=Cartesian3.normalize(Matrix4.multiplyByPointAsVector(n,Cartesian3.UNIT_Y,wrapLongitudeXZNormal),wrapLongitudeXZNormal),s=Plane.fromPointNormal(a,o,wrapLongitudeXZPlane),l=Cartesian3.normalize(Matrix4.multiplyByPointAsVector(n,Cartesian3.UNIT_X,wrapLongitudeYZNormal),wrapLongitudeYZNormal),u=Plane.fromPointNormal(a,l,wrapLongitudeYZPlane),c=1;i.push(Cartesian3.clone(e[0]));for(var d=i[0],h=e.length,p=1;p<h;++p){var f=e[p];if(Plane.getPointDistance(u,d)<0||Plane.getPointDistance(u,f)<0){var m=IntersectionTests.lineSegmentPlane(d,f,s,wrapLongitudeIntersection);if(defined(m)){var g=Cartesian3.multiplyByScalar(o,5e-9,wrapLongitudeOffset);Plane.getPointDistance(s,d)<0&&Cartesian3.negate(g,g),i.push(Cartesian3.add(m,g,new Cartesian3)),r.push(c+1),Cartesian3.negate(g,g),i.push(Cartesian3.add(m,g,new Cartesian3)),c=1}}i.push(Cartesian3.clone(e[p])),c++,d=f}r.push(c)}return{positions:i,lengths:r}},PolylinePipeline.generateArc=function(e){defined(e)||(e={});var t=e.positions,i=t.length,r=defaultValue(e.ellipsoid,Ellipsoid.WGS84),n=defaultValue(e.height,0),a=Array.isArray(n);if(i<1)return[];if(1===i){var o=r.scaleToGeodeticSurface(t[0],scaleFirst);if(0!==(n=a?n[0]:n)){var s=r.geodeticSurfaceNormal(o,cartesian);Cartesian3.multiplyByScalar(s,n,s),Cartesian3.add(o,s,o)}return[o.x,o.y,o.z]}var l=e.minDistance;if(!defined(l)){var u=defaultValue(e.granularity,CesiumMath.RADIANS_PER_DEGREE);l=CesiumMath.chordLength(u,r.maximumRadius)}var c,d=0;for(c=0;c<i-1;c++)d+=PolylinePipeline.numberOfPoints(t[c],t[c+1],l);var h=3*(d+1),p=new Array(h),f=0;for(c=0;c<i-1;c++){f=generateCartesianArc(t[c],t[c+1],l,r,a?n[c]:n,a?n[c+1]:n,p,f)}subdivideHeightsScratchArray.length=0;var m=t[i-1],g=r.cartesianToCartographic(m,carto1);g.height=a?n[i-1]:n;var y=r.cartographicToCartesian(g,cartesian);return Cartesian3.pack(y,p,h-3),p};var scratchCartographic0$1=new Cartographic,scratchCartographic1$1=new Cartographic;PolylinePipeline.generateRhumbArc=function(e){defined(e)||(e={});var t=e.positions,i=t.length,r=defaultValue(e.ellipsoid,Ellipsoid.WGS84),n=defaultValue(e.height,0),a=Array.isArray(n);if(i<1)return[];if(1===i){var o=r.scaleToGeodeticSurface(t[0],scaleFirst);if(0!==(n=a?n[0]:n)){var s=r.geodeticSurfaceNormal(o,cartesian);Cartesian3.multiplyByScalar(s,n,s),Cartesian3.add(o,s,o)}return[o.x,o.y,o.z]}var l,u,c=defaultValue(e.granularity,CesiumMath.RADIANS_PER_DEGREE),d=0,h=r.cartesianToCartographic(t[0],scratchCartographic0$1);for(l=0;l<i-1;l++)u=r.cartesianToCartographic(t[l+1],scratchCartographic1$1),d+=PolylinePipeline.numberOfPointsRhumbLine(h,u,c),h=Cartographic.clone(u,scratchCartographic0$1);var p=3*(d+1),f=new Array(p),m=0;for(l=0;l<i-1;l++){m=generateCartesianRhumbArc(t[l],t[l+1],c,r,a?n[l]:n,a?n[l+1]:n,f,m)}subdivideHeightsScratchArray.length=0;var g=t[i-1],y=r.cartesianToCartographic(g,carto1);y.height=a?n[i-1]:n;var v=r.cartographicToCartesian(y,cartesian);return Cartesian3.pack(v,f,p-3),f},PolylinePipeline.generateCartesianArc=function(e){for(var t=PolylinePipeline.generateArc(e),i=t.length/3,r=new Array(i),n=0;n<i;n++)r[n]=Cartesian3.unpack(t,3*n);return r},PolylinePipeline.generateCartesianRhumbArc=function(e){for(var t=PolylinePipeline.generateRhumbArc(e),i=t.length/3,r=new Array(i),n=0;n<i;n++)r[n]=Cartesian3.unpack(t,3*n);return r};var scratchInterpolateColorsArray=[];function interpolateColors(e,t,i,r,n){var a,o=scratchInterpolateColorsArray;o.length=n;var s=i.red,l=i.green,u=i.blue,c=i.alpha,d=r.red,h=r.green,p=r.blue,f=r.alpha;if(Color.equals(i,r)){for(a=0;a<n;a++)o[a]=Color.clone(i);return o}var m=(d-s)/n,g=(h-l)/n,y=(p-u)/n,v=(f-c)/n;for(a=0;a<n;a++)o[a]=new Color(s+a*m,l+a*g,u+a*y,c+a*v);return o}function PolylineGeometry(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).positions,i=e.colors,r=defaultValue(e.width,1),n=defaultValue(e.colorsPerVertex,!1);this._positions=t,this._colors=i,this._width=r,this._colorsPerVertex=n,this._vertexFormat=VertexFormat.clone(defaultValue(e.vertexFormat,VertexFormat.DEFAULT)),this._arcType=defaultValue(e.arcType,ArcType$1.GEODESIC),this._granularity=defaultValue(e.granularity,CesiumMath.RADIANS_PER_DEGREE),this._ellipsoid=Ellipsoid.clone(defaultValue(e.ellipsoid,Ellipsoid.WGS84)),this._workerName="createPolylineGeometry";var a=1+t.length*Cartesian3.packedLength;a+=defined(i)?1+i.length*Color.packedLength:1,this.packedLength=a+Ellipsoid.packedLength+VertexFormat.packedLength+4}PolylineGeometry.pack=function(e,t,i){var r;i=defaultValue(i,0);var n=e._positions,a=n.length;for(t[i++]=a,r=0;r<a;++r,i+=Cartesian3.packedLength)Cartesian3.pack(n[r],t,i);var o=e._colors;for(a=defined(o)?o.length:0,t[i++]=a,r=0;r<a;++r,i+=Color.packedLength)Color.pack(o[r],t,i);return Ellipsoid.pack(e._ellipsoid,t,i),i+=Ellipsoid.packedLength,VertexFormat.pack(e._vertexFormat,t,i),i+=VertexFormat.packedLength,t[i++]=e._width,t[i++]=e._colorsPerVertex?1:0,t[i++]=e._arcType,t[i]=e._granularity,t};var scratchEllipsoid$1=Ellipsoid.clone(Ellipsoid.UNIT_SPHERE),scratchVertexFormat$1=new VertexFormat,scratchOptions={positions:void 0,colors:void 0,ellipsoid:scratchEllipsoid$1,vertexFormat:scratchVertexFormat$1,width:void 0,colorsPerVertex:void 0,arcType:void 0,granularity:void 0};PolylineGeometry.unpack=function(e,t,i){var r;t=defaultValue(t,0);var n=e[t++],a=new Array(n);for(r=0;r<n;++r,t+=Cartesian3.packedLength)a[r]=Cartesian3.unpack(e,t);var o=0<(n=e[t++])?new Array(n):void 0;for(r=0;r<n;++r,t+=Color.packedLength)o[r]=Color.unpack(e,t);var s=Ellipsoid.unpack(e,t,scratchEllipsoid$1);t+=Ellipsoid.packedLength;var l=VertexFormat.unpack(e,t,scratchVertexFormat$1);t+=VertexFormat.packedLength;var u=e[t++],c=1===e[t++],d=e[t++],h=e[t];return defined(i)?(i._positions=a,i._colors=o,i._ellipsoid=Ellipsoid.clone(s,i._ellipsoid),i._vertexFormat=VertexFormat.clone(l,i._vertexFormat),i._width=u,i._colorsPerVertex=c,i._arcType=d,i._granularity=h,i):(scratchOptions.positions=a,scratchOptions.colors=o,scratchOptions.width=u,scratchOptions.colorsPerVertex=c,scratchOptions.arcType=d,scratchOptions.granularity=h,new PolylineGeometry(scratchOptions))};var scratchCartesian3$6=new Cartesian3,scratchPosition$3=new Cartesian3,scratchPrevPosition=new Cartesian3,scratchNextPosition=new Cartesian3;PolylineGeometry.createGeometry=function(e){var t,i,r,n=e._width,a=e._vertexFormat,o=e._colors,s=e._colorsPerVertex,l=e._arcType,u=e._granularity,c=e._ellipsoid,d=arrayRemoveDuplicates(e._positions,Cartesian3.equalsEpsilon),h=d.length;if(!(h<2||n<=0)){if(l===ArcType$1.GEODESIC||l===ArcType$1.RHUMB){var p,f;f=l===ArcType$1.GEODESIC?(p=CesiumMath.chordLength(u,c.maximumRadius),PolylinePipeline.numberOfPoints):(p=u,PolylinePipeline.numberOfPointsRhumbLine);var m=PolylinePipeline.extractHeights(d,c);if(defined(o)){var g=1;for(t=0;t<h-1;++t)g+=f(d[t],d[t+1],p);var y=new Array(g),v=0;for(t=0;t<h-1;++t){var _=d[t],C=d[t+1],x=o[t],b=f(_,C,p);if(s&&t<g){var A=interpolateColors(_,C,x,o[t+1],b),S=A.length;for(i=0;i<S;++i)y[v++]=A[i]}else for(i=0;i<b;++i)y[v++]=Color.clone(x)}y[v]=Color.clone(o[o.length-1]),o=y,scratchInterpolateColorsArray.length=0}d=l===ArcType$1.GEODESIC?PolylinePipeline.generateCartesianArc({positions:d,minDistance:p,ellipsoid:c,height:m}):PolylinePipeline.generateCartesianRhumbArc({positions:d,granularity:p,ellipsoid:c,height:m})}var w,E=4*(h=d.length)-4,T=new Float64Array(3*E),P=new Float64Array(3*E),M=new Float64Array(3*E),D=new Float32Array(2*E),I=a.st?new Float32Array(2*E):void 0,O=defined(o)?new Uint8Array(4*E):void 0,R=0,L=0,N=0,k=0;for(i=0;i<h;++i){var B,F;0===i?(w=scratchCartesian3$6,Cartesian3.subtract(d[0],d[1],w),Cartesian3.add(d[0],w,w)):w=d[i-1],Cartesian3.clone(w,scratchPrevPosition),Cartesian3.clone(d[i],scratchPosition$3),i===h-1?(w=scratchCartesian3$6,Cartesian3.subtract(d[h-1],d[h-2],w),Cartesian3.add(d[h-1],w,w)):w=d[i+1],Cartesian3.clone(w,scratchNextPosition),defined(O)&&(B=0===i||s?o[i]:o[i-1],i!==h-1&&(F=o[i]));var V=i===h-1?2:4;for(r=0===i?2:0;r<V;++r){Cartesian3.pack(scratchPosition$3,T,R),Cartesian3.pack(scratchPrevPosition,P,R),Cartesian3.pack(scratchNextPosition,M,R),R+=3;var z=r-2<0?-1:1;if(D[L++]=r%2*2-1,D[L++]=z*n,a.st&&(I[N++]=i/(h-1),I[N++]=Math.max(D[L-2],0)),defined(O)){var U=r<2?B:F;O[k++]=Color.floatToByte(U.red),O[k++]=Color.floatToByte(U.green),O[k++]=Color.floatToByte(U.blue),O[k++]=Color.floatToByte(U.alpha)}}}var G=new GeometryAttributes;G.position=new GeometryAttribute({componentDatatype:ComponentDatatype$1.DOUBLE,componentsPerAttribute:3,values:T}),G.prevPosition=new GeometryAttribute({componentDatatype:ComponentDatatype$1.DOUBLE,componentsPerAttribute:3,values:P}),G.nextPosition=new GeometryAttribute({componentDatatype:ComponentDatatype$1.DOUBLE,componentsPerAttribute:3,values:M}),G.expandAndWidth=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:2,values:D}),a.st&&(G.st=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:2,values:I})),defined(O)&&(G.color=new GeometryAttribute({componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE,componentsPerAttribute:4,values:O,normalize:!0}));var $=IndexDatatype$1.createTypedArray(E,6*h-6),H=0,W=0,j=h-1;for(i=0;i<j;++i)$[W++]=H,$[W++]=H+2,$[W++]=H+1,$[W++]=H+1,$[W++]=H+2,$[W++]=H+3,H+=4;return new Geometry({attributes:G,indices:$,primitiveType:PrimitiveType$1.TRIANGLES,boundingSphere:BoundingSphere.fromPoints(d),geometryType:GeometryType$1.POLYLINES})}};var AllMaterialAppearanceFS="varying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec3 v_tangentEC;\nvarying vec3 v_bitangentEC;\nvarying vec2 v_st;\nvoid main()\n{\nvec3 positionToEyeEC = -v_positionEC;\nmat3 tangentToEyeMatrix = czm_tangentToEyeSpaceMatrix(v_normalEC, v_tangentEC, v_bitangentEC);\nvec3 normalEC = normalize(v_normalEC);\n#ifdef FACE_FORWARD\nnormalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n#endif\nczm_materialInput materialInput;\nmaterialInput.normalEC = normalEC;\nmaterialInput.tangentToEyeMatrix = tangentToEyeMatrix;\nmaterialInput.positionToEyeEC = positionToEyeEC;\nmaterialInput.st = v_st;\nczm_material material = czm_getMaterial(materialInput);\n#ifdef FLAT\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#else\ngl_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);\n#endif\n}\n",AllMaterialAppearanceVS="attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 normal;\nattribute vec3 tangent;\nattribute vec3 bitangent;\nattribute vec2 st;\nattribute float batchId;\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec3 v_tangentEC;\nvarying vec3 v_bitangentEC;\nvarying vec2 v_st;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\nv_normalEC = czm_normal * normal;\nv_tangentEC = czm_normal * tangent;\nv_bitangentEC = czm_normal * bitangent;\nv_st = st;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n",BasicMaterialAppearanceFS="varying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvoid main()\n{\nvec3 positionToEyeEC = -v_positionEC;\nvec3 normalEC = normalize(v_normalEC);\n#ifdef FACE_FORWARD\nnormalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n#endif\nczm_materialInput materialInput;\nmaterialInput.normalEC = normalEC;\nmaterialInput.positionToEyeEC = positionToEyeEC;\nczm_material material = czm_getMaterial(materialInput);\n#ifdef FLAT\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#else\ngl_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);\n#endif\n}\n",BasicMaterialAppearanceVS="attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 normal;\nattribute float batchId;\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\nv_normalEC = czm_normal * normal;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n",TexturedMaterialAppearanceFS="varying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec2 v_st;\nvoid main()\n{\nvec3 positionToEyeEC = -v_positionEC;\nvec3 normalEC = normalize(v_normalEC);\n#ifdef FACE_FORWARD\nnormalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n#endif\nczm_materialInput materialInput;\nmaterialInput.normalEC = normalEC;\nmaterialInput.positionToEyeEC = positionToEyeEC;\nmaterialInput.st = v_st;\nczm_material material = czm_getMaterial(materialInput);\n#ifdef FLAT\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#else\ngl_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);\n#endif\n}\n",TexturedMaterialAppearanceVS="attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 normal;\nattribute vec2 st;\nattribute float batchId;\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec2 v_st;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\nv_normalEC = czm_normal * normal;\nv_st = st;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n";function MaterialAppearance(e){var t=defaultValue((e=defaultValue(e,defaultValue.EMPTY_OBJECT)).translucent,!0),i=defaultValue(e.closed,!1),r=defaultValue(e.materialSupport,MaterialAppearance.MaterialSupport.TEXTURED);this.material=defined(e.material)?e.material:Material.fromType(Material.ColorType),this.translucent=t,this._vertexShaderSource=defaultValue(e.vertexShaderSource,r.vertexShaderSource),this._fragmentShaderSource=defaultValue(e.fragmentShaderSource,r.fragmentShaderSource),this._renderState=Appearance.getDefaultRenderState(t,i,e.renderState),this._closed=i,this._materialSupport=r,this._vertexFormat=r.vertexFormat,this._flat=defaultValue(e.flat,!1),this._faceForward=defaultValue(e.faceForward,!i)}Object.defineProperties(MaterialAppearance.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},materialSupport:{get:function(){return this._materialSupport}},vertexFormat:{get:function(){return this._vertexFormat}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}}}),MaterialAppearance.prototype.getFragmentShaderSource=Appearance.prototype.getFragmentShaderSource,MaterialAppearance.prototype.isTranslucent=Appearance.prototype.isTranslucent,MaterialAppearance.prototype.getRenderState=Appearance.prototype.getRenderState,MaterialAppearance.MaterialSupport={BASIC:Object.freeze({vertexFormat:VertexFormat.POSITION_AND_NORMAL,vertexShaderSource:BasicMaterialAppearanceVS,fragmentShaderSource:BasicMaterialAppearanceFS}),TEXTURED:Object.freeze({vertexFormat:VertexFormat.POSITION_NORMAL_AND_ST,vertexShaderSource:TexturedMaterialAppearanceVS,fragmentShaderSource:TexturedMaterialAppearanceFS}),ALL:Object.freeze({vertexFormat:VertexFormat.ALL,vertexShaderSource:AllMaterialAppearanceVS,fragmentShaderSource:AllMaterialAppearanceFS})};var EllipsoidSurfaceAppearanceFS="varying vec3 v_positionMC;\nvarying vec3 v_positionEC;\nvarying vec2 v_st;\nvoid main()\n{\nczm_materialInput materialInput;\nvec3 normalEC = normalize(czm_normal3D * czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0)));\n#ifdef FACE_FORWARD\nnormalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n#endif\nmaterialInput.s = v_st.s;\nmaterialInput.st = v_st;\nmaterialInput.str = vec3(v_st, 0.0);\nmaterialInput.normalEC = normalEC;\nmaterialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, materialInput.normalEC);\nvec3 positionToEyeEC = -v_positionEC;\nmaterialInput.positionToEyeEC = positionToEyeEC;\nczm_material material = czm_getMaterial(materialInput);\n#ifdef FLAT\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#else\ngl_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);\n#endif\n}\n",EllipsoidSurfaceAppearanceVS="attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec2 st;\nattribute float batchId;\nvarying vec3 v_positionMC;\nvarying vec3 v_positionEC;\nvarying vec2 v_st;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_positionMC = position3DHigh + position3DLow;\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\nv_st = st;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n";function EllipsoidSurfaceAppearance(e){var t=defaultValue((e=defaultValue(e,defaultValue.EMPTY_OBJECT)).translucent,!0),i=defaultValue(e.aboveGround,!1);this.material=defined(e.material)?e.material:Material.fromType(Material.ColorType),this.translucent=defaultValue(e.translucent,!0),this._vertexShaderSource=defaultValue(e.vertexShaderSource,EllipsoidSurfaceAppearanceVS),this._fragmentShaderSource=defaultValue(e.fragmentShaderSource,EllipsoidSurfaceAppearanceFS),this._renderState=Appearance.getDefaultRenderState(t,!i,e.renderState),this._closed=!1,this._flat=defaultValue(e.flat,!1),this._faceForward=defaultValue(e.faceForward,i),this._aboveGround=i}Object.defineProperties(EllipsoidSurfaceAppearance.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return EllipsoidSurfaceAppearance.VERTEX_FORMAT}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}},aboveGround:{get:function(){return this._aboveGround}}}),EllipsoidSurfaceAppearance.VERTEX_FORMAT=VertexFormat.POSITION_AND_ST,EllipsoidSurfaceAppearance.prototype.getFragmentShaderSource=Appearance.prototype.getFragmentShaderSource,EllipsoidSurfaceAppearance.prototype.isTranslucent=Appearance.prototype.isTranslucent,EllipsoidSurfaceAppearance.prototype.getRenderState=Appearance.prototype.getRenderState;var PolylineVS="attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 position2DHigh;\nattribute vec3 position2DLow;\nattribute vec3 prevPosition3DHigh;\nattribute vec3 prevPosition3DLow;\nattribute vec3 prevPosition2DHigh;\nattribute vec3 prevPosition2DLow;\nattribute vec3 nextPosition3DHigh;\nattribute vec3 nextPosition3DLow;\nattribute vec3 nextPosition2DHigh;\nattribute vec3 nextPosition2DLow;\nattribute vec4 texCoordExpandAndBatchIndex;\nvarying vec2 v_st;\nvarying float v_width;\nvarying vec4 v_pickColor;\nvarying float v_polylineAngle;\nvoid main()\n{\nfloat texCoord = texCoordExpandAndBatchIndex.x;\nfloat expandDir = texCoordExpandAndBatchIndex.y;\nbool usePrev = texCoordExpandAndBatchIndex.z < 0.0;\nfloat batchTableIndex = texCoordExpandAndBatchIndex.w;\nvec2 widthAndShow = batchTable_getWidthAndShow(batchTableIndex);\nfloat width = widthAndShow.x + 0.5;\nfloat show = widthAndShow.y;\nif (width < 1.0)\n{\nshow = 0.0;\n}\nvec4 pickColor = batchTable_getPickColor(batchTableIndex);\nvec4 p, prev, next;\nif (czm_morphTime == 1.0)\n{\np = czm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz);\nprev = czm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz);\nnext = czm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz);\n}\nelse if (czm_morphTime == 0.0)\n{\np = czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy);\nprev = czm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy);\nnext = czm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy);\n}\nelse\n{\np = czm_columbusViewMorph(\nczm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy),\nczm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz),\nczm_morphTime);\nprev = czm_columbusViewMorph(\nczm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy),\nczm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz),\nczm_morphTime);\nnext = czm_columbusViewMorph(\nczm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy),\nczm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz),\nczm_morphTime);\n}\nvec4 positionEC = czm_modelViewRelativeToEye * p;\n#if defined(FRAGMENT_DEPTH_CHECK) || defined(VERTEX_DEPTH_CHECK)\nfloat eyeDepth = positionEC.z;\n#endif\n#ifdef DISTANCE_DISPLAY_CONDITION\nvec3 centerHigh = batchTable_getCenterHigh(batchTableIndex);\nvec4 centerLowAndRadius = batchTable_getCenterLowAndRadius(batchTableIndex);\nvec3 centerLow = centerLowAndRadius.xyz;\nfloat radius = centerLowAndRadius.w;\nvec2 distanceDisplayCondition = batchTable_getDistanceDisplayCondition(batchTableIndex);\nfloat lengthSq;\nif (czm_sceneMode == czm_sceneMode2D)\n{\nlengthSq = czm_eyeHeight2D.y;\n}\nelse\n{\nvec4 center = czm_translateRelativeToEye(centerHigh.xyz, centerLow.xyz);\nlengthSq = max(0.0, dot(center.xyz, center.xyz) - radius * radius);\n}\nfloat nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x;\nfloat farSq = distanceDisplayCondition.y * distanceDisplayCondition.y;\nif (lengthSq < nearSq || lengthSq > farSq)\n{\nshow = 0.0;\n}\n#endif\nvec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, v_polylineAngle);\ngl_Position = czm_viewportOrthographic * positionWC * show;\n#ifdef DISABLE_DEPTH_DISTANCE\n{\n{\ngl_Position.z = -gl_Position.w;\n#ifdef LOG_DEPTH\nv_depthFromNearPlusOne = 1.0;\n#endif\n}\n}\n#endif\nv_st = vec2(texCoord, clamp(expandDir, 0.0, 1.0));\nv_width = width;\nv_pickColor = pickColor;\n}\n";function Polyline(e,t){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this._show=defaultValue(e.show,!0),this._width=defaultValue(e.width,1),this._loop=defaultValue(e.loop,!1),this._distanceDisplayCondition=e.distanceDisplayCondition,this._disableDepthTestDistance=e.disableDepthTestDistance,this._material=e.material,defined(this._material)||(this._material=Material.fromType(Material.ColorType,{color:new Color(1,1,1,1)}));var i,r=e.positions;defined(r)||(r=[]),this._positions=r,this._actualPositions=arrayRemoveDuplicates(r,Cartesian3.equalsEpsilon),this._loop&&2<this._actualPositions.length&&(this._actualPositions===this._positions&&(this._actualPositions=r.slice()),this._actualPositions.push(Cartesian3.clone(this._actualPositions[0]))),this._length=this._actualPositions.length,this._id=e.id,defined(t)&&(i=Matrix4.clone(t.modelMatrix)),this._modelMatrix=i,this._segments=PolylinePipeline.wrapLongitude(this._actualPositions,i),this._actualLength=void 0,this._propertiesChanged=new Uint32Array(NUMBER_OF_PROPERTIES$2),this._polylineCollection=t,this._dirty=!1,this._pickId=void 0,this._boundingVolume=BoundingSphere.fromPoints(this._actualPositions),this._boundingVolumeWC=BoundingSphere.transform(this._boundingVolume,this._modelMatrix),this._boundingVolume2D=new BoundingSphere}var POSITION_INDEX$4=Polyline.POSITION_INDEX=0,SHOW_INDEX$4=Polyline.SHOW_INDEX=1,WIDTH_INDEX=Polyline.WIDTH_INDEX=2,MATERIAL_INDEX=Polyline.MATERIAL_INDEX=3,POSITION_SIZE_INDEX=Polyline.POSITION_SIZE_INDEX=4,DISTANCE_DISPLAY_CONDITION$1=Polyline.DISTANCE_DISPLAY_CONDITION=5,DISABLE_DEPTH_DISTANCE$2=Polyline.DISABLE_DEPTH_DISTANCE=6,NUMBER_OF_PROPERTIES$2=Polyline.NUMBER_OF_PROPERTIES=7;function makeDirty$2(e,t){++e._propertiesChanged[t];var i=e._polylineCollection;defined(i)&&(i._updatePolyline(e,t),e._dirty=!0)}Object.defineProperties(Polyline.prototype,{show:{get:function(){return this._show},set:function(e){e!==this._show&&(this._show=e,makeDirty$2(this,SHOW_INDEX$4))}},positions:{get:function(){return this._positions},set:function(e){var t=arrayRemoveDuplicates(e,Cartesian3.equalsEpsilon);this._loop&&2<t.length&&(t===e&&(t=e.slice()),t.push(Cartesian3.clone(t[0]))),this._actualPositions.length===t.length&&this._actualPositions.length===this._length||makeDirty$2(this,POSITION_SIZE_INDEX),this._positions=e,this._actualPositions=t,this._length=t.length,this._boundingVolume=BoundingSphere.fromPoints(this._actualPositions,this._boundingVolume),this._boundingVolumeWC=BoundingSphere.transform(this._boundingVolume,this._modelMatrix,this._boundingVolumeWC),makeDirty$2(this,POSITION_INDEX$4),this.update()}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,makeDirty$2(this,MATERIAL_INDEX))}},width:{get:function(){return this._width},set:function(e){e!==this._width&&(this._width=e,makeDirty$2(this,WIDTH_INDEX))}},loop:{get:function(){return this._loop},set:function(e){if(e!==this._loop){var t=this._actualPositions;e?2<t.length&&!Cartesian3.equals(t[0],t[t.length-1])&&(t.length===this._positions.length&&(this._actualPositions=t=this._positions.slice()),t.push(Cartesian3.clone(t[0]))):2<t.length&&Cartesian3.equals(t[0],t[t.length-1])&&(t.length-1===this._positions.length?this._actualPositions=this._positions:t.pop()),this._loop=e,makeDirty$2(this,POSITION_SIZE_INDEX)}}},id:{get:function(){return this._id},set:function(e){this._id=e,defined(this._pickId)&&(this._pickId.object.id=e)}},pickId:{get:function(){return this._pickId}},isDestroyed:{get:function(){return!defined(this._polylineCollection)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){DistanceDisplayCondition.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=DistanceDisplayCondition.clone(e,this._distanceDisplayCondition),makeDirty$2(this,DISTANCE_DISPLAY_CONDITION$1))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,makeDirty$2(this,DISABLE_DEPTH_DISTANCE$2))}}}),Polyline.prototype.update=function(){var e=Matrix4.IDENTITY;defined(this._polylineCollection)&&(e=this._polylineCollection.modelMatrix);var t=this._segments.positions.length,i=this._segments.lengths,r=0<this._propertiesChanged[POSITION_INDEX$4]||0<this._propertiesChanged[POSITION_SIZE_INDEX];if(Matrix4.equals(e,this._modelMatrix)&&!r||(this._segments=PolylinePipeline.wrapLongitude(this._actualPositions,e),this._boundingVolumeWC=BoundingSphere.transform(this._boundingVolume,e,this._boundingVolumeWC)),this._modelMatrix=Matrix4.clone(e,this._modelMatrix),this._segments.positions.length!==t)makeDirty$2(this,POSITION_SIZE_INDEX);else for(var n=i.length,a=0;a<n;++a)if(i[a]!==this._segments.lengths[a]){makeDirty$2(this,POSITION_SIZE_INDEX);break}},Polyline.prototype.getPickId=function(e){return defined(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._polylineCollection,id:this._id})),this._pickId},Polyline.prototype._clean=function(){this._dirty=!1;for(var e=this._propertiesChanged,t=0;t<NUMBER_OF_PROPERTIES$2-1;++t)e[t]=0},Polyline.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._material=this._material&&this._material.destroy(),this._polylineCollection=void 0};var SHOW_INDEX$5=Polyline.SHOW_INDEX,WIDTH_INDEX$1=Polyline.WIDTH_INDEX,POSITION_INDEX$5=Polyline.POSITION_INDEX,MATERIAL_INDEX$1=Polyline.MATERIAL_INDEX,POSITION_SIZE_INDEX$1=Polyline.POSITION_SIZE_INDEX,DISTANCE_DISPLAY_CONDITION$2=Polyline.DISTANCE_DISPLAY_CONDITION,NUMBER_OF_PROPERTIES$3=Polyline.NUMBER_OF_PROPERTIES,attributeLocations$2={texCoordExpandAndBatchIndex:0,position3DHigh:1,position3DLow:2,position2DHigh:3,position2DLow:4,prevPosition3DHigh:5,prevPosition3DLow:6,prevPosition2DHigh:7,prevPosition2DLow:8,nextPosition3DHigh:9,nextPosition3DLow:10,nextPosition2DHigh:11,nextPosition2DLow:12};function PolylineCollection(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this.modelMatrix=Matrix4.clone(defaultValue(e.modelMatrix,Matrix4.IDENTITY)),this._modelMatrix=Matrix4.clone(Matrix4.IDENTITY),this.debugShowBoundingVolume=defaultValue(e.debugShowBoundingVolume,!1),this._opaqueRS=void 0,this._translucentRS=void 0,this._colorCommands=[],this._polylinesUpdated=!1,this._polylinesRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(NUMBER_OF_PROPERTIES$3),this._polylines=[],this._polylineBuckets={},this._positionBufferUsage={bufferUsage:BufferUsage$1.STATIC_DRAW,frameCount:0},this._mode=void 0,this._polylinesToUpdate=[],this._vertexArrays=[],this._positionBuffer=void 0,this._texCoordExpandAndBatchIndexBuffer=void 0,this._batchTable=void 0,this._createBatchTable=!1,this._useHighlightColor=!1,this._highlightColor=Color.clone(Color.WHITE);var t=this;this._uniformMap={u_highlightColor:function(){return t._highlightColor}}}function createBatchTable$1(e,t){defined(e._batchTable)&&e._batchTable.destroy();var i=[{functionName:"batchTable_getWidthAndShow",componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE,componentsPerAttribute:2},{functionName:"batchTable_getPickColor",componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0},{functionName:"batchTable_getCenterHigh",componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3},{functionName:"batchTable_getCenterLowAndRadius",componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:4},{functionName:"batchTable_getDistanceDisplayCondition",componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:2}];e._batchTable=new BatchTable(t,i,e._polylines.length)}Object.defineProperties(PolylineCollection.prototype,{length:{get:function(){return removePolylines(this),this._polylines.length}}}),PolylineCollection.prototype.add=function(e){var t=new Polyline(e=defaultValue(e,defaultValue.EMPTY_OBJECT),this);return t._index=this._polylines.length,this._polylines.push(t),this._createVertexArray=!0,this._createBatchTable=!0,this.disableDepthTestDistance=e.disableDepthTestDistance,t},PolylineCollection.prototype.remove=function(e){if(this.contains(e)){if(this._polylinesRemoved=!0,this._createVertexArray=!0,this._createBatchTable=!0,defined(e._bucket)){var t=e._bucket;t.shaderProgram=t.shaderProgram&&t.shaderProgram.destroy()}return e._destroy(),!0}return!1},PolylineCollection.prototype.removeAll=function(){releaseShaders(this),destroyPolylines(this),this._polylineBuckets={},this._polylinesRemoved=!1,this._polylines.length=0,this._polylinesToUpdate.length=0,this._createVertexArray=!0},PolylineCollection.prototype.contains=function(e){return defined(e)&&e._polylineCollection===this},PolylineCollection.prototype.get=function(e){return removePolylines(this),this._polylines[e]};var scratchUpdatePolylineEncodedCartesian=new EncodedCartesian3,scratchUpdatePolylineCartesian4=new Cartesian4,scratchNearFarCartesian2=new Cartesian2;PolylineCollection.prototype.update=function(e){if(removePolylines(this),0!==this._polylines.length){updateMode$2(this,e);var t,i=e.context,r=e.mapProjection,n=this._propertiesChanged;if(this._createBatchTable){if(0===ContextLimits.maximumVertexTextureImageUnits)throw new RuntimeError("Vertex texture fetch support is required to render polylines. The maximum number of vertex texture image units must be greater than zero.");createBatchTable$1(this,i),this._createBatchTable=!1}if(this._createVertexArray||computeNewBuffersUsage(this))createVertexArrays(this,i,r);else if(this._polylinesUpdated){var a=this._polylinesToUpdate;if(this._mode!==SceneMode$1.SCENE3D)for(var o=a.length,s=0;s<o;++s)(t=a[s]).update();if(n[POSITION_SIZE_INDEX$1]||n[MATERIAL_INDEX$1])createVertexArrays(this,i,r);else for(var l=a.length,u=this._polylineBuckets,c=0;c<l;++c){n=(t=a[c])._propertiesChanged;var d=t._bucket,h=0;for(var p in u)if(u.hasOwnProperty(p)){if(u[p]===d){n[POSITION_INDEX$5]&&d.writeUpdate(h,t,this._positionBuffer,r);break}h+=u[p].lengthOfPositions}if((n[SHOW_INDEX$5]||n[WIDTH_INDEX$1])&&this._batchTable.setBatchedAttribute(t._index,0,new Cartesian2(t._width,t._show)),2<this._batchTable.attributes.length){if(n[POSITION_INDEX$5]||n[POSITION_SIZE_INDEX$1]){var f=e.mode===SceneMode$1.SCENE2D?t._boundingVolume2D:t._boundingVolumeWC,m=EncodedCartesian3.fromCartesian(f.center,scratchUpdatePolylineEncodedCartesian),g=Cartesian4.fromElements(m.low.x,m.low.y,m.low.z,f.radius,scratchUpdatePolylineCartesian4);this._batchTable.setBatchedAttribute(t._index,2,m.high),this._batchTable.setBatchedAttribute(t._index,3,g)}if(n[DISTANCE_DISPLAY_CONDITION$2]){var y=scratchNearFarCartesian2;y.x=0,y.y=Number.MAX_VALUE;var v=t.distanceDisplayCondition;defined(v)&&(y.x=v.near,y.y=v.far),this._batchTable.setBatchedAttribute(t._index,4,y)}}t._clean()}a.length=0,this._polylinesUpdated=!1}n=this._propertiesChanged;for(var _=0;_<NUMBER_OF_PROPERTIES$3;++_)n[_]=0;var C=Matrix4.IDENTITY;e.mode===SceneMode$1.SCENE3D&&(C=this.modelMatrix);var x=e.passes,b=0!==e.morphTime;if(defined(this._opaqueRS)&&this._opaqueRS.depthTest.enabled===b||(this._opaqueRS=RenderState.fromCache({depthMask:b,depthTest:{enabled:b}})),defined(this._translucentRS)&&this._translucentRS.depthTest.enabled===b||(this._translucentRS=RenderState.fromCache({blending:BlendingState$1.ALPHA_BLEND,depthMask:!b,depthTest:{enabled:b}})),this._batchTable.update(e),x.render||x.pick)createCommandLists(this,e,this._colorCommands,C)}};var boundingSphereScratch=new BoundingSphere,boundingSphereScratch2=new BoundingSphere;function createCommandLists(e,t,i,r){for(var n=t.context,a=t.commandList,o=i.length,s=0,l=!0,u=e._vertexArrays,c=e.debugShowBoundingVolume,d=e._batchTable.getUniformMapCallback(),h=u.length,p=0;p<h;++p)for(var f=u[p],m=f.buckets,g=m.length,y=0;y<g;++y){for(var v,_,C,x,b=m[y],A=b.offset,S=b.bucket.shaderProgram,w=b.bucket.polylines,E=w.length,T=0,P=0;P<E;++P){var M=w[P],D=createMaterialId(M._material);if(D!==v){if(defined(v)&&0<T){var I=_.isTranslucent();o<=s?(C=new DrawCommand({owner:e}),i.push(C)):C=i[s],++s,x=combine(d(_._uniforms),e._uniformMap),C.boundingVolume=BoundingSphere.clone(boundingSphereScratch,C.boundingVolume),C.modelMatrix=r,C.shaderProgram=S,C.vertexArray=f.va,C.renderState=I?e._translucentRS:e._opaqueRS,C.pass=I?Pass$1.TRANSLUCENT:Pass$1.OPAQUE,C.debugShowBoundingVolume=c,C.pickId="v_pickColor",C.uniformMap=x,C.count=T,C.offset=A,A+=T,l=!(T=0),a.push(C)}(_=M._material).update(n),v=D}for(var O,R=M._locatorBuckets,L=R.length,N=0;N<L;++N){var k=R[N];k.locator===b&&(T+=k.count)}t.mode===SceneMode$1.SCENE3D?O=M._boundingVolumeWC:t.mode===SceneMode$1.COLUMBUS_VIEW?O=M._boundingVolume2D:t.mode===SceneMode$1.SCENE2D?defined(M._boundingVolume2D)&&((O=BoundingSphere.clone(M._boundingVolume2D,boundingSphereScratch2)).center.x=0):defined(M._boundingVolumeWC)&&defined(M._boundingVolume2D)&&(O=BoundingSphere.union(M._boundingVolumeWC,M._boundingVolume2D,boundingSphereScratch2)),l?(l=!1,BoundingSphere.clone(O,boundingSphereScratch)):BoundingSphere.union(O,boundingSphereScratch,boundingSphereScratch)}defined(v)&&0<T&&(o<=s?(C=new DrawCommand({owner:e}),i.push(C)):C=i[s],++s,x=combine(d(_._uniforms),e._uniformMap),C.boundingVolume=BoundingSphere.clone(boundingSphereScratch,C.boundingVolume),C.modelMatrix=r,C.shaderProgram=S,C.vertexArray=f.va,C.renderState=_.isTranslucent()?e._translucentRS:e._opaqueRS,C.pass=_.isTranslucent()?Pass$1.TRANSLUCENT:Pass$1.OPAQUE,C.debugShowBoundingVolume=c,C.pickId="v_pickColor",C.uniformMap=x,C.count=T,C.offset=A,l=!0,a.push(C)),v=void 0}i.length=s}function computeNewBuffersUsage(e){var t=!1,i=e._propertiesChanged,r=e._positionBufferUsage;return i[POSITION_INDEX$5]?(r.bufferUsage!==BufferUsage$1.STREAM_DRAW&&(t=!0,r.bufferUsage=BufferUsage$1.STREAM_DRAW),r.frameCount=100):r.bufferUsage!==BufferUsage$1.STATIC_DRAW&&(0===r.frameCount?(t=!0,r.bufferUsage=BufferUsage$1.STATIC_DRAW):r.frameCount--),t}PolylineCollection.prototype.isDestroyed=function(){return!1},PolylineCollection.prototype.destroy=function(){return destroyVertexArrays(this),releaseShaders(this),destroyPolylines(this),this._batchTable=this._batchTable&&this._batchTable.destroy(),destroyObject(this)};var emptyVertexBuffer=[0,0,0];function createVertexArrays(e,t,i){e._createVertexArray=!1,releaseShaders(e),destroyVertexArrays(e),sortPolylinesIntoBuckets(e);var r,n,a=[[]],o=a[0],s=e._batchTable,l=e._useHighlightColor,u=e.disableDepthTestDistance,c=[0],d=0,h=[[]],p=0,f=e._polylineBuckets;for(r in f)f.hasOwnProperty(r)&&((n=f[r]).updateShader(t,s,l,u),p+=n.lengthOfPositions);if(0<p){var m,g=e._mode,y=new Float32Array(6*p*3),v=new Float32Array(4*p),_=0,C=0,x=0;for(r in f)if(f.hasOwnProperty(r)){(n=f[r]).write(y,v,_,C,x,s,t,i),g===SceneMode$1.MORPHING&&(defined(m)||(m=new Float32Array(6*p*3)),n.writeForMorph(m,_));var b=n.lengthOfPositions;_+=6*b*3,C+=4*b,x+=4*b,d=n.updateIndices(a,c,h,d)}var A,S=e._positionBufferUsage.bufferUsage,w=BufferUsage$1.STATIC_DRAW;e._positionBuffer=Buffer$1.createVertexBuffer({context:t,typedArray:y,usage:S}),defined(m)&&(A=Buffer$1.createVertexBuffer({context:t,typedArray:m,usage:S})),e._texCoordExpandAndBatchIndexBuffer=Buffer$1.createVertexBuffer({context:t,typedArray:v,usage:w});for(var E=3*Float32Array.BYTES_PER_ELEMENT,T=4*Float32Array.BYTES_PER_ELEMENT,P=0,M=a.length,D=0;D<M;++D)if(0<(o=a[D]).length){var I=new Uint16Array(o),O=Buffer$1.createIndexBuffer({context:t,typedArray:I,usage:BufferUsage$1.STATIC_DRAW,indexDatatype:IndexDatatype$1.UNSIGNED_SHORT});P+=c[D];var R,L,N,k,B=6*(D*(E*CesiumMath.SIXTY_FOUR_KILOBYTES)-P*E),F=E+B,V=E+F,z=E+V,U=E+z,G=E+U,$=D*(T*CesiumMath.SIXTY_FOUR_KILOBYTES)-P*T,H=[{index:attributeLocations$2.position3DHigh,componentsPerAttribute:3,componentDatatype:ComponentDatatype$1.FLOAT,offsetInBytes:B,strideInBytes:6*E},{index:attributeLocations$2.position3DLow,componentsPerAttribute:3,componentDatatype:ComponentDatatype$1.FLOAT,offsetInBytes:F,strideInBytes:6*E},{index:attributeLocations$2.position2DHigh,componentsPerAttribute:3,componentDatatype:ComponentDatatype$1.FLOAT,offsetInBytes:B,strideInBytes:6*E},{index:attributeLocations$2.position2DLow,componentsPerAttribute:3,componentDatatype:ComponentDatatype$1.FLOAT,offsetInBytes:F,strideInBytes:6*E},{index:attributeLocations$2.prevPosition3DHigh,componentsPerAttribute:3,componentDatatype:ComponentDatatype$1.FLOAT,offsetInBytes:V,strideInBytes:6*E},{index:attributeLocations$2.prevPosition3DLow,componentsPerAttribute:3,componentDatatype:ComponentDatatype$1.FLOAT,offsetInBytes:z,strideInBytes:6*E},{index:attributeLocations$2.prevPosition2DHigh,componentsPerAttribute:3,componentDatatype:ComponentDatatype$1.FLOAT,offsetInBytes:V,strideInBytes:6*E},{index:attributeLocations$2.prevPosition2DLow,componentsPerAttribute:3,componentDatatype:ComponentDatatype$1.FLOAT,offsetInBytes:z,strideInBytes:6*E},{index:attributeLocations$2.nextPosition3DHigh,componentsPerAttribute:3,componentDatatype:ComponentDatatype$1.FLOAT,offsetInBytes:U,strideInBytes:6*E},{index:attributeLocations$2.nextPosition3DLow,componentsPerAttribute:3,componentDatatype:ComponentDatatype$1.FLOAT,offsetInBytes:G,strideInBytes:6*E},{index:attributeLocations$2.nextPosition2DHigh,componentsPerAttribute:3,componentDatatype:ComponentDatatype$1.FLOAT,offsetInBytes:U,strideInBytes:6*E},{index:attributeLocations$2.nextPosition2DLow,componentsPerAttribute:3,componentDatatype:ComponentDatatype$1.FLOAT,offsetInBytes:G,strideInBytes:6*E},{index:attributeLocations$2.texCoordExpandAndBatchIndex,componentsPerAttribute:4,componentDatatype:ComponentDatatype$1.FLOAT,vertexBuffer:e._texCoordExpandAndBatchIndexBuffer,offsetInBytes:$}];k=g===SceneMode$1.SCENE3D?(R=e._positionBuffer,L="vertexBuffer",N=emptyVertexBuffer,"value"):(N=(L=g===SceneMode$1.SCENE2D||g===SceneMode$1.COLUMBUS_VIEW?(R=emptyVertexBuffer,"value"):(R=A,"vertexBuffer"),e._positionBuffer),"vertexBuffer"),H[0][L]=R,H[1][L]=R,H[2][k]=N,H[3][k]=N,H[4][L]=R,H[5][L]=R,H[6][k]=N,H[7][k]=N,H[8][L]=R,H[9][L]=R,H[10][k]=N,H[11][k]=N;var W=new VertexArray({context:t,attributes:H,indexBuffer:O});e._vertexArrays.push({va:W,buckets:h[D]})}}}function replacer(e,t){return t instanceof Texture?t.id:t}var scratchUniformArray$1=[];function createMaterialId(e){var t=Material._uniformList[e.type],i=t.length;scratchUniformArray$1.length=2*i;for(var r=0,n=0;n<i;++n){var a=t[n];scratchUniformArray$1[r]=a,scratchUniformArray$1[r+1]=e._uniforms[a](),r+=2}return e.type+":"+JSON.stringify(scratchUniformArray$1,replacer)}function sortPolylinesIntoBuckets(e){for(var t=e._mode,i=e._modelMatrix,r=e._polylineBuckets={},n=e._polylines,a=n.length,o=0;o<a;++o){var s=n[o];if(1<s._actualPositions.length){s.update();var l=s.material,u=r[l.type];defined(u)||(u=r[l.type]=new PolylineBucket(l,t,i)),u.addPolyline(s)}}}function updateMode$2(e,t){var i=t.mode;e._mode===i&&Matrix4.equals(e._modelMatrix,e.modelMatrix)||(e._mode=i,e._modelMatrix=Matrix4.clone(e.modelMatrix),e._createVertexArray=!0)}function removePolylines(e){if(e._polylinesRemoved){e._polylinesRemoved=!1;for(var t,i=[],r=[],n=0,a=e._polylines.length,o=0;o<a;++o)(t=e._polylines[o]).isDestroyed||(t._index=n++,r.push(t),i.push(t));e._polylines=i,e._polylinesToUpdate=r}}function releaseShaders(e){for(var t=e._polylines,i=t.length,r=0;r<i;++r)if(!t[r].isDestroyed){var n=t[r]._bucket;defined(n)&&(n.shaderProgram=n.shaderProgram&&n.shaderProgram.destroy())}}function destroyVertexArrays(e){for(var t=e._vertexArrays.length,i=0;i<t;++i)e._vertexArrays[i].va.destroy();e._vertexArrays.length=0}function destroyPolylines(e){for(var t=e._polylines,i=t.length,r=0;r<i;++r)t[r].isDestroyed||t[r]._destroy()}function VertexArrayBucketLocator(e,t,i){this.count=e,this.offset=t,this.bucket=i}function PolylineBucket(e,t,i){this.polylines=[],this.lengthOfPositions=0,this.material=e,this.shaderProgram=void 0,this.mode=t,this.modelMatrix=i}function intersectsIDL(e){return Cartesian3.dot(Cartesian3.UNIT_X,e._boundingVolume.center)<0||e._boundingVolume.intersectPlane(Plane.ORIGIN_ZX_PLANE)===Intersect$1.INTERSECTING}PolylineCollection.prototype._updatePolyline=function(e,t){this._polylinesUpdated=!0,e._dirty||this._polylinesToUpdate.push(e),++this._propertiesChanged[t]},PolylineBucket.prototype.addPolyline=function(e){this.polylines.push(e),e._actualLength=this.getPolylinePositionsLength(e),this.lengthOfPositions+=e._actualLength,e._bucket=this},PolylineBucket.prototype.updateShader=function(e,t,i,r){if(!defined(this.shaderProgram)){var n=["DISTANCE_DISPLAY_CONDITION"];i&&n.push("VECTOR_TILE"),r&&n.push("DISABLE_DEPTH_DISTANCE"),-1!==this.material.shaderSource.search(/varying\s+float\s+v_polylineAngle;/g)&&n.push("POLYLINE_DASH"),FeatureDetection$1.isInternetExplorer()||n.push("CLIP_POLYLINE");var a=new ShaderSource({defines:n,sources:["varying vec4 v_pickColor;\n",this.material.shaderSource,PolylineFS]}),o=t.getVertexShaderCallback()(PolylineVS),s=new ShaderSource({defines:n,sources:[PolylineCommon,o]});this.shaderProgram=ShaderProgram.fromCache({context:e,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:attributeLocations$2})}},PolylineBucket.prototype.getPolylinePositionsLength=function(e){var t;if(this.mode===SceneMode$1.SCENE3D||!intersectsIDL(e))return 4*(t=e._actualPositions.length)-4;var i=0,r=e._segments.lengths;t=r.length;for(var n=0;n<t;++n)i+=4*r[n]-4;return i};var scratchWritePosition=new Cartesian3,scratchWritePrevPosition=new Cartesian3,scratchWriteNextPosition=new Cartesian3,scratchWriteVector=new Cartesian3,scratchPickColorCartesian=new Cartesian4,scratchWidthShowCartesian=new Cartesian2;PolylineBucket.prototype.write=function(e,t,i,r,n,a,o,s){for(var l=this.mode,u=s.ellipsoid.maximumRadius*CesiumMath.PI,c=this.polylines,d=c.length,h=0;h<d;++h){for(var p,f=c[h],m=f.width,g=f.show&&0<m,y=f._index,v=this.getSegments(f,s),_=v.positions,C=v.lengths,x=_.length,b=f.getPickId(o).color,A=0,S=0,w=0;w<x;++w){0===w?f._loop?p=_[x-2]:(p=scratchWriteVector,Cartesian3.subtract(_[0],_[1],p),Cartesian3.add(_[0],p,p)):p=_[w-1],Cartesian3.clone(p,scratchWritePrevPosition),Cartesian3.clone(_[w],scratchWritePosition),w===x-1?f._loop?p=_[1]:(p=scratchWriteVector,Cartesian3.subtract(_[x-1],_[x-2],p),Cartesian3.add(_[x-1],p,p)):p=_[w+1],Cartesian3.clone(p,scratchWriteNextPosition);var E=C[A];w===S+E&&(S+=E,++A);var T=w-S==0,P=w===S+C[A]-1;l===SceneMode$1.SCENE2D&&(scratchWritePrevPosition.z=0,scratchWritePosition.z=0,scratchWriteNextPosition.z=0),l!==SceneMode$1.SCENE2D&&l!==SceneMode$1.MORPHING||(T||P)&&u-Math.abs(scratchWritePosition.x)<1&&((scratchWritePosition.x<0&&0<scratchWritePrevPosition.x||0<scratchWritePosition.x&&scratchWritePrevPosition.x<0)&&Cartesian3.clone(scratchWritePosition,scratchWritePrevPosition),(scratchWritePosition.x<0&&0<scratchWriteNextPosition.x||0<scratchWritePosition.x&&scratchWriteNextPosition.x<0)&&Cartesian3.clone(scratchWritePosition,scratchWriteNextPosition));for(var M=P?2:4,D=T?2:0;D<M;++D){EncodedCartesian3.writeElements(scratchWritePosition,e,i),EncodedCartesian3.writeElements(scratchWritePrevPosition,e,i+6),EncodedCartesian3.writeElements(scratchWriteNextPosition,e,i+12);var I=D-2<0?-1:1;t[n]=w/(x-1),t[n+1]=D%2*2-1,t[n+2]=I,t[n+3]=y,i+=18,n+=4}}var O=scratchPickColorCartesian;O.x=Color.floatToByte(b.red),O.y=Color.floatToByte(b.green),O.z=Color.floatToByte(b.blue),O.w=Color.floatToByte(b.alpha);var R=scratchWidthShowCartesian;R.x=m,R.y=g?1:0;var L=l===SceneMode$1.SCENE2D?f._boundingVolume2D:f._boundingVolumeWC,N=EncodedCartesian3.fromCartesian(L.center,scratchUpdatePolylineEncodedCartesian),k=N.high,B=Cartesian4.fromElements(N.low.x,N.low.y,N.low.z,L.radius,scratchUpdatePolylineCartesian4),F=scratchNearFarCartesian2;F.x=0,F.y=Number.MAX_VALUE;var V=f.distanceDisplayCondition;defined(V)&&(F.x=V.near,F.y=V.far),a.setBatchedAttribute(y,0,R),a.setBatchedAttribute(y,1,O),2<a.attributes.length&&(a.setBatchedAttribute(y,2,k),a.setBatchedAttribute(y,3,B),a.setBatchedAttribute(y,4,F))}};var morphPositionScratch=new Cartesian3,morphPrevPositionScratch=new Cartesian3,morphNextPositionScratch=new Cartesian3,morphVectorScratch=new Cartesian3;PolylineBucket.prototype.writeForMorph=function(e,t){for(var i=this.modelMatrix,r=this.polylines,n=r.length,a=0;a<n;++a)for(var o=r[a],s=o._segments.positions,l=o._segments.lengths,u=s.length,c=0,d=0,h=0;h<u;++h){var p;0===h?o._loop?p=s[u-2]:(p=morphVectorScratch,Cartesian3.subtract(s[0],s[1],p),Cartesian3.add(s[0],p,p)):p=s[h-1],p=Matrix4.multiplyByPoint(i,p,morphPrevPositionScratch);var f,m=Matrix4.multiplyByPoint(i,s[h],morphPositionScratch);h===u-1?o._loop?f=s[1]:(f=morphVectorScratch,Cartesian3.subtract(s[u-1],s[u-2],f),Cartesian3.add(s[u-1],f,f)):f=s[h+1],f=Matrix4.multiplyByPoint(i,f,morphNextPositionScratch);var g=l[c];h===d+g&&(d+=g,++c);for(var y=h-d==0,v=h===d+l[c]-1?2:4,_=y?2:0;_<v;++_)EncodedCartesian3.writeElements(m,e,t),EncodedCartesian3.writeElements(p,e,t+6),EncodedCartesian3.writeElements(f,e,t+12),t+=18}};var scratchSegmentLengths=new Array(1);PolylineBucket.prototype.updateIndices=function(e,t,i,r){var n=i.length-1,a=new VertexArrayBucketLocator(0,r,this);i[n].push(a);var o=0,s=e[e.length-1],l=0;0<s.length&&(l=s[s.length-1]+1);for(var u=this.polylines,c=u.length,d=0;d<c;++d){var h,p=u[d];if(p._locatorBuckets=[],this.mode===SceneMode$1.SCENE3D){h=scratchSegmentLengths;var f=p._actualPositions.length;if(!(0<f))continue;h[0]=f}else h=p._segments.lengths;var m=h.length;if(0<m){for(var g=0,y=0;y<m;++y)for(var v=h[y]-1,_=0;_<v;++_)l+4>CesiumMath.SIXTY_FOUR_KILOBYTES&&(p._locatorBuckets.push({locator:a,count:g}),g=0,t.push(4),s=[],e.push(s),l=0,a.count=o,a=new VertexArrayBucketLocator(r=o=0,0,this),i[++n]=[a]),s.push(l,l+2,l+1),s.push(l+1,l+2,l+3),g+=6,o+=6,r+=6,l+=4;p._locatorBuckets.push({locator:a,count:g}),l+4>CesiumMath.SIXTY_FOUR_KILOBYTES&&(t.push(0),s=[],e.push(s),l=0,a.count=o,a=new VertexArrayBucketLocator(o=r=0,0,this),i[++n]=[a])}p._clean()}return a.count=o,r},PolylineBucket.prototype.getPolylineStartIndex=function(e){for(var t=this.polylines,i=0,r=t.length,n=0;n<r;++n){var a=t[n];if(a===e)break;i+=a._actualLength}return i};var scratchSegments={positions:void 0,lengths:void 0},scratchLengths=new Array(1),pscratch=new Cartesian3,scratchCartographic$3=new Cartographic,scratchPositionsArray;PolylineBucket.prototype.getSegments=function(e,t){var i=e._actualPositions;if(this.mode===SceneMode$1.SCENE3D)return scratchLengths[0]=i.length,scratchSegments.positions=i,scratchSegments.lengths=scratchLengths,scratchSegments;intersectsIDL(e)&&(i=e._segments.positions);for(var r,n=t.ellipsoid,a=[],o=this.modelMatrix,s=i.length,l=pscratch,u=0;u<s;++u)r=i[u],l=Matrix4.multiplyByPoint(o,r,l),a.push(t.project(n.cartesianToCartographic(l,scratchCartographic$3)));if(0<a.length){e._boundingVolume2D=BoundingSphere.fromPoints(a,e._boundingVolume2D);var c=e._boundingVolume2D.center;e._boundingVolume2D.center=new Cartesian3(c.z,c.x,c.y)}return scratchSegments.positions=a,scratchSegments.lengths=e._segments.lengths,scratchSegments},PolylineBucket.prototype.writeUpdate=function(e,t,i,r){var n=this.mode,a=r.ellipsoid.maximumRadius*CesiumMath.PI,o=t._actualLength;if(o){e+=this.getPolylineStartIndex(t);var s=scratchPositionsArray,l=6*o*3;!defined(s)||s.length<l?s=scratchPositionsArray=new Float32Array(l):s.length>l&&(s=new Float32Array(s.buffer,0,l));var u,c=this.getSegments(t,r),d=c.positions,h=c.lengths,p=0,f=0,m=0;o=d.length;for(var g=0;g<o;++g){0===g?t._loop?u=d[o-2]:(u=scratchWriteVector,Cartesian3.subtract(d[0],d[1],u),Cartesian3.add(d[0],u,u)):u=d[g-1],Cartesian3.clone(u,scratchWritePrevPosition),Cartesian3.clone(d[g],scratchWritePosition),g===o-1?t._loop?u=d[1]:(u=scratchWriteVector,Cartesian3.subtract(d[o-1],d[o-2],u),Cartesian3.add(d[o-1],u,u)):u=d[g+1],Cartesian3.clone(u,scratchWriteNextPosition);var y=h[f];g===m+y&&(m+=y,++f);var v=g-m==0,_=g===m+h[f]-1;n===SceneMode$1.SCENE2D&&(scratchWritePrevPosition.z=0,scratchWritePosition.z=0,scratchWriteNextPosition.z=0),n!==SceneMode$1.SCENE2D&&n!==SceneMode$1.MORPHING||(v||_)&&a-Math.abs(scratchWritePosition.x)<1&&((scratchWritePosition.x<0&&0<scratchWritePrevPosition.x||0<scratchWritePosition.x&&scratchWritePrevPosition.x<0)&&Cartesian3.clone(scratchWritePosition,scratchWritePrevPosition),(scratchWritePosition.x<0&&0<scratchWriteNextPosition.x||0<scratchWritePosition.x&&scratchWriteNextPosition.x<0)&&Cartesian3.clone(scratchWritePosition,scratchWriteNextPosition));for(var C=_?2:4,x=v?2:0;x<C;++x)EncodedCartesian3.writeElements(scratchWritePosition,s,p),EncodedCartesian3.writeElements(scratchWritePrevPosition,s,p+6),EncodedCartesian3.writeElements(scratchWriteNextPosition,s,p+12),p+=18}i.copyFromArrayView(s,18*Float32Array.BYTES_PER_ELEMENT*e)}};var waterFS="varying vec3 v_positionMC;\r\nvarying vec3 v_positionEC;\r\nvarying vec2 v_st;\r\nvoid main()\r\n{\r\nczm_materialInput materialInput;\r\nvec3 normalEC = normalize(czm_normal3D * czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0)));\r\n#ifdef FACE_FORWARD\r\nnormalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\r\n#endif\r\nmaterialInput.s = v_st.s;\r\nmaterialInput.st = v_st;\r\nmaterialInput.str = vec3(v_st, 0.0);\r\nmaterialInput.normalEC = normalEC;\r\nmaterialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, materialInput.normalEC);\r\nvec3 positionToEyeEC = -v_positionEC;\r\nmaterialInput.positionToEyeEC = positionToEyeEC;\r\nczm_material material = czm_getMaterial(materialInput);\r\n#ifdef FLAT\r\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\r\n#else\r\ngl_FragColor = czm_phong(normalize(positionToEyeEC), material,czm_lightDirectionEC);\r\ngl_FragColor.a=0.5;\n#endif\n}\n";function Utils(){}Utils.changeCartesian3Height=function(e,t,i){defined(i)||(i=new Cartesian3),i=Cartesian3.clone(e,i);var r=Transforms.eastNorthUpToFixedFrame(i),n=new Cartesian3(0,0,t);return Matrix4.multiplyByPoint(r,n,i),i},Utils.changeCartesian3ByScalar=function(e,t,i){defined(i)||(i=new Cartesian3),defined(t)||(t=new Cartesian3(0,0,0)),i=Cartesian3.clone(e,i);var r=Transforms.eastNorthUpToFixedFrame(i);return Matrix4.multiplyByPoint(r,t,i),i};var whiteModelVS="attribute vec3 position3DHigh;\r\nattribute vec3 position3DLow;\r\nattribute vec3 normal;\r\nattribute vec2 st;\r\nattribute float height;\r\nattribute float batchId;\r\nvarying vec3 v_positionEC;\r\nvarying vec3 v_normalEC;\r\nvarying vec3 v_positionMC;\r\nvarying vec2 v_st;\r\nvarying float v_height;\r\nvoid main()\r\n{\r\nvec4 p = czm_computePosition();\r\nv_positionMC = position3DHigh + position3DLow;\r\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\r\nv_normalEC = czm_normal * normal;\r\nv_st = st;\r\nv_height = height;\r\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\r\n}\r\n",whiteModelFS="\r\nvarying vec3 v_positionEC;\r\nvarying vec3 v_normalEC;\r\nvarying vec2 v_st;\r\nvarying vec3 v_positionMC;\r\nvarying float v_height;\r\nfloat czm_private_getLambertDiffuseOfMaterial(vec3 lightDirectionEC, czm_material material)\n {\r return czm_getLambertDiffuse(lightDirectionEC, material.normal);\n }\n float czm_private_getSpecularOfMaterial(vec3 lightDirectionEC, vec3 toEyeEC, czm_material material)\n {\n return czm_getSpecular(lightDirectionEC, toEyeEC, material.normal, material.shininess);\n }\r\n\r\nvec4 czm_private_phong(vec3 toEye, czm_material material)\r\n{\r\nfloat diffuse = czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 0.0, 1.0), material);\r\nif (czm_sceneMode == czm_sceneMode3D) {\r\n diffuse += czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 1.0, 0.0), material);\r\n}\r\nfloat specular = czm_private_getSpecularOfMaterial(czm_sunDirectionEC, toEye, material) + czm_private_getSpecularOfMaterial(czm_moonDirectionEC, toEye, material);\r\nvec3 materialDiffuse = material.diffuse * 0.5;\r\nvec3 ambient = materialDiffuse;\r\nvec3 color = ambient + material.emission;\r\ncolor += materialDiffuse * diffuse;\r\ncolor += material.specular * specular;\r\nreturn vec4(color, material.alpha);\r\n}\r\nvoid main()\r\n{\r\nvec3 positionToEyeEC = -v_positionEC;\r\nvec3 normalEC = normalize(v_normalEC);\r\n#ifdef FACE_FORWARD\r\nnormalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\r\n#endif\r\nczm_materialInput materialInput;\r\nmaterialInput.normalEC = normalEC;\r\nmaterialInput.positionToEyeEC = positionToEyeEC;\r\nmaterialInput.st = v_st;\r\nmaterialInput.height = v_height;\r\nczm_material material = czm_getMaterial(materialInput);\r\n#ifdef FLAT\r\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\r\n#else\r\ngl_FragColor = czm_private_phong(normalize(positionToEyeEC), material);\r\n#endif\r\n}\r\n",DB=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,whiteModelTable="whiteModel",TYPE_WHITE_MODEL="whiteModel",TYPE_WATER="water",TYPE_POLYLINE_TRAIL="polylineTrail";function FeatureJsonData(e,t){this._earthCtrl=e,this._parameter=t,this._url=defaultValue(t.url,"http://localhost:8080/gisserver"),this._version=defaultValue(t.version,"1.3.0"),this._params=defaultValue(t.params,{typename:"*",bbox:""}),this._load=defaultValue(t.load,!0),this._primitive=[],this._modelColor=defaultValue(t.featureColor,Color.BLUE),this._modelHeightKey=defaultValue(t.modelHeightKey,"Height"),this._lineWidth=defaultValue(t.lineWidth,1),this._labelOptions=defaultValue(t.label,{}),this._textKey=defaultValue(t.textKey,"属性"),this._image=defaultValue(t.image,void 0),this._useCache=defaultValue(t.useCache,!0),this._primitiveSize=defaultValue(t.primitiveSize,2e4),this._maximumHeight=defaultValue(t.maximumHeight,100),this._minimumHeight=defaultValue(t.minimumHeight,0),this._groundHeight=defaultValue(t.groundHeight,0),defined(this._image)&&(this.material=Material.fromType(Material.ModelColorType),this.material.uniforms.color=this._modelColor,this.material.uniforms.image=this._image,this.material.uniforms.minimumHeight=this._minimumHeight,this.material.uniforms.maximumHeight=this._maximumHeight,this.material.update(e.coreMap.scene.context)),this.baseWaterColor=defaultValue(t.baseWaterColor,new Color(.2,.3,.6,1)),this.waterFrequency=defaultValue(t.waterFrequency,1e3),this.animationSpeed=defaultValue(t.animationSpeed,.01),this.amplitude=defaultValue(t.amplitude,10),this.disableDepthTest=defaultValue(t.disableDepthTest,!1),this.instancesLabel=new LabelCollection,this.instancesPolygon=[],this.instancesPolyline=[],this.instancesPolylineCollection=new PolylineCollection,this.type=defaultValue(t.type,TYPE_WHITE_MODEL),this.featureDB=void 0,this.init()}function defaultCrsFunction$1(e){return Cartesian3.fromDegrees(e[0],e[1],e[2])}FeatureJsonData.prototype.init=function(){var t=this;defined(DB)||(console.warn("Your browser doesn't support IndexedDB!"),t._useCache=!1),new Promise(function(i){if(t._useCache){var r=DB.open("FeatureDataDB");r.onerror=function(e){console.warn(" open FeatureDataDB error"),i()},r.onsuccess=function(e){var t=r.result;console.info(" open FeatureDataDB success"),i(t)},r.onupgradeneeded=function(e){var t=e.target.result;t.objectStoreNames.contains(whiteModelTable)||t.createObjectStore(whiteModelTable,{autoIncrement:!0}).createIndex("pathIndex","path",{unique:!0})}}else i()}).then(function(e){defined(e)?t.featureDB=e:t._useCache=!1,t._load&&t.load()})},FeatureJsonData.prototype.buildUrl=function(e){return this._url+"?version="+this._version+"&request=GetFeature&typename="+e.typename+"&propertyname=*&bbox="+e.bbox+"&format=json"},FeatureJsonData.prototype.loadUrl=function(e){var t=this,i=new Resource(e).fetchJson();when.all([i]).then(function(e){t.parse(e)})},FeatureJsonData.prototype.setCache=function(r,n){if(this._useCache){var a=this;return new Promise(function(t,i){var e=a.featureDB.transaction([whiteModelTable],"readwrite").objectStore(whiteModelTable).add({path:r,data:n});e.onsuccess=function(e){console.log("wreite db success"),t(n)},e.onerror=function(e){console.warn("write db faild "+n),i()}})}},FeatureJsonData.prototype.getCache=function(e){var r=this;return new Promise(function(t){if(r._useCache){var i=r.featureDB.transaction([whiteModelTable],"readonly").objectStore(whiteModelTable).index("pathIndex").get(e);i.onerror=function(e){console.warn("transaction error"+e),t()},i.onsuccess=function(e){i.result?t(i.result.data):(console.info(" no data "),t())}}else t()})},FeatureJsonData.prototype.load=function(){var e=this._params.length;if(0!==e){for(var i=this,t=new Array(e),r=0;r<e;++r){var n=i.buildUrl(i._params[r]);t[r]=function(){var t=n;return i.getCache(n).then(function(e){return e||new Resource(t).fetchJson().then(function(e){return i.setCache(t,e),e})})}()}when.all(t).then(function(e){i.parse(e)})}},FeatureJsonData.prototype.createLabelGeometryInstance=function(e){this._labelOptions.text=e.properties[this._textKey];var t=Cartesian3.fromDegrees(e.geometry.coordinates[0],e.geometry.coordinates[1]);this._labelOptions.position=t,this.instancesLabel.length>this._primitiveSize&&this.savePrimitive(),this.instancesLabel.add(this._labelOptions)},FeatureJsonData.prototype.createPolylineGeometryInstance2=function(e,t,i){var r={},n=this.convertCoordinates([t]);r.positions=Cartesian3.fromDegreesArray(n),r.width=this._lineWidth,r.material=Material.fromType("Color"),r.material.uniforms.color=this._modelColor,r.id=i,r.disableDepthTestDistance=this.disableDepthTest,this.instancesPolylineCollection.length>this._primitiveSize&&this.savePrimitive(),this.instancesPolylineCollection.add(r)},FeatureJsonData.prototype.createPolylineGeometryInstance=function(e,t,i){var r=ColorGeometryInstanceAttribute.fromColor(this._modelColor),n=this.convertCoordinates([t]),a=Cartesian3.fromDegreesArray(n);this.instancesPolyline.length>this._primitiveSize&&this.savePrimitive(),this.instancesPolyline.push(new GeometryInstance({geometry:new PolylineGeometry({width:this._lineWidth,positions:a}),id:i,attributes:{color:r}}))},FeatureJsonData.prototype.createPolygonGeometryInstance=function(e,t,i){var r=ColorGeometryInstanceAttribute.fromColor(this._modelColor),n=this.convertCoordinates(t),a=Cartesian3.fromDegreesArray(n),o=e.properties[this._modelHeightKey];defined(o)||(o=0),this.type===TYPE_WATER&&(o=void 0),this.instancesPolygon.length>this._primitiveSize&&this.savePrimitive(),this.instancesPolygon.push(new GeometryInstance({geometry:new PolygonGeometry({polygonHierarchy:new PolygonHierarchy(a),extrudedHeight:o,height:this._groundHeight}),id:i,releaseGeometryInstances:!0,attributes:{color:r}}))},FeatureJsonData.prototype.parse=function(e){if(Array.isArray(e)){for(var t=0;t<e.length;t++)for(var i=e[t],r=0;r<i.features.length;r++){var n=i.features[r];if("Polygon"===n.geometry.type)this.createPolygonGeometryInstance(n,n.geometry.coordinates,n.id);else if("MultiPolygon"===n.geometry.type)for(var a=n.geometry.coordinates,o=0;o<a.length;o++){var s=n.id+"-"+t;this.createPolygonGeometryInstance(n,a[o],s)}else if("Point"===n.geometry.type)this.createLabelGeometryInstance(n);else if("LineString"===n.geometry.type)this.createPolylineGeometryInstance2(n,n.geometry.coordinates,n.id);else if("MultiLineString"===n.geometry.type)for(var l=n.geometry.coordinates,u=0;u<l.length;u++)this.createPolylineGeometryInstance2(n,l[u],n.id+"-"+u);else console.error(n.geometry.type)}this.savePrimitive()}else console.info(e)},FeatureJsonData.prototype.savePrimitive=function(){var e=this;if(0<e.instancesPolygon.length){if(e.type===TYPE_WHITE_MODEL)defined(e._image)?i=this.material:(i=Material.fromType(Material.ColorType)).uniforms.color=e._modelColor,r=new MaterialAppearance({material:i,translucent:!0,faceForward:!0,vertexShaderSource:whiteModelVS,fragmentShaderSource:whiteModelFS});else if(e.type===TYPE_WATER){var t={};t.normalMap=GEOWORLD_BASE_URL+"./Assets/Images/waterNormals.jpg",t.baseWaterColor=e.baseWaterColor,t.frequency=e.waterFrequency,t.animationSpeed=e.animationSpeed,t.amplitude=e.amplitude,(i=new Material({fabric:{type:"Water",uniforms:t}})).update(e._earthCtrl.coreMap.scene.context),r=new EllipsoidSurfaceAppearance({material:i,fragmentShaderSource:waterFS})}else r=new PerInstanceColorAppearance;e._primitive.push(e._earthCtrl.primitives.add(new Primitive({geometryInstances:e.instancesPolygon,appearance:r}))),e.instancesPolygon=[]}if(0<e.instancesPolyline.length){var i,r;if(e.type===TYPE_POLYLINE_TRAIL){var n={duration:e.duration};defined(e._image)&&(n.image=e._image),(i=Material.fromType("PolylineTrailLink")).uniforms.image=e._image,i.uniforms.time=.8,r=new MaterialAppearance({material:i,translucent:!0,faceForward:!0})}else r=new PolylineColorAppearance({});e._primitive.push(e._earthCtrl.primitives.add(new Primitive({geometryInstances:e.instancesPolyline,appearance:r}))),e.instancesPolyline=[]}0<e.instancesLabel.length&&(e._primitive.push(e._earthCtrl.primitives.add(e.instancesLabel)),e.instancesLabel=new LabelCollection),0<e.instancesPolylineCollection.length&&(e._primitive.push(e._earthCtrl.primitives.add(e.instancesPolylineCollection)),e.instancesPolylineCollection=new PolylineCollection)},FeatureJsonData.prototype.convertCoordinates=function(e){for(var t=[],i=0;i<e.length;i++)for(var r=e[i],n=0;n<r.length;n++)Array.prototype.push.apply(t,r[n]);return t},FeatureJsonData.prototype.coordinatesArrayToCartesianArray=function(e){for(var t=new Array(e.length),i=0;i<e.length;i++)t[i]=defaultCrsFunction$1(e[i]);return t},Object.defineProperties(FeatureJsonData.prototype,{url:{set:function(e){this._url=e},get:function(){return this._url}},primitive:{get:function(){return this._primitive}}});var diffScratch=new Cartesian3;function BoxOutlineGeometry(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).minimum,i=e.maximum;this._min=Cartesian3.clone(t),this._max=Cartesian3.clone(i),this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxOutlineGeometry"}BoxOutlineGeometry.fromDimensions=function(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).dimensions,i=Cartesian3.multiplyByScalar(t,.5,new Cartesian3);return new BoxOutlineGeometry({minimum:Cartesian3.negate(i,new Cartesian3),maximum:i,offsetAttribute:e.offsetAttribute})},BoxOutlineGeometry.fromAxisAlignedBoundingBox=function(e){return new BoxOutlineGeometry({minimum:e.minimum,maximum:e.maximum})},BoxOutlineGeometry.packedLength=2*Cartesian3.packedLength+1,BoxOutlineGeometry.pack=function(e,t,i){return i=defaultValue(i,0),Cartesian3.pack(e._min,t,i),Cartesian3.pack(e._max,t,i+Cartesian3.packedLength),t[i+2*Cartesian3.packedLength]=defaultValue(e._offsetAttribute,-1),t};var scratchMin=new Cartesian3,scratchMax=new Cartesian3,scratchOptions$1={minimum:scratchMin,maximum:scratchMax,offsetAttribute:void 0};function PerspectiveOffCenterFrustum(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this.left=e.left,this._left=void 0,this.right=e.right,this._right=void 0,this.top=e.top,this._top=void 0,this.bottom=e.bottom,this._bottom=void 0,this.near=defaultValue(e.near,1),this._near=this.near,this.far=defaultValue(e.far,5e8),this._far=this.far,this._cullingVolume=new CullingVolume,this._perspectiveMatrix=new Matrix4,this._infinitePerspective=new Matrix4}function update$2(e){var t=e.top,i=e.bottom,r=e.right,n=e.left,a=e.near,o=e.far;t===e._top&&i===e._bottom&&n===e._left&&r===e._right&&a===e._near&&o===e._far||(e._left=n,e._right=r,e._top=t,e._bottom=i,e._near=a,e._far=o,e._perspectiveMatrix=Matrix4.computePerspectiveOffCenter(n,r,i,t,a,o,e._perspectiveMatrix),e._infinitePerspective=Matrix4.computeInfinitePerspectiveOffCenter(n,r,i,t,a,e._infinitePerspective))}BoxOutlineGeometry.unpack=function(e,t,i){t=defaultValue(t,0);var r=Cartesian3.unpack(e,t,scratchMin),n=Cartesian3.unpack(e,t+Cartesian3.packedLength,scratchMax),a=e[t+2*Cartesian3.packedLength];return defined(i)?(i._min=Cartesian3.clone(r,i._min),i._max=Cartesian3.clone(n,i._max),i._offsetAttribute=-1===a?void 0:a,i):(scratchOptions$1.offsetAttribute=-1===a?void 0:a,new BoxOutlineGeometry(scratchOptions$1))},BoxOutlineGeometry.createGeometry=function(e){var t=e._min,i=e._max;if(!Cartesian3.equals(t,i)){var r=new GeometryAttributes,n=new Uint16Array(24),a=new Float64Array(24);a[0]=t.x,a[1]=t.y,a[2]=t.z,a[3]=i.x,a[4]=t.y,a[5]=t.z,a[6]=i.x,a[7]=i.y,a[8]=t.z,a[9]=t.x,a[10]=i.y,a[11]=t.z,a[12]=t.x,a[13]=t.y,a[14]=i.z,a[15]=i.x,a[16]=t.y,a[17]=i.z,a[18]=i.x,a[19]=i.y,a[20]=i.z,a[21]=t.x,a[22]=i.y,a[23]=i.z,r.position=new GeometryAttribute({componentDatatype:ComponentDatatype$1.DOUBLE,componentsPerAttribute:3,values:a}),n[0]=4,n[1]=5,n[2]=5,n[3]=6,n[4]=6,n[5]=7,n[6]=7,n[7]=4,n[8]=0,n[9]=1,n[10]=1,n[11]=2,n[12]=2,n[13]=3,n[14]=3,n[15]=0,n[16]=0,n[17]=4,n[18]=1,n[19]=5,n[20]=2,n[21]=6,n[22]=3,n[23]=7;var o=Cartesian3.subtract(i,t,diffScratch),s=.5*Cartesian3.magnitude(o);if(defined(e._offsetAttribute)){var l=a.length,u=new Uint8Array(l/3);arrayFill(u,e._offsetAttribute===GeometryOffsetAttribute$1.NONE?0:1),r.applyOffset=new GeometryAttribute({componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE,componentsPerAttribute:1,values:u})}return new Geometry({attributes:r,indices:n,primitiveType:PrimitiveType$1.LINES,boundingSphere:new BoundingSphere(Cartesian3.ZERO,s),offsetAttribute:e._offsetAttribute})}},Object.defineProperties(PerspectiveOffCenterFrustum.prototype,{projectionMatrix:{get:function(){return update$2(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return update$2(this),this._infinitePerspective}}});var getPlanesRight$1=new Cartesian3,getPlanesNearCenter$1=new Cartesian3,getPlanesFarCenter=new Cartesian3,getPlanesNormal=new Cartesian3;function PerspectiveFrustum(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this._offCenterFrustum=new PerspectiveOffCenterFrustum,this.fov=e.fov,this._fov=void 0,this._fovy=void 0,this._sseDenominator=void 0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void 0,this.near=defaultValue(e.near,1),this._near=this.near,this.far=defaultValue(e.far,5e8),this._far=this.far,this.xOffset=defaultValue(e.xOffset,0),this._xOffset=this.xOffset,this.yOffset=defaultValue(e.yOffset,0),this._yOffset=this.yOffset}function update$3(e){var t=e._offCenterFrustum;e.fov===e._fov&&e.aspectRatio===e._aspectRatio&&e.near===e._near&&e.far===e._far&&e.xOffset===e._xOffset&&e.yOffset===e._yOffset||(e._aspectRatio=e.aspectRatio,e._fov=e.fov,e._fovy=e.aspectRatio<=1?e.fov:2*Math.atan(Math.tan(.5*e.fov)/e.aspectRatio),e._near=e.near,e._far=e.far,e._sseDenominator=2*Math.tan(.5*e._fovy),e._xOffset=e.xOffset,e._yOffset=e.yOffset,t.top=e.near*Math.tan(.5*e._fovy),t.bottom=-t.top,t.right=e.aspectRatio*t.top,t.left=-t.right,t.near=e.near,t.far=e.far,t.right+=e.xOffset,t.left+=e.xOffset,t.top+=e.yOffset,t.bottom+=e.yOffset)}PerspectiveOffCenterFrustum.prototype.computeCullingVolume=function(e,t,i){var r=this._cullingVolume.planes,n=this.top,a=this.bottom,o=this.right,s=this.left,l=this.near,u=this.far,c=Cartesian3.cross(t,i,getPlanesRight$1),d=getPlanesNearCenter$1;Cartesian3.multiplyByScalar(t,l,d),Cartesian3.add(e,d,d);var h=getPlanesFarCenter;Cartesian3.multiplyByScalar(t,u,h),Cartesian3.add(e,h,h);var p=getPlanesNormal;Cartesian3.multiplyByScalar(c,s,p),Cartesian3.add(d,p,p),Cartesian3.subtract(p,e,p),Cartesian3.normalize(p,p),Cartesian3.cross(p,i,p),Cartesian3.normalize(p,p);var f=r[0];return defined(f)||(f=r[0]=new Cartesian4),f.x=p.x,f.y=p.y,f.z=p.z,f.w=-Cartesian3.dot(p,e),Cartesian3.multiplyByScalar(c,o,p),Cartesian3.add(d,p,p),Cartesian3.subtract(p,e,p),Cartesian3.cross(i,p,p),Cartesian3.normalize(p,p),defined(f=r[1])||(f=r[1]=new Cartesian4),f.x=p.x,f.y=p.y,f.z=p.z,f.w=-Cartesian3.dot(p,e),Cartesian3.multiplyByScalar(i,a,p),Cartesian3.add(d,p,p),Cartesian3.subtract(p,e,p),Cartesian3.cross(c,p,p),Cartesian3.normalize(p,p),defined(f=r[2])||(f=r[2]=new Cartesian4),f.x=p.x,f.y=p.y,f.z=p.z,f.w=-Cartesian3.dot(p,e),Cartesian3.multiplyByScalar(i,n,p),Cartesian3.add(d,p,p),Cartesian3.subtract(p,e,p),Cartesian3.cross(p,c,p),Cartesian3.normalize(p,p),defined(f=r[3])||(f=r[3]=new Cartesian4),f.x=p.x,f.y=p.y,f.z=p.z,f.w=-Cartesian3.dot(p,e),defined(f=r[4])||(f=r[4]=new Cartesian4),f.x=t.x,f.y=t.y,f.z=t.z,f.w=-Cartesian3.dot(t,d),Cartesian3.negate(t,p),defined(f=r[5])||(f=r[5]=new Cartesian4),f.x=p.x,f.y=p.y,f.z=p.z,f.w=-Cartesian3.dot(p,h),this._cullingVolume},PerspectiveOffCenterFrustum.prototype.getPixelDimensions=function(e,t,i,r,n){update$2(this);var a=1/this.near,o=this.top*a,s=2*r*i*o/t,l=2*r*i*(o=this.right*a)/e;return n.x=l,n.y=s,n},PerspectiveOffCenterFrustum.prototype.clone=function(e){return defined(e)||(e=new PerspectiveOffCenterFrustum),e.right=this.right,e.left=this.left,e.top=this.top,e.bottom=this.bottom,e.near=this.near,e.far=this.far,e._left=void 0,e._right=void 0,e._top=void 0,e._bottom=void 0,e._near=void 0,e._far=void 0,e},PerspectiveOffCenterFrustum.prototype.equals=function(e){return defined(e)&&e instanceof PerspectiveOffCenterFrustum&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far},PerspectiveOffCenterFrustum.prototype.equalsEpsilon=function(e,t,i){return e===this||defined(e)&&e instanceof PerspectiveOffCenterFrustum&&CesiumMath.equalsEpsilon(this.right,e.right,t,i)&&CesiumMath.equalsEpsilon(this.left,e.left,t,i)&&CesiumMath.equalsEpsilon(this.top,e.top,t,i)&&CesiumMath.equalsEpsilon(this.bottom,e.bottom,t,i)&&CesiumMath.equalsEpsilon(this.near,e.near,t,i)&&CesiumMath.equalsEpsilon(this.far,e.far,t,i)},PerspectiveFrustum.packedLength=6,PerspectiveFrustum.pack=function(e,t,i){return i=defaultValue(i,0),t[i++]=e.fov,t[i++]=e.aspectRatio,t[i++]=e.near,t[i++]=e.far,t[i++]=e.xOffset,t[i]=e.yOffset,t},PerspectiveFrustum.unpack=function(e,t,i){return t=defaultValue(t,0),defined(i)||(i=new PerspectiveFrustum),i.fov=e[t++],i.aspectRatio=e[t++],i.near=e[t++],i.far=e[t++],i.xOffset=e[t++],i.yOffset=e[t],i},Object.defineProperties(PerspectiveFrustum.prototype,{projectionMatrix:{get:function(){return update$3(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return update$3(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return update$3(this),this._fovy}},sseDenominator:{get:function(){return update$3(this),this._sseDenominator}}}),PerspectiveFrustum.prototype.computeCullingVolume=function(e,t,i){return update$3(this),this._offCenterFrustum.computeCullingVolume(e,t,i)},PerspectiveFrustum.prototype.getPixelDimensions=function(e,t,i,r,n){return update$3(this),this._offCenterFrustum.getPixelDimensions(e,t,i,r,n)},PerspectiveFrustum.prototype.clone=function(e){return defined(e)||(e=new PerspectiveFrustum),e.aspectRatio=this.aspectRatio,e.fov=this.fov,e.near=this.near,e.far=this.far,e._aspectRatio=void 0,e._fov=void 0,e._near=void 0,e._far=void 0,this._offCenterFrustum.clone(e._offCenterFrustum),e},PerspectiveFrustum.prototype.equals=function(e){return!!(defined(e)&&e instanceof PerspectiveFrustum)&&(update$3(this),update$3(e),this.fov===e.fov&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))},PerspectiveFrustum.prototype.equalsEpsilon=function(e,t,i){return!!(defined(e)&&e instanceof PerspectiveFrustum)&&(update$3(this),update$3(e),CesiumMath.equalsEpsilon(this.fov,e.fov,t,i)&&CesiumMath.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,i)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,i))};var defaultRadii=new Cartesian3(1,1,1),cos=Math.cos,sin=Math.sin;function EllipsoidOutlineGeometry(e){var t=defaultValue((e=defaultValue(e,defaultValue.EMPTY_OBJECT)).radii,defaultRadii),i=defaultValue(e.innerRadii,t),r=defaultValue(e.minimumClock,0),n=defaultValue(e.maximumClock,CesiumMath.TWO_PI),a=defaultValue(e.minimumCone,0),o=defaultValue(e.maximumCone,CesiumMath.PI),s=Math.round(defaultValue(e.stackPartitions,10)),l=Math.round(defaultValue(e.slicePartitions,8)),u=Math.round(defaultValue(e.subdivisions,128));this._radii=Cartesian3.clone(t),this._innerRadii=Cartesian3.clone(i),this._minimumClock=r,this._maximumClock=n,this._minimumCone=a,this._maximumCone=o,this._stackPartitions=s,this._slicePartitions=l,this._subdivisions=u,this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidOutlineGeometry"}EllipsoidOutlineGeometry.packedLength=2*Cartesian3.packedLength+8,EllipsoidOutlineGeometry.pack=function(e,t,i){return i=defaultValue(i,0),Cartesian3.pack(e._radii,t,i),i+=Cartesian3.packedLength,Cartesian3.pack(e._innerRadii,t,i),i+=Cartesian3.packedLength,t[i++]=e._minimumClock,t[i++]=e._maximumClock,t[i++]=e._minimumCone,t[i++]=e._maximumCone,t[i++]=e._stackPartitions,t[i++]=e._slicePartitions,t[i++]=e._subdivisions,t[i]=defaultValue(e._offsetAttribute,-1),t};var scratchRadii=new Cartesian3,scratchInnerRadii=new Cartesian3,scratchOptions$2={radii:scratchRadii,innerRadii:scratchInnerRadii,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0,offsetAttribute:void 0};function SphereOutlineGeometry(e){var t=defaultValue(e.radius,1),i={radii:new Cartesian3(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,subdivisions:e.subdivisions};this._ellipsoidGeometry=new EllipsoidOutlineGeometry(i),this._workerName="createSphereOutlineGeometry"}EllipsoidOutlineGeometry.unpack=function(e,t,i){t=defaultValue(t,0);var r=Cartesian3.unpack(e,t,scratchRadii);t+=Cartesian3.packedLength;var n=Cartesian3.unpack(e,t,scratchInnerRadii);t+=Cartesian3.packedLength;var a=e[t++],o=e[t++],s=e[t++],l=e[t++],u=e[t++],c=e[t++],d=e[t++],h=e[t];return defined(i)?(i._radii=Cartesian3.clone(r,i._radii),i._innerRadii=Cartesian3.clone(n,i._innerRadii),i._minimumClock=a,i._maximumClock=o,i._minimumCone=s,i._maximumCone=l,i._stackPartitions=u,i._slicePartitions=c,i._subdivisions=d,i._offsetAttribute=-1===h?void 0:h,i):(scratchOptions$2.minimumClock=a,scratchOptions$2.maximumClock=o,scratchOptions$2.minimumCone=s,scratchOptions$2.maximumCone=l,scratchOptions$2.stackPartitions=u,scratchOptions$2.slicePartitions=c,scratchOptions$2.subdivisions=d,scratchOptions$2.offsetAttribute=-1===h?void 0:h,new EllipsoidOutlineGeometry(scratchOptions$2))},EllipsoidOutlineGeometry.createGeometry=function(e){var t=e._radii;if(!(t.x<=0||t.y<=0||t.z<=0)){var i=e._innerRadii;if(!(i.x<=0||i.y<=0||i.z<=0)){var r=e._minimumClock,n=e._maximumClock,a=e._minimumCone,o=e._maximumCone,s=e._subdivisions,l=Ellipsoid.fromCartesian3(t),u=e._slicePartitions+1,c=e._stackPartitions+1;(u=Math.round(u*Math.abs(n-r)/CesiumMath.TWO_PI))<2&&(u=2),(c=Math.round(c*Math.abs(o-a)/CesiumMath.PI))<2&&(c=2);var d=0,h=1,p=i.x!==t.x||i.y!==t.y||i.z!==t.z,f=!1,m=!1;p&&(h=2,0<a&&(f=!0,d+=u),o<Math.PI&&(m=!0,d+=u));var g,y,v,_,C=s*h*(c+u),x=new Float64Array(3*C),b=2*(C+d-(u+c)*h),A=IndexDatatype$1.createTypedArray(C,b),S=0,w=new Array(c),E=new Array(c);for(g=0;g<c;g++)_=a+g*(o-a)/(c-1),w[g]=sin(_),E[g]=cos(_);var T=new Array(s),P=new Array(s);for(g=0;g<s;g++)v=r+g*(n-r)/(s-1),T[g]=sin(v),P[g]=cos(v);for(g=0;g<c;g++)for(y=0;y<s;y++)x[S++]=t.x*w[g]*P[y],x[S++]=t.y*w[g]*T[y],x[S++]=t.z*E[g];if(p)for(g=0;g<c;g++)for(y=0;y<s;y++)x[S++]=i.x*w[g]*P[y],x[S++]=i.y*w[g]*T[y],x[S++]=i.z*E[g];for(w.length=s,E.length=s,g=0;g<s;g++)_=a+g*(o-a)/(s-1),w[g]=sin(_),E[g]=cos(_);for(T.length=u,P.length=u,g=0;g<u;g++)v=r+g*(n-r)/(u-1),T[g]=sin(v),P[g]=cos(v);for(g=0;g<s;g++)for(y=0;y<u;y++)x[S++]=t.x*w[g]*P[y],x[S++]=t.y*w[g]*T[y],x[S++]=t.z*E[g];if(p)for(g=0;g<s;g++)for(y=0;y<u;y++)x[S++]=i.x*w[g]*P[y],x[S++]=i.y*w[g]*T[y],x[S++]=i.z*E[g];for(g=S=0;g<c*h;g++){var M=g*s;for(y=0;y<s-1;y++)A[S++]=M+y,A[S++]=M+y+1}var D=c*s*h;for(g=0;g<u;g++)for(y=0;y<s-1;y++)A[S++]=D+g+y*u,A[S++]=D+g+(y+1)*u;if(p)for(D=c*s*h+u*s,g=0;g<u;g++)for(y=0;y<s-1;y++)A[S++]=D+g+y*u,A[S++]=D+g+(y+1)*u;if(p){var I=c*s*h,O=I+s*u;if(f)for(g=0;g<u;g++)A[S++]=I+g,A[S++]=O+g;if(m)for(I+=s*u-u,O+=s*u-u,g=0;g<u;g++)A[S++]=I+g,A[S++]=O+g}var R=new GeometryAttributes({position:new GeometryAttribute({componentDatatype:ComponentDatatype$1.DOUBLE,componentsPerAttribute:3,values:x})});if(defined(e._offsetAttribute)){var L=x.length,N=new Uint8Array(L/3);arrayFill(N,e._offsetAttribute===GeometryOffsetAttribute$1.NONE?0:1),R.applyOffset=new GeometryAttribute({componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE,componentsPerAttribute:1,values:N})}return new Geometry({attributes:R,indices:A,primitiveType:PrimitiveType$1.LINES,boundingSphere:BoundingSphere.fromEllipsoid(l),offsetAttribute:e._offsetAttribute})}}},SphereOutlineGeometry.packedLength=EllipsoidOutlineGeometry.packedLength,SphereOutlineGeometry.pack=function(e,t,i){return EllipsoidOutlineGeometry.pack(e._ellipsoidGeometry,t,i)};var scratchEllipsoidGeometry=new EllipsoidOutlineGeometry,scratchOptions$3={radius:void 0,radii:new Cartesian3,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};function ClearCommand(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this.color=e.color,this.depth=e.depth,this.stencil=e.stencil,this.renderState=e.renderState,this.framebuffer=e.framebuffer,this.owner=e.owner,this.pass=e.pass}function PassState(e){this.context=e,this.framebuffer=void 0,this.blendingEnabled=void 0,this.scissorTest=void 0,this.viewport=void 0}SphereOutlineGeometry.unpack=function(e,t,i){var r=EllipsoidOutlineGeometry.unpack(e,t,scratchEllipsoidGeometry);return scratchOptions$3.stackPartitions=r._stackPartitions,scratchOptions$3.slicePartitions=r._slicePartitions,scratchOptions$3.subdivisions=r._subdivisions,defined(i)?(Cartesian3.clone(r._radii,scratchOptions$3.radii),i._ellipsoidGeometry=new EllipsoidOutlineGeometry(scratchOptions$3),i):(scratchOptions$3.radius=r._radii.x,new SphereOutlineGeometry(scratchOptions$3))},SphereOutlineGeometry.createGeometry=function(e){return EllipsoidOutlineGeometry.createGeometry(e._ellipsoidGeometry)},ClearCommand.ALL=Object.freeze(new ClearCommand({color:new Color(0,0,0,0),depth:1,stencil:0})),ClearCommand.prototype.execute=function(e,t){e.clear(this,t)};var RenderbufferFormat={RGBA4:WebGLConstants$1.RGBA4,RGB5_A1:WebGLConstants$1.RGB5_A1,RGB565:WebGLConstants$1.RGB565,DEPTH_COMPONENT16:WebGLConstants$1.DEPTH_COMPONENT16,STENCIL_INDEX8:WebGLConstants$1.STENCIL_INDEX8,DEPTH_STENCIL:WebGLConstants$1.DEPTH_STENCIL,validate:function(e){return e===RenderbufferFormat.RGBA4||e===RenderbufferFormat.RGB5_A1||e===RenderbufferFormat.RGB565||e===RenderbufferFormat.DEPTH_COMPONENT16||e===RenderbufferFormat.STENCIL_INDEX8||e===RenderbufferFormat.DEPTH_STENCIL}},RenderbufferFormat$1=Object.freeze(RenderbufferFormat);function Renderbuffer(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).context._gl,i=defaultValue(e.format,RenderbufferFormat$1.RGBA4),r=defined(e.width)?e.width:t.drawingBufferWidth,n=defined(e.height)?e.height:t.drawingBufferHeight;this._gl=t,this._format=i,this._width=r,this._height=n,this._renderbuffer=this._gl.createRenderbuffer(),t.bindRenderbuffer(t.RENDERBUFFER,this._renderbuffer),t.renderbufferStorage(t.RENDERBUFFER,i,r,n),t.bindRenderbuffer(t.RENDERBUFFER,null)}Object.defineProperties(Renderbuffer.prototype,{format:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}}),Renderbuffer.prototype._getRenderbuffer=function(){return this._renderbuffer},Renderbuffer.prototype.isDestroyed=function(){return!1},Renderbuffer.prototype.destroy=function(){return this._gl.deleteRenderbuffer(this._renderbuffer),destroyObject(this)};var CameraFlightPath={};function getAltitude(e,t,i){var r,n,a;if(e instanceof PerspectiveFrustum){var o=Math.tan(.5*e.fovy);return r=e.near,n=e.near*o,a=e.aspectRatio*n,Math.max(t*r/a,i*r/n)}return e instanceof PerspectiveOffCenterFrustum?(r=e.near,n=e.top,a=e.right,Math.max(t*r/a,i*r/n)):Math.max(t,i)}var scratchCart=new Cartesian3,scratchCart2$2=new Cartesian3;function createPitchFunction(n,a,o,e){if(defined(e)&&o(.5)>e){var s=o(0),l=o(1),t=o(.5),u=t-s,c=t-l;return function(e){var t=o(e);if(e<=.5){var i=(t-s)/u;return CesiumMath.lerp(n,-CesiumMath.PI_OVER_TWO,i)}var r=(t-l)/c;return CesiumMath.lerp(-CesiumMath.PI_OVER_TWO,a,1-r)}}return function(e){return CesiumMath.lerp(n,a,e)}}function createHeightFunction(e,t,i,r,n){var a=n,o=Math.max(i,r);if(!defined(a)){var s=e.position,l=t,u=e.up,c=e.right,d=e.frustum,h=Cartesian3.subtract(s,l,scratchCart),p=Cartesian3.magnitude(Cartesian3.multiplyByScalar(u,Cartesian3.dot(h,u),scratchCart2$2)),f=Cartesian3.magnitude(Cartesian3.multiplyByScalar(c,Cartesian3.dot(h,c),scratchCart2$2));a=Math.min(.2*getAltitude(d,p,f),1e9)}if(o<a){var m=-Math.pow(1e6*(a-i),1/8),g=Math.pow(1e6*(a-r),1/8);return function(e){var t=e*(g-m)+m;return-Math.pow(t,8)/1e6+a}}return function(e){return CesiumMath.lerp(i,r,e)}}function adjustAngleForLERP(e,t){return CesiumMath.equalsEpsilon(e,CesiumMath.TWO_PI,CesiumMath.EPSILON11)&&(e=0),t>e+Math.PI?e+=CesiumMath.TWO_PI:t<e-Math.PI&&(e-=CesiumMath.TWO_PI),e}var scratchStart=new Cartesian3;function createUpdateCV(e,i,r,n,a,o,t){var s=e.camera,l=Cartesian3.clone(s.position,scratchStart),u=s.pitch,c=adjustAngleForLERP(s.heading,n),d=adjustAngleForLERP(s.roll,o),h=createHeightFunction(s,r,l.z,r.z,t);return function(e){var t=e.time/i;s.setView({orientation:{heading:CesiumMath.lerp(c,n,t),pitch:CesiumMath.lerp(u,a,t),roll:CesiumMath.lerp(d,o,t)}}),Cartesian2.lerp(l,r,t,s.position),s.position.z=h(t)}}function useLongestFlight(e,t){e.longitude<t.longitude?e.longitude+=CesiumMath.TWO_PI:t.longitude+=CesiumMath.TWO_PI}function useShortestFlight(e,t){var i=e.longitude-t.longitude;i<-CesiumMath.PI?e.longitude+=CesiumMath.TWO_PI:i>CesiumMath.PI&&(t.longitude+=CesiumMath.TWO_PI)}var scratchStartCart=new Cartographic,scratchEndCart=new Cartographic;function createUpdate3D(e,r,t,n,i,a,o,s,l,u){var c=e.camera,d=e.mapProjection.ellipsoid,h=Cartographic.clone(c.positionCartographic,scratchStartCart),p=c.pitch,f=adjustAngleForLERP(c.heading,n),m=adjustAngleForLERP(c.roll,a),g=d.cartesianToCartographic(t,scratchEndCart);h.longitude=CesiumMath.zeroToTwoPi(h.longitude),g.longitude=CesiumMath.zeroToTwoPi(g.longitude);var y=!1;if(defined(s)){var v=CesiumMath.zeroToTwoPi(s),_=Math.min(h.longitude,g.longitude),C=Math.max(h.longitude,g.longitude),x=_<=v&&v<=C;if(defined(l)){var b=Math.abs(h.longitude-g.longitude),A=CesiumMath.TWO_PI-b;(x?b:A)<(x?A:b)*l&&!x&&(y=!0)}else x||(y=!0)}y?useLongestFlight(h,g):useShortestFlight(h,g);var S,w,E,T,P=createHeightFunction(c,t,h.height,g.height,o),M=createPitchFunction(p,i,P,u);return S=h.longitude,w=g.longitude,E=h.latitude,T=g.latitude,function(e){var t=e.time/r,i=Cartesian3.fromRadians(CesiumMath.lerp(S,w,t),CesiumMath.lerp(E,T,t),P(t));c.setView({destination:i,orientation:{heading:CesiumMath.lerp(f,n,t),pitch:M(t),roll:CesiumMath.lerp(m,a,t)}})}}function createUpdate2D(e,o,s,l,t,i,r){var u=e.camera,c=Cartesian3.clone(u.position,scratchStart),d=adjustAngleForLERP(u.heading,l),n=u.frustum.right-u.frustum.left,h=createHeightFunction(u,s,n,s.z,r);return function(e){var t=e.time/o;u.setView({orientation:{heading:CesiumMath.lerp(d,l,t)}}),Cartesian2.lerp(c,s,t,u.position);var i=h(t),r=u.frustum,n=r.top/r.right,a=.5*(i-(r.right-r.left));r.right+=a,r.left-=a,r.top=n*r.right,r.bottom=-r.top}}var scratchCartographic$4=new Cartographic,scratchDestination=new Cartesian3;function emptyFlight(e,t){return{startObject:{},stopObject:{},duration:0,complete:e,cancel:t}}function wrapCallback(e,t){return function(){"function"==typeof t&&t(),e.enableInputs=!0}}CameraFlightPath.createTween=function(e,t){var i=(t=defaultValue(t,defaultValue.EMPTY_OBJECT)).destination,r=e.mode;if(r===SceneMode$1.MORPHING)return emptyFlight();var n=defaultValue(t.convert,!0),a=e.mapProjection,o=a.ellipsoid,s=t.maximumHeight,l=t.flyOverLongitude,u=t.flyOverLongitudeWeight,c=t.pitchAdjustHeight,d=t.easingFunction;n&&r!==SceneMode$1.SCENE3D&&(o.cartesianToCartographic(i,scratchCartographic$4),i=a.project(scratchCartographic$4,scratchDestination));var h=e.camera,p=t.endTransform;defined(p)&&h._setTransform(p);var f=t.duration;defined(f)||(f=Math.ceil(Cartesian3.distance(h.position,i)/1e6)+2,f=Math.min(f,3));var m=defaultValue(t.heading,0),g=defaultValue(t.pitch,-CesiumMath.PI_OVER_TWO),y=defaultValue(t.roll,0),v=e.screenSpaceCameraController;v.enableInputs=!1;var _=wrapCallback(v,t.complete),C=wrapCallback(v,t.cancel),x=h.frustum,b=e.mode===SceneMode$1.SCENE2D;if(b=(b=(b=(b=b&&Cartesian2.equalsEpsilon(h.position,i,CesiumMath.EPSILON6))&&CesiumMath.equalsEpsilon(Math.max(x.right-x.left,x.top-x.bottom),i.z,CesiumMath.EPSILON6))||e.mode!==SceneMode$1.SCENE2D&&Cartesian3.equalsEpsilon(i,h.position,CesiumMath.EPSILON10))&&CesiumMath.equalsEpsilon(CesiumMath.negativePiToPi(m),CesiumMath.negativePiToPi(h.heading),CesiumMath.EPSILON10)&&CesiumMath.equalsEpsilon(CesiumMath.negativePiToPi(g),CesiumMath.negativePiToPi(h.pitch),CesiumMath.EPSILON10)&&CesiumMath.equalsEpsilon(CesiumMath.negativePiToPi(y),CesiumMath.negativePiToPi(h.roll),CesiumMath.EPSILON10))return emptyFlight(_,C);var A=new Array(4);if(A[SceneMode$1.SCENE2D]=createUpdate2D,A[SceneMode$1.SCENE3D]=createUpdate3D,A[SceneMode$1.COLUMBUS_VIEW]=createUpdateCV,f<=0){return emptyFlight(function(){A[r](e,1,i,m,g,y,s,l,u,c)({time:1}),"function"==typeof _&&_()},C)}var S=A[r](e,f,i,m,g,y,s,l,u,c);if(!defined(d)){var w=h.positionCartographic.height;d=(r===SceneMode$1.SCENE3D?o.cartesianToCartographic(i).height:i.z)<w&&11500<w?EasingFunction$1.CUBIC_OUT:EasingFunction$1.QUINTIC_IN_OUT}return{duration:f,easingFunction:d,startObject:{time:0},stopObject:{time:f},update:S,complete:_,cancel:C}};var MapMode2D={ROTATE:0,INFINITE_SCROLL:1},MapMode2D$1=Object.freeze(MapMode2D);function Camera(e){this._scene=e,this._transform=Matrix4.clone(Matrix4.IDENTITY),this._invTransform=Matrix4.clone(Matrix4.IDENTITY),this._actualTransform=Matrix4.clone(Matrix4.IDENTITY),this._actualInvTransform=Matrix4.clone(Matrix4.IDENTITY),this._transformChanged=!1,this.position=new Cartesian3,this._position=new Cartesian3,this._positionWC=new Cartesian3,this._positionCartographic=new Cartographic,this._oldPositionWC=void 0,this.positionWCDeltaMagnitude=0,this.positionWCDeltaMagnitudeLastFrame=0,this.timeSinceMoved=0,this._lastMovedTimestamp=0,this.direction=new Cartesian3,this._direction=new Cartesian3,this._directionWC=new Cartesian3,this.up=new Cartesian3,this._up=new Cartesian3,this._upWC=new Cartesian3,this.right=new Cartesian3,this._right=new Cartesian3,this._rightWC=new Cartesian3,this.frustum=new PerspectiveFrustum,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=CesiumMath.toRadians(60),this.defaultMoveAmount=1e5,this.defaultLookAmount=Math.PI/60,this.defaultRotateAmount=Math.PI/3600,this.defaultZoomAmount=1e5,this.constrainedAxis=void 0,this.maximumZoomFactor=1.5,this._moveStart=new Event,this._moveEnd=new Event,this._changed=new Event,this._changedPosition=void 0,this._changedDirection=void 0,this._changedFrustum=void 0,this.percentageChanged=.5,this._viewMatrix=new Matrix4,this._invViewMatrix=new Matrix4,updateViewMatrix(this),this._mode=SceneMode$1.SCENE3D,this._modeChanged=!0;var t=e.mapProjection;this._projection=t,this._maxCoord=t.project(new Cartographic(Math.PI,CesiumMath.PI_OVER_TWO)),this._max2Dfrustum=void 0,rectangleCameraPosition3D(this,Camera.DEFAULT_VIEW_RECTANGLE,this.position,!0);var i=Cartesian3.magnitude(this.position);i+=i*Camera.DEFAULT_VIEW_FACTOR,Cartesian3.normalize(this.position,this.position),Cartesian3.multiplyByScalar(this.position,i,this.position)}function updateViewMatrix(e){Matrix4.computeView(e._position,e._direction,e._up,e._right,e._viewMatrix),Matrix4.multiply(e._viewMatrix,e._actualInvTransform,e._viewMatrix),Matrix4.inverseTransformation(e._viewMatrix,e._invViewMatrix)}function updateCameraDeltas(e){if(defined(e._oldPositionWC)){e.positionWCDeltaMagnitudeLastFrame=e.positionWCDeltaMagnitude;var t=Cartesian3.subtract(e.positionWC,e._oldPositionWC,e._oldPositionWC);e.positionWCDeltaMagnitude=Cartesian3.magnitude(t),e._oldPositionWC=Cartesian3.clone(e.positionWC,e._oldPositionWC),0<e.positionWCDeltaMagnitude?(e.timeSinceMoved=0,e._lastMovedTimestamp=getTimestamp$1()):e.timeSinceMoved=Math.max(getTimestamp$1()-e._lastMovedTimestamp,0)/1e3}else e._oldPositionWC=Cartesian3.clone(e.positionWC,e._oldPositionWC)}function convertTransformForColumbusView(e){Transforms.basisTo2D(e._projection,e._transform,e._actualTransform)}Camera.TRANSFORM_2D=new Matrix4(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),Camera.TRANSFORM_2D_INVERSE=Matrix4.inverseTransformation(Camera.TRANSFORM_2D,new Matrix4),Camera.DEFAULT_VIEW_RECTANGLE=Rectangle.fromDegrees(-95,-20,-70,90),Camera.DEFAULT_VIEW_FACTOR=.5,Camera.DEFAULT_OFFSET=new HeadingPitchRange(0,-CesiumMath.PI_OVER_FOUR,0),Camera.prototype.canPreloadFlight=function(){return defined(this._currentFlight)&&this._mode!==SceneMode$1.SCENE2D},Camera.prototype._updateCameraChanged=function(){var e=this;if(updateCameraDeltas(e),0!==e._changed.numberOfListeners){var t=e.percentageChanged;if(e._mode!==SceneMode$1.SCENE2D){if(!defined(e._changedDirection))return e._changedPosition=Cartesian3.clone(e.positionWC,e._changedPosition),void(e._changedDirection=Cartesian3.clone(e.directionWC,e._changedDirection));var i,r=CesiumMath.acosClamped(Cartesian3.dot(e.directionWC,e._changedDirection));i=defined(e.frustum.fovy)?r/(.5*e.frustum.fovy):r;var n=Cartesian3.distance(e.positionWC,e._changedPosition)/e.positionCartographic.height;(t<i||t<n)&&(e._changed.raiseEvent(Math.max(i,n)),e._changedPosition=Cartesian3.clone(e.positionWC,e._changedPosition),e._changedDirection=Cartesian3.clone(e.directionWC,e._changedDirection))}else{if(!defined(e._changedFrustum))return e._changedPosition=Cartesian3.clone(e.position,e._changedPosition),void(e._changedFrustum=e.frustum.clone());var a,o=e.position,s=e._changedPosition,l=e.frustum,u=e._changedFrustum,c=o.x+l.left,d=o.x+l.right,h=s.x+u.left,p=s.x+u.right,f=o.y+l.bottom,m=o.y+l.top,g=s.y+u.bottom,y=s.y+u.top,v=Math.max(c,h),_=Math.min(d,p),C=Math.max(f,g),x=Math.min(m,y);if(_<=v||m<=C)a=1;else{var b=u;c<h&&p<d&&f<g&&y<m&&(b=l),a=1-(_-v)*(x-C)/((b.right-b.left)*(b.top-b.bottom))}t<a&&(e._changed.raiseEvent(a),e._changedPosition=Cartesian3.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone(e._changedFrustum))}}};var scratchCartographic$5=new Cartographic,scratchCartesian3Projection$1=new Cartesian3,scratchCartesian3$7=new Cartesian3,scratchCartesian4Origin=new Cartesian4,scratchCartesian4NewOrigin=new Cartesian4,scratchCartesian4NewXAxis=new Cartesian4,scratchCartesian4NewYAxis=new Cartesian4,scratchCartesian4NewZAxis=new Cartesian4;function convertTransformFor2D(e){var t=e._projection,i=t.ellipsoid,r=Matrix4.getColumn(e._transform,3,scratchCartesian4Origin),n=i.cartesianToCartographic(r,scratchCartographic$5),a=t.project(n,scratchCartesian3Projection$1),o=scratchCartesian4NewOrigin;o.x=a.z,o.y=a.x,o.z=a.y,o.w=1;var s=Cartesian4.clone(Cartesian4.UNIT_X,scratchCartesian4NewZAxis),l=Cartesian4.add(Matrix4.getColumn(e._transform,0,scratchCartesian3$7),r,scratchCartesian3$7);i.cartesianToCartographic(l,n),t.project(n,a);var u=scratchCartesian4NewXAxis;u.x=a.z,u.y=a.x,u.z=a.y,u.w=0,Cartesian3.subtract(u,o,u),u.x=0;var c=scratchCartesian4NewYAxis;if(Cartesian3.magnitudeSquared(u)>CesiumMath.EPSILON10)Cartesian3.cross(s,u,c);else{var d=Cartesian4.add(Matrix4.getColumn(e._transform,1,scratchCartesian3$7),r,scratchCartesian3$7);i.cartesianToCartographic(d,n),t.project(n,a),c.x=a.z,c.y=a.x,c.z=a.y,c.w=0,Cartesian3.subtract(c,o,c),c.x=0,Cartesian3.magnitudeSquared(c)<CesiumMath.EPSILON10&&(Cartesian4.clone(Cartesian4.UNIT_Y,u),Cartesian4.clone(Cartesian4.UNIT_Z,c))}Cartesian3.cross(c,s,u),Cartesian3.normalize(u,u),Cartesian3.cross(s,u,c),Cartesian3.normalize(c,c),Matrix4.setColumn(e._actualTransform,0,u,e._actualTransform),Matrix4.setColumn(e._actualTransform,1,c,e._actualTransform),Matrix4.setColumn(e._actualTransform,2,s,e._actualTransform),Matrix4.setColumn(e._actualTransform,3,o,e._actualTransform)}var scratchCartesian$2=new Cartesian3;function updateMembers(e){var t=e._mode,i=!1,r=0;t===SceneMode$1.SCENE2D&&(i=(r=e.frustum.right-e.frustum.left)!==e._positionCartographic.height);var n=e._position,a=!Cartesian3.equals(n,e.position)||i;a&&(n=Cartesian3.clone(e.position,e._position));var o=e._direction,s=!Cartesian3.equals(o,e.direction);s&&(Cartesian3.normalize(e.direction,e.direction),o=Cartesian3.clone(e.direction,e._direction));var l=e._up,u=!Cartesian3.equals(l,e.up);u&&(Cartesian3.normalize(e.up,e.up),l=Cartesian3.clone(e.up,e._up));var c=e._right,d=!Cartesian3.equals(c,e.right);d&&(Cartesian3.normalize(e.right,e.right),c=Cartesian3.clone(e.right,e._right));var h=e._transformChanged||e._modeChanged;e._transformChanged=!1,h&&(Matrix4.inverseTransformation(e._transform,e._invTransform),e._mode===SceneMode$1.COLUMBUS_VIEW||e._mode===SceneMode$1.SCENE2D?Matrix4.equals(Matrix4.IDENTITY,e._transform)?Matrix4.clone(Camera.TRANSFORM_2D,e._actualTransform):e._mode===SceneMode$1.COLUMBUS_VIEW?convertTransformForColumbusView(e):convertTransformFor2D(e):Matrix4.clone(e._transform,e._actualTransform),Matrix4.inverseTransformation(e._actualTransform,e._actualInvTransform),e._modeChanged=!1);var p=e._actualTransform;if(a||h)if(e._positionWC=Matrix4.multiplyByPoint(p,n,e._positionWC),t===SceneMode$1.SCENE3D||t===SceneMode$1.MORPHING)e._positionCartographic=e._projection.ellipsoid.cartesianToCartographic(e._positionWC,e._positionCartographic);else{var f=scratchCartesian$2;f.x=e._positionWC.y,f.y=e._positionWC.z,f.z=e._positionWC.x,t===SceneMode$1.SCENE2D&&(f.z=r),e._projection.unproject(f,e._positionCartographic)}if(s||u||d){var m=Cartesian3.dot(o,Cartesian3.cross(l,c,scratchCartesian$2));if(Math.abs(1-m)>CesiumMath.EPSILON2){var g=1/Cartesian3.magnitudeSquared(l),y=Cartesian3.dot(l,o)*g,v=Cartesian3.multiplyByScalar(o,y,scratchCartesian$2);l=Cartesian3.normalize(Cartesian3.subtract(l,v,e._up),e._up),Cartesian3.clone(l,e.up),c=Cartesian3.cross(o,l,e._right),Cartesian3.clone(c,e.right)}}(s||h)&&(e._directionWC=Matrix4.multiplyByPointAsVector(p,o,e._directionWC),Cartesian3.normalize(e._directionWC,e._directionWC)),(u||h)&&(e._upWC=Matrix4.multiplyByPointAsVector(p,l,e._upWC),Cartesian3.normalize(e._upWC,e._upWC)),(d||h)&&(e._rightWC=Matrix4.multiplyByPointAsVector(p,c,e._rightWC),Cartesian3.normalize(e._rightWC,e._rightWC)),(a||s||u||d||h)&&updateViewMatrix(e)}function getHeading(e,t){var i;return i=CesiumMath.equalsEpsilon(Math.abs(e.z),1,CesiumMath.EPSILON3)?Math.atan2(t.y,t.x)-CesiumMath.PI_OVER_TWO:Math.atan2(e.y,e.x)-CesiumMath.PI_OVER_TWO,CesiumMath.TWO_PI-CesiumMath.zeroToTwoPi(i)}function getPitch(e){return CesiumMath.PI_OVER_TWO-CesiumMath.acosClamped(e.z)}function getRoll(e,t,i){var r=0;return CesiumMath.equalsEpsilon(Math.abs(e.z),1,CesiumMath.EPSILON3)||(r=Math.atan2(-i.z,t.z),r=CesiumMath.zeroToTwoPi(r+CesiumMath.TWO_PI)),r}var scratchHPRMatrix1=new Matrix4,scratchHPRMatrix2=new Matrix4;Object.defineProperties(Camera.prototype,{transform:{get:function(){return this._transform}},inverseTransform:{get:function(){return updateMembers(this),this._invTransform}},viewMatrix:{get:function(){return updateMembers(this),this._viewMatrix}},inverseViewMatrix:{get:function(){return updateMembers(this),this._invViewMatrix}},positionCartographic:{get:function(){return updateMembers(this),this._positionCartographic}},positionWC:{get:function(){return updateMembers(this),this._positionWC}},directionWC:{get:function(){return updateMembers(this),this._directionWC}},upWC:{get:function(){return updateMembers(this),this._upWC}},rightWC:{get:function(){return updateMembers(this),this._rightWC}},heading:{get:function(){if(this._mode!==SceneMode$1.MORPHING){var e=this._projection.ellipsoid,t=Matrix4.clone(this._transform,scratchHPRMatrix1),i=Transforms.eastNorthUpToFixedFrame(this.positionWC,e,scratchHPRMatrix2);this._setTransform(i);var r=getHeading(this.direction,this.up);return this._setTransform(t),r}}},pitch:{get:function(){if(this._mode!==SceneMode$1.MORPHING){var e=this._projection.ellipsoid,t=Matrix4.clone(this._transform,scratchHPRMatrix1),i=Transforms.eastNorthUpToFixedFrame(this.positionWC,e,scratchHPRMatrix2);this._setTransform(i);var r=getPitch(this.direction);return this._setTransform(t),r}}},roll:{get:function(){if(this._mode!==SceneMode$1.MORPHING){var e=this._projection.ellipsoid,t=Matrix4.clone(this._transform,scratchHPRMatrix1),i=Transforms.eastNorthUpToFixedFrame(this.positionWC,e,scratchHPRMatrix2);this._setTransform(i);var r=getRoll(this.direction,this.up,this.right);return this._setTransform(t),r}}},moveStart:{get:function(){return this._moveStart}},moveEnd:{get:function(){return this._moveEnd}},changed:{get:function(){return this._changed}}}),Camera.prototype.update=function(e){var t=!1;if(e!==this._mode&&(this._mode=e,this._modeChanged=e!==SceneMode$1.MORPHING,t=this._mode===SceneMode$1.SCENE2D),t){var i=this._max2Dfrustum=this.frustum.clone(),r=i.top/i.right;i.right=2*this._maxCoord.x,i.left=-i.right,i.top=r*i.right,i.bottom=-i.top}this._mode===SceneMode$1.SCENE2D&&clampMove2D(this,this.position)};var setTransformPosition=new Cartesian3,setTransformUp=new Cartesian3,setTransformDirection=new Cartesian3;Camera.prototype._setTransform=function(e){var t=Cartesian3.clone(this.positionWC,setTransformPosition),i=Cartesian3.clone(this.upWC,setTransformUp),r=Cartesian3.clone(this.directionWC,setTransformDirection);Matrix4.clone(e,this._transform),this._transformChanged=!0,updateMembers(this);var n=this._actualInvTransform;Matrix4.multiplyByPoint(n,t,this.position),Matrix4.multiplyByPointAsVector(n,r,this.direction),Matrix4.multiplyByPointAsVector(n,i,this.up),Cartesian3.cross(this.direction,this.up,this.right),updateMembers(this)};var scratchAdjustOrtghographicFrustumMousePosition=new Cartesian2,pickGlobeScratchRay=new Ray,scratchRayIntersection=new Cartesian3,scratchDepthIntersection=new Cartesian3;Camera.prototype._adjustOrthographicFrustum=function(e){if(this.frustum instanceof OrthographicFrustum&&(e||!(this._positionCartographic.height<15e4)))if(Matrix4.equals(Matrix4.IDENTITY,this.transform)){var t,i,r=this._scene,n=r.globe;if(defined(n)){var a=scratchAdjustOrtghographicFrustumMousePosition;a.x=r.drawingBufferWidth/2,a.y=r.drawingBufferHeight/2;var o=this.getPickRay(a,pickGlobeScratchRay);if(t=n.pickWorldCoordinates(o,r,scratchRayIntersection),r.pickPositionSupported&&(i=r.pickPositionWorldCoordinates(a,scratchDepthIntersection)),defined(t)&&defined(i)){var s=defined(i)?Cartesian3.distance(i,this.positionWC):Number.POSITIVE_INFINITY,l=defined(t)?Cartesian3.distance(t,this.positionWC):Number.POSITIVE_INFINITY;this.frustum.width=Math.min(s,l)}else defined(i)?this.frustum.width=Cartesian3.distance(i,this.positionWC):defined(t)&&(this.frustum.width=Cartesian3.distance(t,this.positionWC))}if(!defined(n)||!defined(t)&&!defined(i)){var u=Math.max(this.positionCartographic.height,0);this.frustum.width=u}}else this.frustum.width=Cartesian3.magnitude(this.position)};var scratchSetViewCartesian=new Cartesian3,scratchSetViewTransform1=new Matrix4,scratchSetViewTransform2=new Matrix4,scratchSetViewQuaternion=new Quaternion,scratchSetViewMatrix3=new Matrix3,scratchSetViewCartographic=new Cartographic;function setView3D(e,t,i){var r=Matrix4.clone(e.transform,scratchSetViewTransform1),n=Transforms.eastNorthUpToFixedFrame(t,e._projection.ellipsoid,scratchSetViewTransform2);e._setTransform(n),Cartesian3.clone(Cartesian3.ZERO,e.position),i.heading=i.heading-CesiumMath.PI_OVER_TWO;var a=Quaternion.fromHeadingPitchRoll(i,scratchSetViewQuaternion),o=Matrix3.fromQuaternion(a,scratchSetViewMatrix3);Matrix3.getColumn(o,0,e.direction),Matrix3.getColumn(o,2,e.up),Cartesian3.cross(e.direction,e.up,e.right),e._setTransform(r),e._adjustOrthographicFrustum(!0)}function setViewCV(e,t,i,r){var n=Matrix4.clone(e.transform,scratchSetViewTransform1);if(e._setTransform(Matrix4.IDENTITY),!Cartesian3.equals(t,e.positionWC)){if(r){var a=e._projection,o=a.ellipsoid.cartesianToCartographic(t,scratchSetViewCartographic);t=a.project(o,scratchSetViewCartesian)}Cartesian3.clone(t,e.position)}i.heading=i.heading-CesiumMath.PI_OVER_TWO;var s=Quaternion.fromHeadingPitchRoll(i,scratchSetViewQuaternion),l=Matrix3.fromQuaternion(s,scratchSetViewMatrix3);Matrix3.getColumn(l,0,e.direction),Matrix3.getColumn(l,2,e.up),Cartesian3.cross(e.direction,e.up,e.right),e._setTransform(n),e._adjustOrthographicFrustum(!0)}function setView2D(e,t,i,r){var n=Matrix4.clone(e.transform,scratchSetViewTransform1);if(e._setTransform(Matrix4.IDENTITY),!Cartesian3.equals(t,e.positionWC)){if(r){var a=e._projection,o=a.ellipsoid.cartesianToCartographic(t,scratchSetViewCartographic);t=a.project(o,scratchSetViewCartesian)}Cartesian2.clone(t,e.position);var s=.5*-t.z,l=-s,u=e.frustum;if(s<l){var c=u.top/u.right;u.right=l,u.left=s,u.top=u.right*c,u.bottom=-u.top}}if(e._scene.mapMode2D===MapMode2D$1.ROTATE){i.heading=i.heading-CesiumMath.PI_OVER_TWO,i.pitch=-CesiumMath.PI_OVER_TWO,i.roll=0;var d=Quaternion.fromHeadingPitchRoll(i,scratchSetViewQuaternion),h=Matrix3.fromQuaternion(d,scratchSetViewMatrix3);Matrix3.getColumn(h,2,e.up),Cartesian3.cross(e.direction,e.up,e.right)}e._setTransform(n)}var scratchToHPRDirection=new Cartesian3,scratchToHPRUp=new Cartesian3,scratchToHPRRight=new Cartesian3;function directionUpToHeadingPitchRoll(e,t,i,r){var n=Cartesian3.clone(i.direction,scratchToHPRDirection),a=Cartesian3.clone(i.up,scratchToHPRUp);if(e._scene.mode===SceneMode$1.SCENE3D){var o=e._projection.ellipsoid,s=Transforms.eastNorthUpToFixedFrame(t,o,scratchHPRMatrix1),l=Matrix4.inverseTransformation(s,scratchHPRMatrix2);Matrix4.multiplyByPointAsVector(l,n,n),Matrix4.multiplyByPointAsVector(l,a,a)}var u=Cartesian3.cross(n,a,scratchToHPRRight);return r.heading=getHeading(n,a),r.pitch=getPitch(n),r.roll=getRoll(n,a,u),r}var scratchSetViewOptions={destination:void 0,orientation:{direction:void 0,up:void 0,heading:void 0,pitch:void 0,roll:void 0},convert:void 0,endTransform:void 0},scratchHpr=new HeadingPitchRoll;Camera.prototype.setView=function(e){var t=defaultValue((e=defaultValue(e,defaultValue.EMPTY_OBJECT)).orientation,defaultValue.EMPTY_OBJECT),i=this._mode;if(i!==SceneMode$1.MORPHING){defined(e.endTransform)&&this._setTransform(e.endTransform);var r=defaultValue(e.convert,!0),n=defaultValue(e.destination,Cartesian3.clone(this.positionWC,scratchSetViewCartesian));defined(n)&&defined(n.west)&&(n=this.getRectangleCameraCoordinates(n,scratchSetViewCartesian),r=!1),defined(t.direction)&&(t=directionUpToHeadingPitchRoll(this,n,t,scratchSetViewOptions.orientation)),scratchHpr.heading=defaultValue(t.heading,0),scratchHpr.pitch=defaultValue(t.pitch,-CesiumMath.PI_OVER_TWO),scratchHpr.roll=defaultValue(t.roll,0),i===SceneMode$1.SCENE3D?setView3D(this,n,scratchHpr):i===SceneMode$1.SCENE2D?setView2D(this,n,scratchHpr,r):setViewCV(this,n,scratchHpr,r)}};var pitchScratch=new Cartesian3;function clampMove2D(e,t){var i,r,n=e._scene.mapMode2D===MapMode2D$1.ROTATE,a=e._maxCoord.x,o=e._maxCoord.y;i=n?-(r=a):(r=t.x-2*a,t.x+2*a),t.x>a&&(t.x=r),t.x<-a&&(t.x=i),t.y>o&&(t.y=o),t.y<-o&&(t.y=-o)}Camera.prototype.flyHome=function(e){var t=this._mode;if(t===SceneMode$1.MORPHING&&this._scene.completeMorph(),t===SceneMode$1.SCENE2D)this.flyTo({destination:Camera.DEFAULT_VIEW_RECTANGLE,duration:e,endTransform:Matrix4.IDENTITY});else if(t===SceneMode$1.SCENE3D){var i=this.getRectangleCameraCoordinates(Camera.DEFAULT_VIEW_RECTANGLE),r=Cartesian3.magnitude(i);r+=r*Camera.DEFAULT_VIEW_FACTOR,Cartesian3.normalize(i,i),Cartesian3.multiplyByScalar(i,r,i),this.flyTo({destination:i,duration:e,endTransform:Matrix4.IDENTITY})}else if(t===SceneMode$1.COLUMBUS_VIEW){var n=this._projection.ellipsoid.maximumRadius,a=new Cartesian3(0,-1,1);a=Cartesian3.multiplyByScalar(Cartesian3.normalize(a,a),5*n,a),this.flyTo({destination:a,duration:e,orientation:{heading:0,pitch:-Math.acos(Cartesian3.normalize(a,pitchScratch).z),roll:0},endTransform:Matrix4.IDENTITY,convert:!1})}},Camera.prototype.worldToCameraCoordinates=function(e,t){return defined(t)||(t=new Cartesian4),updateMembers(this),Matrix4.multiplyByVector(this._actualInvTransform,e,t)},Camera.prototype.worldToCameraCoordinatesPoint=function(e,t){return defined(t)||(t=new Cartesian3),updateMembers(this),Matrix4.multiplyByPoint(this._actualInvTransform,e,t)},Camera.prototype.worldToCameraCoordinatesVector=function(e,t){return defined(t)||(t=new Cartesian3),updateMembers(this),Matrix4.multiplyByPointAsVector(this._actualInvTransform,e,t)},Camera.prototype.cameraToWorldCoordinates=function(e,t){return defined(t)||(t=new Cartesian4),updateMembers(this),Matrix4.multiplyByVector(this._actualTransform,e,t)},Camera.prototype.cameraToWorldCoordinatesPoint=function(e,t){return defined(t)||(t=new Cartesian3),updateMembers(this),Matrix4.multiplyByPoint(this._actualTransform,e,t)},Camera.prototype.cameraToWorldCoordinatesVector=function(e,t){return defined(t)||(t=new Cartesian3),updateMembers(this),Matrix4.multiplyByPointAsVector(this._actualTransform,e,t)};var moveScratch=new Cartesian3,cameraGroundPosition;Camera.prototype.move=function(e,t){var i=this.position;Cartesian3.multiplyByScalar(e,t,moveScratch);var r=this._scene.screenSpaceCameraController.defaultCollisionRayWidth,n=new Cartesian3;Cartesian3.clone(i,n),Cartesian3.add(n,moveScratch,n),this.modelColliDetection(n,void 0,r)||(this.groundRoaming(n)||Cartesian3.add(i,moveScratch,i),this._mode===SceneMode$1.SCENE2D&&clampMove2D(this,i),this._adjustOrthographicFrustum(!0))},Camera.prototype.moveForward=function(e){e=defaultValue(e,this.defaultMoveAmount),this._mode===SceneMode$1.SCENE2D?zoom2D(this,e):this.move(this.direction,e)},Camera.prototype.moveBackward=function(e){e=defaultValue(e,this.defaultMoveAmount),this._mode===SceneMode$1.SCENE2D?zoom2D(this,-e):this.move(this.direction,-e)},Camera.prototype.moveUp=function(e){e=defaultValue(e,this.defaultMoveAmount),this.move(this.up,e)},Camera.prototype.moveDown=function(e){e=defaultValue(e,this.defaultMoveAmount),this.move(this.up,-e)},Camera.prototype.moveRight=function(e){e=defaultValue(e,this.defaultMoveAmount),this.move(this.right,e)},Camera.prototype.moveLeft=function(e){e=defaultValue(e,this.defaultMoveAmount),this.move(this.right,-e)},Camera.prototype.lookLeft=function(e){e=defaultValue(e,this.defaultLookAmount),this._mode!==SceneMode$1.SCENE2D&&this.look(this.up,-e)},Camera.prototype.lookRight=function(e){e=defaultValue(e,this.defaultLookAmount),this._mode!==SceneMode$1.SCENE2D&&this.look(this.up,e)},Camera.prototype.lookUp=function(e){e=defaultValue(e,this.defaultLookAmount),this._mode!==SceneMode$1.SCENE2D&&this.look(this.right,-e)},Camera.prototype.lookDown=function(e){e=defaultValue(e,this.defaultLookAmount),this._mode!==SceneMode$1.SCENE2D&&this.look(this.right,e)};var lookScratchQuaternion=new Quaternion,lookScratchMatrix=new Matrix3;Camera.prototype.look=function(e,t){var i=defaultValue(t,this.defaultLookAmount),r=Quaternion.fromAxisAngle(e,-i,lookScratchQuaternion),n=Matrix3.fromQuaternion(r,lookScratchMatrix),a=this.direction,o=this.up,s=this.right;Matrix3.multiplyByVector(n,a,a),Matrix3.multiplyByVector(n,o,o),Matrix3.multiplyByVector(n,s,s)},Camera.prototype.twistLeft=function(e){e=defaultValue(e,this.defaultLookAmount),this.look(this.direction,e)},Camera.prototype.twistRight=function(e){e=defaultValue(e,this.defaultLookAmount),this.look(this.direction,-e)};var rotateScratchQuaternion=new Quaternion,rotateScratchMatrix=new Matrix3;Camera.prototype.rotate=function(e,t){var i=defaultValue(t,this.defaultRotateAmount),r=Quaternion.fromAxisAngle(e,-i,rotateScratchQuaternion),n=Matrix3.fromQuaternion(r,rotateScratchMatrix);Matrix3.multiplyByVector(n,this.position,this.position),Matrix3.multiplyByVector(n,this.direction,this.direction),Matrix3.multiplyByVector(n,this.up,this.up),Cartesian3.cross(this.direction,this.up,this.right),Cartesian3.cross(this.right,this.direction,this.up),this._adjustOrthographicFrustum(!1)},Camera.prototype.rotateDown=function(e){rotateVertical(this,e=defaultValue(e,this.defaultRotateAmount))},Camera.prototype.rotateUp=function(e){rotateVertical(this,-(e=defaultValue(e,this.defaultRotateAmount)))};var rotateVertScratchP=new Cartesian3,rotateVertScratchA=new Cartesian3,rotateVertScratchTan=new Cartesian3,rotateVertScratchNegate=new Cartesian3;function rotateVertical(e,t){var i=e.position;if(defined(e.constrainedAxis)&&!Cartesian3.equalsEpsilon(e.position,Cartesian3.ZERO,CesiumMath.EPSILON2)){var r=Cartesian3.normalize(i,rotateVertScratchP),n=Cartesian3.equalsEpsilon(r,e.constrainedAxis,CesiumMath.EPSILON2),a=Cartesian3.equalsEpsilon(r,Cartesian3.negate(e.constrainedAxis,rotateVertScratchNegate),CesiumMath.EPSILON2);if(n||a)(n&&t<0||a&&0<t)&&e.rotate(e.right,t);else{var o=Cartesian3.normalize(e.constrainedAxis,rotateVertScratchA),s=Cartesian3.dot(r,o),l=CesiumMath.acosClamped(s);0<t&&l<t&&(t=l-CesiumMath.EPSILON4),s=Cartesian3.dot(r,Cartesian3.negate(o,rotateVertScratchNegate)),l=CesiumMath.acosClamped(s),t<0&&l<-t&&(t=-l+CesiumMath.EPSILON4);var u=Cartesian3.cross(o,r,rotateVertScratchTan);e.rotate(u,t)}}else e.rotate(e.right,t)}function rotateHorizontal(e,t){defined(e.constrainedAxis)?e.rotate(e.constrainedAxis,t):e.rotate(e.up,t)}function zoom2D(e,t){var i,r=e.frustum;if(t*=.5,Math.abs(r.top)+Math.abs(r.bottom)>Math.abs(r.left)+Math.abs(r.right)){var n=r.top-t,a=r.bottom+t,o=e._maxCoord.y;e._scene.mapMode2D===MapMode2D$1.ROTATE&&(o*=e.maximumZoomFactor),o<a&&(n=-(a=o)),n<=a&&(a=-(n=1)),i=r.right/r.top,r.top=n,r.bottom=a,r.right=r.top*i,r.left=-r.right}else{var s=r.right-t,l=r.left+t,u=e._maxCoord.x;e._scene.mapMode2D===MapMode2D$1.ROTATE&&(u*=e.maximumZoomFactor),u<s&&(l=-(s=u)),s<=l&&(l=-(s=1)),i=r.top/r.right,r.right=s,r.left=l,r.top=r.right*i,r.bottom=-r.top}}function zoom3D(e,t){e.move(e.direction,t)}Camera.prototype.rotateRight=function(e){rotateHorizontal(this,-(e=defaultValue(e,this.defaultRotateAmount)))},Camera.prototype.rotateLeft=function(e){rotateHorizontal(this,e=defaultValue(e,this.defaultRotateAmount))},Camera.prototype.zoomIn=function(e){e=defaultValue(e,this.defaultZoomAmount),this._mode===SceneMode$1.SCENE2D?zoom2D(this,e):zoom3D(this,e)},Camera.prototype.zoomOut=function(e){e=defaultValue(e,this.defaultZoomAmount),this._mode===SceneMode$1.SCENE2D?zoom2D(this,-e):zoom3D(this,-e)},Camera.prototype.getMagnitude=function(){return this._mode===SceneMode$1.SCENE3D?Cartesian3.magnitude(this.position):this._mode===SceneMode$1.COLUMBUS_VIEW?Math.abs(this.position.z):this._mode===SceneMode$1.SCENE2D?Math.max(this.frustum.right-this.frustum.left,this.frustum.top-this.frustum.bottom):void 0};var scratchLookAtMatrix4=new Matrix4;Camera.prototype.lookAt=function(e,t){var i=Transforms.eastNorthUpToFixedFrame(e,Ellipsoid.WGS84,scratchLookAtMatrix4);this.lookAtTransform(i,t)};var scratchLookAtHeadingPitchRangeOffset=new Cartesian3,scratchLookAtHeadingPitchRangeQuaternion1=new Quaternion,scratchLookAtHeadingPitchRangeQuaternion2=new Quaternion,scratchHeadingPitchRangeMatrix3=new Matrix3;function offsetFromHeadingPitchRange(e,t,i){t=CesiumMath.clamp(t,-CesiumMath.PI_OVER_TWO,CesiumMath.PI_OVER_TWO),e=CesiumMath.zeroToTwoPi(e)-CesiumMath.PI_OVER_TWO;var r=Quaternion.fromAxisAngle(Cartesian3.UNIT_Y,-t,scratchLookAtHeadingPitchRangeQuaternion1),n=Quaternion.fromAxisAngle(Cartesian3.UNIT_Z,-e,scratchLookAtHeadingPitchRangeQuaternion2),a=Quaternion.multiply(n,r,n),o=Matrix3.fromQuaternion(a,scratchHeadingPitchRangeMatrix3),s=Cartesian3.clone(Cartesian3.UNIT_X,scratchLookAtHeadingPitchRangeOffset);return Matrix3.multiplyByVector(o,s,s),Cartesian3.negate(s,s),Cartesian3.multiplyByScalar(s,i,s),s}Camera.prototype.lookAtTransform=function(e,t){if(this._setTransform(e),defined(t)){var i;if(i=defined(t.heading)?offsetFromHeadingPitchRange(t.heading,t.pitch,t.range):t,this._mode===SceneMode$1.SCENE2D){Cartesian2.clone(Cartesian2.ZERO,this.position),Cartesian3.negate(i,this.up),this.up.z=0,Cartesian3.magnitudeSquared(this.up)<CesiumMath.EPSILON10&&Cartesian3.clone(Cartesian3.UNIT_Y,this.up),Cartesian3.normalize(this.up,this.up),this._setTransform(Matrix4.IDENTITY),Cartesian3.negate(Cartesian3.UNIT_Z,this.direction),Cartesian3.cross(this.direction,this.up,this.right),Cartesian3.normalize(this.right,this.right);var r=this.frustum,n=r.top/r.right;return r.right=.5*Cartesian3.magnitude(i),r.left=-r.right,r.top=n*r.right,r.bottom=-r.top,void this._setTransform(e)}Cartesian3.clone(i,this.position),Cartesian3.negate(this.position,this.direction),Cartesian3.normalize(this.direction,this.direction),Cartesian3.cross(this.direction,Cartesian3.UNIT_Z,this.right),Cartesian3.magnitudeSquared(this.right)<CesiumMath.EPSILON10&&Cartesian3.clone(Cartesian3.UNIT_X,this.right),Cartesian3.normalize(this.right,this.right),Cartesian3.cross(this.right,this.direction,this.up),Cartesian3.normalize(this.up,this.up),this._adjustOrthographicFrustum(!0)}};var viewRectangle3DCartographic1=new Cartographic,viewRectangle3DCartographic2=new Cartographic,viewRectangle3DNorthEast=new Cartesian3,viewRectangle3DSouthWest=new Cartesian3,viewRectangle3DNorthWest=new Cartesian3,viewRectangle3DSouthEast=new Cartesian3,viewRectangle3DNorthCenter=new Cartesian3,viewRectangle3DSouthCenter=new Cartesian3,viewRectangle3DCenter=new Cartesian3,viewRectangle3DEquator=new Cartesian3,defaultRF={direction:new Cartesian3,right:new Cartesian3,up:new Cartesian3},viewRectangle3DEllipsoidGeodesic;function computeD(e,t,i,r){return Math.abs(Cartesian3.dot(t,i))/r-Cartesian3.dot(e,i)}function rectangleCameraPosition3D(e,t,i,r){var n=e._projection.ellipsoid,a=r?e:defaultRF,o=t.north,s=t.south,l=t.east,u=t.west;l<u&&(l+=CesiumMath.TWO_PI);var c,d=.5*(u+l);if(s<-CesiumMath.PI_OVER_TWO+CesiumMath.RADIANS_PER_DEGREE&&o>CesiumMath.PI_OVER_TWO-CesiumMath.RADIANS_PER_DEGREE)c=0;else{var h=viewRectangle3DCartographic1;h.longitude=d,h.latitude=o,h.height=0;var p=viewRectangle3DCartographic2;p.longitude=d,p.latitude=s,p.height=0;var f=viewRectangle3DEllipsoidGeodesic;defined(f)&&f.ellipsoid===n||(viewRectangle3DEllipsoidGeodesic=f=new EllipsoidGeodesic(void 0,void 0,n)),f.setEndPoints(h,p),c=f.interpolateUsingFraction(.5,viewRectangle3DCartographic1).latitude}var m=viewRectangle3DCartographic1;m.longitude=d,m.latitude=c,m.height=0;var g=n.cartographicToCartesian(m,viewRectangle3DCenter),y=viewRectangle3DCartographic1;y.longitude=l,y.latitude=o;var v=n.cartographicToCartesian(y,viewRectangle3DNorthEast);y.longitude=u;var _=n.cartographicToCartesian(y,viewRectangle3DNorthWest);y.longitude=d;var C=n.cartographicToCartesian(y,viewRectangle3DNorthCenter);y.latitude=s;var x=n.cartographicToCartesian(y,viewRectangle3DSouthCenter);y.longitude=l;var b=n.cartographicToCartesian(y,viewRectangle3DSouthEast);y.longitude=u;var A=n.cartographicToCartesian(y,viewRectangle3DSouthWest);Cartesian3.subtract(_,g,_),Cartesian3.subtract(b,g,b),Cartesian3.subtract(v,g,v),Cartesian3.subtract(A,g,A),Cartesian3.subtract(C,g,C),Cartesian3.subtract(x,g,x);var S=n.geodeticSurfaceNormal(g,a.direction);Cartesian3.negate(S,S);var w=Cartesian3.cross(S,Cartesian3.UNIT_Z,a.right);Cartesian3.normalize(w,w);var E,T=Cartesian3.cross(w,S,a.up);if(e.frustum instanceof OrthographicFrustum){var P,M,D=Math.max(Cartesian3.distance(v,_),Cartesian3.distance(b,A)),I=Math.max(Cartesian3.distance(v,b),Cartesian3.distance(_,A)),O=e.frustum._offCenterFrustum.right/e.frustum._offCenterFrustum.top,R=I*O;R<D?M=(P=D)/O:(M=I,P=R),E=Math.max(P,M)}else{var L=Math.tan(.5*e.frustum.fovy),N=e.frustum.aspectRatio*L;if(E=Math.max(computeD(S,T,_,L),computeD(S,T,b,L),computeD(S,T,v,L),computeD(S,T,A,L),computeD(S,T,C,L),computeD(S,T,x,L),computeD(S,w,_,N),computeD(S,w,b,N),computeD(S,w,v,N),computeD(S,w,A,N),computeD(S,w,C,N),computeD(S,w,x,N)),s<0&&0<o){var k=viewRectangle3DCartographic1;k.longitude=u,k.latitude=0,k.height=0;var B=n.cartographicToCartesian(k,viewRectangle3DEquator);Cartesian3.subtract(B,g,B),E=Math.max(E,computeD(S,T,B,L),computeD(S,w,B,N)),k.longitude=l,B=n.cartographicToCartesian(k,viewRectangle3DEquator),Cartesian3.subtract(B,g,B),E=Math.max(E,computeD(S,T,B,L),computeD(S,w,B,N))}}return Cartesian3.add(g,Cartesian3.multiplyByScalar(S,-E,viewRectangle3DEquator),i)}var viewRectangleCVCartographic=new Cartographic,viewRectangleCVNorthEast=new Cartesian3,viewRectangleCVSouthWest=new Cartesian3;function rectangleCameraPositionColumbusView(e,t,i){var r=e._projection;t.west>t.east&&(t=Rectangle.MAX_VALUE);var n=e._actualTransform,a=e._actualInvTransform,o=viewRectangleCVCartographic;o.longitude=t.east,o.latitude=t.north;var s=r.project(o,viewRectangleCVNorthEast);Matrix4.multiplyByPoint(n,s,s),Matrix4.multiplyByPoint(a,s,s),o.longitude=t.west,o.latitude=t.south;var l=r.project(o,viewRectangleCVSouthWest);if(Matrix4.multiplyByPoint(n,l,l),Matrix4.multiplyByPoint(a,l,l),i.x=.5*(s.x-l.x)+l.x,i.y=.5*(s.y-l.y)+l.y,defined(e.frustum.fovy)){var u=Math.tan(.5*e.frustum.fovy),c=e.frustum.aspectRatio*u;i.z=.5*Math.max((s.x-l.x)/c,(s.y-l.y)/u)}else{var d=s.x-l.x,h=s.y-l.y;i.z=Math.max(d,h)}return i}var viewRectangle2DCartographic=new Cartographic,viewRectangle2DNorthEast=new Cartesian3,viewRectangle2DSouthWest=new Cartesian3;function rectangleCameraPosition2D(e,t,i){var r=e._projection,n=t.east;t.west>t.east&&(e._scene.mapMode2D===MapMode2D$1.INFINITE_SCROLL?n+=CesiumMath.TWO_PI:n=(t=Rectangle.MAX_VALUE).east);var a=viewRectangle2DCartographic;a.longitude=n,a.latitude=t.north;var o=r.project(a,viewRectangle2DNorthEast);a.longitude=t.west,a.latitude=t.south;var s,l,u=r.project(a,viewRectangle2DSouthWest),c=.5*Math.abs(o.x-u.x),d=.5*Math.abs(o.y-u.y),h=e.frustum.right/e.frustum.top,p=d*h;return p<c?l=(s=c)/h:(l=d,s=p),d=Math.max(2*s,2*l),i.x=.5*(o.x-u.x)+u.x,i.y=.5*(o.y-u.y)+u.y,(a=r.unproject(i,a)).height=d,i=r.project(a,i)}Camera.prototype.getRectangleCameraCoordinates=function(e,t){var i=this._mode;return defined(t)||(t=new Cartesian3),i===SceneMode$1.SCENE3D?rectangleCameraPosition3D(this,e,t):i===SceneMode$1.COLUMBUS_VIEW?rectangleCameraPositionColumbusView(this,e,t):i===SceneMode$1.SCENE2D?rectangleCameraPosition2D(this,e,t):void 0};var pickEllipsoid3DRay=new Ray;function pickEllipsoid3D(e,t,i,r){i=defaultValue(i,Ellipsoid.WGS84);var n=e.getPickRay(t,pickEllipsoid3DRay),a=IntersectionTests.rayEllipsoid(n,i);if(a){var o=0<a.start?a.start:a.stop;return Ray.getPoint(n,o,r)}}var pickEllipsoid2DRay=new Ray;function pickMap2D(e,t,i,r){var n=e.getPickRay(t,pickEllipsoid2DRay).origin;n=Cartesian3.fromElements(n.y,n.z,0,n);var a=i.unproject(n);if(!(a.latitude<-CesiumMath.PI_OVER_TWO||a.latitude>CesiumMath.PI_OVER_TWO))return i.ellipsoid.cartographicToCartesian(a,r)}var pickEllipsoidCVRay=new Ray;function pickMapColumbusView(e,t,i,r){var n=e.getPickRay(t,pickEllipsoidCVRay),a=-n.origin.x/n.direction.x;Ray.getPoint(n,a,r);var o=i.unproject(new Cartesian3(r.y,r.z,0));if(!(o.latitude<-CesiumMath.PI_OVER_TWO||o.latitude>CesiumMath.PI_OVER_TWO||o.longitude<-Math.PI||o.longitude>Math.PI))return i.ellipsoid.cartographicToCartesian(o,r)}Camera.prototype.pickEllipsoid=function(e,t,i){var r=this._scene.canvas;if(0!==r.clientWidth&&0!==r.clientHeight){if(defined(i)||(i=new Cartesian3),t=defaultValue(t,Ellipsoid.WGS84),this._mode===SceneMode$1.SCENE3D)i=pickEllipsoid3D(this,e,t,i);else if(this._mode===SceneMode$1.SCENE2D)i=pickMap2D(this,e,this._projection,i);else{if(this._mode!==SceneMode$1.COLUMBUS_VIEW)return;i=pickMapColumbusView(this,e,this._projection,i)}return i}};var pickPerspCenter=new Cartesian3,pickPerspXDir=new Cartesian3,pickPerspYDir=new Cartesian3;function getPickRayPerspective(e,t,i){var r=e._scene.canvas,n=r.clientWidth,a=r.clientHeight,o=Math.tan(.5*e.frustum.fovy),s=e.frustum.aspectRatio*o,l=e.frustum.near,u=2/n*t.x-1,c=2/a*(a-t.y)-1,d=e.positionWC;Cartesian3.clone(d,i.origin);var h=Cartesian3.multiplyByScalar(e.directionWC,l,pickPerspCenter);Cartesian3.add(d,h,h);var p=Cartesian3.multiplyByScalar(e.rightWC,u*l*s,pickPerspXDir),f=Cartesian3.multiplyByScalar(e.upWC,c*l*o,pickPerspYDir),m=Cartesian3.add(h,p,i.direction);return Cartesian3.add(m,f,m),Cartesian3.subtract(m,d,m),Cartesian3.normalize(m,m),i}var scratchDirection=new Cartesian3;function getPickRayOrthographic(e,t,i){var r=e._scene.canvas,n=r.clientWidth,a=r.clientHeight,o=e.frustum;defined(o._offCenterFrustum)&&(o=o._offCenterFrustum);var s=2/n*t.x-1;s*=.5*(o.right-o.left);var l=2/a*(a-t.y)-1;l*=.5*(o.top-o.bottom);var u=i.origin;return Cartesian3.clone(e.position,u),Cartesian3.multiplyByScalar(e.right,s,scratchDirection),Cartesian3.add(scratchDirection,u,u),Cartesian3.multiplyByScalar(e.up,l,scratchDirection),Cartesian3.add(scratchDirection,u,u),Cartesian3.clone(e.directionWC,i.direction),e._mode!==SceneMode$1.COLUMBUS_VIEW&&e._mode!==SceneMode$1.SCENE2D||Cartesian3.fromElements(i.origin.z,i.origin.x,i.origin.y,i.origin),i}Camera.prototype.getPickRay=function(e,t){defined(t)||(t=new Ray);var i=this.frustum;return defined(i.aspectRatio)&&defined(i.fov)&&defined(i.near)?getPickRayPerspective(this,e,t):getPickRayOrthographic(this,e,t)};var scratchToCenter$1=new Cartesian3,scratchProj=new Cartesian3;Camera.prototype.distanceToBoundingSphere=function(e){var t=Cartesian3.subtract(this.positionWC,e.center,scratchToCenter$1),i=Cartesian3.multiplyByScalar(this.directionWC,Cartesian3.dot(t,this.directionWC),scratchProj);return Math.max(0,Cartesian3.magnitude(i)-e.radius)};var scratchPixelSize=new Cartesian2;function createAnimationTemplateCV(i,r,e,t,n,a){var o=Cartesian3.clone(r);return e.y>t?o.y-=e.y-t:e.y<-t&&(o.y+=-t-e.y),e.z>n?o.z-=e.z-n:e.z<-n&&(o.z+=-n-e.z),{easingFunction:EasingFunction$1.EXPONENTIAL_OUT,startObject:{time:0},stopObject:{time:1},duration:a,update:function(e){var t=Cartesian3.lerp(r,o,e.time,new Cartesian3);i.worldToCameraCoordinatesPoint(t,i.position)}}}Camera.prototype.getPixelSize=function(e,t,i){var r=this.distanceToBoundingSphere(e),n=this.frustum.getPixelDimensions(t,i,r,this._scene.pixelRatio,scratchPixelSize);return Math.max(n.x,n.y)};var normalScratch$2=new Cartesian3,centerScratch=new Cartesian3,posScratch=new Cartesian3,scratchCartesian3Subtract=new Cartesian3;function createAnimationCV(e,t){var i=e.position,r=e.direction,n=e.worldToCameraCoordinatesVector(Cartesian3.UNIT_X,normalScratch$2),a=-Cartesian3.dot(n,i)/Cartesian3.dot(n,r),o=Cartesian3.add(i,Cartesian3.multiplyByScalar(r,a,centerScratch),centerScratch);e.cameraToWorldCoordinatesPoint(o,o),i=e.cameraToWorldCoordinatesPoint(e.position,posScratch);var s=Math.tan(.5*e.frustum.fovy),l=e.frustum.aspectRatio*s,u=Cartesian3.magnitude(Cartesian3.subtract(i,o,scratchCartesian3Subtract)),c=l*u,d=s*u,h=e._maxCoord.x,p=e._maxCoord.y,f=Math.max(c-h,h),m=Math.max(d-p,p);if(i.z<-f||i.z>f||i.y<-m||i.y>m){var g=o.y<-f||o.y>f,y=o.z<-m||o.z>m;if(g||y)return createAnimationTemplateCV(e,i,o,f,m,t)}}Camera.prototype.createCorrectPositionTween=function(e){if(this._mode===SceneMode$1.COLUMBUS_VIEW)return createAnimationCV(this,e)};var scratchFlyToDestination=new Cartesian3,newOptions={destination:void 0,heading:void 0,pitch:void 0,roll:void 0,duration:void 0,complete:void 0,cancel:void 0,endTransform:void 0,maximumHeight:void 0,easingFunction:void 0};function distanceToBoundingSphere3D(e,t){var i=e.frustum,r=Math.tan(.5*i.fovy),n=i.aspectRatio*r;return Math.max(t/n,t/r)}function distanceToBoundingSphere2D(e,t){var i,r,n=e.frustum;defined(n._offCenterFrustum)&&(n=n._offCenterFrustum);var a=n.right/n.top,o=t*a;return o<t?r=(i=t)/a:(r=t,i=o),1.5*Math.max(i,r)}Camera.prototype.cancelFlight=function(){defined(this._currentFlight)&&(this._currentFlight.cancelTween(),this._currentFlight=void 0)},Camera.prototype.flyTo=function(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).destination;if(this._mode!==SceneMode$1.MORPHING){this.cancelFlight();var i=defaultValue(e.orientation,defaultValue.EMPTY_OBJECT);if(defined(i.direction)&&(i=directionUpToHeadingPitchRoll(this,t,i,scratchSetViewOptions.orientation)),defined(e.duration)&&e.duration<=0){var r=scratchSetViewOptions;return r.destination=e.destination,r.orientation.heading=i.heading,r.orientation.pitch=i.pitch,r.orientation.roll=i.roll,r.convert=e.convert,r.endTransform=e.endTransform,this.setView(r),void("function"==typeof e.complete&&e.complete())}var n=defined(t.west);n&&(t=this.getRectangleCameraCoordinates(t,scratchFlyToDestination));var a,o=this;newOptions.destination=t,newOptions.heading=i.heading,newOptions.pitch=i.pitch,newOptions.roll=i.roll,newOptions.duration=e.duration,newOptions.complete=function(){a===o._currentFlight&&(o._currentFlight=void 0),defined(e.complete)&&e.complete()},newOptions.cancel=e.cancel,newOptions.endTransform=e.endTransform,newOptions.convert=!n&&e.convert,newOptions.maximumHeight=e.maximumHeight,newOptions.pitchAdjustHeight=e.pitchAdjustHeight,newOptions.flyOverLongitude=e.flyOverLongitude,newOptions.flyOverLongitudeWeight=e.flyOverLongitudeWeight,newOptions.easingFunction=e.easingFunction;var s=this._scene,l=CameraFlightPath.createTween(s,newOptions);if(0!==l.duration){a=s.tweens.add(l),this._currentFlight=a;var u=this._scene.preloadFlightCamera;this._mode!==SceneMode$1.SCENE2D&&(defined(u)||(u=Camera.clone(this)),u.setView({destination:t,orientation:i}),this._scene.preloadFlightCullingVolume=u.frustum.computeCullingVolume(u.positionWC,u.directionWC,u.upWC))}else"function"==typeof l.complete&&l.complete()}};var MINIMUM_ZOOM=100;function adjustBoundingSphereOffset(e,t,i){i=HeadingPitchRange.clone(defined(i)?i:Camera.DEFAULT_OFFSET);var r=e._scene.screenSpaceCameraController.minimumZoomDistance,n=e._scene.screenSpaceCameraController.maximumZoomDistance,a=i.range;if(!defined(a)||0===a){var o=t.radius;0===o?i.range=MINIMUM_ZOOM:e.frustum instanceof OrthographicFrustum||e._mode===SceneMode$1.SCENE2D?i.range=distanceToBoundingSphere2D(e,o):i.range=distanceToBoundingSphere3D(e,o),i.range=CesiumMath.clamp(i.range,r,n)}return i}Camera.prototype.viewBoundingSphere=function(e,t){t=adjustBoundingSphereOffset(this,e,t),this.lookAt(e.center,t)};var scratchflyToBoundingSphereTransform=new Matrix4,scratchflyToBoundingSphereDestination=new Cartesian3,scratchflyToBoundingSphereDirection=new Cartesian3,scratchflyToBoundingSphereUp=new Cartesian3,scratchflyToBoundingSphereRight=new Cartesian3,scratchFlyToBoundingSphereCart4=new Cartesian4,scratchFlyToBoundingSphereQuaternion=new Quaternion,scratchFlyToBoundingSphereMatrix3=new Matrix3;Camera.prototype.flyToBoundingSphere=function(e,t){t=defaultValue(t,defaultValue.EMPTY_OBJECT);var i=this._mode===SceneMode$1.SCENE2D||this._mode===SceneMode$1.COLUMBUS_VIEW;this._setTransform(Matrix4.IDENTITY);var r,n=adjustBoundingSphereOffset(this,e,t.offset);r=i?Cartesian3.multiplyByScalar(Cartesian3.UNIT_Z,n.range,scratchflyToBoundingSphereDestination):offsetFromHeadingPitchRange(n.heading,n.pitch,n.range);var a,o,s=Transforms.eastNorthUpToFixedFrame(e.center,Ellipsoid.WGS84,scratchflyToBoundingSphereTransform);if(Matrix4.multiplyByPoint(s,r,r),!i){if(a=Cartesian3.subtract(e.center,r,scratchflyToBoundingSphereDirection),Cartesian3.normalize(a,a),o=Matrix4.multiplyByPointAsVector(s,Cartesian3.UNIT_Z,scratchflyToBoundingSphereUp),1-Math.abs(Cartesian3.dot(a,o))<CesiumMath.EPSILON6){var l=Quaternion.fromAxisAngle(a,n.heading,scratchFlyToBoundingSphereQuaternion),u=Matrix3.fromQuaternion(l,scratchFlyToBoundingSphereMatrix3);Cartesian3.fromCartesian4(Matrix4.getColumn(s,1,scratchFlyToBoundingSphereCart4),o),Matrix3.multiplyByVector(u,o,o)}var c=Cartesian3.cross(a,o,scratchflyToBoundingSphereRight);Cartesian3.cross(c,a,o),Cartesian3.normalize(o,o)}this.flyTo({destination:r,orientation:{direction:a,up:o},duration:t.duration,complete:t.complete,cancel:t.cancel,endTransform:t.endTransform,maximumHeight:t.maximumHeight,easingFunction:t.easingFunction,flyOverLongitude:t.flyOverLongitude,flyOverLongitudeWeight:t.flyOverLongitudeWeight,pitchAdjustHeight:t.pitchAdjustHeight})};var scratchCartesian3_1=new Cartesian3,scratchCartesian3_2=new Cartesian3,scratchCartesian3_3=new Cartesian3,scratchCartesian3_4=new Cartesian3,horizonPoints=[new Cartesian3,new Cartesian3,new Cartesian3,new Cartesian3];function computeHorizonQuad(e,t){var i,r,n=t.radii,a=e.positionWC,o=Cartesian3.multiplyComponents(t.oneOverRadii,a,scratchCartesian3_1),s=Cartesian3.magnitude(o),l=Cartesian3.normalize(o,scratchCartesian3_2);r=Cartesian3.equalsEpsilon(l,Cartesian3.UNIT_Z,CesiumMath.EPSILON10)?(i=new Cartesian3(0,1,0),new Cartesian3(0,0,1)):(i=Cartesian3.normalize(Cartesian3.cross(Cartesian3.UNIT_Z,l,scratchCartesian3_3),scratchCartesian3_3),Cartesian3.normalize(Cartesian3.cross(l,i,scratchCartesian3_4),scratchCartesian3_4));var u=Math.sqrt(Cartesian3.magnitudeSquared(o)-1),c=Cartesian3.multiplyByScalar(l,1/s,scratchCartesian3_1),d=u/s,h=Cartesian3.multiplyByScalar(i,d,scratchCartesian3_2),p=Cartesian3.multiplyByScalar(r,d,scratchCartesian3_3),f=Cartesian3.add(c,p,horizonPoints[0]);Cartesian3.subtract(f,h,f),Cartesian3.multiplyComponents(n,f,f);var m=Cartesian3.subtract(c,p,horizonPoints[1]);Cartesian3.subtract(m,h,m),Cartesian3.multiplyComponents(n,m,m);var g=Cartesian3.subtract(c,p,horizonPoints[2]);Cartesian3.add(g,h,g),Cartesian3.multiplyComponents(n,g,g);var y=Cartesian3.add(c,p,horizonPoints[3]);return Cartesian3.add(y,h,y),Cartesian3.multiplyComponents(n,y,y),horizonPoints}var scratchPickCartesian2=new Cartesian2,scratchRectCartesian=new Cartesian3,cartoArray=[new Cartographic,new Cartographic,new Cartographic,new Cartographic];function addToResult(e,t,i,r,n,a){scratchPickCartesian2.x=e,scratchPickCartesian2.y=t;var o=r.pickEllipsoid(scratchPickCartesian2,n,scratchRectCartesian);return defined(o)?(cartoArray[i]=n.cartesianToCartographic(o,cartoArray[i]),1):(cartoArray[i]=n.cartesianToCartographic(a[i],cartoArray[i]),0)}function isColli(e,t,i){var r=Cartesian3.distance(e,t);return Cartesian3.distance(e,i)<=r+1.5}function pickDownPosition(e,t){t=defaultValue(t,1);var i=Cartographic.fromCartesian(e),r=Cartographic.clone(i);return r.height-=t,r.longitude=CesiumMath.toDegrees(r.longitude),r.latitude=CesiumMath.toDegrees(r.latitude),Cartesian3.fromDegrees(r.longitude,r.latitude,r.height)}function pickPosition(e,t,i,r,n){var a=new Ray(t,Cartesian3.normalize(Cartesian3.subtract(i,t,new Cartesian3),new Cartesian3)),o=e.pickFromRay(a,r,n);return defined(o)?o.position:void 0}Camera.prototype.computeViewRectangle=function(e,t){e=defaultValue(e,Ellipsoid.WGS84);var i=this.frustum.computeCullingVolume(this.positionWC,this.directionWC,this.upWC),r=new BoundingSphere(Cartesian3.ZERO,e.maximumRadius);if(i.computeVisibility(r)!==Intersect$1.OUTSIDE){var n=this._scene.canvas,a=n.clientWidth,o=n.clientHeight,s=0,l=computeHorizonQuad(this,e);if(s+=addToResult(0,0,0,this,e,l),s+=addToResult(0,o,1,this,e,l),s+=addToResult(a,o,2,this,e,l),(s+=addToResult(a,0,3,this,e,l))<2)return Rectangle.MAX_VALUE;t=Rectangle.fromCartographicArray(cartoArray,t);for(var u=0,c=cartoArray[3].longitude,d=0;d<4;++d){var h=cartoArray[d].longitude,p=Math.abs(h-c);p>CesiumMath.PI?u+=CesiumMath.TWO_PI-p:u+=p,c=h}return CesiumMath.equalsEpsilon(Math.abs(u),CesiumMath.TWO_PI,CesiumMath.EPSILON9)&&(t.west=-CesiumMath.PI,t.east=CesiumMath.PI,0<=cartoArray[0].latitude?t.north=CesiumMath.PI_OVER_TWO:t.south=-CesiumMath.PI_OVER_TWO),t}},Camera.prototype.switchToPerspectiveFrustum=function(){if(!(this._mode===SceneMode$1.SCENE2D||this.frustum instanceof PerspectiveFrustum)){var e=this._scene;this.frustum=new PerspectiveFrustum,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=CesiumMath.toRadians(60)}},Camera.prototype.switchToOrthographicFrustum=function(){if(!(this._mode===SceneMode$1.SCENE2D||this.frustum instanceof OrthographicFrustum)){var e=this._scene;this.frustum=new OrthographicFrustum,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.width=Cartesian3.magnitude(this.position),defined(this.frustum.projectionMatrix)&&this._adjustOrthographicFrustum(!0)}},Camera.prototype.changeHeading=function(e){var t=Cartesian3.normalize(Cartesian3.subtract(e,this.position,new Cartesian3),new Cartesian3),i=this._projection.ellipsoid,r=Matrix4.clone(this._transform,scratchHPRMatrix1),n=Transforms.eastNorthUpToFixedFrame(this.positionWC,i,scratchHPRMatrix2);this._setTransform(n);var a=getHeading(t,this.up);return this._setTransform(r),a},Camera.prototype.groundRoaming=function(e){if(this._mode===SceneMode$1.SCENE2D)return!1;var t=this._scene;if(!t.screenSpaceCameraController.enableGroundRoaming)return!1;var i=t.screenSpaceCameraController.defaultCollisionRayWidth,r=pickPosition(t,e,pickDownPosition(e),void 0,i);if(defined(r)){var n={destination:pickDownPosition(r,-1*t.screenSpaceCameraController.defaultGroundRoamingHeight),orientation:{heading:this.heading,pitch:this.pitch,roll:0}};return this.setView(n),!0}return!1},Camera.prototype.modelColliDetection=function(e,t,i){if(this._mode===SceneMode$1.SCENE2D)return!1;var r=this._scene;if(!r.screenSpaceCameraController.enableModelCollisionDetection)return!1;cameraGroundPosition=void 0;var n=r.screenSpaceCameraController.defaultGroundRoamingHeight/2,a=pickDownPosition(this.position);if(defined(cameraGroundPosition=pickPosition(r,this.position,a,t,i))){var o=pickDownPosition(cameraGroundPosition,-1*n),s=pickDownPosition(e,Cartesian3.distance(this.position,o)),l=pickPosition(r,o,s,t,i);if(defined(l)&&isColli(o,s,l))return!0}return!1},Camera.clone=function(e,t){return defined(t)||(t=new Camera(e._scene)),Cartesian3.clone(e.position,t.position),Cartesian3.clone(e.direction,t.direction),Cartesian3.clone(e.up,t.up),Cartesian3.clone(e.right,t.right),Matrix4.clone(e._transform,t.transform),t._transformChanged=!0,t.frustum=e.frustum.clone(),t};var PERSPECTIVE=0,ORTHOGRAPHIC=1;function FrustumGeometry(e){var t,i,r=e.frustum,n=e.orientation,a=e.origin,o=defaultValue(e.vertexFormat,VertexFormat.DEFAULT),s=defaultValue(e._drawNearPlane,!0);r instanceof PerspectiveFrustum?(t=PERSPECTIVE,i=PerspectiveFrustum.packedLength):r instanceof OrthographicFrustum&&(t=ORTHOGRAPHIC,i=OrthographicFrustum.packedLength),this._frustumType=t,this._frustum=r.clone(),this._origin=Cartesian3.clone(a),this._orientation=Quaternion.clone(n),this._drawNearPlane=s,this._vertexFormat=o,this._workerName="createFrustumGeometry",this.packedLength=2+i+Cartesian3.packedLength+Quaternion.packedLength+VertexFormat.packedLength}FrustumGeometry.pack=function(e,t,i){i=defaultValue(i,0);var r=e._frustumType,n=e._frustum;return(t[i++]=r)===PERSPECTIVE?(PerspectiveFrustum.pack(n,t,i),i+=PerspectiveFrustum.packedLength):(OrthographicFrustum.pack(n,t,i),i+=OrthographicFrustum.packedLength),Cartesian3.pack(e._origin,t,i),i+=Cartesian3.packedLength,Quaternion.pack(e._orientation,t,i),i+=Quaternion.packedLength,VertexFormat.pack(e._vertexFormat,t,i),t[i+=VertexFormat.packedLength]=e._drawNearPlane?1:0,t};var scratchPackPerspective=new PerspectiveFrustum,scratchPackOrthographic=new OrthographicFrustum,scratchPackQuaternion=new Quaternion,scratchPackorigin=new Cartesian3,scratchVertexFormat$2=new VertexFormat;function getAttributes(e,t,i,r,n,a,o,s){for(var l=e/3*2,u=0;u<4;++u)defined(t)&&(t[e]=a.x,t[e+1]=a.y,t[e+2]=a.z),defined(i)&&(i[e]=o.x,i[e+1]=o.y,i[e+2]=o.z),defined(r)&&(r[e]=s.x,r[e+1]=s.y,r[e+2]=s.z),e+=3;n[l]=0,n[1+l]=0,n[2+l]=1,n[3+l]=0,n[4+l]=1,n[5+l]=1,n[6+l]=0,n[7+l]=1}FrustumGeometry.unpack=function(e,t,i){t=defaultValue(t,0);var r,n=e[t++];n===PERSPECTIVE?(r=PerspectiveFrustum.unpack(e,t,scratchPackPerspective),t+=PerspectiveFrustum.packedLength):(r=OrthographicFrustum.unpack(e,t,scratchPackOrthographic),t+=OrthographicFrustum.packedLength);var a=Cartesian3.unpack(e,t,scratchPackorigin);t+=Cartesian3.packedLength;var o=Quaternion.unpack(e,t,scratchPackQuaternion);t+=Quaternion.packedLength;var s=VertexFormat.unpack(e,t,scratchVertexFormat$2),l=1===e[t+=VertexFormat.packedLength];if(!defined(i))return new FrustumGeometry({frustum:r,origin:a,orientation:o,vertexFormat:s,_drawNearPlane:l});var u=n===i._frustumType?i._frustum:void 0;return i._frustum=r.clone(u),i._frustumType=n,i._origin=Cartesian3.clone(a,i._origin),i._orientation=Quaternion.clone(o,i._orientation),i._vertexFormat=VertexFormat.clone(s,i._vertexFormat),i._drawNearPlane=l,i};var scratchRotationMatrix=new Matrix3,scratchViewMatrix=new Matrix4,scratchInverseMatrix=new Matrix4,scratchXDirection=new Cartesian3,scratchYDirection=new Cartesian3,scratchZDirection=new Cartesian3,scratchNegativeX=new Cartesian3,scratchNegativeY=new Cartesian3,scratchNegativeZ=new Cartesian3,frustumSplits=new Array(3),frustumCornersNDC=new Array(4);frustumCornersNDC[0]=new Cartesian4(-1,-1,1,1),frustumCornersNDC[1]=new Cartesian4(1,-1,1,1),frustumCornersNDC[2]=new Cartesian4(1,1,1,1),frustumCornersNDC[3]=new Cartesian4(-1,1,1,1);for(var scratchFrustumCorners=new Array(4),i$1=0;i$1<4;++i$1)scratchFrustumCorners[i$1]=new Cartesian4;FrustumGeometry._computeNearFarPlanes=function(e,t,i,r,n,a,o,s){var l=Matrix3.fromQuaternion(t,scratchRotationMatrix),u=defaultValue(a,scratchXDirection),c=defaultValue(o,scratchYDirection),d=defaultValue(s,scratchZDirection);u=Matrix3.getColumn(l,0,u),c=Matrix3.getColumn(l,1,c),d=Matrix3.getColumn(l,2,d),Cartesian3.normalize(u,u),Cartesian3.normalize(c,c),Cartesian3.normalize(d,d),Cartesian3.negate(u,u);var h,p,f=Matrix4.computeView(e,d,c,u,scratchViewMatrix);if(i===PERSPECTIVE){var m=r.projectionMatrix,g=Matrix4.multiply(m,f,scratchInverseMatrix);p=Matrix4.inverse(g,scratchInverseMatrix)}else h=Matrix4.inverseTransformation(f,scratchInverseMatrix);defined(p)?(frustumSplits[0]=r.near,frustumSplits[1]=r.far):(frustumSplits[0]=0,frustumSplits[1]=r.near,frustumSplits[2]=r.far);for(var y=0;y<2;++y)for(var v=0;v<4;++v){var _=Cartesian4.clone(frustumCornersNDC[v],scratchFrustumCorners[v]);if(defined(p)){var C=1/(_=Matrix4.multiplyByVector(p,_,_)).w;Cartesian3.multiplyByScalar(_,C,_),Cartesian3.subtract(_,e,_),Cartesian3.normalize(_,_);var x=Cartesian3.dot(d,_);Cartesian3.multiplyByScalar(_,frustumSplits[y]/x,_),Cartesian3.add(_,e,_)}else{defined(r._offCenterFrustum)&&(r=r._offCenterFrustum);var b=frustumSplits[y],A=frustumSplits[y+1];_.x=.5*(_.x*(r.right-r.left)+r.left+r.right),_.y=.5*(_.y*(r.top-r.bottom)+r.bottom+r.top),_.z=.5*(_.z*(b-A)-b-A),_.w=1,Matrix4.multiplyByVector(h,_,_)}n[12*y+3*v]=_.x,n[12*y+3*v+1]=_.y,n[12*y+3*v+2]=_.z}},FrustumGeometry.createGeometry=function(e){var t=e._frustumType,i=e._frustum,r=e._origin,n=e._orientation,a=e._drawNearPlane,o=e._vertexFormat,s=a?6:5,l=new Float64Array(72);FrustumGeometry._computeNearFarPlanes(r,n,t,i,l);var u=24;l[u]=l[12],l[u+1]=l[13],l[u+2]=l[14],l[u+3]=l[0],l[u+4]=l[1],l[u+5]=l[2],l[u+6]=l[9],l[u+7]=l[10],l[u+8]=l[11],l[u+9]=l[21],l[u+10]=l[22],l[u+11]=l[23],l[u+=12]=l[15],l[u+1]=l[16],l[u+2]=l[17],l[u+3]=l[3],l[u+4]=l[4],l[u+5]=l[5],l[u+6]=l[0],l[u+7]=l[1],l[u+8]=l[2],l[u+9]=l[12],l[u+10]=l[13],l[u+11]=l[14],l[u+=12]=l[3],l[u+1]=l[4],l[u+2]=l[5],l[u+3]=l[15],l[u+4]=l[16],l[u+5]=l[17],l[u+6]=l[18],l[u+7]=l[19],l[u+8]=l[20],l[u+9]=l[6],l[u+10]=l[7],l[u+11]=l[8],l[u+=12]=l[6],l[u+1]=l[7],l[u+2]=l[8],l[u+3]=l[18],l[u+4]=l[19],l[u+5]=l[20],l[u+6]=l[21],l[u+7]=l[22],l[u+8]=l[23],l[u+9]=l[9],l[u+10]=l[10],l[u+11]=l[11],a||(l=l.subarray(12));var c=new GeometryAttributes({position:new GeometryAttribute({componentDatatype:ComponentDatatype$1.DOUBLE,componentsPerAttribute:3,values:l})});if(defined(o.normal)||defined(o.tangent)||defined(o.bitangent)||defined(o.st)){var d=defined(o.normal)?new Float32Array(12*s):void 0,h=defined(o.tangent)?new Float32Array(12*s):void 0,p=defined(o.bitangent)?new Float32Array(12*s):void 0,f=defined(o.st)?new Float32Array(8*s):void 0,m=scratchXDirection,g=scratchYDirection,y=scratchZDirection,v=Cartesian3.negate(m,scratchNegativeX),_=Cartesian3.negate(g,scratchNegativeY),C=Cartesian3.negate(y,scratchNegativeZ);u=0,a&&(getAttributes(u,d,h,p,f,C,m,g),u+=12),getAttributes(u,d,h,p,f,y,v,g),getAttributes(u+=12,d,h,p,f,v,C,g),getAttributes(u+=12,d,h,p,f,_,C,v),getAttributes(u+=12,d,h,p,f,m,y,g),getAttributes(u+=12,d,h,p,f,g,y,v),defined(d)&&(c.normal=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:d})),defined(h)&&(c.tangent=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:h})),defined(p)&&(c.bitangent=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:p})),defined(f)&&(c.st=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:2,values:f}))}for(var x=new Uint16Array(6*s),b=0;b<s;++b){var A=6*b,S=4*b;x[A]=S,x[1+A]=1+S,x[2+A]=2+S,x[3+A]=S,x[4+A]=2+S,x[5+A]=3+S}return new Geometry({attributes:c,indices:x,primitiveType:PrimitiveType$1.TRIANGLES,boundingSphere:BoundingSphere.fromVertices(l)})};var PERSPECTIVE$1=0,ORTHOGRAPHIC$1=1;function FrustumOutlineGeometry(e){var t,i,r=e.frustum,n=e.orientation,a=e.origin,o=defaultValue(e._drawNearPlane,!0);r instanceof PerspectiveFrustum?(t=PERSPECTIVE$1,i=PerspectiveFrustum.packedLength):r instanceof OrthographicFrustum&&(t=ORTHOGRAPHIC$1,i=OrthographicFrustum.packedLength),this._frustumType=t,this._frustum=r.clone(),this._origin=Cartesian3.clone(a),this._orientation=Quaternion.clone(n),this._drawNearPlane=o,this._workerName="createFrustumOutlineGeometry",this.packedLength=2+i+Cartesian3.packedLength+Quaternion.packedLength}FrustumOutlineGeometry.pack=function(e,t,i){i=defaultValue(i,0);var r=e._frustumType,n=e._frustum;return(t[i++]=r)===PERSPECTIVE$1?(PerspectiveFrustum.pack(n,t,i),i+=PerspectiveFrustum.packedLength):(OrthographicFrustum.pack(n,t,i),i+=OrthographicFrustum.packedLength),Cartesian3.pack(e._origin,t,i),i+=Cartesian3.packedLength,Quaternion.pack(e._orientation,t,i),t[i+=Quaternion.packedLength]=e._drawNearPlane?1:0,t};var scratchPackPerspective$1=new PerspectiveFrustum,scratchPackOrthographic$1=new OrthographicFrustum,scratchPackQuaternion$1=new Quaternion,scratchPackorigin$1=new Cartesian3;function DebugCameraPrimitive(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this._camera=e.camera,this._color=defaultValue(e.color,Color.CYAN),this._updateOnChange=defaultValue(e.updateOnChange,!0),this.show=defaultValue(e.show,!0),this.id=e.id,this._id=void 0,this._outlinePrimitives=[],this._planesPrimitives=[]}FrustumOutlineGeometry.unpack=function(e,t,i){t=defaultValue(t,0);var r,n=e[t++];n===PERSPECTIVE$1?(r=PerspectiveFrustum.unpack(e,t,scratchPackPerspective$1),t+=PerspectiveFrustum.packedLength):(r=OrthographicFrustum.unpack(e,t,scratchPackOrthographic$1),t+=OrthographicFrustum.packedLength);var a=Cartesian3.unpack(e,t,scratchPackorigin$1);t+=Cartesian3.packedLength;var o=Quaternion.unpack(e,t,scratchPackQuaternion$1),s=1===e[t+=Quaternion.packedLength];if(!defined(i))return new FrustumOutlineGeometry({frustum:r,origin:a,orientation:o,_drawNearPlane:s});var l=n===i._frustumType?i._frustum:void 0;return i._frustum=r.clone(l),i._frustumType=n,i._origin=Cartesian3.clone(a,i._origin),i._orientation=Quaternion.clone(o,i._orientation),i._drawNearPlane=s,i},FrustumOutlineGeometry.createGeometry=function(e){var t=e._frustumType,i=e._frustum,r=e._origin,n=e._orientation,a=e._drawNearPlane,o=new Float64Array(24);FrustumGeometry._computeNearFarPlanes(r,n,t,i,o);for(var s,l,u=new GeometryAttributes({position:new GeometryAttribute({componentDatatype:ComponentDatatype$1.DOUBLE,componentsPerAttribute:3,values:o})}),c=a?2:1,d=new Uint16Array(8*(1+c)),h=a?0:1;h<2;++h)l=4*h,d[s=a?8*h:0]=l,d[s+1]=l+1,d[s+2]=l+1,d[s+3]=l+2,d[s+4]=l+2,d[s+5]=l+3,d[s+6]=l+3,d[s+7]=l;for(h=0;h<2;++h)l=4*h,d[s=8*(c+h)]=l,d[s+1]=l+4,d[s+2]=l+1,d[s+3]=l+5,d[s+4]=l+2,d[s+5]=l+6,d[s+6]=l+3,d[s+7]=l+7;return new Geometry({attributes:u,indices:d,primitiveType:PrimitiveType$1.LINES,boundingSphere:BoundingSphere.fromVertices(o)})};var scratchRight=new Cartesian3,scratchRotation$1=new Matrix3,scratchOrientation=new Quaternion,scratchPerspective=new PerspectiveFrustum,scratchPerspectiveOffCenter=new PerspectiveOffCenterFrustum,scratchOrthographic=new OrthographicFrustum,scratchOrthographicOffCenter=new OrthographicOffCenterFrustum,scratchColor=new Color,scratchSplits=[1,1e5];function FisheyeProjectionMapShader(){}function FisheyeProjectionMap(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).context;this._enabled=defaultValue(e.enabled,!0),this._softShadows=defaultValue(e.softShadows,!1),this._normalOffset=defaultValue(e.normalOffset,!0),this.dirty=!0,this._name=e.name||"",this._matchMaterials=e.matchMaterials||[],this._type="fisheye",this.fromLightSource=defaultValue(e.fromLightSource,!0),this.darkness=defaultValue(e.darkness,0),this._darkness=this.darkness,this.maximumDistance=defaultValue(e.maximumDistance,5e3),this._outOfView=!1,this._outOfViewPrevious=!1;var i,r=this._needsUpdate=!0;(FeatureDetection$1.isInternetExplorer()||FeatureDetection$1.isEdge()||(FeatureDetection$1.isChrome()||FeatureDetection$1.isFirefox())&&FeatureDetection$1.isWindows()&&!t.depthTexture)&&(r=!1),this._polygonOffsetSupported=r,this._terrainBias={polygonOffset:r,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.5,normalShading:!0,normalShadingSmooth:.3,depthBias:1e-4},this._primitiveBias={polygonOffset:r,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.1,normalShading:!0,normalShadingSmooth:.05,depthBias:e.depthBias||2e-5},this._pointBias={polygonOffset:!1,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:0,normalShading:!0,normalShadingSmooth:.1,depthBias:5e-4},this._depthAttachment=void 0,this._colorAttachment=void 0,this._shadowMapMatrix=new Matrix4,this._shadowMapTexture=void 0,this._shadowMapProjectionTexture=void 0,this._castImage=void 0,this._lightDirectionEC=new Cartesian3,this._lightPositionEC=new Cartesian4,this._distance=0,this._lightCamera=e.lightCamera,this._shadowMapCamera=new ShadowMapCamera,this._shadowMapCullingVolume=void 0,this._sceneCamera=void 0,this._boundingSphere=new BoundingSphere,this._isPointLight=defaultValue(e.isPointLight,!1),this._pointLightRadius=defaultValue(e.pointLightRadius,100),this._cascadesEnabled=!this._isPointLight&&defaultValue(e.cascadesEnabled,!0),this._numberOfCascades=this._cascadesEnabled?defaultValue(e.numberOfCascades,4):0,this._fitNearFar=!0,this._maximumCascadeDistances=[25,150,700,Number.MAX_VALUE],this._textureSize=new Cartesian2,this._isSpotLight=!1,this._cascadesEnabled?this._shadowMapCamera.frustum=new OrthographicOffCenterFrustum:defined(this._lightCamera.frustum.fov)&&(this._isSpotLight=!0),this._cascadeSplits=[new Cartesian4,new Cartesian4],this._cascadeMatrices=[new Matrix4,new Matrix4,new Matrix4,new Matrix4],this._cascadeDistances=new Cartesian4,i=this._isPointLight?6:this._cascadesEnabled?this._numberOfCascades:1,this._passes=new Array(i);for(var n=0;n<i;++n)this._passes[n]=new ShadowPass(t);this.debugShow=!1,this.debugFreezeFrame=!1,this._debugFreezeFrame=!1,this._debugCascadeColors=!1,this._debugLightFrustum=void 0,this._debugCameraFrustum=void 0,this._debugCascadeFrustums=new Array(this._numberOfCascades),this._debugShadowViewCommand=void 0,this._usesDepthTexture=t.depthTexture,this._isPointLight&&(this._usesDepthTexture=!1),this._usesDepthTexture=!1,this._primitiveRenderState=void 0,this._terrainRenderState=void 0,this._pointRenderState=void 0,createRenderStates$2(this),this._clearCommand=new ClearCommand({depth:1,color:new Color}),this._clearPassState=new PassState(t),this._size=defaultValue(e.size,2048),this.size=this._size,this._shadowMapProjectionTexture=t.defaultTexture,this._isCastTextureDirty=!1,this._isPlayVideo=defaultValue(e.playVideo,!1),this._videoFrameInterval=defaultValue(e.videoFrameInterval,500)}function ShadowPass(e){this.camera=new ShadowMapCamera,this.passState=new PassState(e),this.framebuffer=void 0,this.textureOffsets=void 0,this.commandList=[],this.cullingVolume=void 0}function createRenderState(e,t){return RenderState.fromCache({cull:{enabled:!0,face:CullFace$1.BACK},depthTest:{enabled:!0,func:DepthFunction$1.LESS_OR_EQUAL},colorMask:{red:e,green:e,blue:e,alpha:e},depthMask:!0,polygonOffset:{enabled:t.polygonOffset,factor:t.polygonOffsetFactor,units:t.polygonOffsetUnits}})}function createRenderStates$2(e){var t=!e._usesDepthTexture;e._primitiveRenderState=createRenderState(t,e._primitiveBias),e._terrainRenderState=createRenderState(t,e._terrainBias),e._pointRenderState=createRenderState(t,e._pointBias)}function destroyFramebuffer$1(e){for(var t=e._passes.length,i=0;i<t;++i){var r=e._passes[i],n=r.framebuffer;defined(n)&&!n.isDestroyed()&&n.destroy(),r.framebuffer=void 0}e._depthAttachment=e._depthAttachment&&e._depthAttachment.destroy(),e._colorAttachment=e._colorAttachment&&e._colorAttachment.destroy()}function clearFramebuffer(e,t,i){i=defaultValue(i,0),!e._isPointLight&&0!==i||(e._clearCommand.framebuffer=e._passes[i].framebuffer,e._clearCommand.execute(t,e._clearPassState))}function resize(e,t){e._size=t;var i=e._passes,r=i.length,n=e._textureSize;if(e._isPointLight){t=ContextLimits.maximumCubeMapSize>=t?t:ContextLimits.maximumCubeMapSize,n.x=t;var a=new BoundingRectangle(0,0,n.y=t,t);i[0].passState.viewport=a,i[1].passState.viewport=a,i[2].passState.viewport=a,i[3].passState.viewport=a,i[4].passState.viewport=a,i[5].passState.viewport=a}else 1===r?(t=ContextLimits.maximumTextureSize>=t?t:ContextLimits.maximumTextureSize,n.x=t,n.y=t,i[0].passState.viewport=new BoundingRectangle(0,0,t,t)):4===r&&(t=ContextLimits.maximumTextureSize>=2*t?t:ContextLimits.maximumTextureSize/2,n.x=2*t,n.y=2*t,i[0].passState.viewport=new BoundingRectangle(0,0,t,t),i[1].passState.viewport=new BoundingRectangle(t,0,t,t),i[2].passState.viewport=new BoundingRectangle(0,t,t,t),i[3].passState.viewport=new BoundingRectangle(t,t,t,t));e._clearPassState.viewport=new BoundingRectangle(0,0,n.x,n.y);for(var o=0;o<r;++o){var s=i[o],l=s.passState.viewport,u=l.x/n.x,c=l.y/n.y,d=l.width/n.x,h=l.height/n.y;s.textureOffsets=new Matrix4(d,0,0,u,0,h,0,c,0,0,1,0,0,0,0,1)}}DebugCameraPrimitive.prototype.update=function(e){if(this.show){var t,i,r=this._planesPrimitives,n=this._outlinePrimitives;if(this._updateOnChange){for(i=r.length,t=0;t<i;++t)n[t]=n[t]&&n[t].destroy(),r[t]=r[t]&&r[t].destroy();r.length=0,n.length=0}if(0===r.length){var a,o=this._camera,s=o.frustum;a=s instanceof PerspectiveFrustum?scratchPerspective:s instanceof PerspectiveOffCenterFrustum?scratchPerspectiveOffCenter:s instanceof OrthographicFrustum?scratchOrthographic:scratchOrthographicOffCenter,a=s.clone(a);var l=e.frustumSplits,u=l.length-1;u<=0&&((l=scratchSplits)[0]=this._camera.frustum.near,l[1]=this._camera.frustum.far,u=1);var c=o.positionWC,d=o.directionWC,h=o.upWC,p=o.rightWC;p=Cartesian3.negate(p,scratchRight);var f=scratchRotation$1;Matrix3.setColumn(f,0,p,f),Matrix3.setColumn(f,1,h,f),Matrix3.setColumn(f,2,d,f);var m=Quaternion.fromRotationMatrix(f,scratchOrientation);for(r.length=n.length=u,t=0;t<u;++t)a.near=l[t],a.far=l[t+1],r[t]=new Primitive({geometryInstances:new GeometryInstance({geometry:new FrustumGeometry({origin:c,orientation:m,frustum:a,_drawNearPlane:0===t}),attributes:{color:ColorGeometryInstanceAttribute.fromColor(Color.fromAlpha(this._color,.1,scratchColor))},id:this.id,pickPrimitive:this}),appearance:new PerInstanceColorAppearance({translucent:!0,flat:!0}),asynchronous:!1}),n[t]=new Primitive({geometryInstances:new GeometryInstance({geometry:new FrustumOutlineGeometry({origin:c,orientation:m,frustum:a,_drawNearPlane:0===t}),attributes:{color:ColorGeometryInstanceAttribute.fromColor(this._color)},id:this.id,pickPrimitive:this}),appearance:new PerInstanceColorAppearance({translucent:!1,flat:!0}),asynchronous:!1})}for(i=r.length,t=0;t<i;++t)n[t].update(e),r[t].update(e)}},DebugCameraPrimitive.prototype.isDestroyed=function(){return!1},DebugCameraPrimitive.prototype.destroy=function(){for(var e=this._planesPrimitives.length,t=0;t<e;++t)this._outlinePrimitives[t]=this._outlinePrimitives[t]&&this._outlinePrimitives[t].destroy(),this._planesPrimitives[t]=this._planesPrimitives[t]&&this._planesPrimitives[t].destroy();return destroyObject(this)},FisheyeProjectionMapShader.getReceiveShaderKeyword=function(e,t,i,r){return"receiveFisheyeProjection "+e._usesDepthTexture+e._polygonOffsetSupported+e._isPointLight+e._isSpotLight+(1<e._numberOfCascades)+e.debugCascadeColors+e.softShadows+t+i+r},FisheyeProjectionMapShader.createReceiveVertexShader=function(e,t,i){var r=e.defines.slice(0),n=e.sources.slice(0);return t&&(i?r.push("GENERATE_POSITION_AND_NORMAL"):r.push("GENERATE_POSITION")),new ShaderSource({defines:r,sources:n})},FisheyeProjectionMapShader.createReceiveFragmentShader=function(e,t,i,r,n){for(var a=ShaderSource.findNormalVarying(e),o=!r&&defined(a)||r&&n,s=ShaderSource.findPositionVarying(e),l=defined(s),u=t._isPointLight?t._pointBias:r?t._terrainBias:t._primitiveBias,c=e.defines.slice(0),d=e.sources.slice(0),h=d.length,p=0;p<h;++p)d[p]=ShaderSource.replaceMain(d[p],"czm_shadow_receive_main");var f="";return f+="uniform sampler2D shadowMap_texture; \n",f+="uniform sampler2D shadowMap_projectionTexture; \n",f+="uniform sampler2D shadowMap_projectionTextureArr[4]; \n",f+="uniform vec4 shadowMap_lightPositionECArr[4]; \n",f+="uniform mat4 shadowMap_matrixArr[4]; \n",f+="uniform vec3 shadowMap_lightDirectionECArr[4]; \n",f+="uniform vec4 shadowMapCount; \n",f+="uniform mat4 shadowMap_matrix; \nuniform vec3 shadowMap_lightDirectionEC; \nuniform vec4 shadowMap_lightPositionEC; \nuniform vec4 shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness; \nuniform vec4 shadowMap_texelSizeDepthBiasAndNormalShadingSmooth; \n#ifdef LOG_DEPTH \nvarying vec3 v_logPositionEC; \n#endif \nvec4 getPositionEC() \n{ \n"+(l?" return vec4("+s+", 1.0); \n":"#ifndef LOG_DEPTH \n return czm_windowToEyeCoordinates(gl_FragCoord); \n#else \n return vec4(v_logPositionEC, 1.0); \n#endif \n")+"} \nvec3 getNormalEC() \n{ \n"+(o?" return normalize("+a+"); \n":" return vec3(1.0); \n")+"} \nvoid applyNormalOffset(inout vec4 positionEC, vec3 normalEC, float nDotL) \n{ \n"+(u.normalOffset&&o?" float normalOffset = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.x; \n float normalOffsetScale = 1.0 - nDotL; \n vec3 offset = normalOffset * normalOffsetScale * normalEC; \n positionEC.xyz += offset; \n":"")+"} \n",f+="void main() \n{ \n czm_shadow_receive_main(); \n vec4 positionEC = getPositionEC(); \n vec3 normalEC = getNormalEC(); \n float depth = -positionEC.z; \n for(int i = 0; i < 4; i++){ \n if(i < int(shadowMapCount.x)){ \n vec3 directionEC = positionEC.xyz - shadowMap_lightPositionECArr[i].xyz; \n float distance = length(directionEC); \n directionEC = normalize(directionEC); \n float radius = shadowMap_lightPositionECArr[i].w; \n // Stop early if the fragment is beyond the point light radius \n if (distance > radius) \n { \n continue; \n } \n vec3 directionWC = czm_inverseViewRotation * directionEC; \n vec4 directionLight = shadowMap_matrixArr[i] * vec4(directionEC,0.0); \n vec3 shadowPosition = normalize(directionLight.xyz); \n shadowPosition = vec3( shadowPosition.xy, 0.0) * 0.5 + vec3(0.5,0.5, 0.0); \n if(i == 0){ \n gl_FragColor *= texture2D(shadowMap_projectionTextureArr[0], shadowPosition.xy); \n }else if(i == 1){ \n gl_FragColor *= texture2D(shadowMap_projectionTextureArr[1], shadowPosition.xy); \n }else if(i == 2){ \n gl_FragColor *= texture2D(shadowMap_projectionTextureArr[2], shadowPosition.xy); \n }else { \n gl_FragColor *= texture2D(shadowMap_projectionTextureArr[3], shadowPosition.xy); \n } \n }else{ \n break; \n } \n } \n} \n",d.push(f),new ShaderSource({defines:c,sources:d})},FisheyeProjectionMap.MAXIMUM_DISTANCE=2e4,FisheyeProjectionMap.prototype.debugCreateRenderStates=function(){createRenderStates$2(this)},Object.defineProperties(FisheyeProjectionMap.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this.dirty=this._enabled!==e,this._enabled=e}},normalOffset:{get:function(){return this._normalOffset},set:function(e){this.dirty=this._normalOffset!==e,this._normalOffset=e,this._terrainBias.normalOffset=e,this._primitiveBias.normalOffset=e,this._pointBias.normalOffset=e}},softShadows:{get:function(){return this._softShadows},set:function(e){this.dirty=this._softShadows!==e,this._softShadows=e}},size:{get:function(){return this._size},set:function(e){resize(this,e)}},outOfView:{get:function(){return this._outOfView}},shadowMapCullingVolume:{get:function(){return this._shadowMapCullingVolume}},passes:{get:function(){return this._passes}},isPointLight:{get:function(){return this._isPointLight}},castTexture:{set:function(t){(this._castImage=t)instanceof HTMLVideoElement&&(this._isPlayVideo&&this._castImage.play(),t.onplaying=function(e){t.playing=!0},t.timeupdate=function(e){t.timeupdate=!0}),this._isCastTextureDirty=!0}},playVideo:{set:function(e){this._isPlayVideo=e,this._isCastTextureDirty=e}},debugCascadeColors:{get:function(){return this._debugCascadeColors},set:function(e){this.dirty=this._debugCascadeColors!==e,this._debugCascadeColors=e}}});var scratchViewport$2=new BoundingRectangle;function createDebugShadowViewCommand(e,t){var i;i=e._isPointLight?"uniform samplerCube shadowMap_textureCube; \nvarying vec2 v_textureCoordinates; \nvoid main() \n{ \n vec2 uv = v_textureCoordinates; \n vec3 dir; \n \n if (uv.y < 0.5) \n { \n if (uv.x < 0.333) \n { \n dir.x = -1.0; \n dir.y = uv.x * 6.0 - 1.0; \n dir.z = uv.y * 4.0 - 1.0; \n } \n else if (uv.x < 0.666) \n { \n dir.y = -1.0; \n dir.x = uv.x * 6.0 - 3.0; \n dir.z = uv.y * 4.0 - 1.0; \n } \n else \n { \n dir.z = -1.0; \n dir.x = uv.x * 6.0 - 5.0; \n dir.y = uv.y * 4.0 - 1.0; \n } \n } \n else \n { \n if (uv.x < 0.333) \n { \n dir.x = 1.0; \n dir.y = uv.x * 6.0 - 1.0; \n dir.z = uv.y * 4.0 - 3.0; \n } \n else if (uv.x < 0.666) \n { \n dir.y = 1.0; \n dir.x = uv.x * 6.0 - 3.0; \n dir.z = uv.y * 4.0 - 3.0; \n } \n else \n { \n dir.z = 1.0; \n dir.x = uv.x * 6.0 - 5.0; \n dir.y = uv.y * 4.0 - 3.0; \n } \n } \n \n float shadow = czm_unpackDepth(textureCube(shadowMap_textureCube, dir)); \n gl_FragColor = vec4(vec3(shadow), 1.0); \n} \n":"uniform sampler2D shadowMap_texture; \nvarying vec2 v_textureCoordinates; \nvoid main() \n{ \n"+(e._usesDepthTexture?" float shadow = texture2D(shadowMap_texture, v_textureCoordinates).r; \n":" float shadow = czm_unpackDepth(texture2D(shadowMap_texture, v_textureCoordinates)); \n")+" gl_FragColor = vec4(vec3(shadow), 1.0); \n} \n";var r=t.createViewportQuadCommand(i,{uniformMap:{shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture}}});return r.pass=Pass$1.OVERLAY,r}function updateDebugShadowViewCommand(e,t){var i=t.context,r=t.context.drawingBufferWidth,n=t.context.drawingBufferHeight,a=.3*Math.min(r,n),o=scratchViewport$2;o.x=r-a,o.y=0,o.width=a,o.height=a;var s=e._debugShadowViewCommand;defined(s)||(s=createDebugShadowViewCommand(e,i),e._debugShadowViewCommand=s),defined(s.renderState)&&BoundingRectangle.equals(s.renderState.viewport,o)||(s.renderState=RenderState.fromCache({viewport:BoundingRectangle.clone(o)})),t.commandList.push(e._debugShadowViewCommand)}var frustumCornersNDC$1=new Array(8);frustumCornersNDC$1[0]=new Cartesian4(-1,-1,-1,1),frustumCornersNDC$1[1]=new Cartesian4(1,-1,-1,1),frustumCornersNDC$1[2]=new Cartesian4(1,1,-1,1),frustumCornersNDC$1[3]=new Cartesian4(-1,1,-1,1),frustumCornersNDC$1[4]=new Cartesian4(-1,-1,1,1),frustumCornersNDC$1[5]=new Cartesian4(1,-1,1,1),frustumCornersNDC$1[6]=new Cartesian4(1,1,1,1),frustumCornersNDC$1[7]=new Cartesian4(-1,1,1,1);for(var scratchMatrix=new Matrix4,scratchFrustumCorners$1=new Array(8),i$2=0;i$2<8;++i$2)scratchFrustumCorners$1[i$2]=new Cartesian4;function createDebugPointLight(e,t){return new Primitive({geometryInstances:[new GeometryInstance({geometry:new BoxOutlineGeometry({minimum:new Cartesian3(-.5,-.5,-.5),maximum:new Cartesian3(.5,.5,.5)}),attributes:{color:ColorGeometryInstanceAttribute.fromColor(t)}}),new GeometryInstance({geometry:new SphereOutlineGeometry({radius:.5}),attributes:{color:ColorGeometryInstanceAttribute.fromColor(t)}})],appearance:new PerInstanceColorAppearance({translucent:!1,flat:!0}),asynchronous:!1,modelMatrix:e})}var debugOutlineColors=[Color.RED,Color.GREEN,Color.BLUE,Color.MAGENTA],scratchScale$5=new Cartesian3;function applyDebugSettings(e,t){updateDebugShadowViewCommand(e,t);var i=e.debugFreezeFrame&&!e._debugFreezeFrame;if(e._debugFreezeFrame=e.debugFreezeFrame,e.debugFreezeFrame&&(i&&(e._debugCameraFrustum=e._debugCameraFrustum&&e._debugCameraFrustum.destroy(),e._debugCameraFrustum=new DebugCameraPrimitive({camera:e._sceneCamera,color:Color.CYAN,updateOnChange:!1})),e._debugCameraFrustum.update(t)),e._cascadesEnabled){if(e.debugFreezeFrame){i&&(e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=new DebugCameraPrimitive({camera:e._shadowMapCamera,color:Color.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t);for(var r=0;r<e._numberOfCascades;++r)i&&(e._debugCascadeFrustums[r]=e._debugCascadeFrustums[r]&&e._debugCascadeFrustums[r].destroy(),e._debugCascadeFrustums[r]=new DebugCameraPrimitive({camera:e._passes[r].camera,color:debugOutlineColors[r],updateOnChange:!1})),e._debugCascadeFrustums[r].update(t)}}else if(e._isPointLight){if(!defined(e._debugLightFrustum)||e._needsUpdate){var n=e._shadowMapCamera.positionWC,a=Quaternion.IDENTITY,o=2*e._pointLightRadius,s=Cartesian3.fromElements(o,o,o,scratchScale$5),l=Matrix4.fromTranslationQuaternionRotationScale(n,a,s,scratchMatrix);e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=createDebugPointLight(l,Color.YELLOW)}e._debugLightFrustum.update(t)}else defined(e._debugLightFrustum)&&!e._needsUpdate||(e._debugLightFrustum=new DebugCameraPrimitive({camera:e._shadowMapCamera,color:Color.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t)}function ShadowMapCamera(){this.viewMatrix=new Matrix4,this.inverseViewMatrix=new Matrix4,this.frustum=void 0,this.positionCartographic=new Cartographic,this.positionWC=new Cartesian3,this.directionWC=Cartesian3.clone(Cartesian3.UNIT_Z),this.upWC=Cartesian3.clone(Cartesian3.UNIT_Y),this.rightWC=Cartesian3.clone(Cartesian3.UNIT_X),this.viewProjectionMatrix=new Matrix4}ShadowMapCamera.prototype.clone=function(e){Matrix4.clone(e.viewMatrix,this.viewMatrix),Matrix4.clone(e.inverseViewMatrix,this.inverseViewMatrix),this.frustum=e.frustum.clone(this.frustum),Cartographic.clone(e.positionCartographic,this.positionCartographic),Cartesian3.clone(e.positionWC,this.positionWC),Cartesian3.clone(e.directionWC,this.directionWC),Cartesian3.clone(e.upWC,this.upWC),Cartesian3.clone(e.rightWC,this.rightWC)};var scaleBiasMatrix=new Matrix4(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);ShadowMapCamera.prototype.getViewProjection=function(){var e=this.viewMatrix,t=this.frustum.projectionMatrix;return Matrix4.multiply(t,e,this.viewProjectionMatrix),Matrix4.multiply(scaleBiasMatrix,this.viewProjectionMatrix,this.viewProjectionMatrix),this.viewProjectionMatrix};var scratchSplits$1=new Array(5),scratchFrustum=new PerspectiveFrustum,scratchCascadeDistances=new Array(4),scratchMin$1=new Cartesian3,scratchMax$1=new Cartesian3;function computeCascades(e,t){var i,r=e._shadowMapCamera,n=e._sceneCamera,a=n.frustum.near,o=n.frustum.far,s=e._numberOfCascades,l=o-a,u=o/a,c=.9,d=!1;t.shadowState.closestObjectSize<200&&(d=!0,c=.9);var h=scratchCascadeDistances,p=scratchSplits$1;for(p[0]=a,p[s]=o,i=0;i<s;++i){var f=(i+1)/s,m=a*Math.pow(u,f),g=a+l*f,y=CesiumMath.lerp(g,m,c);p[i+1]=y,h[i]=y-p[i]}if(d){for(i=0;i<s;++i)h[i]=Math.min(h[i],e._maximumCascadeDistances[i]);var v=p[0];for(i=0;i<s-1;++i)v+=h[i],p[i+1]=v}Cartesian4.unpack(p,0,e._cascadeSplits[0]),Cartesian4.unpack(p,1,e._cascadeSplits[1]),Cartesian4.unpack(h,0,e._cascadeDistances);var _=r.frustum,C=_.left,x=_.right,b=_.bottom,A=_.top,S=_.near,w=_.far,E=r.positionWC,T=r.directionWC,P=r.upWC,M=n.frustum.clone(scratchFrustum),D=r.getViewProjection();for(i=0;i<s;++i){M.near=p[i],M.far=p[i+1];for(var I=Matrix4.multiply(M.projectionMatrix,n.viewMatrix,scratchMatrix),O=Matrix4.inverse(I,scratchMatrix),R=Matrix4.multiply(D,O,scratchMatrix),L=Cartesian3.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,scratchMin$1),N=Cartesian3.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,scratchMax$1),k=0;k<8;++k){var B=Cartesian4.clone(frustumCornersNDC$1[k],scratchFrustumCorners$1[k]);Matrix4.multiplyByVector(R,B,B),Cartesian3.divideByScalar(B,B.w,B),Cartesian3.minimumByComponent(B,L,L),Cartesian3.maximumByComponent(B,N,N)}L.x=Math.max(L.x,0),L.y=Math.max(L.y,0),L.z=0,N.x=Math.min(N.x,1),N.y=Math.min(N.y,1),N.z=Math.min(N.z,1);var F=e._passes[i],V=F.camera;V.clone(r);var z=V.frustum;z.left=C+L.x*(x-C),z.right=C+N.x*(x-C),z.bottom=b+L.y*(A-b),z.top=b+N.y*(A-b),z.near=S+L.z*(w-S),z.far=S+N.z*(w-S),F.cullingVolume=V.frustum.computeCullingVolume(E,T,P);var U=e._cascadeMatrices[i];Matrix4.multiply(V.getViewProjection(),n.inverseViewMatrix,U),Matrix4.multiply(F.textureOffsets,U,U)}}var scratchLightView=new Matrix4,scratchRight$1=new Cartesian3,scratchUp=new Cartesian3,scratchTranslation=new Cartesian3;function fitShadowMapToScene(e,t){var i=e._shadowMapCamera,r=e._sceneCamera,n=Matrix4.multiply(r.frustum.projectionMatrix,r.viewMatrix,scratchMatrix),a=Matrix4.inverse(n,scratchMatrix),o=i.directionWC,s=r.directionWC,l=Cartesian3.cross(o,s,scratchRight$1);s=Cartesian3.cross(l,o,scratchUp),Cartesian3.normalize(s,s),Cartesian3.normalize(l,l);for(var u=Cartesian3.fromElements(0,0,0,scratchTranslation),c=Matrix4.computeView(u,o,s,l,scratchLightView),d=Matrix4.multiply(c,a,scratchMatrix),h=Cartesian3.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,scratchMin$1),p=Cartesian3.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,scratchMax$1),f=0;f<8;++f){var m=Cartesian4.clone(frustumCornersNDC$1[f],scratchFrustumCorners$1[f]);Matrix4.multiplyByVector(d,m,m),Cartesian3.divideByScalar(m,m.w,m),Cartesian3.minimumByComponent(m,h,h),Cartesian3.maximumByComponent(m,p,p)}p.z+=1e3,h.z-=10;var g=scratchTranslation;g.x=-.5*(h.x+p.x),g.y=-.5*(h.y+p.y),g.z=-p.z;var y=Matrix4.fromTranslation(g,scratchMatrix);c=Matrix4.multiply(y,c,c);var v=.5*(p.x-h.x),_=.5*(p.y-h.y),C=p.z-h.z,x=i.frustum;x.left=-v,x.right=v,x.bottom=-_,x.top=_,x.near=.01,x.far=C,Matrix4.clone(c,i.viewMatrix),Matrix4.inverse(c,i.inverseViewMatrix),Matrix4.getTranslation(i.inverseViewMatrix,i.positionWC),t.mapProjection.ellipsoid.cartesianToCartographic(i.positionWC,i.positionCartographic),Cartesian3.clone(o,i.directionWC),Cartesian3.clone(s,i.upWC),Cartesian3.clone(l,i.rightWC)}var directions=[new Cartesian3(-1,0,0),new Cartesian3(0,-1,0),new Cartesian3(0,0,-1),new Cartesian3(1,0,0),new Cartesian3(0,1,0),new Cartesian3(0,0,1)],ups=[new Cartesian3(0,-1,0),new Cartesian3(0,0,-1),new Cartesian3(0,-1,0),new Cartesian3(0,-1,0),new Cartesian3(0,0,1),new Cartesian3(0,-1,0)],rights=[new Cartesian3(0,0,1),new Cartesian3(1,0,0),new Cartesian3(-1,0,0),new Cartesian3(0,0,-1),new Cartesian3(1,0,0),new Cartesian3(1,0,0)];function computeOmnidirectional(e,t){var i=new PerspectiveFrustum;i.fov=CesiumMath.PI_OVER_TWO,i.near=1,i.far=e._pointLightRadius,i.aspectRatio=1;for(var r=0;r<6;++r){var n=e._passes[r].camera;n.positionWC=e._shadowMapCamera.positionWC,n.positionCartographic=t.mapProjection.ellipsoid.cartesianToCartographic(n.positionWC,n.positionCartographic),n.directionWC=directions[r],n.upWC=ups[r],n.rightWC=rights[r],Matrix4.computeView(n.positionWC,n.directionWC,n.upWC,n.rightWC,n.viewMatrix),Matrix4.inverse(n.viewMatrix,n.inverseViewMatrix),n.frustum=i}}var scratchCartesian1$2=new Cartesian3,scratchCartesian2$5=new Cartesian3,scratchBoundingSphere$3=new BoundingSphere,scratchCenter$1=scratchBoundingSphere$3.center;function checkVisibility(e,t){var i=e._sceneCamera,r=e._shadowMapCamera,n=scratchBoundingSphere$3;if(e._cascadesEnabled){if(i.frustum.near>=e.maximumDistance)return e._outOfView=!0,void(e._needsUpdate=!1);var a=t.mapProjection.ellipsoid.geodeticSurfaceNormal(i.positionWC,scratchCartesian1$2),o=Cartesian3.negate(r.directionWC,scratchCartesian2$5);if(Cartesian3.dot(a,o)<(e._darkness=0))return e._outOfView=!0,void(e._needsUpdate=!1);e._needsUpdate=!0,e._outOfView=!1}else if(e._isPointLight)n.center=r.positionWC,n.radius=e._pointLightRadius,e._outOfView=t.cullingVolume.computeVisibility(n)===Intersect$1.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(n),BoundingSphere.clone(n,e._boundingSphere);else{var s=r.frustum.far/2,l=Cartesian3.add(r.positionWC,Cartesian3.multiplyByScalar(r.directionWC,s,scratchCenter$1),scratchCenter$1);n.center=l,n.radius=s,e._outOfView=t.cullingVolume.computeVisibility(n)===Intersect$1.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(n),BoundingSphere.clone(n,e._boundingSphere)}}function updateCameras(e,t){var i=t.camera,r=e._lightCamera,n=e._sceneCamera,a=e._shadowMapCamera;e._cascadesEnabled?Cartesian3.clone(r.directionWC,a.directionWC):e._isPointLight?Cartesian3.clone(r.positionWC,a.positionWC):a.clone(r);var o,s,l=e._lightDirectionEC;Matrix4.multiplyByPointAsVector(i.viewMatrix,a.directionWC,l),Cartesian3.normalize(l,l),Cartesian3.negate(l,l),Matrix4.multiplyByPoint(i.viewMatrix,a.positionWC,e._lightPositionEC),e._lightPositionEC.w=e._pointLightRadius,Matrix4.multiply(r.viewMatrix,i.inverseViewMatrix,e._shadowMapMatrix),s=e._fitNearFar?(o=Math.min(t.shadowState.nearPlane,e.maximumDistance),Math.min(t.shadowState.farPlane,e.maximumDistance+1)):(o=i.frustum.near,e.maximumDistance),e._sceneCamera=Camera.clone(i,n),i.frustum.clone(e._sceneCamera.frustum),e._sceneCamera.frustum.near=o,e._sceneCamera.frustum.far=s,e._distance=s-o,checkVisibility(e,t),!e._outOfViewPrevious&&e._outOfView&&(e._needsUpdate=!0),e._outOfViewPrevious=e._outOfView}function updateCastTextures(e,t){if(!1!==e._isCastTextureDirty&&defined(e._castImage)){var i=t.context,r=e._shadowMapProjectionTexture,n=e._castImage;if(n instanceof HTMLVideoElement)if(2<=n.readyState){if(defined(r)){var a=(new Date).getTime();if(void 0===r._lastCreateTextureTime&&(r._lastCreateTextureTime=0),a-r._lastCreateTextureTime<e._videoFrameInterval)return;if(!n.timeupdate)return;r!==i.defaultTexture&&r.destroy(),r=void 0}defined(r)&&r!==i.defaultTexture||((r=new Texture({context:i,source:n}))._lastCreateTextureTime=(new Date).getTime(),e._shadowMapProjectionTexture=r,e._isPlayVideo||(e._isCastTextureDirty=!1))}else defined(r)||(e._shadowMapProjectionTexture=i.defaultTexture);else e._shadowMapProjectionTexture=new Texture({context:t.context,source:e._castImage}),e._isCastTextureDirty=!1}}FisheyeProjectionMap.prototype.update=function(e){if(updateCameras(this,e),updateCastTextures(this,e),this._needsUpdate)if(this._isPointLight&&computeOmnidirectional(this,e),this._cascadesEnabled&&(fitShadowMapToScene(this,e),1<this._numberOfCascades&&computeCascades(this,e)),this._isPointLight)this._shadowMapCullingVolume=CullingVolume.fromBoundingSphere(this._boundingSphere);else{var t=this._shadowMapCamera,i=t.positionWC,r=t.directionWC,n=t.upWC;this._shadowMapCullingVolume=t.frustum.computeCullingVolume(i,r,n),1===this._passes.length&&this._passes[0].camera.clone(t)}this.debugShow&&applyDebugSettings(this,e)},FisheyeProjectionMap.prototype.updatePass=function(e,t){clearFramebuffer(this,e,t)};var scratchTexelStepSize=new Cartesian2;function combineUniforms(t,e,i,r){var n=t._isPointLight?t._pointBias:i?t._terrainBias:t._primitiveBias;return combine(e,{shadowMap_texture:function(){return t._shadowMapTexture},shadowMap_projectionTexture:function(){return t._shadowMapProjectionTexture},shadowMap_textureCube:function(){return t._shadowMapTexture},shadowMap_matrix:function(){return t._shadowMapMatrix},shadowMap_cascadeSplits:function(){return t._cascadeSplits},shadowMap_cascadeMatrices:function(){return t._cascadeMatrices},shadowMap_lightDirectionEC:function(){return t._lightDirectionEC},shadowMap_lightPositionEC:function(){return t._lightPositionEC},shadowMap_cascadeDistances:function(){return t._cascadeDistances},shadowMap_projectionTextureArr:function(){for(var e=[],t=0;t<4;t++)e[t]=r._shadowMapProjectionTextureArr[t]._shadowMapProjectionTexture;return e},shadowMap_lightPositionECArr:function(){return r._lightPositionECArr},shadowMap_lightDirectionECArr:function(){return r._lightDirectionECArr},shadowMapCount:function(){return Cartesian4.fromElements(r._shadowMapCount,0,0,0)},shadowMap_matrixArr:function(){return r._shadowMapMatrixArr},shadowMap_texelSizeDepthBiasAndNormalShadingSmooth:function(){var e=scratchTexelStepSize;return e.x=1/t._textureSize.x,e.y=1/t._textureSize.y,Cartesian4.fromElements(e.x,e.y,n.depthBias,n.normalShadingSmooth,this.combinedUniforms1)},shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness:function(){return Cartesian4.fromElements(n.normalOffsetScale,t._distance,t.maximumDistance,t._darkness,this.combinedUniforms2)},combinedUniforms1:new Cartesian4,combinedUniforms2:new Cartesian4},!1)}var FisheyeTextureProjectionParam=function(){this._shadowMapProjectionTextureArr=new Array(4),this._shadowMapMatrixArr=new Array(4),this._lightPositionECArr=new Array(4),this._lightDirectionECArr=new Array(4);for(var e=0;e<4;e++)this._shadowMapMatrixArr[e]=new Matrix4,this._lightPositionECArr[e]=new Cartesian4,this._lightDirectionECArr[e]=new Cartesian3};function matchTextureProjection(e,t,i){for(var r=!1,n=0;n<t.length;n++){var a=t[n];for(var o in i){var s=i[o];if("fisheye"===s._type){var l=!1;for(var u in s._matchMaterials)if(0<=a.indexOf(s._matchMaterials[u])){l=!0;break}l&&(e.push(s),r=!0)}}}return r}FisheyeProjectionMap.createDerivedCommands=function(e,t,i,r,n,a){defined(a)||(a={});var o=0<e.length,s=i.shaderProgram,l=s.vertexShaderSource,u=s.fragmentShaderSource,c=i.pass===Pass$1.GLOBE;if(o&&defined(i.receiveTextureProjectionList)&&0<i.receiveTextureProjectionList.length){var d=i.ftpp;defined(d)||(d=new FisheyeTextureProjectionParam,i.ftpp=d);var h=[];matchTextureProjection(h,i.receiveTextureProjectionList,e);var p,f,m=Math.min(h.length,4);if(0===m)return;d.textureProjectionArray=h,d._shadowMapCount=m,defined(a.receiveCommand)&&(p=a.receiveCommand.shaderProgram,f=a.receiveCommand.uniformMap);var g=DrawCommand.shallowClone(i,a.receiveCommand);a.castShadows=!1,a.receiveShadows=!0;for(var y=0;y<m;++y){var v=a.receiveShaderCastShadows!==i.castShadows,_=a.receiveShaderProgramId!==i.shaderProgram.id;if(!defined(p)||_||r||v){var C=FisheyeProjectionMapShader.getReceiveShaderKeyword(h[y],i.castShadows,c,!1);if(!defined(p=n.shaderCache.getDerivedShaderProgram(s,C))){var x=FisheyeProjectionMapShader.createReceiveVertexShader(l,c,!1),b=FisheyeProjectionMapShader.createReceiveFragmentShader(u,h[y],i.castShadows,c,!1);p=n.shaderCache.createDerivedShaderProgram(s,C,{vertexShaderSource:x,fragmentShaderSource:b,attributeLocations:s._attributeLocations})}}d._shadowMapProjectionTextureArr[y]=h[y],d._shadowMapMatrixArr[y]=h[y]._shadowMapMatrix,d._lightPositionECArr[y]=h[y]._lightPositionEC,d._lightDirectionECArr[y]=h[y]._lightDirectionEC}for(var A=m;A<4;A++)d._shadowMapProjectionTextureArr[A]=h[m-1];return f=combineUniforms(h[0],i.uniformMap,c,d),g.shaderProgram=p,g.renderState=h[0]._primitiveRenderState,g.uniformMap=f,a.receiveShaderProgramId=i.shaderProgram.id,a.receiveShaderCastShadows=i.castShadows,a.receiveCommand=g,a}},FisheyeProjectionMap.prototype.isDestroyed=function(){return!1},FisheyeProjectionMap.prototype.destroy=function(){destroyFramebuffer$1(this),this._debugLightFrustum=this._debugLightFrustum&&this._debugLightFrustum.destroy(),this._debugCameraFrustum=this._debugCameraFrustum&&this._debugCameraFrustum.destroy(),this._debugShadowViewCommand=this._debugShadowViewCommand&&this._debugShadowViewCommand.shaderProgram&&this._debugShadowViewCommand.shaderProgram.destroy();for(var e=0;e<this._numberOfCascades;++e)this._debugCascadeFrustums[e]=this._debugCascadeFrustums[e]&&this._debugCascadeFrustums[e].destroy();return destroyObject(this)};var tmp$4={},AFj,BFj,CFj,EFj;tmp$4.SuperGif=(AFj=function(e){return e.reduce(function(e,t){return 2*e+t},0)},BFj=function(e){for(var t=[],i=7;0<=i;i--)t.push(!!(e&1<<i));return t},CFj=function(e){this.data=e,this.len=this.data.length,this.pos=0,this.readByte=function(){if(this.pos>=this.data.length)throw new Error("Attempted to read past end of stream.");return e instanceof Uint8Array?e[this.pos++]:255&e.charCodeAt(this.pos++)},this.readBytes=function(e){for(var t=[],i=0;i<e;i++)t.push(this.readByte());return t},this.read=function(e){for(var t="",i=0;i<e;i++)t+=String.fromCharCode(this.readByte());return t},this.readUnsigned=function(){var e=this.readBytes(2);return(e[1]<<8)+e[0]}},EFj=function(o,s){s=s||{};var r=function(e){for(var t=[],i=0;i<e;i++)t.push(o.readBytes(3));return t},l=function(){var e,t;for(t="";e=o.readByte(),t+=o.read(e),0!==e;);return t},e=function(){var e={};if(e.sig=o.read(3),e.ver=o.read(3),"GIF"!==e.sig)throw new Error("Not a GIF file.");e.width=o.readUnsigned(),e.height=o.readUnsigned();var t=BFj(o.readByte());e.gctFlag=t.shift(),e.colorRes=AFj(t.splice(0,3)),e.sorted=t.shift(),e.gctSize=AFj(t.splice(0,3)),e.bgColor=o.readByte(),e.pixelAspectRatio=o.readByte(),e.gctFlag&&(e.gct=r(1<<e.gctSize+1)),s.hdr&&s.hdr(e)},t=function(e){e.leftPos=o.readUnsigned(),e.topPos=o.readUnsigned(),e.width=o.readUnsigned(),e.height=o.readUnsigned();var t=BFj(o.readByte());e.lctFlag=t.shift(),e.interlaced=t.shift(),e.sorted=t.shift(),e.reserved=t.splice(0,2),e.lctSize=AFj(t.splice(0,3)),e.lctFlag&&(e.lct=r(1<<e.lctSize+1)),e.lzwMinCodeSize=o.readByte();var i=l();e.pixels=function(t,r){var n=0,e=function(e){var t=0;for(var i=0;i<e;i++){if(r.charCodeAt(n>>3)&1<<(n&7)){t|=1<<i}n++}return t},i=[],a=1<<t,o=a+1,s=t+1,l=[],u=function(){l=[];s=t+1;for(var e=0;e<a;e++){l[e]=[e]}l[a]=[];l[o]=null},c,d;while(true){d=c;c=e(s);if(c===a){u();continue}if(c===o)break;if(c<l.length){if(d!==a){l.push(l[d].concat(l[c][0]))}}else{if(c!==l.length)throw new Error("Invalid LZW code.");l.push(l[d].concat(l[d][0]))}i.push.apply(i,l[c]);if(l.length===1<<s&&s<12){s++}}return i}(e.lzwMinCodeSize,i),e.interlaced&&(e.pixels=function(r,n){for(var a=new Array(r.length),e=r.length/n,t=function(e,t){var i=r.slice(t*n,(t+1)*n);a.splice.apply(a,[e*n,n].concat(i))},i=[0,4,2,1],o=[8,8,4,2],s=0,l=0;l<4;l++){for(var u=i[l];u<e;u+=o[l]){t(u,s);s++}}return a}(e.pixels,e.width)),s.img&&s.img(e)},i=function(){var e={};switch(e.sentinel=o.readByte(),String.fromCharCode(e.sentinel)){case"!":e.type="ext",function(e){var t=function(e){var t=o.readByte(),i=BFj(o.readByte());e.reserved=i.splice(0,3),e.disposalMethod=AFj(i.splice(0,3)),e.userInput=i.shift(),e.transparencyGiven=i.shift(),e.delayTime=o.readUnsigned(),e.transparencyIndex=o.readByte(),e.terminator=o.readByte(),s.gce&&s.gce(e)},i=function(e){e.comment=l(),s.com&&s.com(e)},r=function(e){var t=o.readByte();e.ptHeader=o.readBytes(12),e.ptData=l(),s.pte&&s.pte(e)},n=function(e){var t=function(e){var t=o.readByte();e.unknown=o.readByte(),e.iterations=o.readUnsigned(),e.terminator=o.readByte(),s.app&&s.app.NETSCAPE&&s.app.NETSCAPE(e)},i=function(e){e.appData=l(),s.app&&s.app[e.identifier]&&s.app[e.identifier](e)},r=o.readByte();switch(e.identifier=o.read(8),e.authCode=o.read(3),e.identifier){case"NETSCAPE":t(e);break;default:i(e);break}},a=function(e){e.data=l(),s.unknown&&s.unknown(e)};switch(e.label=o.readByte(),e.label){case 249:e.extType="gce";t(e);break;case 254:e.extType="com";i(e);break;case 1:e.extType="pte";r(e);break;case 255:e.extType="app";n(e);break;default:e.extType="unknown";a(e);break}}(e);break;case",":e.type="img",t(e);break;case";":e.type="eof",s.eof&&s.eof(e);break;default:throw new Error("Unknown block: 0x"+e.sentinel.toString(16))}"eof"!==e.type&&setTimeout(i,0)};e(),setTimeout(i,0)},function(e){var r,n,l={vp_l:0,vp_t:0,vp_w:null,vp_h:null,c_w:null,c_h:null};for(var t in e)l[t]=e[t];l.vp_w&&l.vp_h&&(l.is_vp=!0);var s=null,i=!1,a=null,o=null,u=null,c=null,d=null,h=null,p=null,f=!0,m=!1,g=[],y=[],v=l.gif;void 0===l.auto_play&&(l.auto_play=!v.getAttribute("rel:auto_play")||"1"==v.getAttribute("rel:auto_play"));var _,C,x,b,A=l.hasOwnProperty("on_end")?l.on_end:null,S=l.hasOwnProperty("loop_delay")?l.loop_delay:0,w=l.hasOwnProperty("loop_mode")?l.loop_mode:"auto",E=!l.hasOwnProperty("draw_while_loading")||l.draw_while_loading,T=!!E&&(!l.hasOwnProperty("show_progress_bar")||l.show_progress_bar),P=l.hasOwnProperty("progressbar_height")?l.progressbar_height:25,M=l.hasOwnProperty("progressbar_background_color")?l.progressbar_background_color:"rgba(255,255,255,0.4)",D=l.hasOwnProperty("progressbar_foreground_color")?l.progressbar_foreground_color:"rgba(255,0,22,.8)",I=function(){d=u,h=u=o=a=null},O=function(){try{EFj(r,U)}catch(e){N("parse")}},R=function(e,t){_.width=e*$(),_.height=t*$(),x.style.minWidth=e*$()+"px",b.width=e,b.height=t,b.style.width=e+"px",b.style.height=t+"px",b.getContext("2d").setTransform(1,0,0,1,0,0)},L=function(e,t,i){if(i&&T){var r,n,a,o,s=P;l.is_vp?o=m?(a=(l.vp_t+l.vp_h-s)/$(),s/=$(),r=l.vp_l/$(),n=r+e/t*(l.vp_w/$()),_.width/$()):(a=l.vp_t+l.vp_h-s,s=s,r=l.vp_l,n=r+e/t*l.vp_w,_.width):(a=(_.height-s)/(m?$():1),n=e/t*_.width/(m?$():1),o=_.width/(m?$():1),s/=m?$():1),C.fillStyle=M,C.fillRect(n,a,o-n,s),C.fillStyle=D,C.fillRect(0,a,n,s)}},N=function(e){s=e,n={width:v.width,height:v.height},g=[],C.fillStyle="black",C.fillRect(0,0,l.c_w?l.c_w:n.width,l.c_h?l.c_h:n.height),C.strokeStyle="red",C.lineWidth=3,C.moveTo(0,0),C.lineTo(l.c_w?l.c_w:n.width,l.c_h?l.c_h:n.height),C.moveTo(0,l.c_h?l.c_h:n.height),C.lineTo(l.c_w?l.c_w:n.width,0),C.stroke()},k=function(){h&&(g.push({data:h.getImageData(0,0,n.width,n.height),delay:o}),y.push({x:0,y:0}))},B=function(){var a=-1,e=0,o=function(e){a+=e,i()},t=function(){var i=!1,r=function(){null!==A&&A(v),e++,!1!==w||e<0?n():f=i=!1},n=function(){if(i=f){o(1);var e=10*g[a].delay;e=e||100;var t=(a+1+g.length)%g.length;0===t?(e+=S,setTimeout(r,e)):setTimeout(n,e)}};return function(){i||setTimeout(n,0)}}(),i=function(){var e;(a=parseInt(a,10))>g.length-1&&(a=0),a<0&&(a=0),e=y[a],b.getContext("2d").putImageData(g[a].data,e.x,e.y),C.globalCompositeOperation="copy",C.drawImage(b,0,0)};return{init:function(){s||(l.c_w&&l.c_h||C.scale($(),$()),l.auto_play?t():(a=0,i()))},step:t,play:function(){f=!0,t()},pause:function(){f=!1},playing:f,move_relative:o,current_frame:function(){return a},length:function(){return g.length},move_to:function(e){a=e,i()}}}(),F=function(e){L(r.pos,r.data.length,e)},V=function(){},z=function(t,i){return function(e){t(e),F(i)}},U={hdr:z(function(e){R((n=e).width,n.height)}),gce:z(function(e){k(),I(),a=e.transparencyGiven?e.transparencyIndex:null,o=e.delayTime,u=e.disposalMethod}),com:z(V),app:{NETSCAPE:z(V)},img:z(function(e){h=h||b.getContext("2d");var t=g.length,i=e.lctFlag?e.lct:n.gct;0<t&&(3===d?null!==c?h.putImageData(g[c].data,0,0):h.clearRect(p.leftPos,p.topPos,p.width,p.height):c=t-1,2===d&&h.clearRect(p.leftPos,p.topPos,p.width,p.height));var r=h.getImageData(e.leftPos,e.topPos,e.width,e.height);e.pixels.forEach(function(e,t){e!==a&&(r.data[4*t+0]=i[e][0],r.data[4*t+1]=i[e][1],r.data[4*t+2]=i[e][2],r.data[4*t+3]=255)}),h.putImageData(r,e.leftPos,e.topPos),m||(C.scale($(),$()),m=!0),E&&(C.drawImage(b,0,0),E=l.auto_play),p=e},!0),eof:function(e){k(),F(!1),l.c_w&&l.c_h||(_.width=n.width*$(),_.height=n.height*$()),B.init(),i=!1,W&&W(v)}},G=function(){var e=v.parentNode,t=document.createElement("div");_=document.createElement("canvas"),C=_.getContext("2d"),x=document.createElement("div"),b=document.createElement("canvas"),t.width=_.width=v.width,t.height=_.height=v.height,x.style.minWidth=v.width+"px",t.className="jsgif",x.className="jsgif_toolbar",t.appendChild(_),t.appendChild(x),e.insertBefore(t,v),e.removeChild(v),l.c_w&&l.c_h&&R(l.c_w,l.c_h),H=!0},$=function(){return l.max_width&&n&&n.width>l.max_width?l.max_width/n.width:1},H=!1,W=!1,j=function(e){return!(i||(W=e||!1,i=!0,g=[],I(),p=h=d=c=null))};return{play:B.play,pause:B.pause,move_relative:B.move_relative,move_to:B.move_to,get_playing:function(){return f},get_canvas:function(){return _},get_canvas_scale:function(){return $()},get_loading:function(){return i},get_auto_play:function(){return l.auto_play},get_length:function(){return B.length()},get_current_frame:function(){return B.current_frame()},load_url:function(e,t){if(j(t)){var i=new XMLHttpRequest;i.open("GET",e,!0),"overrideMimeType"in i?i.overrideMimeType("text/plain; charset=x-user-defined"):"responseType"in i?i.responseType="arraybuffer":i.setRequestHeader("Accept-Charset","x-user-defined"),i.onloadstart=function(){H||G()},i.onload=function(e){200!=this.status&&N("xhr - response"),"response"in this||(this.response=new VBArray(this.responseText).toArray().map(String.fromCharCode).join(""));var t=this.response;0<t.toString().indexOf("ArrayBuffer")&&(t=new Uint8Array(t)),r=new CFj(t),setTimeout(O,0)},i.onprogress=function(e){e.lengthComputable&&L(e.loaded,e.total,!0)},i.onerror=function(){N("xhr")},i.send()}},load:function(e){this.load_url(v.getAttribute("rel:animated_src")||v.src,e)},load_raw:function(e,t){j(t)&&(H||G(),r=new CFj(e),setTimeout(O,0))},set_frame_offset:function(e,t){y[e]?(void 0!==t.x&&(y[e].x=t.x),void 0!==t.y&&(y[e].y=t.y)):y[e]=t}}});var SuperGif=tmp$4.SuperGif;function GifImageProperty(e){if(!defined(e.gif))throw new DeveloperError("gif property is needed.");this._definitionChanged=new Event,this._gif=e.gif,this._speed=defaultValue(e.speed,1),this.parseGif(),this._step=0,this._imageArr=[]}function WebMercatorTilingScheme(e){if(e=defaultValue(e,defaultValue.EMPTY_OBJECT),this._ellipsoid=defaultValue(e.ellipsoid,Ellipsoid.WGS84),this._numberOfLevelZeroTilesX=defaultValue(e.numberOfLevelZeroTilesX,1),this._numberOfLevelZeroTilesY=defaultValue(e.numberOfLevelZeroTilesY,1),this._projection=new WebMercatorProjection(this._ellipsoid),defined(e.rectangleSouthwestInMeters)&&defined(e.rectangleNortheastInMeters))this._rectangleSouthwestInMeters=e.rectangleSouthwestInMeters,this._rectangleNortheastInMeters=e.rectangleNortheastInMeters;else{var t=this._ellipsoid.maximumRadius*Math.PI;this._rectangleSouthwestInMeters=new Cartesian2(-t,-t),this._rectangleNortheastInMeters=new Cartesian2(t,t)}var i=this._projection.unproject(this._rectangleSouthwestInMeters),r=this._projection.unproject(this._rectangleNortheastInMeters);this._rectangle=new Rectangle(i.longitude,i.latitude,r.longitude,r.latitude)}function ImageryProvider(){this.defaultAlpha=void 0,this.defaultBrightness=void 0,this.defaultContrast=void 0,this.defaultHue=void 0,this.defaultSaturation=void 0,this.defaultGamma=void 0,this.defaultMinificationFilter=void 0,this.defaultMagnificationFilter=void 0,DeveloperError.throwInstantiationError()}Object.defineProperties(GifImageProperty.prototype,{gif:{set:function(e){this._gif=e,this.parseGif()},get:function(){return this._gif}},speed:{get:function(){return this._speed},set:function(e){this._speed=e}},definitionChanged:{get:function(){return this._definitionChanged}}}),GifImageProperty.prototype.parseGif=function(){var i=this;i._imageArr=[];var e=document.createElement("img");e.src=i._gif,e.setAttribute("rel:animated_src",i.gif),e.setAttribute("rel:auto_play","1"),document.body.appendChild(e);var r=new SuperGif({gif:e});return new Promise(function(t){r.load(function(){for(var e=0;e<r.get_length();e++)r.move_to(e),i._imageArr.push(r.get_canvas().toDataURL());t(i._imageArr)})})},GifImageProperty.prototype.getImageBySpeed=function(){var e=this._imageArr.length;return 0<e?(this._step<this._speed*(e-1)?this._step++:this._step=0,this._imageArr[Math.floor(this._step/this._speed)]):this._gif},GifImageProperty.prototype.getValue=function(e,t){return defined(t)||(t={}),t.image=this.getImageBySpeed(),t.image},GifImageProperty.prototype.equals=function(e){return this===e||e instanceof GifImageProperty&&Property.equals(this.gif,e.gif)},Object.defineProperties(WebMercatorTilingScheme.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}}),WebMercatorTilingScheme.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e},WebMercatorTilingScheme.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e},WebMercatorTilingScheme.prototype.rectangleToNativeRectangle=function(e,t){var i=this._projection,r=i.project(Rectangle.southwest(e)),n=i.project(Rectangle.northeast(e));return defined(t)?(t.west=r.x,t.south=r.y,t.east=n.x,t.north=n.y,t):new Rectangle(r.x,r.y,n.x,n.y)},WebMercatorTilingScheme.prototype.tileXYToNativeRectangle=function(e,t,i,r){var n=this.getNumberOfXTilesAtLevel(i),a=this.getNumberOfYTilesAtLevel(i),o=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/n,s=this._rectangleSouthwestInMeters.x+e*o,l=this._rectangleSouthwestInMeters.x+(e+1)*o,u=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/a,c=this._rectangleNortheastInMeters.y-t*u,d=this._rectangleNortheastInMeters.y-(t+1)*u;return defined(r)?(r.west=s,r.south=d,r.east=l,r.north=c,r):new Rectangle(s,d,l,c)},WebMercatorTilingScheme.prototype.tileXYToRectangle=function(e,t,i,r){var n=this.tileXYToNativeRectangle(e,t,i,r),a=this._projection,o=a.unproject(new Cartesian2(n.west,n.south)),s=a.unproject(new Cartesian2(n.east,n.north));return n.west=o.longitude,n.south=o.latitude,n.east=s.longitude,n.north=s.latitude,n},WebMercatorTilingScheme.prototype.positionToTileXY=function(e,t,i){var r=this._rectangle;if(Rectangle.contains(r,e)){var n=this.getNumberOfXTilesAtLevel(t),a=this.getNumberOfYTilesAtLevel(t),o=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/n,s=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/a,l=this._projection.project(e),u=(l.x-this._rectangleSouthwestInMeters.x)/o|0;n<=u&&(u=n-1);var c=(this._rectangleNortheastInMeters.y-l.y)/s|0;return a<=c&&(c=a-1),defined(i)?(i.x=u,i.y=c,i):new Cartesian2(u,c)}},Object.defineProperties(ImageryProvider.prototype,{ready:{get:DeveloperError.throwInstantiationError},readyPromise:{get:DeveloperError.throwInstantiationError},rectangle:{get:DeveloperError.throwInstantiationError},tileWidth:{get:DeveloperError.throwInstantiationError},tileHeight:{get:DeveloperError.throwInstantiationError},maximumLevel:{get:DeveloperError.throwInstantiationError},minimumLevel:{get:DeveloperError.throwInstantiationError},tilingScheme:{get:DeveloperError.throwInstantiationError},tileDiscardPolicy:{get:DeveloperError.throwInstantiationError},errorEvent:{get:DeveloperError.throwInstantiationError},credit:{get:DeveloperError.throwInstantiationError},proxy:{get:DeveloperError.throwInstantiationError},hasAlphaChannel:{get:DeveloperError.throwInstantiationError}}),ImageryProvider.prototype.getTileCredits=DeveloperError.throwInstantiationError,ImageryProvider.prototype.requestImage=DeveloperError.throwInstantiationError,ImageryProvider.prototype.pickFeatures=DeveloperError.throwInstantiationError;var ktxRegex$1=/\.ktx$/i,crnRegex$1=/\.crn$/i,ddsRegex$1=/\.dds$/i,jsonRegex=/\.json$/i;function loadJson(e){var t=e.fetchJson();if(void 0!==t)return t.then(function(e){return e})}function GWBaiduImageryProvider(e){this._errorEvent=new Event,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=18,this._minimumLevel=1;var t=new Cartesian2(-33554054,-33746824),i=new Cartesian2(33554054,33746824);this._tilingScheme=new WebMercatorTilingScheme({rectangleSouthwestInMeters:t,rectangleNortheastInMeters:i}),this._rectangle=this._tilingScheme.rectangle,this._resource=Resource.createIfNeeded(e.url),this._tileDiscardPolicy=void 0,this._credit=void 0,this._readyPromise=void 0}ImageryProvider.loadImage=function(e,t){var i=Resource.createIfNeeded(t);return ktxRegex$1.test(i.url)?loadKTX(i):crnRegex$1.test(i.url)?loadCRN(i):ddsRegex$1.test(i)?loadDDS(i):jsonRegex.test(i.url)?loadJson(i):defined(e)&&defined(e.tileDiscardPolicy)?i.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}):i.fetchImage({preferImageBitmap:!0,flipY:!0})},Object.defineProperties(GWBaiduImageryProvider.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){if(!this.ready)throw new DeveloperError("tileWidth must not be called before the imagery provider is ready.");return this._tileWidth}},tileHeight:{get:function(){if(!this.ready)throw new DeveloperError("tileHeight must not be called before the imagery provider is ready.");return this._tileHeight}},maximumLevel:{get:function(){if(!this.ready)throw new DeveloperError("maximumLevel must not be called before the imagery provider is ready.");return this._maximumLevel}},minimumLevel:{get:function(){if(!this.ready)throw new DeveloperError("minimumLevel must not be called before the imagery provider is ready.");return this._minimumLevel}},tilingScheme:{get:function(){if(!this.ready)throw new DeveloperError("tilingScheme must not be called before the imagery provider is ready.");return this._tilingScheme}},tileDiscardPolicy:{get:function(){if(!this.ready)throw new DeveloperError("tileDiscardPolicy must not be called before the imagery provider is ready.");return this._tileDiscardPolicy}},rectangle:{get:function(){if(!this.ready)throw new DeveloperError("rectangle must not be called before the imagery provider is ready.");return this._rectangle}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._resource}},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){if(!this.ready)throw new DeveloperError("credit must not be called before the imagery provider is ready.");return this._credit}}}),GWBaiduImageryProvider.prototype.requestImage=function(e,t,i,r){var n=this._tilingScheme.getNumberOfXTilesAtLevel(i),a=this._tilingScheme.getNumberOfYTilesAtLevel(i),o=this.url.replace("{x}",e-n/2).replace("{y}",a/2-t-1).replace("{z}",i).replace("{s}",Math.floor(10*Math.random()));return ImageryProvider.loadImage(this,o)};var tmp$5={};!function(e){var p=6371008.8,r={centimeters:637100880,centimetres:637100880,degrees:57.22891354143274,feet:20902260.511392,inches:39.37*p,kilometers:6371.0088,kilometres:6371.0088,meters:p,metres:p,miles:3958.761333810546,millimeters:6371008800,millimetres:6371008800,nauticalmiles:p/1852,radians:1,yards:6967335.223679999},t={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:.001,kilometres:.001,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/p,yards:1.0936133},a={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function G(e,t,i){void 0===i&&(i={});var r={type:"Feature"};return 0!==i.id&&!i.id||(r.id=i.id),i.bbox&&(r.bbox=i.bbox),r.properties=t||{},r.geometry=e,r}function i(e,t,i){switch(e){case"Point":return $(t).geometry;case"LineString":return H(t).geometry;case"Polygon":return V(t).geometry;case"MultiPoint":return l(t).geometry;case"MultiLineString":return c(t).geometry;case"MultiPolygon":return d(t).geometry;default:throw new Error(e+" is invalid")}}function $(e,t,i){if(void 0===i&&(i={}),!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");if(e.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!j(e[0])||!j(e[1]))throw new Error("coordinates must contain numbers");return G({type:"Point",coordinates:e},t,i)}function n(e,t,i){return void 0===i&&(i={}),W(e.map(function(e){return $(e,t)}),i)}function V(e,t,i){void 0===i&&(i={});for(var r=0,n=e;r<n.length;r++){var a=n[r];if(a.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var o=0;o<a[a.length-1].length;o++)if(a[a.length-1][o]!==a[0][o])throw new Error("First and last Position are not equivalent.")}return G({type:"Polygon",coordinates:e},t,i)}function o(e,t,i){return void 0===i&&(i={}),W(e.map(function(e){return V(e,t)}),i)}function H(e,t,i){if(void 0===i&&(i={}),e.length<2)throw new Error("coordinates must be an array of two or more positions");return G({type:"LineString",coordinates:e},t,i)}function s(e,t,i){return void 0===i&&(i={}),W(e.map(function(e){return H(e,t)}),i)}function W(e,t){void 0===t&&(t={});var i={type:"FeatureCollection"};return t.id&&(i.id=t.id),t.bbox&&(i.bbox=t.bbox),i.features=e,i}function c(e,t,i){return void 0===i&&(i={}),G({type:"MultiLineString",coordinates:e},t,i)}function l(e,t,i){return void 0===i&&(i={}),G({type:"MultiPoint",coordinates:e},t,i)}function d(e,t,i){return void 0===i&&(i={}),G({type:"MultiPolygon",coordinates:e},t,i)}function u(e,t,i){return void 0===i&&(i={}),G({type:"GeometryCollection",geometries:e},t,i)}function h(e,t){if(void 0===t&&(t=0),t&&!(0<=t))throw new Error("precision must be a positive number");var i=Math.pow(10,t||0);return Math.round(e*i)/i}function f(e,t){void 0===t&&(t="kilometers");var i=r[t];if(!i)throw new Error(t+" units is invalid");return e*i}function m(e,t){void 0===t&&(t="kilometers");var i=r[t];if(!i)throw new Error(t+" units is invalid");return e/i}function y(e,t){return v(m(e,t))}function g(e){var t=e%360;return t<0&&(t+=360),t}function v(e){return e%(2*Math.PI)*180/Math.PI}function _(e){return e%360*Math.PI/180}function C(e,t,i){if(void 0===t&&(t="kilometers"),void 0===i&&(i="kilometers"),!(0<=e))throw new Error("length must be a positive number");return f(m(e,t),i)}function x(e,t,i){if(void 0===t&&(t="meters"),void 0===i&&(i="kilometers"),!(0<=e))throw new Error("area must be a positive number");var r=a[t];if(!r)throw new Error("invalid original units");var n=a[i];if(!n)throw new Error("invalid final units");return e/r*n}function j(e){return!isNaN(e)&&null!==e&&!Array.isArray(e)}function q(e){return!!e&&e.constructor===Object}function b(e){if(!e)throw new Error("bbox is required");if(!Array.isArray(e))throw new Error("bbox must be an Array");if(4!==e.length&&6!==e.length)throw new Error("bbox must be an Array of 4 or 6 numbers");e.forEach(function(e){if(!j(e))throw new Error("bbox must only contain numbers")})}function A(e){if(!e)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof e))throw new Error("id must be a number or a string")}var S=Object.freeze({__proto__:null,earthRadius:p,factors:r,unitsFactors:t,areaFactors:a,feature:G,geometry:i,point:$,points:n,polygon:V,polygons:o,lineString:H,lineStrings:s,featureCollection:W,multiLineString:c,multiPoint:l,multiPolygon:d,geometryCollection:u,round:h,radiansToLength:f,lengthToRadians:m,lengthToDegrees:y,bearingToAzimuth:g,radiansToDegrees:v,degreesToRadians:_,convertLength:C,convertArea:x,isNumber:j,isObject:q,validateBBox:b,validateId:A});function Q(e){if(!e)throw new Error("coord is required");if(!Array.isArray(e)){if("Feature"===e.type&&null!==e.geometry&&"Point"===e.geometry.type)return e.geometry.coordinates;if("Point"===e.type)return e.coordinates}if(Array.isArray(e)&&2<=e.length&&!Array.isArray(e[0])&&!Array.isArray(e[1]))return e;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function w(e){if(Array.isArray(e))return e;if("Feature"===e.type){if(null!==e.geometry)return e.geometry.coordinates}else if(e.coordinates)return e.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function E(e){if(1<e.length&&j(e[0])&&j(e[1]))return!0;if(Array.isArray(e[0])&&e[0].length)return E(e[0]);throw new Error("coordinates must only contain numbers")}function T(e,t,i){if(!t||!i)throw new Error("type and name required");if(!e||e.type!==t)throw new Error("Invalid input to "+i+": must be a "+t+", given "+e.type)}function P(e,t,i){if(!e)throw new Error("No feature passed");if(!i)throw new Error(".featureOf() requires a name");if(!e||"Feature"!==e.type||!e.geometry)throw new Error("Invalid input to "+i+", Feature with geometry required");if(!e.geometry||e.geometry.type!==t)throw new Error("Invalid input to "+i+": must be a "+t+", given "+e.geometry.type)}function M(e,t,i){if(!e)throw new Error("No featureCollection passed");if(!i)throw new Error(".collectionOf() requires a name");if(!e||"FeatureCollection"!==e.type)throw new Error("Invalid input to "+i+", FeatureCollection required");for(var r=0,n=e.features;r<n.length;r++){var a=n[r];if(!a||"Feature"!==a.type||!a.geometry)throw new Error("Invalid input to "+i+", Feature with geometry required");if(!a.geometry||a.geometry.type!==t)throw new Error("Invalid input to "+i+": must be a "+t+", given "+a.geometry.type)}}function Y(e){return"Feature"===e.type?e.geometry:e}function X(e,t){return"FeatureCollection"===e.type?"FeatureCollection":"GeometryCollection"===e.type?"GeometryCollection":"Feature"===e.type&&null!==e.geometry?e.geometry.type:e.type}var D=Object.freeze({__proto__:null,getCoord:Q,getCoords:w,containsNumber:E,geojsonType:T,featureOf:P,collectionOf:M,getGeom:Y,getType:X});function I(e,t,i){if(null!==e)for(var r,n,a,o,s,l,u,c,d=0,h=0,p=e.type,f="FeatureCollection"===p,m="Feature"===p,g=f?e.features.length:1,y=0;y<g;y++){s=(c=!!(u=f?e.features[y].geometry:m?e.geometry:e)&&"GeometryCollection"===u.type)?u.geometries.length:1;for(var v=0;v<s;v++){var _=0,C=0;if(null!==(o=c?u.geometries[v]:u)){l=o.coordinates;var x=o.type;switch(d=!i||"Polygon"!==x&&"MultiPolygon"!==x?0:1,x){case null:break;case"Point":if(!1===t(l,h,y,_,C))return!1;h++,_++;break;case"LineString":case"MultiPoint":for(r=0;r<l.length;r++){if(!1===t(l[r],h,y,_,C))return!1;h++,"MultiPoint"===x&&_++}"LineString"===x&&_++;break;case"Polygon":case"MultiLineString":for(r=0;r<l.length;r++){for(n=0;n<l[r].length-d;n++){if(!1===t(l[r][n],h,y,_,C))return!1;h++}"MultiLineString"===x&&_++,"Polygon"===x&&C++}"Polygon"===x&&_++;break;case"MultiPolygon":for(r=0;r<l.length;r++){for(n=C=0;n<l[r].length;n++){for(a=0;a<l[r][n].length-d;a++){if(!1===t(l[r][n][a],h,y,_,C))return!1;h++}C++}_++}break;case"GeometryCollection":for(r=0;r<o.geometries.length;r++)if(!1===I(o.geometries[r],t,i))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function O(e,a,o,t){var s=o;return I(e,function(e,t,i,r,n){s=0===t&&void 0===o?e:a(s,e,t,i,r,n)},t),s}function R(e,t){var i;switch(e.type){case"FeatureCollection":for(i=0;i<e.features.length&&!1!==t(e.features[i].properties,i);i++);break;case"Feature":t(e.properties,0)}}function L(e,i,r){var n=r;return R(e,function(e,t){n=0===t&&void 0===r?e:i(n,e,t)}),n}function N(e,t){if("Feature"===e.type)t(e,0);else if("FeatureCollection"===e.type)for(var i=0;i<e.features.length&&!1!==t(e.features[i],i);i++);}function k(e,i,r){var n=r;return N(e,function(e,t){n=0===t&&void 0===r?e:i(n,e,t)}),n}function B(e){var t=[];return I(e,function(e){t.push(e)}),t}function F(e,t){var i,r,n,a,o,s,l,u,c,d,h=0,p="FeatureCollection"===e.type,f="Feature"===e.type,m=p?e.features.length:1;for(i=0;i<m;i++){for(s=p?e.features[i].geometry:f?e.geometry:e,u=p?e.features[i].properties:f?e.properties:{},c=p?e.features[i].bbox:f?e.bbox:void 0,d=p?e.features[i].id:f?e.id:void 0,o=(l=!!s&&"GeometryCollection"===s.type)?s.geometries.length:1,n=0;n<o;n++)if(null!==(a=l?s.geometries[n]:s))switch(a.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===t(a,h,u,c,d))return!1;break;case"GeometryCollection":for(r=0;r<a.geometries.length;r++)if(!1===t(a.geometries[r],h,u,c,d))return!1;break;default:throw new Error("Unknown Geometry Type")}else if(!1===t(null,h,u,c,d))return!1;h++}}function z(e,a,o){var s=o;return F(e,function(e,t,i,r,n){s=0===t&&void 0===o?e:a(s,e,t,i,r,n)}),s}function U(e,u){F(e,function(e,t,i,r,n){var a,o=null===e?null:e.type;switch(o){case null:case"Point":case"LineString":case"Polygon":return!1!==u(G(e,i,{bbox:r,id:n}),t,0)&&void 0}switch(o){case"MultiPoint":a="Point";break;case"MultiLineString":a="LineString";break;case"MultiPolygon":a="Polygon"}for(var s=0;s<e.coordinates.length;s++){var l=e.coordinates[s];if(!1===u(G({type:a,coordinates:l},i),t,s))return!1}})}function Z(e,r,n){var a=n;return U(e,function(e,t,i){a=0===t&&0===i&&void 0===n?e:r(a,e,t,i)}),a}function J(e,f){U(e,function(o,s,l){var u=0;if(o.geometry){var e=o.geometry.type;if("Point"!==e&&"MultiPoint"!==e){var c,d=0,h=0,p=0;return!1!==I(o,function(e,t,i,r,n){if(void 0===c||d<s||h<r||p<n)return c=e,d=s,h=r,p=n,void(u=0);var a=H([c,e],o.properties);if(!1===f(a,s,l,n,u))return!1;u++,c=e})&&void 0}}})}function K(e,a,o){var s=o,l=!1;return J(e,function(e,t,i,r,n){s=!1===l&&void 0===o?e:a(s,e,t,i,r,n),l=!0}),s}function ee(e,o){if(!e)throw new Error("geojson is required");U(e,function(e,t,i){if(null!==e.geometry){var r=e.geometry.type,n=e.geometry.coordinates;switch(r){case"LineString":if(!1===o(e,t,i,0,0))return!1;break;case"Polygon":for(var a=0;a<n.length;a++)if(!1===o(H(n[a],e.properties),t,i,a))return!1}}})}function te(e,n,a){var o=a;return ee(e,function(e,t,i,r){o=0===t&&void 0===a?e:n(o,e,t,i,r)}),o}function ie(e,t){if(!q(t=t||{}))throw new Error("options is invalid");var i,r=t.featureIndex||0,n=t.multiFeatureIndex||0,a=t.geometryIndex||0,o=t.segmentIndex||0,s=t.properties;switch(e.type){case"FeatureCollection":r<0&&(r=e.features.length+r),s=s||e.features[r].properties,i=e.features[r].geometry;break;case"Feature":s=s||e.properties,i=e.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":i=e;break;default:throw new Error("geojson is invalid")}if(null===i)return null;var l=i.coordinates;switch(i.type){case"Point":case"MultiPoint":return null;case"LineString":return o<0&&(o=l.length+o-1),H([l[o],l[o+1]],s,t);case"Polygon":return a<0&&(a=l.length+a),o<0&&(o=l[a].length+o-1),H([l[a][o],l[a][o+1]],s,t);case"MultiLineString":return n<0&&(n=l.length+n),o<0&&(o=l[n].length+o-1),H([l[n][o],l[n][o+1]],s,t);case"MultiPolygon":return n<0&&(n=l.length+n),a<0&&(a=l[n].length+a),o<0&&(o=l[n][a].length-o-1),H([l[n][a][o],l[n][a][o+1]],s,t)}throw new Error("geojson is invalid")}function re(e,t){if(!q(t=t||{}))throw new Error("options is invalid");var i,r=t.featureIndex||0,n=t.multiFeatureIndex||0,a=t.geometryIndex||0,o=t.coordIndex||0,s=t.properties;switch(e.type){case"FeatureCollection":r<0&&(r=e.features.length+r),s=s||e.features[r].properties,i=e.features[r].geometry;break;case"Feature":s=s||e.properties,i=e.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":i=e;break;default:throw new Error("geojson is invalid")}if(null===i)return null;var l=i.coordinates;switch(i.type){case"Point":return $(l,s,t);case"MultiPoint":return n<0&&(n=l.length+n),$(l[n],s,t);case"LineString":return o<0&&(o=l.length+o),$(l[o],s,t);case"Polygon":return a<0&&(a=l.length+a),o<0&&(o=l[a].length+o),$(l[a][o],s,t);case"MultiLineString":return n<0&&(n=l.length+n),o<0&&(o=l[n].length+o),$(l[n][o],s,t);case"MultiPolygon":return n<0&&(n=l.length+n),a<0&&(a=l[n].length+a),o<0&&(o=l[n][a].length-o),$(l[n][a][o],s,t)}throw new Error("geojson is invalid")}var ne=Object.freeze({__proto__:null,coordEach:I,coordReduce:O,propEach:R,propReduce:L,featureEach:N,featureReduce:k,coordAll:B,geomEach:F,geomReduce:z,flattenEach:U,flattenReduce:Z,segmentEach:J,segmentReduce:K,lineEach:ee,lineReduce:te,findSegment:ie,findPoint:re});function ae(e){var t=[1/0,1/0,-1/0,-1/0];return I(e,function(e){t[0]>e[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]<e[0]&&(t[2]=e[0]),t[3]<e[1]&&(t[3]=e[1])}),t}ae.default=ae;var oe=Object.getOwnPropertySymbols,se=Object.prototype.hasOwnProperty,le=Object.prototype.propertyIsEnumerable;var ue=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},i=0;i<10;i++)t["_"+String.fromCharCode(i)]=i;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var i,r,n=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),a=1;a<arguments.length;a++){for(var o in i=Object(arguments[a]))se.call(i,o)&&(n[o]=i[o]);if(oe){r=oe(i);for(var s=0;s<r.length;s++)le.call(i,r[s])&&(n[r[s]]=i[r[s]])}}return n},ce={successCallback:null,verbose:!1},de={};function he(e,t,i){i=i||{};for(var r=Object.keys(ce),n=0;n<r.length;n++){var a=r[n],o=i[a];o=null!=o?o:ce[a],de[a]=o}de.verbose&&console.log("MarchingSquaresJS-isoContours: computing isocontour for "+t);var s=function(c){var d=[],h=0;return c.cells.forEach(function(e,u){e.forEach(function(e,t){if(void 0!==e&&5!==(l=e).cval&&10!==l.cval&&!fe(e)){var i=function(e,t,i){var r,n,a=e.length,o=[],s=[0,0,1,1,0,0,0,0,-1,0,1,1,-1,0,-1,0],l=[0,-1,0,0,1,1,1,1,0,-1,0,0,0,-1,0,0],u=["none","bottom","right","right","top","top","top","top","left","bottom","right","right","left","bottom","left","none"],c=e[t][i],d=c.cval,h=["none","left","bottom","left","right","none","bottom","left","top","top","none","top","right","right","bottom","none"][d],p=ge(c,h);o.push([i+p[0],t+p[1]]),p=ge(c,h=u[d]),o.push([i+p[0],t+p[1]]),me(c);for(var f=i+s[d],m=t+l[d],g=d;0<=f&&0<=m&&m<a&&(f!=i||m!=t)&&void 0!==(c=e[m][f]);){if(0===(d=c.cval)||15===d)return{path:o,info:"mergeable"};h=u[d],r=s[d],n=l[d],5!==d&&10!==d||(5===d?c.flipped?n=(r=-1===l[g]?(h="left",-1):(h="right",1),0):-1===s[g]&&(h="bottom",r=0,n=-1):10===d&&(c.flipped?n=-1===s[g]?(h="top",r=0,1):(h="bottom",r=0,-1):1===l[g]&&(h="left",r=-1,n=0))),p=ge(c,h),o.push([f+p[0],m+p[1]]),me(c),f+=r,m+=n,g=d}return{path:o,info:"closed"}}(c.cells,u,t),r=!1;if("mergeable"===i.info)for(var n=i.path[i.path.length-1][0],a=i.path[i.path.length-1][1],o=h-1;0<=o;o--)if(Math.abs(d[o][0][0]-n)<=1e-7&&Math.abs(d[o][0][1]-a)<=1e-7){for(var s=i.path.length-2;0<=s;--s)d[o].unshift(i.path[s]);r=!0;break}r||(d[h++]=i.path)}var l})}),d}(function(e,t){for(var i=e.length-1,r=e[0].length-1,n={rows:i,cols:r,cells:[]},a=0;a<i;++a){n.cells[a]=[];for(var o=0;o<r;++o){var s=0,l=e[a+1][o],u=e[a+1][o+1],c=e[a][o+1],d=e[a][o];if(!(isNaN(l)||isNaN(u)||isNaN(c)||isNaN(d))){s|=t<=l?8:0,s|=t<=u?4:0,s|=t<=c?2:0;var h,p,f,m,g=!1;if(5==(s|=t<=d?1:0)||10===s){var y=(l+u+c+d)/4;5===s&&y<t?(s=10,g=!0):10===s&&y<t&&(s=5,g=!0)}0!==s&&15!==s&&(h=p=f=m=.5,1===s?(f=1-pe(t,l,d),p=1-pe(t,c,d)):2===s?(p=pe(t,d,c),m=1-pe(t,u,c)):3===s?(f=1-pe(t,l,d),m=1-pe(t,u,c)):4===s?(h=pe(t,l,u),m=pe(t,c,u)):5===s?(h=pe(t,l,u),m=pe(t,c,u),p=1-pe(t,c,d),f=1-pe(t,l,d)):6===s?(p=pe(t,d,c),h=pe(t,l,u)):7===s?(f=1-pe(t,l,d),h=pe(t,l,u)):8===s?(f=pe(t,d,l),h=1-pe(t,u,l)):9===s?(p=1-pe(t,c,d),h=1-pe(t,u,l)):10===s?(h=1-pe(t,u,l),m=1-pe(t,u,c),p=pe(t,d,c),f=pe(t,d,l)):11===s?(h=1-pe(t,u,l),m=1-pe(t,u,c)):12===s?(f=pe(t,d,l),m=pe(t,c,u)):13===s?(p=1-pe(t,c,d),m=pe(t,c,u)):14===s?(f=pe(t,d,l),p=pe(t,d,c)):console.log("MarchingSquaresJS-isoContours: Illegal cval detected: "+s),n.cells[a][o]={cval:s,flipped:g,top:h,right:m,bottom:p,left:f})}}}return n}(e,t));return"function"==typeof de.successCallback&&de.successCallback(s),s}function pe(e,t,i){return(e-t)/(i-t)}function fe(e){return 0===e.cval||15===e.cval}function me(e){fe(e)||5===e.cval||10===e.cval||(e.cval=15)}function ge(e,t){return"top"===t?[e.top,1]:"bottom"===t?[e.bottom,0]:"right"===t?[1,e.right]:"left"===t?[0,e.left]:void 0}var ye=_e,ve=_e;function _e(e,t,i,r,n){!function e(t,i,r,n,a){for(;r<n;){if(600<n-r){var o=n-r+1,s=i-r+1,l=Math.log(o),u=.5*Math.exp(2*l/3),c=.5*Math.sqrt(l*u*(o-u)/o)*(s-o/2<0?-1:1);e(t,i,Math.max(r,Math.floor(i-s*u/o+c)),Math.min(n,Math.floor(i+(o-s)*u/o+c)),a)}var d=t[i],h=r,p=n;for(Ce(t,r,i),0<a(t[n],d)&&Ce(t,r,n);h<p;){for(Ce(t,h,p),h++,p--;a(t[h],d)<0;)h++;for(;0<a(t[p],d);)p--}0===a(t[r],d)?Ce(t,r,p):Ce(t,++p,n),p<=i&&(r=p+1),i<=p&&(n=p-1)}}(e,t,i||0,r||e.length-1,n||xe)}function Ce(e,t,i){var r=e[t];e[t]=e[i],e[i]=r}function xe(e,t){return e<t?-1:t<e?1:0}ye.default=ve;var be=Se,Ae=Se;function Se(e,t){if(!(this instanceof Se))return new Se(e,t);this._maxEntries=Math.max(4,e||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),t&&this._initFormat(t),this.clear()}function we(e,t,i){if(!i)return t.indexOf(e);for(var r=0;r<t.length;r++)if(i(e,t[r]))return r;return-1}function Ee(e,t){Te(e,0,e.children.length,t,e)}function Te(e,t,i,r,n){(n=n||Ne(null)).minX=1/0,n.minY=1/0,n.maxX=-1/0,n.maxY=-1/0;for(var a,o=t;o<i;o++)a=e.children[o],Pe(n,e.leaf?r(a):a);return n}function Pe(e,t){return e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),e}function Me(e,t){return e.minX-t.minX}function De(e,t){return e.minY-t.minY}function Ie(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function Oe(e){return e.maxX-e.minX+(e.maxY-e.minY)}function Re(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function Le(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function Ne(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function ke(e,t,i,r,n){for(var a,o=[t,i];o.length;)(i=o.pop())-(t=o.pop())<=r||(a=t+Math.ceil((i-t)/r/2)*r,ye(e,a,t,i,n),o.push(t,a,a,i))}function Be(e){var t={exports:{}};return e(t,t.exports),t.exports}Se.prototype={all:function(){return this._all(this.data,[])},search:function(e){var t=this.data,i=[],r=this.toBBox;if(!Le(e,t))return i;for(var n,a,o,s,l=[];t;){for(n=0,a=t.children.length;n<a;n++)o=t.children[n],Le(e,s=t.leaf?r(o):o)&&(t.leaf?i.push(o):Re(e,s)?this._all(o,i):l.push(o));t=l.pop()}return i},collides:function(e){var t=this.data,i=this.toBBox;if(!Le(e,t))return!1;for(var r,n,a,o,s=[];t;){for(r=0,n=t.children.length;r<n;r++)if(a=t.children[r],Le(e,o=t.leaf?i(a):a)){if(t.leaf||Re(e,o))return!0;s.push(a)}t=s.pop()}return!1},load:function(e){if(!e||!e.length)return this;if(e.length<this._minEntries){for(var t=0,i=e.length;t<i;t++)this.insert(e[t]);return this}var r=this._build(e.slice(),0,e.length-1,0);if(this.data.children.length)if(this.data.height===r.height)this._splitRoot(this.data,r);else{if(this.data.height<r.height){var n=this.data;this.data=r,r=n}this._insert(r,this.data.height-r.height-1,!0)}else this.data=r;return this},insert:function(e){return e&&this._insert(e,this.data.height-1),this},clear:function(){return this.data=Ne([]),this},remove:function(e,t){if(!e)return this;for(var i,r,n,a,o=this.data,s=this.toBBox(e),l=[],u=[];o||l.length;){if(o||(o=l.pop(),r=l[l.length-1],i=u.pop(),a=!0),o.leaf&&-1!==(n=we(e,o.children,t)))return o.children.splice(n,1),l.push(o),this._condense(l),this;a||o.leaf||!Re(o,s)?r?(i++,o=r.children[i],a=!1):o=null:(l.push(o),u.push(i),i=0,o=(r=o).children[0])}return this},toBBox:function(e){return e},compareMinX:Me,compareMinY:De,toJSON:function(){return this.data},fromJSON:function(e){return this.data=e,this},_all:function(e,t){for(var i=[];e;)e.leaf?t.push.apply(t,e.children):i.push.apply(i,e.children),e=i.pop();return t},_build:function(e,t,i,r){var n,a=i-t+1,o=this._maxEntries;if(a<=o)return Ee(n=Ne(e.slice(t,i+1)),this.toBBox),n;r||(r=Math.ceil(Math.log(a)/Math.log(o)),o=Math.ceil(a/Math.pow(o,r-1))),(n=Ne([])).leaf=!1,n.height=r;var s,l,u,c,d=Math.ceil(a/o),h=d*Math.ceil(Math.sqrt(o));for(ke(e,t,i,h,this.compareMinX),s=t;s<=i;s+=h)for(ke(e,s,u=Math.min(s+h-1,i),d,this.compareMinY),l=s;l<=u;l+=d)c=Math.min(l+d-1,u),n.children.push(this._build(e,l,c,r-1));return Ee(n,this.toBBox),n},_chooseSubtree:function(e,t,i,r){for(var n,a,o,s,l,u,c,d,h,p;r.push(t),!t.leaf&&r.length-1!==i;){for(c=d=1/0,n=0,a=t.children.length;n<a;n++)l=Ie(o=t.children[n]),h=e,p=o,(u=(Math.max(p.maxX,h.maxX)-Math.min(p.minX,h.minX))*(Math.max(p.maxY,h.maxY)-Math.min(p.minY,h.minY))-l)<d?(d=u,c=l<c?l:c,s=o):u===d&&l<c&&(c=l,s=o);t=s||t.children[0]}return t},_insert:function(e,t,i){var r=this.toBBox,n=i?e:r(e),a=[],o=this._chooseSubtree(n,this.data,t,a);for(o.children.push(e),Pe(o,n);0<=t&&a[t].children.length>this._maxEntries;)this._split(a,t),t--;this._adjustParentBBoxes(n,a,t)},_split:function(e,t){var i=e[t],r=i.children.length,n=this._minEntries;this._chooseSplitAxis(i,n,r);var a=this._chooseSplitIndex(i,n,r),o=Ne(i.children.splice(a,i.children.length-a));o.height=i.height,o.leaf=i.leaf,Ee(i,this.toBBox),Ee(o,this.toBBox),t?e[t-1].children.push(o):this._splitRoot(i,o)},_splitRoot:function(e,t){this.data=Ne([e,t]),this.data.height=e.height+1,this.data.leaf=!1,Ee(this.data,this.toBBox)},_chooseSplitIndex:function(e,t,i){var r,n,a,o,s,l,u,c,d,h,p,f,m,g;for(l=u=1/0,r=t;r<=i-t;r++)n=Te(e,0,r,this.toBBox),a=Te(e,r,i,this.toBBox),d=n,h=a,g=m=f=p=void 0,p=Math.max(d.minX,h.minX),f=Math.max(d.minY,h.minY),m=Math.min(d.maxX,h.maxX),g=Math.min(d.maxY,h.maxY),o=Math.max(0,m-p)*Math.max(0,g-f),s=Ie(n)+Ie(a),o<l?(l=o,c=r,u=s<u?s:u):o===l&&s<u&&(u=s,c=r);return c},_chooseSplitAxis:function(e,t,i){var r=e.leaf?this.compareMinX:Me,n=e.leaf?this.compareMinY:De;this._allDistMargin(e,t,i,r)<this._allDistMargin(e,t,i,n)&&e.children.sort(r)},_allDistMargin:function(e,t,i,r){e.children.sort(r);var n,a,o=this.toBBox,s=Te(e,0,t,o),l=Te(e,i-t,i,o),u=Oe(s)+Oe(l);for(n=t;n<i-t;n++)a=e.children[n],Pe(s,e.leaf?o(a):a),u+=Oe(s);for(n=i-t-1;t<=n;n--)a=e.children[n],Pe(l,e.leaf?o(a):a),u+=Oe(l);return u},_adjustParentBBoxes:function(e,t,i){for(var r=i;0<=r;r--)Pe(t[r],e)},_condense:function(e){for(var t,i=e.length-1;0<=i;i--)0===e[i].children.length?0<i?(t=e[i-1].children).splice(t.indexOf(e[i]),1):this.clear():Ee(e[i],this.toBBox)},_initFormat:function(e){var t=["return a"," - b",";"];this.compareMinX=new Function("a","b",t.join(e[0])),this.compareMinY=new Function("a","b",t.join(e[1])),this.toBBox=new Function("a","return {minX: a"+e[0]+", minY: a"+e[1]+", maxX: a"+e[2]+", maxY: a"+e[3]+"};")}},be.default=Ae;var Fe=function(e,t,i){var r=e*t,n=Ve*e,a=n-(n-e),o=e-a,s=Ve*t,l=s-(s-t),u=t-l,c=o*u-(r-a*l-o*l-a*u);return i?(i[0]=c,i[1]=r,i):[c,r]},Ve=+(Math.pow(2,27)+1),ze=function(e,t){var i=0|e.length,r=0|t.length;if(1==i&&1==r)return function(e,t){var i=e+t,r=i-e,n=e-(i-r)+(t-r);return n?[n,i]:[i]}(e[0],t[0]);var n,a,o=new Array(i+r),s=0,l=0,u=0,c=Math.abs,d=e[l],h=c(d),p=t[u],f=c(p);h<f?(a=d,(l+=1)<i&&(d=e[l],h=c(d))):(a=p,(u+=1)<r&&(p=t[u],f=c(p))),l<i&&h<f||r<=u?(n=d,(l+=1)<i&&(d=e[l],h=c(d))):(n=p,(u+=1)<r&&(p=t[u],f=c(p)));for(var m,g,y=n+a,v=y-n,_=a-v,C=_,x=y;l<i&&u<r;)h<f?(n=d,(l+=1)<i&&(d=e[l],h=c(d))):(n=p,(u+=1)<r&&(p=t[u],f=c(p))),(_=(a=C)-(v=(y=n+a)-n))&&(o[s++]=_),C=x-((m=x+y)-(g=m-x))+(y-g),x=m;for(;l<i;)(_=(a=C)-(v=(y=(n=d)+a)-n))&&(o[s++]=_),C=x-((m=x+y)-(g=m-x))+(y-g),x=m,(l+=1)<i&&(d=e[l]);for(;u<r;)(_=(a=C)-(v=(y=(n=p)+a)-n))&&(o[s++]=_),C=x-((m=x+y)-(g=m-x))+(y-g),x=m,(u+=1)<r&&(p=t[u]);return C&&(o[s++]=C),x&&(o[s++]=x),s||(o[s++]=0),o.length=s,o},Ue=function(e,t,i){var r=e+t,n=r-e,a=t-n,o=e-(r-n);return i?(i[0]=o+a,i[1]=r,i):[o+a,r]},Ge=function(e,t){var i=e.length;if(1===i){var r=Fe(e[0],t);return r[0]?r:[r[1]]}var n=new Array(2*i),a=[.1,.1],o=[.1,.1],s=0;Fe(e[0],t,a),a[0]&&(n[s++]=a[0]);for(var l=1;l<i;++l){Fe(e[l],t,o);var u=a[1];Ue(u,o[0],a),a[0]&&(n[s++]=a[0]);var c=o[1],d=a[1],h=c+d,p=d-(h-c);a[1]=h,p&&(n[s++]=p)}return a[1]&&(n[s++]=a[1]),0===s&&(n[s++]=0),n.length=s,n},$e=function(e,t){var i=0|e.length,r=0|t.length;if(1==i&&1==r)return function(e,t){var i=e+t,r=i-e,n=e-(i-r)+(t-r);return n?[n,i]:[i]}(e[0],-t[0]);var n,a,o=new Array(i+r),s=0,l=0,u=0,c=Math.abs,d=e[l],h=c(d),p=-t[u],f=c(p);h<f?(a=d,(l+=1)<i&&(d=e[l],h=c(d))):(a=p,(u+=1)<r&&(p=-t[u],f=c(p))),l<i&&h<f||r<=u?(n=d,(l+=1)<i&&(d=e[l],h=c(d))):(n=p,(u+=1)<r&&(p=-t[u],f=c(p)));for(var m,g,y=n+a,v=y-n,_=a-v,C=_,x=y;l<i&&u<r;)h<f?(n=d,(l+=1)<i&&(d=e[l],h=c(d))):(n=p,(u+=1)<r&&(p=-t[u],f=c(p))),(_=(a=C)-(v=(y=n+a)-n))&&(o[s++]=_),C=x-((m=x+y)-(g=m-x))+(y-g),x=m;for(;l<i;)(_=(a=C)-(v=(y=(n=d)+a)-n))&&(o[s++]=_),C=x-((m=x+y)-(g=m-x))+(y-g),x=m,(l+=1)<i&&(d=e[l]);for(;u<r;)(_=(a=C)-(v=(y=(n=p)+a)-n))&&(o[s++]=_),C=x-((m=x+y)-(g=m-x))+(y-g),x=m,(u+=1)<r&&(p=-t[u]);return C&&(o[s++]=C),x&&(o[s++]=x),s||(o[s++]=0),o.length=s,o},He=Be(function(a){function c(e,t){for(var i=new Array(e.length-1),r=1;r<e.length;++r)for(var n=i[r-1]=new Array(e.length-1),a=0,o=0;a<e.length;++a)a!==t&&(n[o++]=e[r][a]);return i}function d(e){if(1===e.length)return e[0];if(2===e.length)return["sum(",e[0],",",e[1],")"].join("");var t=e.length>>1;return["sum(",d(e.slice(0,t)),",",d(e.slice(t)),")"].join("")}function h(e){if(2===e.length)return[["sum(prod(",e[0][0],",",e[1][1],"),prod(-",e[0][1],",",e[1][0],"))"].join("")];for(var t=[],i=0;i<e.length;++i)t.push(["scale(",d(h(c(e,i))),",",(r=i,1&r?"-":""),e[0][i],")"].join(""));return t;var r}function o(e){for(var t=[],i=[],r=function(e){for(var t=new Array(e),i=0;i<e;++i){t[i]=new Array(e);for(var r=0;r<e;++r)t[i][r]=["m",r,"[",e-i-1,"]"].join("")}return t}(e),n=[],a=0;a<e;++a)0==(1&a)?t.push.apply(t,h(c(r,a))):i.push.apply(i,h(c(r,a))),n.push("m"+a);var o=d(t),s=d(i),l="orientation"+e+"Exact",u=["function ",l,"(",n.join(),"){var p=",o,",n=",s,",d=sub(p,n);return d[d.length-1];};return ",l].join("");return new Function("sum","prod","scale","sub",u)(ze,Fe,Ge,$e)}var l=o(3),x=o(4),s=[function(){return 0},function(){return 0},function(e,t){return t[0]-e[0]},function(e,t,i){var r,n=(e[1]-i[1])*(t[0]-i[0]),a=(e[0]-i[0])*(t[1]-i[1]),o=n-a;if(0<n){if(a<=0)return o;r=n+a}else{if(!(n<0))return o;if(0<=a)return o;r=-(n+a)}var s=33306690738754716e-32*r;return s<=o||o<=-s?o:l(e,t,i)},function(e,t,i,r){var n=e[0]-r[0],a=t[0]-r[0],o=i[0]-r[0],s=e[1]-r[1],l=t[1]-r[1],u=i[1]-r[1],c=e[2]-r[2],d=t[2]-r[2],h=i[2]-r[2],p=a*u,f=o*l,m=o*s,g=n*u,y=n*l,v=a*s,_=c*(p-f)+d*(m-g)+h*(y-v),C=7771561172376103e-31*((Math.abs(p)+Math.abs(f))*Math.abs(c)+(Math.abs(m)+Math.abs(g))*Math.abs(d)+(Math.abs(y)+Math.abs(v))*Math.abs(h));return C<_||C<-_?_:x(e,t,i,r)}];!function(){for(;s.length<=5;)s.push(o(s.length));for(var e=[],t=["slow"],i=0;i<=5;++i)e.push("a"+i),t.push("o"+i);var r=["function getOrientation(",e.join(),"){switch(arguments.length){case 0:case 1:return 0;"];for(i=2;i<=5;++i)r.push("case ",i,":return o",i,"(",e.slice(0,i).join(),");");r.push("}var s=new Array(arguments.length);for(var i=0;i<arguments.length;++i){s[i]=arguments[i]};return slow(s);}return getOrientation"),t.push(r.join(""));var n=Function.apply(void 0,t);for(a.exports=n.apply(void 0,[function(e){var t=s[e.length];return t=t||(s[e.length]=o(e.length)),t.apply(void 0,e)}].concat(s)),i=0;i<=5;++i)a.exports[i]=s[i]}()}),We=He[3],je=Qe,qe=Qe;function Qe(e,t){if(!(this instanceof Qe))return new Qe(e,t);if(this.data=e||[],this.length=this.data.length,this.compare=t||Ye,0<this.length)for(var i=(this.length>>1)-1;0<=i;i--)this._down(i)}function Ye(e,t){return e<t?-1:t<e?1:0}Qe.prototype={push:function(e){this.data.push(e),this.length++,this._up(this.length-1)},pop:function(){if(0!==this.length){var e=this.data[0];return this.length--,0<this.length&&(this.data[0]=this.data[this.length],this._down(0)),this.data.pop(),e}},peek:function(){return this.data[0]},_up:function(e){for(var t=this.data,i=this.compare,r=t[e];0<e;){var n=e-1>>1,a=t[n];if(0<=i(r,a))break;t[e]=a,e=n}t[e]=r},_down:function(e){for(var t=this.data,i=this.compare,r=this.length>>1,n=t[e];e<r;){var a=1+(e<<1),o=a+1,s=t[a];if(o<this.length&&i(t[o],s)<0&&(s=t[a=o]),0<=i(s,n))break;t[e]=s,e=a}t[e]=n}},je.default=qe;var Xe=function(e,t){for(var i=e[0],r=e[1],n=!1,a=0,o=t.length-1;a<t.length;o=a++){var s=t[a][0],l=t[a][1],u=t[o][0],c=t[o][1];r<l!=r<c&&i<(u-s)*(r-l)/(c-l)+s&&(n=!n)}return n},Ze=He[3],Je=et,Ke=et;function et(e,t,i){t=Math.max(0,void 0===t?2:t),i=i||0;for(var r,n=function(e){for(var t=e[0],i=e[0],r=e[0],n=e[0],a=0;a<e.length;a++){var o=e[a];o[0]<t[0]&&(t=o),o[0]>r[0]&&(r=o),o[1]<i[1]&&(i=o),o[1]>n[1]&&(n=o)}var s=[t,i,r,n],l=s.slice();for(a=0;a<e.length;a++)Xe(e[a],s)||l.push(e[a]);var u=function(r){var e=r.length;if(e<3){for(var t=new Array(e),i=0;i<e;++i)t[i]=i;return 2===e&&r[0][0]===r[1][0]&&r[0][1]===r[1][1]?[0]:t}var n=new Array(e);for(i=0;i<e;++i)n[i]=i;n.sort(function(e,t){var i=r[e][0]-r[t][0];return i||r[e][1]-r[t][1]});var a=[n[0],n[1]],o=[n[0],n[1]];for(i=2;i<e;++i){for(var s=n[i],l=r[s],u=a.length;u>1&&We(r[a[u-2]],r[a[u-1]],l)<=0;)u-=1,a.pop();for(a.push(s),u=o.length;u>1&&We(r[o[u-2]],r[o[u-1]],l)>=0;)u-=1,o.pop();o.push(s)}t=new Array(o.length+a.length-2);for(var c=0,d=(i=0,a.length);i<d;++i)t[c++]=a[i];for(var h=o.length-2;h>0;--h)t[c++]=o[h];return t}(l),c=[];for(a=0;a<u.length;a++)c.push(l[u[a]]);return c}(e),a=be(16,["[0]","[1]","[0]","[1]"]).load(e),o=[],s=0;s<n.length;s++){var l=n[s];a.remove(l),r=st(l,r),o.push(r)}var u=be(16);for(s=0;s<o.length;s++)u.insert(ot(o[s]));for(var c=t*t,d=i*i;o.length;){var h=o.shift(),p=h.p,f=h.next.p,m=lt(p,f);if(!(m<d)){var g=m/c;(l=tt(a,h.prev.p,p,f,h.next.next.p,g,u))&&Math.min(lt(l,p),lt(l,f))<=g&&(o.push(h),o.push(st(l,h)),a.remove(l),u.remove(h),u.insert(ot(h)),u.insert(ot(h.next)))}}h=r;for(var y=[];y.push(h.p),(h=h.next)!==r;);return y.push(h.p),y}function tt(e,t,i,r,n,a,o){for(var s=new je(null,it),l=e.data;l;){for(var u=0;u<l.children.length;u++){var c=l.children[u],d=l.leaf?ut(c,i,r):rt(i,r,c);a<d||s.push({node:c,dist:d})}for(;s.length&&!s.peek().node.children;){var h=s.pop(),p=h.node,f=ut(p,t,i),m=ut(p,r,n);if(h.dist<f&&h.dist<m&&at(i,p,o)&&at(r,p,o))return p}(l=s.pop())&&(l=l.node)}return null}function it(e,t){return e.dist-t.dist}function rt(e,t,i){if(nt(e,i)||nt(t,i))return 0;var r=ct(e[0],e[1],t[0],t[1],i.minX,i.minY,i.maxX,i.minY);if(0===r)return 0;var n=ct(e[0],e[1],t[0],t[1],i.minX,i.minY,i.minX,i.maxY);if(0===n)return 0;var a=ct(e[0],e[1],t[0],t[1],i.maxX,i.minY,i.maxX,i.maxY);if(0===a)return 0;var o=ct(e[0],e[1],t[0],t[1],i.minX,i.maxY,i.maxX,i.maxY);return 0===o?0:Math.min(r,n,a,o)}function nt(e,t){return e[0]>=t.minX&&e[0]<=t.maxX&&e[1]>=t.minY&&e[1]<=t.maxY}function at(e,t,i){for(var r,n,a,o,s=Math.min(e[0],t[0]),l=Math.min(e[1],t[1]),u=Math.max(e[0],t[0]),c=Math.max(e[1],t[1]),d=i.search({minX:s,minY:l,maxX:u,maxY:c}),h=0;h<d.length;h++)if(r=d[h].p,n=d[h].next.p,a=e,r!==(o=t)&&n!==a&&0<Ze(r,n,a)!=0<Ze(r,n,o)&&0<Ze(a,o,r)!=0<Ze(a,o,n))return!1;return!0}function ot(e){var t=e.p,i=e.next.p;return e.minX=Math.min(t[0],i[0]),e.minY=Math.min(t[1],i[1]),e.maxX=Math.max(t[0],i[0]),e.maxY=Math.max(t[1],i[1]),e}function st(e,t){var i={p:e,prev:null,next:null,minX:0,minY:0,maxX:0,maxY:0};return t?(i.next=t.next,(i.prev=t).next.prev=i,t.next=i):(i.prev=i).next=i,i}function lt(e,t){var i=e[0]-t[0],r=e[1]-t[1];return i*i+r*r}function ut(e,t,i){var r=t[0],n=t[1],a=i[0]-r,o=i[1]-n;if(0!==a||0!==o){var s=((e[0]-r)*a+(e[1]-n)*o)/(a*a+o*o);1<s?(r=i[0],n=i[1]):0<s&&(r+=a*s,n+=o*s)}return(a=e[0]-r)*a+(o=e[1]-n)*o}function ct(e,t,i,r,n,a,o,s){var l,u,c,d,h=i-e,p=r-t,f=o-n,m=s-a,g=e-n,y=t-a,v=h*h+p*p,_=h*f+p*m,C=f*f+m*m,x=h*g+p*y,b=f*g+m*y,A=v*C-_*_,S=A,w=A;0==A?(u=0,S=1,d=b,w=C):(d=v*b-_*x,(u=_*b-C*x)<0?(u=0,d=b,w=C):S<u&&(u=S,d=b+_,w=C)),d<0?-x<(d=0)?u=0:v<-x?u=S:(u=-x,S=v):w<d&&(d=w,_-x<0?u=0:v<_-x?u=S:(u=_-x,S=v));var E=(1-(c=0===d?0:d/w))*n+c*o-((1-(l=0===u?0:u/S))*e+l*i),T=(1-c)*a+c*s-((1-l)*t+l*r);return E*E+T*T}function dt(e,t){void 0===t&&(t={}),t.concavity=t.concavity||1/0;var i=[];if(I(e,function(e){i.push([e[0],e[1]])}),!i.length)return null;var r=Je(i,t.concavity);return 3<r.length?V([r]):null}function ht(e,t,i){if(void 0===i&&(i={}),!e)throw new Error("point is required");if(!t)throw new Error("polygon is required");var r=Q(e),n=Y(t),a=n.type,o=t.bbox,s=n.coordinates;if(o&&!1===function(e,t){return t[0]<=e[0]&&t[1]<=e[1]&&t[2]>=e[0]&&t[3]>=e[1]}(r,o))return!1;"Polygon"===a&&(s=[s]);for(var l=!1,u=0;u<s.length&&!l;u++)if(pt(r,s[u][0],i.ignoreBoundary)){for(var c=!1,d=1;d<s[u].length&&!c;)pt(r,s[u][d],!i.ignoreBoundary)&&(c=!0),d++;c||(l=!0)}return l}function pt(e,t,i){var r=!1;t[0][0]===t[t.length-1][0]&&t[0][1]===t[t.length-1][1]&&(t=t.slice(0,t.length-1));for(var n=0,a=t.length-1;n<t.length;a=n++){var o=t[n][0],s=t[n][1],l=t[a][0],u=t[a][1];if(e[1]*(o-l)+s*(l-e[0])+u*(e[0]-o)==0&&(o-e[0])*(l-e[0])<=0&&(s-e[1])*(u-e[1])<=0)return!i;s>e[1]!=u>e[1]&&e[0]<(l-o)*(e[1]-s)/(u-s)+o&&(r=!r)}return r}function ft(e,r){var n=[];return N(e,function(t){var i=!1;F(r,function(e){ht(t,e)&&(i=!0)}),i&&n.push(t)}),W(n)}function mt(e,t,i){void 0===i&&(i={});var r=Q(e),n=Q(t),a=_(n[1]-r[1]),o=_(n[0]-r[0]),s=_(r[1]),l=_(n[1]),u=Math.pow(Math.sin(a/2),2)+Math.pow(Math.sin(o/2),2)*Math.cos(s)*Math.cos(l);return f(2*Math.atan2(Math.sqrt(u),Math.sqrt(1-u)),i.units)}function gt(e,i){var a=!1;return W(function(e){if(e.length<3)return[];e.sort(vt);for(var t,i,r,n,a,o,s=e.length-1,l=e[s].x,u=e[0].x,c=e[s].y,d=c;s--;)e[s].y<c&&(c=e[s].y),e[s].y>d&&(d=e[s].y);var h,p=u-l,f=d-c,m=f<p?p:f,g=.5*(u+l),y=.5*(d+c),v=[new yt({__sentinel:!0,x:g-20*m,y:y-m},{__sentinel:!0,x:g,y:y+20*m},{__sentinel:!0,x:g+20*m,y:y-m})],_=[],C=[];for(s=e.length;s--;){for(C.length=0,h=v.length;h--;)0<(p=e[s].x-v[h].x)&&p*p>v[h].r?(_.push(v[h]),v.splice(h,1)):p*p+(f=e[s].y-v[h].y)*f>v[h].r||(C.push(v[h].a,v[h].b,v[h].b,v[h].c,v[h].c,v[h].a),v.splice(h,1));for(_t(C),h=C.length;h;)i=C[--h],t=C[--h],r=e[s],n=i.x-t.x,a=i.y-t.y,o=2*(n*(r.y-i.y)-a*(r.x-i.x)),1e-12<Math.abs(o)&&v.push(new yt(t,i,r))}for(Array.prototype.push.apply(_,v),s=_.length;s--;)(_[s].a.__sentinel||_[s].b.__sentinel||_[s].c.__sentinel)&&_.splice(s,1);return _}(e.features.map(function(e){var t={x:e.geometry.coordinates[0],y:e.geometry.coordinates[1]};return i?t.z=e.properties[i]:3===e.geometry.coordinates.length&&(a=!0,t.z=e.geometry.coordinates[2]),t})).map(function(e){var t=[e.a.x,e.a.y],i=[e.b.x,e.b.y],r=[e.c.x,e.c.y],n={};return a?(t.push(e.a.z),i.push(e.b.z),r.push(e.c.z)):n={a:e.a.z,b:e.b.z,c:e.c.z},V([[t,i,r,t]],n)}))}Je.default=Ke;var yt=function(e,t,i){this.a=e,this.b=t,this.c=i;var r,n,a=t.x-e.x,o=t.y-e.y,s=i.x-e.x,l=i.y-e.y,u=a*(e.x+t.x)+o*(e.y+t.y),c=s*(e.x+i.x)+l*(e.y+i.y),d=2*(a*(i.y-t.y)-o*(i.x-t.x));this.x=(l*u-o*c)/d,this.y=(a*c-s*u)/d,r=this.x-e.x,n=this.y-e.y,this.r=r*r+n*n};function vt(e,t){return t.x-e.x}function _t(e){var t,i,r,n,a,o=e.length;e:for(;o;)for(i=e[--o],t=e[--o],r=o;r;)if(a=e[--r],t===(n=e[--r])&&i===a||t===a&&i===n){e.splice(o,2),e.splice(r,2),o-=2;continue e}}function Ct(e){if(!e)throw new Error("geojson is required");switch(e.type){case"Feature":return xt(e);case"FeatureCollection":return function(t){var i={type:"FeatureCollection"};return Object.keys(t).forEach(function(e){switch(e){case"type":case"features":return;default:i[e]=t[e]}}),i.features=t.features.map(function(e){return xt(e)}),i}(e);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return bt(e);default:throw new Error("unknown GeoJSON type")}}function xt(t){var i={type:"Feature"};return Object.keys(t).forEach(function(e){switch(e){case"type":case"properties":case"geometry":return;default:i[e]=t[e]}}),i.properties=function i(r){var n={};return r&&Object.keys(r).forEach(function(e){var t=r[e];"object"==typeof t?null===t?n[e]=null:Array.isArray(t)?n[e]=t.map(function(e){return e}):n[e]=i(t):n[e]=t}),n}(t.properties),i.geometry=bt(t.geometry),i}function bt(e){var t={type:e.type};return e.bbox&&(t.bbox=e.bbox),"GeometryCollection"===e.type?t.geometries=e.geometries.map(function(e){return bt(e)}):t.coordinates=function t(e){var i=e;return"object"!=typeof i[0]?i.slice():i.map(function(e){return t(e)})}(e.coordinates),t}function At(e){return e[0].toString()+","+e[1].toString()}function St(e){return e}function wt(e,t){var a=function(e){if(null==e)return St;var a,o,s=e.scale[0],l=e.scale[1],u=e.translate[0],c=e.translate[1];return function(e,t){t||(a=o=0);var i=2,r=e.length,n=new Array(r);for(n[0]=(a+=e[0])*s+u,n[1]=(o+=e[1])*l+c;i<r;)n[i]=e[i],++i;return n}}(e.transform),o=e.arcs;function n(e,t){t.length&&t.pop();for(var i=o[e<0?~e:e],r=0,n=i.length;r<n;++r)t.push(a(i[r],r));e<0&&function(e,t){for(var i,r=e.length,n=r-t;n<--r;)i=e[n],e[n++]=e[r],e[r]=i}(t,n)}function s(e){return a(e)}function l(e){for(var t=[],i=0,r=e.length;i<r;++i)n(e[i],t);return t.length<2&&t.push(t[0]),t}function i(e){for(var t=l(e);t.length<4;)t.push(t[0]);return t}function u(e){return e.map(i)}return function e(t){var i,r=t.type;switch(r){case"GeometryCollection":return{type:r,geometries:t.geometries.map(e)};case"Point":i=s(t.coordinates);break;case"MultiPoint":i=t.coordinates.map(s);break;case"LineString":i=l(t.arcs);break;case"MultiLineString":i=t.arcs.map(l);break;case"Polygon":i=u(t.arcs);break;case"MultiPolygon":i=t.arcs.map(u);break;default:return null}return{type:r,coordinates:i}}(t)}var Et=Object.prototype.hasOwnProperty;function Tt(a,o,s,e,l,t){3===arguments.length&&(e=t=Array,l=null);for(var u=new e(a=1<<Math.max(4,Math.ceil(Math.log(a)/Math.LN2))),c=new t(a),d=a-1,i=0;i<a;++i)u[i]=l;return{set:function(e,t){for(var i=o(e)&d,r=u[i],n=0;r!=l;){if(s(r,e))return c[i]=t;if(++n>=a)throw new Error("full hashmap");r=u[i=i+1&d]}return u[i]=e,c[i]=t},maybeSet:function(e,t){for(var i=o(e)&d,r=u[i],n=0;r!=l;){if(s(r,e))return c[i];if(++n>=a)throw new Error("full hashmap");r=u[i=i+1&d]}return u[i]=e,c[i]=t},get:function(e,t){for(var i=o(e)&d,r=u[i],n=0;r!=l;){if(s(r,e))return c[i];if(++n>=a)break;r=u[i=i+1&d]}return t},keys:function(){for(var e=[],t=0,i=u.length;t<i;++t){var r=u[t];r!=l&&e.push(r)}return e}}}function Pt(e,t){return e[0]===t[0]&&e[1]===t[1]}var Mt=new ArrayBuffer(16),Dt=new Float64Array(Mt),It=new Uint32Array(Mt);function Ot(e){Dt[0]=e[0],Dt[1]=e[1];var t=It[0]^It[1];return 2147483647&(t=t<<5^t>>7^It[2]^It[3])}function Rt(e,t,i){for(var r,n=t+(i---t>>1);t<n;++t,--i)r=e[t],e[t]=e[i],e[i]=r}function Lt(e){var t={type:"GeometryCollection",geometries:e.features.map(Nt)};return null!=e.bbox&&(t.bbox=e.bbox),t}function Nt(e){var t,i=kt(e.geometry);for(t in null!=e.id&&(i.id=e.id),null!=e.bbox&&(i.bbox=e.bbox),e.properties){i.properties=e.properties;break}return i}function kt(e){if(null==e)return{type:null};var t="GeometryCollection"===e.type?{type:"GeometryCollection",geometries:e.geometries.map(kt)}:"Point"===e.type||"MultiPoint"===e.type?{type:e.type,coordinates:e.coordinates}:{type:e.type,arcs:e.coordinates};return null!=e.bbox&&(t.bbox=e.bbox),t}function Bt(e,t){var i=function(e){var r=1/0,n=1/0,a=-1/0,o=-1/0;function t(e){null!=e&&Et.call(i,e.type)&&i[e.type](e)}var i={GeometryCollection:function(e){e.geometries.forEach(t)},Point:function(e){s(e.coordinates)},MultiPoint:function(e){e.coordinates.forEach(s)},LineString:function(e){l(e.arcs)},MultiLineString:function(e){e.arcs.forEach(l)},Polygon:function(e){e.arcs.forEach(l)},MultiPolygon:function(e){e.arcs.forEach(u)}};function s(e){var t=e[0],i=e[1];t<r&&(r=t),a<t&&(a=t),i<n&&(n=i),o<i&&(o=i)}function l(e){e.forEach(s)}function u(e){e.forEach(l)}for(var c in e)t(e[c]);return r<=a&&n<=o?[r,n,a,o]:void 0}(e=function(e){var t,i,r={};for(t in e)r[t]=null==(i=e[t])?{type:null}:("FeatureCollection"===i.type?Lt:"Feature"===i.type?Nt:kt)(i);return r}(e)),r=0<t&&i&&function(e,t,i){var d=t[0],h=t[1],r=t[2],n=t[3],p=r-d?(i-1)/(r-d):1,f=n-h?(i-1)/(n-h):1;function a(e){return[Math.round((e[0]-d)*p),Math.round((e[1]-h)*f)]}function o(e,t){for(var i,r,n,a,o,s=-1,l=0,u=e.length,c=new Array(u);++s<u;)i=e[s],a=Math.round((i[0]-d)*p),o=Math.round((i[1]-h)*f),a===r&&o===n||(c[l++]=[r=a,n=o]);for(c.length=l;l<t;)l=c.push([c[0][0],c[0][1]]);return c}function s(e){return o(e,2)}function l(e){return o(e,4)}function u(e){return e.map(l)}function c(e){null!=e&&Et.call(m,e.type)&&m[e.type](e)}var m={GeometryCollection:function(e){e.geometries.forEach(c)},Point:function(e){e.coordinates=a(e.coordinates)},MultiPoint:function(e){e.coordinates=e.coordinates.map(a)},LineString:function(e){e.arcs=s(e.arcs)},MultiLineString:function(e){e.arcs=e.arcs.map(s)},Polygon:function(e){e.arcs=u(e.arcs)},MultiPolygon:function(e){e.arcs=e.arcs.map(u)}};for(var g in e)c(e[g]);return{scale:[1/p,1/f],translate:[d,h]}}(e,i,t),n=function(e){var t,i,r,n,c=e.coordinates,a=e.lines,o=e.rings,s=a.length+o.length;for(delete e.lines,delete e.rings,r=0,n=a.length;r<n;++r)for(t=a[r];t=t.next;)++s;for(r=0,n=o.length;r<n;++r)for(i=o[r];i=i.next;)++s;var u=Tt(2*s*1.4,Ot,Pt),d=e.arcs=[];for(r=0,n=a.length;r<n;++r)for(t=a[r];l(t),t=t.next;);for(r=0,n=o.length;r<n;++r)if((i=o[r]).next)for(;l(i),i=i.next;);else h(i);function l(e){var t,i,r,n,a,o,s,l;if(r=u.get(t=c[e[0]]))for(s=0,l=r.length;s<l;++s)if(p(n=r[s],e))return e[0]=n[0],void(e[1]=n[1]);if(a=u.get(i=c[e[1]]))for(s=0,l=a.length;s<l;++s)if(f(o=a[s],e))return e[1]=o[0],void(e[0]=o[1]);r?r.push(e):u.set(t,[e]),a?a.push(e):u.set(i,[e]),d.push(e)}function h(e){var t,i,r,n,a;if(i=u.get(c[e[0]]))for(n=0,a=i.length;n<a;++n){if(m(r=i[n],e))return e[0]=r[0],void(e[1]=r[1]);if(g(r,e))return e[0]=r[1],void(e[1]=r[0])}if(i=u.get(t=c[e[0]+y(e)]))for(n=0,a=i.length;n<a;++n){if(m(r=i[n],e))return e[0]=r[0],void(e[1]=r[1]);if(g(r,e))return e[0]=r[1],void(e[1]=r[0])}i?i.push(e):u.set(t,[e]),d.push(e)}function p(e,t){var i=e[0],r=t[0],n=e[1];if(i-n!=r-t[1])return!1;for(;i<=n;++i,++r)if(!Pt(c[i],c[r]))return!1;return!0}function f(e,t){var i=e[0],r=t[0],n=e[1],a=t[1];if(i-n!=r-a)return!1;for(;i<=n;++i,--a)if(!Pt(c[i],c[a]))return!1;return!0}function m(e,t){var i=e[0],r=t[0],n=e[1]-i;if(n!=t[1]-r)return!1;for(var a=y(e),o=y(t),s=0;s<n;++s)if(!Pt(c[i+(s+a)%n],c[r+(s+o)%n]))return!1;return!0}function g(e,t){var i=e[0],r=t[0],n=e[1],a=t[1],o=n-i;if(o!=a-r)return!1;for(var s=y(e),l=o-y(t),u=0;u<o;++u)if(!Pt(c[i+(u+s)%o],c[a-(u+l)%o]))return!1;return!0}function y(e){for(var t=e[0],i=e[1],r=t,n=r,a=c[r];++r<i;){var o=c[r];(o[0]<a[0]||o[0]===a[0]&&o[1]<a[1])&&(n=r,a=o)}return n-t}return e}(function(e){var t,i,r,n,a,o,s,l=function(e){var t,i,r,n,a=e.coordinates,o=e.lines,s=e.rings,l=function(){for(var e=Tt(1.4*a.length,x,b,Int32Array,-1,Int32Array),t=new Int32Array(a.length),i=0,r=a.length;i<r;++i)t[i]=e.maybeSet(i,i);return t}(),u=new Int32Array(a.length),c=new Int32Array(a.length),d=new Int32Array(a.length),h=new Int8Array(a.length),p=0;for(t=0,i=a.length;t<i;++t)u[t]=c[t]=d[t]=-1;for(t=0,i=o.length;t<i;++t){var f=o[t],m=f[0],g=f[1];for(r=l[m],n=l[++m],++p,h[r]=1;++m<=g;)C(t,r,r=n,n=l[m]);++p,h[n]=1}for(t=0,i=a.length;t<i;++t)u[t]=-1;for(t=0,i=s.length;t<i;++t){var y=s[t],v=y[0]+1,_=y[1];for(C(t,l[_-1],r=l[v-1],n=l[v]);++v<=_;)C(t,r,r=n,n=l[v])}function C(e,t,i,r){if(u[i]!==e){u[i]=e;var n=c[i];if(0<=n){var a=d[i];n===t&&a===r||n===r&&a===t||(++p,h[i]=1)}else c[i]=t,d[i]=r}}function x(e){return Ot(a[e])}function b(e,t){return Pt(a[e],a[t])}u=c=d=null;var A,S=function(n,a,o,e,s){3===arguments.length&&(e=Array,s=null);for(var l=new e(n=1<<Math.max(4,Math.ceil(Math.log(n)/Math.LN2))),u=n-1,t=0;t<n;++t)l[t]=s;function i(e){for(var t=a(e)&u,i=l[t],r=0;i!=s;){if(o(i,e))return!0;if(++r>=n)throw new Error("full hashset");i=l[t=t+1&u]}return l[t]=e,!0}function r(e){for(var t=a(e)&u,i=l[t],r=0;i!=s;){if(o(i,e))return!0;if(++r>=n)break;i=l[t=t+1&u]}return!1}function c(){for(var e=[],t=0,i=l.length;t<i;++t){var r=l[t];r!=s&&e.push(r)}return e}return{add:i,has:r,values:c}}(1.4*p,Ot,Pt);for(t=0,i=a.length;t<i;++t)h[A=l[t]]&&S.add(a[A]);return S}(e),u=e.coordinates,c=e.lines,d=e.rings;for(i=0,r=c.length;i<r;++i)for(var h=c[i],p=h[0],f=h[1];++p<f;)l.has(u[p])&&(t={0:p,1:h[1]},h[1]=p,h=h.next=t);for(i=0,r=d.length;i<r;++i)for(var m=d[i],g=m[0],y=g,v=m[1],_=l.has(u[g]);++y<v;)l.has(u[y])&&(_?(t={0:y,1:m[1]},m[1]=y,m=m.next=t):(s=(o=v)-y,Rt(n=u,a=g,o),Rt(n,a,a+s),Rt(n,a+s,o),u[v]=u[g],_=!0,y=g));return e}(function(e){var n=-1,a=[],o=[],s=[];function t(e){e&&Et.call(i,e.type)&&i[e.type](e)}var i={GeometryCollection:function(e){e.geometries.forEach(t)},LineString:function(e){e.arcs=r(e.arcs)},MultiLineString:function(e){e.arcs=e.arcs.map(r)},Polygon:function(e){e.arcs=e.arcs.map(l)},MultiPolygon:function(e){e.arcs=e.arcs.map(u)}};function r(e){for(var t=0,i=e.length;t<i;++t)s[++n]=e[t];var r={0:n-i+1,1:n};return a.push(r),r}function l(e){for(var t=0,i=e.length;t<i;++t)s[++n]=e[t];var r={0:n-i+1,1:n};return o.push(r),r}function u(e){return e.map(l)}for(var c in e)t(e[c]);return{type:"Topology",coordinates:s,lines:a,rings:o,objects:e}}(e))),a=n.coordinates,o=Tt(1.4*n.arcs.length,Ft,Vt);function s(e){e&&Et.call(l,e.type)&&l[e.type](e)}e=n.objects,n.bbox=i,n.arcs=n.arcs.map(function(e,t){return o.set(e,t),a.slice(e[0],e[1]+1)}),delete n.coordinates,a=null;var l={GeometryCollection:function(e){e.geometries.forEach(s)},LineString:function(e){e.arcs=u(e.arcs)},MultiLineString:function(e){e.arcs=e.arcs.map(u)},Polygon:function(e){e.arcs=e.arcs.map(u)},MultiPolygon:function(e){e.arcs=e.arcs.map(c)}};function u(e){var t=[];do{var i=o.get(e);t.push(e[0]<e[1]?i:~i)}while(e=e.next);return t}function c(e){return e.map(u)}for(var d in e)s(e[d]);return r&&(n.transform=r,n.arcs=function(e){for(var t=-1,i=e.length;++t<i;){for(var r,n,a=e[t],o=0,s=1,l=a.length,u=a[0],c=u[0],d=u[1];++o<l;)r=(u=a[o])[0],n=u[1],r===c&&n===d||(a[s++]=[r-c,n-d],c=r,d=n);1===s&&(a[s++]=[0,0]),a.length=s}return e}(n.arcs)),n}function Ft(e){var t,i=e[0],r=e[1];return r<i&&(t=i,i=r,r=t),i+31*r}function Vt(e,t){var i,r=e[0],n=e[1],a=t[0],o=t[1];return n<r&&(i=r,r=n,n=i),o<a&&(i=a,a=o,o=i),r===a&&n===o}function zt(e,t){if(void 0===t&&(t={}),"FeatureCollection"!==X(e))throw new Error("geojson must be a FeatureCollection");if(!e.features.length)throw new Error("geojson is empty");!1!==t.mutate&&void 0!==t.mutate||(e=Ct(e));var i=[];U(e,function(e){i.push(e.geometry)});var r=Bt({geoms:u(i).geometry});return function(e){return wt(e,function(m,e){var g={},i=[],r=[];function n(t){t.forEach(function(e){e.forEach(function(e){(g[e=e<0?~e:e]||(g[e]=[])).push(t)})}),i.push(t)}function y(e){return function(e){for(var t,i=-1,r=e.length,n=e[r-1],a=0;++i<r;)t=n,n=e[i],a+=t[0]*n[1]-t[1]*n[0];return Math.abs(a)}(wt(m,{type:"Polygon",arcs:[e]}).coordinates[0])}return e.forEach(function e(t){switch(t.type){case"GeometryCollection":t.geometries.forEach(e);break;case"Polygon":n(t.arcs);break;case"MultiPolygon":t.arcs.forEach(n)}}),i.forEach(function(e){if(!e._){var t=[],i=[e];for(e._=1,r.push(t);e=i.pop();)t.push(e),e.forEach(function(e){e.forEach(function(e){g[e<0?~e:e].forEach(function(e){e._||(e._=1,i.push(e))})})})}}),i.forEach(function(e){delete e._}),{type:"MultiPolygon",arcs:r.map(function(e){var t,h,n,a,p,f,o,s,i=[];if(e.forEach(function(e){e.forEach(function(e){e.forEach(function(e){g[e<0?~e:e].length<2&&i.push(e)})})}),1<(t=(h=m,a={},p={},f={},o=[],s=-1,(n=i).forEach(function(e,t){var i,r=h.arcs[e<0?~e:e];r.length<3&&!r[1][0]&&!r[1][1]&&(i=n[++s],n[s]=e,n[t]=i)}),n.forEach(function(e){var t,i,r,n,a,o,s=(r=e,a=h.arcs[r<0?~r:r],o=a[0],h.transform?(n=[0,0],a.forEach(function(e){n[0]+=e[0],n[1]+=e[1]})):n=a[a.length-1],r<0?[n,o]:[o,n]),l=s[0],u=s[1];if(t=f[l])if(delete f[t.end],t.push(e),t.end=u,i=p[u]){delete p[i.start];var c=i===t?t:t.concat(i);p[c.start=t.start]=f[c.end=i.end]=c}else p[t.start]=f[t.end]=t;else if(t=p[u])if(delete p[t.start],t.unshift(e),t.start=l,i=f[l]){delete f[i.end];var d=i===t?t:i.concat(t);p[d.start=i.start]=f[d.end=t.end]=d}else p[t.start]=f[t.end]=t;else p[(t=[e]).start=l]=f[t.end=u]=t}),d(f,p),d(p,f),n.forEach(function(e){a[e<0?~e:e]||o.push([e])}),i=o).length))for(var r,l,u=1,c=y(i[0]);u<t;++u)(r=y(i[u]))>c&&(l=i[0],i[0]=i[u],i[u]=l,c=r);function d(e,t){for(var i in e){var r=e[i];delete t[r.start],delete r.start,delete r.end,r.forEach(function(e){a[e<0?~e:e]=1}),o.push(r)}}return i}).filter(function(e){return 0<e.length})}}.apply(this,arguments))}(r,r.objects.geoms.geometries)}function Ut(e,t){if(void 0===t&&(t={}),!q(t=t||{}))throw new Error("options is invalid");var i=t.mutate;if("FeatureCollection"!==X(e))throw new Error("geojson must be a FeatureCollection");if(!e.features.length)throw new Error("geojson is empty");!1!==i&&void 0!==i||(e=Ct(e));var r=function(e){var t={};U(e,function(e){t[e.geometry.type]=!0});var i=Object.keys(t);return 1===i.length?i[0]:null}(e);if(!r)throw new Error("geojson must be homogenous");var n=e;switch(r){case"LineString":return function(e,t){if(void 0===t&&(t={}),!q(t=t||{}))throw new Error("options is invalid");var i=t.mutate;if("FeatureCollection"!==X(e))throw new Error("geojson must be a FeatureCollection");if(!e.features.length)throw new Error("geojson is empty");!1!==i&&void 0!==i||(e=Ct(e));var r=[],n=te(e,function(u,e){return function(e,t){var i,r=u.geometry.coordinates,n=t.geometry.coordinates,a=At(r[0]),o=At(r[r.length-1]),s=At(n[0]),l=At(n[n.length-1]);if(a===l)i=n.concat(r.slice(1));else if(s===o)i=r.concat(n.slice(1));else if(a===s)i=r.slice(1).reverse().concat(n);else{if(o!==l)return null;i=r.concat(n.reverse().slice(1))}return H(i)}(0,e)||(r.push(u),e)});return n&&r.push(n),r.length?1===r.length?r[0]:c(r.map(function(e){return e.coordinates})):null}(n,t);case"Polygon":return zt(n,t);default:throw new Error(r+" is not supported")}}function Gt(e,t){void 0===t&&(t={});var i="object"==typeof t?t.mutate:t;if(!e)throw new Error("geojson is required");var r=X(e),n=[];switch(r){case"LineString":n=$t(e);break;case"MultiLineString":case"Polygon":w(e).forEach(function(e){n.push($t(e))});break;case"MultiPolygon":w(e).forEach(function(e){var t=[];e.forEach(function(e){t.push($t(e))}),n.push(t)});break;case"Point":return e;case"MultiPoint":var a={};w(e).forEach(function(e){var t=e.join("-");a.hasOwnProperty(t)||(n.push(e),a[t]=!0)});break;default:throw new Error(r+" geometry not supported")}return e.coordinates?!0===i?(e.coordinates=n,e):{type:r,coordinates:n}:!0===i?(e.geometry.coordinates=n,e):G({type:r,coordinates:n},e.properties,{bbox:e.bbox,id:e.id})}function $t(e){var t=w(e);if(2===t.length&&!Ht(t[0],t[1]))return t;var i=[],r=t.length-1,n=i.length;i.push(t[0]);for(var a=1;a<r;a++){var o=i[i.length-1];t[a][0]===o[0]&&t[a][1]===o[1]||(i.push(t[a]),2<(n=i.length)&&Wt(i[n-3],i[n-1],i[n-2])&&i.splice(i.length-2,1))}if(i.push(t[t.length-1]),n=i.length,Ht(t[0],t[t.length-1])&&n<4)throw new Error("invalid polygon");return Wt(i[n-3],i[n-1],i[n-2])&&i.splice(i.length-2,1),i}function Ht(e,t){return e[0]===t[0]&&e[1]===t[1]}function Wt(e,t,i){var r=i[0],n=i[1],a=e[0],o=e[1],s=t[0],l=t[1],u=s-a,c=l-o;return 0==(r-a)*c-(n-o)*u&&(Math.abs(u)>=Math.abs(c)?0<u?a<=r&&r<=s:s<=r&&r<=a:0<c?o<=n&&n<=l:l<=n&&n<=o)}function jt(e,t,i){var r=t.x,n=t.y,a=i.x-r,o=i.y-n;if(0!==a||0!==o){var s=((e.x-r)*a+(e.y-n)*o)/(a*a+o*o);1<s?(r=i.x,n=i.y):0<s&&(r+=a*s,n+=o*s)}return(a=e.x-r)*a+(o=e.y-n)*o}function qt(e,t){var i=e.length-1,r=[e[0]];return function e(t,i,r,n,a){for(var o,s=n,l=i+1;l<r;l++){var u=jt(t[l],t[i],t[r]);s<u&&(o=l,s=u)}n<s&&(1<o-i&&e(t,i,o,n,a),a.push(t[o]),1<r-o&&e(t,o,r,n,a))}(e,0,i,t,r),r.push(e[i]),r}function Qt(e,t,i){if(e.length<=2)return e;var r=void 0!==t?t*t:1;return e=qt(e=i?e:function(e,t){for(var i,r,n,a,o,s=e[0],l=[s],u=1,c=e.length;u<c;u++)i=e[u],n=s,o=a=void 0,a=(r=i).x-n.x,o=r.y-n.y,t<a*a+o*o&&(l.push(i),s=i);return s!==i&&l.push(i),l}(e,r),r)}function Yt(e,t,i){return Qt(e.map(function(e){return{x:e[0],y:e[1],z:e[2]}}),t,i).map(function(e){return e.z?[e.x,e.y,e.z]:[e.x,e.y]})}function Xt(e,n,a){return e.map(function(e){var t,i=e.map(function(e){return{x:e[0],y:e[1]}});if(i.length<4)throw new Error("invalid polygon");for(var r=Qt(i,n,a).map(function(e){return[e.x,e.y]});(t=r).length<3||3===t.length&&t[2][0]===t[0][0]&&t[2][1]===t[0][1];)r=Qt(i,n-=.01*n,a).map(function(e){return[e.x,e.y]});return r[r.length-1][0]===r[0][0]&&r[r.length-1][1]===r[0][1]||r.push(r[0]),r})}var Zt=function(){function e(e){this.points=e.points||[],this.duration=e.duration||1e4,this.sharpness=e.sharpness||.85,this.centers=[],this.controls=[],this.stepLength=e.stepLength||60,this.length=this.points.length;for(var t=this.delay=0;t<this.length;t++)this.points[t].z=this.points[t].z||0;for(t=0;t<this.length-1;t++){var i=this.points[t],r=this.points[t+1];this.centers.push({x:(i.x+r.x)/2,y:(i.y+r.y)/2,z:(i.z+r.z)/2})}for(this.controls.push([this.points[0],this.points[0]]),t=0;t<this.centers.length-1;t++){var n=this.points[t+1].x-(this.centers[t].x+this.centers[t+1].x)/2,a=this.points[t+1].y-(this.centers[t].y+this.centers[t+1].y)/2,o=this.points[t+1].z-(this.centers[t].y+this.centers[t+1].z)/2;this.controls.push([{x:(1-this.sharpness)*this.points[t+1].x+this.sharpness*(this.centers[t].x+n),y:(1-this.sharpness)*this.points[t+1].y+this.sharpness*(this.centers[t].y+a),z:(1-this.sharpness)*this.points[t+1].z+this.sharpness*(this.centers[t].z+o)},{x:(1-this.sharpness)*this.points[t+1].x+this.sharpness*(this.centers[t+1].x+n),y:(1-this.sharpness)*this.points[t+1].y+this.sharpness*(this.centers[t+1].y+a),z:(1-this.sharpness)*this.points[t+1].z+this.sharpness*(this.centers[t+1].z+o)}])}return this.controls.push([this.points[this.length-1],this.points[this.length-1]]),this.steps=this.cacheSteps(this.stepLength),this}return e.prototype.cacheSteps=function(e){var t=[],i=this.pos(0);t.push(0);for(var r=0;r<this.duration;r+=10){var n=this.pos(r);Math.sqrt((n.x-i.x)*(n.x-i.x)+(n.y-i.y)*(n.y-i.y)+(n.z-i.z)*(n.z-i.z))>e&&(t.push(r),i=n)}return t},e.prototype.vector=function(e){var t=this.pos(e+10),i=this.pos(e-10);return{angle:180*Math.atan2(t.y-i.y,t.x-i.x)/3.14,speed:Math.sqrt((i.x-t.x)*(i.x-t.x)+(i.y-t.y)*(i.y-t.y)+(i.z-t.z)*(i.z-t.z))}},e.prototype.pos=function(e){var t=e-this.delay;t<0&&(t=0),t>this.duration&&(t=this.duration-1);var i=t/this.duration;if(1<=i)return this.points[this.length-1];var r=Math.floor((this.points.length-1)*i);return function(e,t,i,r,n){var a=function(e){var t=e*e;return[t*e,3*t*(1-e),3*e*(1-e)*(1-e),(1-e)*(1-e)*(1-e)]}(e);return{x:n.x*a[0]+r.x*a[1]+i.x*a[2]+t.x*a[3],y:n.y*a[0]+r.y*a[1]+i.y*a[2]+t.y*a[3],z:n.z*a[0]+r.z*a[1]+i.z*a[2]+t.z*a[3]}}((this.length-1)*i-r,this.points[r],this.controls[r][1],this.controls[r+1][0],this.points[r+1])},e}();function Jt(e,t){void 0===t&&(t={});for(var i=t.resolution||1e4,r=t.sharpness||.85,n=[],a=Y(e).coordinates.map(function(e){return{x:e[0],y:e[1]}}),o=new Zt({duration:i,points:a,sharpness:r}),s=function(e){var t=o.pos(e);Math.floor(e/100)%2==0&&n.push([t.x,t.y])},l=0;l<o.duration;l+=10)s(l);return s(o.duration),H(n,t.properties)}function Kt(e,t){void 0===t&&(t={});var i=Number(e[0]),r=Number(e[1]),n=Number(e[2]),a=Number(e[3]);if(6===e.length)throw new Error("@turf/bbox-polygon does not support BBox with 6 positions");var o=[i,r];return V([[o,[n,r],[n,a],[i,a],o]],t.properties,{bbox:e,id:t.id})}function ei(e){return Kt(ae(e))}function ti(e){var t=e[0],i=e[1],r=e[2],n=e[3];if(mt(e.slice(0,2),[r,i])>=mt(e.slice(0,2),[t,n])){var a=(i+n)/2;return[t,a-(r-t)/2,r,a+(r-t)/2]}var o=(t+r)/2;return[o-(n-i)/2,i,o+(n-i)/2,n]}function ii(e,t,i,r){void 0===r&&(r={});var n=Q(e),a=_(n[0]),o=_(n[1]),s=_(i),l=m(t,r.units),u=Math.asin(Math.sin(o)*Math.cos(l)+Math.cos(o)*Math.sin(l)*Math.cos(s));return $([v(a+Math.atan2(Math.sin(s)*Math.sin(l)*Math.cos(o),Math.cos(l)-Math.sin(o)*Math.sin(u))),v(u)],r.properties)}function ri(e,t,i){void 0===i&&(i={});for(var r=i.steps||64,n=i.properties?i.properties:!Array.isArray(e)&&"Feature"===e.type&&e.properties?e.properties:{},a=[],o=0;o<r;o++)a.push(ii(e,t,-360*o/r,i).geometry.coordinates);return a.push(a[0]),V([a],n)}function ni(e,t,i){if(void 0===i&&(i={}),!0===i.final)return function(e,t){var i=ni(t,e);return i=(i+180)%360}(e,t);var r=Q(e),n=Q(t),a=_(r[0]),o=_(n[0]),s=_(r[1]),l=_(n[1]),u=Math.sin(o-a)*Math.cos(l),c=Math.cos(s)*Math.sin(l)-Math.sin(s)*Math.cos(l)*Math.cos(o-a);return v(Math.atan2(u,c))}function ai(e,t){void 0===t&&(t={});var i=ae(e);return $([(i[0]+i[2])/2,(i[1]+i[3])/2],t.properties,t)}function oi(e,t){void 0===t&&(t={});var i=0,r=0,n=0;return I(e,function(e){i+=e[0],r+=e[1],n++},!0),$([i/n,r/n],t.properties)}function si(t){var i=[];return"FeatureCollection"===t.type?N(t,function(t){I(t,function(e){i.push($(e,t.properties))})}):I(t,function(e){i.push($(e,t.properties))}),W(i)}var li=ci,ui=ci;function ci(e,t,i){i=i||2;var r,n,a,o,s,l,u,c=t&&t.length,d=c?t[0]*i:e.length,h=di(e,0,d,i,!0),p=[];if(!h)return p;if(c&&(h=function(e,t,i,r){var n,a,o,s=[];for(n=0,a=t.length;n<a;n++)(o=di(e,t[n]*r,n<a-1?t[n+1]*r:e.length,r,!1))===o.next&&(o.steiner=!0),s.push(xi(o));for(s.sort(vi),n=0;n<s.length;n++)_i(s[n],i),i=hi(i,i.next);return i}(e,t,h,i)),e.length>80*i){r=a=e[0],n=o=e[1];for(var f=i;f<d;f+=i)(s=e[f])<r&&(r=s),(l=e[f+1])<n&&(n=l),a<s&&(a=s),o<l&&(o=l);u=0!==(u=Math.max(a-r,o-n))?1/u:0}return pi(h,p,i,r,n,u),p}function di(e,t,i,r,n){var a,o;if(n===0<Ii(e,t,i,r))for(a=t;a<i;a+=r)o=Pi(a,e[a],e[a+1],o);else for(a=i-r;t<=a;a-=r)o=Pi(a,e[a],e[a+1],o);return o&&Si(o,o.next)&&(Mi(o),o=o.next),o}function hi(e,t){if(!e)return e;t=t||e;var i,r=e;do{if(i=!1,r.steiner||!Si(r,r.next)&&0!==Ai(r.prev,r,r.next))r=r.next;else{if(Mi(r),(r=t=r.prev)===r.next)break;i=!0}}while(i||r!==t);return t}function pi(e,t,i,r,n,a,o){if(e){!o&&a&&function(e,t,i,r){for(var n=e;null===n.z&&(n.z=Ci(n.x,n.y,t,i,r)),n.prevZ=n.prev,n.nextZ=n.next,(n=n.next)!==e;);n.prevZ.nextZ=null,n.prevZ=null,function(e){var t,i,r,n,a,o,s,l,u=1;do{for(i=e,a=e=null,o=0;i;){for(o++,r=i,t=s=0;t<u&&(s++,r=r.nextZ);t++);for(l=u;0<s||0<l&&r;)0!==s&&(0===l||!r||i.z<=r.z)?(i=(n=i).nextZ,s--):(r=(n=r).nextZ,l--),a?a.nextZ=n:e=n,n.prevZ=a,a=n;i=r}a.nextZ=null,u*=2}while(1<o)}(n)}(e,r,n,a);for(var s,l,u=e;e.prev!==e.next;)if(s=e.prev,l=e.next,a?mi(e,r,n,a):fi(e))t.push(s.i/i),t.push(e.i/i),t.push(l.i/i),Mi(e),e=l.next,u=l.next;else if((e=l)===u){o?1===o?pi(e=gi(e,t,i),t,i,r,n,a,2):2===o&&yi(e,t,i,r,n,a):pi(hi(e),t,i,r,n,a,1);break}}}function fi(e){var t=e.prev,i=e,r=e.next;if(0<=Ai(t,i,r))return!1;for(var n=e.next.next;n!==e.prev;){if(bi(t.x,t.y,i.x,i.y,r.x,r.y,n.x,n.y)&&0<=Ai(n.prev,n,n.next))return!1;n=n.next}return!0}function mi(e,t,i,r){var n=e.prev,a=e,o=e.next;if(0<=Ai(n,a,o))return!1;for(var s=n.x<a.x?n.x<o.x?n.x:o.x:a.x<o.x?a.x:o.x,l=n.y<a.y?n.y<o.y?n.y:o.y:a.y<o.y?a.y:o.y,u=n.x>a.x?n.x>o.x?n.x:o.x:a.x>o.x?a.x:o.x,c=n.y>a.y?n.y>o.y?n.y:o.y:a.y>o.y?a.y:o.y,d=Ci(s,l,t,i,r),h=Ci(u,c,t,i,r),p=e.prevZ,f=e.nextZ;p&&p.z>=d&&f&&f.z<=h;){if(p!==e.prev&&p!==e.next&&bi(n.x,n.y,a.x,a.y,o.x,o.y,p.x,p.y)&&0<=Ai(p.prev,p,p.next))return!1;if(p=p.prevZ,f!==e.prev&&f!==e.next&&bi(n.x,n.y,a.x,a.y,o.x,o.y,f.x,f.y)&&0<=Ai(f.prev,f,f.next))return!1;f=f.nextZ}for(;p&&p.z>=d;){if(p!==e.prev&&p!==e.next&&bi(n.x,n.y,a.x,a.y,o.x,o.y,p.x,p.y)&&0<=Ai(p.prev,p,p.next))return!1;p=p.prevZ}for(;f&&f.z<=h;){if(f!==e.prev&&f!==e.next&&bi(n.x,n.y,a.x,a.y,o.x,o.y,f.x,f.y)&&0<=Ai(f.prev,f,f.next))return!1;f=f.nextZ}return!0}function gi(e,t,i){var r=e;do{var n=r.prev,a=r.next.next;!Si(n,a)&&wi(n,r,r.next,a)&&Ei(n,a)&&Ei(a,n)&&(t.push(n.i/i),t.push(r.i/i),t.push(a.i/i),Mi(r),Mi(r.next),r=e=a),r=r.next}while(r!==e);return r}function yi(e,t,i,r,n,a){var o,s,l=e;do{for(var u=l.next.next;u!==l.prev;){if(l.i!==u.i&&(s=u,(o=l).next.i!==s.i&&o.prev.i!==s.i&&!function(e,t){var i=e;do{if(i.i!==e.i&&i.next.i!==e.i&&i.i!==t.i&&i.next.i!==t.i&&wi(i,i.next,e,t))return!0;i=i.next}while(i!==e);return!1}(o,s)&&Ei(o,s)&&Ei(s,o)&&function(e,t){for(var i=e,r=!1,n=(e.x+t.x)/2,a=(e.y+t.y)/2;i.y>a!=i.next.y>a&&i.next.y!==i.y&&n<(i.next.x-i.x)*(a-i.y)/(i.next.y-i.y)+i.x&&(r=!r),(i=i.next)!==e;);return r}(o,s))){var c=Ti(l,u);return l=hi(l,l.next),c=hi(c,c.next),pi(l,t,i,r,n,a),void pi(c,t,i,r,n,a)}u=u.next}l=l.next}while(l!==e)}function vi(e,t){return e.x-t.x}function _i(e,t){if(t=function(e,t){var i,r=t,n=e.x,a=e.y,o=-1/0;do{if(a<=r.y&&a>=r.next.y&&r.next.y!==r.y){var s=r.x+(a-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=n&&o<s){if((o=s)===n){if(a===r.y)return r;if(a===r.next.y)return r.next}i=r.x<r.next.x?r:r.next}}r=r.next}while(r!==t);if(!i)return null;if(n===o)return i.prev;var l,u=i,c=i.x,d=i.y,h=1/0;for(r=i.next;r!==u;)n>=r.x&&r.x>=c&&n!==r.x&&bi(a<d?n:o,a,c,d,a<d?o:n,a,r.x,r.y)&&((l=Math.abs(a-r.y)/(n-r.x))<h||l===h&&r.x>i.x)&&Ei(r,e)&&(i=r,h=l),r=r.next;return i}(e,t)){var i=Ti(t,e);hi(i,i.next)}}function Ci(e,t,i,r,n){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)*n)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*n)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function xi(e){for(var t=e,i=e;t.x<i.x&&(i=t),(t=t.next)!==e;);return i}function bi(e,t,i,r,n,a,o,s){return 0<=(n-o)*(t-s)-(e-o)*(a-s)&&0<=(e-o)*(r-s)-(i-o)*(t-s)&&0<=(i-o)*(a-s)-(n-o)*(r-s)}function Ai(e,t,i){return(t.y-e.y)*(i.x-t.x)-(t.x-e.x)*(i.y-t.y)}function Si(e,t){return e.x===t.x&&e.y===t.y}function wi(e,t,i,r){return!!(Si(e,t)&&Si(i,r)||Si(e,r)&&Si(i,t))||0<Ai(e,t,i)!=0<Ai(e,t,r)&&0<Ai(i,r,e)!=0<Ai(i,r,t)}function Ei(e,t){return Ai(e.prev,e,e.next)<0?0<=Ai(e,t,e.next)&&0<=Ai(e,e.prev,t):Ai(e,t,e.prev)<0||Ai(e,e.next,t)<0}function Ti(e,t){var i=new Di(e.i,e.x,e.y),r=new Di(t.i,t.x,t.y),n=e.next,a=t.prev;return(e.next=t).prev=e,(i.next=n).prev=i,(r.next=i).prev=r,(a.next=r).prev=a,r}function Pi(e,t,i,r){var n=new Di(e,t,i);return r?(n.next=r.next,(n.prev=r).next.prev=n,r.next=n):(n.prev=n).next=n,n}function Mi(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function Di(e,t,i){this.i=e,this.x=t,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Ii(e,t,i,r){for(var n=0,a=t,o=i-r;a<i;a+=r)n+=(e[o]-e[a])*(e[a+1]+e[o+1]),o=a;return n}function Oi(e){var r=function(e){for(var t=e[0][0].length,i={vertices:[],holes:[],dimensions:t},r=0,n=0;n<e.length;n++){for(var a=0;a<e[n].length;a++)for(var o=0;o<t;o++)i.vertices.push(e[n][a][o]);0<n&&(r+=e[n-1].length,i.holes.push(r))}return i}(e),n=li(r.vertices,r.holes,2),t=[],a=[];n.forEach(function(e,t){var i=n[t];a.push([r.vertices[2*i],r.vertices[2*i+1]])});for(var i=0;i<a.length;i+=3){var o=a.slice(i,i+3);o.push(a[i]),t.push(V([o]))}return t}function Ri(r,e){if(!r)throw new Error("targetPoint is required");if(!e)throw new Error("points is required");var t,n=1/0,a=0;return N(e,function(e,t){var i=mt(r,e);i<n&&(a=t,n=i)}),(t=Ct(e.features[a])).properties.featureIndex=a,t.properties.distanceToPoint=n,t}function Li(e){if(!e)throw new Error("geojson is required");var t=[];return U(e,function(e){!function(t,i){var e=[],r=t.geometry;if(null!==r){switch(r.type){case"Polygon":e=w(r);break;case"LineString":e=[w(r)]}e.forEach(function(e){(function(e,r){var n=[];return e.reduce(function(e,t){var i=H([e,t],r);return i.bbox=function(e,t){var i=e[0],r=e[1],n=t[0],a=t[1];return[i<n?i:n,r<a?r:a,n<i?i:n,a<r?r:a]}(e,t),n.push(i),t}),n})(e,t.properties).forEach(function(e){e.id=i.length,i.push(e)})})}}(e,t)}),W(t)}ci.deviation=function(e,t,i,r){var n=t&&t.length,a=n?t[0]*i:e.length,o=Math.abs(Ii(e,0,a,i));if(n)for(var s=0,l=t.length;s<l;s++){var u=t[s]*i,c=s<l-1?t[s+1]*i:e.length;o-=Math.abs(Ii(e,u,c,i))}var d=0;for(s=0;s<r.length;s+=3){var h=r[s]*i,p=r[s+1]*i,f=r[s+2]*i;d+=Math.abs((e[h]-e[f])*(e[1+p]-e[1+h])-(e[h]-e[p])*(e[1+f]-e[1+h]))}return 0===o&&0===d?0:Math.abs((d-o)/o)},ci.flatten=function(e){for(var t=e[0][0].length,i={vertices:[],holes:[],dimensions:t},r=0,n=0;n<e.length;n++){for(var a=0;a<e[n].length;a++)for(var o=0;o<t;o++)i.vertices.push(e[n][a][o]);0<n&&(r+=e[n-1].length,i.holes.push(r))}return i},li.default=ui;var Ni=Be(function(e,a){function s(e,t,i){void 0===i&&(i={});var r={type:"Feature"};return 0!==i.id&&!i.id||(r.id=i.id),i.bbox&&(r.bbox=i.bbox),r.properties=t||{},r.geometry=e,r}function r(e,t,i){if(void 0===i&&(i={}),!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");if(e.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!f(e[0])||!f(e[1]))throw new Error("coordinates must contain numbers");return s({type:"Point",coordinates:e},t,i)}function n(e,t,i){void 0===i&&(i={});for(var r=0,n=e;r<n.length;r++){var a=n[r];if(a.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var o=0;o<a[a.length-1].length;o++)if(a[a.length-1][o]!==a[0][o])throw new Error("First and last Position are not equivalent.")}return s({type:"Polygon",coordinates:e},t,i)}function o(e,t,i){if(void 0===i&&(i={}),e.length<2)throw new Error("coordinates must be an array of two or more positions");return s({type:"LineString",coordinates:e},t,i)}function l(e,t){void 0===t&&(t={});var i={type:"FeatureCollection"};return t.id&&(i.id=t.id),t.bbox&&(i.bbox=t.bbox),i.features=e,i}function u(e,t,i){return void 0===i&&(i={}),s({type:"MultiLineString",coordinates:e},t,i)}function c(e,t,i){return void 0===i&&(i={}),s({type:"MultiPoint",coordinates:e},t,i)}function d(e,t,i){return void 0===i&&(i={}),s({type:"MultiPolygon",coordinates:e},t,i)}function h(e,t){void 0===t&&(t="kilometers");var i=a.factors[t];if(!i)throw new Error(t+" units is invalid");return e*i}function p(e,t){void 0===t&&(t="kilometers");var i=a.factors[t];if(!i)throw new Error(t+" units is invalid");return e/i}function i(e){return e%(2*Math.PI)*180/Math.PI}function f(e){return!isNaN(e)&&null!==e&&!Array.isArray(e)}Object.defineProperty(a,"__esModule",{value:!0}),a.earthRadius=6371008.8,a.factors={centimeters:100*a.earthRadius,centimetres:100*a.earthRadius,degrees:a.earthRadius/111325,feet:3.28084*a.earthRadius,inches:39.37*a.earthRadius,kilometers:a.earthRadius/1e3,kilometres:a.earthRadius/1e3,meters:a.earthRadius,metres:a.earthRadius,miles:a.earthRadius/1609.344,millimeters:1e3*a.earthRadius,millimetres:1e3*a.earthRadius,nauticalmiles:a.earthRadius/1852,radians:1,yards:1.0936*a.earthRadius},a.unitsFactors={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:.001,kilometres:.001,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/a.earthRadius,yards:1.0936133},a.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046},a.feature=s,a.geometry=function(e,t,i){switch(e){case"Point":return r(t).geometry;case"LineString":return o(t).geometry;case"Polygon":return n(t).geometry;case"MultiPoint":return c(t).geometry;case"MultiLineString":return u(t).geometry;case"MultiPolygon":return d(t).geometry;default:throw new Error(e+" is invalid")}},a.point=r,a.points=function(e,t,i){return void 0===i&&(i={}),l(e.map(function(e){return r(e,t)}),i)},a.polygon=n,a.polygons=function(e,t,i){return void 0===i&&(i={}),l(e.map(function(e){return n(e,t)}),i)},a.lineString=o,a.lineStrings=function(e,t,i){return void 0===i&&(i={}),l(e.map(function(e){return o(e,t)}),i)},a.featureCollection=l,a.multiLineString=u,a.multiPoint=c,a.multiPolygon=d,a.geometryCollection=function(e,t,i){return void 0===i&&(i={}),s({type:"GeometryCollection",geometries:e},t,i)},a.round=function(e,t){if(void 0===t&&(t=0),t&&!(0<=t))throw new Error("precision must be a positive number");var i=Math.pow(10,t||0);return Math.round(e*i)/i},a.radiansToLength=h,a.lengthToRadians=p,a.lengthToDegrees=function(e,t){return i(p(e,t))},a.bearingToAzimuth=function(e){var t=e%360;return t<0&&(t+=360),t},a.radiansToDegrees=i,a.degreesToRadians=function(e){return e%360*Math.PI/180},a.convertLength=function(e,t,i){if(void 0===t&&(t="kilometers"),void 0===i&&(i="kilometers"),!(0<=e))throw new Error("length must be a positive number");return h(p(e,t),i)},a.convertArea=function(e,t,i){if(void 0===t&&(t="meters"),void 0===i&&(i="kilometers"),!(0<=e))throw new Error("area must be a positive number");var r=a.areaFactors[t];if(!r)throw new Error("invalid original units");var n=a.areaFactors[i];if(!n)throw new Error("invalid final units");return e/r*n},a.isNumber=f,a.isObject=function(e){return!!e&&e.constructor===Object},a.validateBBox=function(e){if(!e)throw new Error("bbox is required");if(!Array.isArray(e))throw new Error("bbox must be an Array");if(4!==e.length&&6!==e.length)throw new Error("bbox must be an Array of 4 or 6 numbers");e.forEach(function(e){if(!f(e))throw new Error("bbox must only contain numbers")})},a.validateId=function(e){if(!e)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof e))throw new Error("id must be a number or a string")}});function ki(e,t,i){if(null!==e)for(var r,n,a,o,s,l,u,c,d=0,h=0,p=e.type,f="FeatureCollection"===p,m="Feature"===p,g=f?e.features.length:1,y=0;y<g;y++){s=(c=!!(u=f?e.features[y].geometry:m?e.geometry:e)&&"GeometryCollection"===u.type)?u.geometries.length:1;for(var v=0;v<s;v++){var _=0,C=0;if(null!==(o=c?u.geometries[v]:u)){l=o.coordinates;var x=o.type;switch(d=!i||"Polygon"!==x&&"MultiPolygon"!==x?0:1,x){case null:break;case"Point":if(!1===t(l,h,y,_,C))return!1;h++,_++;break;case"LineString":case"MultiPoint":for(r=0;r<l.length;r++){if(!1===t(l[r],h,y,_,C))return!1;h++,"MultiPoint"===x&&_++}"LineString"===x&&_++;break;case"Polygon":case"MultiLineString":for(r=0;r<l.length;r++){for(n=0;n<l[r].length-d;n++){if(!1===t(l[r][n],h,y,_,C))return!1;h++}"MultiLineString"===x&&_++,"Polygon"===x&&C++}"Polygon"===x&&_++;break;case"MultiPolygon":for(r=0;r<l.length;r++){for(n=C=0;n<l[r].length;n++){for(a=0;a<l[r][n].length-d;a++){if(!1===t(l[r][n][a],h,y,_,C))return!1;h++}C++}_++}break;case"GeometryCollection":for(r=0;r<o.geometries.length;r++)if(!1===ki(o.geometries[r],t,i))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function Bi(e,t){var i;switch(e.type){case"FeatureCollection":for(i=0;i<e.features.length&&!1!==t(e.features[i].properties,i);i++);break;case"Feature":t(e.properties,0)}}function Fi(e,t){if("Feature"===e.type)t(e,0);else if("FeatureCollection"===e.type)for(var i=0;i<e.features.length&&!1!==t(e.features[i],i);i++);}function Vi(e,t){var i,r,n,a,o,s,l,u,c,d,h=0,p="FeatureCollection"===e.type,f="Feature"===e.type,m=p?e.features.length:1;for(i=0;i<m;i++){for(s=p?e.features[i].geometry:f?e.geometry:e,u=p?e.features[i].properties:f?e.properties:{},c=p?e.features[i].bbox:f?e.bbox:void 0,d=p?e.features[i].id:f?e.id:void 0,o=(l=!!s&&"GeometryCollection"===s.type)?s.geometries.length:1,n=0;n<o;n++)if(null!==(a=l?s.geometries[n]:s))switch(a.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===t(a,h,u,c,d))return!1;break;case"GeometryCollection":for(r=0;r<a.geometries.length;r++)if(!1===t(a.geometries[r],h,u,c,d))return!1;break;default:throw new Error("Unknown Geometry Type")}else if(!1===t(null,h,u,c,d))return!1;h++}}function zi(e,u){Vi(e,function(e,t,i,r,n){var a,o=null===e?null:e.type;switch(o){case null:case"Point":case"LineString":case"Polygon":return!1!==u(Ni.feature(e,i,{bbox:r,id:n}),t,0)&&void 0}switch(o){case"MultiPoint":a="Point";break;case"MultiLineString":a="LineString";break;case"MultiPolygon":a="Polygon"}for(var s=0;s<e.coordinates.length;s++){var l={type:a,coordinates:e.coordinates[s]};if(!1===u(Ni.feature(l,i),t,s))return!1}})}function Ui(e,f){zi(e,function(o,s,l){var u=0;if(o.geometry){var e=o.geometry.type;if("Point"!==e&&"MultiPoint"!==e){var c,d=0,h=0,p=0;return!1!==ki(o,function(e,t,i,r,n){if(void 0===c||d<s||h<r||p<n)return c=e,d=s,h=r,p=n,void(u=0);var a=Ni.lineString([c,e],o.properties);if(!1===f(a,s,l,n,u))return!1;u++,c=e})&&void 0}}})}function Gi(e,o){if(!e)throw new Error("geojson is required");zi(e,function(e,t,i){if(null!==e.geometry){var r=e.geometry.type,n=e.geometry.coordinates;switch(r){case"LineString":if(!1===o(e,t,i,0,0))return!1;break;case"Polygon":for(var a=0;a<n.length;a++)if(!1===o(Ni.lineString(n[a],e.properties),t,i,a))return!1}}})}var $i=ki,Hi=Bi,Wi=Fi,ji=Vi,qi=zi,Qi=Ui,Yi=Gi,Xi=Object.defineProperty({coordEach:$i,coordReduce:function(e,a,o,t){var s=o;return ki(e,function(e,t,i,r,n){s=0===t&&void 0===o?e:a(s,e,t,i,r,n)},t),s},propEach:Hi,propReduce:function(e,i,r){var n=r;return Bi(e,function(e,t){n=0===t&&void 0===r?e:i(n,e,t)}),n},featureEach:Wi,featureReduce:function(e,i,r){var n=r;return Fi(e,function(e,t){n=0===t&&void 0===r?e:i(n,e,t)}),n},coordAll:function(e){var t=[];return ki(e,function(e){t.push(e)}),t},geomEach:ji,geomReduce:function(e,a,o){var s=o;return Vi(e,function(e,t,i,r,n){s=0===t&&void 0===o?e:a(s,e,t,i,r,n)}),s},flattenEach:qi,flattenReduce:function(e,r,n){var a=n;return zi(e,function(e,t,i){a=0===t&&0===i&&void 0===n?e:r(a,e,t,i)}),a},segmentEach:Qi,segmentReduce:function(e,a,o){var s=o,l=!1;return Ui(e,function(e,t,i,r,n){s=!1===l&&void 0===o?e:a(s,e,t,i,r,n),l=!0}),s},lineEach:Yi,lineReduce:function(e,n,a){var o=a;return Gi(e,function(e,t,i,r){o=0===t&&void 0===a?e:n(o,e,t,i,r)}),o},findSegment:function(e,t){if(t=t||{},!Ni.isObject(t))throw new Error("options is invalid");var i,r=t.featureIndex||0,n=t.multiFeatureIndex||0,a=t.geometryIndex||0,o=t.segmentIndex||0,s=t.properties;switch(e.type){case"FeatureCollection":r<0&&(r=e.features.length+r),s=s||e.features[r].properties,i=e.features[r].geometry;break;case"Feature":s=s||e.properties,i=e.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":i=e;break;default:throw new Error("geojson is invalid")}if(null===i)return null;var l=i.coordinates;switch(i.type){case"Point":case"MultiPoint":return null;case"LineString":return o<0&&(o=l.length+o-1),Ni.lineString([l[o],l[o+1]],s,t);case"Polygon":return a<0&&(a=l.length+a),o<0&&(o=l[a].length+o-1),Ni.lineString([l[a][o],l[a][o+1]],s,t);case"MultiLineString":return n<0&&(n=l.length+n),o<0&&(o=l[n].length+o-1),Ni.lineString([l[n][o],l[n][o+1]],s,t);case"MultiPolygon":return n<0&&(n=l.length+n),a<0&&(a=l[n].length+a),o<0&&(o=l[n][a].length-o-1),Ni.lineString([l[n][a][o],l[n][a][o+1]],s,t)}throw new Error("geojson is invalid")},findPoint:function(e,t){if(t=t||{},!Ni.isObject(t))throw new Error("options is invalid");var i,r=t.featureIndex||0,n=t.multiFeatureIndex||0,a=t.geometryIndex||0,o=t.coordIndex||0,s=t.properties;switch(e.type){case"FeatureCollection":r<0&&(r=e.features.length+r),s=s||e.features[r].properties,i=e.features[r].geometry;break;case"Feature":s=s||e.properties,i=e.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":i=e;break;default:throw new Error("geojson is invalid")}if(null===i)return null;var l=i.coordinates;switch(i.type){case"Point":return Ni.point(l,s,t);case"MultiPoint":return n<0&&(n=l.length+n),Ni.point(l[n],s,t);case"LineString":return o<0&&(o=l.length+o),Ni.point(l[o],s,t);case"Polygon":return a<0&&(a=l.length+a),o<0&&(o=l[a].length+o),Ni.point(l[a][o],s,t);case"MultiLineString":return n<0&&(n=l.length+n),o<0&&(o=l[n].length+o),Ni.point(l[n][o],s,t);case"MultiPolygon":return n<0&&(n=l.length+n),a<0&&(a=l[n].length+a),o<0&&(o=l[n][a].length-o),Ni.point(l[n][a][o],s,t)}throw new Error("geojson is invalid")}},"__esModule",{value:!0});function Zi(e){var t=[1/0,1/0,-1/0,-1/0];return Xi.coordEach(e,function(e){t[0]>e[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]<e[0]&&(t[2]=e[0]),t[3]<e[1]&&(t[3]=e[1])}),t}var Ji=Zi.default=Zi,Ki=Object.defineProperty({default:Ji},"__esModule",{value:!0}).default,er=Xi.featureEach,tr=(Xi.coordEach,Ni.polygon,Ni.featureCollection);function ir(e){var t=be(e);return t.insert=function(e){if("Feature"!==e.type)throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:Ki(e),be.prototype.insert.call(this,e)},t.load=function(e){var t=[];return Array.isArray(e)?e.forEach(function(e){if("Feature"!==e.type)throw new Error("invalid features");e.bbox=e.bbox?e.bbox:Ki(e),t.push(e)}):er(e,function(e){if("Feature"!==e.type)throw new Error("invalid features");e.bbox=e.bbox?e.bbox:Ki(e),t.push(e)}),be.prototype.load.call(this,t)},t.remove=function(e,t){if("Feature"!==e.type)throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:Ki(e),be.prototype.remove.call(this,e,t)},t.clear=function(){return be.prototype.clear.call(this)},t.search=function(e){var t=be.prototype.search.call(this,this.toBBox(e));return tr(t)},t.collides=function(e){return be.prototype.collides.call(this,this.toBBox(e))},t.all=function(){var e=be.prototype.all.call(this);return tr(e)},t.toJSON=function(){return be.prototype.toJSON.call(this)},t.fromJSON=function(e){return be.prototype.fromJSON.call(this,e)},t.toBBox=function(e){var t;if(e.bbox)t=e.bbox;else if(Array.isArray(e)&&4===e.length)t=e;else if(Array.isArray(e)&&6===e.length)t=[e[0],e[1],e[3],e[4]];else if("Feature"===e.type)t=Ki(e);else{if("FeatureCollection"!==e.type)throw new Error("invalid geojson");t=Ki(e)}return{minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]}},t}var rr=ir,nr=ir;function ar(e,t){var n={},a=[];if("LineString"===e.type&&(e=G(e)),"LineString"===t.type&&(t=G(t)),"Feature"===e.type&&"Feature"===t.type&&null!==e.geometry&&null!==t.geometry&&"LineString"===e.geometry.type&&"LineString"===t.geometry.type&&2===e.geometry.coordinates.length&&2===t.geometry.coordinates.length){var i=or(e,t);return i&&a.push(i),W(a)}var o=rr();return o.load(Li(t)),N(Li(e),function(r){N(o.search(r),function(e){var t=or(r,e);if(t){var i=w(t).join(",");n[i]||(n[i]=!0,a.push(t))}})}),W(a)}function or(e,t){var i=w(e),r=w(t);if(2!==i.length)throw new Error("<intersects> line1 must only contain 2 coordinates");if(2!==r.length)throw new Error("<intersects> line2 must only contain 2 coordinates");var n=i[0][0],a=i[0][1],o=i[1][0],s=i[1][1],l=r[0][0],u=r[0][1],c=r[1][0],d=r[1][1],h=(d-u)*(o-n)-(c-l)*(s-a),p=(c-l)*(a-u)-(d-u)*(n-l),f=(o-n)*(a-u)-(s-a)*(n-l);if(0==h)return null;var m=p/h,g=f/h;return 0<=m&&m<=1&&0<=g&&g<=1?$([n+m*(o-n),a+m*(s-a)]):null}function sr(e,h,p){void 0===p&&(p={});var f=$([1/0,1/0],{dist:1/0}),m=0;return U(e,function(e){for(var t=w(e),i=0;i<t.length-1;i++){var r=$(t[i]);r.properties.dist=mt(h,r,p);var n=$(t[i+1]);n.properties.dist=mt(h,n,p);var a=mt(r,n,p),o=Math.max(r.properties.dist,n.properties.dist),s=ni(r,n),l=ii(h,o,s+90,p),u=ii(h,o,s-90,p),c=ar(H([l.geometry.coordinates,u.geometry.coordinates]),H([r.geometry.coordinates,n.geometry.coordinates])),d=null;0<c.features.length&&((d=c.features[0]).properties.dist=mt(h,d,p),d.properties.location=m+mt(r,d,p)),r.properties.dist<f.properties.dist&&((f=r).properties.index=i,f.properties.location=m),n.properties.dist<f.properties.dist&&((f=n).properties.index=i+1,f.properties.location=m+a),d&&d.properties.dist<f.properties.dist&&((f=d).properties.index=i),m+=a}}),f}function lr(e,t,i){void 0===i&&(i={});var r=Q(e),n=Q(t);return n[0]+=180<n[0]-r[0]?-360:180<r[0]-n[0]?360:0,C(function(e,t,i){var r=i=void 0===i?p:Number(i),n=e[1]*Math.PI/180,a=t[1]*Math.PI/180,o=a-n,s=Math.abs(t[0]-e[0])*Math.PI/180;s>Math.PI&&(s-=2*Math.PI);var l=Math.log(Math.tan(a/2+Math.PI/4)/Math.tan(n/2+Math.PI/4)),u=1e-11<Math.abs(l)?o/l:Math.cos(n);return Math.sqrt(o*o+u*u*s*s)*r}(r,n),"meters",i.units)}function ur(e,t,n){if(void 0===n&&(n={}),n.method||(n.method="geodesic"),n.units||(n.units="kilometers"),!e)throw new Error("pt is required");if(Array.isArray(e)?e=$(e):"Point"===e.type?e=G(e):P(e,"Point","point"),!t)throw new Error("line is required");Array.isArray(t)?t=H(t):"LineString"===t.type?t=G(t):P(t,"LineString","line");var a=1/0,o=e.geometry.coordinates;return J(t,function(e){var t=e.geometry.coordinates[0],i=e.geometry.coordinates[1],r=function(e,t,i,r){var n=[i[0]-t[0],i[1]-t[1]],a=cr([e[0]-t[0],e[1]-t[1]],n);if(a<=0)return dr(e,t,{method:r.method,units:"degrees"});var o=cr(n,n);if(o<=a)return dr(e,i,{method:r.method,units:"degrees"});var s=a/o,l=[t[0]+s*n[0],t[1]+s*n[1]];return dr(e,l,{method:r.method,units:"degrees"})}(o,t,i,n);r<a&&(a=r)}),C(a,"degrees",n.units)}function cr(e,t){return e[0]*t[0]+e[1]*t[1]}function dr(e,t,i){return"planar"===i.method?lr(e,t,i):mt(e,t,i)}function hr(e){for(var t=function(e){return"FeatureCollection"!==e.type?"Feature"!==e.type?W([G(e)]):W([e]):e}(e),i=ai(t),r=!1,n=0;!r&&n<t.features.length;){var a,o=t.features[n].geometry,s=!1;if("Point"===o.type)i.geometry.coordinates[0]===o.coordinates[0]&&i.geometry.coordinates[1]===o.coordinates[1]&&(r=!0);else if("MultiPoint"===o.type){var l=!1;for(a=0;!l&&a<o.coordinates.length;)i.geometry.coordinates[0]===o.coordinates[a][0]&&i.geometry.coordinates[1]===o.coordinates[a][1]&&(l=r=!0),a++}else if("LineString"===o.type)for(a=0;!s&&a<o.coordinates.length-1;)pr(i.geometry.coordinates[0],i.geometry.coordinates[1],o.coordinates[a][0],o.coordinates[a][1],o.coordinates[a+1][0],o.coordinates[a+1][1])&&(r=s=!0),a++;else if("MultiLineString"===o.type)for(var u=0;u<o.coordinates.length;){s=!1,a=0;for(var c=o.coordinates[u];!s&&a<c.length-1;)pr(i.geometry.coordinates[0],i.geometry.coordinates[1],c[a][0],c[a][1],c[a+1][0],c[a+1][1])&&(r=s=!0),a++;u++}else"Polygon"!==o.type&&"MultiPolygon"!==o.type||ht(i,o)&&(r=!0);n++}if(r)return i;var d=W([]);for(n=0;n<t.features.length;n++)d.features=d.features.concat(si(t.features[n]).features);return $(Ri(i,d).geometry.coordinates)}function pr(e,t,i,r,n,a){return Math.sqrt((n-i)*(n-i)+(a-r)*(a-r))===Math.sqrt((e-i)*(e-i)+(t-r)*(t-r))+Math.sqrt((n-e)*(n-e)+(a-t)*(a-t))}rr.default=nr;var fr=6378137;function mr(e){return z(e,function(e,t){return e+function(e){var t,i=0;switch(e.type){case"Polygon":return gr(e.coordinates);case"MultiPolygon":for(t=0;t<e.coordinates.length;t++)i+=gr(e.coordinates[t]);return i;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0}return 0}(t)},0)}function gr(e){var t=0;if(e&&0<e.length){t+=Math.abs(yr(e[0]));for(var i=1;i<e.length;i++)t-=Math.abs(yr(e[i]))}return t}function yr(e){var t,i,r,n,a,o,s=0,l=e.length;if(2<l){for(o=0;o<l;o++)a=o===l-2?(r=l-2,n=l-1,0):o===l-1?(r=l-1,n=0,1):(n=(r=o)+1,o+2),t=e[r],i=e[n],s+=(vr(e[a][0])-vr(t[0]))*Math.sin(vr(i[1]));s=s*fr*fr/2}return s}function vr(e){return e*Math.PI/180}function _r(e,r){return void 0===r&&(r={}),K(e,function(e,t){var i=t.geometry.coordinates;return e+mt(i[0],i[1],r)},0)}function Cr(e,t,i,r){if(!q(r=r||{}))throw new Error("options is invalid");var n,a=[];if("Feature"===e.type)n=e.geometry.coordinates;else{if("LineString"!==e.type)throw new Error("input must be a LineString Feature or Geometry");n=e.coordinates}for(var o,s,l,u=n.length,c=0,d=0;d<n.length&&!(c<=t&&d===n.length-1);d++){if(t<c&&0===a.length){if(!(o=t-c))return a.push(n[d]),H(a);s=ni(n[d],n[d-1])-180,l=ii(n[d],o,s,r),a.push(l.geometry.coordinates)}if(i<=c)return(o=i-c)?(s=ni(n[d],n[d-1])-180,l=ii(n[d],o,s,r),a.push(l.geometry.coordinates)):a.push(n[d]),H(a);if(t<=c&&a.push(n[d]),d===n.length-1)return H(a);c+=mt(n[d],n[d+1],r)}if(c<t&&n.length===u)throw new Error("Start position is beyond line");var h=n[n.length-1];return H([h,h])}function xr(e,t,i){void 0===i&&(i={});for(var r=Q(e),n=w(t),a=0;a<n.length-1;a++){var o=!1;if(i.ignoreEndVertices&&(0===a&&(o="start"),a===n.length-2&&(o="end"),0===a&&a+1===n.length-1&&(o="both")),br(n[a],n[a+1],r,o,void 0===i.epsilon?null:i.epsilon))return!0}return!1}function br(e,t,i,r,n){var a=i[0],o=i[1],s=e[0],l=e[1],u=t[0],c=t[1],d=u-s,h=c-l,p=(i[0]-s)*h-(i[1]-l)*d;if(null!==n){if(Math.abs(p)>n)return!1}else if(0!=p)return!1;return r?"start"===r?Math.abs(d)>=Math.abs(h)?0<d?s<a&&a<=u:u<=a&&a<s:0<h?l<o&&o<=c:c<=o&&o<l:"end"===r?Math.abs(d)>=Math.abs(h)?0<d?s<=a&&a<u:u<a&&a<=s:0<h?l<=o&&o<c:c<o&&o<=l:"both"===r&&(Math.abs(d)>=Math.abs(h)?0<d?s<a&&a<u:u<a&&a<s:0<h?l<o&&o<c:c<o&&o<l):Math.abs(d)>=Math.abs(h)?0<d?s<=a&&a<=u:u<=a&&a<=s:0<h?l<=o&&o<=c:c<=o&&o<=l}function Ar(e,t){var i=Y(e),r=Y(t),n=i.type,a=r.type;switch(n){case"Point":switch(a){case"MultiPoint":return function(e,t){var i,r=!1;for(i=0;i<t.coordinates.length;i++)if(wr(t.coordinates[i],e.coordinates)){r=!0;break}return r}(i,r);case"LineString":return xr(i,r,{ignoreEndVertices:!0});case"Polygon":case"MultiPolygon":return ht(i,r,{ignoreBoundary:!0});default:throw new Error("feature2 "+a+" geometry not supported")}case"MultiPoint":switch(a){case"MultiPoint":return function(e,t){for(var i=0;i<e.coordinates.length;i++){for(var r=!1,n=0;n<t.coordinates.length;n++)wr(e.coordinates[i],t.coordinates[n])&&(r=!0);if(!r)return!1}return!0}(i,r);case"LineString":return function(e,t){for(var i=!1,r=0;r<e.coordinates.length;r++){if(!xr(e.coordinates[r],t))return!1;i=i||xr(e.coordinates[r],t,{ignoreEndVertices:!0})}return i}(i,r);case"Polygon":case"MultiPolygon":return function(e,t){for(var i=!0,r=!1,n=0;n<e.coordinates.length;n++){if(!(r=ht(e.coordinates[1],t))){i=!1;break}r=ht(e.coordinates[1],t,{ignoreBoundary:!0})}return i&&r}(i,r);default:throw new Error("feature2 "+a+" geometry not supported")}case"LineString":switch(a){case"LineString":return function(e,t){for(var i=0;i<e.coordinates.length;i++)if(!xr(e.coordinates[i],t))return!1;return!0}(i,r);case"Polygon":case"MultiPolygon":return function(e,t){var i,r,n=ae(t),a=ae(e);if(!Sr(n,a))return!1;for(var o=!1,s=0;s<e.coordinates.length-1;s++){if(!ht(e.coordinates[s],t))return!1;o=(o=o||ht(e.coordinates[s],t,{ignoreBoundary:!0}))||ht((i=e.coordinates[s],r=e.coordinates[s+1],[(i[0]+r[0])/2,(i[1]+r[1])/2]),t,{ignoreBoundary:!0})}return o}(i,r);default:throw new Error("feature2 "+a+" geometry not supported")}case"Polygon":switch(a){case"Polygon":case"MultiPolygon":return function(e,t){var i=ae(e);if(!Sr(ae(t),i))return!1;for(var r=0;r<e.coordinates[0].length;r++)if(!ht(e.coordinates[0][r],t))return!1;return!0}(i,r);default:throw new Error("feature2 "+a+" geometry not supported")}default:throw new Error("feature1 "+n+" geometry not supported")}}function Sr(e,t){return!(e[0]>t[0]||e[2]<t[2]||e[1]>t[1]||e[3]<t[3])}function wr(e,t){return e[0]===t[0]&&e[1]===t[1]}function Er(e,t,i){void 0===i&&(i={}),i.mask&&!i.units&&(i.units="kilometers");for(var r=[],n=e[0],a=e[1],o=e[2],s=e[3],l=t/mt([n,a],[o,a],i)*(o-n),u=t/mt([n,a],[n,s],i)*(s-a),c=o-n,d=s-a,h=Math.floor(c/l),p=(d-Math.floor(d/u)*u)/2,f=n+(c-h*l)/2;f<=o;){for(var m=a+p;m<=s;){var g=$([f,m],i.properties);i.mask?Ar(g,i.mask)&&r.push(g):r.push(g),m+=u}f+=l}return W(r)}function Tr(e,t){void 0===t&&(t={});var i=t.precision,r=t.coordinates,n=t.mutate;if(i=null==i||isNaN(i)?6:i,r=null==r||isNaN(r)?3:r,!e)throw new Error("<geojson> is required");if("number"!=typeof i)throw new Error("<precision> must be a number");if("number"!=typeof r)throw new Error("<coordinates> must be a number");!1!==n&&void 0!==n||(e=JSON.parse(JSON.stringify(e)));var a=Math.pow(10,i);return I(e,function(e){!function(e,t,i){e.length>i&&e.splice(i,e.length);for(var r=0;r<e.length;r++)e[r]=Math.round(e[r]*t)/t}(e,a,r)}),e}function Pr(e,t){if(!e||!t)return!1;if(e.length!==t.length)return!1;for(var i=0,r=e.length;i<r;i++)if(e[i]instanceof Array&&t[i]instanceof Array){if(!Pr(e[i],t[i]))return!1}else if(e[i]!==t[i])return!1;return!0}var Mr=function(e,t,i,r,n){this.coord=e,this.param=t,this.ringAndEdgeIn=i,this.ringAndEdgeOut=r,this.nxtIsectAlongEdgeIn=n},Dr=function(e,t,i,r,n,a,o){this.coord=e,this.ringAndEdge1=t,this.ringAndEdge2=i,this.nxtIsectAlongRingAndEdge1=r,this.nxtIsectAlongRingAndEdge2=n,this.ringAndEdge1Walkable=a,this.ringAndEdge2Walkable=o};function Ir(e,t){if(void 0===t&&(t=!0),3!=e.length)throw new Error("This function requires an array of three points [x,y]");return 0<=(e[1][0]-e[0][0])*(e[2][1]-e[0][1])-(e[1][1]-e[0][1])*(e[2][0]-e[0][0])==t}function Or(e){for(var t=0,i=0;i<e.length-1;i++)e[i][0]<e[t][0]&&(t=i);if(Ir([e[Lr(t-1,e.length-1)],e[t],e[Lr(t+1,e.length-1)]],!0))var r=1;else r=-1;return r}function Rr(e,t){if(!e||!t)return!1;if(e.length!=t.length)return!1;for(var i=0,r=e.length;i<r;i++)if(e[i]instanceof Array&&t[i]instanceof Array){if(!Rr(e[i],t[i]))return!1}else if(e[i]!=t[i])return!1;return!0}function Lr(e,t){return(e%t+t)%t}var Nr=Math.PI/180,kr=180/Math.PI,Br=function(e,t){this.lon=e,this.lat=t,this.x=Nr*e,this.y=Nr*t};Br.prototype.view=function(){return String(this.lon).slice(0,4)+","+String(this.lat).slice(0,4)},Br.prototype.antipode=function(){var e=-1*this.lat,t=this.lon<0?180+this.lon:-1*(180-this.lon);return new Br(t,e)};var Fr=function(){this.coords=[],this.length=0};Fr.prototype.move_to=function(e){this.length++,this.coords.push(e)};var Vr=function(e){this.properties=e||{},this.geometries=[]};Vr.prototype.json=function(){if(this.geometries.length<=0)return{geometry:{type:"LineString",coordinates:null},type:"Feature",properties:this.properties};if(1===this.geometries.length)return{geometry:{type:"LineString",coordinates:this.geometries[0].coords},type:"Feature",properties:this.properties};for(var e=[],t=0;t<this.geometries.length;t++)e.push(this.geometries[t].coords);return{geometry:{type:"MultiLineString",coordinates:e},type:"Feature",properties:this.properties}},Vr.prototype.wkt=function(){for(var e="",t="LINESTRING(",i=function(e){t+=e[0]+" "+e[1]+","},r=0;r<this.geometries.length;r++){if(0===this.geometries[r].coords.length)return"LINESTRING(empty)";this.geometries[r].coords.forEach(i),e+=t.substring(0,t.length-1)+")"}return e};var zr=function(e,t,i){if(!e||void 0===e.x||void 0===e.y)throw new Error("GreatCircle constructor expects two args: start and end objects with x and y properties");if(!t||void 0===t.x||void 0===t.y)throw new Error("GreatCircle constructor expects two args: start and end objects with x and y properties");this.start=new Br(e.x,e.y),this.end=new Br(t.x,t.y),this.properties=i||{};var r=this.start.x-this.end.x,n=this.start.y-this.end.y,a=Math.pow(Math.sin(n/2),2)+Math.cos(this.start.y)*Math.cos(this.end.y)*Math.pow(Math.sin(r/2),2);if(this.g=2*Math.asin(Math.sqrt(a)),this.g===Math.PI)throw new Error("it appears "+e.view()+" and "+t.view()+" are 'antipodal', e.g diametrically opposite, thus there is no single route but rather infinite");if(isNaN(this.g))throw new Error("could not calculate great circle between "+e+" and "+t)};function Ur(r,e){var n=[],a=rr();return U(e,function(e){if(n.forEach(function(e,t){e.id=t}),n.length){var t=a.search(e);if(t.features.length){var i=$r(e,t);n=n.filter(function(e){return e.id!==i.id}),a.remove(i),N(Gr(i,e),function(e){n.push(e),a.insert(e)})}}else(n=Gr(r,e).features).forEach(function(e){e.bbox||(e.bbox=ti(ae(e)))}),a.load(W(n))}),W(n)}function Gr(e,a){var o=[],t=w(e)[0],i=w(e)[e.geometry.coordinates.length-1];if(Hr(t,Q(a))||Hr(i,Q(a)))return W([e]);var r=rr(),n=Li(e);r.load(n);var s=r.search(a);if(!s.features.length)return W([e]);var l=$r(a,s),u=k(n,function(e,t,i){var r=w(t)[1],n=Q(a);return i===l.id?(e.push(n),o.push(H(e)),Hr(n,r)?[n]:[n,r]):(e.push(r),e)},[t]);return 1<u.length&&o.push(H(u)),W(o)}function $r(i,e){if(!e.features.length)throw new Error("lines must contain features");if(1===e.features.length)return e.features[0];var r,n=1/0;return N(e,function(e){var t=sr(e,i).properties.dist;t<n&&(r=e,n=t)}),r}function Hr(e,t){return e[0]===t[0]&&e[1]===t[1]}function Wr(e,t,i,r,n){void 0===n&&(n={});var a=n.steps||64,o=jr(i),s=jr(r),l=Array.isArray(e)||"Feature"!==e.type?{}:e.properties;if(o===s)return H(ri(e,t,n).geometry.coordinates[0],l);for(var u=o,c=o<s?s:s+360,d=u,h=[],p=0;d<c;)h.push(ii(e,t,d,n).geometry.coordinates),d=u+360*++p/a;return c<d&&h.push(ii(e,t,c,n).geometry.coordinates),H(h,l)}function jr(e){var t=e%360;return t<0&&(t+=360),t}function qr(e,t){void 0===t&&(t={});var i=Y(e);switch(t.properties||"Feature"!==e.type||(t.properties=e.properties),i.type){case"Polygon":return Qr(i,t);case"MultiPolygon":return function(e,t){void 0===t&&(t={});var i=Y(e).coordinates,r=t.properties?t.properties:"Feature"===e.type?e.properties:{},n=[];return i.forEach(function(e){n.push(Yr(e,r))}),W(n)}(i,t);default:throw new Error("invalid poly")}}function Qr(e,t){return void 0===t&&(t={}),Yr(Y(e).coordinates,t.properties?t.properties:"Feature"===e.type?e.properties:{})}function Yr(e,t){return 1<e.length?c(e,t):H(e[0],t)}function Xr(e,t){var i,r,n;void 0===t&&(t={});var a=t.properties,o=null===(i=t.autoComplete)||void 0===i||i,s=null===(r=t.orderCoords)||void 0===r||r;switch(null!==(n=t.mutate)&&void 0!==n&&n||(e=Ct(e)),e.type){case"FeatureCollection":var l=[];return e.features.forEach(function(e){l.push(w(Zr(e,{},o,s)))}),d(l,a);default:return Zr(e,a,o,s)}}function Zr(e,t,i,r){t=t||("Feature"===e.type?e.properties:{});var n=Y(e),a=n.coordinates,o=n.type;if(!a.length)throw new Error("line must contain coordinates");switch(o){case"LineString":return i&&(a=Jr(a)),V([a],t);case"MultiLineString":var s=[],l=0;return a.forEach(function(e){if(i&&(e=Jr(e)),r){var t=function(e){var t=e[0],i=e[1],r=e[2],n=e[3];return Math.abs(t-r)*Math.abs(i-n)}(ae(H(e)));l<t?(s.unshift(e),l=t):s.push(e)}else s.push(e)}),V(s,t);default:throw new Error("geometry type "+o+" is not supported")}}function Jr(e){var t=e[0],i=t[0],r=t[1],n=e[e.length-1],a=n[0],o=n[1];return i===a&&r===o||e.push(t),e}function Kr(e,t){var i,r,n,a,o,s,l;for(r=1;r<=8;r*=2){for(i=[],a=!(tn(n=e[e.length-1],t)&r),o=0;o<e.length;o++)(l=!(tn(s=e[o],t)&r))!==a&&i.push(en(n,s,r,t)),l&&i.push(s),n=s,a=l;if(!(e=i).length)break}return i}function en(e,t,i,r){return 8&i?[e[0]+(t[0]-e[0])*(r[3]-e[1])/(t[1]-e[1]),r[3]]:4&i?[e[0]+(t[0]-e[0])*(r[1]-e[1])/(t[1]-e[1]),r[1]]:2&i?[r[2],e[1]+(t[1]-e[1])*(r[2]-e[0])/(t[0]-e[0])]:1&i?[r[0],e[1]+(t[1]-e[1])*(r[0]-e[0])/(t[0]-e[0])]:null}function tn(e,t){var i=0;return e[0]<t[0]?i|=1:e[0]>t[2]&&(i|=2),e[1]<t[1]?i|=4:e[1]>t[3]&&(i|=8),i}function rn(e,t){for(var i=[],r=0,n=e;r<n.length;r++){var a=Kr(n[r],t);0<a.length&&(a[0][0]===a[a.length-1][0]&&a[0][1]===a[a.length-1][1]||a.push(a[0]),4<=a.length&&i.push(a))}return i}zr.prototype.interpolate=function(e){var t=Math.sin((1-e)*this.g)/Math.sin(this.g),i=Math.sin(e*this.g)/Math.sin(this.g),r=t*Math.cos(this.start.y)*Math.cos(this.start.x)+i*Math.cos(this.end.y)*Math.cos(this.end.x),n=t*Math.cos(this.start.y)*Math.sin(this.start.x)+i*Math.cos(this.end.y)*Math.sin(this.end.x),a=t*Math.sin(this.start.y)+i*Math.sin(this.end.y),o=kr*Math.atan2(a,Math.sqrt(Math.pow(r,2)+Math.pow(n,2)));return[kr*Math.atan2(n,r),o]},zr.prototype.Arc=function(e,t){var i=[];if(!e||e<=2)i.push([this.start.lon,this.start.lat]),i.push([this.end.lon,this.end.lat]);else for(var r=1/(e-1),n=0;n<e;++n){var a=r*n,o=this.interpolate(a);i.push(o)}for(var s=!1,l=0,u=t&&t.offset?t.offset:10,c=180-u,d=-180+u,h=360-u,p=1;p<i.length;++p){var f=i[p-1][0],m=i[p][0],g=Math.abs(m-f);h<g&&(c<m&&f<d||c<f&&m<d)?s=!0:l<g&&(l=g)}var y=[];if(s&&l<u){var v=[];y.push(v);for(var _=0;_<i.length;++_){var C=parseFloat(i[_][0]);if(0<_&&Math.abs(C-i[_-1][0])>h){var x=parseFloat(i[_-1][0]),b=parseFloat(i[_-1][1]),A=parseFloat(i[_][0]),S=parseFloat(i[_][1]);if(-180<x&&x<d&&180===A&&_+1<i.length&&-180<i[_-1][0]&&i[_-1][0]<d){v.push([-180,i[_][1]]),_++,v.push([i[_][0],i[_][1]]);continue}if(c<x&&x<180&&-180===A&&_+1<i.length&&i[_-1][0]>c&&i[_-1][0]<180){v.push([180,i[_][1]]),_++,v.push([i[_][0],i[_][1]]);continue}if(x<d&&c<A){var w=x;x=A,A=w;var E=b;b=S,S=E}if(c<x&&A<d&&(A+=360),x<=180&&180<=A&&x<A){var T=(180-x)/(A-x),P=T*S+(1-T)*b;v.push([i[_-1][0]>c?180:-180,P]),(v=[]).push([i[_-1][0]>c?-180:180,P]),y.push(v)}else v=[],y.push(v);v.push([C,i[_][1]])}else v.push([i[_][0],i[_][1]])}}else{var M=[];y.push(M);for(var D=0;D<i.length;++D)M.push([i[D][0],i[D][1]])}for(var I=new Vr(this.properties),O=0;O<y.length;++O){var R=new Fr;I.geometries.push(R);for(var L=y[O],N=0;N<L.length;++N)R.move_to(L[N])}return I};var nn=Be(function(e,t){function i(e){var t=[];for(var i in e)t.push(i);return t}(e.exports="function"==typeof Object.keys?Object.keys:i).shim=i}),an=Be(function(e,t){var i="[object Arguments]"==function(){return Object.prototype.toString.call(arguments)}();function r(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function n(e){return e&&"object"==typeof e&&"number"==typeof e.length&&Object.prototype.hasOwnProperty.call(e,"callee")&&!Object.prototype.propertyIsEnumerable.call(e,"callee")||!1}(t=e.exports=i?r:n).supported=r,t.unsupported=n}),on=Be(function(e){var s=Array.prototype.slice,l=e.exports=function(e,t,i){return i=i||{},e===t||(e instanceof Date&&t instanceof Date?e.getTime()===t.getTime():!e||!t||"object"!=typeof e&&"object"!=typeof t?i.strict?e===t:e==t:function(e,t,i){var r,n;if(u(e)||u(t))return!1;if(e.prototype!==t.prototype)return!1;if(an(e))return!!an(t)&&(e=s.call(e),t=s.call(t),l(e,t,i));if(c(e)){if(!c(t))return!1;if(e.length!==t.length)return!1;for(r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}try{var a=nn(e),o=nn(t)}catch(e){return!1}if(a.length!=o.length)return!1;for(a.sort(),o.sort(),r=a.length-1;0<=r;r--)if(a[r]!=o[r])return!1;for(r=a.length-1;0<=r;r--)if(n=a[r],!l(e[n],t[n],i))return!1;return typeof e==typeof t}(e,t,i))};function u(e){return null==e}function c(e){return!(!e||"object"!=typeof e||"number"!=typeof e.length||"function"!=typeof e.copy||"function"!=typeof e.slice||0<e.length&&"number"!=typeof e[0])}});function sn(e,t,i){if(void 0===i&&(i={}),!q(i=i||{}))throw new Error("options is invalid");var a,o=i.tolerance||0,s=[],l=rr(),r=Li(e);return l.load(r),J(t,function(r){var n=!1;r&&(N(l.search(r),function(e){if(!1===n){var t=w(r).sort(),i=w(e).sort();on(t,i)||(0===o?xr(t[0],e)&&xr(t[1],e):sr(e,t[0]).properties.dist<=o&&sr(e,t[1]).properties.dist<=o)?(n=!0,a=a?ln(a,r):r):(0===o?xr(i[0],r)&&xr(i[1],r):sr(r,i[0]).properties.dist<=o&&sr(r,i[1]).properties.dist<=o)&&(a=a?ln(a,e):e)}}),!1===n&&a&&(s.push(a),a=void 0))}),a&&s.push(a),W(s)}function ln(e,t){var i=w(t),r=w(e),n=r[0],a=r[r.length-1],o=e.geometry.coordinates;return on(i[0],n)?o.unshift(i[1]):on(i[0],a)?o.push(i[1]):on(i[1],n)?o.unshift(i[0]):on(i[1],a)&&o.push(i[0]),e}function un(e){var t=e%360;return t<0&&(t+=360),t}function cn(e,t,i){var r;return void 0===i&&(i={}),180<(r=i.final?dn(Q(t),Q(e)):dn(Q(e),Q(t)))?-(360-r):r}function dn(e,t){var i=_(e[1]),r=_(t[1]),n=_(t[0]-e[0]);n>Math.PI&&(n-=2*Math.PI),n<-Math.PI&&(n+=2*Math.PI);var a=Math.log(Math.tan(r/2+Math.PI/4)/Math.tan(i/2+Math.PI/4));return(v(Math.atan2(n,a))+360)%360}function hn(e,t,i,r){void 0===r&&(r={});var n=t<0,a=C(Math.abs(t),r.units,"meters");n&&(a=-Math.abs(a));var o=Q(e),s=function(e,t,i,r){r=void 0===r?p:Number(r);var n=t/r,a=e[0]*Math.PI/180,o=_(e[1]),s=_(i),l=n*Math.cos(s),u=o+l;Math.abs(u)>Math.PI/2&&(u=0<u?Math.PI-u:-Math.PI-u);var c=Math.log(Math.tan(u/2+Math.PI/4)/Math.tan(o/2+Math.PI/4)),d=1e-11<Math.abs(c)?l/c:Math.cos(o),h=n*Math.sin(s)/d;return[(180*(a+h)/Math.PI+540)%360-180,180*u/Math.PI]}(o,a,i);return s[0]+=180<s[0]-o[0]?-360:180<o[0]-s[0]?360:0,$(s,r.properties)}function pn(e,t,i,r,n,a){for(var o=0;o<e.length;o++){var s=e[o],l=e[o+1];o===e.length-1&&(l=e[0]),r=fn(s,l,t),i<=0&&0<r?fn(t,s,n)<0||(n=s):0<i&&r<=0&&(0<fn(t,s,a)||(a=s)),i=r}return[n,a]}function fn(e,t,i){return(t[0]-e[0])*(i[1]-e[1])-(i[0]-e[0])*(t[1]-e[1])}function mn(e){for(var t,i,r=w(e),n=0,a=1;a<r.length;)t=i||r[0],n+=((i=r[a])[0]-t[0])*(i[1]+t[1]),a++;return 0<n}function gn(e,t){switch("Feature"===e.type?e.geometry.type:e.type){case"GeometryCollection":return F(e,function(e){gn(e,t)}),e;case"LineString":return yn(w(e),t),e;case"Polygon":return vn(w(e),t),e;case"MultiLineString":return w(e).forEach(function(e){yn(e,t)}),e;case"MultiPolygon":return w(e).forEach(function(e){vn(e,t)}),e;case"Point":case"MultiPoint":return e}}function yn(e,t){mn(e)===t&&e.reverse()}function vn(e,t){mn(e[0])!==t&&e[0].reverse();for(var i=1;i<e.length;i++)mn(e[i])===t&&e[i].reverse()}var _n={successCallback:null,verbose:!1,polygons:!1},Cn={};function xn(e,t,i,r){r=r||{};for(var n=Object.keys(_n),a=0;a<n.length;a++){var o=n[a],s=r[o];s=null!=s?s:_n[o],Cn[o]=s}Cn.verbose&&console.log("MarchingSquaresJS-isoBands: computing isobands for ["+t+":"+(t+i)+"]");var l,u=function(e,t,i){for(var r=e.length-1,n=e[0].length-1,a={rows:r,cols:n,cells:[]},o=t+Math.abs(i),s=0;s<r;++s){a.cells[s]=[];for(var l=0;l<n;++l){var u=0,c=e[s+1][l],d=e[s+1][l+1],h=e[s][l+1],p=e[s][l];if(!(isNaN(c)||isNaN(d)||isNaN(h)||isNaN(p))){u|=c<t?0:o<c?128:64,u|=d<t?0:o<d?32:16,u|=h<t?0:o<h?8:4;var f=+(u|=p<t?0:o<p?2:1),m=0;if(17===u||18===u||33===u||34===u||38===u||68===u||72===u||98===u||102===u||132===u||136===u||137===u||152===u||153===u){var g=(c+d+h+p)/4;m=o<g?2:g<t?0:1,34===u?1===m?u=35:0===m&&(u=136):136===u?1===m?(u=35,m=4):0===m&&(u=34):17===u?1===m?(u=155,m=4):0===m&&(u=153):68===u?1===m?(u=103,m=4):0===m&&(u=102):153===u?1===m&&(u=155):102===u?1===m&&(u=103):152===u?m<2&&(u=156,m=1):137===u?m<2&&(u=139,m=1):98===u?m<2&&(u=99,m=1):38===u?m<2&&(u=39,m=1):18===u?0<m?(u=156,m=4):u=152:33===u?0<m?(u=139,m=4):u=137:72===u?0<m?(u=99,m=4):u=98:132===u&&(0<m?(u=39,m=4):u=38)}if(0!=u&&170!=u){var y,v,_,C,x,b,A,S;y=v=_=C=x=b=A=S=.5;var w=[];1===u?(_=1-da(t,h,p),S=1-da(t,c,p),w.push(aa[u])):169===u?(_=da(o,p,h),S=da(o,p,c),w.push(aa[u])):4===u?(b=1-da(t,d,h),C=da(t,p,h),w.push(ra[u])):166===u?(b=da(o,h,d),C=1-da(o,h,p),w.push(ra[u])):16===u?(x=da(t,h,d),v=da(t,c,d),w.push(ia[u])):154===u?(x=1-da(o,d,h),v=1-da(o,d,c),w.push(ia[u])):64===u?(A=da(t,p,c),y=1-da(t,d,c),w.push(sa[u])):106===u?(A=1-da(o,c,p),y=da(o,c,d),w.push(sa[u])):168===u?(C=da(o,p,h),_=da(t,p,h),S=da(t,p,c),A=da(o,p,c),w.push(na[u]),w.push(aa[u])):2===u?(C=1-da(t,h,p),_=1-da(o,h,p),S=1-da(o,c,p),A=1-da(t,c,p),w.push(na[u]),w.push(aa[u])):162===u?(x=da(o,h,d),b=da(t,h,d),C=1-da(t,h,p),_=1-da(o,h,p),w.push(na[u]),w.push(aa[u])):8===u?(x=1-da(t,d,h),b=1-da(o,d,h),C=da(o,p,h),_=da(t,p,h),w.push(ia[u]),w.push(ra[u])):138===u?(x=1-da(t,d,h),b=1-da(o,d,h),y=1-da(o,d,c),v=1-da(t,d,c),w.push(ia[u]),w.push(ra[u])):32===u?(x=da(o,h,d),b=da(t,h,d),y=da(t,c,d),v=da(o,c,d),w.push(ia[u]),w.push(ra[u])):42===u?(S=1-da(o,c,p),A=1-da(t,c,p),y=da(t,c,d),v=da(o,c,d),w.push(oa[u]),w.push(sa[u])):128===u&&(S=da(t,p,c),A=da(o,p,c),y=1-da(o,d,c),v=1-da(t,d,c),w.push(oa[u]),w.push(sa[u])),5===u?(b=1-da(t,d,h),S=1-da(t,c,p),w.push(ra[u])):165===u?(b=da(o,h,d),S=da(o,p,c),w.push(ra[u])):20===u?(C=da(t,p,h),v=da(t,c,d),w.push(na[u])):150===u?(C=1-da(o,h,p),v=1-da(o,d,c),w.push(na[u])):80===u?(x=da(t,h,d),A=da(t,p,c),w.push(ia[u])):90===u?(x=1-da(o,d,h),A=1-da(o,c,p),w.push(ia[u])):65===u?(_=1-da(t,h,p),y=1-da(t,d,c),w.push(aa[u])):105===u?(_=da(o,p,h),y=da(o,c,d),w.push(aa[u])):160===u?(x=da(o,h,d),b=da(t,h,d),S=da(t,p,c),A=da(o,p,c),w.push(ia[u]),w.push(ra[u])):10===u?(x=1-da(t,d,h),b=1-da(o,d,h),S=1-da(o,c,p),A=1-da(t,c,p),w.push(ia[u]),w.push(ra[u])):130===u?(C=1-da(t,h,p),_=1-da(o,h,p),y=1-da(o,d,c),v=1-da(t,d,c),w.push(na[u]),w.push(aa[u])):40===u?(C=da(o,p,h),_=da(t,p,h),y=da(t,c,d),v=da(o,c,d),w.push(na[u]),w.push(aa[u])):101===u?(b=da(o,h,d),y=da(o,c,d),w.push(ra[u])):69===u?(b=1-da(t,d,h),y=1-da(t,d,c),w.push(ra[u])):149===u?(S=da(o,p,c),v=1-da(o,d,c),w.push(oa[u])):21===u?(S=1-da(t,c,p),v=da(t,c,d),w.push(oa[u])):86===u?(C=1-da(o,h,p),A=1-da(o,c,p),w.push(na[u])):84===u?(C=da(t,p,h),A=da(t,p,c),w.push(na[u])):89===u?(x=1-da(o,d,h),_=da(o,p,h),w.push(aa[u])):81===u?(x=da(t,h,d),_=1-da(t,h,p),w.push(aa[u])):96===u?(x=da(o,h,d),b=da(t,h,d),A=da(t,p,c),y=da(o,c,d),w.push(ia[u]),w.push(ra[u])):74===u?(x=1-da(t,d,h),b=1-da(o,d,h),A=1-da(o,c,p),y=1-da(t,d,c),w.push(ia[u]),w.push(ra[u])):24===u?(x=1-da(o,d,h),C=da(o,p,h),_=da(t,p,h),v=da(t,c,d),w.push(ia[u]),w.push(aa[u])):146===u?(x=da(t,h,d),C=1-da(t,h,p),_=1-da(o,h,p),v=1-da(o,d,c),w.push(ia[u]),w.push(aa[u])):6===u?(b=1-da(t,d,h),C=1-da(o,h,p),S=1-da(o,c,p),A=1-da(t,c,p),w.push(ra[u]),w.push(na[u])):164===u?(b=da(o,h,d),C=da(t,p,h),S=da(t,p,c),A=da(o,p,c),w.push(ra[u]),w.push(na[u])):129===u?(_=1-da(t,h,p),S=da(o,p,c),y=1-da(o,d,c),v=1-da(t,d,c),w.push(aa[u]),w.push(oa[u])):41===u?(_=da(o,p,h),S=1-da(t,c,p),y=da(t,c,d),v=da(o,c,d),w.push(aa[u]),w.push(oa[u])):66===u?(C=1-da(t,h,p),_=1-da(o,h,p),A=1-da(o,c,p),y=1-da(t,d,c),w.push(na[u]),w.push(aa[u])):104===u?(C=da(o,p,h),_=da(t,p,h),A=da(t,p,c),y=da(o,c,d),w.push(aa[u]),w.push(la[u])):144===u?(x=da(t,h,d),S=da(t,p,c),A=da(o,p,c),v=1-da(o,d,c),w.push(ia[u]),w.push(sa[u])):26===u?(x=1-da(o,d,h),S=1-da(o,c,p),A=1-da(t,c,p),v=da(t,c,d),w.push(ia[u]),w.push(sa[u])):36===u?(b=da(o,h,d),C=da(t,p,h),y=da(t,c,d),v=da(o,c,d),w.push(ra[u]),w.push(na[u])):134===u?(b=1-da(t,d,h),C=1-da(o,h,p),y=1-da(o,d,c),v=1-da(t,d,c),w.push(ra[u]),w.push(na[u])):9===u?(x=1-da(t,d,h),b=1-da(o,d,h),_=da(o,p,h),S=1-da(t,c,p),w.push(ia[u]),w.push(ra[u])):161===u?(x=da(o,h,d),b=da(t,h,d),_=1-da(t,h,p),S=da(o,p,c),w.push(ia[u]),w.push(ra[u])):37===u?(b=da(o,h,d),S=1-da(t,c,p),y=da(t,c,d),v=da(o,c,d),w.push(ra[u]),w.push(oa[u])):133===u?(b=1-da(t,d,h),S=da(o,p,c),y=1-da(o,d,c),v=1-da(t,d,c),w.push(ra[u]),w.push(oa[u])):148===u?(C=da(t,p,h),S=da(t,p,c),A=da(o,p,c),v=1-da(o,d,c),w.push(na[u]),w.push(sa[u])):22===u?(C=1-da(o,h,p),S=1-da(o,c,p),A=1-da(t,c,p),v=da(t,c,d),w.push(na[u]),w.push(sa[u])):82===u?(x=da(t,h,d),C=1-da(t,h,p),_=1-da(o,h,p),A=1-da(o,c,p),w.push(ia[u]),w.push(aa[u])):88===u?(x=1-da(o,d,h),C=da(o,p,h),_=da(t,p,h),A=da(t,p,c),w.push(ia[u]),w.push(aa[u])):73===u?(x=1-da(t,d,h),b=1-da(o,d,h),_=da(o,p,h),y=1-da(t,d,c),w.push(ia[u]),w.push(ra[u])):97===u?(x=da(o,h,d),b=da(t,h,d),_=1-da(t,h,p),y=da(o,c,d),w.push(ia[u]),w.push(ra[u])):145===u?(x=da(t,h,d),_=1-da(t,h,p),S=da(o,p,c),v=1-da(o,d,c),w.push(ia[u]),w.push(oa[u])):25===u?(x=1-da(o,d,h),_=da(o,p,h),S=1-da(t,c,p),v=da(t,c,d),w.push(ia[u]),w.push(oa[u])):70===u?(b=1-da(t,d,h),C=1-da(o,h,p),A=1-da(o,c,p),y=1-da(t,d,c),w.push(ra[u]),w.push(na[u])):100===u?(b=da(o,h,d),C=da(t,p,h),A=da(t,p,c),y=da(o,c,d),w.push(ra[u]),w.push(na[u])):34===u?(v=0===m?(x=1-da(t,d,h),b=1-da(o,d,h),C=da(o,p,h),_=da(t,p,h),S=da(t,p,c),A=da(o,p,c),y=1-da(o,d,c),1-da(t,d,c)):(x=da(o,h,d),b=da(t,h,d),C=1-da(t,h,p),_=1-da(o,h,p),S=1-da(o,c,p),A=1-da(t,c,p),y=da(t,c,d),da(o,c,d)),w.push(ia[u]),w.push(ra[u]),w.push(oa[u]),w.push(sa[u])):35===u?(v=4===m?(x=1-da(t,d,h),b=1-da(o,d,h),C=da(o,p,h),_=da(t,p,h),S=da(t,p,c),A=da(o,p,c),y=1-da(o,d,c),1-da(t,d,c)):(x=da(o,h,d),b=da(t,h,d),C=1-da(t,h,p),_=1-da(o,h,p),S=1-da(o,c,p),A=1-da(t,c,p),y=da(t,c,d),da(o,c,d)),w.push(ia[u]),w.push(ra[u]),w.push(aa[u]),w.push(sa[u])):136===u?(v=0===m?(x=da(o,h,d),b=da(t,h,d),C=1-da(t,h,p),_=1-da(o,h,p),S=1-da(o,c,p),A=1-da(t,c,p),y=da(t,c,d),da(o,c,d)):(x=1-da(t,d,h),b=1-da(o,d,h),C=da(o,p,h),_=da(t,p,h),S=da(t,p,c),A=da(o,p,c),y=1-da(o,d,c),1-da(t,d,c)),w.push(ia[u]),w.push(ra[u]),w.push(oa[u]),w.push(sa[u])):153===u?(v=0===m?(x=da(t,h,d),_=1-da(t,h,p),S=1-da(t,c,p),da(t,c,d)):(x=1-da(o,d,h),_=da(o,p,h),S=da(o,p,c),1-da(o,d,c)),w.push(ia[u]),w.push(aa[u])):102===u?(y=0===m?(b=1-da(t,d,h),C=da(t,p,h),A=da(t,p,c),1-da(t,d,c)):(b=da(o,h,d),C=1-da(o,h,p),A=1-da(o,c,p),da(o,c,d)),w.push(ra[u]),w.push(sa[u])):155===u?(v=4===m?(x=da(t,h,d),_=1-da(t,h,p),S=1-da(t,c,p),da(t,c,d)):(x=1-da(o,d,h),_=da(o,p,h),S=da(o,p,c),1-da(o,d,c)),w.push(ia[u]),w.push(oa[u])):103===u?(y=4===m?(b=1-da(t,d,h),C=da(t,p,h),A=da(t,p,c),1-da(t,d,c)):(b=da(o,h,d),C=1-da(o,h,p),A=1-da(o,c,p),da(o,c,d)),w.push(ra[u]),w.push(na[u])):152===u?(v=0===m?(x=da(t,h,d),C=1-da(t,h,p),_=1-da(o,h,p),S=1-da(o,c,p),A=1-da(t,c,p),da(t,c,d)):(x=1-da(o,d,h),C=da(o,p,h),_=da(t,p,h),S=da(t,p,c),A=da(o,p,c),1-da(o,d,c)),w.push(ia[u]),w.push(na[u]),w.push(aa[u])):156===u?(v=4===m?(x=da(t,h,d),C=1-da(t,h,p),_=1-da(o,h,p),S=1-da(o,c,p),A=1-da(t,c,p),da(t,c,d)):(x=1-da(o,d,h),C=da(o,p,h),_=da(t,p,h),S=da(t,p,c),A=da(o,p,c),1-da(o,d,c)),w.push(ia[u]),w.push(aa[u]),w.push(sa[u])):137===u?(v=0===m?(x=da(o,h,d),b=da(t,h,d),_=1-da(t,h,p),S=1-da(t,c,p),y=da(t,c,d),da(o,c,d)):(x=1-da(t,d,h),b=1-da(o,d,h),_=da(o,p,h),S=da(o,p,c),y=1-da(o,d,c),1-da(t,d,c)),w.push(ia[u]),w.push(ra[u]),w.push(aa[u])):139===u?(v=4===m?(x=da(o,h,d),b=da(t,h,d),_=1-da(t,h,p),S=1-da(t,c,p),y=da(t,c,d),da(o,c,d)):(x=1-da(t,d,h),b=1-da(o,d,h),_=da(o,p,h),S=da(o,p,c),y=1-da(o,d,c),1-da(t,d,c)),w.push(ia[u]),w.push(ra[u]),w.push(oa[u])):98===u?(y=0===m?(x=1-da(t,d,h),b=1-da(o,d,h),C=da(o,p,h),_=da(t,p,h),A=da(t,p,c),1-da(t,d,c)):(x=da(o,h,d),b=da(t,h,d),C=1-da(t,h,p),_=1-da(o,h,p),A=1-da(o,c,p),da(o,c,d)),w.push(ia[u]),w.push(ra[u]),w.push(sa[u])):99===u?(y=4===m?(x=1-da(t,d,h),b=1-da(o,d,h),C=da(o,p,h),_=da(t,p,h),A=da(t,p,c),1-da(t,d,c)):(x=da(o,h,d),b=da(t,h,d),C=1-da(t,h,p),_=1-da(o,h,p),A=1-da(o,c,p),da(o,c,d)),w.push(ia[u]),w.push(ra[u]),w.push(aa[u])):38===u?(v=0===m?(b=1-da(t,d,h),C=da(t,p,h),S=da(t,p,c),A=da(o,p,c),y=1-da(o,d,c),1-da(t,d,c)):(b=da(o,h,d),C=1-da(o,h,p),S=1-da(o,c,p),A=1-da(t,c,p),y=da(t,c,d),da(o,c,d)),w.push(ra[u]),w.push(oa[u]),w.push(sa[u])):39===u?(v=4===m?(b=1-da(t,d,h),C=da(t,p,h),S=da(t,p,c),A=da(o,p,c),y=1-da(o,d,c),1-da(t,d,c)):(b=da(o,h,d),C=1-da(o,h,p),S=1-da(o,c,p),A=1-da(t,c,p),y=da(t,c,d),da(o,c,d)),w.push(ra[u]),w.push(na[u]),w.push(sa[u])):85===u&&(y=S=_=b=0,v=A=C=x=1),(y<0||1<y||v<0||1<v||x<0||1<x||C<0||1<C||S<0||1<S||A<0||1<A)&&console.log("MarchingSquaresJS-isoBands: "+u+" "+f+" "+c+","+d+","+h+","+p+" "+m+" "+y+" "+v+" "+x+" "+b+" "+C+" "+_+" "+S+" "+A),a.cells[s][l]={cval:u,cval_real:f,flipped:m,topleft:y,topright:v,righttop:x,rightbottom:b,bottomright:C,bottomleft:_,leftbottom:S,lefttop:A,edges:w}}}}}return a}(e,t,i);return l=Cn.polygons?(Cn.verbose&&console.log("MarchingSquaresJS-isoBands: returning single polygons for each grid cell"),function(e){var n=[],a=0;return e.cells.forEach(function(e,r){e.forEach(function(e,t){if(void 0!==e){var i=ca[e.cval](e);"object"==typeof i&&ha(i)?"object"==typeof i[0]&&ha(i[0])?"object"==typeof i[0][0]&&ha(i[0][0])?i.forEach(function(e){e.forEach(function(e){e[0]+=t,e[1]+=r}),n[a++]=e}):(i.forEach(function(e){e[0]+=t,e[1]+=r}),n[a++]=i):console.log("MarchingSquaresJS-isoBands: bandcell polygon with malformed coordinates"):console.log("MarchingSquaresJS-isoBands: bandcell polygon with null coordinates")}})}),n}(u)):(Cn.verbose&&console.log("MarchingSquaresJS-isoBands: returning polygon paths for entire data grid"),function(e){for(var t=[],i=e.rows,r=e.cols,n=[],a=0;a<i;a++)for(var o=0;o<r;o++)if(void 0!==e.cells[a][o]&&0<e.cells[a][o].edges.length){var s=fa(e.cells[a][o]),l=null,u=o,c=a;null!==s&&n.push([s.p[0]+u,s.p[1]+c]);do{if(null===(l=ma(e.cells[c][u],s.x,s.y,s.o)))break;if(n.push([l.p[0]+u,l.p[1]+c]),u+=l.x,(c+=(s=l).y)<0||i<=c||u<0||r<=u||void 0===e.cells[c][u]){var d=pa(e,u-=l.x,c-=l.y,l.x,l.y,l.o);if(null===d)break;d.path.forEach(function(e){n.push(e)}),u=d.i,c=d.j,s=d}}while(void 0!==e.cells[c][u]&&0<e.cells[c][u].edges.length);t.push(n),n=[],0<e.cells[a][o].edges.length&&o--}return t}(u)),"function"==typeof Cn.successCallback&&Cn.successCallback(l),l}var bn=64,An=16,Sn=[],wn=[],En=[],Tn=[],Pn=[],Mn=[],Dn=[],In=[],On=[],Rn=[],Ln=[],Nn=[],kn=[],Bn=[],Fn=[],Vn=[],zn=[],Un=[],Gn=[],$n=[],Hn=[],Wn=[],jn=[],qn=[];Dn[85]=Rn[85]=-1,In[85]=Ln[85]=0,On[85]=Nn[85]=1,Gn[85]=Wn[85]=1,$n[85]=jn[85]=0,Hn[85]=qn[85]=1,Sn[85]=Tn[85]=0,wn[85]=Pn[85]=-1,En[85]=Fn[85]=0,Vn[85]=kn[85]=0,zn[85]=Bn[85]=1,Mn[85]=Un[85]=1,Wn[1]=Wn[169]=0,jn[1]=jn[169]=-1,qn[1]=qn[169]=0,kn[1]=kn[169]=-1,Bn[1]=Bn[169]=0,Fn[1]=Fn[169]=0,Rn[4]=Rn[166]=0,Ln[4]=Ln[166]=-1,Nn[4]=Nn[166]=1,Vn[4]=Vn[166]=1,zn[4]=zn[166]=0,Un[4]=Un[166]=0,Dn[16]=Dn[154]=0,In[16]=In[154]=1,On[16]=On[154]=1,Tn[16]=Tn[154]=1,Pn[16]=Pn[154]=0,Mn[16]=Mn[154]=1,Gn[64]=Gn[106]=0,$n[64]=$n[106]=1,Hn[64]=Hn[106]=0,Sn[64]=Sn[106]=-1,wn[64]=wn[106]=0,En[64]=En[106]=1,Gn[2]=Gn[168]=0,$n[2]=$n[168]=-1,Hn[2]=Hn[168]=1,Wn[2]=Wn[168]=0,jn[2]=jn[168]=-1,qn[2]=qn[168]=0,kn[2]=kn[168]=-1,Bn[2]=Bn[168]=0,Fn[2]=Fn[168]=0,Vn[2]=Vn[168]=-1,zn[2]=zn[168]=0,Un[2]=Un[168]=1,Dn[8]=Dn[162]=0,In[8]=In[162]=-1,On[8]=On[162]=0,Rn[8]=Rn[162]=0,Ln[8]=Ln[162]=-1,Nn[8]=Nn[162]=1,kn[8]=kn[162]=1,Bn[8]=Bn[162]=0,Fn[8]=Fn[162]=1,Vn[8]=Vn[162]=1,zn[8]=zn[162]=0,Un[8]=Un[162]=0,Dn[32]=Dn[138]=0,In[32]=In[138]=1,On[32]=On[138]=1,Rn[32]=Rn[138]=0,Ln[32]=Ln[138]=1,Nn[32]=Nn[138]=0,Sn[32]=Sn[138]=1,wn[32]=wn[138]=0,En[32]=En[138]=0,Tn[32]=Tn[138]=1,Pn[32]=Pn[138]=0,Mn[32]=Mn[138]=1,Wn[128]=Wn[42]=0,jn[128]=jn[42]=1,qn[128]=qn[42]=1,Gn[128]=Gn[42]=0,$n[128]=$n[42]=1,Hn[128]=Hn[42]=0,Sn[128]=Sn[42]=-1,wn[128]=wn[42]=0,En[128]=En[42]=1,Tn[128]=Tn[42]=-1,Pn[128]=Pn[42]=0,Mn[128]=Mn[42]=0,Rn[5]=Rn[165]=-1,Ln[5]=Ln[165]=0,Nn[5]=Nn[165]=0,Wn[5]=Wn[165]=1,jn[5]=jn[165]=0,qn[5]=qn[165]=0,Vn[20]=Vn[150]=0,zn[20]=zn[150]=1,Un[20]=Un[150]=1,Tn[20]=Tn[150]=0,Pn[20]=Pn[150]=-1,Mn[20]=Mn[150]=1,Dn[80]=Dn[90]=-1,In[80]=In[90]=0,On[80]=On[90]=1,Gn[80]=Gn[90]=1,$n[80]=$n[90]=0,Hn[80]=Hn[90]=1,kn[65]=kn[105]=0,Bn[65]=Bn[105]=1,Fn[65]=Fn[105]=0,Sn[65]=Sn[105]=0,wn[65]=wn[105]=-1,En[65]=En[105]=0,Dn[160]=Dn[10]=-1,In[160]=In[10]=0,On[160]=On[10]=1,Rn[160]=Rn[10]=-1,Ln[160]=Ln[10]=0,Nn[160]=Nn[10]=0,Wn[160]=Wn[10]=1,jn[160]=jn[10]=0,qn[160]=qn[10]=0,Gn[160]=Gn[10]=1,$n[160]=$n[10]=0,Hn[160]=Hn[10]=1,Vn[130]=Vn[40]=0,zn[130]=zn[40]=1,Un[130]=Un[40]=1,kn[130]=kn[40]=0,Bn[130]=Bn[40]=1,Fn[130]=Fn[40]=0,Sn[130]=Sn[40]=0,wn[130]=wn[40]=-1,En[130]=En[40]=0,Tn[130]=Tn[40]=0,Pn[130]=Pn[40]=-1,Mn[130]=Mn[40]=1,Rn[37]=Rn[133]=0,Ln[37]=Ln[133]=1,Nn[37]=Nn[133]=1,Wn[37]=Wn[133]=0,jn[37]=jn[133]=1,qn[37]=qn[133]=0,Sn[37]=Sn[133]=-1,wn[37]=wn[133]=0,En[37]=En[133]=0,Tn[37]=Tn[133]=1,Pn[37]=Pn[133]=0,Mn[37]=Mn[133]=0,Vn[148]=Vn[22]=-1,zn[148]=zn[22]=0,Un[148]=Un[22]=0,Wn[148]=Wn[22]=0,jn[148]=jn[22]=-1,qn[148]=qn[22]=1,Gn[148]=Gn[22]=0,$n[148]=$n[22]=1,Hn[148]=Hn[22]=1,Tn[148]=Tn[22]=-1,Pn[148]=Pn[22]=0,Mn[148]=Mn[22]=1,Dn[82]=Dn[88]=0,In[82]=In[88]=-1,On[82]=On[88]=1,Vn[82]=Vn[88]=1,zn[82]=zn[88]=0,Un[82]=Un[88]=1,kn[82]=kn[88]=-1,Bn[82]=Bn[88]=0,Fn[82]=Fn[88]=1,Gn[82]=Gn[88]=0,$n[82]=$n[88]=-1,Hn[82]=Hn[88]=0,Dn[73]=Dn[97]=0,In[73]=In[97]=1,On[73]=On[97]=0,Rn[73]=Rn[97]=0,Ln[73]=Ln[97]=-1,Nn[73]=Nn[97]=0,kn[73]=kn[97]=1,Bn[73]=Bn[97]=0,Fn[73]=Fn[97]=0,Sn[73]=Sn[97]=1,wn[73]=wn[97]=0,En[73]=En[97]=1,Dn[145]=Dn[25]=0,In[145]=In[25]=-1,On[145]=On[25]=0,kn[145]=kn[25]=1,Bn[145]=Bn[25]=0,Fn[145]=Fn[25]=1,Wn[145]=Wn[25]=0,jn[145]=jn[25]=1,qn[145]=qn[25]=1,Tn[145]=Tn[25]=-1,Pn[145]=Pn[25]=0,Mn[145]=Mn[25]=0,Rn[70]=Rn[100]=0,Ln[70]=Ln[100]=1,Nn[70]=Nn[100]=0,Vn[70]=Vn[100]=-1,zn[70]=zn[100]=0,Un[70]=Un[100]=1,Gn[70]=Gn[100]=0,$n[70]=$n[100]=-1,Hn[70]=Hn[100]=1,Sn[70]=Sn[100]=1,wn[70]=wn[100]=0,En[70]=En[100]=0,Rn[101]=Rn[69]=0,Ln[101]=Ln[69]=1,Nn[101]=Nn[69]=0,Sn[101]=Sn[69]=1,wn[101]=wn[69]=0,En[101]=En[69]=0,Wn[149]=Wn[21]=0,jn[149]=jn[21]=1,qn[149]=qn[21]=1,Tn[149]=Tn[21]=-1,Pn[149]=Pn[21]=0,Mn[149]=Mn[21]=0,Vn[86]=Vn[84]=-1,zn[86]=zn[84]=0,Un[86]=Un[84]=1,Gn[86]=Gn[84]=0,$n[86]=$n[84]=-1,Hn[86]=Hn[84]=1,Dn[89]=Dn[81]=0,In[89]=In[81]=-1,On[89]=On[81]=0,kn[89]=kn[81]=1,Bn[89]=Bn[81]=0,Fn[89]=Fn[81]=1,Dn[96]=Dn[74]=0,In[96]=In[74]=1,On[96]=On[74]=0,Rn[96]=Rn[74]=-1,Ln[96]=Ln[74]=0,Nn[96]=Nn[74]=1,Gn[96]=Gn[74]=1,$n[96]=$n[74]=0,Hn[96]=Hn[74]=0,Sn[96]=Sn[74]=1,wn[96]=wn[74]=0,En[96]=En[74]=1,Dn[24]=Dn[146]=0,In[24]=In[146]=-1,On[24]=On[146]=1,Vn[24]=Vn[146]=1,zn[24]=zn[146]=0,Un[24]=Un[146]=1,kn[24]=kn[146]=0,Bn[24]=Bn[146]=1,Fn[24]=Fn[146]=1,Tn[24]=Tn[146]=0,Pn[24]=Pn[146]=-1,Mn[24]=Mn[146]=0,Rn[6]=Rn[164]=-1,Ln[6]=Ln[164]=0,Nn[6]=Nn[164]=1,Vn[6]=Vn[164]=-1,zn[6]=zn[164]=0,Un[6]=Un[164]=0,Wn[6]=Wn[164]=0,jn[6]=jn[164]=-1,qn[6]=qn[164]=1,Gn[6]=Gn[164]=1,$n[6]=$n[164]=0,Hn[6]=Hn[164]=0,kn[129]=kn[41]=0,Bn[129]=Bn[41]=1,Fn[129]=Fn[41]=1,Wn[129]=Wn[41]=0,jn[129]=jn[41]=1,qn[129]=qn[41]=0,Sn[129]=Sn[41]=-1,wn[129]=wn[41]=0,En[129]=En[41]=0,Tn[129]=Tn[41]=0,Pn[129]=Pn[41]=-1,Mn[129]=Mn[41]=0,Vn[66]=Vn[104]=0,zn[66]=zn[104]=1,Un[66]=Un[104]=0,kn[66]=kn[104]=-1,Bn[66]=Bn[104]=0,Fn[66]=Fn[104]=1,Gn[66]=Gn[104]=0,$n[66]=$n[104]=-1,Hn[66]=Hn[104]=0,Sn[66]=Sn[104]=0,wn[66]=wn[104]=-1,En[66]=En[104]=1,Dn[144]=Dn[26]=-1,In[144]=In[26]=0,On[144]=On[26]=0,Wn[144]=Wn[26]=1,jn[144]=jn[26]=0,qn[144]=qn[26]=1,Gn[144]=Gn[26]=0,$n[144]=$n[26]=1,Hn[144]=Hn[26]=1,Tn[144]=Tn[26]=-1,Pn[144]=Pn[26]=0,Mn[144]=Mn[26]=1,Rn[36]=Rn[134]=0,Ln[36]=Ln[134]=1,Nn[36]=Nn[134]=1,Vn[36]=Vn[134]=0,zn[36]=zn[134]=1,Un[36]=Un[134]=0,Sn[36]=Sn[134]=0,wn[36]=wn[134]=-1,En[36]=En[134]=1,Tn[36]=Tn[134]=1,Pn[36]=Pn[134]=0,Mn[36]=Mn[134]=0,Dn[9]=Dn[161]=-1,In[9]=In[161]=0,On[9]=On[161]=0,Rn[9]=Rn[161]=0,Ln[9]=Ln[161]=-1,Nn[9]=Nn[161]=0,kn[9]=kn[161]=1,Bn[9]=Bn[161]=0,Fn[9]=Fn[161]=0,Wn[9]=Wn[161]=1,jn[9]=jn[161]=0,qn[9]=qn[161]=1,Dn[136]=0,In[136]=1,On[136]=1,Rn[136]=0,Ln[136]=1,Nn[136]=0,Vn[136]=-1,zn[136]=0,Un[136]=1,kn[136]=-1,Bn[136]=0,Fn[136]=0,Wn[136]=0,jn[136]=-1,qn[136]=0,Gn[136]=0,$n[136]=-1,Hn[136]=1,Sn[136]=1,wn[136]=0,En[136]=0,Tn[136]=1,Pn[136]=0,Mn[136]=1,Dn[34]=0,In[34]=-1,On[34]=0,Rn[34]=0,Ln[34]=-1,Nn[34]=1,Vn[34]=1,zn[34]=0,Un[34]=0,kn[34]=1,Bn[34]=0,Fn[34]=1,Wn[34]=0,jn[34]=1,qn[34]=1,Gn[34]=0,$n[34]=1,Hn[34]=0,Sn[34]=-1,wn[34]=0,En[34]=1,Tn[34]=-1,Pn[34]=0,Mn[34]=0,Dn[35]=0,In[35]=1,On[35]=1,Rn[35]=0,Ln[35]=-1,Nn[35]=1,Vn[35]=1,zn[35]=0,Un[35]=0,kn[35]=-1,Bn[35]=0,Fn[35]=0,Wn[35]=0,jn[35]=-1,qn[35]=0,Gn[35]=0,$n[35]=1,Hn[35]=0,Sn[35]=-1,wn[35]=0,En[35]=1,Tn[35]=1,Pn[35]=0,Mn[35]=1,Dn[153]=0,In[153]=1,On[153]=1,kn[153]=-1,Bn[153]=0,Fn[153]=0,Wn[153]=0,jn[153]=-1,qn[153]=0,Tn[153]=1,Pn[153]=0,Mn[153]=1,Rn[102]=0,Ln[102]=-1,Nn[102]=1,Vn[102]=1,zn[102]=0,Un[102]=0,Gn[102]=0,$n[102]=1,Hn[102]=0,Sn[102]=-1,wn[102]=0,En[102]=1,Dn[155]=0,In[155]=-1,On[155]=0,kn[155]=1,Bn[155]=0,Fn[155]=1,Wn[155]=0,jn[155]=1,qn[155]=1,Tn[155]=-1,Pn[155]=0,Mn[155]=0,Rn[103]=0,Ln[103]=1,Nn[103]=0,Vn[103]=-1,zn[103]=0,Un[103]=1,Gn[103]=0,$n[103]=-1,Hn[103]=1,Sn[103]=1,wn[103]=0,En[103]=0,Dn[152]=0,In[152]=1,On[152]=1,Vn[152]=-1,zn[152]=0,Un[152]=1,kn[152]=-1,Bn[152]=0,Fn[152]=0,Wn[152]=0,jn[152]=-1,qn[152]=0,Gn[152]=0,$n[152]=-1,Hn[152]=1,Tn[152]=1,Pn[152]=0,Mn[152]=1,Dn[156]=0,In[156]=-1,On[156]=1,Vn[156]=1,zn[156]=0,Un[156]=1,kn[156]=-1,Bn[156]=0,Fn[156]=0,Wn[156]=0,jn[156]=-1,qn[156]=0,Gn[156]=0,$n[156]=1,Hn[156]=1,Tn[156]=-1,Pn[156]=0,Mn[156]=1,Dn[137]=0,In[137]=1,On[137]=1,Rn[137]=0,Ln[137]=1,Nn[137]=0,kn[137]=-1,Bn[137]=0,Fn[137]=0,Wn[137]=0,jn[137]=-1,qn[137]=0,Sn[137]=1,wn[137]=0,En[137]=0,Tn[137]=1,Pn[137]=0,Mn[137]=1,Dn[139]=0,In[139]=1,On[139]=1,Rn[139]=0,Ln[139]=-1,Nn[139]=0,kn[139]=1,Bn[139]=0,Fn[139]=0,Wn[139]=0,jn[139]=1,qn[139]=0,Sn[139]=-1,wn[139]=0,En[139]=0,Tn[139]=1,Pn[139]=0,Mn[139]=1,Dn[98]=0,In[98]=-1,On[98]=0,Rn[98]=0,Ln[98]=-1,Nn[98]=1,Vn[98]=1,zn[98]=0,Un[98]=0,kn[98]=1,Bn[98]=0,Fn[98]=1,Gn[98]=0,$n[98]=1,Hn[98]=0,Sn[98]=-1,wn[98]=0,En[98]=1,Dn[99]=0,In[99]=1,On[99]=0,Rn[99]=0,Ln[99]=-1,Nn[99]=1,Vn[99]=1,zn[99]=0,Un[99]=0,kn[99]=-1,Bn[99]=0,Fn[99]=1,Gn[99]=0,$n[99]=-1,Hn[99]=0,Sn[99]=1,wn[99]=0,En[99]=1,Rn[38]=0,Ln[38]=-1,Nn[38]=1,Vn[38]=1,zn[38]=0,Un[38]=0,Wn[38]=0,jn[38]=1,qn[38]=1,Gn[38]=0,$n[38]=1,Hn[38]=0,Sn[38]=-1,wn[38]=0,En[38]=1,Tn[38]=-1,Pn[38]=0,Mn[38]=0,Rn[39]=0,Ln[39]=1,Nn[39]=1,Vn[39]=-1,zn[39]=0,Un[39]=0,Wn[39]=0,jn[39]=-1,qn[39]=1,Gn[39]=0,$n[39]=1,Hn[39]=0,Sn[39]=-1,wn[39]=0,En[39]=1,Tn[39]=1,Pn[39]=0,Mn[39]=0;var Qn=function(e){return[[e.bottomleft,0],[0,0],[0,e.leftbottom]]},Yn=function(e){return[[1,e.rightbottom],[1,0],[e.bottomright,0]]},Xn=function(e){return[[e.topright,1],[1,1],[1,e.righttop]]},Zn=function(e){return[[0,e.lefttop],[0,1],[e.topleft,1]]},Jn=function(e){return[[e.bottomright,0],[e.bottomleft,0],[0,e.leftbottom],[0,e.lefttop]]},Kn=function(e){return[[e.bottomright,0],[e.bottomleft,0],[1,e.righttop],[1,e.rightbottom]]},ea=function(e){return[[1,e.righttop],[1,e.rightbottom],[e.topleft,1],[e.topright,1]]},ta=function(e){return[[0,e.leftbottom],[0,e.lefttop],[e.topleft,1],[e.topright,1]]},ia=[],ra=[],na=[],aa=[],oa=[],sa=[],la=[],ua=[];aa[1]=oa[1]=18,aa[169]=oa[169]=18,na[4]=ra[4]=12,na[166]=ra[166]=12,ia[16]=ua[16]=4,ia[154]=ua[154]=4,sa[64]=la[64]=22,sa[106]=la[106]=22,na[2]=sa[2]=17,aa[2]=oa[2]=18,na[168]=sa[168]=17,aa[168]=oa[168]=18,ia[8]=aa[8]=9,ra[8]=na[8]=12,ia[162]=aa[162]=9,ra[162]=na[162]=12,ia[32]=ua[32]=4,ra[32]=la[32]=1,ia[138]=ua[138]=4,ra[138]=la[138]=1,oa[128]=ua[128]=21,sa[128]=la[128]=22,oa[42]=ua[42]=21,sa[42]=la[42]=22,ra[5]=oa[5]=14,ra[165]=oa[165]=14,na[20]=ua[20]=6,na[150]=ua[150]=6,ia[80]=sa[80]=11,ia[90]=sa[90]=11,aa[65]=la[65]=3,aa[105]=la[105]=3,ia[160]=sa[160]=11,ra[160]=oa[160]=14,ia[10]=sa[10]=11,ra[10]=oa[10]=14,na[130]=ua[130]=6,aa[130]=la[130]=3,na[40]=ua[40]=6,aa[40]=la[40]=3,ra[101]=la[101]=1,ra[69]=la[69]=1,oa[149]=ua[149]=21,oa[21]=ua[21]=21,na[86]=sa[86]=17,na[84]=sa[84]=17,ia[89]=aa[89]=9,ia[81]=aa[81]=9,ia[96]=la[96]=0,ra[96]=sa[96]=15,ia[74]=la[74]=0,ra[74]=sa[74]=15,ia[24]=na[24]=8,aa[24]=ua[24]=7,ia[146]=na[146]=8,aa[146]=ua[146]=7,ra[6]=sa[6]=15,na[6]=oa[6]=16,ra[164]=sa[164]=15,na[164]=oa[164]=16,aa[129]=ua[129]=7,oa[129]=la[129]=20,aa[41]=ua[41]=7,oa[41]=la[41]=20,na[66]=la[66]=2,aa[66]=sa[66]=19,na[104]=la[104]=2,aa[104]=sa[104]=19,ia[144]=oa[144]=10,sa[144]=ua[144]=23,ia[26]=oa[26]=10,sa[26]=ua[26]=23,ra[36]=ua[36]=5,na[36]=la[36]=2,ra[134]=ua[134]=5,na[134]=la[134]=2,ia[9]=oa[9]=10,ra[9]=aa[9]=13,ia[161]=oa[161]=10,ra[161]=aa[161]=13,ra[37]=ua[37]=5,oa[37]=la[37]=20,ra[133]=ua[133]=5,oa[133]=la[133]=20,na[148]=oa[148]=16,sa[148]=ua[148]=23,na[22]=oa[22]=16,sa[22]=ua[22]=23,ia[82]=na[82]=8,aa[82]=sa[82]=19,ia[88]=na[88]=8,aa[88]=sa[88]=19,ia[73]=la[73]=0,ra[73]=aa[73]=13,ia[97]=la[97]=0,ra[97]=aa[97]=13,ia[145]=aa[145]=9,oa[145]=ua[145]=21,ia[25]=aa[25]=9,oa[25]=ua[25]=21,ra[70]=la[70]=1,na[70]=sa[70]=17,ra[100]=la[100]=1,na[100]=sa[100]=17,ia[34]=aa[34]=9,ra[34]=na[34]=12,oa[34]=ua[34]=21,sa[34]=la[34]=22,ia[136]=ua[136]=4,ra[136]=la[136]=1,na[136]=sa[136]=17,aa[136]=oa[136]=18,ia[35]=ua[35]=4,ra[35]=na[35]=12,aa[35]=oa[35]=18,sa[35]=la[35]=22,ia[153]=ua[153]=4,aa[153]=oa[153]=18,ra[102]=na[102]=12,sa[102]=la[102]=22,ia[155]=aa[155]=9,oa[155]=ua[155]=23,ra[103]=la[103]=1,na[103]=sa[103]=17,ia[152]=ua[152]=4,na[152]=sa[152]=17,aa[152]=oa[152]=18,ia[156]=na[156]=8,aa[156]=oa[156]=18,sa[156]=ua[156]=23,ia[137]=ua[137]=4,ra[137]=la[137]=1,aa[137]=oa[137]=18,ia[139]=ua[139]=4,ra[139]=aa[139]=13,oa[139]=la[139]=20,ia[98]=aa[98]=9,ra[98]=na[98]=12,sa[98]=la[98]=22,ia[99]=la[99]=0,ra[99]=na[99]=12,aa[99]=sa[99]=19,ra[38]=na[38]=12,oa[38]=ua[38]=21,sa[38]=la[38]=22,ra[39]=ua[39]=5,na[39]=oa[39]=16,sa[39]=la[39]=22;var ca=[];function da(e,t,i){return(e-t)/(i-t)}function ha(e){return-1<e.constructor.toString().indexOf("Array")}function pa(e,t,i,r,n,a){for(var o=e.cells[i][t],s=o.cval_real,l=t+r,u=i+n,c=[],d=!1;!d;){if(void 0===e.cells[u]||void 0===e.cells[u][l])if(u-=n,l-=r,s=(o=e.cells[u][l]).cval_real,-1===n)if(0===a)if(1&s)c.push([l,u]),r=-1,a=n=0;else{if(!(4&s)){c.push([l+o.bottomright,u]),a=n=1,d=!(r=0);break}c.push([l+1,u]),r=1,a=n=0}else{if(!(1&s)){if(4&s){c.push([l+o.bottomright,u]),a=n=1,d=!(r=0);break}c.push([l+o.bottomleft,u]),n=1,d=!(a=r=0);break}c.push([l,u]),r=-1,a=n=0}else if(1===n)if(0===a){if(!(s&An)){if(s&bn){c.push([l+o.topleft,u+1]),n=-1,d=!(a=r=0);break}c.push([l+o.topright,u+1]),n=-1,a=1,d=!(r=0);break}c.push([l+1,u+1]),n=0,a=r=1}else c.push([l+1,u+1]),n=0,a=r=1;else if(-1===r)if(0===a){if(!(s&bn)){if(1&s){c.push([l,u+o.leftbottom]),r=1,d=!(a=n=0);break}c.push([l,u+o.lefttop]),a=r=1,d=!(n=0);break}c.push([l,u+1]),n=1,a=r=0}else{if(!(s&bn)){console.log("MarchingSquaresJS-isoBands: wtf");break}c.push([l,u+1]),n=1,a=r=0}else{if(1!==r){console.log("MarchingSquaresJS-isoBands: we came from nowhere!");break}if(0===a){if(!(4&s)){c.push([l+1,u+o.rightbottom]),r=-1,d=!(a=n=0);break}c.push([l+1,u]),r=0,n=-1,a=1}else{if(!(4&s)){if(s&An){c.push([l+1,u+o.righttop]),r=-1,n=0,a=1;break}c.push([l+1,u+o.rightbottom]),r=-1,d=!(a=n=0);break}c.push([l+1,u]),r=0,n=-1,a=1}}else if(s=(o=e.cells[u][l]).cval_real,-1===r)if(0===a)if(void 0!==e.cells[u-1]&&void 0!==e.cells[u-1][l])r=0,n=-1,a=1;else{if(!(1&s)){c.push([l+o.bottomright,u]),a=n=1,d=!(r=0);break}c.push([l,u])}else{if(!(s&bn)){console.log("MarchingSquaresJS-isoBands: found entry from top at "+l+","+u);break}console.log("MarchingSquaresJS-isoBands: proceeding in x-direction!")}else if(1===r){if(0===a){console.log("MarchingSquaresJS-isoBands: wtf");break}if(void 0!==e.cells[u+1]&&void 0!==e.cells[u+1][l])n=1,a=r=0;else{if(!(s&An)){c.push([l+o.topleft,u+1]),n=-1,d=!(a=r=0);break}c.push([l+1,u+1]),n=0,a=r=1}}else if(-1===n){if(1!==a){console.log("MarchingSquaresJS-isoBands: wtf");break}if(void 0!==e.cells[u][l+1])n=0,a=r=1;else{if(!(4&s)){c.push([l+1,u+o.righttop]),r=-1,a=1,d=!(n=0);break}c.push([l+1,u]),r=0,n=-1,a=1}}else{if(1!==n){console.log("MarchingSquaresJS-isoBands: where did we came from???");break}if(0!==a){console.log("MarchingSquaresJS-isoBands: wtf");break}if(void 0!==e.cells[u][l-1])r=-1,a=n=0;else{if(!(s&bn)){c.push([l,u+o.leftbottom]),r=1,d=!(a=n=0);break}c.push([l,u+1]),n=1,a=r=0}}if(u+=n,(l+=r)===t&&u===i)break}return{path:c,i:l,j:u,x:r,y:n,o:a}}function fa(e){if(0<e.edges.length){var t=e.edges[e.edges.length-1],i=e.cval_real;switch(t){case 0:return i&An?{p:[1,e.righttop],x:-1,y:0,o:1}:{p:[e.topleft,1],x:0,y:-1,o:0};case 1:return 4&i?{p:[e.topleft,1],x:0,y:-1,o:0}:{p:[1,e.rightbottom],x:-1,y:0,o:0};case 2:return 4&i?{p:[e.bottomright,0],x:0,y:1,o:1}:{p:[e.topleft,1],x:0,y:-1,o:0};case 3:return 1&i?{p:[e.topleft,1],x:0,y:-1,o:0}:{p:[e.bottomleft,0],x:0,y:1,o:0};case 4:return i&An?{p:[1,e.righttop],x:-1,y:0,o:1}:{p:[e.topright,1],x:0,y:-1,o:1};case 5:return 4&i?{p:[e.topright,1],x:0,y:-1,o:1}:{p:[1,e.rightbottom],x:-1,y:0,o:0};case 6:return 4&i?{p:[e.bottomright,0],x:0,y:1,o:1}:{p:[e.topright,1],x:0,y:-1,o:1};case 7:return 1&i?{p:[e.topright,1],x:0,y:-1,o:1}:{p:[e.bottomleft,0],x:0,y:1,o:0};case 8:return 4&i?{p:[e.bottomright,0],x:0,y:1,o:1}:{p:[1,e.righttop],x:-1,y:0,o:1};case 9:return 1&i?{p:[1,e.righttop],x:-1,y:0,o:1}:{p:[e.bottomleft,0],x:0,y:1,o:0};case 10:return 1&i?{p:[0,e.leftbottom],x:1,y:0,o:0}:{p:[1,e.righttop],x:-1,y:0,o:1};case 11:return i&bn?{p:[1,e.righttop],x:-1,y:0,o:1}:{p:[0,e.lefttop],x:1,y:0,o:1};case 12:return 4&i?{p:[e.bottomright,0],x:0,y:1,o:1}:{p:[1,e.rightbottom],x:-1,y:0,o:0};case 13:return 1&i?{p:[1,e.rightbottom],x:-1,y:0,o:0}:{p:[e.bottomleft,0],x:0,y:1,o:0};case 14:return 1&i?{p:[0,e.leftbottom],x:1,y:0,o:0}:{p:[1,e.rightbottom],x:-1,y:0,o:0};case 15:return i&bn?{p:[1,e.rightbottom],x:-1,y:0,o:0}:{p:[0,e.lefttop],x:1,y:0,o:1};case 16:return 4&i?{p:[e.bottomright,0],x:0,y:1,o:1}:{p:[0,e.leftbottom],x:1,y:0,o:0};case 17:return i&bn?{p:[e.bottomright,0],x:0,y:1,o:1}:{p:[0,e.lefttop],x:1,y:0,o:1};case 18:return 1&i?{p:[0,e.leftbottom],x:1,y:0,o:0}:{p:[e.bottomleft,0],x:0,y:1,o:0};case 19:return i&bn?{p:[e.bottomleft,0],x:0,y:1,o:0}:{p:[0,e.lefttop],x:1,y:0,o:1};case 20:return i&bn?{p:[e.topleft,1],x:0,y:-1,o:0}:{p:[0,e.leftbottom],x:1,y:0,o:0};case 21:return i&An?{p:[0,e.leftbottom],x:1,y:0,o:0}:{p:[e.topright,1],x:0,y:-1,o:1};case 22:return i&bn?{p:[e.topleft,1],x:0,y:-1,o:0}:{p:[0,e.lefttop],x:1,y:0,o:1};case 23:return i&An?{p:[0,e.lefttop],x:1,y:0,o:1}:{p:[e.topright,1],x:0,y:-1,o:1};default:console.log("MarchingSquaresJS-isoBands: edge index out of range!"),console.log(e)}}return null}function ma(e,t,i,r){var n,a,o,s,l,u=e.cval;switch(t){case-1:switch(r){case 0:n=ra[u],o=Rn[u],s=Ln[u],l=Nn[u];break;default:n=ia[u],o=Dn[u],s=In[u],l=On[u]}break;case 1:switch(r){case 0:n=oa[u],o=Wn[u],s=jn[u],l=qn[u];break;default:n=sa[u],o=Gn[u],s=$n[u],l=Hn[u]}break;default:switch(i){case-1:switch(r){case 0:n=la[u],o=Sn[u],s=wn[u],l=En[u];break;default:n=ua[u],o=Tn[u],s=Pn[u],l=Mn[u]}break;case 1:switch(r){case 0:n=aa[u],o=kn[u],s=Bn[u],l=Fn[u];break;default:n=na[u],o=Vn[u],s=zn[u],l=Un[u]}}}if(a=e.edges.indexOf(n),void 0===e.edges[a])return null;switch(function(e,t){delete e.edges[t];for(var i=t+1;i<e.edges.length;i++)e.edges[i-1]=e.edges[i];e.edges.pop()}(e,a),u=e.cval_real,n){case 0:i=u&An?(t=e.topleft,1):(t=1,e.righttop);break;case 1:i=4&u?(t=1,e.rightbottom):(t=e.topleft,1);break;case 2:i=4&u?(t=e.topleft,1):(t=e.bottomright,0);break;case 3:i=1&u?(t=e.bottomleft,0):(t=e.topleft,1);break;case 4:i=u&An?(t=e.topright,1):(t=1,e.righttop);break;case 5:i=4&u?(t=1,e.rightbottom):(t=e.topright,1);break;case 6:i=4&u?(t=e.topright,1):(t=e.bottomright,0);break;case 7:i=1&u?(t=e.bottomleft,0):(t=e.topright,1);break;case 8:i=4&u?(t=1,e.righttop):(t=e.bottomright,0);break;case 9:i=1&u?(t=e.bottomleft,0):(t=1,e.righttop);break;case 10:i=1&u?(t=1,e.righttop):(t=0,e.leftbottom);break;case 11:i=u&bn?(t=0,e.lefttop):(t=1,e.righttop);break;case 12:i=4&u?(t=1,e.rightbottom):(t=e.bottomright,0);break;case 13:i=1&u?(t=e.bottomleft,0):(t=1,e.rightbottom);break;case 14:i=1&u?(t=1,e.rightbottom):(t=0,e.leftbottom);break;case 15:i=u&bn?(t=0,e.lefttop):(t=1,e.rightbottom);break;case 16:i=4&u?(t=0,e.leftbottom):(t=e.bottomright,0);break;case 17:i=u&bn?(t=0,e.lefttop):(t=e.bottomright,0);break;case 18:i=1&u?(t=e.bottomleft,0):(t=0,e.leftbottom);break;case 19:i=u&bn?(t=0,e.lefttop):(t=e.bottomleft,0);break;case 20:i=u&bn?(t=0,e.leftbottom):(t=e.topleft,1);break;case 21:i=u&An?(t=e.topright,1):(t=0,e.leftbottom);break;case 22:i=u&bn?(t=0,e.lefttop):(t=e.topleft,1);break;case 23:i=u&An?(t=e.topright,1):(t=0,e.lefttop);break;default:return console.log("MarchingSquaresJS-isoBands: edge index out of range!"),console.log(e),null}return void 0!==t&&void 0!==i&&void 0!==o&&void 0!==s&&void 0!==l||(console.log("MarchingSquaresJS-isoBands: undefined value!"),console.log(e),console.log(t+" "+i+" "+o+" "+s+" "+l)),{p:[t,i],x:o,y:s,o:l}}function ga(e){var i=[],r=[];e.forEach(function(e){var t=mr(V([e]));r.push(t),i.push({ring:e,area:t})}),r.sort(function(e,t){return t-e});var n=[];return r.forEach(function(e){for(var t=0;t<i.length;t++)if(i[t].area===e){n.push(i[t].ring),i.splice(t,1);break}}),n}function ya(e){for(var t=e.map(function(e){return{lrCoordinates:e,grouped:!1}}),i=[];!_a(t);)for(var r=0;r<t.length;r++)if(!t[r].grouped){var n=[];n.push(t[r].lrCoordinates),t[r].grouped=!0;for(var a=V([t[r].lrCoordinates]),o=r+1;o<t.length;o++)t[o].grouped||va(V([t[o].lrCoordinates]),a)&&(n.push(t[o].lrCoordinates),t[o].grouped=!0);i.push(n)}return i}function va(e,t){for(var i=si(e),r=0;r<i.features.length;r++)if(!ht(i.features[r],t))return!1;return!0}function _a(e){for(var t=0;t<e.length;t++)if(!1===e[t].grouped)return!1;return!0}function Ca(e,n,t){if(!q(t=t||{}))throw new Error("options is invalid");var a=t.pivot,i=t.mutate;if(!e)throw new Error("geojson is required");if(null==n||isNaN(n))throw new Error("angle is required");return 0===n||(a=a||oi(e),!1!==i&&void 0!==i||(e=Ct(e)),I(e,function(e){var t=cn(a,e)+n,i=lr(a,e),r=w(hn(a,i,t));e[0]=r[0],e[1]=r[1]})),e}function xa(i,r,e){if(!q(e=e||{}))throw new Error("options is invalid");var n=e.origin,t=e.mutate;if(!i)throw new Error("geojson required");if("number"!=typeof r||0===r)throw new Error("invalid factor");var a=Array.isArray(n)||"object"==typeof n;return!0!==t&&(i=Ct(i)),"FeatureCollection"!==i.type||a?ba(i,r,n):(N(i,function(e,t){i.features[t]=ba(e,r,n)}),i)}function ba(e,n,a){var t="Point"===X(e);return a=function(e,t){if(null==t&&(t="centroid"),Array.isArray(t)||"object"==typeof t)return Q(t);var i=e.bbox?e.bbox:ae(e),r=i[0],n=i[1],a=i[2],o=i[3];switch(t){case"sw":case"southwest":case"westsouth":case"bottomleft":return $([r,n]);case"se":case"southeast":case"eastsouth":case"bottomright":return $([a,n]);case"nw":case"northwest":case"westnorth":case"topleft":return $([r,o]);case"ne":case"northeast":case"eastnorth":case"topright":return $([a,o]);case"center":return ai(e);case void 0:case null:case"centroid":return oi(e);default:throw new Error("invalid origin")}}(e,a),1===n||t||I(e,function(e){var t=lr(a,e),i=cn(a,e),r=w(hn(a,t*n,i));e[0]=r[0],e[1]=r[1],3===e.length&&(e[2]*=n)}),e}function Aa(e){var t=e[0],i=e[1];return[i[0]-t[0],i[1]-t[1]]}function Sa(e,t){return e[0]*t[1]-t[0]*e[1]}function wa(e,t,i){var p=[],f=y(t,i),m=w(e),g=[];return m.forEach(function(e,t){if(t!==m.length-1){var i=(a=e,o=m[t+1],s=f,l=Math.sqrt((a[0]-o[0])*(a[0]-o[0])+(a[1]-o[1])*(a[1]-o[1])),u=a[0]+s*(o[1]-a[1])/l,c=o[0]+s*(o[1]-a[1])/l,d=a[1]+s*(a[0]-o[0])/l,h=o[1]+s*(a[0]-o[0])/l,[[u,d],[c,h]]);if(p.push(i),0<t){var r=p[t-1],n=function(i,e){return!function(e,t){return 0===Sa(Aa(i),Aa(t))}(0,e)&&function(e,t){var i,r,n,a,o,s,l=e[0],u=Aa(e),c=t[0],d=Aa(t),h=Sa(u,d);return o=Sa((r=n=l,[(i=c)[0]-r[0],i[1]-r[1]]),d)/h,a=[o*(s=u)[0],o*s[1]],[n[0]+a[0],n[1]+a[1]]}(i,e)}(i,r);!1!==n&&(r[1]=n,i[0]=n),g.push(r[0]),t===m.length-2&&(g.push(i[0]),g.push(i[1]))}2===m.length&&(g.push(i[0]),g.push(i[1]))}var a,o,s,l,u,c,d,h}),H(g,e.properties)}function Ea(e,t,i){var r=t[0]-e[0],n=t[1]-e[1],a=i[0]-t[0];return function(e){return(0<e)-(e<0)||+e}(r*(i[1]-t[1])-a*n)}function Ta(t,e){return e.geometry.coordinates[0].every(function(e){return ht($(e),t)})}ca[1]=ca[169]=Qn,ca[4]=ca[166]=Yn,ca[16]=ca[154]=Xn,ca[64]=ca[106]=Zn,ca[168]=ca[2]=Jn,ca[162]=ca[8]=Kn,ca[138]=ca[32]=ea,ca[42]=ca[128]=ta,ca[5]=ca[165]=function(e){return[[0,0],[0,e.leftbottom],[1,e.rightbottom],[1,0]]},ca[20]=ca[150]=function(e){return[[1,0],[e.bottomright,0],[e.topright,1],[1,1]]},ca[80]=ca[90]=function(e){return[[1,1],[1,e.righttop],[0,e.lefttop],[0,1]]},ca[65]=ca[105]=function(e){return[[e.bottomleft,0],[0,0],[0,1],[e.topleft,1]]},ca[160]=ca[10]=function(e){return[[1,e.righttop],[1,e.rightbottom],[0,e.leftbottom],[0,e.lefttop]]},ca[130]=ca[40]=function(e){return[[e.topleft,1],[e.topright,1],[e.bottomright,0],[e.bottomleft,0]]},ca[85]=function(){return[[0,0],[0,1],[1,1],[1,0]]},ca[101]=ca[69]=function(e){return[[1,e.rightbottom],[1,0],[0,0],[0,1],[e.topleft,1]]},ca[149]=ca[21]=function(e){return[[e.topright,1],[1,1],[1,0],[0,0],[0,e.leftbottom]]},ca[86]=ca[84]=function(e){return[[1,0],[e.bottomright,0],[0,e.lefttop],[0,1],[1,1]]},ca[89]=ca[81]=function(e){return[[1,1],[1,e.righttop],[e.bottomleft,0],[0,0],[0,1]]},ca[96]=ca[74]=function(e){return[[1,e.righttop],[1,e.rightbottom],[0,e.lefttop],[0,1],[e.topleft,1]]},ca[24]=ca[146]=function(e){return[[1,1],[1,e.righttop],[e.bottomright,0],[e.bottomleft,0],[e.topright,1]]},ca[6]=ca[164]=function(e){return[[1,e.rightbottom],[1,0],[e.bottomright,0],[0,e.leftbottom],[0,e.lefttop]]},ca[129]=ca[41]=function(e){return[[e.topright,1],[e.bottomleft,0],[0,0],[0,e.leftbottom],[e.topleft,1]]},ca[66]=ca[104]=function(e){return[[e.bottomright,0],[e.bottomleft,0],[0,e.lefttop],[0,1],[e.topleft,1]]},ca[144]=ca[26]=function(e){return[[1,1],[1,e.righttop],[0,e.leftbottom],[0,e.lefttop],[e.topright,1]]},ca[36]=ca[134]=function(e){return[[1,e.rightbottom],[1,0],[e.bottomright,0],[e.topleft,1],[e.topright,1]]},ca[9]=ca[161]=function(e){return[[1,e.righttop],[1,e.rightbottom],[e.bottomleft,0],[0,0],[0,e.leftbottom]]},ca[37]=ca[133]=function(e){return[[1,e.rightbottom],[1,0],[0,0],[0,e.leftbottom],[e.topleft,1],[e.topright,1]]},ca[148]=ca[22]=function(e){return[[1,1],[1,0],[e.bottomright,0],[0,e.leftbottom],[0,e.lefttop],[e.topright,1]]},ca[82]=ca[88]=function(e){return[[1,1],[1,e.righttop],[e.bottomright,0],[e.bottomleft,0],[0,e.lefttop],[0,1]]},ca[73]=ca[97]=function(e){return[[1,e.righttop],[1,e.rightbottom],[e.bottomleft,0],[0,0],[0,1],[e.topleft,1]]},ca[145]=ca[25]=function(e){return[[1,1],[1,e.righttop],[e.bottomleft,0],[0,0],[0,e.leftbottom],[e.topright,1]]},ca[70]=ca[100]=function(e){return[[1,e.rightbottom],[1,0],[e.bottomright,0],[0,e.lefttop],[0,1],[e.topleft,1]]},ca[34]=function(e){return[ta(e),Kn(e)]},ca[35]=function(e){return[[1,e.righttop],[1,e.rightbottom],[e.bottomright,0],[e.bottomleft,0],[0,e.leftbottom],[0,e.lefttop],[e.topleft,1],[e.topright,1]]},ca[136]=function(e){return[ea(e),Jn(e)]},ca[153]=function(e){return[Xn(e),Qn(e)]},ca[102]=function(e){return[Yn(e),Zn(e)]},ca[155]=function(e){return[[1,1],[1,e.righttop],[e.bottomleft,0],[0,0],[0,e.leftbottom],[e.topright,1]]},ca[103]=function(e){return[[1,e.rightbottom],[1,0],[e.bottomright,0],[0,e.lefttop],[0,1],[e.topleft,1]]},ca[152]=function(e){return[Xn(e),Jn(e)]},ca[156]=function(e){return[[1,1],[1,e.righttop],[e.bottomright,0],[e.bottomleft,0],[0,e.leftbottom],[0,e.lefttop],[e.topright,1]]},ca[137]=function(e){return[ea(e),Qn(e)]},ca[139]=function(e){return[[1,e.righttop],[1,e.rightbottom],[e.bottomleft,0],[0,0],[0,e.leftbottom],[e.topleft,1],[e.topright,1]]},ca[98]=function(e){return[Kn(e),Zn(e)]},ca[99]=function(e){return[[1,e.righttop],[1,e.rightbottom],[e.bottomright,0],[e.bottomleft,0],[0,e.lefttop],[0,1],[e.topleft,1]]},ca[38]=function(e){return[Yn(e),ta(e)]},ca[39]=function(e){return[[1,e.rightbottom],[1,0],[e.bottomright,0],[0,e.leftbottom],[0,e.lefttop],[e.topleft,1],[e.topright,1]]};var Pa=function(){function t(e){this.id=t.buildId(e),this.coordinates=e,this.innerEdges=[],this.outerEdges=[],this.outerEdgesSorted=!1}return t.buildId=function(e){return e.join(",")},t.prototype.removeInnerEdge=function(t){this.innerEdges=this.innerEdges.filter(function(e){return e.from.id!==t.from.id})},t.prototype.removeOuterEdge=function(t){this.outerEdges=this.outerEdges.filter(function(e){return e.to.id!==t.to.id})},t.prototype.addOuterEdge=function(e){this.outerEdges.push(e),this.outerEdgesSorted=!1},t.prototype.sortOuterEdges=function(){var a=this;this.outerEdgesSorted||(this.outerEdges.sort(function(e,t){var i=e.to,r=t.to;if(0<=i.coordinates[0]-a.coordinates[0]&&r.coordinates[0]-a.coordinates[0]<0)return 1;if(i.coordinates[0]-a.coordinates[0]<0&&0<=r.coordinates[0]-a.coordinates[0])return-1;if(i.coordinates[0]-a.coordinates[0]==0&&r.coordinates[0]-a.coordinates[0]==0)return 0<=i.coordinates[1]-a.coordinates[1]||0<=r.coordinates[1]-a.coordinates[1]?i.coordinates[1]-r.coordinates[1]:r.coordinates[1]-i.coordinates[1];var n=Ea(a.coordinates,i.coordinates,r.coordinates);return n<0?1:0<n?-1:Math.pow(i.coordinates[0]-a.coordinates[0],2)+Math.pow(i.coordinates[1]-a.coordinates[1],2)-(Math.pow(r.coordinates[0]-a.coordinates[0],2)+Math.pow(r.coordinates[1]-a.coordinates[1],2))}),this.outerEdgesSorted=!0)},t.prototype.getOuterEdges=function(){return this.sortOuterEdges(),this.outerEdges},t.prototype.getOuterEdge=function(e){return this.sortOuterEdges(),this.outerEdges[e]},t.prototype.addInnerEdge=function(e){this.innerEdges.push(e)},t}(),Ma=function(){function e(e,t){this.from=e,this.to=t,this.next=void 0,this.label=void 0,this.symetric=void 0,this.ring=void 0,this.from.addOuterEdge(this),this.to.addInnerEdge(this)}return e.prototype.getSymetric=function(){return this.symetric||(this.symetric=new e(this.to,this.from),this.symetric.symetric=this),this.symetric},e.prototype.deleteEdge=function(){this.from.removeOuterEdge(this),this.to.removeInnerEdge(this)},e.prototype.isEqual=function(e){return this.from.id===e.from.id&&this.to.id===e.to.id},e.prototype.toString=function(){return"Edge { "+this.from.id+" -> "+this.to.id+" }"},e.prototype.toLineString=function(){return H([this.from.coordinates,this.to.coordinates])},e.prototype.compareTo=function(e){return Ea(e.from.coordinates,e.to.coordinates,this.to.coordinates)},e}(),Da=function(){function e(){this.edges=[],this.polygon=void 0,this.envelope=void 0}return e.prototype.push=function(e){this[this.edges.length]=e,this.edges.push(e),this.polygon=this.envelope=void 0},e.prototype.get=function(e){return this.edges[e]},Object.defineProperty(e.prototype,"length",{get:function(){return this.edges.length},enumerable:!0,configurable:!0}),e.prototype.forEach=function(e){this.edges.forEach(e)},e.prototype.map=function(e){return this.edges.map(e)},e.prototype.some=function(e){return this.edges.some(e)},e.prototype.isValid=function(){return!0},e.prototype.isHole=function(){var r=this,e=this.edges.reduce(function(e,t,i){return t.from.coordinates[1]>r.edges[e].from.coordinates[1]&&(e=i),e},0),t=(0===e?this.length:e)-1,i=(e+1)%this.length,n=Ea(this.edges[t].from.coordinates,this.edges[e].from.coordinates,this.edges[i].from.coordinates);return 0===n?this.edges[t].from.coordinates[0]>this.edges[i].from.coordinates[0]:0<n},e.prototype.toMultiPoint=function(){return l(this.edges.map(function(e){return e.from.coordinates}))},e.prototype.toPolygon=function(){if(this.polygon)return this.polygon;var e=this.edges.map(function(e){return e.from.coordinates});return e.push(this.edges[0].from.coordinates),this.polygon=V([e])},e.prototype.getEnvelope=function(){return this.envelope?this.envelope:this.envelope=ei(this.toPolygon())},e.findEdgeRingContaining=function(u,e){var c,d,h=u.getEnvelope();return e.forEach(function(e){var t,i,r,n,a,o,s=e.getEnvelope();if(d&&(c=d.getEnvelope()),i=h,r=(t=s).geometry.coordinates.map(function(e){return e[0]}),n=t.geometry.coordinates.map(function(e){return e[1]}),a=i.geometry.coordinates.map(function(e){return e[0]}),o=i.geometry.coordinates.map(function(e){return e[1]}),(Math.max(null,r)!==Math.max(null,a)||Math.max(null,n)!==Math.max(null,o)||Math.min(null,r)!==Math.min(null,a)||Math.min(null,n)!==Math.min(null,o))&&Ta(s,h)){var l=u.map(function(e){return e.from.coordinates}).find(function(r){return!e.some(function(e){return t=r,i=e.from.coordinates,t[0]===i[0]&&t[1]===i[1];var t,i})});l&&e.inside($(l))&&(d&&!Ta(c,s)||(d=e))}}),d},e.prototype.inside=function(e){return ht(e,this.toPolygon())},e}(),Ia=function(){function t(){this.edges=[],this.nodes={}}return t.fromGeoJson=function(e){!function(e){if(!e)throw new Error("No geojson passed");if("FeatureCollection"!==e.type&&"GeometryCollection"!==e.type&&"MultiLineString"!==e.type&&"LineString"!==e.type&&"Feature"!==e.type)throw new Error("Invalid input type '"+e.type+"'. Geojson must be FeatureCollection, GeometryCollection, LineString, MultiLineString or Feature")}(e);var n=new t;return U(e,function(e){P(e,"LineString","Graph::fromGeoJson"),O(e,function(e,t){if(e){var i=n.getNode(e),r=n.getNode(t);n.addEdge(i,r)}return t})}),n},t.prototype.getNode=function(e){var t=Pa.buildId(e),i=this.nodes[t];return i=i||(this.nodes[t]=new Pa(e))},t.prototype.addEdge=function(e,t){var i=new Ma(e,t),r=i.getSymetric();this.edges.push(i),this.edges.push(r)},t.prototype.deleteDangles=function(){var t=this;Object.keys(this.nodes).map(function(e){return t.nodes[e]}).forEach(function(e){return t._removeIfDangle(e)})},t.prototype._removeIfDangle=function(e){var t=this;if(e.innerEdges.length<=1){var i=e.getOuterEdges().map(function(e){return e.to});this.removeNode(e),i.forEach(function(e){return t._removeIfDangle(e)})}},t.prototype.deleteCutEdges=function(){var t=this;this._computeNextCWEdges(),this._findLabeledEdgeRings(),this.edges.forEach(function(e){e.label===e.symetric.label&&(t.removeEdge(e.symetric),t.removeEdge(e))})},t.prototype._computeNextCWEdges=function(i){var t=this;void 0===i?Object.keys(this.nodes).forEach(function(e){return t._computeNextCWEdges(t.nodes[e])}):i.getOuterEdges().forEach(function(e,t){i.getOuterEdge((0===t?i.getOuterEdges().length:t)-1).symetric.next=e})},t.prototype._computeNextCCWEdges=function(e,t){for(var i,r,n=e.getOuterEdges(),a=n.length-1;0<=a;--a){var o=n[a],s=o.symetric,l=void 0,u=void 0;o.label===t&&(l=o),s.label===t&&(u=s),l&&u&&(u&&(r=u),l&&(r&&(r.next=l,r=void 0),i=i||l))}r&&(r.next=i)},t.prototype._findLabeledEdgeRings=function(){var i=[],r=0;return this.edges.forEach(function(e){if(!(0<=e.label)){i.push(e);for(var t=e;t.label=r,t=t.next,!e.isEqual(t););r++}}),i},t.prototype.getEdgeRings=function(){var i=this;this._computeNextCWEdges(),this.edges.forEach(function(e){e.label=void 0}),this._findLabeledEdgeRings().forEach(function(t){i._findIntersectionNodes(t).forEach(function(e){i._computeNextCCWEdges(e,t.label)})});var t=[];return this.edges.forEach(function(e){e.ring||t.push(i._findEdgeRing(e))}),t},t.prototype._findIntersectionNodes=function(i){for(var e=[],r=i,t=function(){var t=0;r.from.getOuterEdges().forEach(function(e){e.label===i.label&&++t}),1<t&&e.push(r.from),r=r.next};t(),!i.isEqual(r););return e},t.prototype._findEdgeRing=function(e){for(var t=e,i=new Da;i.push(t),t.ring=i,t=t.next,!e.isEqual(t););return i},t.prototype.removeNode=function(e){var t=this;e.getOuterEdges().forEach(function(e){return t.removeEdge(e)}),e.innerEdges.forEach(function(e){return t.removeEdge(e)}),delete this.nodes[e.id]},t.prototype.removeEdge=function(t){this.edges=this.edges.filter(function(e){return!e.isEqual(t)}),t.deleteEdge()},t}();function Oa(e,i){var r=!0;return U(e,function(t){U(i,function(e){if(!1===r)return!1;r=function(e,t){switch(e.type){case"Point":switch(t.type){case"Point":return i=e.coordinates,r=t.coordinates,!(i[0]===r[0]&&i[1]===r[1]);case"LineString":return!Ra(t,e);case"Polygon":return!ht(e,t)}break;case"LineString":switch(t.type){case"Point":return!Ra(e,t);case"LineString":return!function(e,t){return 0<ar(e,t).features.length}(e,t);case"Polygon":return!La(t,e)}break;case"Polygon":switch(t.type){case"Point":return!ht(t,e);case"LineString":return!La(e,t);case"Polygon":return!function(e,t){for(var i=0,r=e.coordinates[0];i<r.length;i++)if(ht(r[i],t))return!0;for(var n=0,a=t.coordinates[0];n<a.length;n++)if(ht(a[n],e))return!0;return 0<ar(qr(e),qr(t)).features.length}(t,e)}}var i,r;return!1}(t.geometry,e.geometry)})}),r}function Ra(e,t){for(var i=0;i<e.coordinates.length-1;i++)if(r=e.coordinates[i],n=e.coordinates[i+1],a=t.coordinates,void 0,o=a[0]-r[0],s=a[1]-r[1],l=n[0]-r[0],u=n[1]-r[1],0==o*u-s*l&&(Math.abs(l)>=Math.abs(u)?0<l?r[0]<=a[0]&&a[0]<=n[0]:n[0]<=a[0]&&a[0]<=r[0]:0<u?r[1]<=a[1]&&a[1]<=n[1]:n[1]<=a[1]&&a[1]<=r[1]))return!0;var r,n,a,o,s,l,u;return!1}function La(e,t){for(var i=0,r=t.coordinates;i<r.length;i++)if(ht(r[i],e))return!0;return 0<ar(t,qr(e)).features.length}function Na(e,t){return!(e[0]>t[0]||e[2]<t[2]||e[1]>t[1]||e[3]<t[3])}function ka(e,t){return e[0]===t[0]&&e[1]===t[1]}function Ba(e,t){for(var i=!1,r=!1,n=e.coordinates.length,a=0;a<n&&!i&&!r;){for(var o=0;o<t.coordinates.length-1;o++){var s=!0;0!==o&&o!==t.coordinates.length-2||(s=!1),za(t.coordinates[o],t.coordinates[o+1],e.coordinates[a],s)?i=!0:r=!0}a++}return i&&r}function Fa(e,t){return 0<ar(e,Qr(t)).features.length}function Va(e,t){for(var i=!1,r=!1,n=e.coordinates.length,a=0;a<n&&(!i||!r);a++)ht($(e.coordinates[a]),t)?i=!0:r=!0;return r&&i}function za(e,t,i,r){var n=i[0]-e[0],a=i[1]-e[1],o=t[0]-e[0],s=t[1]-e[1];return 0==n*s-a*o&&(r?Math.abs(o)>=Math.abs(s)?0<o?e[0]<=i[0]&&i[0]<=t[0]:t[0]<=i[0]&&i[0]<=e[0]:0<s?e[1]<=i[1]&&i[1]<=t[1]:t[1]<=i[1]&&i[1]<=e[1]:Math.abs(o)>=Math.abs(s)?0<o?e[0]<i[0]&&i[0]<t[0]:t[0]<i[0]&&i[0]<e[0]:0<s?e[1]<i[1]&&i[1]<t[1]:t[1]<i[1]&&i[1]<e[1])}var Ua=function(e){this.precision=e&&e.precision?e.precision:17,this.direction=!(!e||!e.direction)&&e.direction,this.pseudoNode=!(!e||!e.pseudoNode)&&e.pseudoNode,this.objectComparator=e&&e.objectComparator?e.objectComparator:Ha};function Ga(t){return t.coordinates.map(function(e){return{type:t.type.replace("Multi",""),coordinates:e}})}function $a(e,t){return e.hasOwnProperty("coordinates")?e.coordinates.length===t.coordinates.length:e.length===t.length}function Ha(e,t){return on(e,t,{strict:!0})}Ua.prototype.compare=function(e,t){if(e.type!==t.type||!$a(e,t))return!1;switch(e.type){case"Point":return this.compareCoord(e.coordinates,t.coordinates);case"LineString":return this.compareLine(e.coordinates,t.coordinates,0,!1);case"Polygon":return this.comparePolygon(e,t);case"Feature":return this.compareFeature(e,t);default:if(0===e.type.indexOf("Multi")){var i=this,r=Ga(e),n=Ga(t);return r.every(function(t){return this.some(function(e){return i.compare(t,e)})},n)}}return!1},Ua.prototype.compareCoord=function(e,t){if(e.length!==t.length)return!1;for(var i=0;i<e.length;i++)if(e[i].toFixed(this.precision)!==t[i].toFixed(this.precision))return!1;return!0},Ua.prototype.compareLine=function(e,t,i,r){if(!$a(e,t))return!1;var n=this.pseudoNode?e:this.removePseudo(e),a=this.pseudoNode?t:this.removePseudo(t);if(!r||this.compareCoord(n[0],a[0])||(a=this.fixStartIndex(a,n))){var o=this.compareCoord(n[i],a[i]);return this.direction||o?this.comparePath(n,a):!!this.compareCoord(n[i],a[a.length-(1+i)])&&this.comparePath(n.slice().reverse(),a)}},Ua.prototype.fixStartIndex=function(e,t){for(var i,r=-1,n=0;n<e.length;n++)if(this.compareCoord(e[n],t[0])){r=n;break}return 0<=r&&(i=[].concat(e.slice(r,e.length),e.slice(1,r+1))),i},Ua.prototype.comparePath=function(e,t){var i=this;return e.every(function(e,t){return i.compareCoord(e,this[t])},t)},Ua.prototype.comparePolygon=function(e,t){if(this.compareLine(e.coordinates[0],t.coordinates[0],1,!0)){var i=e.coordinates.slice(1,e.coordinates.length),r=t.coordinates.slice(1,t.coordinates.length),n=this;return i.every(function(t){return this.some(function(e){return n.compareLine(t,e,1,!0)})},r)}return!1},Ua.prototype.compareFeature=function(e,t){return!(e.id!==t.id||!this.objectComparator(e.properties,t.properties)||!this.compareBBox(e,t))&&this.compare(e.geometry,t.geometry)},Ua.prototype.compareBBox=function(e,t){return!!(!e.bbox&&!t.bbox||e.bbox&&t.bbox&&this.compareCoord(e.bbox,t.bbox))},Ua.prototype.removePseudo=function(e){return e};var Wa=Ua;function ja(e,i){var t=Y(e),r=Y(i),n=t.type,a=r.type;if("MultiPoint"===n&&"MultiPoint"!==a||("LineString"===n||"MultiLineString"===n)&&"LineString"!==a&&"MultiLineString"!==a||("Polygon"===n||"MultiPolygon"===n)&&"Polygon"!==a&&"MultiPolygon"!==a)throw new Error("features must be of the same type");if("Point"===n)throw new Error("Point geometry not supported");if(new Wa({precision:6}).compare(e,i))return!1;var o=0;switch(n){case"MultiPoint":for(var s=0;s<t.coordinates.length;s++)for(var l=0;l<r.coordinates.length;l++){var u=t.coordinates[s],c=r.coordinates[l];if(u[0]===c[0]&&u[1]===c[1])return!0}return!1;case"LineString":case"MultiLineString":J(e,function(t){J(i,function(e){sn(t,e).features.length&&o++})});break;case"Polygon":case"MultiPolygon":J(e,function(t){J(i,function(e){ar(t,e).features.length&&o++})})}return 0<o}function qa(e,i){var r=!1;return U(e,function(t){U(i,function(e){if(!0===r)return!0;r=!Oa(t.geometry,e.geometry)})}),r}var Qa=Be(function(e){function t(e,t,i,r){this.dataset=[],this.epsilon=1,this.minPts=2,this.distance=this._euclideanDistance,this.clusters=[],this.noise=[],this._visited=[],this._assigned=[],this._datasetLength=0,this._init(e,t,i,r)}t.prototype.run=function(e,t,i,r){this._init(e,t,i,r);for(var n=0;n<this._datasetLength;n++)if(1!==this._visited[n]){this._visited[n]=1;var a=this._regionQuery(n);if(a.length<this.minPts)this.noise.push(n);else{var o=this.clusters.length;this.clusters.push([]),this._addToCluster(n,o),this._expandCluster(o,a)}}return this.clusters},t.prototype._init=function(e,t,i,r){if(e){if(!(e instanceof Array))throw Error("Dataset must be of type array, "+typeof e+" given");this.dataset=e,this.clusters=[],this.noise=[],this._datasetLength=e.length,this._visited=new Array(this._datasetLength),this._assigned=new Array(this._datasetLength)}t&&(this.epsilon=t),i&&(this.minPts=i),r&&(this.distance=r)},t.prototype._expandCluster=function(e,t){for(var i=0;i<t.length;i++){var r=t[i];if(1!==this._visited[r]){this._visited[r]=1;var n=this._regionQuery(r);n.length>=this.minPts&&(t=this._mergeArrays(t,n))}1!==this._assigned[r]&&this._addToCluster(r,e)}},t.prototype._addToCluster=function(e,t){this.clusters[t].push(e),this._assigned[e]=1},t.prototype._regionQuery=function(e){for(var t=[],i=0;i<this._datasetLength;i++)this.distance(this.dataset[e],this.dataset[i])<this.epsilon&&t.push(i);return t},t.prototype._mergeArrays=function(e,t){for(var i=t.length,r=0;r<i;r++){var n=t[r];e.indexOf(n)<0&&e.push(n)}return e},t.prototype._euclideanDistance=function(e,t){for(var i=0,r=Math.min(e.length,t.length);r--;)i+=(e[r]-t[r])*(e[r]-t[r]);return Math.sqrt(i)},e.exports&&(e.exports=t)}),Ya=Be(function(e){function t(e,t,i){this.k=3,this.dataset=[],this.assignments=[],this.centroids=[],this.init(e,t,i)}t.prototype.init=function(e,t,i){this.assignments=[],this.centroids=[],void 0!==e&&(this.dataset=e),void 0!==t&&(this.k=t),void 0!==i&&(this.distance=i)},t.prototype.run=function(e,t){this.init(e,t);for(var i=this.dataset.length,r=0;r<this.k;r++)this.centroids[r]=this.randomCentroid();for(var n=!0;n;){n=this.assign();for(var a=0;a<this.k;a++){for(var o=new Array(c),s=0,l=0;l<c;l++)o[l]=0;for(var u=0;u<i;u++){var c=this.dataset[u].length;if(a===this.assignments[u]){for(l=0;l<c;l++)o[l]+=this.dataset[u][l];s++}}if(0<s){for(l=0;l<c;l++)o[l]/=s;this.centroids[a]=o}else this.centroids[a]=this.randomCentroid(),n=!0}}return this.getClusters()},t.prototype.randomCentroid=function(){for(var e,t,i=this.dataset.length-1;t=Math.round(Math.random()*i),e=this.dataset[t],0<=this.centroids.indexOf(e););return e},t.prototype.assign=function(){for(var e,t=!1,i=this.dataset.length,r=0;r<i;r++)(e=this.argmin(this.dataset[r],this.centroids,this.distance))!=this.assignments[r]&&(this.assignments[r]=e,t=!0);return t},t.prototype.getClusters=function(){for(var e,t=new Array(this.k),i=0;i<this.assignments.length;i++)void 0===t[e=this.assignments[i]]&&(t[e]=[]),t[e].push(i);return t},t.prototype.argmin=function(e,t,i){for(var r,n=Number.MAX_VALUE,a=0,o=t.length,s=0;s<o;s++)(r=i(e,t[s]))<n&&(n=r,a=s);return a},t.prototype.distance=function(e,t){for(var i=0,r=Math.min(e.length,t.length);r--;){var n=e[r]-t[r];i+=n*n}return Math.sqrt(i)},e.exports&&(e.exports=t)}),Xa=Be(function(e){function t(e,t,i){this._queue=[],this._priorities=[],this._sorting="desc",this._init(e,t,i)}t.prototype.insert=function(e,t){for(var i=this._queue.length,r=i;r--;){var n=this._priorities[r];"desc"===this._sorting?n<t&&(i=r):t<n&&(i=r)}this._insertAt(e,t,i)},t.prototype.remove=function(e){for(var t=this._queue.length;t--;)if(e===this._queue[t]){this._queue.splice(t,1),this._priorities.splice(t,1);break}},t.prototype.forEach=function(e){this._queue.forEach(e)},t.prototype.getElements=function(){return this._queue},t.prototype.getElementPriority=function(e){return this._priorities[e]},t.prototype.getPriorities=function(){return this._priorities},t.prototype.getElementsWithPriorities=function(){for(var e=[],t=0,i=this._queue.length;t<i;t++)e.push([this._queue[t],this._priorities[t]]);return e},t.prototype._init=function(e,t,i){if(e&&t){if(this._queue=[],this._priorities=[],e.length!==t.length)throw new Error("Arrays must have the same length");for(var r=0;r<e.length;r++)this.insert(e[r],t[r])}i&&(this._sorting=i)},t.prototype._insertAt=function(e,t,i){this._queue.length===i?(this._queue.push(e),this._priorities.push(t)):(this._queue.splice(i,0,e),this._priorities.splice(i,0,t))},e.exports&&(e.exports=t)}),Za=Be(function(e){if(e.exports)var u=Xa;function t(e,t,i,r){this.epsilon=1,this.minPts=1,this.distance=this._euclideanDistance,this._reachability=[],this._processed=[],this._coreDistance=0,this._orderedList=[],this._init(e,t,i,r)}t.prototype.run=function(e,t,i,r){this._init(e,t,i,r);for(var n=0,a=this.dataset.length;n<a;n++)if(1!==this._processed[n]){this._processed[n]=1,this.clusters.push([n]);var o=this.clusters.length-1;this._orderedList.push(n);var s=new u(null,null,"asc"),l=this._regionQuery(n);void 0!==this._distanceToCore(n)&&(this._updateQueue(n,l,s),this._expandCluster(o,s))}return this.clusters},t.prototype.getReachabilityPlot=function(){for(var e=[],t=0,i=this._orderedList.length;t<i;t++){var r=this._orderedList[t],n=this._reachability[r];e.push([r,n])}return e},t.prototype._init=function(e,t,i,r){if(e){if(!(e instanceof Array))throw Error("Dataset must be of type array, "+typeof e+" given");this.dataset=e,this.clusters=[],this._reachability=new Array(this.dataset.length),this._processed=new Array(this.dataset.length),this._coreDistance=0,this._orderedList=[]}t&&(this.epsilon=t),i&&(this.minPts=i),r&&(this.distance=r)},t.prototype._updateQueue=function(r,e,n){var a=this;this._coreDistance=this._distanceToCore(r),e.forEach(function(e){if(void 0===a._processed[e]){var t=a.distance(a.dataset[r],a.dataset[e]),i=Math.max(a._coreDistance,t);void 0===a._reachability[e]?(a._reachability[e]=i,n.insert(e,i)):i<a._reachability[e]&&(a._reachability[e]=i,n.remove(e),n.insert(e,i))}})},t.prototype._expandCluster=function(e,t){for(var i=t.getElements(),r=0,n=i.length;r<n;r++){var a=i[r];if(void 0===this._processed[a]){var o=this._regionQuery(a);this._processed[a]=1,this.clusters[e].push(a),this._orderedList.push(a),void 0!==this._distanceToCore(a)&&(this._updateQueue(a,o,t),this._expandCluster(e,t))}}},t.prototype._distanceToCore=function(e){for(var t=this.epsilon,i=0;i<t;i++)if(this._regionQuery(e,i).length>=this.minPts)return i},t.prototype._regionQuery=function(e,t){t=t||this.epsilon;for(var i=[],r=0,n=this.dataset.length;r<n;r++)this.distance(this.dataset[e],this.dataset[r])<t&&i.push(r);return i},t.prototype._euclideanDistance=function(e,t){for(var i=0,r=Math.min(e.length,t.length);r--;)i+=(e[r]-t[r])*(e[r]-t[r]);return Math.sqrt(i)},e.exports&&(e.exports=t)}),Ja=Be(function(e){e.exports&&(e.exports={DBSCAN:Qa,KMEANS:Ya,OPTICS:Za,PriorityQueue:Xa})}),Ka=function(e,t,i){for(var r=e.length,n=0,a=0;a<r;a++){var o=(e[a]||0)-(t[a]||0);n+=o*o}return i?Math.sqrt(n):n},eo=Ka,to=function(e,t,i){var r=Math.abs(e-t);return i?r:r*r},io=Ka;function ro(e,t,i){i=i||[];for(var r=0;r<e;r++)i[r]=t;return i}var no=function(e,t,i,r){var n=[],a=[],o=[],s=[],l=!1,u=r||1e4,c=e.length,d=e[0].length,h=0<d,p=[];if(i)n="kmrand"==i?function(e,t){for(var i={},r=[],n=t<<2,a=e.length,o=e[0].length>0;r.length<t&&n-- >0;){var s=e[Math.floor(Math.random()*a)],l=o?s.join("_"):""+s;i[l]||(i[l]=!0,r.push(s))}if(r.length<t)throw new Error("Error initializating clusters");return r}(e,t):"kmpp"==i?function(e,t){var i=e[0].length?eo:to,r=[],n=e.length,a=e[0].length>0,o=e[Math.floor(Math.random()*n)];for(a&&o.join("_"),r.push(o);r.length<t;){for(var s=[],l=r.length,u=0,c=[],d=0;d<n;d++){for(var h=1/0,p=0;p<l;p++){var f=i(e[d],r[p]);f<=h&&(h=f)}s[d]=h}for(var m=0;m<n;m++)u+=s[m];for(var g=0;g<n;g++)c[g]={i:g,v:e[g],pr:s[g]/u,cs:0};c.sort(function(e,t){return e.pr-t.pr}),c[0].cs=c[0].pr;for(var y=1;y<n;y++)c[y].cs=c[y-1].cs+c[y].pr;for(var v=Math.random(),_=0;_<n-1&&c[_++].cs<v;);r.push(c[_-1].v)}return r}(e,t):i;else for(var f={};n.length<t;){var m=Math.floor(Math.random()*c);f[m]||(f[m]=!0,n.push(e[m]))}do{ro(t,0,p);for(var g=0;g<c;g++){for(var y=1/0,v=0,_=0;_<t;_++)(s=h?io(e[g],n[_]):Math.abs(e[g]-n[_]))<=y&&(y=s,v=_);o[g]=v,p[v]++}for(var C=[],x=(a=[],0);x<t;x++)C[x]=h?ro(d,0,C[x]):0,a[x]=n[x];if(h){for(var b=0;b<t;b++)n[b]=[];for(var A=0;A<c;A++)for(var S=C[o[A]],w=e[A],E=0;E<d;E++)S[E]+=w[E];l=!0;for(var T=0;T<t;T++){for(var P=n[T],M=C[T],D=a[T],I=p[T],O=0;O<d;O++)P[O]=M[O]/I||0;if(l)for(var R=0;R<d;R++)if(D[R]!=P[R]){l=!1;break}}}else{for(var L=0;L<c;L++)C[o[L]]+=e[L];for(var N=0;N<t;N++)n[N]=C[N]/p[N]||0;l=!0;for(var k=0;k<t;k++)if(a[k]!=n[k]){l=!1;break}}l=l||--u<=0}while(!l);return{it:1e4-u,k:t,idxs:o,centroids:n}};function ao(e,t){if(e.geometry&&e.geometry.type)return e.geometry.type;if(e.type)return e.type;throw new Error("Invalid GeoJSON object for "+t)}function oo(e){for(var t=e,i=[];t.parent;)i.unshift(t),t=t.parent;return i}var so={search:function(e,t,i,r){e.cleanDirty();var n=(r=r||{}).heuristic||so.heuristics.manhattan,a=r.closest||!1,o=new co(function(e){return e.f}),s=t;for(t.h=n(t,i),o.push(t);0<o.size();){var l=o.pop();if(l===i)return oo(l);l.closed=!0;for(var u=e.neighbors(l),c=0,d=u.length;c<d;++c){var h=u[c];if(!h.closed&&!h.isWall()){var p=l.g+h.getCost(l),f=h.visited;(!f||p<h.g)&&(h.visited=!0,h.parent=l,h.h=h.h||n(h,i),h.g=p,h.f=h.g+h.h,e.markDirty(h),a&&(h.h<s.h||h.h===s.h&&h.g<s.g)&&(s=h),f?o.rescoreElement(h):o.push(h))}}}return a?oo(s):[]},heuristics:{manhattan:function(e,t){return Math.abs(t.x-e.x)+Math.abs(t.y-e.y)},diagonal:function(e,t){var i=Math.sqrt(2),r=Math.abs(t.x-e.x),n=Math.abs(t.y-e.y);return 1*(r+n)+(i-2)*Math.min(r,n)}},cleanNode:function(e){e.f=0,e.g=0,e.h=0,e.visited=!1,e.closed=!1,e.parent=null}};function lo(e,t){t=t||{},this.nodes=[],this.diagonal=!!t.diagonal,this.grid=[];for(var i=0;i<e.length;i++){this.grid[i]=[];for(var r=0,n=e[i];r<n.length;r++){var a=new uo(i,r,n[r]);this.grid[i][r]=a,this.nodes.push(a)}}this.init()}function uo(e,t,i){this.x=e,this.y=t,this.weight=i}function co(e){this.content=[],this.scoreFunction=e}function ho(e,t){for(var i=0;i<t.features.length;i++)if(ht(e,t.features[i]))return!0;return!1}function po(e){return function(){return e}}function fo(e){return e[0]}function mo(e){return e[1]}function go(){this._=null}function yo(e){e.U=e.C=e.L=e.R=e.P=e.N=null}function vo(e,t){var i=t,r=t.R,n=i.U;n?n.L===i?n.L=r:n.R=r:e._=r,r.U=n,i.U=r,i.R=r.L,i.R&&(i.R.U=i),r.L=i}function _o(e,t){var i=t,r=t.L,n=i.U;n?n.L===i?n.L=r:n.R=r:e._=r,r.U=n,i.U=r,i.L=r.R,i.L&&(i.L.U=i),r.R=i}function Co(e){for(;e.L;)e=e.L;return e}function xo(e,t,i,r){var n=[null,null],a=$o.push(n)-1;return n.left=e,n.right=t,i&&Ao(n,e,t,i),r&&Ao(n,t,e,r),Uo[e.index].halfedges.push(a),Uo[t.index].halfedges.push(a),n}function bo(e,t,i){var r=[t,i];return r.left=e,r}function Ao(e,t,i,r){e[0]||e[1]?e.left===i?e[1]=r:e[0]=r:(e[0]=r,e.left=t,e.right=i)}function So(e,t,i,r,n){var a,o=e[0],s=e[1],l=o[0],u=o[1],c=0,d=1,h=s[0]-l,p=s[1]-u;if(a=t-l,h||!(0<a)){if(a/=h,h<0){if(a<c)return;a<d&&(d=a)}else if(0<h){if(d<a)return;c<a&&(c=a)}if(a=r-l,h||!(a<0)){if(a/=h,h<0){if(d<a)return;c<a&&(c=a)}else if(0<h){if(a<c)return;a<d&&(d=a)}if(a=i-u,p||!(0<a)){if(a/=p,p<0){if(a<c)return;a<d&&(d=a)}else if(0<p){if(d<a)return;c<a&&(c=a)}if(a=n-u,p||!(a<0)){if(a/=p,p<0){if(d<a)return;c<a&&(c=a)}else if(0<p){if(a<c)return;a<d&&(d=a)}return!(0<c||d<1)||(0<c&&(e[0]=[l+c*h,u+c*p]),d<1&&(e[1]=[l+d*h,u+d*p]),!0)}}}}}function wo(e,t,i,r,n){var a=e[1];if(a)return!0;var o,s,l=e[0],u=e.left,c=e.right,d=u[0],h=u[1],p=c[0],f=c[1],m=(d+p)/2,g=(h+f)/2;if(f===h){if(m<t||r<=m)return;if(p<d){if(l){if(l[1]>=n)return}else l=[m,i];a=[m,n]}else{if(l){if(l[1]<i)return}else l=[m,n];a=[m,i]}}else if(s=g-(o=(d-p)/(f-h))*m,o<-1||1<o)if(p<d){if(l){if(l[1]>=n)return}else l=[(i-s)/o,i];a=[(n-s)/o,n]}else{if(l){if(l[1]<i)return}else l=[(n-s)/o,n];a=[(i-s)/o,i]}else if(h<f){if(l){if(l[0]>=r)return}else l=[t,o*t+s];a=[r,o*r+s]}else{if(l){if(l[0]<t)return}else l=[r,o*r+s];a=[t,o*t+s]}return e[0]=l,e[1]=a,!0}function Eo(e,t){return t[+(t.left!==e.site)]}lo.prototype.init=function(){this.dirtyNodes=[];for(var e=0;e<this.nodes.length;e++)so.cleanNode(this.nodes[e])},lo.prototype.cleanDirty=function(){for(var e=0;e<this.dirtyNodes.length;e++)so.cleanNode(this.dirtyNodes[e]);this.dirtyNodes=[]},lo.prototype.markDirty=function(e){this.dirtyNodes.push(e)},lo.prototype.neighbors=function(e){var t=[],i=e.x,r=e.y,n=this.grid;return n[i-1]&&n[i-1][r]&&t.push(n[i-1][r]),n[i+1]&&n[i+1][r]&&t.push(n[i+1][r]),n[i]&&n[i][r-1]&&t.push(n[i][r-1]),n[i]&&n[i][r+1]&&t.push(n[i][r+1]),this.diagonal&&(n[i-1]&&n[i-1][r-1]&&t.push(n[i-1][r-1]),n[i+1]&&n[i+1][r-1]&&t.push(n[i+1][r-1]),n[i-1]&&n[i-1][r+1]&&t.push(n[i-1][r+1]),n[i+1]&&n[i+1][r+1]&&t.push(n[i+1][r+1])),t},lo.prototype.toString=function(){for(var e,t,i,r,n=[],a=this.grid,o=0,s=a.length;o<s;o++){for(e=[],i=0,r=(t=a[o]).length;i<r;i++)e.push(t[i].weight);n.push(e.join(" "))}return n.join("\n")},uo.prototype.toString=function(){return"["+this.x+" "+this.y+"]"},uo.prototype.getCost=function(e){return e&&e.x!==this.x&&e.y!==this.y?1.41421*this.weight:this.weight},uo.prototype.isWall=function(){return 0===this.weight},co.prototype={push:function(e){this.content.push(e),this.sinkDown(this.content.length-1)},pop:function(){var e=this.content[0],t=this.content.pop();return 0<this.content.length&&(this.content[0]=t,this.bubbleUp(0)),e},remove:function(e){var t=this.content.indexOf(e),i=this.content.pop();t!==this.content.length-1&&(this.content[t]=i,this.scoreFunction(i)<this.scoreFunction(e)?this.sinkDown(t):this.bubbleUp(t))},size:function(){return this.content.length},rescoreElement:function(e){this.sinkDown(this.content.indexOf(e))},sinkDown:function(e){for(var t=this.content[e];0<e;){var i=(e+1>>1)-1,r=this.content[i];if(!(this.scoreFunction(t)<this.scoreFunction(r)))break;this.content[i]=t,this.content[e]=r,e=i}},bubbleUp:function(e){for(var t=this.content.length,i=this.content[e],r=this.scoreFunction(i);;){var n,a=e+1<<1,o=a-1,s=null;if(o<t){var l=this.content[o];(n=this.scoreFunction(l))<r&&(s=o)}if(a<t){var u=this.content[a];this.scoreFunction(u)<(null===s?r:n)&&(s=a)}if(null===s)break;this.content[e]=this.content[s],this.content[s]=i,e=s}}},go.prototype={constructor:go,insert:function(e,t){var i,r,n;if(e){if(t.P=e,t.N=e.N,e.N&&(e.N.P=t),e.N=t,e.R){for(e=e.R;e.L;)e=e.L;e.L=t}else e.R=t;i=e}else i=this._?(e=Co(this._),t.P=null,(t.N=e).P=e.L=t,e):(t.P=t.N=null,this._=t,null);for(t.L=t.R=null,t.U=i,t.C=!0,e=t;i&&i.C;)i===(r=i.U).L?(n=r.R)&&n.C?(i.C=n.C=!1,r.C=!0,e=r):(e===i.R&&(vo(this,i),i=(e=i).U),i.C=!1,r.C=!0,_o(this,r)):(n=r.L)&&n.C?(i.C=n.C=!1,r.C=!0,e=r):(e===i.L&&(_o(this,i),i=(e=i).U),i.C=!1,r.C=!0,vo(this,r)),i=e.U;this._.C=!1},remove:function(e){e.N&&(e.N.P=e.P),e.P&&(e.P.N=e.N),e.N=e.P=null;var t,i,r,n=e.U,a=e.L,o=e.R;if(i=a?o?Co(o):a:o,n?n.L===e?n.L=i:n.R=i:this._=i,a&&o?(r=i.C,i.C=e.C,((i.L=a).U=i)!==o?(n=i.U,i.U=e.U,e=i.R,n.L=e,(i.R=o).U=i):(i.U=n,e=(n=i).R)):(r=e.C,e=i),e&&(e.U=n),!r)if(e&&e.C)e.C=!1;else{do{if(e===this._)break;if(e===n.L){if((t=n.R).C&&(t.C=!1,n.C=!0,vo(this,n),t=n.R),t.L&&t.L.C||t.R&&t.R.C){t.R&&t.R.C||(t.L.C=!1,t.C=!0,_o(this,t),t=n.R),t.C=n.C,n.C=t.R.C=!1,vo(this,n),e=this._;break}}else if((t=n.L).C&&(t.C=!1,n.C=!0,_o(this,n),t=n.L),t.L&&t.L.C||t.R&&t.R.C){t.L&&t.L.C||(t.R.C=!1,t.C=!0,vo(this,t),t=n.L),t.C=n.C,n.C=t.L.C=!1,_o(this,n),e=this._;break}t.C=!0,n=(e=n).U}while(!e.C);e&&(e.C=!1)}}};var To,Po=[];function Mo(){yo(this),this.x=this.y=this.arc=this.site=this.cy=null}function Do(e){var t=e.P,i=e.N;if(t&&i){var r=t.site,n=e.site,a=i.site;if(r!==a){var o=n[0],s=n[1],l=r[0]-o,u=r[1]-s,c=a[0]-o,d=a[1]-s,h=2*(l*d-u*c);if(!(-Wo<=h)){var p=l*l+u*u,f=c*c+d*d,m=(d*p-u*f)/h,g=(l*f-c*p)/h,y=Po.pop()||new Mo;y.arc=e,y.site=n,y.x=m+o,y.y=(y.cy=g+s)+Math.sqrt(m*m+g*g),e.circle=y;for(var v=null,_=Go._;_;)if(y.y<_.y||y.y===_.y&&y.x<=_.x){if(!_.L){v=_.P;break}_=_.L}else{if(!_.R){v=_;break}_=_.R}Go.insert(v,y),v||(To=y)}}}}function Io(e){var t=e.circle;t&&(t.P||(To=t.N),Go.remove(t),Po.push(t),yo(t),e.circle=null)}var Oo=[];function Ro(){yo(this),this.edge=this.site=this.circle=null}function Lo(e){var t=Oo.pop()||new Ro;return t.site=e,t}function No(e){Io(e),zo.remove(e),Oo.push(e),yo(e)}function ko(e){var t=e.circle,i=t.x,r=t.cy,n=[i,r],a=e.P,o=e.N,s=[e];No(e);for(var l=a;l.circle&&Math.abs(i-l.circle.x)<Ho&&Math.abs(r-l.circle.cy)<Ho;)a=l.P,s.unshift(l),No(l),l=a;s.unshift(l),Io(l);for(var u=o;u.circle&&Math.abs(i-u.circle.x)<Ho&&Math.abs(r-u.circle.cy)<Ho;)o=u.N,s.push(u),No(u),u=o;s.push(u),Io(u);var c,d=s.length;for(c=1;c<d;++c)u=s[c],l=s[c-1],Ao(u.edge,l.site,u.site,n);l=s[0],(u=s[d-1]).edge=xo(l.site,u.site,null,n),Do(l),Do(u)}function Bo(e){for(var t,i,r,n,a=e[0],o=e[1],s=zo._;s;)if((r=Fo(s,o)-a)>Ho)s=s.L;else{if(!((n=a-Vo(s,o))>Ho)){-Ho<r?(t=s.P,i=s):-Ho<n?i=(t=s).N:t=i=s;break}if(!s.R){t=s;break}s=s.R}!function(e){Uo[e.index]={site:e,halfedges:[]}}(e);var l=Lo(e);if(zo.insert(t,l),t||i){if(t===i)return Io(t),i=Lo(t.site),zo.insert(l,i),l.edge=i.edge=xo(t.site,l.site),Do(t),void Do(i);if(i){Io(t),Io(i);var u=t.site,c=u[0],d=u[1],h=e[0]-c,p=e[1]-d,f=i.site,m=f[0]-c,g=f[1]-d,y=2*(h*g-p*m),v=h*h+p*p,_=m*m+g*g,C=[(g*v-p*_)/y+c,(h*_-m*v)/y+d];Ao(i.edge,u,f,C),l.edge=xo(u,e,null,C),i.edge=xo(e,f,null,C),Do(t),Do(i)}else l.edge=xo(t.site,l.site)}}function Fo(e,t){var i=e.site,r=i[0],n=i[1],a=n-t;if(!a)return r;var o=e.P;if(!o)return-1/0;var s=(i=o.site)[0],l=i[1],u=l-t;if(!u)return s;var c=s-r,d=1/a-1/u,h=c/u;return d?(-h+Math.sqrt(h*h-2*d*(c*c/(-2*u)-l+u/2+n-a/2)))/d+r:(r+s)/2}function Vo(e,t){var i=e.N;if(i)return Fo(i,t);var r=e.site;return r[1]===t?r[0]:1/0}var zo,Uo,Go,$o,Ho=1e-6,Wo=1e-12;function jo(e,t){return t[1]-e[1]||t[0]-e[0]}function qo(e,t){var i,r,n,a=e.sort(jo).pop();for($o=[],Uo=new Array(e.length),zo=new go,Go=new go;;)if(n=To,a&&(!n||a[1]<n.y||a[1]===n.y&&a[0]<n.x))a[0]===i&&a[1]===r||(Bo(a),i=a[0],r=a[1]),a=e.pop();else{if(!n)break;ko(n.arc)}if(function(){for(var e,t,i,r,n=0,a=Uo.length;n<a;++n)if((e=Uo[n])&&(r=(t=e.halfedges).length)){var o=new Array(r),s=new Array(r);for(i=0;i<r;++i)o[i]=i,s[i]=(l=e,u=$o[t[i]],h=d=void 0,c=l.site,d=u.left,h=u.right,c===h&&(h=d,d=c),h?Math.atan2(h[1]-d[1],h[0]-d[0]):(h=c===d?(d=u[1],u[0]):(d=u[0],u[1]),Math.atan2(d[0]-h[0],h[1]-d[1])));for(o.sort(function(e,t){return s[t]-s[e]}),i=0;i<r;++i)s[i]=t[o[i]];for(i=0;i<r;++i)t[i]=s[i]}var l,u,c,d,h}(),t){var o=+t[0][0],s=+t[0][1],l=+t[1][0],u=+t[1][1];!function(e,t,i,r){for(var n,a=$o.length;a--;)wo(n=$o[a],e,t,i,r)&&So(n,e,t,i,r)&&(Math.abs(n[0][0]-n[1][0])>Ho||Math.abs(n[0][1]-n[1][1])>Ho)||delete $o[a]}(o,s,l,u),function(e,t,i,r){var n,a,o,s,l,u,c,d,h,p,f,m,g,y,v=Uo.length,_=!0;for(n=0;n<v;++n)if(a=Uo[n]){for(o=a.site,s=(l=a.halfedges).length;s--;)$o[l[s]]||l.splice(s,1);for(s=0,u=l.length;s<u;)f=(g=a,y=$o[l[s]],p=y[+(y.left===g.site)])[0],m=p[1],d=(c=Eo(a,$o[l[++s%u]]))[0],h=c[1],(Math.abs(f-d)>Ho||Math.abs(m-h)>Ho)&&(l.splice(s,0,$o.push(bo(o,p,Math.abs(f-e)<Ho&&Ho<r-m?[e,Math.abs(d-e)<Ho?h:r]:Math.abs(m-r)<Ho&&Ho<i-f?[Math.abs(h-r)<Ho?d:i,r]:Math.abs(f-i)<Ho&&Ho<m-t?[i,Math.abs(d-i)<Ho?h:t]:Math.abs(m-t)<Ho&&Ho<f-e?[Math.abs(h-t)<Ho?d:e,t]:null))-1),++u);u&&(_=!1)}if(_){var C,x,b,A=1/0;for(n=0,_=null;n<v;++n)(a=Uo[n])&&(b=(C=(o=a.site)[0]-e)*C+(x=o[1]-t)*x)<A&&(A=b,_=a);if(_){var S=[e,t],w=[e,r],E=[i,r],T=[i,t];_.halfedges.push($o.push(bo(o=_.site,S,w))-1,$o.push(bo(o,w,E))-1,$o.push(bo(o,E,T))-1,$o.push(bo(o,T,S))-1)}}for(n=0;n<v;++n)(a=Uo[n])&&(a.halfedges.length||delete Uo[n])}(o,s,l,u)}this.edges=$o,this.cells=Uo,zo=Go=$o=Uo=null}function Qo(e){return(e=e.slice()).push(e[0]),V([e])}function Yo(e,t,i,r){var n=(r=r||{}).steps||64,a=r.units||"kilometers",o=r.angle||0,s=r.pivot||e,l=r.properties||e.properties||{};if(!e)throw new Error("center is required");if(!t)throw new Error("xSemiAxis is required");if(!i)throw new Error("ySemiAxis is required");if(!q(r))throw new Error("options must be an object");if(!j(n))throw new Error("steps must be a number");if(!j(o))throw new Error("angle must be a number");var u=Q(e);if("degrees"===a)var c=_(o);else t=hn(e,t,90,{units:a}),i=hn(e,i,0,{units:a}),t=Q(t)[0]-u[0],i=Q(i)[1]-u[1];for(var d=[],h=0;h<n;h+=1){var p=-360*h/n,f=t*i/Math.sqrt(Math.pow(i,2)+Math.pow(t,2)*Math.pow(Xo(p),2)),m=t*i/Math.sqrt(Math.pow(t,2)+Math.pow(i,2)/Math.pow(Xo(p),2));if(p<-90&&-270<=p&&(f=-f),p<-180&&-360<=p&&(m=-m),"degrees"===a){var g=f*Math.cos(c)+m*Math.sin(c),y=m*Math.cos(c)-f*Math.sin(c);f=g,m=y}d.push([f+u[0],m+u[1]])}return d.push(d[0]),"degrees"===a?V([d],l):Ca(V([d],l),o,{pivot:s})}function Xo(e){var t=e*Math.PI/180;return Math.tan(t)}function Zo(e,n){void 0===n&&(n={});var a=0,o=0,s=0;return F(e,function(e,t,i){var r=n.weight?null==i?void 0:i[n.weight]:void 0;if(!j(r=null==r?1:r))throw new Error("weight value must be a number for feature index "+t);0<(r=Number(r))&&I(e,function(e){a+=e[0]*r,o+=e[1]*r,s+=r})}),$([a/s,o/s],n.properties,n)}function Jo(e,t){return{x:e[0]-t[0],y:e[1]-t[1]}}function Ko(d,h){var p=0,f=0;I(d,function(e,t,i,r,n){p<n&&(p=n,f=t,h.push([]));var a=t-f,o=d.coordinates[n][1+a],s=e[0],l=e[1],u=o[0],c=o[1];h[n].push([.75*s+.25*u,.75*l+.25*c]),h[n].push([.25*s+.75*u,.25*l+.75*c])},!0),h.forEach(function(e){e.push(e[0])})}function es(d,h){var p=0,f=0,m=0;I(d,function(e,t,i,r,n){m<r&&(m=r,f=t,h.push([[]])),p<n&&(p=n,f=t,h[r].push([]));var a=t-f,o=d.coordinates[r][n][1+a],s=e[0],l=e[1],u=o[0],c=o[1];h[r][n].push([.75*s+.25*u,.75*l+.25*c]),h[r][n].push([.25*s+.75*u,.25*l+.75*c])},!0),h.forEach(function(e){e.forEach(function(e){e.push(e[0])})})}function ts(e,t,i){void 0===i&&(i=2);var r=Q(e),n=Q(t),a=r[0]-n[0],o=r[1]-n[1];return 1===i?Math.abs(a)+Math.abs(o):Math.pow(Math.pow(a,i)+Math.pow(o,i),1/i)}function is(e,t){var i=(t=t||{}).threshold||1e4,r=t.p||2,n=t.binary||!1,a=t.alpha||-1,o=t.standardization||!1,s=[];N(e,function(e){s.push(oi(e))});for(var l=[],u=0;u<s.length;u++)l[u]=[];for(u=0;u<s.length;u++)for(var c=u;c<s.length;c++){u===c&&(l[u][c]=0);var d=ts(s[u],s[c],r);l[u][c]=d,l[c][u]=d}for(u=0;u<s.length;u++)for(c=0;c<s.length;c++)0!==(d=l[u][c])&&(l[u][c]=n?d<=i?1:0:d<=i?Math.pow(d,a):0);if(o)for(u=0;u<s.length;u++){var h=l[u].reduce(function(e,t){return e+t},0);for(c=0;c<s.length;c++)l[u][c]=l[u][c]/h}return l}function rs(e){for(var t=0,i=0,r=e;i<r.length;i++)t+=r[i];return t/e.length}function ns(e,t){return void 0===t&&(t={}),os(e,"mercator",t)}function as(e,t){return void 0===t&&(t={}),os(e,"wgs84",t)}function os(e,i,t){void 0===t&&(t={});var r=(t=t||{}).mutate;if(!e)throw new Error("geojson is required");return Array.isArray(e)&&j(e[0])?e="mercator"===i?ss(e):ls(e):(!0!==r&&(e=Ct(e)),I(e,function(e){var t="mercator"===i?ss(e):ls(e);e[0]=t[0],e[1]=t[1]})),e}function ss(e){var t=Math.PI/180,i=20037508.342789244,r=[6378137*(Math.abs(e[0])<=180?e[0]:e[0]-360*function(e){return e<0?-1:0<e?1:0}(e[0]))*t,6378137*Math.log(Math.tan(.25*Math.PI+.5*e[1]*t))];return r[0]>i&&(r[0]=i),r[0]<-i&&(r[0]=-i),r[1]>i&&(r[1]=i),r[1]<-i&&(r[1]=-i),r}function ls(e){var t=180/Math.PI;return[e[0]*t/6378137,(.5*Math.PI-2*Math.atan(Math.exp(-e[1]/6378137)))*t]}qo.prototype={constructor:qo,polygons:function(){var i=this.edges;return this.cells.map(function(t){var e=t.halfedges.map(function(e){return Eo(t,i[e])});return e.data=t.site.data,e})},triangles:function(){var h=[],p=this.edges;return this.cells.forEach(function(e,t){if(r=(i=e.halfedges).length)for(var i,r,n,a,o,s,l=e.site,u=-1,c=p[i[r-1]],d=c.left===l?c.right:c.left;++u<r;)n=d,d=(c=p[i[u]]).left===l?c.right:c.left,n&&d&&t<n.index&&t<d.index&&(o=n,s=d,((a=l)[0]-s[0])*(o[1]-a[1])-(a[0]-o[0])*(s[1]-a[1])<0)&&h.push([l.data,n.data,d.data])}),h},links:function(){return this.edges.filter(function(e){return e.right}).map(function(e){return{source:e.left.data,target:e.right.data}})},find:function(o,s,e){for(var t,l,u=this,c=u._found||0,i=u.cells.length;!(l=u.cells[c]);)if(++c>=i)return null;for(var r=o-l.site[0],n=s-l.site[1],d=r*r+n*n;l=u.cells[t=c],c=null,l.halfedges.forEach(function(e){var t=u.edges[e],i=t.left;if(i!==l.site&&i||(i=t.right)){var r=o-i[0],n=s-i[1],a=r*r+n*n;a<d&&(d=a,c=i.index)}}),null!==c;);return u._found=t,null==e||d<=e*e?l.site:null}};var us=Object.freeze({__proto__:null,toMercator:ns,toWgs84:as});function cs(e){return Array.isArray(e)?ms(e):e&&e.bbox?ms(e.bbox):[360*fs(),180*fs()]}function ds(e,t){void 0===t&&(t={}),null==e&&(e=1);for(var i=[],r=0;r<e;r++)i.push($(cs(t.bbox)));return W(i)}function hs(e,n){void 0===n&&(n={}),null==e&&(e=1),j(n.num_vertices)&&void 0!==n.num_vertices||(n.num_vertices=10),j(n.max_radial_length)&&void 0!==n.max_radial_length||(n.max_radial_length=10);for(var a=[],t=function(e){var t,i=[],r=Array.apply(null,new Array(n.num_vertices+1)).map(Math.random);r.forEach(function(e,t,i){i[t]=0<t?e+i[t-1]:e}),r.forEach(function(e){e=2*e*Math.PI/r[r.length-1];var t=Math.random();i.push([t*(n.max_radial_length||10)*Math.sin(e),t*(n.max_radial_length||10)*Math.cos(e)])}),i[i.length-1]=i[0],i=i.map((t=cs(n.bbox),function(e){return[e[0]+t[0],e[1]+t[1]]})),a.push(V([i]))},i=0;i<e;i++)t();return W(a)}function ps(e,t){if(void 0===t&&(t={}),!q(t=t||{}))throw new Error("options is invalid");var i=t.bbox,r=t.num_vertices,n=t.max_length,a=t.max_rotation;null==e&&(e=1),(!j(r)||void 0===r||r<2)&&(r=10),j(n)&&void 0!==n||(n=1e-4),j(a)&&void 0!==a||(a=Math.PI/8);for(var o=[],s=0;s<e;s++){for(var l=[cs(i)],u=0;u<r-1;u++){var c=(0===u?2*Math.random()*Math.PI:Math.tan((l[u][1]-l[u-1][1])/(l[u][0]-l[u-1][0])))+(Math.random()-.5)*a*2,d=Math.random()*n;l.push([l[u][0]+d*Math.cos(c),l[u][1]+d*Math.sin(c)])}o.push(H(l))}return W(o)}function fs(){return Math.random()-.5}function ms(e){return[Math.random()*(e[2]-e[0])+e[0],Math.random()*(e[3]-e[1])+e[1]]}var gs=Object.freeze({__proto__:null,randomPosition:cs,randomPoint:ds,randomPolygon:hs,randomLineString:ps});function ys(e,t){if(!e)throw new Error("geojson is required");if("FeatureCollection"!==e.type)throw new Error("geojson must be a FeatureCollection");if(null==t)throw new Error("filter is required");var i=[];return N(e,function(e){xs(e.properties,t)&&i.push(e)}),W(i)}function vs(e,t,i){if(!e)throw new Error("geojson is required");if("FeatureCollection"!==e.type)throw new Error("geojson must be a FeatureCollection");if(null==t)throw new Error("property is required");for(var r=Cs(e,t),n=Object.keys(r),a=0;a<n.length;a++){for(var o=n[a],s=r[o],l=[],u=0;u<s.length;u++)l.push(e.features[s[u]]);i(W(l),o,a)}}function _s(e,t,r,n){var a=n;return vs(e,t,function(e,t,i){a=0===i&&void 0===n?e:r(a,e,t,i)}),a}function Cs(e,n){var a={};return N(e,function(e,t){var i=e.properties||{};if(i.hasOwnProperty(String(n))){var r=i[n];a.hasOwnProperty(r)?a[r].push(t):a[r]=[t]}}),a}function xs(e,t){if(void 0===e)return!1;var i=typeof t;if("number"==i||"string"==i)return e.hasOwnProperty(t);if(Array.isArray(t)){for(var r=0;r<t.length;r++)if(!xs(e,t[r]))return!1;return!0}return bs(e,t)}function bs(e,t){for(var i=Object.keys(t),r=0;r<i.length;r++){var n=i[r];if(e[n]!==t[n])return!1}return!0}function As(e,t){if(!t)return{};if(!t.length)return{};for(var i={},r=0;r<t.length;r++){var n=t[r];e.hasOwnProperty(n)&&(i[n]=e[n])}return i}var Ss=Object.freeze({__proto__:null,getCluster:ys,clusterEach:vs,clusterReduce:_s,createBins:Cs,applyFilter:xs,propertiesContainsFilter:bs,filterProperties:As}),ws=function(e,t){this.next=null,this.key=e,this.data=t,this.left=null,this.right=null};function Es(e,t){return t<e?1:e<t?-1:0}function Ts(e,t,i){for(var r=new ws(null,null),n=r,a=r;;){var o=i(e,t.key);if(o<0){if(null===t.left)break;if(i(e,t.left.key)<0){var s=t.left;if(t.left=s.right,s.right=t,null===(t=s).left)break}a.left=t,t=(a=t).left}else{if(!(0<o))break;if(null===t.right)break;if(0<i(e,t.right.key)&&(s=t.right,t.right=s.left,s.left=t,null===(t=s).right))break;n.right=t,t=(n=t).right}}return n.right=t.left,a.left=t.right,t.left=r.right,t.right=r.left,t}function Ps(e,t,i,r){var n=new ws(e,t);if(null===i)return n.left=n.right=null,n;var a=r(e,(i=Ts(e,i,r)).key);return a<0?(n.left=i.left,(n.right=i).left=null):0<=a&&(n.right=i.right,(n.left=i).right=null),n}function Ms(e,t,i){var r=null,n=null;if(t){var a=i((t=Ts(e,t,i)).key,e);0===a?(r=t.left,n=t.right):a<0?(n=t.right,t.right=null,r=t):(r=t.left,t.left=null,n=t)}return{left:r,right:n}}var Ds=function(){function e(e){void 0===e&&(e=Es),this._root=null,this._size=0,this._comparator=e}return e.prototype.insert=function(e,t){return this._size++,this._root=Ps(e,t,this._root,this._comparator)},e.prototype.add=function(e,t){var i=new ws(e,t);null===this._root&&(i.left=i.right=null,this._size++,this._root=i);var r=this._comparator,n=Ts(e,this._root,r),a=r(e,n.key);return 0===a?this._root=n:(a<0?(i.left=n.left,(i.right=n).left=null):0<a&&(i.right=n.right,(i.left=n).right=null),this._size++,this._root=i),this._root},e.prototype.remove=function(e){this._root=this._remove(e,this._root,this._comparator)},e.prototype._remove=function(e,t,i){var r;return null===t?null:0===i(e,(t=Ts(e,t,i)).key)?(null===t.left?r=t.right:(r=Ts(e,t.left,i)).right=t.right,this._size--,r):t},e.prototype.pop=function(){var e=this._root;if(e){for(;e.left;)e=e.left;return this._root=Ts(e.key,this._root,this._comparator),this._root=this._remove(e.key,this._root,this._comparator),{key:e.key,data:e.data}}return null},e.prototype.findStatic=function(e){for(var t=this._root,i=this._comparator;t;){var r=i(e,t.key);if(0===r)return t;t=r<0?t.left:t.right}return null},e.prototype.find=function(e){return this._root&&(this._root=Ts(e,this._root,this._comparator),0!==this._comparator(e,this._root.key))?null:this._root},e.prototype.contains=function(e){for(var t=this._root,i=this._comparator;t;){var r=i(e,t.key);if(0===r)return!0;t=r<0?t.left:t.right}return!1},e.prototype.forEach=function(e,t){for(var i=this._root,r=[],n=!1;!n;)null!==i?(r.push(i),i=i.left):0!==r.length?(i=r.pop(),e.call(t,i),i=i.right):n=!0;return this},e.prototype.range=function(e,t,i,r){for(var n=[],a=this._comparator,o=this._root;0!==n.length||o;)if(o)n.push(o),o=o.left;else{if(0<a((o=n.pop()).key,t))break;if(0<=a(o.key,e)&&i.call(r,o))return this;o=o.right}return this},e.prototype.keys=function(){var i=[];return this.forEach(function(e){var t=e.key;return i.push(t)}),i},e.prototype.values=function(){var i=[];return this.forEach(function(e){var t=e.data;return i.push(t)}),i},e.prototype.min=function(){return this._root?this.minNode(this._root).key:null},e.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},e.prototype.minNode=function(e){if(void 0===e&&(e=this._root),e)for(;e.left;)e=e.left;return e},e.prototype.maxNode=function(e){if(void 0===e&&(e=this._root),e)for(;e.right;)e=e.right;return e},e.prototype.at=function(e){for(var t=this._root,i=!1,r=0,n=[];!i;)if(t)n.push(t),t=t.left;else if(0<n.length){if(t=n.pop(),r===e)return t;r++,t=t.right}else i=!0;return null},e.prototype.next=function(e){var t=this._root,i=null;if(e.right){for(i=e.right;i.left;)i=i.left;return i}for(var r=this._comparator;t;){var n=r(e.key,t.key);if(0===n)break;t=n<0?(i=t).left:t.right}return i},e.prototype.prev=function(e){var t=this._root,i=null;if(null!==e.left){for(i=e.left;i.right;)i=i.right;return i}for(var r=this._comparator;t;){var n=r(e.key,t.key);if(0===n)break;t=n<0?t.left:(i=t).right}return i},e.prototype.clear=function(){return this._root=null,this._size=0,this},e.prototype.toList=function(){return function(e){for(var t=e,i=[],r=!1,n=new ws(null,null),a=n;!r;)t?(i.push(t),t=t.left):0<i.length?t=(t=a=a.next=i.pop()).right:r=!0;return a.next=null,n.next}(this._root)},e.prototype.load=function(e,t,i){void 0===t&&(t=[]),void 0===i&&(i=!1);var r=e.length,n=this._comparator;if(i&&function e(t,i,r,n,a){if(!(n<=r)){for(var o=t[r+n>>1],s=r-1,l=n+1;;){for(;a(t[++s],o)<0;);for(;0<a(t[--l],o););if(l<=s)break;var u=t[s];t[s]=t[l],t[l]=u,u=i[s],i[s]=i[l],i[l]=u}e(t,i,r,l,a),e(t,i,l+1,n,a)}}(e,t,0,r-1,n),null===this._root)this._root=function e(t,i,r,n){var a=n-r;if(0<a){var o=r+Math.floor(a/2),s=t[o],l=i[o],u=new ws(s,l);return u.left=e(t,i,r,o),u.right=e(t,i,o+1,n),u}return null}(e,t,0,r),this._size=r;else{var a=function(e,t,i){for(var r=new ws(null,null),n=r,a=e,o=t;null!==a&&null!==o;)i(a.key,o.key)<0?a=(n.next=a).next:o=(n.next=o).next,n=n.next;return null!==a?n.next=a:null!==o&&(n.next=o),r.next}(this.toList(),function(e,t){for(var i=new ws(null,null),r=i,n=0;n<e.length;n++)r=r.next=new ws(e[n],t[n]);return r.next=null,i.next}(e,t),n);r=this._size+r,this._root=function e(t,i,r){var n=r-i;if(0<n){var a=i+Math.floor(n/2),o=e(t,i,a),s=t.head;return s.left=o,t.head=t.head.next,s.right=e(t,a+1,r),s}return null}({head:a},0,r)}return this},e.prototype.isEmpty=function(){return null===this._root},Object.defineProperty(e.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),e.prototype.toString=function(e){void 0===e&&(e=function(e){return String(e.key)});var t=[];return function e(t,i,r,n,a){if(t){n(i+(r?"└── ":"├── ")+a(t)+"\n");var o=i+(r?" ":"│ ");t.left&&e(t.left,o,!1,n,a),t.right&&e(t.right,o,!0,n,a)}}(this._root,"",!0,function(e){return t.push(e)},e),t.join("")},e.prototype.update=function(e,t,i){var r=this._comparator,n=Ms(e,this._root,r),a=n.left,o=n.right;r(e,t)<0?o=Ps(t,i,o,r):a=Ps(t,i,a,r),this._root=function(e,t,i){return null===t?e:(null===e||((t=Ts(e.key,t,i)).left=e),t)}(a,o,r)},e.prototype.split=function(e){return Ms(e,this._root,this._comparator)},e}();function Is(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Os(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Rs(e,t,i){return t&&Os(e.prototype,t),i&&Os(e,i),e}var Ls=function(e,t){return e.ll.x<=t.x&&t.x<=e.ur.x&&e.ll.y<=t.y&&t.y<=e.ur.y},Ns=function(e,t){if(t.ur.x<e.ll.x||e.ur.x<t.ll.x||t.ur.y<e.ll.y||e.ur.y<t.ll.y)return null;var i=e.ll.x<t.ll.x?t.ll.x:e.ll.x,r=e.ur.x<t.ur.x?e.ur.x:t.ur.x;return{ll:{x:i,y:e.ll.y<t.ll.y?t.ll.y:e.ll.y},ur:{x:r,y:e.ur.y<t.ur.y?e.ur.y:t.ur.y}}},ks=Number.EPSILON;void 0===ks&&(ks=Math.pow(2,-52));var Bs=ks*ks,Fs=function(e,t){if(-ks<e&&e<ks&&-ks<t&&t<ks)return 0;var i=e-t;return i*i<Bs*e*t?0:e<t?-1:1},Vs=function(){function e(){Is(this,e),this.reset()}return Rs(e,[{key:"reset",value:function(){this.xRounder=new zs,this.yRounder=new zs}},{key:"round",value:function(e,t){return{x:this.xRounder.round(e),y:this.yRounder.round(t)}}}]),e}(),zs=function(){function e(){Is(this,e),this.tree=new Ds,this.round(0)}return Rs(e,[{key:"round",value:function(e){var t=this.tree.add(e),i=this.tree.prev(t);if(null!==i&&0===Fs(t.key,i.key))return this.tree.remove(e),i.key;var r=this.tree.next(t);return null!==r&&0===Fs(t.key,r.key)?(this.tree.remove(e),r.key):e}}]),e}(),Us=new Vs,Gs=function(e,t){return e.x*t.y-e.y*t.x},$s=function(e,t){return e.x*t.x+e.y*t.y},Hs=function(e,t,i){var r={x:t.x-e.x,y:t.y-e.y},n={x:i.x-e.x,y:i.y-e.y},a=Gs(r,n);return Fs(a,0)},Ws=function(e){return Math.sqrt($s(e,e))},js=function(e,t,i){return 0===t.y?null:{x:e.x+t.x/t.y*(i-e.y),y:i}},qs=function(e,t,i){return 0===t.x?null:{x:i,y:e.y+t.y/t.x*(i-e.x)}},Qs=function(){function r(e,t){Is(this,r),void 0===e.events?e.events=[this]:e.events.push(this),this.point=e,this.isLeft=t}return Rs(r,null,[{key:"compare",value:function(e,t){var i=r.comparePoints(e.point,t.point);return 0!==i?i:(e.point!==t.point&&e.link(t),e.isLeft!==t.isLeft?e.isLeft?1:-1:Xs.compare(e.segment,t.segment))}},{key:"comparePoints",value:function(e,t){return e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0}}]),Rs(r,[{key:"link",value:function(e){if(e.point===this.point)throw new Error("Tried to link already linked events");for(var t=e.point.events,i=0,r=t.length;i<r;i++){var n=t[i];this.point.events.push(n),n.point=this.point}this.checkForConsuming()}},{key:"checkForConsuming",value:function(){for(var e=this.point.events.length,t=0;t<e;t++){var i=this.point.events[t];if(void 0===i.segment.consumedBy)for(var r=t+1;r<e;r++){var n=this.point.events[r];void 0===n.consumedBy&&i.otherSE.point.events===n.otherSE.point.events&&i.segment.consume(n.segment)}}}},{key:"getAvailableLinkedEvents",value:function(){for(var e=[],t=0,i=this.point.events.length;t<i;t++){var r=this.point.events[t];r!==this&&!r.segment.ringOut&&r.segment.isInResult()&&e.push(r)}return e}},{key:"getLeftmostComparator",value:function(s){var l=this,u=new Map,c=function(e){var t,i,r,n,a,o=e.otherSE;u.set(e,{sine:(t=l.point,i=s.point,r=o.point,n={x:i.x-t.x,y:i.y-t.y},a={x:r.x-t.x,y:r.y-t.y},Gs(a,n)/Ws(a)/Ws(n)),cosine:function(e,t,i){var r={x:t.x-e.x,y:t.y-e.y},n={x:i.x-e.x,y:i.y-e.y};return $s(n,r)/Ws(n)/Ws(r)}(l.point,s.point,o.point)})};return function(e,t){u.has(e)||c(e),u.has(t)||c(t);var i=u.get(e),r=i.sine,n=i.cosine,a=u.get(t),o=a.sine,s=a.cosine;return 0<=r&&0<=o?n<s?1:s<n?-1:0:r<0&&o<0?n<s?-1:s<n?1:0:o<r?-1:r<o?1:0}}}]),r}(),Ys=0,Xs=function(){function d(e,t,i,r){Is(this,d),this.id=++Ys,(this.leftSE=e).segment=this,e.otherSE=t,(this.rightSE=t).segment=this,t.otherSE=e,this.rings=i,this.windings=r}return Rs(d,null,[{key:"compare",value:function(e,t){var i=e.leftSE.point.x,r=t.leftSE.point.x,n=e.rightSE.point.x,a=t.rightSE.point.x;if(a<i)return 1;if(n<r)return-1;var o=e.leftSE.point.y,s=t.leftSE.point.y,l=e.rightSE.point.y,u=t.rightSE.point.y;if(i<r){if(s<o&&s<l)return 1;if(o<s&&l<s)return-1;var c=e.comparePoint(t.leftSE.point);if(c<0)return 1;if(0<c)return-1;var d=t.comparePoint(e.rightSE.point);return 0!==d?d:-1}if(r<i){if(o<s&&o<u)return-1;if(s<o&&u<o)return 1;var h=t.comparePoint(e.leftSE.point);if(0!==h)return h;var p=e.comparePoint(t.rightSE.point);return p<0?1:0<p?-1:1}if(o<s)return-1;if(s<o)return 1;if(n<a){var f=t.comparePoint(e.rightSE.point);if(0!==f)return f}if(a<n){var m=e.comparePoint(t.rightSE.point);if(m<0)return 1;if(0<m)return-1}if(n!==a){var g=l-o,y=n-i,v=u-s,_=a-r;if(y<g&&v<_)return 1;if(g<y&&_<v)return-1}return a<n?1:n<a||l<u?-1:u<l?1:e.id<t.id?-1:e.id>t.id?1:0}}]),Rs(d,[{key:"replaceRightSE",value:function(e){this.rightSE=e,(this.rightSE.segment=this).rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}},{key:"bbox",value:function(){var e=this.leftSE.point.y,t=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:e<t?e:t},ur:{x:this.rightSE.point.x,y:t<e?e:t}}}},{key:"vector",value:function(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}},{key:"isAnEndpoint",value:function(e){return e.x===this.leftSE.point.x&&e.y===this.leftSE.point.y||e.x===this.rightSE.point.x&&e.y===this.rightSE.point.y}},{key:"comparePoint",value:function(e){if(this.isAnEndpoint(e))return 0;var t=this.leftSE.point,i=this.rightSE.point,r=this.vector();if(t.x===i.x)return e.x===t.x?0:e.x<t.x?1:-1;var n=(e.y-t.y)/r.y,a=t.x+n*r.x;if(e.x===a)return 0;var o=(e.x-t.x)/r.x,s=t.y+o*r.y;return e.y===s?0:e.y<s?-1:1}},{key:"getIntersection",value:function(e){var t=this.bbox(),i=e.bbox(),r=Ns(t,i);if(null===r)return null;var n=this.leftSE.point,a=this.rightSE.point,o=e.leftSE.point,s=e.rightSE.point,l=Ls(t,o)&&0===this.comparePoint(o),u=Ls(i,n)&&0===e.comparePoint(n),c=Ls(t,s)&&0===this.comparePoint(s),d=Ls(i,a)&&0===e.comparePoint(a);if(u&&l)return d&&!c?a:!d&&c?s:null;if(u)return c&&n.x===s.x&&n.y===s.y?null:n;if(l)return d&&a.x===o.x&&a.y===o.y?null:o;if(d&&c)return null;if(d)return a;if(c)return s;var h=function(e,t,i,r){if(0===t.x)return qs(i,r,e.x);if(0===r.x)return qs(e,t,i.x);if(0===t.y)return js(i,r,e.y);if(0===r.y)return js(e,t,i.y);var n=Gs(t,r);if(0==n)return null;var a={x:i.x-e.x,y:i.y-e.y},o=Gs(a,t)/n,s=Gs(a,r)/n;return{x:(e.x+s*t.x+(i.x+o*r.x))/2,y:(e.y+s*t.y+(i.y+o*r.y))/2}}(n,this.vector(),o,e.vector());return null===h?null:Ls(r,h)?Us.round(h.x,h.y):null}},{key:"split",value:function(e){var t=[],i=void 0!==e.events,r=new Qs(e,!0),n=new Qs(e,!1),a=this.rightSE;this.replaceRightSE(n),t.push(n),t.push(r);var o=new d(r,a,this.rings.slice(),this.windings.slice());return 0<Qs.comparePoints(o.leftSE.point,o.rightSE.point)&&o.swapEvents(),0<Qs.comparePoints(this.leftSE.point,this.rightSE.point)&&this.swapEvents(),i&&(r.checkForConsuming(),n.checkForConsuming()),t}},{key:"swapEvents",value:function(){var e=this.rightSE;this.rightSE=this.leftSE,this.leftSE=e,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(var t=0,i=this.windings.length;t<i;t++)this.windings[t]*=-1}},{key:"consume",value:function(e){for(var t=this,i=e;t.consumedBy;)t=t.consumedBy;for(;i.consumedBy;)i=i.consumedBy;var r=d.compare(t,i);if(0!==r){if(0<r){var n=t;t=i,i=n}if(t.prev===i){var a=t;t=i,i=a}for(var o=0,s=i.rings.length;o<s;o++){var l=i.rings[o],u=i.windings[o],c=t.rings.indexOf(l);-1===c?(t.rings.push(l),t.windings.push(u)):t.windings[c]+=u}i.rings=null,i.windings=null,i.consumedBy=t,i.leftSE.consumedBy=t.leftSE,i.rightSE.consumedBy=t.rightSE}}},{key:"prevInResult",value:function(){return void 0!==this._prevInResult||(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null),this._prevInResult}},{key:"beforeState",value:function(){if(void 0!==this._beforeState)return this._beforeState;if(this.prev){var e=this.prev.consumedBy||this.prev;this._beforeState=e.afterState()}else this._beforeState={rings:[],windings:[],multiPolys:[]};return this._beforeState}},{key:"afterState",value:function(){if(void 0!==this._afterState)return this._afterState;var e=this.beforeState();this._afterState={rings:e.rings.slice(0),windings:e.windings.slice(0),multiPolys:[]};for(var t=this._afterState.rings,i=this._afterState.windings,r=this._afterState.multiPolys,n=0,a=this.rings.length;n<a;n++){var o=this.rings[n],s=this.windings[n],l=t.indexOf(o);-1===l?(t.push(o),i.push(s)):i[l]+=s}for(var u=[],c=[],d=0,h=t.length;d<h;d++)if(0!==i[d]){var p=t[d],f=p.poly;if(-1===c.indexOf(f))if(p.isExterior)u.push(f);else{-1===c.indexOf(f)&&c.push(f);var m=u.indexOf(p.poly);-1!==m&&u.splice(m,1)}}for(var g=0,y=u.length;g<y;g++){var v=u[g].multiPoly;-1===r.indexOf(v)&&r.push(v)}return this._afterState}},{key:"isInResult",value:function(){if(this.consumedBy)return!1;if(void 0!==this._isInResult)return this._isInResult;var e=this.beforeState().multiPolys,t=this.afterState().multiPolys;switch(ol.type){case"union":var i=0===e.length,r=0===t.length;this._isInResult=i!=r;break;case"intersection":var n,a;a=e.length<t.length?(n=e.length,t.length):(n=t.length,e.length),this._isInResult=a===ol.numMultiPolys&&n<a;break;case"xor":var o=Math.abs(e.length-t.length);this._isInResult=o%2==1;break;case"difference":var s=function(e){return 1===e.length&&e[0].isSubject};this._isInResult=s(e)!==s(t);break;default:throw new Error("Unrecognized operation type found ".concat(ol.type))}return this._isInResult}}],[{key:"fromRing",value:function(e,t,i){var r,n,a,o=Qs.comparePoints(e,t);if(o<0)r=e,n=t,a=1;else{if(!(0<o))throw new Error("Tried to create degenerate segment at [".concat(e.x,", ").concat(e.y,"]"));r=t,n=e,a=-1}return new d(new Qs(r,!0),new Qs(n,!1),[i],[a])}}]),d}(),Zs=function(){function l(e,t,i){if(Is(this,l),!Array.isArray(e)||0===e.length)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=t,this.isExterior=i,this.segments=[],"number"!=typeof e[0][0]||"number"!=typeof e[0][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var r=Us.round(e[0][0],e[0][1]);this.bbox={ll:{x:r.x,y:r.y},ur:{x:r.x,y:r.y}};for(var n=r,a=1,o=e.length;a<o;a++){if("number"!=typeof e[a][0]||"number"!=typeof e[a][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var s=Us.round(e[a][0],e[a][1]);s.x===n.x&&s.y===n.y||(this.segments.push(Xs.fromRing(n,s,this)),s.x<this.bbox.ll.x&&(this.bbox.ll.x=s.x),s.y<this.bbox.ll.y&&(this.bbox.ll.y=s.y),s.x>this.bbox.ur.x&&(this.bbox.ur.x=s.x),s.y>this.bbox.ur.y&&(this.bbox.ur.y=s.y),n=s)}r.x===n.x&&r.y===n.y||this.segments.push(Xs.fromRing(n,r,this))}return Rs(l,[{key:"getSweepEvents",value:function(){for(var e=[],t=0,i=this.segments.length;t<i;t++){var r=this.segments[t];e.push(r.leftSE),e.push(r.rightSE)}return e}}]),l}(),Js=function(){function a(e,t){if(Is(this,a),!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new Zs(e[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(var i=1,r=e.length;i<r;i++){var n=new Zs(e[i],this,!1);n.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=n.bbox.ll.x),n.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=n.bbox.ll.y),n.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=n.bbox.ur.x),n.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=n.bbox.ur.y),this.interiorRings.push(n)}this.multiPoly=t}return Rs(a,[{key:"getSweepEvents",value:function(){for(var e=this.exteriorRing.getSweepEvents(),t=0,i=this.interiorRings.length;t<i;t++)for(var r=this.interiorRings[t].getSweepEvents(),n=0,a=r.length;n<a;n++)e.push(r[n]);return e}}]),a}(),Ks=function(){function a(e,t){if(Is(this,a),!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{"number"==typeof e[0][0][0]&&(e=[e])}catch(e){}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(var i=0,r=e.length;i<r;i++){var n=new Js(e[i],this);n.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=n.bbox.ll.x),n.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=n.bbox.ll.y),n.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=n.bbox.ur.x),n.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=n.bbox.ur.y),this.polys.push(n)}this.isSubject=t}return Rs(a,[{key:"getSweepEvents",value:function(){for(var e=[],t=0,i=this.polys.length;t<i;t++)for(var r=this.polys[t].getSweepEvents(),n=0,a=r.length;n<a;n++)e.push(r[n]);return e}}]),a}(),el=function(){function C(e){Is(this,C),this.events=e;for(var t=0,i=e.length;t<i;t++)e[t].segment.ringOut=this;this.poly=null}return Rs(C,null,[{key:"factory",value:function(e){for(var t=[],i=0,r=e.length;i<r;i++){var n=e[i];if(n.isInResult()&&!n.ringOut){for(var a=null,o=n.leftSE,s=n.rightSE,l=[o],u=o.point,c=[];a=o,o=s,l.push(o),o.point!==u;)for(;;){var d=o.getAvailableLinkedEvents();if(0===d.length){var h=l[0].point,p=l[l.length-1].point;throw new Error("Unable to complete output ring starting at [".concat(h.x,",")+" ".concat(h.y,"]. Last matching segment found ends at")+" [".concat(p.x,", ").concat(p.y,"]."))}if(1===d.length){s=d[0].otherSE;break}for(var f=null,m=0,g=c.length;m<g;m++)if(c[m].point===o.point){f=m;break}if(null===f){c.push({index:l.length,point:o.point});var y=o.getLeftmostComparator(a);s=d.sort(y)[0].otherSE;break}var v=c.splice(f)[0],_=l.splice(v.index);_.unshift(_[0].otherSE),t.push(new C(_.reverse()))}t.push(new C(l))}}return t}}]),Rs(C,[{key:"getGeom",value:function(){for(var e=this.events[0].point,t=[e],i=1,r=this.events.length-1;i<r;i++){var n=this.events[i].point,a=this.events[i+1].point;0!==Hs(n,e,a)&&(t.push(n),e=n)}if(1===t.length)return null;var o=t[0],s=t[1];0===Hs(o,e,s)&&t.shift(),t.push(t[0]);for(var l=this.isExteriorRing()?1:-1,u=this.isExteriorRing()?0:t.length-1,c=this.isExteriorRing()?t.length:-1,d=[],h=u;h!=c;h+=l)d.push([t[h].x,t[h].y]);return d}},{key:"isExteriorRing",value:function(){if(void 0===this._isExteriorRing){var e=this.enclosingRing();this._isExteriorRing=!e||!e.isExteriorRing()}return this._isExteriorRing}},{key:"enclosingRing",value:function(){return void 0===this._enclosingRing&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}},{key:"_calcEnclosingRing",value:function(){for(var e=this.events[0],t=1,i=this.events.length;t<i;t++){var r=this.events[t];0<Qs.compare(e,r)&&(e=r)}for(var n=e.segment.prevInResult(),a=n?n.prevInResult():null;;){if(!n)return null;if(!a)return n.ringOut;if(a.ringOut!==n.ringOut)return a.ringOut.enclosingRing()!==n.ringOut?n.ringOut:n.ringOut.enclosingRing();a=(n=a.prevInResult())?n.prevInResult():null}}}]),C}(),tl=function(){function t(e){Is(this,t),((this.exteriorRing=e).poly=this).interiorRings=[]}return Rs(t,[{key:"addInterior",value:function(e){this.interiorRings.push(e),e.poly=this}},{key:"getGeom",value:function(){var e=[this.exteriorRing.getGeom()];if(null===e[0])return null;for(var t=0,i=this.interiorRings.length;t<i;t++){var r=this.interiorRings[t].getGeom();null!==r&&e.push(r)}return e}}]),t}(),il=function(){function t(e){Is(this,t),this.rings=e,this.polys=this._composePolys(e)}return Rs(t,[{key:"getGeom",value:function(){for(var e=[],t=0,i=this.polys.length;t<i;t++){var r=this.polys[t].getGeom();null!==r&&e.push(r)}return e}},{key:"_composePolys",value:function(e){for(var t=[],i=0,r=e.length;i<r;i++){var n=e[i];if(!n.poly)if(n.isExteriorRing())t.push(new tl(n));else{var a=n.enclosingRing();a.poly||t.push(new tl(a)),a.poly.addInterior(n)}}return t}}]),t}(),rl=function(){function i(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:Xs.compare;Is(this,i),this.queue=e,this.tree=new Ds(t),this.segments=[]}return Rs(i,[{key:"process",value:function(e){var t=e.segment,i=[];if(e.consumedBy)return e.isLeft?this.queue.remove(e.otherSE):this.tree.remove(t),i;var r=e.isLeft?this.tree.insert(t):this.tree.find(t);if(!r)throw new Error("Unable to find segment #".concat(t.id," ")+"[".concat(t.leftSE.point.x,", ").concat(t.leftSE.point.y,"] -> ")+"[".concat(t.rightSE.point.x,", ").concat(t.rightSE.point.y,"] ")+"in SweepLine tree. Please submit a bug report.");for(var n=r,a=r,o=void 0,s=void 0;void 0===o;)null===(n=this.tree.prev(n))?o=null:void 0===n.key.consumedBy&&(o=n.key);for(;void 0===s;)null===(a=this.tree.next(a))?s=null:void 0===a.key.consumedBy&&(s=a.key);if(e.isLeft){var l=null;if(o){var u=o.getIntersection(t);if(null!==u&&(t.isAnEndpoint(u)||(l=u),!o.isAnEndpoint(u)))for(var c=this._splitSafely(o,u),d=0,h=c.length;d<h;d++)i.push(c[d])}var p=null;if(s){var f=s.getIntersection(t);if(null!==f&&(t.isAnEndpoint(f)||(p=f),!s.isAnEndpoint(f)))for(var m=this._splitSafely(s,f),g=0,y=m.length;g<y;g++)i.push(m[g])}if(null!==l||null!==p){var v=null;v=null===l?p:null===p?l:Qs.comparePoints(l,p)<=0?l:p,this.queue.remove(t.rightSE),i.push(t.rightSE);for(var _=t.split(v),C=0,x=_.length;C<x;C++)i.push(_[C])}0<i.length?(this.tree.remove(t),i.push(e)):(this.segments.push(t),t.prev=o)}else{if(o&&s){var b=o.getIntersection(s);if(null!==b){if(!o.isAnEndpoint(b))for(var A=this._splitSafely(o,b),S=0,w=A.length;S<w;S++)i.push(A[S]);if(!s.isAnEndpoint(b))for(var E=this._splitSafely(s,b),T=0,P=E.length;T<P;T++)i.push(E[T])}}this.tree.remove(t)}return i}},{key:"_splitSafely",value:function(e,t){this.tree.remove(e);var i=e.rightSE;this.queue.remove(i);var r=e.split(t);return r.push(i),void 0===e.consumedBy&&this.tree.insert(e),r}}]),i}(),nl="undefined"!=typeof process&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,al="undefined"!=typeof process&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6,ol=new(function(){function e(){Is(this,e)}return Rs(e,[{key:"run",value:function(e,t,i){ol.type=e,Us.reset();for(var r=[new Ks(t,!0)],n=0,a=i.length;n<a;n++)r.push(new Ks(i[n],!1));if(ol.numMultiPolys=r.length,"difference"===ol.type)for(var o=r[0],s=1;s<r.length;)null!==Ns(r[s].bbox,o.bbox)?s++:r.splice(s,1);if("intersection"===ol.type)for(var l=0,u=r.length;l<u;l++)for(var c=r[l],d=l+1,h=r.length;d<h;d++)if(null===Ns(c.bbox,r[d].bbox))return[];for(var p=new Ds(Qs.compare),f=0,m=r.length;f<m;f++)for(var g=r[f].getSweepEvents(),y=0,v=g.length;y<v;y++)if(p.insert(g[y]),p.size>nl)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big). Please file a bug report.");for(var _=new rl(p),C=p.size,x=p.pop();x;){var b=x.key;if(p.size===C){var A=b.segment;throw new Error("Unable to pop() ".concat(b.isLeft?"left":"right"," SweepEvent ")+"[".concat(b.point.x,", ").concat(b.point.y,"] from segment #").concat(A.id," ")+"[".concat(A.leftSE.point.x,", ").concat(A.leftSE.point.y,"] -> ")+"[".concat(A.rightSE.point.x,", ").concat(A.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(p.size>nl)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big). Please file a bug report.");if(_.segments.length>al)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments). Please file a bug report.");for(var S=_.process(b),w=0,E=S.length;w<E;w++){var T=S[w];void 0===T.consumedBy&&p.insert(T)}C=p.size,x=p.pop()}Us.reset();var P=el.factory(_.segments);return new il(P).getGeom()}}]),e}()),sl=function(e){for(var t=arguments.length,i=new Array(1<t?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];return ol.run("union",e,i)},ll=function(e){for(var t=arguments.length,i=new Array(1<t?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];return ol.run("intersection",e,i)};"fill"in Array.prototype||Object.defineProperty(Array.prototype,"fill",{configurable:!0,value:function(e){if(null==this)throw new TypeError(this+" is not an object");var t=Object(this),i=Math.max(Math.min(t.length,9007199254740991),0)||0,r=1 in arguments&&parseInt(Number(arguments[1]),10)||0;r=r<0?Math.max(i+r,0):Math.min(r,i);var n=2 in arguments&&void 0!==arguments[2]?parseInt(Number(arguments[2]),10)||0:i;for(n=n<0?Math.max(i+arguments[2],0):Math.min(n,i);r<n;)t[r]=e,++r;return t},writable:!0}),Number.isFinite=Number.isFinite||function(e){return"number"==typeof e&&isFinite(e)},Number.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},Number.parseFloat=Number.parseFloat||parseFloat,Number.isNaN=Number.isNaN||function(e){return e!=e},Math.trunc=Math.trunc||function(e){return e<0?Math.ceil(e):Math.floor(e)};var ul=function(){};ul.prototype.interfaces_=function(){return[]},ul.prototype.getClass=function(){return ul},ul.prototype.equalsWithTolerance=function(e,t,i){return Math.abs(e-t)<=i};var cl=function(t){function e(e){t.call(this,e),this.name="IllegalArgumentException",this.message=e,this.stack=(new t).stack}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e}(Error),dl=function(){},hl={MAX_VALUE:{configurable:!0}};dl.isNaN=function(e){return Number.isNaN(e)},dl.doubleToLongBits=function(e){return e},dl.longBitsToDouble=function(e){return e},dl.isInfinite=function(e){return!Number.isFinite(e)},hl.MAX_VALUE.get=function(){return Number.MAX_VALUE},Object.defineProperties(dl,hl);var pl=function(){},fl=function(){},ml=function(){};function gl(){}var yl=function e(){if(this.x=null,this.y=null,this.z=null,0===arguments.length)this.x=0,this.y=0,this.z=e.NULL_ORDINATE;else if(1===arguments.length){var t=arguments[0];this.x=t.x,this.y=t.y,this.z=t.z}else 2===arguments.length?(this.x=arguments[0],this.y=arguments[1],this.z=e.NULL_ORDINATE):3===arguments.length&&(this.x=arguments[0],this.y=arguments[1],this.z=arguments[2])},vl={DimensionalComparator:{configurable:!0},serialVersionUID:{configurable:!0},NULL_ORDINATE:{configurable:!0},X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0}};yl.prototype.setOrdinate=function(e,t){switch(e){case yl.X:this.x=t;break;case yl.Y:this.y=t;break;case yl.Z:this.z=t;break;default:throw new cl("Invalid ordinate index: "+e)}},yl.prototype.equals2D=function(){if(1===arguments.length){var e=arguments[0];return this.x===e.x&&this.y===e.y}if(2===arguments.length){var t=arguments[0],i=arguments[1];return!!ul.equalsWithTolerance(this.x,t.x,i)&&!!ul.equalsWithTolerance(this.y,t.y,i)}},yl.prototype.getOrdinate=function(e){switch(e){case yl.X:return this.x;case yl.Y:return this.y;case yl.Z:return this.z}throw new cl("Invalid ordinate index: "+e)},yl.prototype.equals3D=function(e){return this.x===e.x&&this.y===e.y&&(this.z===e.z||dl.isNaN(this.z))&&dl.isNaN(e.z)},yl.prototype.equals=function(e){return e instanceof yl&&this.equals2D(e)},yl.prototype.equalInZ=function(e,t){return ul.equalsWithTolerance(this.z,e.z,t)},yl.prototype.compareTo=function(e){var t=e;return this.x<t.x?-1:this.x>t.x?1:this.y<t.y?-1:this.y>t.y?1:0},yl.prototype.clone=function(){},yl.prototype.copy=function(){return new yl(this)},yl.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},yl.prototype.distance3D=function(e){var t=this.x-e.x,i=this.y-e.y,r=this.z-e.z;return Math.sqrt(t*t+i*i+r*r)},yl.prototype.distance=function(e){var t=this.x-e.x,i=this.y-e.y;return Math.sqrt(t*t+i*i)},yl.prototype.hashCode=function(){var e=17;return e=37*(e=37*e+yl.hashCode(this.x))+yl.hashCode(this.y)},yl.prototype.setCoordinate=function(e){this.x=e.x,this.y=e.y,this.z=e.z},yl.prototype.interfaces_=function(){return[pl,fl,gl]},yl.prototype.getClass=function(){return yl},yl.hashCode=function(){if(1===arguments.length){var e=arguments[0],t=dl.doubleToLongBits(e);return Math.trunc((t^t)>>>32)}},vl.DimensionalComparator.get=function(){return _l},vl.serialVersionUID.get=function(){return 0x5cbf2c235c7e5800},vl.NULL_ORDINATE.get=function(){return dl.NaN},vl.X.get=function(){return 0},vl.Y.get=function(){return 1},vl.Z.get=function(){return 2},Object.defineProperties(yl,vl);var _l=function(e){if(this._dimensionsToTest=2,0===arguments.length);else if(1===arguments.length){var t=arguments[0];if(2!==t&&3!==t)throw new cl("only 2 or 3 dimensions may be specified");this._dimensionsToTest=t}};_l.prototype.compare=function(e,t){var i=e,r=t,n=_l.compare(i.x,r.x);if(0!==n)return n;var a=_l.compare(i.y,r.y);return 0!==a?a:this._dimensionsToTest<=2?0:_l.compare(i.z,r.z)},_l.prototype.interfaces_=function(){return[ml]},_l.prototype.getClass=function(){return _l},_l.compare=function(e,t){return e<t?-1:t<e?1:dl.isNaN(e)?dl.isNaN(t)?0:-1:dl.isNaN(t)?1:0};var Cl=function(){};Cl.prototype.create=function(){},Cl.prototype.interfaces_=function(){return[]},Cl.prototype.getClass=function(){return Cl};var xl=function(){},bl={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};xl.prototype.interfaces_=function(){return[]},xl.prototype.getClass=function(){return xl},xl.toLocationSymbol=function(e){switch(e){case xl.EXTERIOR:return"e";case xl.BOUNDARY:return"b";case xl.INTERIOR:return"i";case xl.NONE:return"-"}throw new cl("Unknown location value: "+e)},bl.INTERIOR.get=function(){return 0},bl.BOUNDARY.get=function(){return 1},bl.EXTERIOR.get=function(){return 2},bl.NONE.get=function(){return-1},Object.defineProperties(xl,bl);var Al=function(e,t){return e.interfaces_&&-1<e.interfaces_().indexOf(t)},Sl=function(){},wl={LOG_10:{configurable:!0}};Sl.prototype.interfaces_=function(){return[]},Sl.prototype.getClass=function(){return Sl},Sl.log10=function(e){var t=Math.log(e);return dl.isInfinite(t)||dl.isNaN(t)?t:t/Sl.LOG_10},Sl.min=function(e,t,i,r){var n=e;return t<n&&(n=t),i<n&&(n=i),r<n&&(n=r),n},Sl.clamp=function(){if("number"==typeof arguments[2]&&"number"==typeof arguments[0]&&"number"==typeof arguments[1]){var e=arguments[0],t=arguments[1],i=arguments[2];return e<t?t:i<e?i:e}if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var r=arguments[0],n=arguments[1],a=arguments[2];return r<n?n:a<r?a:r}},Sl.wrap=function(e,t){return e<0?t- -e%t:e%t},Sl.max=function(){if(3===arguments.length){var e=arguments[0],t=arguments[1],i=arguments[2],r=e;return r<t&&(r=t),r<i&&(r=i),r}if(4===arguments.length){var n=arguments[0],a=arguments[1],o=arguments[2],s=arguments[3],l=n;return l<a&&(l=a),l<o&&(l=o),l<s&&(l=s),l}},Sl.average=function(e,t){return(e+t)/2},wl.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(Sl,wl);var El=function(e){this.str=e};El.prototype.append=function(e){this.str+=e},El.prototype.setCharAt=function(e,t){this.str=this.str.substr(0,e)+t+this.str.substr(e+1)},El.prototype.toString=function(e){return this.str};var Tl=function(e){this.value=e};Tl.prototype.intValue=function(){return this.value},Tl.prototype.compareTo=function(e){return this.value<e?-1:this.value>e?1:0},Tl.isNaN=function(e){return Number.isNaN(e)};var Pl=function(){};Pl.isWhitespace=function(e){return e<=32&&0<=e||127===e},Pl.toUpperCase=function(e){return e.toUpperCase()};var Ml=function e(){if(this._hi=0,(this._lo=0)===arguments.length)this.init(0);else if(1===arguments.length){if("number"==typeof arguments[0]){var t=arguments[0];this.init(t)}else if(arguments[0]instanceof e){var i=arguments[0];this.init(i)}else if("string"==typeof arguments[0]){var r=arguments[0];e.call(this,e.parse(r))}}else if(2===arguments.length){var n=arguments[0],a=arguments[1];this.init(n,a)}},Dl={PI:{configurable:!0},TWO_PI:{configurable:!0},PI_2:{configurable:!0},E:{configurable:!0},NaN:{configurable:!0},EPS:{configurable:!0},SPLIT:{configurable:!0},MAX_PRINT_DIGITS:{configurable:!0},TEN:{configurable:!0},ONE:{configurable:!0},SCI_NOT_EXPONENT_CHAR:{configurable:!0},SCI_NOT_ZERO:{configurable:!0}};Ml.prototype.le=function(e){return(this._hi<e._hi||this._hi===e._hi)&&this._lo<=e._lo},Ml.prototype.extractSignificantDigits=function(e,t){var i=this.abs(),r=Ml.magnitude(i._hi),n=Ml.TEN.pow(r);(i=i.divide(n)).gt(Ml.TEN)?(i=i.divide(Ml.TEN),r+=1):i.lt(Ml.ONE)&&(i=i.multiply(Ml.TEN),r-=1);for(var a=r+1,o=new El,s=Ml.MAX_PRINT_DIGITS-1,l=0;l<=s;l++){e&&l===a&&o.append(".");var u=Math.trunc(i._hi);if(u<0)break;var c=!1,d=0;d=9<u?(c=!0,"9"):"0"+u,o.append(d),i=i.subtract(Ml.valueOf(u)).multiply(Ml.TEN),c&&i.selfAdd(Ml.TEN);var h=!0,p=Ml.magnitude(i._hi);if(p<0&&Math.abs(p)>=s-l&&(h=!1),!h)break}return t[0]=r,o.toString()},Ml.prototype.sqr=function(){return this.multiply(this)},Ml.prototype.doubleValue=function(){return this._hi+this._lo},Ml.prototype.subtract=function(){if(arguments[0]instanceof Ml){var e=arguments[0];return this.add(e.negate())}if("number"==typeof arguments[0]){var t=arguments[0];return this.add(-t)}},Ml.prototype.equals=function(){if(1===arguments.length){var e=arguments[0];return this._hi===e._hi&&this._lo===e._lo}},Ml.prototype.isZero=function(){return 0===this._hi&&0===this._lo},Ml.prototype.selfSubtract=function(){if(arguments[0]instanceof Ml){var e=arguments[0];return this.isNaN()?this:this.selfAdd(-e._hi,-e._lo)}if("number"==typeof arguments[0]){var t=arguments[0];return this.isNaN()?this:this.selfAdd(-t,0)}},Ml.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},Ml.prototype.min=function(e){return this.le(e)?this:e},Ml.prototype.selfDivide=function(){if(1===arguments.length){if(arguments[0]instanceof Ml){var e=arguments[0];return this.selfDivide(e._hi,e._lo)}if("number"==typeof arguments[0]){var t=arguments[0];return this.selfDivide(t,0)}}else if(2===arguments.length){var i=arguments[0],r=arguments[1],n=null,a=null,o=null,s=null,l=null,u=null,c=null,d=null;return l=this._hi/i,d=(n=(u=Ml.SPLIT*l)-(n=u-l))*(o=(d=Ml.SPLIT*i)-(o=d-i))-(c=l*i)+n*(s=i-o)+(a=l-n)*o+a*s,d=l+(u=(this._hi-c-d+this._lo-l*r)/i),this._hi=d,this._lo=l-d+u,this}},Ml.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},Ml.prototype.divide=function(){if(arguments[0]instanceof Ml){var e=arguments[0],t=null,i=null,r=null,n=null,a=null,o=null,s=null,l=null;i=(a=this._hi/e._hi)-(t=(o=Ml.SPLIT*a)-(t=o-a)),l=t*(r=(l=Ml.SPLIT*e._hi)-(r=l-e._hi))-(s=a*e._hi)+t*(n=e._hi-r)+i*r+i*n;var u=l=a+(o=(this._hi-s-l+this._lo-a*e._lo)/e._hi),c=a-l+o;return new Ml(u,c)}if("number"==typeof arguments[0]){var d=arguments[0];return dl.isNaN(d)?Ml.createNaN():Ml.copy(this).selfDivide(d,0)}},Ml.prototype.ge=function(e){return(this._hi>e._hi||this._hi===e._hi)&&this._lo>=e._lo},Ml.prototype.pow=function(e){if(0===e)return Ml.valueOf(1);var t=new Ml(this),i=Ml.valueOf(1),r=Math.abs(e);if(1<r)for(;0<r;)r%2==1&&i.selfMultiply(t),0<(r/=2)&&(t=t.sqr());else i=t;return e<0?i.reciprocal():i},Ml.prototype.ceil=function(){if(this.isNaN())return Ml.NaN;var e=Math.ceil(this._hi),t=0;return e===this._hi&&(t=Math.ceil(this._lo)),new Ml(e,t)},Ml.prototype.compareTo=function(e){var t=e;return this._hi<t._hi?-1:this._hi>t._hi?1:this._lo<t._lo?-1:this._lo>t._lo?1:0},Ml.prototype.rint=function(){return this.isNaN()?this:this.add(.5).floor()},Ml.prototype.setValue=function(){if(arguments[0]instanceof Ml){var e=arguments[0];return this.init(e),this}if("number"==typeof arguments[0]){var t=arguments[0];return this.init(t),this}},Ml.prototype.max=function(e){return this.ge(e)?this:e},Ml.prototype.sqrt=function(){if(this.isZero())return Ml.valueOf(0);if(this.isNegative())return Ml.NaN;var e=1/Math.sqrt(this._hi),t=this._hi*e,i=Ml.valueOf(t),r=this.subtract(i.sqr())._hi*(.5*e);return i.add(r)},Ml.prototype.selfAdd=function(){if(1===arguments.length){if(arguments[0]instanceof Ml){var e=arguments[0];return this.selfAdd(e._hi,e._lo)}if("number"==typeof arguments[0]){var t=arguments[0],i=null,r=null,n=null,a=null,o=null,s=null;return a=(n=this._hi+t)-(o=n-this._hi),r=(s=(a=t-o+(this._hi-a))+this._lo)+(n-(i=n+s)),this._hi=i+r,this._lo=r+(i-this._hi),this}}else if(2===arguments.length){var l=arguments[0],u=arguments[1],c=null,d=null,h=null,p=null,f=null,m=null,g=null;p=this._hi+l,d=this._lo+u,f=p-(m=p-this._hi),h=d-(g=d-this._lo);var y=(c=p+(m=(f=l-m+(this._hi-f))+d))+(m=(h=u-g+(this._lo-h))+(m+(p-c))),v=m+(c-y);return this._hi=y,this._lo=v,this}},Ml.prototype.selfMultiply=function(){if(1===arguments.length){if(arguments[0]instanceof Ml){var e=arguments[0];return this.selfMultiply(e._hi,e._lo)}if("number"==typeof arguments[0]){var t=arguments[0];return this.selfMultiply(t,0)}}else if(2===arguments.length){var i=arguments[0],r=arguments[1],n=null,a=null,o=null,s=null,l=null,u=null;n=(l=Ml.SPLIT*this._hi)-this._hi,u=Ml.SPLIT*i,n=l-n,a=this._hi-n,o=u-i;var c=(l=this._hi*i)+(u=n*(o=u-o)-l+n*(s=i-o)+a*o+a*s+(this._hi*r+this._lo*i)),d=u+(n=l-c);return this._hi=c,this._lo=d,this}},Ml.prototype.selfSqr=function(){return this.selfMultiply(this)},Ml.prototype.floor=function(){if(this.isNaN())return Ml.NaN;var e=Math.floor(this._hi),t=0;return e===this._hi&&(t=Math.floor(this._lo)),new Ml(e,t)},Ml.prototype.negate=function(){return this.isNaN()?this:new Ml(-this._hi,-this._lo)},Ml.prototype.clone=function(){},Ml.prototype.multiply=function(){if(arguments[0]instanceof Ml){var e=arguments[0];return e.isNaN()?Ml.createNaN():Ml.copy(this).selfMultiply(e)}if("number"==typeof arguments[0]){var t=arguments[0];return dl.isNaN(t)?Ml.createNaN():Ml.copy(this).selfMultiply(t,0)}},Ml.prototype.isNaN=function(){return dl.isNaN(this._hi)},Ml.prototype.intValue=function(){return Math.trunc(this._hi)},Ml.prototype.toString=function(){var e=Ml.magnitude(this._hi);return-3<=e&&e<=20?this.toStandardNotation():this.toSciNotation()},Ml.prototype.toStandardNotation=function(){var e=this.getSpecialNumberString();if(null!==e)return e;var t=new Array(1).fill(null),i=this.extractSignificantDigits(!0,t),r=t[0]+1,n=i;if("."===i.charAt(0))n="0"+i;else if(r<0)n="0."+Ml.stringOfChar("0",-r)+i;else if(-1===i.indexOf(".")){var a=r-i.length;n=i+Ml.stringOfChar("0",a)+".0"}return this.isNegative()?"-"+n:n},Ml.prototype.reciprocal=function(){var e,t,i,r,n=null,a=null,o=null,s=null;e=(i=1/this._hi)-(n=(o=Ml.SPLIT*i)-(n=o-i)),a=(s=Ml.SPLIT*this._hi)-this._hi;var l=i+(o=(1-(r=i*this._hi)-(s=n*(a=s-a)-r+n*(t=this._hi-a)+e*a+e*t)-i*this._lo)/this._hi);return new Ml(l,i-l+o)},Ml.prototype.toSciNotation=function(){if(this.isZero())return Ml.SCI_NOT_ZERO;var e=this.getSpecialNumberString();if(null!==e)return e;var t=new Array(1).fill(null),i=this.extractSignificantDigits(!1,t),r=Ml.SCI_NOT_EXPONENT_CHAR+t[0];if("0"===i.charAt(0))throw new Error("Found leading zero: "+i);var n="";1<i.length&&(n=i.substring(1));var a=i.charAt(0)+"."+n;return this.isNegative()?"-"+a+r:a+r},Ml.prototype.abs=function(){return this.isNaN()?Ml.NaN:this.isNegative()?this.negate():new Ml(this)},Ml.prototype.isPositive=function(){return(0<this._hi||0===this._hi)&&0<this._lo},Ml.prototype.lt=function(e){return(this._hi<e._hi||this._hi===e._hi)&&this._lo<e._lo},Ml.prototype.add=function(){if(arguments[0]instanceof Ml){var e=arguments[0];return Ml.copy(this).selfAdd(e)}if("number"==typeof arguments[0]){var t=arguments[0];return Ml.copy(this).selfAdd(t)}},Ml.prototype.init=function(){if(1===arguments.length){if("number"==typeof arguments[0]){var e=arguments[0];this._hi=e,this._lo=0}else if(arguments[0]instanceof Ml){var t=arguments[0];this._hi=t._hi,this._lo=t._lo}}else if(2===arguments.length){var i=arguments[0],r=arguments[1];this._hi=i,this._lo=r}},Ml.prototype.gt=function(e){return(this._hi>e._hi||this._hi===e._hi)&&this._lo>e._lo},Ml.prototype.isNegative=function(){return(this._hi<0||0===this._hi)&&this._lo<0},Ml.prototype.trunc=function(){return this.isNaN()?Ml.NaN:this.isPositive()?this.floor():this.ceil()},Ml.prototype.signum=function(){return 0<this._hi?1:this._hi<0?-1:0<this._lo?1:this._lo<0?-1:0},Ml.prototype.interfaces_=function(){return[gl,pl,fl]},Ml.prototype.getClass=function(){return Ml},Ml.sqr=function(e){return Ml.valueOf(e).selfMultiply(e)},Ml.valueOf=function(){if("string"==typeof arguments[0]){var e=arguments[0];return Ml.parse(e)}if("number"==typeof arguments[0]){var t=arguments[0];return new Ml(t)}},Ml.sqrt=function(e){return Ml.valueOf(e).sqrt()},Ml.parse=function(e){for(var t=0,i=e.length;Pl.isWhitespace(e.charAt(t));)t++;var r=!1;if(t<i){var n=e.charAt(t);"-"!==n&&"+"!==n||(t++,"-"===n&&(r=!0))}for(var a=new Ml,o=0,s=0,l=0;!(i<=t);){var u=e.charAt(t);if(t++,Pl.isDigit(u)){var c=u-"0";a.selfMultiply(Ml.TEN),a.selfAdd(c),o++}else{if("."!==u){if("e"!==u&&"E"!==u)throw new Error("Unexpected character '"+u+"' at position "+t+" in string "+e);var d=e.substring(t);try{l=Tl.parseInt(d)}catch(t){throw t instanceof Error?new Error("Invalid exponent "+d+" in string "+e):t}break}s=o}}var h=a,p=o-s-l;if(0==p)h=a;else if(0<p){var f=Ml.TEN.pow(p);h=a.divide(f)}else if(p<0){var m=Ml.TEN.pow(-p);h=a.multiply(m)}return r?h.negate():h},Ml.createNaN=function(){return new Ml(dl.NaN,dl.NaN)},Ml.copy=function(e){return new Ml(e)},Ml.magnitude=function(e){var t=Math.abs(e),i=Math.log(t)/Math.log(10),r=Math.trunc(Math.floor(i));return 10*Math.pow(10,r)<=t&&(r+=1),r},Ml.stringOfChar=function(e,t){for(var i=new El,r=0;r<t;r++)i.append(e);return i.toString()},Dl.PI.get=function(){return new Ml(3.141592653589793,12246467991473532e-32)},Dl.TWO_PI.get=function(){return new Ml(6.283185307179586,24492935982947064e-32)},Dl.PI_2.get=function(){return new Ml(1.5707963267948966,6123233995736766e-32)},Dl.E.get=function(){return new Ml(2.718281828459045,14456468917292502e-32)},Dl.NaN.get=function(){return new Ml(dl.NaN,dl.NaN)},Dl.EPS.get=function(){return 123259516440783e-46},Dl.SPLIT.get=function(){return 134217729},Dl.MAX_PRINT_DIGITS.get=function(){return 32},Dl.TEN.get=function(){return Ml.valueOf(10)},Dl.ONE.get=function(){return Ml.valueOf(1)},Dl.SCI_NOT_EXPONENT_CHAR.get=function(){return"E"},Dl.SCI_NOT_ZERO.get=function(){return"0.0E0"},Object.defineProperties(Ml,Dl);var Il=function(){},Ol={DP_SAFE_EPSILON:{configurable:!0}};Il.prototype.interfaces_=function(){return[]},Il.prototype.getClass=function(){return Il},Il.orientationIndex=function(e,t,i){var r=Il.orientationIndexFilter(e,t,i);if(r<=1)return r;var n=Ml.valueOf(t.x).selfAdd(-e.x),a=Ml.valueOf(t.y).selfAdd(-e.y),o=Ml.valueOf(i.x).selfAdd(-t.x),s=Ml.valueOf(i.y).selfAdd(-t.y);return n.selfMultiply(s).selfSubtract(a.selfMultiply(o)).signum()},Il.signOfDet2x2=function(e,t,i,r){return e.multiply(r).selfSubtract(t.multiply(i)).signum()},Il.intersection=function(e,t,i,r){var n=Ml.valueOf(r.y).selfSubtract(i.y).selfMultiply(Ml.valueOf(t.x).selfSubtract(e.x)),a=Ml.valueOf(r.x).selfSubtract(i.x).selfMultiply(Ml.valueOf(t.y).selfSubtract(e.y)),o=n.subtract(a),s=Ml.valueOf(r.x).selfSubtract(i.x).selfMultiply(Ml.valueOf(e.y).selfSubtract(i.y)),l=Ml.valueOf(r.y).selfSubtract(i.y).selfMultiply(Ml.valueOf(e.x).selfSubtract(i.x)),u=s.subtract(l).selfDivide(o).doubleValue(),c=Ml.valueOf(e.x).selfAdd(Ml.valueOf(t.x).selfSubtract(e.x).selfMultiply(u)).doubleValue(),d=Ml.valueOf(t.x).selfSubtract(e.x).selfMultiply(Ml.valueOf(e.y).selfSubtract(i.y)),h=Ml.valueOf(t.y).selfSubtract(e.y).selfMultiply(Ml.valueOf(e.x).selfSubtract(i.x)),p=d.subtract(h).selfDivide(o).doubleValue(),f=Ml.valueOf(i.y).selfAdd(Ml.valueOf(r.y).selfSubtract(i.y).selfMultiply(p)).doubleValue();return new yl(c,f)},Il.orientationIndexFilter=function(e,t,i){var r=null,n=(e.x-i.x)*(t.y-i.y),a=(e.y-i.y)*(t.x-i.x),o=n-a;if(0<n){if(a<=0)return Il.signum(o);r=n+a}else{if(!(n<0))return Il.signum(o);if(0<=a)return Il.signum(o);r=-n-a}var s=Il.DP_SAFE_EPSILON*r;return s<=o||s<=-o?Il.signum(o):2},Il.signum=function(e){return 0<e?1:e<0?-1:0},Ol.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(Il,Ol);var Rl=function(){},Ll={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};Ll.X.get=function(){return 0},Ll.Y.get=function(){return 1},Ll.Z.get=function(){return 2},Ll.M.get=function(){return 3},Rl.prototype.setOrdinate=function(e,t,i){},Rl.prototype.size=function(){},Rl.prototype.getOrdinate=function(e,t){},Rl.prototype.getCoordinate=function(){},Rl.prototype.getCoordinateCopy=function(e){},Rl.prototype.getDimension=function(){},Rl.prototype.getX=function(e){},Rl.prototype.clone=function(){},Rl.prototype.expandEnvelope=function(e){},Rl.prototype.copy=function(){},Rl.prototype.getY=function(e){},Rl.prototype.toCoordinateArray=function(){},Rl.prototype.interfaces_=function(){return[fl]},Rl.prototype.getClass=function(){return Rl},Object.defineProperties(Rl,Ll);var Nl=function(){},kl=function(e){function t(){e.call(this,"Projective point not representable on the Cartesian plane.")}return e&&(t.__proto__=e),((t.prototype=Object.create(e&&e.prototype)).constructor=t).prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Nl),Bl=function(){};Bl.arraycopy=function(e,t,i,r,n){for(var a=0,o=t;o<t+n;o++)i[r+a]=e[o],a++},Bl.getProperty=function(e){return{"line.separator":"\n"}[e]};var Fl=function e(){if(this.x=null,this.y=null,this.w=null,0===arguments.length)this.x=0,this.y=0,this.w=1;else if(1===arguments.length){var t=arguments[0];this.x=t.x,this.y=t.y,this.w=1}else if(2===arguments.length){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var i=arguments[0],r=arguments[1];this.x=i,this.y=r,this.w=1}else if(arguments[0]instanceof e&&arguments[1]instanceof e){var n=arguments[0],a=arguments[1];this.x=n.y*a.w-a.y*n.w,this.y=a.x*n.w-n.x*a.w,this.w=n.x*a.y-a.x*n.y}else if(arguments[0]instanceof yl&&arguments[1]instanceof yl){var o=arguments[0],s=arguments[1];this.x=o.y-s.y,this.y=s.x-o.x,this.w=o.x*s.y-s.x*o.y}}else if(3===arguments.length){var l=arguments[0],u=arguments[1],c=arguments[2];this.x=l,this.y=u,this.w=c}else if(4===arguments.length){var d=arguments[0],h=arguments[1],p=arguments[2],f=arguments[3],m=d.y-h.y,g=h.x-d.x,y=d.x*h.y-h.x*d.y,v=p.y-f.y,_=f.x-p.x,C=p.x*f.y-f.x*p.y;this.x=g*C-_*y,this.y=v*y-m*C,this.w=m*_-v*g}};Fl.prototype.getY=function(){var e=this.y/this.w;if(dl.isNaN(e)||dl.isInfinite(e))throw new kl;return e},Fl.prototype.getX=function(){var e=this.x/this.w;if(dl.isNaN(e)||dl.isInfinite(e))throw new kl;return e},Fl.prototype.getCoordinate=function(){var e=new yl;return e.x=this.getX(),e.y=this.getY(),e},Fl.prototype.interfaces_=function(){return[]},Fl.prototype.getClass=function(){return Fl},Fl.intersection=function(e,t,i,r){var n=e.y-t.y,a=t.x-e.x,o=e.x*t.y-t.x*e.y,s=i.y-r.y,l=r.x-i.x,u=i.x*r.y-r.x*i.y,c=n*l-s*a,d=(a*u-l*o)/c,h=(s*o-n*u)/c;if(dl.isNaN(d)||dl.isInfinite(d)||dl.isNaN(h)||dl.isInfinite(h))throw new kl;return new yl(d,h)};var Vl=function e(){if(this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,0===arguments.length)this.init();else if(1===arguments.length){if(arguments[0]instanceof yl){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof e){var i=arguments[0];this.init(i)}}else if(2===arguments.length){var r=arguments[0],n=arguments[1];this.init(r.x,n.x,r.y,n.y)}else if(4===arguments.length){var a=arguments[0],o=arguments[1],s=arguments[2],l=arguments[3];this.init(a,o,s,l)}},zl={serialVersionUID:{configurable:!0}};Vl.prototype.getArea=function(){return this.getWidth()*this.getHeight()},Vl.prototype.equals=function(e){if(!(e instanceof Vl))return!1;var t=e;return this.isNull()?t.isNull():this._maxx===t.getMaxX()&&this._maxy===t.getMaxY()&&this._minx===t.getMinX()&&this._miny===t.getMinY()},Vl.prototype.intersection=function(e){if(this.isNull()||e.isNull()||!this.intersects(e))return new Vl;var t=this._minx>e._minx?this._minx:e._minx,i=this._miny>e._miny?this._miny:e._miny,r=this._maxx<e._maxx?this._maxx:e._maxx,n=this._maxy<e._maxy?this._maxy:e._maxy;return new Vl(t,r,i,n)},Vl.prototype.isNull=function(){return this._maxx<this._minx},Vl.prototype.getMaxX=function(){return this._maxx},Vl.prototype.covers=function(){if(1===arguments.length){if(arguments[0]instanceof yl){var e=arguments[0];return this.covers(e.x,e.y)}if(arguments[0]instanceof Vl){var t=arguments[0];return!this.isNull()&&!t.isNull()&&t.getMinX()>=this._minx&&t.getMaxX()<=this._maxx&&t.getMinY()>=this._miny&&t.getMaxY()<=this._maxy}}else if(2===arguments.length){var i=arguments[0],r=arguments[1];return!this.isNull()&&i>=this._minx&&i<=this._maxx&&r>=this._miny&&r<=this._maxy}},Vl.prototype.intersects=function(){if(1===arguments.length){if(arguments[0]instanceof Vl){var e=arguments[0];return!this.isNull()&&!e.isNull()&&!(e._minx>this._maxx||e._maxx<this._minx||e._miny>this._maxy||e._maxy<this._miny)}if(arguments[0]instanceof yl){var t=arguments[0];return this.intersects(t.x,t.y)}}else if(2===arguments.length){var i=arguments[0],r=arguments[1];return!this.isNull()&&!(i>this._maxx||i<this._minx||r>this._maxy||r<this._miny)}},Vl.prototype.getMinY=function(){return this._miny},Vl.prototype.getMinX=function(){return this._minx},Vl.prototype.expandToInclude=function(){if(1===arguments.length){if(arguments[0]instanceof yl){var e=arguments[0];this.expandToInclude(e.x,e.y)}else if(arguments[0]instanceof Vl){var t=arguments[0];if(t.isNull())return null;this.isNull()?(this._minx=t.getMinX(),this._maxx=t.getMaxX(),this._miny=t.getMinY(),this._maxy=t.getMaxY()):(t._minx<this._minx&&(this._minx=t._minx),t._maxx>this._maxx&&(this._maxx=t._maxx),t._miny<this._miny&&(this._miny=t._miny),t._maxy>this._maxy&&(this._maxy=t._maxy))}}else if(2===arguments.length){var i=arguments[0],r=arguments[1];this.isNull()?(this._minx=i,this._maxx=i,this._miny=r,this._maxy=r):(i<this._minx&&(this._minx=i),i>this._maxx&&(this._maxx=i),r<this._miny&&(this._miny=r),r>this._maxy&&(this._maxy=r))}},Vl.prototype.minExtent=function(){if(this.isNull())return 0;var e=this.getWidth(),t=this.getHeight();return e<t?e:t},Vl.prototype.getWidth=function(){return this.isNull()?0:this._maxx-this._minx},Vl.prototype.compareTo=function(e){var t=e;return this.isNull()?t.isNull()?0:-1:t.isNull()?1:this._minx<t._minx?-1:this._minx>t._minx?1:this._miny<t._miny?-1:this._miny>t._miny?1:this._maxx<t._maxx?-1:this._maxx>t._maxx?1:this._maxy<t._maxy?-1:this._maxy>t._maxy?1:0},Vl.prototype.translate=function(e,t){if(this.isNull())return null;this.init(this.getMinX()+e,this.getMaxX()+e,this.getMinY()+t,this.getMaxY()+t)},Vl.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"},Vl.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},Vl.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},Vl.prototype.maxExtent=function(){if(this.isNull())return 0;var e=this.getWidth(),t=this.getHeight();return t<e?e:t},Vl.prototype.expandBy=function(){if(1===arguments.length){var e=arguments[0];this.expandBy(e,e)}else if(2===arguments.length){var t=arguments[0],i=arguments[1];if(this.isNull())return null;this._minx-=t,this._maxx+=t,this._miny-=i,this._maxy+=i,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}},Vl.prototype.contains=function(){if(1===arguments.length){if(arguments[0]instanceof Vl){var e=arguments[0];return this.covers(e)}if(arguments[0]instanceof yl){var t=arguments[0];return this.covers(t)}}else if(2===arguments.length){var i=arguments[0],r=arguments[1];return this.covers(i,r)}},Vl.prototype.centre=function(){return this.isNull()?null:new yl((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},Vl.prototype.init=function(){if(0===arguments.length)this.setToNull();else if(1===arguments.length){if(arguments[0]instanceof yl){var e=arguments[0];this.init(e.x,e.x,e.y,e.y)}else if(arguments[0]instanceof Vl){var t=arguments[0];this._minx=t._minx,this._maxx=t._maxx,this._miny=t._miny,this._maxy=t._maxy}}else if(2===arguments.length){var i=arguments[0],r=arguments[1];this.init(i.x,r.x,i.y,r.y)}else if(4===arguments.length){var n=arguments[0],a=arguments[1],o=arguments[2],s=arguments[3];n<a?(this._minx=n,this._maxx=a):(this._minx=a,this._maxx=n),o<s?(this._miny=o,this._maxy=s):(this._miny=s,this._maxy=o)}},Vl.prototype.getMaxY=function(){return this._maxy},Vl.prototype.distance=function(e){if(this.intersects(e))return 0;var t=0;this._maxx<e._minx?t=e._minx-this._maxx:this._minx>e._maxx&&(t=this._minx-e._maxx);var i=0;return this._maxy<e._miny?i=e._miny-this._maxy:this._miny>e._maxy&&(i=this._miny-e._maxy),0===t?i:0===i?t:Math.sqrt(t*t+i*i)},Vl.prototype.hashCode=function(){var e=17;return e=37*(e=37*(e=37*(e=37*e+yl.hashCode(this._minx))+yl.hashCode(this._maxx))+yl.hashCode(this._miny))+yl.hashCode(this._maxy)},Vl.prototype.interfaces_=function(){return[pl,gl]},Vl.prototype.getClass=function(){return Vl},Vl.intersects=function(){if(3===arguments.length){var e=arguments[0],t=arguments[1],i=arguments[2];return i.x>=(e.x<t.x?e.x:t.x)&&i.x<=(e.x>t.x?e.x:t.x)&&i.y>=(e.y<t.y?e.y:t.y)&&i.y<=(e.y>t.y?e.y:t.y)}if(4===arguments.length){var r=arguments[0],n=arguments[1],a=arguments[2],o=arguments[3],s=Math.min(a.x,o.x),l=Math.max(a.x,o.x),u=Math.min(r.x,n.x),c=Math.max(r.x,n.x);return!(l<u||c<s||(s=Math.min(a.y,o.y),l=Math.max(a.y,o.y),u=Math.min(r.y,n.y),c=Math.max(r.y,n.y),l<u||c<s))}},zl.serialVersionUID.get=function(){return 0x51845cd552189800},Object.defineProperties(Vl,zl);var Ul={typeStr:/^\s*(\w+)\s*\(\s*(.*)\s*\)\s*$/,emptyTypeStr:/^\s*(\w+)\s*EMPTY\s*$/,spaces:/\s+/,parenComma:/\)\s*,\s*\(/,doubleParenComma:/\)\s*\)\s*,\s*\(\s*\(/,trimParens:/^\s*\(?(.*?)\)?\s*$/},Gl=function(e){this.geometryFactory=e||new Tc};Gl.prototype.read=function(e){var t,i,r;e=e.replace(/[\n\r]/g," ");var n=Ul.typeStr.exec(e);if(-1!==e.search("EMPTY")&&((n=Ul.emptyTypeStr.exec(e))[2]=void 0),n&&(i=n[1].toLowerCase(),r=n[2],Hl[i]&&(t=Hl[i].apply(this,[r]))),void 0===t)throw new Error("Could not parse WKT "+e);return t},Gl.prototype.write=function(e){return this.extractGeometry(e)},Gl.prototype.extractGeometry=function(e){var t=e.getGeometryType().toLowerCase();if(!$l[t])return null;var i=t.toUpperCase();return e.isEmpty()?i+" EMPTY":i+"("+$l[t].apply(this,[e])+")"};var $l={coordinate:function(e){return e.x+" "+e.y},point:function(e){return $l.coordinate.call(this,e._coordinates._coordinates[0])},multipoint:function(e){for(var t=[],i=0,r=e._geometries.length;i<r;++i)t.push("("+$l.point.apply(this,[e._geometries[i]])+")");return t.join(",")},linestring:function(e){for(var t=[],i=0,r=e._points._coordinates.length;i<r;++i)t.push($l.coordinate.apply(this,[e._points._coordinates[i]]));return t.join(",")},linearring:function(e){for(var t=[],i=0,r=e._points._coordinates.length;i<r;++i)t.push($l.coordinate.apply(this,[e._points._coordinates[i]]));return t.join(",")},multilinestring:function(e){for(var t=[],i=0,r=e._geometries.length;i<r;++i)t.push("("+$l.linestring.apply(this,[e._geometries[i]])+")");return t.join(",")},polygon:function(e){var t=[];t.push("("+$l.linestring.apply(this,[e._shell])+")");for(var i=0,r=e._holes.length;i<r;++i)t.push("("+$l.linestring.apply(this,[e._holes[i]])+")");return t.join(",")},multipolygon:function(e){for(var t=[],i=0,r=e._geometries.length;i<r;++i)t.push("("+$l.polygon.apply(this,[e._geometries[i]])+")");return t.join(",")},geometrycollection:function(e){for(var t=[],i=0,r=e._geometries.length;i<r;++i)t.push(this.extractGeometry(e._geometries[i]));return t.join(",")}},Hl={point:function(e){if(void 0===e)return this.geometryFactory.createPoint();var t=e.trim().split(Ul.spaces);return this.geometryFactory.createPoint(new yl(Number.parseFloat(t[0]),Number.parseFloat(t[1])))},multipoint:function(e){var t;if(void 0===e)return this.geometryFactory.createMultiPoint();for(var i=e.trim().split(","),r=[],n=0,a=i.length;n<a;++n)t=i[n].replace(Ul.trimParens,"$1"),r.push(Hl.point.apply(this,[t]));return this.geometryFactory.createMultiPoint(r)},linestring:function(e){if(void 0===e)return this.geometryFactory.createLineString();for(var t,i=e.trim().split(","),r=[],n=0,a=i.length;n<a;++n)t=i[n].trim().split(Ul.spaces),r.push(new yl(Number.parseFloat(t[0]),Number.parseFloat(t[1])));return this.geometryFactory.createLineString(r)},linearring:function(e){if(void 0===e)return this.geometryFactory.createLinearRing();for(var t,i=e.trim().split(","),r=[],n=0,a=i.length;n<a;++n)t=i[n].trim().split(Ul.spaces),r.push(new yl(Number.parseFloat(t[0]),Number.parseFloat(t[1])));return this.geometryFactory.createLinearRing(r)},multilinestring:function(e){var t;if(void 0===e)return this.geometryFactory.createMultiLineString();for(var i=e.trim().split(Ul.parenComma),r=[],n=0,a=i.length;n<a;++n)t=i[n].replace(Ul.trimParens,"$1"),r.push(Hl.linestring.apply(this,[t]));return this.geometryFactory.createMultiLineString(r)},polygon:function(e){var t,i,r;if(void 0===e)return this.geometryFactory.createPolygon();for(var n,a=e.trim().split(Ul.parenComma),o=[],s=0,l=a.length;s<l;++s)t=a[s].replace(Ul.trimParens,"$1"),i=Hl.linestring.apply(this,[t]),r=this.geometryFactory.createLinearRing(i._points),0===s?n=r:o.push(r);return this.geometryFactory.createPolygon(n,o)},multipolygon:function(e){var t;if(void 0===e)return this.geometryFactory.createMultiPolygon();for(var i=e.trim().split(Ul.doubleParenComma),r=[],n=0,a=i.length;n<a;++n)t=i[n].replace(Ul.trimParens,"$1"),r.push(Hl.polygon.apply(this,[t]));return this.geometryFactory.createMultiPolygon(r)},geometrycollection:function(e){if(void 0===e)return this.geometryFactory.createGeometryCollection();for(var t=(e=e.replace(/,\s*([A-Za-z])/g,"|$1")).trim().split("|"),i=[],r=0,n=t.length;r<n;++r)i.push(this.read(t[r]));return this.geometryFactory.createGeometryCollection(i)}},Wl=function(e){this.parser=new Gl(e)};Wl.prototype.write=function(e){return this.parser.write(e)},Wl.toLineString=function(e,t){if(2!==arguments.length)throw new Error("Not implemented");return"LINESTRING ( "+e.x+" "+e.y+", "+t.x+" "+t.y+" )"};var jl=function(t){function e(e){t.call(this,e),this.name="RuntimeException",this.message=e,this.stack=(new t).stack}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e}(Error),ql=function(t){function e(){if(t.call(this),0===arguments.length)t.call(this);else if(1===arguments.length){var e=arguments[0];t.call(this,e)}}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(jl),Ql=function(){};Ql.prototype.interfaces_=function(){return[]},Ql.prototype.getClass=function(){return Ql},Ql.shouldNeverReachHere=function(){if(0===arguments.length)Ql.shouldNeverReachHere(null);else if(1===arguments.length){var e=arguments[0];throw new ql("Should never reach here"+(null!==e?": "+e:""))}},Ql.isTrue=function(){var e;if(1===arguments.length)Ql.isTrue(arguments[0],null);else if(2===arguments.length&&(e=arguments[1],!arguments[0]))throw null===e?new ql:new ql(e)},Ql.equals=function(){var e,t,i;if(2===arguments.length)Ql.equals(e=arguments[0],t=arguments[1],null);else if(3===arguments.length&&(e=arguments[0],i=arguments[2],!(t=arguments[1]).equals(e)))throw new ql("Expected "+e+" but encountered "+t+(null!==i?": "+i:""))};var Yl=function(){this._result=null,this._inputLines=Array(2).fill().map(function(){return Array(2)}),this._intPt=new Array(2).fill(null),this._intLineIndex=null,this._isProper=null,this._pa=null,this._pb=null,this._precisionModel=null,this._intPt[0]=new yl,this._intPt[1]=new yl,this._pa=this._intPt[0],this._pb=this._intPt[1],this._result=0},Xl={DONT_INTERSECT:{configurable:!0},DO_INTERSECT:{configurable:!0},COLLINEAR:{configurable:!0},NO_INTERSECTION:{configurable:!0},POINT_INTERSECTION:{configurable:!0},COLLINEAR_INTERSECTION:{configurable:!0}};Yl.prototype.getIndexAlongSegment=function(e,t){return this.computeIntLineIndex(),this._intLineIndex[e][t]},Yl.prototype.getTopologySummary=function(){var e=new El;return this.isEndPoint()&&e.append(" endpoint"),this._isProper&&e.append(" proper"),this.isCollinear()&&e.append(" collinear"),e.toString()},Yl.prototype.computeIntersection=function(e,t,i,r){this._inputLines[0][0]=e,this._inputLines[0][1]=t,this._inputLines[1][0]=i,this._inputLines[1][1]=r,this._result=this.computeIntersect(e,t,i,r)},Yl.prototype.getIntersectionNum=function(){return this._result},Yl.prototype.computeIntLineIndex=function(){if(0===arguments.length)null===this._intLineIndex&&(this._intLineIndex=Array(2).fill().map(function(){return Array(2)}),this.computeIntLineIndex(0),this.computeIntLineIndex(1));else if(1===arguments.length){var e=arguments[0],t=this.getEdgeDistance(e,0),i=this.getEdgeDistance(e,1);i<t?(this._intLineIndex[e][0]=0,this._intLineIndex[e][1]=1):(this._intLineIndex[e][0]=1,this._intLineIndex[e][1]=0)}},Yl.prototype.isProper=function(){return this.hasIntersection()&&this._isProper},Yl.prototype.setPrecisionModel=function(e){this._precisionModel=e},Yl.prototype.isInteriorIntersection=function(){if(0===arguments.length)return!!this.isInteriorIntersection(0)||!!this.isInteriorIntersection(1);if(1===arguments.length){for(var e=arguments[0],t=0;t<this._result;t++)if(!this._intPt[t].equals2D(this._inputLines[e][0])&&!this._intPt[t].equals2D(this._inputLines[e][1]))return!0;return!1}},Yl.prototype.getIntersection=function(e){return this._intPt[e]},Yl.prototype.isEndPoint=function(){return this.hasIntersection()&&!this._isProper},Yl.prototype.hasIntersection=function(){return this._result!==Yl.NO_INTERSECTION},Yl.prototype.getEdgeDistance=function(e,t){return Yl.computeEdgeDistance(this._intPt[t],this._inputLines[e][0],this._inputLines[e][1])},Yl.prototype.isCollinear=function(){return this._result===Yl.COLLINEAR_INTERSECTION},Yl.prototype.toString=function(){return Wl.toLineString(this._inputLines[0][0],this._inputLines[0][1])+" - "+Wl.toLineString(this._inputLines[1][0],this._inputLines[1][1])+this.getTopologySummary()},Yl.prototype.getEndpoint=function(e,t){return this._inputLines[e][t]},Yl.prototype.isIntersection=function(e){for(var t=0;t<this._result;t++)if(this._intPt[t].equals2D(e))return!0;return!1},Yl.prototype.getIntersectionAlongSegment=function(e,t){return this.computeIntLineIndex(),this._intPt[this._intLineIndex[e][t]]},Yl.prototype.interfaces_=function(){return[]},Yl.prototype.getClass=function(){return Yl},Yl.computeEdgeDistance=function(e,t,i){var r=Math.abs(i.x-t.x),n=Math.abs(i.y-t.y),a=-1;if(e.equals(t))a=0;else if(e.equals(i))a=n<r?r:n;else{var o=Math.abs(e.x-t.x),s=Math.abs(e.y-t.y);0!==(a=n<r?o:s)||e.equals(t)||(a=Math.max(o,s))}return Ql.isTrue(!(0===a&&!e.equals(t)),"Bad distance calculation"),a},Yl.nonRobustComputeEdgeDistance=function(e,t,i){var r=e.x-t.x,n=e.y-t.y,a=Math.sqrt(r*r+n*n);return Ql.isTrue(!(0===a&&!e.equals(t)),"Invalid distance calculation"),a},Xl.DONT_INTERSECT.get=function(){return 0},Xl.DO_INTERSECT.get=function(){return 1},Xl.COLLINEAR.get=function(){return 2},Xl.NO_INTERSECTION.get=function(){return 0},Xl.POINT_INTERSECTION.get=function(){return 1},Xl.COLLINEAR_INTERSECTION.get=function(){return 2},Object.defineProperties(Yl,Xl);var Zl=function(l){function o(){l.apply(this,arguments)}return l&&(o.__proto__=l),((o.prototype=Object.create(l&&l.prototype)).constructor=o).prototype.isInSegmentEnvelopes=function(e){var t=new Vl(this._inputLines[0][0],this._inputLines[0][1]),i=new Vl(this._inputLines[1][0],this._inputLines[1][1]);return t.contains(e)&&i.contains(e)},o.prototype.computeIntersection=function(){if(3!==arguments.length)return l.prototype.computeIntersection.apply(this,arguments);var e=arguments[0],t=arguments[1],i=arguments[2];if(this._isProper=!1,Vl.intersects(t,i,e)&&0===eu.orientationIndex(t,i,e)&&0===eu.orientationIndex(i,t,e))return this._isProper=!0,(e.equals(t)||e.equals(i))&&(this._isProper=!1),this._result=l.POINT_INTERSECTION,null;this._result=l.NO_INTERSECTION},o.prototype.normalizeToMinimum=function(e,t,i,r,n){n.x=this.smallestInAbsValue(e.x,t.x,i.x,r.x),n.y=this.smallestInAbsValue(e.y,t.y,i.y,r.y),e.x-=n.x,e.y-=n.y,t.x-=n.x,t.y-=n.y,i.x-=n.x,i.y-=n.y,r.x-=n.x,r.y-=n.y},o.prototype.safeHCoordinateIntersection=function(t,i,r,n){var a=null;try{a=Fl.intersection(t,i,r,n)}catch(e){if(!(e instanceof kl))throw e;a=o.nearestEndpoint(t,i,r,n)}return a},o.prototype.intersection=function(e,t,i,r){var n=this.intersectionWithNormalization(e,t,i,r);return this.isInSegmentEnvelopes(n)||(n=new yl(o.nearestEndpoint(e,t,i,r))),null!==this._precisionModel&&this._precisionModel.makePrecise(n),n},o.prototype.smallestInAbsValue=function(e,t,i,r){var n=e,a=Math.abs(n);return Math.abs(t)<a&&(n=t,a=Math.abs(t)),Math.abs(i)<a&&(n=i,a=Math.abs(i)),Math.abs(r)<a&&(n=r),n},o.prototype.checkDD=function(e,t,i,r,n){var a=Il.intersection(e,t,i,r),o=this.isInSegmentEnvelopes(a);Bl.out.println("DD in env = "+o+" --------------------- "+a),1e-4<n.distance(a)&&Bl.out.println("Distance = "+n.distance(a))},o.prototype.intersectionWithNormalization=function(e,t,i,r){var n=new yl(e),a=new yl(t),o=new yl(i),s=new yl(r),l=new yl;this.normalizeToEnvCentre(n,a,o,s,l);var u=this.safeHCoordinateIntersection(n,a,o,s);return u.x+=l.x,u.y+=l.y,u},o.prototype.computeCollinearIntersection=function(e,t,i,r){var n=Vl.intersects(e,t,i),a=Vl.intersects(e,t,r),o=Vl.intersects(i,r,e),s=Vl.intersects(i,r,t);return n&&a?(this._intPt[0]=i,this._intPt[1]=r,l.COLLINEAR_INTERSECTION):o&&s?(this._intPt[0]=e,this._intPt[1]=t,l.COLLINEAR_INTERSECTION):n&&o?(this._intPt[0]=i,this._intPt[1]=e,!i.equals(e)||a||s?l.COLLINEAR_INTERSECTION:l.POINT_INTERSECTION):n&&s?(this._intPt[0]=i,this._intPt[1]=t,!i.equals(t)||a||o?l.COLLINEAR_INTERSECTION:l.POINT_INTERSECTION):a&&o?(this._intPt[0]=r,this._intPt[1]=e,!r.equals(e)||n||s?l.COLLINEAR_INTERSECTION:l.POINT_INTERSECTION):a&&s?(this._intPt[0]=r,this._intPt[1]=t,!r.equals(t)||n||o?l.COLLINEAR_INTERSECTION:l.POINT_INTERSECTION):l.NO_INTERSECTION},o.prototype.normalizeToEnvCentre=function(e,t,i,r,n){var a=e.x<t.x?e.x:t.x,o=e.y<t.y?e.y:t.y,s=e.x>t.x?e.x:t.x,l=e.y>t.y?e.y:t.y,u=i.x<r.x?i.x:r.x,c=i.y<r.y?i.y:r.y,d=i.x>r.x?i.x:r.x,h=i.y>r.y?i.y:r.y,p=((u<a?a:u)+(s<d?s:d))/2,f=((c<o?o:c)+(l<h?l:h))/2;n.x=p,n.y=f,e.x-=n.x,e.y-=n.y,t.x-=n.x,t.y-=n.y,i.x-=n.x,i.y-=n.y,r.x-=n.x,r.y-=n.y},o.prototype.computeIntersect=function(e,t,i,r){if(this._isProper=!1,!Vl.intersects(e,t,i,r))return l.NO_INTERSECTION;var n=eu.orientationIndex(e,t,i),a=eu.orientationIndex(e,t,r);if(0<n&&0<a||n<0&&a<0)return l.NO_INTERSECTION;var o=eu.orientationIndex(i,r,e),s=eu.orientationIndex(i,r,t);return 0<o&&0<s||o<0&&s<0?l.NO_INTERSECTION:0===n&&0===a&&0===o&&0===s?this.computeCollinearIntersection(e,t,i,r):(0===n||0===a||0===o||0===s?(this._isProper=!1,e.equals2D(i)||e.equals2D(r)?this._intPt[0]=e:t.equals2D(i)||t.equals2D(r)?this._intPt[0]=t:0===n?this._intPt[0]=new yl(i):0===a?this._intPt[0]=new yl(r):0===o?this._intPt[0]=new yl(e):0===s&&(this._intPt[0]=new yl(t))):(this._isProper=!0,this._intPt[0]=this.intersection(e,t,i,r)),l.POINT_INTERSECTION)},o.prototype.interfaces_=function(){return[]},o.prototype.getClass=function(){return o},o.nearestEndpoint=function(e,t,i,r){var n=e,a=eu.distancePointLine(e,i,r),o=eu.distancePointLine(t,i,r);return o<a&&(a=o,n=t),(o=eu.distancePointLine(i,e,t))<a&&(a=o,n=i),(o=eu.distancePointLine(r,e,t))<a&&(a=o,n=r),n},o}(Yl),Jl=function(){};Jl.prototype.interfaces_=function(){return[]},Jl.prototype.getClass=function(){return Jl},Jl.orientationIndex=function(e,t,i){var r=t.x-e.x,n=t.y-e.y,a=i.x-t.x,o=i.y-t.y;return Jl.signOfDet2x2(r,n,a,o)},Jl.signOfDet2x2=function(e,t,i,r){var n=null,a=null,o=null;if(n=1,0===e||0===r)return 0===t||0===i?0:0<t?0<i?-n:n:0<i?n:-n;if(0===t||0===i)return 0<r?0<e?n:-n:0<e?-n:n;if(0<t?0<r?t<=r||(n=-n,a=e,e=i,i=a,a=t,t=r,r=a):r=t<=-r?(n=-n,i=-i,-r):(a=e,e=-i,i=a,a=t,t=-r,a):0<r?-t<=r?(n=-n,e=-e,t=-t):(a=-e,e=i,i=a,a=-t,t=r,r=a):r=r<=t?(e=-e,t=-t,i=-i,-r):(n=-n,a=-e,e=-i,i=a,a=-t,t=-r,a),0<e){if(!(0<i))return n;if(!(e<=i))return n}else{if(0<i)return-n;if(!(i<=e))return-n;n=-n,e=-e,i=-i}for(;;){if((r-=(o=Math.floor(i/e))*t)<0)return-n;if(t<r)return n;if(e>(i-=o*e)+i){if(t<r+r)return n}else{if(r+r<t)return-n;i=e-i,r=t-r,n=-n}if(0===r)return 0===i?0:-n;if(0===i)return n;if((t-=(o=Math.floor(e/i))*r)<0)return n;if(r<t)return-n;if(i>(e-=o*i)+e){if(r<t+t)return-n}else{if(t+t<r)return n;e=i-e,t=r-t,n=-n}if(0===t)return 0===e?0:n;if(0===e)return-n}};var Kl=function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var e=arguments[0];this._p=e};Kl.prototype.countSegment=function(e,t){if(e.x<this._p.x&&t.x<this._p.x)return null;if(this._p.x===t.x&&this._p.y===t.y)return this._isPointOnSegment=!0,null;if(e.y===this._p.y&&t.y===this._p.y){var i=e.x,r=t.x;return r<i&&(i=t.x,r=e.x),this._p.x>=i&&this._p.x<=r&&(this._isPointOnSegment=!0),null}if(e.y>this._p.y&&t.y<=this._p.y||t.y>this._p.y&&e.y<=this._p.y){var n=e.x-this._p.x,a=e.y-this._p.y,o=t.x-this._p.x,s=t.y-this._p.y,l=Jl.signOfDet2x2(n,a,o,s);if(0===l)return this._isPointOnSegment=!0,null;s<a&&(l=-l),0<l&&this._crossingCount++}},Kl.prototype.isPointInPolygon=function(){return this.getLocation()!==xl.EXTERIOR},Kl.prototype.getLocation=function(){return this._isPointOnSegment?xl.BOUNDARY:this._crossingCount%2==1?xl.INTERIOR:xl.EXTERIOR},Kl.prototype.isOnSegment=function(){return this._isPointOnSegment},Kl.prototype.interfaces_=function(){return[]},Kl.prototype.getClass=function(){return Kl},Kl.locatePointInRing=function(){if(arguments[0]instanceof yl&&Al(arguments[1],Rl)){for(var e=arguments[0],t=arguments[1],i=new Kl(e),r=new yl,n=new yl,a=1;a<t.size();a++)if(t.getCoordinate(a,r),t.getCoordinate(a-1,n),i.countSegment(r,n),i.isOnSegment())return i.getLocation();return i.getLocation()}if(arguments[0]instanceof yl&&arguments[1]instanceof Array){for(var o=arguments[0],s=arguments[1],l=new Kl(o),u=1;u<s.length;u++){var c=s[u],d=s[u-1];if(l.countSegment(c,d),l.isOnSegment())return l.getLocation()}return l.getLocation()}};var eu=function(){},tu={CLOCKWISE:{configurable:!0},RIGHT:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},LEFT:{configurable:!0},COLLINEAR:{configurable:!0},STRAIGHT:{configurable:!0}};eu.prototype.interfaces_=function(){return[]},eu.prototype.getClass=function(){return eu},eu.orientationIndex=function(e,t,i){return Il.orientationIndex(e,t,i)},eu.signedArea=function(){if(arguments[0]instanceof Array){var e=arguments[0];if(e.length<3)return 0;for(var t=0,i=e[0].x,r=1;r<e.length-1;r++){var n=e[r].x-i,a=e[r+1].y,o=e[r-1].y;t+=n*(o-a)}return t/2}if(Al(arguments[0],Rl)){var s=arguments[0],l=s.size();if(l<3)return 0;var u=new yl,c=new yl,d=new yl;s.getCoordinate(0,c),s.getCoordinate(1,d);var h=c.x;d.x-=h;for(var p=0,f=1;f<l-1;f++)u.y=c.y,c.x=d.x,c.y=d.y,s.getCoordinate(f+1,d),d.x-=h,p+=c.x*(u.y-d.y);return p/2}},eu.distanceLineLine=function(e,t,i,r){if(e.equals(t))return eu.distancePointLine(e,i,r);if(i.equals(r))return eu.distancePointLine(r,e,t);var n=!1;if(Vl.intersects(e,t,i,r)){var a=(t.x-e.x)*(r.y-i.y)-(t.y-e.y)*(r.x-i.x);if(0==a)n=!0;else{var o=(e.y-i.y)*(r.x-i.x)-(e.x-i.x)*(r.y-i.y),s=((e.y-i.y)*(t.x-e.x)-(e.x-i.x)*(t.y-e.y))/a,l=o/a;(l<0||1<l||s<0||1<s)&&(n=!0)}}else n=!0;return n?Sl.min(eu.distancePointLine(e,i,r),eu.distancePointLine(t,i,r),eu.distancePointLine(i,e,t),eu.distancePointLine(r,e,t)):0},eu.isPointInRing=function(e,t){return eu.locatePointInRing(e,t)!==xl.EXTERIOR},eu.computeLength=function(e){var t=e.size();if(t<=1)return 0;var i=0,r=new yl;e.getCoordinate(0,r);for(var n=r.x,a=r.y,o=1;o<t;o++){e.getCoordinate(o,r);var s=r.x,l=r.y,u=s-n,c=l-a;i+=Math.sqrt(u*u+c*c),n=s,a=l}return i},eu.isCCW=function(e){var t=e.length-1;if(t<3)throw new cl("Ring has fewer than 4 points, so orientation cannot be determined");for(var i=e[0],r=0,n=1;n<=t;n++){var a=e[n];a.y>i.y&&(i=a,r=n)}for(var o=r;(o-=1)<0&&(o=t),e[o].equals2D(i)&&o!==r;);for(var s=r;e[s=(s+1)%t].equals2D(i)&&s!==r;);var l=e[o],u=e[s];if(l.equals2D(i)||u.equals2D(i)||l.equals2D(u))return!1;var c=eu.computeOrientation(l,i,u);return 0===c?l.x>u.x:0<c},eu.locatePointInRing=function(e,t){return Kl.locatePointInRing(e,t)},eu.distancePointLinePerpendicular=function(e,t,i){var r=(i.x-t.x)*(i.x-t.x)+(i.y-t.y)*(i.y-t.y),n=((t.y-e.y)*(i.x-t.x)-(t.x-e.x)*(i.y-t.y))/r;return Math.abs(n)*Math.sqrt(r)},eu.computeOrientation=function(e,t,i){return eu.orientationIndex(e,t,i)},eu.distancePointLine=function(){if(2===arguments.length){var e=arguments[0],t=arguments[1];if(0===t.length)throw new cl("Line array must contain at least one vertex");for(var i=e.distance(t[0]),r=0;r<t.length-1;r++){var n=eu.distancePointLine(e,t[r],t[r+1]);n<i&&(i=n)}return i}if(3===arguments.length){var a=arguments[0],o=arguments[1],s=arguments[2];if(o.x===s.x&&o.y===s.y)return a.distance(o);var l=(s.x-o.x)*(s.x-o.x)+(s.y-o.y)*(s.y-o.y),u=((a.x-o.x)*(s.x-o.x)+(a.y-o.y)*(s.y-o.y))/l;if(u<=0)return a.distance(o);if(1<=u)return a.distance(s);var c=((o.y-a.y)*(s.x-o.x)-(o.x-a.x)*(s.y-o.y))/l;return Math.abs(c)*Math.sqrt(l)}},eu.isOnLine=function(e,t){for(var i=new Zl,r=1;r<t.length;r++){var n=t[r-1],a=t[r];if(i.computeIntersection(e,n,a),i.hasIntersection())return!0}return!1},tu.CLOCKWISE.get=function(){return-1},tu.RIGHT.get=function(){return eu.CLOCKWISE},tu.COUNTERCLOCKWISE.get=function(){return 1},tu.LEFT.get=function(){return eu.COUNTERCLOCKWISE},tu.COLLINEAR.get=function(){return 0},tu.STRAIGHT.get=function(){return eu.COLLINEAR},Object.defineProperties(eu,tu);var iu=function(){};iu.prototype.filter=function(e){},iu.prototype.interfaces_=function(){return[]},iu.prototype.getClass=function(){return iu};var ru=function(){var e=arguments[0];this._envelope=null,this._factory=null,this._SRID=null,this._userData=null,this._factory=e,this._SRID=e.getSRID()},nu={serialVersionUID:{configurable:!0},SORTINDEX_POINT:{configurable:!0},SORTINDEX_MULTIPOINT:{configurable:!0},SORTINDEX_LINESTRING:{configurable:!0},SORTINDEX_LINEARRING:{configurable:!0},SORTINDEX_MULTILINESTRING:{configurable:!0},SORTINDEX_POLYGON:{configurable:!0},SORTINDEX_MULTIPOLYGON:{configurable:!0},SORTINDEX_GEOMETRYCOLLECTION:{configurable:!0},geometryChangedFilter:{configurable:!0}};ru.prototype.isGeometryCollection=function(){return this.getSortIndex()===ru.SORTINDEX_GEOMETRYCOLLECTION},ru.prototype.getFactory=function(){return this._factory},ru.prototype.getGeometryN=function(e){return this},ru.prototype.getArea=function(){return 0},ru.prototype.isRectangle=function(){return!1},ru.prototype.equals=function(){if(arguments[0]instanceof ru){var e=arguments[0];return null!==e&&this.equalsTopo(e)}if(arguments[0]instanceof Object){var t=arguments[0];if(!(t instanceof ru))return!1;var i=t;return this.equalsExact(i)}},ru.prototype.equalsExact=function(e){return this===e||this.equalsExact(e,0)},ru.prototype.geometryChanged=function(){this.apply(ru.geometryChangedFilter)},ru.prototype.geometryChangedAction=function(){this._envelope=null},ru.prototype.equalsNorm=function(e){return null!==e&&this.norm().equalsExact(e.norm())},ru.prototype.getLength=function(){return 0},ru.prototype.getNumGeometries=function(){return 1},ru.prototype.compareTo=function(){if(1===arguments.length){var e=arguments[0],t=e;return this.getSortIndex()!==t.getSortIndex()?this.getSortIndex()-t.getSortIndex():this.isEmpty()&&t.isEmpty()?0:this.isEmpty()?-1:t.isEmpty()?1:this.compareToSameClass(e)}if(2===arguments.length){var i=arguments[0],r=arguments[1];return this.getSortIndex()!==i.getSortIndex()?this.getSortIndex()-i.getSortIndex():this.isEmpty()&&i.isEmpty()?0:this.isEmpty()?-1:i.isEmpty()?1:this.compareToSameClass(i,r)}},ru.prototype.getUserData=function(){return this._userData},ru.prototype.getSRID=function(){return this._SRID},ru.prototype.getEnvelope=function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())},ru.prototype.checkNotGeometryCollection=function(e){if(e.getSortIndex()===ru.SORTINDEX_GEOMETRYCOLLECTION)throw new cl("This method does not support GeometryCollection arguments")},ru.prototype.equal=function(e,t,i){return 0===i?e.equals(t):e.distance(t)<=i},ru.prototype.norm=function(){var e=this.copy();return e.normalize(),e},ru.prototype.getPrecisionModel=function(){return this._factory.getPrecisionModel()},ru.prototype.getEnvelopeInternal=function(){return null===this._envelope&&(this._envelope=this.computeEnvelopeInternal()),new Vl(this._envelope)},ru.prototype.setSRID=function(e){this._SRID=e},ru.prototype.setUserData=function(e){this._userData=e},ru.prototype.compare=function(e,t){for(var i=e.iterator(),r=t.iterator();i.hasNext()&&r.hasNext();){var n=i.next(),a=r.next(),o=n.compareTo(a);if(0!==o)return o}return i.hasNext()?1:r.hasNext()?-1:0},ru.prototype.hashCode=function(){return this.getEnvelopeInternal().hashCode()},ru.prototype.isGeometryCollectionOrDerived=function(){return this.getSortIndex()===ru.SORTINDEX_GEOMETRYCOLLECTION||this.getSortIndex()===ru.SORTINDEX_MULTIPOINT||this.getSortIndex()===ru.SORTINDEX_MULTILINESTRING||this.getSortIndex()===ru.SORTINDEX_MULTIPOLYGON},ru.prototype.interfaces_=function(){return[fl,pl,gl]},ru.prototype.getClass=function(){return ru},ru.hasNonEmptyElements=function(e){for(var t=0;t<e.length;t++)if(!e[t].isEmpty())return!0;return!1},ru.hasNullElements=function(e){for(var t=0;t<e.length;t++)if(null===e[t])return!0;return!1},nu.serialVersionUID.get=function(){return 0x799ea46522854c00},nu.SORTINDEX_POINT.get=function(){return 0},nu.SORTINDEX_MULTIPOINT.get=function(){return 1},nu.SORTINDEX_LINESTRING.get=function(){return 2},nu.SORTINDEX_LINEARRING.get=function(){return 3},nu.SORTINDEX_MULTILINESTRING.get=function(){return 4},nu.SORTINDEX_POLYGON.get=function(){return 5},nu.SORTINDEX_MULTIPOLYGON.get=function(){return 6},nu.SORTINDEX_GEOMETRYCOLLECTION.get=function(){return 7},nu.geometryChangedFilter.get=function(){return au},Object.defineProperties(ru,nu);var au=function(){};au.interfaces_=function(){return[iu]},au.filter=function(e){e.geometryChangedAction()};var ou=function(){};ou.prototype.filter=function(e){},ou.prototype.interfaces_=function(){return[]},ou.prototype.getClass=function(){return ou};var su=function(){},lu={Mod2BoundaryNodeRule:{configurable:!0},EndPointBoundaryNodeRule:{configurable:!0},MultiValentEndPointBoundaryNodeRule:{configurable:!0},MonoValentEndPointBoundaryNodeRule:{configurable:!0},MOD2_BOUNDARY_RULE:{configurable:!0},ENDPOINT_BOUNDARY_RULE:{configurable:!0},MULTIVALENT_ENDPOINT_BOUNDARY_RULE:{configurable:!0},MONOVALENT_ENDPOINT_BOUNDARY_RULE:{configurable:!0},OGC_SFS_BOUNDARY_RULE:{configurable:!0}};su.prototype.isInBoundary=function(e){},su.prototype.interfaces_=function(){return[]},su.prototype.getClass=function(){return su},lu.Mod2BoundaryNodeRule.get=function(){return uu},lu.EndPointBoundaryNodeRule.get=function(){return cu},lu.MultiValentEndPointBoundaryNodeRule.get=function(){return du},lu.MonoValentEndPointBoundaryNodeRule.get=function(){return hu},lu.MOD2_BOUNDARY_RULE.get=function(){return new uu},lu.ENDPOINT_BOUNDARY_RULE.get=function(){return new cu},lu.MULTIVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new du},lu.MONOVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new hu},lu.OGC_SFS_BOUNDARY_RULE.get=function(){return su.MOD2_BOUNDARY_RULE},Object.defineProperties(su,lu);var uu=function(){};uu.prototype.isInBoundary=function(e){return e%2==1},uu.prototype.interfaces_=function(){return[su]},uu.prototype.getClass=function(){return uu};var cu=function(){};cu.prototype.isInBoundary=function(e){return 0<e},cu.prototype.interfaces_=function(){return[su]},cu.prototype.getClass=function(){return cu};var du=function(){};du.prototype.isInBoundary=function(e){return 1<e},du.prototype.interfaces_=function(){return[su]},du.prototype.getClass=function(){return du};var hu=function(){};hu.prototype.isInBoundary=function(e){return 1===e},hu.prototype.interfaces_=function(){return[su]},hu.prototype.getClass=function(){return hu};var pu=function(){};function fu(e){this.message=e||""}pu.prototype.add=function(){},pu.prototype.addAll=function(){},pu.prototype.isEmpty=function(){},pu.prototype.iterator=function(){},pu.prototype.size=function(){},pu.prototype.toArray=function(){},pu.prototype.remove=function(){},(fu.prototype=new Error).name="IndexOutOfBoundsException";var mu=function(){};mu.prototype.hasNext=function(){},mu.prototype.next=function(){},mu.prototype.remove=function(){};var gu=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),((t.prototype=Object.create(e&&e.prototype)).constructor=t).prototype.get=function(){},t.prototype.set=function(){},t.prototype.isEmpty=function(){},t}(pu);function yu(e){this.message=e||""}(yu.prototype=new Error).name="NoSuchElementException";var vu=function(e){function t(){e.call(this),this.array_=[],arguments[0]instanceof pu&&this.addAll(arguments[0])}return e&&(t.__proto__=e),((t.prototype=Object.create(e&&e.prototype)).constructor=t).prototype.ensureCapacity=function(){},t.prototype.interfaces_=function(){return[e,pu]},t.prototype.add=function(e){return 1===arguments.length?this.array_.push(e):this.array_.splice(arguments[0],arguments[1]),!0},t.prototype.clear=function(){this.array_=[]},t.prototype.addAll=function(e){for(var t=e.iterator();t.hasNext();)this.add(t.next());return!0},t.prototype.set=function(e,t){var i=this.array_[e];return this.array_[e]=t,i},t.prototype.iterator=function(){return new _u(this)},t.prototype.get=function(e){if(e<0||e>=this.size())throw new fu;return this.array_[e]},t.prototype.isEmpty=function(){return 0===this.array_.length},t.prototype.size=function(){return this.array_.length},t.prototype.toArray=function(){for(var e=[],t=0,i=this.array_.length;t<i;t++)e.push(this.array_[t]);return e},t.prototype.remove=function(e){for(var t=!1,i=0,r=this.array_.length;i<r;i++)if(this.array_[i]===e){this.array_.splice(i,1),t=!0;break}return t},t}(gu),_u=function(t){function e(e){t.call(this),this.arrayList_=e,this.position_=0}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.next=function(){if(this.position_===this.arrayList_.size())throw new yu;return this.arrayList_.get(this.position_++)},e.prototype.hasNext=function(){return this.position_<this.arrayList_.size()},e.prototype.set=function(e){return this.arrayList_.set(this.position_-1,e)},e.prototype.remove=function(){this.arrayList_.remove(this.arrayList_.get(this.position_))},e}(mu),Cu=function(w){function e(){if(w.call(this),0===arguments.length);else if(1===arguments.length){var e=arguments[0];this.ensureCapacity(e.length),this.add(e,!0)}else if(2===arguments.length){var t=arguments[0],i=arguments[1];this.ensureCapacity(t.length),this.add(t,i)}}w&&(e.__proto__=w),(e.prototype=Object.create(w&&w.prototype)).constructor=e;var t={coordArrayType:{configurable:!0}};return t.coordArrayType.get=function(){return new Array(0).fill(null)},e.prototype.getCoordinate=function(e){return this.get(e)},e.prototype.addAll=function(){if(2!==arguments.length)return w.prototype.addAll.apply(this,arguments);for(var e=arguments[0],t=arguments[1],i=!1,r=e.iterator();r.hasNext();)this.add(r.next(),t),i=!0;return i},e.prototype.clone=function(){for(var e=w.prototype.clone.call(this),t=0;t<this.size();t++)e.add(t,this.get(t).copy());return e},e.prototype.toCoordinateArray=function(){return this.toArray(e.coordArrayType)},e.prototype.add=function(){if(1===arguments.length){var e=arguments[0];w.prototype.add.call(this,e)}else if(2===arguments.length){if(arguments[0]instanceof Array&&"boolean"==typeof arguments[1]){var t=arguments[0],i=arguments[1];return this.add(t,i,!0),!0}if(arguments[0]instanceof yl&&"boolean"==typeof arguments[1]){var r=arguments[0],n=arguments[1];if(!n&&1<=this.size()){var a=this.get(this.size()-1);if(a.equals2D(r))return null}w.prototype.add.call(this,r)}else if(arguments[0]instanceof Object&&"boolean"==typeof arguments[1]){var o=arguments[0],s=arguments[1];return this.add(o,s),!0}}else if(3===arguments.length){if("boolean"==typeof arguments[2]&&arguments[0]instanceof Array&&"boolean"==typeof arguments[1]){var l=arguments[0],u=arguments[1],c=arguments[2];if(c)for(var d=0;d<l.length;d++)this.add(l[d],u);else for(var h=l.length-1;0<=h;h--)this.add(l[h],u);return!0}if("boolean"==typeof arguments[2]&&Number.isInteger(arguments[0])&&arguments[1]instanceof yl){var p=arguments[0],f=arguments[1],m=arguments[2];if(!m){var g=this.size();if(0<g){if(0<p){var y=this.get(p-1);if(y.equals2D(f))return null}if(p<g){var v=this.get(p);if(v.equals2D(f))return null}}}w.prototype.add.call(this,p,f)}}else if(4===arguments.length){var _=arguments[0],C=arguments[1],x=arguments[2],b=arguments[3],A=1;b<x&&(A=-1);for(var S=x;S!==b;S+=A)this.add(_[S],C);return!0}},e.prototype.closeRing=function(){0<this.size()&&this.add(new yl(this.get(0)),!1)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},Object.defineProperties(e,t),e}(vu),xu=function(){},bu={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};bu.ForwardComparator.get=function(){return Au},bu.BidirectionalComparator.get=function(){return Su},bu.coordArrayType.get=function(){return new Array(0).fill(null)},xu.prototype.interfaces_=function(){return[]},xu.prototype.getClass=function(){return xu},xu.isRing=function(e){return!(e.length<4||!e[0].equals2D(e[e.length-1]))},xu.ptNotInList=function(e,t){for(var i=0;i<e.length;i++){var r=e[i];if(xu.indexOf(r,t)<0)return r}return null},xu.scroll=function(e,t){var i=xu.indexOf(t,e);if(i<0)return null;var r=new Array(e.length).fill(null);Bl.arraycopy(e,i,r,0,e.length-i),Bl.arraycopy(e,0,r,e.length-i,i),Bl.arraycopy(r,0,e,0,e.length)},xu.equals=function(){if(2===arguments.length){var e=arguments[0],t=arguments[1];if(e===t)return!0;if(null===e||null===t)return!1;if(e.length!==t.length)return!1;for(var i=0;i<e.length;i++)if(!e[i].equals(t[i]))return!1;return!0}if(3===arguments.length){var r=arguments[0],n=arguments[1],a=arguments[2];if(r===n)return!0;if(null===r||null===n)return!1;if(r.length!==n.length)return!1;for(var o=0;o<r.length;o++)if(0!==a.compare(r[o],n[o]))return!1;return!0}},xu.intersection=function(e,t){for(var i=new Cu,r=0;r<e.length;r++)t.intersects(e[r])&&i.add(e[r],!0);return i.toCoordinateArray()},xu.hasRepeatedPoints=function(e){for(var t=1;t<e.length;t++)if(e[t-1].equals(e[t]))return!0;return!1},xu.removeRepeatedPoints=function(e){return xu.hasRepeatedPoints(e)?new Cu(e,!1).toCoordinateArray():e},xu.reverse=function(e){for(var t=e.length-1,i=Math.trunc(t/2),r=0;r<=i;r++){var n=e[r];e[r]=e[t-r],e[t-r]=n}},xu.removeNull=function(e){for(var t=0,i=0;i<e.length;i++)null!==e[i]&&t++;var r=new Array(t).fill(null);if(0===t)return r;for(var n=0,a=0;a<e.length;a++)null!==e[a]&&(r[n++]=e[a]);return r},xu.copyDeep=function(){if(1===arguments.length){for(var e=arguments[0],t=new Array(e.length).fill(null),i=0;i<e.length;i++)t[i]=new yl(e[i]);return t}if(5===arguments.length)for(var r=arguments[0],n=arguments[1],a=arguments[2],o=arguments[3],s=arguments[4],l=0;l<s;l++)a[o+l]=new yl(r[n+l])},xu.isEqualReversed=function(e,t){for(var i=0;i<e.length;i++){var r=e[i],n=t[e.length-i-1];if(0!==r.compareTo(n))return!1}return!0},xu.envelope=function(e){for(var t=new Vl,i=0;i<e.length;i++)t.expandToInclude(e[i]);return t},xu.toCoordinateArray=function(e){return e.toArray(xu.coordArrayType)},xu.atLeastNCoordinatesOrNothing=function(e,t){return t.length>=e?t:[]},xu.indexOf=function(e,t){for(var i=0;i<t.length;i++)if(e.equals(t[i]))return i;return-1},xu.increasingDirection=function(e){for(var t=0;t<Math.trunc(e.length/2);t++){var i=e.length-1-t,r=e[t].compareTo(e[i]);if(0!==r)return r}return 1},xu.compare=function(e,t){for(var i=0;i<e.length&&i<t.length;){var r=e[i].compareTo(t[i]);if(0!==r)return r;i++}return i<t.length?-1:i<e.length?1:0},xu.minCoordinate=function(e){for(var t=null,i=0;i<e.length;i++)(null===t||0<t.compareTo(e[i]))&&(t=e[i]);return t},xu.extract=function(e,t,i){t=Sl.clamp(t,0,e.length);var r=(i=Sl.clamp(i,-1,e.length))-t+1;i<0&&(r=0),t>=e.length&&(r=0),i<t&&(r=0);var n=new Array(r).fill(null);if(0===r)return n;for(var a=0,o=t;o<=i;o++)n[a++]=e[o];return n},Object.defineProperties(xu,bu);var Au=function(){};Au.prototype.compare=function(e,t){return xu.compare(e,t)},Au.prototype.interfaces_=function(){return[ml]},Au.prototype.getClass=function(){return Au};var Su=function(){};Su.prototype.compare=function(e,t){var i=e,r=t;if(i.length<r.length)return-1;if(i.length>r.length)return 1;if(0===i.length)return 0;var n=xu.compare(i,r);return xu.isEqualReversed(i,r)?0:n},Su.prototype.OLDcompare=function(e,t){var i=e,r=t;if(i.length<r.length)return-1;if(i.length>r.length)return 1;if(0===i.length)return 0;for(var n=xu.increasingDirection(i),a=xu.increasingDirection(r),o=0<n?0:i.length-1,s=0<a?0:i.length-1,l=0;l<i.length;l++){var u=i[o].compareTo(r[s]);if(0!==u)return u;o+=n,s+=a}return 0},Su.prototype.interfaces_=function(){return[ml]},Su.prototype.getClass=function(){return Su};var wu=function(){};wu.prototype.get=function(){},wu.prototype.put=function(){},wu.prototype.size=function(){},wu.prototype.values=function(){},wu.prototype.entrySet=function(){};var Eu=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t}(wu);function Tu(e){this.message=e||""}function Pu(){}(Tu.prototype=new Error).name="OperationNotSupported",(Pu.prototype=new pu).contains=function(){};var Mu=function(e){function t(){e.call(this),this.array_=[],arguments[0]instanceof pu&&this.addAll(arguments[0])}return e&&(t.__proto__=e),((t.prototype=Object.create(e&&e.prototype)).constructor=t).prototype.contains=function(e){for(var t=0,i=this.array_.length;t<i;t++)if(this.array_[t]===e)return!0;return!1},t.prototype.add=function(e){return!this.contains(e)&&(this.array_.push(e),!0)},t.prototype.addAll=function(e){for(var t=e.iterator();t.hasNext();)this.add(t.next());return!0},t.prototype.remove=function(e){throw new Error},t.prototype.size=function(){return this.array_.length},t.prototype.isEmpty=function(){return 0===this.array_.length},t.prototype.toArray=function(){for(var e=[],t=0,i=this.array_.length;t<i;t++)e.push(this.array_[t]);return e},t.prototype.iterator=function(){return new Du(this)},t}(Pu),Du=function(t){function e(e){t.call(this),this.hashSet_=e,this.position_=0}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.next=function(){if(this.position_===this.hashSet_.size())throw new yu;return this.hashSet_.array_[this.position_++]},e.prototype.hasNext=function(){return this.position_<this.hashSet_.size()},e.prototype.remove=function(){throw new Tu},e}(mu);function Iu(e){return null===e?0:e.color}function Ou(e){return null===e?null:e.parent}function Ru(e,t){null!==e&&(e.color=t)}function Lu(e){return null===e?null:e.left}function Nu(e){return null===e?null:e.right}function ku(){this.root_=null,this.size_=0}(ku.prototype=new Eu).get=function(e){for(var t=this.root_;null!==t;){var i=e.compareTo(t.key);if(i<0)t=t.left;else{if(!(0<i))return t.value;t=t.right}}return null},ku.prototype.put=function(e,t){if(null===this.root_)return this.root_={key:e,value:t,left:null,right:null,parent:null,color:0,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var i,r,n=this.root_;do{if(i=n,(r=e.compareTo(n.key))<0)n=n.left;else{if(!(0<r)){var a=n.value;return n.value=t,a}n=n.right}}while(null!==n);var o={key:e,left:null,right:null,value:t,parent:i,color:0,getValue:function(){return this.value},getKey:function(){return this.key}};return r<0?i.left=o:i.right=o,this.fixAfterInsertion(o),this.size_++,null},ku.prototype.fixAfterInsertion=function(e){for(e.color=1;null!=e&&e!==this.root_&&1===e.parent.color;)if(Ou(e)===Lu(Ou(Ou(e)))){var t=Nu(Ou(Ou(e)));1===Iu(t)?(Ru(Ou(e),0),Ru(t,0),Ru(Ou(Ou(e)),1),e=Ou(Ou(e))):(e===Nu(Ou(e))&&(e=Ou(e),this.rotateLeft(e)),Ru(Ou(e),0),Ru(Ou(Ou(e)),1),this.rotateRight(Ou(Ou(e))))}else{var i=Lu(Ou(Ou(e)));1===Iu(i)?(Ru(Ou(e),0),Ru(i,0),Ru(Ou(Ou(e)),1),e=Ou(Ou(e))):(e===Lu(Ou(e))&&(e=Ou(e),this.rotateRight(e)),Ru(Ou(e),0),Ru(Ou(Ou(e)),1),this.rotateLeft(Ou(Ou(e))))}this.root_.color=0},ku.prototype.values=function(){var e=new vu,t=this.getFirstEntry();if(null!==t)for(e.add(t.value);null!==(t=ku.successor(t));)e.add(t.value);return e},ku.prototype.entrySet=function(){var e=new Mu,t=this.getFirstEntry();if(null!==t)for(e.add(t);null!==(t=ku.successor(t));)e.add(t);return e},ku.prototype.rotateLeft=function(e){if(null!=e){var t=e.right;e.right=t.left,null!=t.left&&(t.left.parent=e),t.parent=e.parent,null===e.parent?this.root_=t:e.parent.left===e?e.parent.left=t:e.parent.right=t,(t.left=e).parent=t}},ku.prototype.rotateRight=function(e){if(null!=e){var t=e.left;e.left=t.right,null!=t.right&&(t.right.parent=e),t.parent=e.parent,null===e.parent?this.root_=t:e.parent.right===e?e.parent.right=t:e.parent.left=t,(t.right=e).parent=t}},ku.prototype.getFirstEntry=function(){var e=this.root_;if(null!=e)for(;null!=e.left;)e=e.left;return e},ku.successor=function(e){if(null===e)return null;if(null!==e.right){for(var t=e.right;null!==t.left;)t=t.left;return t}for(var i=e.parent,r=e;null!==i&&r===i.right;)i=(r=i).parent;return i},ku.prototype.size=function(){return this.size_};var Bu=function(){};function Fu(){}function Vu(){this.array_=[],arguments[0]instanceof pu&&this.addAll(arguments[0])}Bu.prototype.interfaces_=function(){return[]},Bu.prototype.getClass=function(){return Bu},Fu.prototype=new Pu,(Vu.prototype=new Fu).contains=function(e){for(var t=0,i=this.array_.length;t<i;t++)if(0===this.array_[t].compareTo(e))return!0;return!1},Vu.prototype.add=function(e){if(this.contains(e))return!1;for(var t=0,i=this.array_.length;t<i;t++)if(1===this.array_[t].compareTo(e))return this.array_.splice(t,0,e),!0;return this.array_.push(e),!0},Vu.prototype.addAll=function(e){for(var t=e.iterator();t.hasNext();)this.add(t.next());return!0},Vu.prototype.remove=function(e){throw new Tu},Vu.prototype.size=function(){return this.array_.length},Vu.prototype.isEmpty=function(){return 0===this.array_.length},Vu.prototype.toArray=function(){for(var e=[],t=0,i=this.array_.length;t<i;t++)e.push(this.array_[t]);return e},Vu.prototype.iterator=function(){return new zu(this)};var zu=function(e){this.treeSet_=e,this.position_=0};zu.prototype.next=function(){if(this.position_===this.treeSet_.size())throw new yu;return this.treeSet_.array_[this.position_++]},zu.prototype.hasNext=function(){return this.position_<this.treeSet_.size()},zu.prototype.remove=function(){throw new Tu};var Uu=function(){};Uu.sort=function(){var e,t,i,r,n=arguments[0];if(1===arguments.length)r=function(e,t){return e.compareTo(t)},n.sort(r);else if(2===arguments.length)i=arguments[1],r=function(e,t){return i.compare(e,t)},n.sort(r);else if(3===arguments.length){(t=n.slice(arguments[1],arguments[2])).sort();var a=n.slice(0,arguments[1]).concat(t,n.slice(arguments[2],n.length));for(n.splice(0,n.length),e=0;e<a.length;e++)n.push(a[e])}else if(4===arguments.length)for(t=n.slice(arguments[1],arguments[2]),i=arguments[3],r=function(e,t){return i.compare(e,t)},t.sort(r),a=n.slice(0,arguments[1]).concat(t,n.slice(arguments[2],n.length)),n.splice(0,n.length),e=0;e<a.length;e++)n.push(a[e])},Uu.asList=function(e){for(var t=new vu,i=0,r=e.length;i<r;i++)t.add(e[i]);return t};var Gu=function(){},$u={P:{configurable:!0},L:{configurable:!0},A:{configurable:!0},FALSE:{configurable:!0},TRUE:{configurable:!0},DONTCARE:{configurable:!0},SYM_FALSE:{configurable:!0},SYM_TRUE:{configurable:!0},SYM_DONTCARE:{configurable:!0},SYM_P:{configurable:!0},SYM_L:{configurable:!0},SYM_A:{configurable:!0}};$u.P.get=function(){return 0},$u.L.get=function(){return 1},$u.A.get=function(){return 2},$u.FALSE.get=function(){return-1},$u.TRUE.get=function(){return-2},$u.DONTCARE.get=function(){return-3},$u.SYM_FALSE.get=function(){return"F"},$u.SYM_TRUE.get=function(){return"T"},$u.SYM_DONTCARE.get=function(){return"*"},$u.SYM_P.get=function(){return"0"},$u.SYM_L.get=function(){return"1"},$u.SYM_A.get=function(){return"2"},Gu.prototype.interfaces_=function(){return[]},Gu.prototype.getClass=function(){return Gu},Gu.toDimensionSymbol=function(e){switch(e){case Gu.FALSE:return Gu.SYM_FALSE;case Gu.TRUE:return Gu.SYM_TRUE;case Gu.DONTCARE:return Gu.SYM_DONTCARE;case Gu.P:return Gu.SYM_P;case Gu.L:return Gu.SYM_L;case Gu.A:return Gu.SYM_A}throw new cl("Unknown dimension value: "+e)},Gu.toDimensionValue=function(e){switch(Pl.toUpperCase(e)){case Gu.SYM_FALSE:return Gu.FALSE;case Gu.SYM_TRUE:return Gu.TRUE;case Gu.SYM_DONTCARE:return Gu.DONTCARE;case Gu.SYM_P:return Gu.P;case Gu.SYM_L:return Gu.L;case Gu.SYM_A:return Gu.A}throw new cl("Unknown dimension symbol: "+e)},Object.defineProperties(Gu,$u);var Hu=function(){};Hu.prototype.filter=function(e){},Hu.prototype.interfaces_=function(){return[]},Hu.prototype.getClass=function(){return Hu};var Wu=function(){};Wu.prototype.filter=function(e,t){},Wu.prototype.isDone=function(){},Wu.prototype.isGeometryChanged=function(){},Wu.prototype.interfaces_=function(){return[]},Wu.prototype.getClass=function(){return Wu};var ju=function(n){function i(e,t){if(n.call(this,t),this._geometries=e||[],n.hasNullElements(this._geometries))throw new cl("geometries must not contain null elements")}n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype);var e={serialVersionUID:{configurable:!0}};return(i.prototype.constructor=i).prototype.computeEnvelopeInternal=function(){for(var e=new Vl,t=0;t<this._geometries.length;t++)e.expandToInclude(this._geometries[t].getEnvelopeInternal());return e},i.prototype.getGeometryN=function(e){return this._geometries[e]},i.prototype.getSortIndex=function(){return n.SORTINDEX_GEOMETRYCOLLECTION},i.prototype.getCoordinates=function(){for(var e=new Array(this.getNumPoints()).fill(null),t=-1,i=0;i<this._geometries.length;i++)for(var r=this._geometries[i].getCoordinates(),n=0;n<r.length;n++)e[++t]=r[n];return e},i.prototype.getArea=function(){for(var e=0,t=0;t<this._geometries.length;t++)e+=this._geometries[t].getArea();return e},i.prototype.equalsExact=function(){if(2!==arguments.length)return n.prototype.equalsExact.apply(this,arguments);var e=arguments[0],t=arguments[1];if(!this.isEquivalentClass(e))return!1;var i=e;if(this._geometries.length!==i._geometries.length)return!1;for(var r=0;r<this._geometries.length;r++)if(!this._geometries[r].equalsExact(i._geometries[r],t))return!1;return!0},i.prototype.normalize=function(){for(var e=0;e<this._geometries.length;e++)this._geometries[e].normalize();Uu.sort(this._geometries)},i.prototype.getCoordinate=function(){return this.isEmpty()?null:this._geometries[0].getCoordinate()},i.prototype.getBoundaryDimension=function(){for(var e=Gu.FALSE,t=0;t<this._geometries.length;t++)e=Math.max(e,this._geometries[t].getBoundaryDimension());return e},i.prototype.getDimension=function(){for(var e=Gu.FALSE,t=0;t<this._geometries.length;t++)e=Math.max(e,this._geometries[t].getDimension());return e},i.prototype.getLength=function(){for(var e=0,t=0;t<this._geometries.length;t++)e+=this._geometries[t].getLength();return e},i.prototype.getNumPoints=function(){for(var e=0,t=0;t<this._geometries.length;t++)e+=this._geometries[t].getNumPoints();return e},i.prototype.getNumGeometries=function(){return this._geometries.length},i.prototype.reverse=function(){for(var e=this._geometries.length,t=new Array(e).fill(null),i=0;i<this._geometries.length;i++)t[i]=this._geometries[i].reverse();return this.getFactory().createGeometryCollection(t)},i.prototype.compareToSameClass=function(){if(1===arguments.length){var e=arguments[0],t=new Vu(Uu.asList(this._geometries)),i=new Vu(Uu.asList(e._geometries));return this.compare(t,i)}if(2===arguments.length){for(var r=arguments[0],n=arguments[1],a=r,o=this.getNumGeometries(),s=a.getNumGeometries(),l=0;l<o&&l<s;){var u=this.getGeometryN(l),c=a.getGeometryN(l),d=u.compareToSameClass(c,n);if(0!==d)return d;l++}return l<o?1:l<s?-1:0}},i.prototype.apply=function(){if(Al(arguments[0],ou))for(var e=arguments[0],t=0;t<this._geometries.length;t++)this._geometries[t].apply(e);else if(Al(arguments[0],Wu)){var i=arguments[0];if(0===this._geometries.length)return null;for(var r=0;r<this._geometries.length&&(this._geometries[r].apply(i),!i.isDone());r++);i.isGeometryChanged()&&this.geometryChanged()}else if(Al(arguments[0],Hu)){var n=arguments[0];n.filter(this);for(var a=0;a<this._geometries.length;a++)this._geometries[a].apply(n)}else if(Al(arguments[0],iu)){var o=arguments[0];o.filter(this);for(var s=0;s<this._geometries.length;s++)this._geometries[s].apply(o)}},i.prototype.getBoundary=function(){return this.checkNotGeometryCollection(this),Ql.shouldNeverReachHere(),null},i.prototype.clone=function(){var e=n.prototype.clone.call(this);e._geometries=new Array(this._geometries.length).fill(null);for(var t=0;t<this._geometries.length;t++)e._geometries[t]=this._geometries[t].clone();return e},i.prototype.getGeometryType=function(){return"GeometryCollection"},i.prototype.copy=function(){for(var e=new Array(this._geometries.length).fill(null),t=0;t<e.length;t++)e[t]=this._geometries[t].copy();return new i(e,this._factory)},i.prototype.isEmpty=function(){for(var e=0;e<this._geometries.length;e++)if(!this._geometries[e].isEmpty())return!1;return!0},i.prototype.interfaces_=function(){return[]},i.prototype.getClass=function(){return i},e.serialVersionUID.get=function(){return-0x4f07bcb1f857d800},Object.defineProperties(i,e),i}(ru),qu=function(i){function r(){i.apply(this,arguments)}i&&(r.__proto__=i),r.prototype=Object.create(i&&i.prototype);var e={serialVersionUID:{configurable:!0}};return(r.prototype.constructor=r).prototype.getSortIndex=function(){return ru.SORTINDEX_MULTILINESTRING},r.prototype.equalsExact=function(){if(2!==arguments.length)return i.prototype.equalsExact.apply(this,arguments);var e=arguments[0],t=arguments[1];return!!this.isEquivalentClass(e)&&i.prototype.equalsExact.call(this,e,t)},r.prototype.getBoundaryDimension=function(){return this.isClosed()?Gu.FALSE:0},r.prototype.isClosed=function(){if(this.isEmpty())return!1;for(var e=0;e<this._geometries.length;e++)if(!this._geometries[e].isClosed())return!1;return!0},r.prototype.getDimension=function(){return 1},r.prototype.reverse=function(){for(var e=this._geometries.length,t=new Array(e).fill(null),i=0;i<this._geometries.length;i++)t[e-1-i]=this._geometries[i].reverse();return this.getFactory().createMultiLineString(t)},r.prototype.getBoundary=function(){return new Qu(this).getBoundary()},r.prototype.getGeometryType=function(){return"MultiLineString"},r.prototype.copy=function(){for(var e=new Array(this._geometries.length).fill(null),t=0;t<e.length;t++)e[t]=this._geometries[t].copy();return new r(e,this._factory)},r.prototype.interfaces_=function(){return[Bu]},r.prototype.getClass=function(){return r},e.serialVersionUID.get=function(){return 0x7155d2ab4afa8000},Object.defineProperties(r,e),r}(ju),Qu=function(){if(this._geom=null,this._geomFact=null,this._bnRule=null,this._endpointMap=null,1===arguments.length){var e=arguments[0],t=su.MOD2_BOUNDARY_RULE;this._geom=e,this._geomFact=e.getFactory(),this._bnRule=t}else if(2===arguments.length){var i=arguments[0],r=arguments[1];this._geom=i,this._geomFact=i.getFactory(),this._bnRule=r}};Qu.prototype.boundaryMultiLineString=function(e){if(this._geom.isEmpty())return this.getEmptyMultiPoint();var t=this.computeBoundaryCoordinates(e);return 1===t.length?this._geomFact.createPoint(t[0]):this._geomFact.createMultiPointFromCoords(t)},Qu.prototype.getBoundary=function(){return this._geom instanceof ac?this.boundaryLineString(this._geom):this._geom instanceof qu?this.boundaryMultiLineString(this._geom):this._geom.getBoundary()},Qu.prototype.boundaryLineString=function(e){return this._geom.isEmpty()?this.getEmptyMultiPoint():e.isClosed()?this._bnRule.isInBoundary(2)?e.getStartPoint():this._geomFact.createMultiPoint():this._geomFact.createMultiPoint([e.getStartPoint(),e.getEndPoint()])},Qu.prototype.getEmptyMultiPoint=function(){return this._geomFact.createMultiPoint()},Qu.prototype.computeBoundaryCoordinates=function(e){var t=new vu;this._endpointMap=new ku;for(var i=0;i<e.getNumGeometries();i++){var r=e.getGeometryN(i);0!==r.getNumPoints()&&(this.addEndpoint(r.getCoordinateN(0)),this.addEndpoint(r.getCoordinateN(r.getNumPoints()-1)))}for(var n=this._endpointMap.entrySet().iterator();n.hasNext();){var a=n.next(),o=a.getValue().count;this._bnRule.isInBoundary(o)&&t.add(a.getKey())}return xu.toCoordinateArray(t)},Qu.prototype.addEndpoint=function(e){var t=this._endpointMap.get(e);null===t&&(t=new Yu,this._endpointMap.put(e,t)),t.count++},Qu.prototype.interfaces_=function(){return[]},Qu.prototype.getClass=function(){return Qu},Qu.getBoundary=function(){if(1===arguments.length){var e=arguments[0],t=new Qu(e);return t.getBoundary()}if(2===arguments.length){var i=arguments[0],r=arguments[1],n=new Qu(i,r);return n.getBoundary()}};var Yu=function(){this.count=null};function Xu(){}function Zu(){}Yu.prototype.interfaces_=function(){return[]},Yu.prototype.getClass=function(){return Yu};var Ju=function(){};function Ku(){}function ec(){}function tc(){}var ic=function(){},rc={NEWLINE:{configurable:!0},SIMPLE_ORDINATE_FORMAT:{configurable:!0}};ic.prototype.interfaces_=function(){return[]},ic.prototype.getClass=function(){return ic},ic.chars=function(e,t){for(var i=new Array(t).fill(null),r=0;r<t;r++)i[r]=e;return String(i)},ic.getStackTrace=function(){if(1===arguments.length){var e=arguments[0],t=new Ku,i=new Xu(t);return e.printStackTrace(i),t.toString()}if(2===arguments.length){for(var r=arguments[0],n=arguments[1],a="",o=new Zu(ic.getStackTrace(r)),s=new tc(o),l=0;l<n;l++)try{a+=s.readLine()+ic.NEWLINE}catch(e){if(!(e instanceof ec))throw e;Ql.shouldNeverReachHere()}return a}},ic.split=function(e,t){for(var i=t.length,r=new vu,n=""+e,a=n.indexOf(t);0<=a;){var o=n.substring(0,a);r.add(o),a=(n=n.substring(a+i)).indexOf(t)}0<n.length&&r.add(n);for(var s=new Array(r.size()).fill(null),l=0;l<s.length;l++)s[l]=r.get(l);return s},ic.toString=function(){if(1===arguments.length){var e=arguments[0];return ic.SIMPLE_ORDINATE_FORMAT.format(e)}},ic.spaces=function(e){return ic.chars(" ",e)},rc.NEWLINE.get=function(){return Bl.getProperty("line.separator")},rc.SIMPLE_ORDINATE_FORMAT.get=function(){return new Ju("0.#")},Object.defineProperties(ic,rc);var nc=function(){};nc.prototype.interfaces_=function(){return[]},nc.prototype.getClass=function(){return nc},nc.copyCoord=function(e,t,i,r){for(var n=Math.min(e.getDimension(),i.getDimension()),a=0;a<n;a++)i.setOrdinate(r,a,e.getOrdinate(t,a))},nc.isRing=function(e){var t=e.size();return 0===t||!(t<=3)&&e.getOrdinate(0,Rl.X)===e.getOrdinate(t-1,Rl.X)&&e.getOrdinate(0,Rl.Y)===e.getOrdinate(t-1,Rl.Y)},nc.isEqual=function(e,t){var i=e.size();if(i!==t.size())return!1;for(var r=Math.min(e.getDimension(),t.getDimension()),n=0;n<i;n++)for(var a=0;a<r;a++){var o=e.getOrdinate(n,a),s=t.getOrdinate(n,a);if(!(e.getOrdinate(n,a)===t.getOrdinate(n,a)||dl.isNaN(o)&&dl.isNaN(s)))return!1}return!0},nc.extend=function(e,t,i){var r=e.create(i,t.getDimension()),n=t.size();if(nc.copy(t,0,r,0,n),0<n)for(var a=n;a<i;a++)nc.copy(t,n-1,r,a,1);return r},nc.reverse=function(e){for(var t=e.size()-1,i=Math.trunc(t/2),r=0;r<=i;r++)nc.swap(e,r,t-r)},nc.swap=function(e,t,i){if(t===i)return null;for(var r=0;r<e.getDimension();r++){var n=e.getOrdinate(t,r);e.setOrdinate(t,r,e.getOrdinate(i,r)),e.setOrdinate(i,r,n)}},nc.copy=function(e,t,i,r,n){for(var a=0;a<n;a++)nc.copyCoord(e,t+a,i,r+a)},nc.toString=function(){if(1===arguments.length){var e=arguments[0],t=e.size();if(0===t)return"()";var i=e.getDimension(),r=new El;r.append("(");for(var n=0;n<t;n++){0<n&&r.append(" ");for(var a=0;a<i;a++)0<a&&r.append(","),r.append(ic.toString(e.getOrdinate(n,a)))}return r.append(")"),r.toString()}},nc.ensureValidRing=function(e,t){var i=t.size();return 0===i?t:i<=3?nc.createClosedRing(e,t,4):t.getOrdinate(0,Rl.X)===t.getOrdinate(i-1,Rl.X)&&t.getOrdinate(0,Rl.Y)===t.getOrdinate(i-1,Rl.Y)?t:nc.createClosedRing(e,t,i+1)},nc.createClosedRing=function(e,t,i){var r=e.create(i,t.getDimension()),n=t.size();nc.copy(t,0,r,0,n);for(var a=n;a<i;a++)nc.copy(t,0,r,a,1);return r};var ac=function(n){function t(e,t){n.call(this,t),this._points=null,this.init(e)}n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype);var e={serialVersionUID:{configurable:!0}};return(t.prototype.constructor=t).prototype.computeEnvelopeInternal=function(){return this.isEmpty()?new Vl:this._points.expandEnvelope(new Vl)},t.prototype.isRing=function(){return this.isClosed()&&this.isSimple()},t.prototype.getSortIndex=function(){return n.SORTINDEX_LINESTRING},t.prototype.getCoordinates=function(){return this._points.toCoordinateArray()},t.prototype.equalsExact=function(){if(2!==arguments.length)return n.prototype.equalsExact.apply(this,arguments);var e=arguments[0],t=arguments[1];if(!this.isEquivalentClass(e))return!1;var i=e;if(this._points.size()!==i._points.size())return!1;for(var r=0;r<this._points.size();r++)if(!this.equal(this._points.getCoordinate(r),i._points.getCoordinate(r),t))return!1;return!0},t.prototype.normalize=function(){for(var e=0;e<Math.trunc(this._points.size()/2);e++){var t=this._points.size()-1-e;if(!this._points.getCoordinate(e).equals(this._points.getCoordinate(t)))return 0<this._points.getCoordinate(e).compareTo(this._points.getCoordinate(t))&&nc.reverse(this._points),null}},t.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},t.prototype.getBoundaryDimension=function(){return this.isClosed()?Gu.FALSE:0},t.prototype.isClosed=function(){return!this.isEmpty()&&this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))},t.prototype.getEndPoint=function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},t.prototype.getDimension=function(){return 1},t.prototype.getLength=function(){return eu.computeLength(this._points)},t.prototype.getNumPoints=function(){return this._points.size()},t.prototype.reverse=function(){var e=this._points.copy();return nc.reverse(e),this.getFactory().createLineString(e)},t.prototype.compareToSameClass=function(){if(1===arguments.length){for(var e=arguments[0],t=e,i=0,r=0;i<this._points.size()&&r<t._points.size();){var n=this._points.getCoordinate(i).compareTo(t._points.getCoordinate(r));if(0!==n)return n;i++,r++}return i<this._points.size()?1:r<t._points.size()?-1:0}if(2===arguments.length){var a=arguments[0],o=arguments[1],s=a;return o.compare(this._points,s._points)}},t.prototype.apply=function(){if(Al(arguments[0],ou))for(var e=arguments[0],t=0;t<this._points.size();t++)e.filter(this._points.getCoordinate(t));else if(Al(arguments[0],Wu)){var i=arguments[0];if(0===this._points.size())return null;for(var r=0;r<this._points.size()&&(i.filter(this._points,r),!i.isDone());r++);i.isGeometryChanged()&&this.geometryChanged()}else if(Al(arguments[0],Hu)){var n=arguments[0];n.filter(this)}else if(Al(arguments[0],iu)){var a=arguments[0];a.filter(this)}},t.prototype.getBoundary=function(){return new Qu(this).getBoundary()},t.prototype.isEquivalentClass=function(e){return e instanceof t},t.prototype.clone=function(){var e=n.prototype.clone.call(this);return e._points=this._points.clone(),e},t.prototype.getCoordinateN=function(e){return this._points.getCoordinate(e)},t.prototype.getGeometryType=function(){return"LineString"},t.prototype.copy=function(){return new t(this._points.copy(),this._factory)},t.prototype.getCoordinateSequence=function(){return this._points},t.prototype.isEmpty=function(){return 0===this._points.size()},t.prototype.init=function(e){if(null===e&&(e=this.getFactory().getCoordinateSequenceFactory().create([])),1===e.size())throw new cl("Invalid number of points in LineString (found "+e.size()+" - must be 0 or >= 2)");this._points=e},t.prototype.isCoordinate=function(e){for(var t=0;t<this._points.size();t++)if(this._points.getCoordinate(t).equals(e))return!0;return!1},t.prototype.getStartPoint=function(){return this.isEmpty()?null:this.getPointN(0)},t.prototype.getPointN=function(e){return this.getFactory().createPoint(this._points.getCoordinate(e))},t.prototype.interfaces_=function(){return[Bu]},t.prototype.getClass=function(){return t},e.serialVersionUID.get=function(){return 0x2b2b51ba435c8e00},Object.defineProperties(t,e),t}(ru),oc=function(){};oc.prototype.interfaces_=function(){return[]},oc.prototype.getClass=function(){return oc};var sc=function(i){function e(e,t){i.call(this,t),this._coordinates=e||null,this.init(this._coordinates)}i&&(e.__proto__=i),e.prototype=Object.create(i&&i.prototype);var t={serialVersionUID:{configurable:!0}};return(e.prototype.constructor=e).prototype.computeEnvelopeInternal=function(){if(this.isEmpty())return new Vl;var e=new Vl;return e.expandToInclude(this._coordinates.getX(0),this._coordinates.getY(0)),e},e.prototype.getSortIndex=function(){return i.SORTINDEX_POINT},e.prototype.getCoordinates=function(){return this.isEmpty()?[]:[this.getCoordinate()]},e.prototype.equalsExact=function(){if(2!==arguments.length)return i.prototype.equalsExact.apply(this,arguments);var e=arguments[0],t=arguments[1];return!!this.isEquivalentClass(e)&&(!(!this.isEmpty()||!e.isEmpty())||this.isEmpty()===e.isEmpty()&&this.equal(e.getCoordinate(),this.getCoordinate(),t))},e.prototype.normalize=function(){},e.prototype.getCoordinate=function(){return 0!==this._coordinates.size()?this._coordinates.getCoordinate(0):null},e.prototype.getBoundaryDimension=function(){return Gu.FALSE},e.prototype.getDimension=function(){return 0},e.prototype.getNumPoints=function(){return this.isEmpty()?0:1},e.prototype.reverse=function(){return this.copy()},e.prototype.getX=function(){if(null===this.getCoordinate())throw new Error("getX called on empty Point");return this.getCoordinate().x},e.prototype.compareToSameClass=function(){if(1===arguments.length){var e=arguments[0],t=e;return this.getCoordinate().compareTo(t.getCoordinate())}if(2===arguments.length){var i=arguments[0],r=arguments[1],n=i;return r.compare(this._coordinates,n._coordinates)}},e.prototype.apply=function(){if(Al(arguments[0],ou)){var e=arguments[0];if(this.isEmpty())return null;e.filter(this.getCoordinate())}else if(Al(arguments[0],Wu)){var t=arguments[0];if(this.isEmpty())return null;t.filter(this._coordinates,0),t.isGeometryChanged()&&this.geometryChanged()}else if(Al(arguments[0],Hu)){var i=arguments[0];i.filter(this)}else if(Al(arguments[0],iu)){var r=arguments[0];r.filter(this)}},e.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},e.prototype.clone=function(){var e=i.prototype.clone.call(this);return e._coordinates=this._coordinates.clone(),e},e.prototype.getGeometryType=function(){return"Point"},e.prototype.copy=function(){return new e(this._coordinates.copy(),this._factory)},e.prototype.getCoordinateSequence=function(){return this._coordinates},e.prototype.getY=function(){if(null===this.getCoordinate())throw new Error("getY called on empty Point");return this.getCoordinate().y},e.prototype.isEmpty=function(){return 0===this._coordinates.size()},e.prototype.init=function(e){null===e&&(e=this.getFactory().getCoordinateSequenceFactory().create([])),Ql.isTrue(e.size()<=1),this._coordinates=e},e.prototype.isSimple=function(){return!0},e.prototype.interfaces_=function(){return[oc]},e.prototype.getClass=function(){return e},t.serialVersionUID.get=function(){return 0x44077bad161cbc00},Object.defineProperties(e,t),e}(ru),lc=function(){};lc.prototype.interfaces_=function(){return[]},lc.prototype.getClass=function(){return lc};var uc=function(o){function r(e,t,i){if(o.call(this,i),this._shell=null,(this._holes=null)===e&&(e=this.getFactory().createLinearRing()),null===t&&(t=[]),o.hasNullElements(t))throw new cl("holes must not contain null elements");if(e.isEmpty()&&o.hasNonEmptyElements(t))throw new cl("shell is empty but holes are not");this._shell=e,this._holes=t}o&&(r.__proto__=o),r.prototype=Object.create(o&&o.prototype);var e={serialVersionUID:{configurable:!0}};return(r.prototype.constructor=r).prototype.computeEnvelopeInternal=function(){return this._shell.getEnvelopeInternal()},r.prototype.getSortIndex=function(){return o.SORTINDEX_POLYGON},r.prototype.getCoordinates=function(){if(this.isEmpty())return[];for(var e=new Array(this.getNumPoints()).fill(null),t=-1,i=this._shell.getCoordinates(),r=0;r<i.length;r++)e[++t]=i[r];for(var n=0;n<this._holes.length;n++)for(var a=this._holes[n].getCoordinates(),o=0;o<a.length;o++)e[++t]=a[o];return e},r.prototype.getArea=function(){var e=0;e+=Math.abs(eu.signedArea(this._shell.getCoordinateSequence()));for(var t=0;t<this._holes.length;t++)e-=Math.abs(eu.signedArea(this._holes[t].getCoordinateSequence()));return e},r.prototype.isRectangle=function(){if(0!==this.getNumInteriorRing())return!1;if(null===this._shell)return!1;if(5!==this._shell.getNumPoints())return!1;for(var e=this._shell.getCoordinateSequence(),t=this.getEnvelopeInternal(),i=0;i<5;i++){var r=e.getX(i);if(r!==t.getMinX()&&r!==t.getMaxX())return!1;var n=e.getY(i);if(n!==t.getMinY()&&n!==t.getMaxY())return!1}for(var a=e.getX(0),o=e.getY(0),s=1;s<=4;s++){var l=e.getX(s),u=e.getY(s);if(l!==a==(u!==o))return!1;a=l,o=u}return!0},r.prototype.equalsExact=function(){if(2!==arguments.length)return o.prototype.equalsExact.apply(this,arguments);var e=arguments[0],t=arguments[1];if(!this.isEquivalentClass(e))return!1;var i=e,r=this._shell,n=i._shell;if(!r.equalsExact(n,t))return!1;if(this._holes.length!==i._holes.length)return!1;for(var a=0;a<this._holes.length;a++)if(!this._holes[a].equalsExact(i._holes[a],t))return!1;return!0},r.prototype.normalize=function(){if(0===arguments.length){this.normalize(this._shell,!0);for(var e=0;e<this._holes.length;e++)this.normalize(this._holes[e],!1);Uu.sort(this._holes)}else if(2===arguments.length){var t=arguments[0],i=arguments[1];if(t.isEmpty())return null;var r=new Array(t.getCoordinates().length-1).fill(null);Bl.arraycopy(t.getCoordinates(),0,r,0,r.length);var n=xu.minCoordinate(t.getCoordinates());xu.scroll(r,n),Bl.arraycopy(r,0,t.getCoordinates(),0,r.length),t.getCoordinates()[r.length]=r[0],eu.isCCW(t.getCoordinates())===i&&xu.reverse(t.getCoordinates())}},r.prototype.getCoordinate=function(){return this._shell.getCoordinate()},r.prototype.getNumInteriorRing=function(){return this._holes.length},r.prototype.getBoundaryDimension=function(){return 1},r.prototype.getDimension=function(){return 2},r.prototype.getLength=function(){var e=0;e+=this._shell.getLength();for(var t=0;t<this._holes.length;t++)e+=this._holes[t].getLength();return e},r.prototype.getNumPoints=function(){for(var e=this._shell.getNumPoints(),t=0;t<this._holes.length;t++)e+=this._holes[t].getNumPoints();return e},r.prototype.reverse=function(){var e=this.copy();e._shell=this._shell.copy().reverse(),e._holes=new Array(this._holes.length).fill(null);for(var t=0;t<this._holes.length;t++)e._holes[t]=this._holes[t].copy().reverse();return e},r.prototype.convexHull=function(){return this.getExteriorRing().convexHull()},r.prototype.compareToSameClass=function(){if(1===arguments.length){var e=arguments[0],t=this._shell,i=e._shell;return t.compareToSameClass(i)}if(2===arguments.length){var r=arguments[0],n=arguments[1],a=r,o=this._shell,s=a._shell,l=o.compareToSameClass(s,n);if(0!==l)return l;for(var u=this.getNumInteriorRing(),c=a.getNumInteriorRing(),d=0;d<u&&d<c;){var h=this.getInteriorRingN(d),p=a.getInteriorRingN(d),f=h.compareToSameClass(p,n);if(0!==f)return f;d++}return d<u?1:d<c?-1:0}},r.prototype.apply=function(e){if(Al(e,ou)){this._shell.apply(e);for(var t=0;t<this._holes.length;t++)this._holes[t].apply(e)}else if(Al(e,Wu)){if(this._shell.apply(e),!e.isDone())for(var i=0;i<this._holes.length&&(this._holes[i].apply(e),!e.isDone());i++);e.isGeometryChanged()&&this.geometryChanged()}else if(Al(e,Hu))e.filter(this);else if(Al(e,iu)){e.filter(this),this._shell.apply(e);for(var r=0;r<this._holes.length;r++)this._holes[r].apply(e)}},r.prototype.getBoundary=function(){if(this.isEmpty())return this.getFactory().createMultiLineString();var e=new Array(this._holes.length+1).fill(null);e[0]=this._shell;for(var t=0;t<this._holes.length;t++)e[t+1]=this._holes[t];return e.length<=1?this.getFactory().createLinearRing(e[0].getCoordinateSequence()):this.getFactory().createMultiLineString(e)},r.prototype.clone=function(){var e=o.prototype.clone.call(this);e._shell=this._shell.clone(),e._holes=new Array(this._holes.length).fill(null);for(var t=0;t<this._holes.length;t++)e._holes[t]=this._holes[t].clone();return e},r.prototype.getGeometryType=function(){return"Polygon"},r.prototype.copy=function(){for(var e=this._shell.copy(),t=new Array(this._holes.length).fill(null),i=0;i<t.length;i++)t[i]=this._holes[i].copy();return new r(e,t,this._factory)},r.prototype.getExteriorRing=function(){return this._shell},r.prototype.isEmpty=function(){return this._shell.isEmpty()},r.prototype.getInteriorRingN=function(e){return this._holes[e]},r.prototype.interfaces_=function(){return[lc]},r.prototype.getClass=function(){return r},e.serialVersionUID.get=function(){return-0x307ffefd8dc97200},Object.defineProperties(r,e),r}(ru),cc=function(i){function r(){i.apply(this,arguments)}i&&(r.__proto__=i),r.prototype=Object.create(i&&i.prototype);var e={serialVersionUID:{configurable:!0}};return(r.prototype.constructor=r).prototype.getSortIndex=function(){return ru.SORTINDEX_MULTIPOINT},r.prototype.isValid=function(){return!0},r.prototype.equalsExact=function(){if(2!==arguments.length)return i.prototype.equalsExact.apply(this,arguments);var e=arguments[0],t=arguments[1];return!!this.isEquivalentClass(e)&&i.prototype.equalsExact.call(this,e,t)},r.prototype.getCoordinate=function(){if(1!==arguments.length)return i.prototype.getCoordinate.apply(this,arguments);var e=arguments[0];return this._geometries[e].getCoordinate()},r.prototype.getBoundaryDimension=function(){return Gu.FALSE},r.prototype.getDimension=function(){return 0},r.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},r.prototype.getGeometryType=function(){return"MultiPoint"},r.prototype.copy=function(){for(var e=new Array(this._geometries.length).fill(null),t=0;t<e.length;t++)e[t]=this._geometries[t].copy();return new r(e,this._factory)},r.prototype.interfaces_=function(){return[oc]},r.prototype.getClass=function(){return r},e.serialVersionUID.get=function(){return-0x6fb1ed4162e0fc00},Object.defineProperties(r,e),r}(ju),dc=function(i){function e(e,t){e instanceof yl&&t instanceof Tc&&(e=t.getCoordinateSequenceFactory().create(e)),i.call(this,e,t),this.validateConstruction()}i&&(e.__proto__=i),e.prototype=Object.create(i&&i.prototype);var t={MINIMUM_VALID_SIZE:{configurable:!0},serialVersionUID:{configurable:!0}};return(e.prototype.constructor=e).prototype.getSortIndex=function(){return ru.SORTINDEX_LINEARRING},e.prototype.getBoundaryDimension=function(){return Gu.FALSE},e.prototype.isClosed=function(){return!!this.isEmpty()||i.prototype.isClosed.call(this)},e.prototype.reverse=function(){var e=this._points.copy();return nc.reverse(e),this.getFactory().createLinearRing(e)},e.prototype.validateConstruction=function(){if(!this.isEmpty()&&!i.prototype.isClosed.call(this))throw new cl("Points of LinearRing do not form a closed linestring");if(1<=this.getCoordinateSequence().size()&&this.getCoordinateSequence().size()<e.MINIMUM_VALID_SIZE)throw new cl("Invalid number of points in LinearRing (found "+this.getCoordinateSequence().size()+" - must be 0 or >= 4)")},e.prototype.getGeometryType=function(){return"LinearRing"},e.prototype.copy=function(){return new e(this._points.copy(),this._factory)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},t.MINIMUM_VALID_SIZE.get=function(){return 4},t.serialVersionUID.get=function(){return-0x3b229e262367a600},Object.defineProperties(e,t),e}(ac),hc=function(i){function r(){i.apply(this,arguments)}i&&(r.__proto__=i),r.prototype=Object.create(i&&i.prototype);var e={serialVersionUID:{configurable:!0}};return(r.prototype.constructor=r).prototype.getSortIndex=function(){return ru.SORTINDEX_MULTIPOLYGON},r.prototype.equalsExact=function(){if(2!==arguments.length)return i.prototype.equalsExact.apply(this,arguments);var e=arguments[0],t=arguments[1];return!!this.isEquivalentClass(e)&&i.prototype.equalsExact.call(this,e,t)},r.prototype.getBoundaryDimension=function(){return 1},r.prototype.getDimension=function(){return 2},r.prototype.reverse=function(){for(var e=this._geometries.length,t=new Array(e).fill(null),i=0;i<this._geometries.length;i++)t[i]=this._geometries[i].reverse();return this.getFactory().createMultiPolygon(t)},r.prototype.getBoundary=function(){if(this.isEmpty())return this.getFactory().createMultiLineString();for(var e=new vu,t=0;t<this._geometries.length;t++)for(var i=this._geometries[t].getBoundary(),r=0;r<i.getNumGeometries();r++)e.add(i.getGeometryN(r));var n=new Array(e.size()).fill(null);return this.getFactory().createMultiLineString(e.toArray(n))},r.prototype.getGeometryType=function(){return"MultiPolygon"},r.prototype.copy=function(){for(var e=new Array(this._geometries.length).fill(null),t=0;t<e.length;t++)e[t]=this._geometries[t].copy();return new r(e,this._factory)},r.prototype.interfaces_=function(){return[lc]},r.prototype.getClass=function(){return r},e.serialVersionUID.get=function(){return-0x7a5aa1369171980},Object.defineProperties(r,e),r}(ju),pc=function(e){this._factory=e||null,this._isUserDataCopied=!1},fc={NoOpGeometryOperation:{configurable:!0},CoordinateOperation:{configurable:!0},CoordinateSequenceOperation:{configurable:!0}};pc.prototype.setCopyUserData=function(e){this._isUserDataCopied=e},pc.prototype.edit=function(e,t){if(null===e)return null;var i=this.editInternal(e,t);return this._isUserDataCopied&&i.setUserData(e.getUserData()),i},pc.prototype.editInternal=function(e,t){return null===this._factory&&(this._factory=e.getFactory()),e instanceof ju?this.editGeometryCollection(e,t):e instanceof uc?this.editPolygon(e,t):e instanceof sc||e instanceof ac?t.edit(e,this._factory):(Ql.shouldNeverReachHere("Unsupported Geometry class: "+e.getClass().getName()),null)},pc.prototype.editGeometryCollection=function(e,t){for(var i=t.edit(e,this._factory),r=new vu,n=0;n<i.getNumGeometries();n++){var a=this.edit(i.getGeometryN(n),t);null===a||a.isEmpty()||r.add(a)}return i.getClass()===cc?this._factory.createMultiPoint(r.toArray([])):i.getClass()===qu?this._factory.createMultiLineString(r.toArray([])):i.getClass()===hc?this._factory.createMultiPolygon(r.toArray([])):this._factory.createGeometryCollection(r.toArray([]))},pc.prototype.editPolygon=function(e,t){var i=t.edit(e,this._factory);if(null===i&&(i=this._factory.createPolygon(null)),i.isEmpty())return i;var r=this.edit(i.getExteriorRing(),t);if(null===r||r.isEmpty())return this._factory.createPolygon();for(var n=new vu,a=0;a<i.getNumInteriorRing();a++){var o=this.edit(i.getInteriorRingN(a),t);null===o||o.isEmpty()||n.add(o)}return this._factory.createPolygon(r,n.toArray([]))},pc.prototype.interfaces_=function(){return[]},pc.prototype.getClass=function(){return pc},pc.GeometryEditorOperation=function(){},fc.NoOpGeometryOperation.get=function(){return mc},fc.CoordinateOperation.get=function(){return gc},fc.CoordinateSequenceOperation.get=function(){return yc},Object.defineProperties(pc,fc);var mc=function(){};mc.prototype.edit=function(e,t){return e},mc.prototype.interfaces_=function(){return[pc.GeometryEditorOperation]},mc.prototype.getClass=function(){return mc};var gc=function(){};gc.prototype.edit=function(e,t){var i=this.editCoordinates(e.getCoordinates(),e);return null===i?e:e instanceof dc?t.createLinearRing(i):e instanceof ac?t.createLineString(i):e instanceof sc?0<i.length?t.createPoint(i[0]):t.createPoint():e},gc.prototype.interfaces_=function(){return[pc.GeometryEditorOperation]},gc.prototype.getClass=function(){return gc};var yc=function(){};yc.prototype.edit=function(e,t){return e instanceof dc?t.createLinearRing(this.edit(e.getCoordinateSequence(),e)):e instanceof ac?t.createLineString(this.edit(e.getCoordinateSequence(),e)):e instanceof sc?t.createPoint(this.edit(e.getCoordinateSequence(),e)):e},yc.prototype.interfaces_=function(){return[pc.GeometryEditorOperation]},yc.prototype.getClass=function(){return yc};var vc=function(){if(this._dimension=3,this._coordinates=null,1===arguments.length){if(arguments[0]instanceof Array)this._coordinates=arguments[0],this._dimension=3;else if(Number.isInteger(arguments[0])){var e=arguments[0];this._coordinates=new Array(e).fill(null);for(var t=0;t<e;t++)this._coordinates[t]=new yl}else if(Al(arguments[0],Rl)){var i=arguments[0];if(null===i)return this._coordinates=new Array(0).fill(null),null;this._dimension=i.getDimension(),this._coordinates=new Array(i.size()).fill(null);for(var r=0;r<this._coordinates.length;r++)this._coordinates[r]=i.getCoordinateCopy(r)}}else if(2===arguments.length)if(arguments[0]instanceof Array&&Number.isInteger(arguments[1])){var n=arguments[0],a=arguments[1];this._coordinates=n,this._dimension=a,null===n&&(this._coordinates=new Array(0).fill(null))}else if(Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var o=arguments[0],s=arguments[1];this._coordinates=new Array(o).fill(null),this._dimension=s;for(var l=0;l<o;l++)this._coordinates[l]=new yl}},_c={serialVersionUID:{configurable:!0}};vc.prototype.setOrdinate=function(e,t,i){switch(t){case Rl.X:this._coordinates[e].x=i;break;case Rl.Y:this._coordinates[e].y=i;break;case Rl.Z:this._coordinates[e].z=i;break;default:throw new cl("invalid ordinateIndex")}},vc.prototype.size=function(){return this._coordinates.length},vc.prototype.getOrdinate=function(e,t){switch(t){case Rl.X:return this._coordinates[e].x;case Rl.Y:return this._coordinates[e].y;case Rl.Z:return this._coordinates[e].z}return dl.NaN},vc.prototype.getCoordinate=function(){if(1===arguments.length){var e=arguments[0];return this._coordinates[e]}if(2===arguments.length){var t=arguments[0],i=arguments[1];i.x=this._coordinates[t].x,i.y=this._coordinates[t].y,i.z=this._coordinates[t].z}},vc.prototype.getCoordinateCopy=function(e){return new yl(this._coordinates[e])},vc.prototype.getDimension=function(){return this._dimension},vc.prototype.getX=function(e){return this._coordinates[e].x},vc.prototype.clone=function(){for(var e=new Array(this.size()).fill(null),t=0;t<this._coordinates.length;t++)e[t]=this._coordinates[t].clone();return new vc(e,this._dimension)},vc.prototype.expandEnvelope=function(e){for(var t=0;t<this._coordinates.length;t++)e.expandToInclude(this._coordinates[t]);return e},vc.prototype.copy=function(){for(var e=new Array(this.size()).fill(null),t=0;t<this._coordinates.length;t++)e[t]=this._coordinates[t].copy();return new vc(e,this._dimension)},vc.prototype.toString=function(){if(0<this._coordinates.length){var e=new El(17*this._coordinates.length);e.append("("),e.append(this._coordinates[0]);for(var t=1;t<this._coordinates.length;t++)e.append(", "),e.append(this._coordinates[t]);return e.append(")"),e.toString()}return"()"},vc.prototype.getY=function(e){return this._coordinates[e].y},vc.prototype.toCoordinateArray=function(){return this._coordinates},vc.prototype.interfaces_=function(){return[Rl,gl]},vc.prototype.getClass=function(){return vc},_c.serialVersionUID.get=function(){return-0xcb44a778db18e00},Object.defineProperties(vc,_c);var Cc=function(){},xc={serialVersionUID:{configurable:!0},instanceObject:{configurable:!0}};Cc.prototype.readResolve=function(){return Cc.instance()},Cc.prototype.create=function(){if(1===arguments.length){if(arguments[0]instanceof Array){var e=arguments[0];return new vc(e)}if(Al(arguments[0],Rl)){var t=arguments[0];return new vc(t)}}else if(2===arguments.length){var i=arguments[0],r=arguments[1];return 3<r&&(r=3),r<2?new vc(i):new vc(i,r)}},Cc.prototype.interfaces_=function(){return[Cl,gl]},Cc.prototype.getClass=function(){return Cc},Cc.instance=function(){return Cc.instanceObject},xc.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00},xc.instanceObject.get=function(){return new Cc},Object.defineProperties(Cc,xc);var bc=function(e){function t(){e.call(this),this.map_=new Map}return e&&(t.__proto__=e),((t.prototype=Object.create(e&&e.prototype)).constructor=t).prototype.get=function(e){return this.map_.get(e)||null},t.prototype.put=function(e,t){return this.map_.set(e,t),t},t.prototype.values=function(){for(var e=new vu,t=this.map_.values(),i=t.next();!i.done;)e.add(i.value),i=t.next();return e},t.prototype.entrySet=function(){var t=new Mu;return this.map_.entries().forEach(function(e){return t.add(e)}),t},t.prototype.size=function(){return this.map_.size()},t}(wu),Ac=function e(){if(this._modelType=null,this._scale=null,0===arguments.length)this._modelType=e.FLOATING;else if(1===arguments.length)if(arguments[0]instanceof wc){var t=arguments[0];(this._modelType=t)===e.FIXED&&this.setScale(1)}else if("number"==typeof arguments[0]){var i=arguments[0];this._modelType=e.FIXED,this.setScale(i)}else if(arguments[0]instanceof e){var r=arguments[0];this._modelType=r._modelType,this._scale=r._scale}},Sc={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};Ac.prototype.equals=function(e){if(!(e instanceof Ac))return!1;var t=e;return this._modelType===t._modelType&&this._scale===t._scale},Ac.prototype.compareTo=function(e){var t=e,i=this.getMaximumSignificantDigits(),r=t.getMaximumSignificantDigits();return new Tl(i).compareTo(new Tl(r))},Ac.prototype.getScale=function(){return this._scale},Ac.prototype.isFloating=function(){return this._modelType===Ac.FLOATING||this._modelType===Ac.FLOATING_SINGLE},Ac.prototype.getType=function(){return this._modelType},Ac.prototype.toString=function(){var e="UNKNOWN";return this._modelType===Ac.FLOATING?e="Floating":this._modelType===Ac.FLOATING_SINGLE?e="Floating-Single":this._modelType===Ac.FIXED&&(e="Fixed (Scale="+this.getScale()+")"),e},Ac.prototype.makePrecise=function(){if("number"==typeof arguments[0]){var e=arguments[0];return dl.isNaN(e)?e:this._modelType===Ac.FLOATING_SINGLE?e:this._modelType===Ac.FIXED?Math.round(e*this._scale)/this._scale:e}if(arguments[0]instanceof yl){var t=arguments[0];if(this._modelType===Ac.FLOATING)return null;t.x=this.makePrecise(t.x),t.y=this.makePrecise(t.y)}},Ac.prototype.getMaximumSignificantDigits=function(){var e=16;return this._modelType===Ac.FLOATING?e=16:this._modelType===Ac.FLOATING_SINGLE?e=6:this._modelType===Ac.FIXED&&(e=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),e},Ac.prototype.setScale=function(e){this._scale=Math.abs(e)},Ac.prototype.interfaces_=function(){return[gl,pl]},Ac.prototype.getClass=function(){return Ac},Ac.mostPrecise=function(e,t){return 0<=e.compareTo(t)?e:t},Sc.serialVersionUID.get=function(){return 0x6bee6404e9a25c00},Sc.maximumPreciseValue.get=function(){return 9007199254740992},Object.defineProperties(Ac,Sc);var wc=function e(t){this._name=t||null,e.nameToTypeMap.put(t,this)},Ec={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};wc.prototype.readResolve=function(){return wc.nameToTypeMap.get(this._name)},wc.prototype.toString=function(){return this._name},wc.prototype.interfaces_=function(){return[gl]},wc.prototype.getClass=function(){return wc},Ec.serialVersionUID.get=function(){return-552860263173159e4},Ec.nameToTypeMap.get=function(){return new bc},Object.defineProperties(wc,Ec),Ac.Type=wc,Ac.FIXED=new wc("FIXED"),Ac.FLOATING=new wc("FLOATING"),Ac.FLOATING_SINGLE=new wc("FLOATING SINGLE");var Tc=function e(){this._precisionModel=new Ac,this._SRID=0,this._coordinateSequenceFactory=e.getDefaultCoordinateSequenceFactory(),0===arguments.length||(1===arguments.length?Al(arguments[0],Cl)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof Ac&&(this._precisionModel=arguments[0]):2===arguments.length?(this._precisionModel=arguments[0],this._SRID=arguments[1]):3===arguments.length&&(this._precisionModel=arguments[0],this._SRID=arguments[1],this._coordinateSequenceFactory=arguments[2]))},Pc={serialVersionUID:{configurable:!0}};Tc.prototype.toGeometry=function(e){return e.isNull()?this.createPoint(null):e.getMinX()===e.getMaxX()&&e.getMinY()===e.getMaxY()?this.createPoint(new yl(e.getMinX(),e.getMinY())):e.getMinX()===e.getMaxX()||e.getMinY()===e.getMaxY()?this.createLineString([new yl(e.getMinX(),e.getMinY()),new yl(e.getMaxX(),e.getMaxY())]):this.createPolygon(this.createLinearRing([new yl(e.getMinX(),e.getMinY()),new yl(e.getMinX(),e.getMaxY()),new yl(e.getMaxX(),e.getMaxY()),new yl(e.getMaxX(),e.getMinY()),new yl(e.getMinX(),e.getMinY())]),null)},Tc.prototype.createLineString=function(e){return e?e instanceof Array?new ac(this.getCoordinateSequenceFactory().create(e),this):Al(e,Rl)?new ac(e,this):void 0:new ac(this.getCoordinateSequenceFactory().create([]),this)},Tc.prototype.createMultiLineString=function(){if(0===arguments.length)return new qu(null,this);if(1===arguments.length){var e=arguments[0];return new qu(e,this)}},Tc.prototype.buildGeometry=function(e){for(var t=null,i=!1,r=!1,n=e.iterator();n.hasNext();){var a=n.next(),o=a.getClass();null===t&&(t=o),o!==t&&(i=!0),a.isGeometryCollectionOrDerived()&&(r=!0)}if(null===t)return this.createGeometryCollection();if(i||r)return this.createGeometryCollection(Tc.toGeometryArray(e));var s=e.iterator().next();if(1<e.size()){if(s instanceof uc)return this.createMultiPolygon(Tc.toPolygonArray(e));if(s instanceof ac)return this.createMultiLineString(Tc.toLineStringArray(e));if(s instanceof sc)return this.createMultiPoint(Tc.toPointArray(e));Ql.shouldNeverReachHere("Unhandled class: "+s.getClass().getName())}return s},Tc.prototype.createMultiPointFromCoords=function(e){return this.createMultiPoint(null!==e?this.getCoordinateSequenceFactory().create(e):null)},Tc.prototype.createPoint=function(){if(0===arguments.length)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof yl){var e=arguments[0];return this.createPoint(null!==e?this.getCoordinateSequenceFactory().create([e]):null)}if(Al(arguments[0],Rl)){var t=arguments[0];return new sc(t,this)}}},Tc.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory},Tc.prototype.createPolygon=function(){if(0===arguments.length)return new uc(null,null,this);if(1===arguments.length){if(Al(arguments[0],Rl)){var e=arguments[0];return this.createPolygon(this.createLinearRing(e))}if(arguments[0]instanceof Array){var t=arguments[0];return this.createPolygon(this.createLinearRing(t))}if(arguments[0]instanceof dc){var i=arguments[0];return this.createPolygon(i,null)}}else if(2===arguments.length){var r=arguments[0],n=arguments[1];return new uc(r,n,this)}},Tc.prototype.getSRID=function(){return this._SRID},Tc.prototype.createGeometryCollection=function(){if(0===arguments.length)return new ju(null,this);if(1===arguments.length){var e=arguments[0];return new ju(e,this)}},Tc.prototype.createGeometry=function(e){return new pc(this).edit(e,{edit:function(){if(2===arguments.length){var e=arguments[0];return this._coordinateSequenceFactory.create(e)}}})},Tc.prototype.getPrecisionModel=function(){return this._precisionModel},Tc.prototype.createLinearRing=function(){if(0===arguments.length)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof Array){var e=arguments[0];return this.createLinearRing(null!==e?this.getCoordinateSequenceFactory().create(e):null)}if(Al(arguments[0],Rl)){var t=arguments[0];return new dc(t,this)}}},Tc.prototype.createMultiPolygon=function(){if(0===arguments.length)return new hc(null,this);if(1===arguments.length){var e=arguments[0];return new hc(e,this)}},Tc.prototype.createMultiPoint=function(){if(0===arguments.length)return new cc(null,this);if(1===arguments.length){if(arguments[0]instanceof Array){var e=arguments[0];return new cc(e,this)}if(arguments[0]instanceof Array){var t=arguments[0];return this.createMultiPoint(null!==t?this.getCoordinateSequenceFactory().create(t):null)}if(Al(arguments[0],Rl)){var i=arguments[0];if(null===i)return this.createMultiPoint(new Array(0).fill(null));for(var r=new Array(i.size()).fill(null),n=0;n<i.size();n++){var a=this.getCoordinateSequenceFactory().create(1,i.getDimension());nc.copy(i,n,a,0,1),r[n]=this.createPoint(a)}return this.createMultiPoint(r)}}},Tc.prototype.interfaces_=function(){return[gl]},Tc.prototype.getClass=function(){return Tc},Tc.toMultiPolygonArray=function(e){var t=new Array(e.size()).fill(null);return e.toArray(t)},Tc.toGeometryArray=function(e){if(null===e)return null;var t=new Array(e.size()).fill(null);return e.toArray(t)},Tc.getDefaultCoordinateSequenceFactory=function(){return Cc.instance()},Tc.toMultiLineStringArray=function(e){var t=new Array(e.size()).fill(null);return e.toArray(t)},Tc.toLineStringArray=function(e){var t=new Array(e.size()).fill(null);return e.toArray(t)},Tc.toMultiPointArray=function(e){var t=new Array(e.size()).fill(null);return e.toArray(t)},Tc.toLinearRingArray=function(e){var t=new Array(e.size()).fill(null);return e.toArray(t)},Tc.toPointArray=function(e){var t=new Array(e.size()).fill(null);return e.toArray(t)},Tc.toPolygonArray=function(e){var t=new Array(e.size()).fill(null);return e.toArray(t)},Tc.createPointFromInternalCoord=function(e,t){return t.getPrecisionModel().makePrecise(e),t.getFactory().createPoint(e)},Pc.serialVersionUID.get=function(){return-0x5ea75f2051eeb400},Object.defineProperties(Tc,Pc);var Mc=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],Dc=function(e){this.geometryFactory=e||new Tc};Dc.prototype.read=function(e){var t,i=(t="string"==typeof e?JSON.parse(e):e).type;if(!Ic[i])throw new Error("Unknown GeoJSON type: "+t.type);return-1!==Mc.indexOf(i)?Ic[i].apply(this,[t.coordinates]):"GeometryCollection"===i?Ic[i].apply(this,[t.geometries]):Ic[i].apply(this,[t])},Dc.prototype.write=function(e){var t=e.getGeometryType();if(!Oc[t])throw new Error("Geometry is not supported");return Oc[t].apply(this,[e])};var Ic={Feature:function(e){var t={};for(var i in e)t[i]=e[i];if(e.geometry){var r=e.geometry.type;if(!Ic[r])throw new Error("Unknown GeoJSON type: "+e.type);t.geometry=this.read(e.geometry)}return e.bbox&&(t.bbox=Ic.bbox.apply(this,[e.bbox])),t},FeatureCollection:function(e){var t={};if(e.features){t.features=[];for(var i=0;i<e.features.length;++i)t.features.push(this.read(e.features[i]))}return e.bbox&&(t.bbox=this.parse.bbox.apply(this,[e.bbox])),t},coordinates:function(e){for(var t=[],i=0;i<e.length;++i){var r=e[i];t.push(new yl(r[0],r[1]))}return t},bbox:function(e){return this.geometryFactory.createLinearRing([new yl(e[0],e[1]),new yl(e[2],e[1]),new yl(e[2],e[3]),new yl(e[0],e[3]),new yl(e[0],e[1])])},Point:function(e){var t=new yl(e[0],e[1]);return this.geometryFactory.createPoint(t)},MultiPoint:function(e){for(var t=[],i=0;i<e.length;++i)t.push(Ic.Point.apply(this,[e[i]]));return this.geometryFactory.createMultiPoint(t)},LineString:function(e){var t=Ic.coordinates.apply(this,[e]);return this.geometryFactory.createLineString(t)},MultiLineString:function(e){for(var t=[],i=0;i<e.length;++i)t.push(Ic.LineString.apply(this,[e[i]]));return this.geometryFactory.createMultiLineString(t)},Polygon:function(e){for(var t=Ic.coordinates.apply(this,[e[0]]),i=this.geometryFactory.createLinearRing(t),r=[],n=1;n<e.length;++n){var a=e[n],o=Ic.coordinates.apply(this,[a]),s=this.geometryFactory.createLinearRing(o);r.push(s)}return this.geometryFactory.createPolygon(i,r)},MultiPolygon:function(e){for(var t=[],i=0;i<e.length;++i){var r=e[i];t.push(Ic.Polygon.apply(this,[r]))}return this.geometryFactory.createMultiPolygon(t)},GeometryCollection:function(e){for(var t=[],i=0;i<e.length;++i){var r=e[i];t.push(this.read(r))}return this.geometryFactory.createGeometryCollection(t)}},Oc={coordinate:function(e){return[e.x,e.y]},Point:function(e){return{type:"Point",coordinates:Oc.coordinate.apply(this,[e.getCoordinate()])}},MultiPoint:function(e){for(var t=[],i=0;i<e._geometries.length;++i){var r=e._geometries[i],n=Oc.Point.apply(this,[r]);t.push(n.coordinates)}return{type:"MultiPoint",coordinates:t}},LineString:function(e){for(var t=[],i=e.getCoordinates(),r=0;r<i.length;++r){var n=i[r];t.push(Oc.coordinate.apply(this,[n]))}return{type:"LineString",coordinates:t}},MultiLineString:function(e){for(var t=[],i=0;i<e._geometries.length;++i){var r=e._geometries[i],n=Oc.LineString.apply(this,[r]);t.push(n.coordinates)}return{type:"MultiLineString",coordinates:t}},Polygon:function(e){var t=[],i=Oc.LineString.apply(this,[e._shell]);t.push(i.coordinates);for(var r=0;r<e._holes.length;++r){var n=e._holes[r],a=Oc.LineString.apply(this,[n]);t.push(a.coordinates)}return{type:"Polygon",coordinates:t}},MultiPolygon:function(e){for(var t=[],i=0;i<e._geometries.length;++i){var r=e._geometries[i],n=Oc.Polygon.apply(this,[r]);t.push(n.coordinates)}return{type:"MultiPolygon",coordinates:t}},GeometryCollection:function(e){for(var t=[],i=0;i<e._geometries.length;++i){var r=e._geometries[i],n=r.getGeometryType();t.push(Oc[n].apply(this,[r]))}return{type:"GeometryCollection",geometries:t}}},Rc=function(e){this.geometryFactory=e||new Tc,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new Dc(this.geometryFactory)};Rc.prototype.read=function(e){var t=this.parser.read(e);return this.precisionModel.getType()===Ac.FIXED&&this.reducePrecision(t),t},Rc.prototype.reducePrecision=function(e){var t,i;if(e.coordinate)this.precisionModel.makePrecise(e.coordinate);else if(e.points)for(t=0,i=e.points.length;t<i;t++)this.precisionModel.makePrecise(e.points[t]);else if(e.geometries)for(t=0,i=e.geometries.length;t<i;t++)this.reducePrecision(e.geometries[t])};var Lc=function(){this.parser=new Dc(this.geometryFactory)};Lc.prototype.write=function(e){return this.parser.write(e)};var Nc=function(){},kc={ON:{configurable:!0},LEFT:{configurable:!0},RIGHT:{configurable:!0}};function Bc(e){this.message=e||""}function Fc(){this.array_=[]}Nc.prototype.interfaces_=function(){return[]},Nc.prototype.getClass=function(){return Nc},Nc.opposite=function(e){return e===Nc.LEFT?Nc.RIGHT:e===Nc.RIGHT?Nc.LEFT:e},kc.ON.get=function(){return 0},kc.LEFT.get=function(){return 1},kc.RIGHT.get=function(){return 2},Object.defineProperties(Nc,kc),(Bc.prototype=new Error).name="EmptyStackException",(Fc.prototype=new gu).add=function(e){return this.array_.push(e),!0},Fc.prototype.get=function(e){if(e<0||e>=this.size())throw new Error;return this.array_[e]},Fc.prototype.push=function(e){return this.array_.push(e),e},Fc.prototype.pop=function(e){if(0===this.array_.length)throw new Bc;return this.array_.pop()},Fc.prototype.peek=function(){if(0===this.array_.length)throw new Bc;return this.array_[this.array_.length-1]},Fc.prototype.empty=function(){return 0===this.array_.length},Fc.prototype.isEmpty=function(){return this.empty()},Fc.prototype.search=function(e){return this.array_.indexOf(e)},Fc.prototype.size=function(){return this.array_.length},Fc.prototype.toArray=function(){for(var e=[],t=0,i=this.array_.length;t<i;t++)e.push(this.array_[t]);return e};var Vc=function(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null};Vc.prototype.getCoordinate=function(){return this._minCoord},Vc.prototype.getRightmostSide=function(e,t){var i=this.getRightmostSideOfSegment(e,t);return i<0&&(i=this.getRightmostSideOfSegment(e,t-1)),i<0&&(this._minCoord=null,this.checkForRightmostCoordinate(e)),i},Vc.prototype.findRightmostEdgeAtVertex=function(){var e=this._minDe.getEdge().getCoordinates();Ql.isTrue(0<this._minIndex&&this._minIndex<e.length,"rightmost point expected to be interior vertex of edge");var t=e[this._minIndex-1],i=e[this._minIndex+1],r=eu.computeOrientation(this._minCoord,i,t),n=!1;(t.y<this._minCoord.y&&i.y<this._minCoord.y&&r===eu.COUNTERCLOCKWISE||t.y>this._minCoord.y&&i.y>this._minCoord.y&&r===eu.CLOCKWISE)&&(n=!0),n&&(this._minIndex=this._minIndex-1)},Vc.prototype.getRightmostSideOfSegment=function(e,t){var i=e.getEdge().getCoordinates();if(t<0||t+1>=i.length)return-1;if(i[t].y===i[t+1].y)return-1;var r=Nc.LEFT;return i[t].y<i[t+1].y&&(r=Nc.RIGHT),r},Vc.prototype.getEdge=function(){return this._orientedDe},Vc.prototype.checkForRightmostCoordinate=function(e){for(var t=e.getEdge().getCoordinates(),i=0;i<t.length-1;i++)(null===this._minCoord||t[i].x>this._minCoord.x)&&(this._minDe=e,this._minIndex=i,this._minCoord=t[i])},Vc.prototype.findRightmostEdgeAtNode=function(){var e=this._minDe.getNode().getEdges();this._minDe=e.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)},Vc.prototype.findEdge=function(e){for(var t=e.iterator();t.hasNext();){var i=t.next();i.isForward()&&this.checkForRightmostCoordinate(i)}Ql.isTrue(0!==this._minIndex||this._minCoord.equals(this._minDe.getCoordinate()),"inconsistency in rightmost processing"),0===this._minIndex?this.findRightmostEdgeAtNode():this.findRightmostEdgeAtVertex(),this._orientedDe=this._minDe,this.getRightmostSide(this._minDe,this._minIndex)===Nc.LEFT&&(this._orientedDe=this._minDe.getSym())},Vc.prototype.interfaces_=function(){return[]},Vc.prototype.getClass=function(){return Vc};var zc=function(i){function r(e,t){i.call(this,r.msgWithCoord(e,t)),this.pt=t?new yl(t):null,this.name="TopologyException"}return i&&(r.__proto__=i),((r.prototype=Object.create(i&&i.prototype)).constructor=r).prototype.getCoordinate=function(){return this.pt},r.prototype.interfaces_=function(){return[]},r.prototype.getClass=function(){return r},r.msgWithCoord=function(e,t){return t?e:e+" [ "+t+" ]"},r}(jl),Uc=function(){this.array_=[]};Uc.prototype.addLast=function(e){this.array_.push(e)},Uc.prototype.removeFirst=function(){return this.array_.shift()},Uc.prototype.isEmpty=function(){return 0===this.array_.length};var Gc=function(){this._finder=null,this._dirEdgeList=new vu,this._nodes=new vu,this._rightMostCoord=null,this._env=null,this._finder=new Vc};Gc.prototype.clearVisitedEdges=function(){for(var e=this._dirEdgeList.iterator();e.hasNext();)e.next().setVisited(!1)},Gc.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},Gc.prototype.computeNodeDepth=function(e){for(var t=null,i=e.getEdges().iterator();i.hasNext();){var r=i.next();if(r.isVisited()||r.getSym().isVisited()){t=r;break}}if(null===t)throw new zc("unable to find edge to compute depths at "+e.getCoordinate());e.getEdges().computeDepths(t);for(var n=e.getEdges().iterator();n.hasNext();){var a=n.next();a.setVisited(!0),this.copySymDepths(a)}},Gc.prototype.computeDepth=function(e){this.clearVisitedEdges();var t=this._finder.getEdge();t.setEdgeDepths(Nc.RIGHT,e),this.copySymDepths(t),this.computeDepths(t)},Gc.prototype.create=function(e){this.addReachable(e),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},Gc.prototype.findResultEdges=function(){for(var e=this._dirEdgeList.iterator();e.hasNext();){var t=e.next();1<=t.getDepth(Nc.RIGHT)&&t.getDepth(Nc.LEFT)<=0&&!t.isInteriorAreaEdge()&&t.setInResult(!0)}},Gc.prototype.computeDepths=function(e){var t=new Mu,i=new Uc,r=e.getNode();for(i.addLast(r),t.add(r),e.setVisited(!0);!i.isEmpty();){var n=i.removeFirst();t.add(n),this.computeNodeDepth(n);for(var a=n.getEdges().iterator();a.hasNext();){var o=a.next().getSym();if(!o.isVisited()){var s=o.getNode();t.contains(s)||(i.addLast(s),t.add(s))}}}},Gc.prototype.compareTo=function(e){var t=e;return this._rightMostCoord.x<t._rightMostCoord.x?-1:this._rightMostCoord.x>t._rightMostCoord.x?1:0},Gc.prototype.getEnvelope=function(){if(null===this._env){for(var e=new Vl,t=this._dirEdgeList.iterator();t.hasNext();)for(var i=t.next().getEdge().getCoordinates(),r=0;r<i.length-1;r++)e.expandToInclude(i[r]);this._env=e}return this._env},Gc.prototype.addReachable=function(e){var t=new Fc;for(t.add(e);!t.empty();){var i=t.pop();this.add(i,t)}},Gc.prototype.copySymDepths=function(e){var t=e.getSym();t.setDepth(Nc.LEFT,e.getDepth(Nc.RIGHT)),t.setDepth(Nc.RIGHT,e.getDepth(Nc.LEFT))},Gc.prototype.add=function(e,t){e.setVisited(!0),this._nodes.add(e);for(var i=e.getEdges().iterator();i.hasNext();){var r=i.next();this._dirEdgeList.add(r);var n=r.getSym().getNode();n.isVisited()||t.push(n)}},Gc.prototype.getNodes=function(){return this._nodes},Gc.prototype.getDirectedEdges=function(){return this._dirEdgeList},Gc.prototype.interfaces_=function(){return[pl]},Gc.prototype.getClass=function(){return Gc};var $c=function e(){if(this.location=null,1===arguments.length){if(arguments[0]instanceof Array){var t=arguments[0];this.init(t.length)}else if(Number.isInteger(arguments[0])){var i=arguments[0];this.init(1),this.location[Nc.ON]=i}else if(arguments[0]instanceof e){var r=arguments[0];if(this.init(r.location.length),null!==r)for(var n=0;n<this.location.length;n++)this.location[n]=r.location[n]}}else if(3===arguments.length){var a=arguments[0],o=arguments[1],s=arguments[2];this.init(3),this.location[Nc.ON]=a,this.location[Nc.LEFT]=o,this.location[Nc.RIGHT]=s}};$c.prototype.setAllLocations=function(e){for(var t=0;t<this.location.length;t++)this.location[t]=e},$c.prototype.isNull=function(){for(var e=0;e<this.location.length;e++)if(this.location[e]!==xl.NONE)return!1;return!0},$c.prototype.setAllLocationsIfNull=function(e){for(var t=0;t<this.location.length;t++)this.location[t]===xl.NONE&&(this.location[t]=e)},$c.prototype.isLine=function(){return 1===this.location.length},$c.prototype.merge=function(e){if(e.location.length>this.location.length){var t=new Array(3).fill(null);t[Nc.ON]=this.location[Nc.ON],t[Nc.LEFT]=xl.NONE,t[Nc.RIGHT]=xl.NONE,this.location=t}for(var i=0;i<this.location.length;i++)this.location[i]===xl.NONE&&i<e.location.length&&(this.location[i]=e.location[i])},$c.prototype.getLocations=function(){return this.location},$c.prototype.flip=function(){if(this.location.length<=1)return null;var e=this.location[Nc.LEFT];this.location[Nc.LEFT]=this.location[Nc.RIGHT],this.location[Nc.RIGHT]=e},$c.prototype.toString=function(){var e=new El;return 1<this.location.length&&e.append(xl.toLocationSymbol(this.location[Nc.LEFT])),e.append(xl.toLocationSymbol(this.location[Nc.ON])),1<this.location.length&&e.append(xl.toLocationSymbol(this.location[Nc.RIGHT])),e.toString()},$c.prototype.setLocations=function(e,t,i){this.location[Nc.ON]=e,this.location[Nc.LEFT]=t,this.location[Nc.RIGHT]=i},$c.prototype.get=function(e){return e<this.location.length?this.location[e]:xl.NONE},$c.prototype.isArea=function(){return 1<this.location.length},$c.prototype.isAnyNull=function(){for(var e=0;e<this.location.length;e++)if(this.location[e]===xl.NONE)return!0;return!1},$c.prototype.setLocation=function(){if(1===arguments.length){var e=arguments[0];this.setLocation(Nc.ON,e)}else if(2===arguments.length){var t=arguments[0],i=arguments[1];this.location[t]=i}},$c.prototype.init=function(e){this.location=new Array(e).fill(null),this.setAllLocations(xl.NONE)},$c.prototype.isEqualOnSide=function(e,t){return this.location[t]===e.location[t]},$c.prototype.allPositionsEqual=function(e){for(var t=0;t<this.location.length;t++)if(this.location[t]!==e)return!1;return!0},$c.prototype.interfaces_=function(){return[]},$c.prototype.getClass=function(){return $c};var Hc=function e(){if(this.elt=new Array(2).fill(null),1===arguments.length){if(Number.isInteger(arguments[0])){var t=arguments[0];this.elt[0]=new $c(t),this.elt[1]=new $c(t)}else if(arguments[0]instanceof e){var i=arguments[0];this.elt[0]=new $c(i.elt[0]),this.elt[1]=new $c(i.elt[1])}}else if(2===arguments.length){var r=arguments[0],n=arguments[1];this.elt[0]=new $c(xl.NONE),this.elt[1]=new $c(xl.NONE),this.elt[r].setLocation(n)}else if(3===arguments.length){var a=arguments[0],o=arguments[1],s=arguments[2];this.elt[0]=new $c(a,o,s),this.elt[1]=new $c(a,o,s)}else if(4===arguments.length){var l=arguments[0],u=arguments[1],c=arguments[2],d=arguments[3];this.elt[0]=new $c(xl.NONE,xl.NONE,xl.NONE),this.elt[1]=new $c(xl.NONE,xl.NONE,xl.NONE),this.elt[l].setLocations(u,c,d)}};Hc.prototype.getGeometryCount=function(){var e=0;return this.elt[0].isNull()||e++,this.elt[1].isNull()||e++,e},Hc.prototype.setAllLocations=function(e,t){this.elt[e].setAllLocations(t)},Hc.prototype.isNull=function(e){return this.elt[e].isNull()},Hc.prototype.setAllLocationsIfNull=function(){if(1===arguments.length){var e=arguments[0];this.setAllLocationsIfNull(0,e),this.setAllLocationsIfNull(1,e)}else if(2===arguments.length){var t=arguments[0],i=arguments[1];this.elt[t].setAllLocationsIfNull(i)}},Hc.prototype.isLine=function(e){return this.elt[e].isLine()},Hc.prototype.merge=function(e){for(var t=0;t<2;t++)null===this.elt[t]&&null!==e.elt[t]?this.elt[t]=new $c(e.elt[t]):this.elt[t].merge(e.elt[t])},Hc.prototype.flip=function(){this.elt[0].flip(),this.elt[1].flip()},Hc.prototype.getLocation=function(){if(1===arguments.length){var e=arguments[0];return this.elt[e].get(Nc.ON)}if(2===arguments.length){var t=arguments[0],i=arguments[1];return this.elt[t].get(i)}},Hc.prototype.toString=function(){var e=new El;return null!==this.elt[0]&&(e.append("A:"),e.append(this.elt[0].toString())),null!==this.elt[1]&&(e.append(" B:"),e.append(this.elt[1].toString())),e.toString()},Hc.prototype.isArea=function(){if(0===arguments.length)return this.elt[0].isArea()||this.elt[1].isArea();if(1===arguments.length){var e=arguments[0];return this.elt[e].isArea()}},Hc.prototype.isAnyNull=function(e){return this.elt[e].isAnyNull()},Hc.prototype.setLocation=function(){if(2===arguments.length){var e=arguments[0],t=arguments[1];this.elt[e].setLocation(Nc.ON,t)}else if(3===arguments.length){var i=arguments[0],r=arguments[1],n=arguments[2];this.elt[i].setLocation(r,n)}},Hc.prototype.isEqualOnSide=function(e,t){return this.elt[0].isEqualOnSide(e.elt[0],t)&&this.elt[1].isEqualOnSide(e.elt[1],t)},Hc.prototype.allPositionsEqual=function(e,t){return this.elt[e].allPositionsEqual(t)},Hc.prototype.toLine=function(e){this.elt[e].isArea()&&(this.elt[e]=new $c(this.elt[e].location[0]))},Hc.prototype.interfaces_=function(){return[]},Hc.prototype.getClass=function(){return Hc},Hc.toLineLabel=function(e){for(var t=new Hc(xl.NONE),i=0;i<2;i++)t.setLocation(i,e.getLocation(i));return t};var Wc=function(){this._startDe=null,this._maxNodeDegree=-1,this._edges=new vu,this._pts=new vu,this._label=new Hc(xl.NONE),this._ring=null,this._isHole=null,this._shell=null,this._holes=new vu,this._geometryFactory=null;var e=arguments[0],t=arguments[1];this._geometryFactory=t,this.computePoints(e),this.computeRing()};Wc.prototype.computeRing=function(){if(null!==this._ring)return null;for(var e=new Array(this._pts.size()).fill(null),t=0;t<this._pts.size();t++)e[t]=this._pts.get(t);this._ring=this._geometryFactory.createLinearRing(e),this._isHole=eu.isCCW(this._ring.getCoordinates())},Wc.prototype.isIsolated=function(){return 1===this._label.getGeometryCount()},Wc.prototype.computePoints=function(e){var t=this._startDe=e,i=!0;do{if(null===t)throw new zc("Found null DirectedEdge");if(t.getEdgeRing()===this)throw new zc("Directed Edge visited twice during ring-building at "+t.getCoordinate());this._edges.add(t);var r=t.getLabel();Ql.isTrue(r.isArea()),this.mergeLabel(r),this.addPoints(t.getEdge(),t.isForward(),i),i=!1,this.setEdgeRing(t,this),t=this.getNext(t)}while(t!==this._startDe)},Wc.prototype.getLinearRing=function(){return this._ring},Wc.prototype.getCoordinate=function(e){return this._pts.get(e)},Wc.prototype.computeMaxNodeDegree=function(){this._maxNodeDegree=0;var e=this._startDe;do{var t=e.getNode().getEdges().getOutgoingDegree(this);t>this._maxNodeDegree&&(this._maxNodeDegree=t),e=this.getNext(e)}while(e!==this._startDe);this._maxNodeDegree*=2},Wc.prototype.addPoints=function(e,t,i){var r=e.getCoordinates();if(t){var n=1;i&&(n=0);for(var a=n;a<r.length;a++)this._pts.add(r[a])}else{var o=r.length-2;i&&(o=r.length-1);for(var s=o;0<=s;s--)this._pts.add(r[s])}},Wc.prototype.isHole=function(){return this._isHole},Wc.prototype.setInResult=function(){for(var e=this._startDe;e.getEdge().setInResult(!0),(e=e.getNext())!==this._startDe;);},Wc.prototype.containsPoint=function(e){var t=this.getLinearRing();if(!t.getEnvelopeInternal().contains(e))return!1;if(!eu.isPointInRing(e,t.getCoordinates()))return!1;for(var i=this._holes.iterator();i.hasNext();)if(i.next().containsPoint(e))return!1;return!0},Wc.prototype.addHole=function(e){this._holes.add(e)},Wc.prototype.isShell=function(){return null===this._shell},Wc.prototype.getLabel=function(){return this._label},Wc.prototype.getEdges=function(){return this._edges},Wc.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},Wc.prototype.getShell=function(){return this._shell},Wc.prototype.mergeLabel=function(){if(1===arguments.length){var e=arguments[0];this.mergeLabel(e,0),this.mergeLabel(e,1)}else if(2===arguments.length){var t=arguments[0],i=arguments[1],r=t.getLocation(i,Nc.RIGHT);if(r===xl.NONE)return null;if(this._label.getLocation(i)===xl.NONE)return this._label.setLocation(i,r),null}},Wc.prototype.setShell=function(e){null!==(this._shell=e)&&e.addHole(this)},Wc.prototype.toPolygon=function(e){for(var t=new Array(this._holes.size()).fill(null),i=0;i<this._holes.size();i++)t[i]=this._holes.get(i).getLinearRing();return e.createPolygon(this.getLinearRing(),t)},Wc.prototype.interfaces_=function(){return[]},Wc.prototype.getClass=function(){return Wc};var jc=function(i){function e(){var e=arguments[0],t=arguments[1];i.call(this,e,t)}return i&&(e.__proto__=i),((e.prototype=Object.create(i&&i.prototype)).constructor=e).prototype.setEdgeRing=function(e,t){e.setMinEdgeRing(t)},e.prototype.getNext=function(e){return e.getNextMin()},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Wc),qc=function(i){function e(){var e=arguments[0],t=arguments[1];i.call(this,e,t)}return i&&(e.__proto__=i),((e.prototype=Object.create(i&&i.prototype)).constructor=e).prototype.buildMinimalRings=function(){var e=new vu,t=this._startDe;do{if(null===t.getMinEdgeRing()){var i=new jc(t,this._geometryFactory);e.add(i)}t=t.getNext()}while(t!==this._startDe);return e},e.prototype.setEdgeRing=function(e,t){e.setEdgeRing(t)},e.prototype.linkDirectedEdgesForMinimalEdgeRings=function(){for(var e=this._startDe;e.getNode().getEdges().linkMinimalDirectedEdges(this),(e=e.getNext())!==this._startDe;);},e.prototype.getNext=function(e){return e.getNext()},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Wc),Qc=function(){if(this._label=null,this._isInResult=!1,this._isCovered=!1,this._isCoveredSet=!1,this._isVisited=!1,0===arguments.length);else if(1===arguments.length){var e=arguments[0];this._label=e}};Qc.prototype.setVisited=function(e){this._isVisited=e},Qc.prototype.setInResult=function(e){this._isInResult=e},Qc.prototype.isCovered=function(){return this._isCovered},Qc.prototype.isCoveredSet=function(){return this._isCoveredSet},Qc.prototype.setLabel=function(e){this._label=e},Qc.prototype.getLabel=function(){return this._label},Qc.prototype.setCovered=function(e){this._isCovered=e,this._isCoveredSet=!0},Qc.prototype.updateIM=function(e){Ql.isTrue(2<=this._label.getGeometryCount(),"found partial label"),this.computeIM(e)},Qc.prototype.isInResult=function(){return this._isInResult},Qc.prototype.isVisited=function(){return this._isVisited},Qc.prototype.interfaces_=function(){return[]},Qc.prototype.getClass=function(){return Qc};var Yc=function(i){function a(){i.call(this),this._coord=null,this._edges=null;var e=arguments[0],t=arguments[1];this._coord=e,this._edges=t,this._label=new Hc(0,xl.NONE)}return i&&(a.__proto__=i),((a.prototype=Object.create(i&&i.prototype)).constructor=a).prototype.isIncidentEdgeInResult=function(){for(var e=this.getEdges().getEdges().iterator();e.hasNext();)if(e.next().getEdge().isInResult())return!0;return!1},a.prototype.isIsolated=function(){return 1===this._label.getGeometryCount()},a.prototype.getCoordinate=function(){return this._coord},a.prototype.print=function(e){e.println("node "+this._coord+" lbl: "+this._label)},a.prototype.computeIM=function(e){},a.prototype.computeMergedLocation=function(e,t){var i=xl.NONE;if(i=this._label.getLocation(t),!e.isNull(t)){var r=e.getLocation(t);i!==xl.BOUNDARY&&(i=r)}return i},a.prototype.setLabel=function(){if(2!==arguments.length)return i.prototype.setLabel.apply(this,arguments);var e=arguments[0],t=arguments[1];null===this._label?this._label=new Hc(e,t):this._label.setLocation(e,t)},a.prototype.getEdges=function(){return this._edges},a.prototype.mergeLabel=function(){if(arguments[0]instanceof a){var e=arguments[0];this.mergeLabel(e._label)}else if(arguments[0]instanceof Hc)for(var t=arguments[0],i=0;i<2;i++){var r=this.computeMergedLocation(t,i),n=this._label.getLocation(i);n===xl.NONE&&this._label.setLocation(i,r)}},a.prototype.add=function(e){this._edges.insert(e),e.setNode(this)},a.prototype.setLabelBoundary=function(e){if(null===this._label)return null;var t=xl.NONE;null!==this._label&&(t=this._label.getLocation(e));var i=null;switch(t){case xl.BOUNDARY:i=xl.INTERIOR;break;case xl.INTERIOR:default:i=xl.BOUNDARY}this._label.setLocation(e,i)},a.prototype.interfaces_=function(){return[]},a.prototype.getClass=function(){return a},a}(Qc),Xc=function(){this.nodeMap=new ku,this.nodeFact=null;var e=arguments[0];this.nodeFact=e};Xc.prototype.find=function(e){return this.nodeMap.get(e)},Xc.prototype.addNode=function(){if(arguments[0]instanceof yl){var e=arguments[0],t=this.nodeMap.get(e);return null===t&&(t=this.nodeFact.createNode(e),this.nodeMap.put(e,t)),t}if(arguments[0]instanceof Yc){var i=arguments[0],r=this.nodeMap.get(i.getCoordinate());return null===r?(this.nodeMap.put(i.getCoordinate(),i),i):(r.mergeLabel(i),r)}},Xc.prototype.print=function(e){for(var t=this.iterator();t.hasNext();)t.next().print(e)},Xc.prototype.iterator=function(){return this.nodeMap.values().iterator()},Xc.prototype.values=function(){return this.nodeMap.values()},Xc.prototype.getBoundaryNodes=function(e){for(var t=new vu,i=this.iterator();i.hasNext();){var r=i.next();r.getLabel().getLocation(e)===xl.BOUNDARY&&t.add(r)}return t},Xc.prototype.add=function(e){var t=e.getCoordinate();this.addNode(t).add(e)},Xc.prototype.interfaces_=function(){return[]},Xc.prototype.getClass=function(){return Xc};var Zc=function(){},Jc={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};Zc.prototype.interfaces_=function(){return[]},Zc.prototype.getClass=function(){return Zc},Zc.isNorthern=function(e){return e===Zc.NE||e===Zc.NW},Zc.isOpposite=function(e,t){return e!==t&&2==(e-t+4)%4},Zc.commonHalfPlane=function(e,t){if(e===t)return e;if(2==(e-t+4)%4)return-1;var i=e<t?e:t;return 0===i&&3===(t<e?e:t)?3:i},Zc.isInHalfPlane=function(e,t){return t===Zc.SE?e===Zc.SE||e===Zc.SW:e===t||e===t+1},Zc.quadrant=function(){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var e=arguments[0],t=arguments[1];if(0===e&&0===t)throw new cl("Cannot compute the quadrant for point ( "+e+", "+t+" )");return 0<=e?0<=t?Zc.NE:Zc.SE:0<=t?Zc.NW:Zc.SW}if(arguments[0]instanceof yl&&arguments[1]instanceof yl){var i=arguments[0],r=arguments[1];if(r.x===i.x&&r.y===i.y)throw new cl("Cannot compute the quadrant for two identical points "+i);return r.x>=i.x?r.y>=i.y?Zc.NE:Zc.SE:r.y>=i.y?Zc.NW:Zc.SW}},Jc.NE.get=function(){return 0},Jc.NW.get=function(){return 1},Jc.SW.get=function(){return 2},Jc.SE.get=function(){return 3},Object.defineProperties(Zc,Jc);var Kc=function(){if(this._edge=null,this._label=null,this._node=null,this._p0=null,this._p1=null,this._dx=null,this._dy=null,this._quadrant=null,1===arguments.length){var e=arguments[0];this._edge=e}else if(3===arguments.length){var t=arguments[0],i=arguments[1],r=arguments[2];this._edge=t,this.init(i,r),this._label=null}else if(4===arguments.length){var n=arguments[0],a=arguments[1],o=arguments[2],s=arguments[3];this._edge=n,this.init(a,o),this._label=s}};Kc.prototype.compareDirection=function(e){return this._dx===e._dx&&this._dy===e._dy?0:this._quadrant>e._quadrant?1:this._quadrant<e._quadrant?-1:eu.computeOrientation(e._p0,e._p1,this._p1)},Kc.prototype.getDy=function(){return this._dy},Kc.prototype.getCoordinate=function(){return this._p0},Kc.prototype.setNode=function(e){this._node=e},Kc.prototype.print=function(e){var t=Math.atan2(this._dy,this._dx),i=this.getClass().getName(),r=i.lastIndexOf("."),n=i.substring(r+1);e.print(" "+n+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+t+" "+this._label)},Kc.prototype.compareTo=function(e){var t=e;return this.compareDirection(t)},Kc.prototype.getDirectedCoordinate=function(){return this._p1},Kc.prototype.getDx=function(){return this._dx},Kc.prototype.getLabel=function(){return this._label},Kc.prototype.getEdge=function(){return this._edge},Kc.prototype.getQuadrant=function(){return this._quadrant},Kc.prototype.getNode=function(){return this._node},Kc.prototype.toString=function(){var e=Math.atan2(this._dy,this._dx),t=this.getClass().getName(),i=t.lastIndexOf(".");return" "+t.substring(i+1)+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+e+" "+this._label},Kc.prototype.computeLabel=function(e){},Kc.prototype.init=function(e,t){this._p0=e,this._p1=t,this._dx=t.x-e.x,this._dy=t.y-e.y,this._quadrant=Zc.quadrant(this._dx,this._dy),Ql.isTrue(!(0===this._dx&&0===this._dy),"EdgeEnd with identical endpoints found")},Kc.prototype.interfaces_=function(){return[pl]},Kc.prototype.getClass=function(){return Kc};var ed=function(r){function e(){var e=arguments[0],t=arguments[1];if(r.call(this,e),this._isForward=null,this._isInResult=!1,this._isVisited=!1,this._sym=null,this._next=null,this._nextMin=null,this._edgeRing=null,this._minEdgeRing=null,this._depth=[0,-999,-999],this._isForward=t)this.init(e.getCoordinate(0),e.getCoordinate(1));else{var i=e.getNumPoints()-1;this.init(e.getCoordinate(i),e.getCoordinate(i-1))}this.computeDirectedLabel()}return r&&(e.__proto__=r),((e.prototype=Object.create(r&&r.prototype)).constructor=e).prototype.getNextMin=function(){return this._nextMin},e.prototype.getDepth=function(e){return this._depth[e]},e.prototype.setVisited=function(e){this._isVisited=e},e.prototype.computeDirectedLabel=function(){this._label=new Hc(this._edge.getLabel()),this._isForward||this._label.flip()},e.prototype.getNext=function(){return this._next},e.prototype.setDepth=function(e,t){if(-999!==this._depth[e]&&this._depth[e]!==t)throw new zc("assigned depths do not match",this.getCoordinate());this._depth[e]=t},e.prototype.isInteriorAreaEdge=function(){for(var e=!0,t=0;t<2;t++)this._label.isArea(t)&&this._label.getLocation(t,Nc.LEFT)===xl.INTERIOR&&this._label.getLocation(t,Nc.RIGHT)===xl.INTERIOR||(e=!1);return e},e.prototype.setNextMin=function(e){this._nextMin=e},e.prototype.print=function(e){r.prototype.print.call(this,e),e.print(" "+this._depth[Nc.LEFT]+"/"+this._depth[Nc.RIGHT]),e.print(" ("+this.getDepthDelta()+")"),this._isInResult&&e.print(" inResult")},e.prototype.setMinEdgeRing=function(e){this._minEdgeRing=e},e.prototype.isLineEdge=function(){var e=this._label.isLine(0)||this._label.isLine(1),t=!this._label.isArea(0)||this._label.allPositionsEqual(0,xl.EXTERIOR),i=!this._label.isArea(1)||this._label.allPositionsEqual(1,xl.EXTERIOR);return e&&t&&i},e.prototype.setEdgeRing=function(e){this._edgeRing=e},e.prototype.getMinEdgeRing=function(){return this._minEdgeRing},e.prototype.getDepthDelta=function(){var e=this._edge.getDepthDelta();return this._isForward||(e=-e),e},e.prototype.setInResult=function(e){this._isInResult=e},e.prototype.getSym=function(){return this._sym},e.prototype.isForward=function(){return this._isForward},e.prototype.getEdge=function(){return this._edge},e.prototype.printEdge=function(e){this.print(e),e.print(" "),this._isForward?this._edge.print(e):this._edge.printReverse(e)},e.prototype.setSym=function(e){this._sym=e},e.prototype.setVisitedEdge=function(e){this.setVisited(e),this._sym.setVisited(e)},e.prototype.setEdgeDepths=function(e,t){var i=this.getEdge().getDepthDelta();this._isForward||(i=-i);var r=1;e===Nc.LEFT&&(r=-1);var n=Nc.opposite(e),a=t+i*r;this.setDepth(e,t),this.setDepth(n,a)},e.prototype.getEdgeRing=function(){return this._edgeRing},e.prototype.isInResult=function(){return this._isInResult},e.prototype.setNext=function(e){this._next=e},e.prototype.isVisited=function(){return this._isVisited},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.depthFactor=function(e,t){return e===xl.EXTERIOR&&t===xl.INTERIOR?1:e===xl.INTERIOR&&t===xl.EXTERIOR?-1:0},e}(Kc),td=function(){};td.prototype.createNode=function(e){return new Yc(e,null)},td.prototype.interfaces_=function(){return[]},td.prototype.getClass=function(){return td};var id=function(){if(this._edges=new vu,this._nodes=null,this._edgeEndList=new vu,0===arguments.length)this._nodes=new Xc(new td);else if(1===arguments.length){var e=arguments[0];this._nodes=new Xc(e)}};id.prototype.printEdges=function(e){e.println("Edges:");for(var t=0;t<this._edges.size();t++){e.println("edge "+t+":");var i=this._edges.get(t);i.print(e),i.eiList.print(e)}},id.prototype.find=function(e){return this._nodes.find(e)},id.prototype.addNode=function(){if(arguments[0]instanceof Yc){var e=arguments[0];return this._nodes.addNode(e)}if(arguments[0]instanceof yl){var t=arguments[0];return this._nodes.addNode(t)}},id.prototype.getNodeIterator=function(){return this._nodes.iterator()},id.prototype.linkResultDirectedEdges=function(){for(var e=this._nodes.iterator();e.hasNext();)e.next().getEdges().linkResultDirectedEdges()},id.prototype.debugPrintln=function(e){Bl.out.println(e)},id.prototype.isBoundaryNode=function(e,t){var i=this._nodes.find(t);if(null===i)return!1;var r=i.getLabel();return null!==r&&r.getLocation(e)===xl.BOUNDARY},id.prototype.linkAllDirectedEdges=function(){for(var e=this._nodes.iterator();e.hasNext();)e.next().getEdges().linkAllDirectedEdges()},id.prototype.matchInSameDirection=function(e,t,i,r){return!!e.equals(i)&&eu.computeOrientation(e,t,r)===eu.COLLINEAR&&Zc.quadrant(e,t)===Zc.quadrant(i,r)},id.prototype.getEdgeEnds=function(){return this._edgeEndList},id.prototype.debugPrint=function(e){Bl.out.print(e)},id.prototype.getEdgeIterator=function(){return this._edges.iterator()},id.prototype.findEdgeInSameDirection=function(e,t){for(var i=0;i<this._edges.size();i++){var r=this._edges.get(i),n=r.getCoordinates();if(this.matchInSameDirection(e,t,n[0],n[1]))return r;if(this.matchInSameDirection(e,t,n[n.length-1],n[n.length-2]))return r}return null},id.prototype.insertEdge=function(e){this._edges.add(e)},id.prototype.findEdgeEnd=function(e){for(var t=this.getEdgeEnds().iterator();t.hasNext();){var i=t.next();if(i.getEdge()===e)return i}return null},id.prototype.addEdges=function(e){for(var t=e.iterator();t.hasNext();){var i=t.next();this._edges.add(i);var r=new ed(i,!0),n=new ed(i,!1);r.setSym(n),n.setSym(r),this.add(r),this.add(n)}},id.prototype.add=function(e){this._nodes.add(e),this._edgeEndList.add(e)},id.prototype.getNodes=function(){return this._nodes.values()},id.prototype.findEdge=function(e,t){for(var i=0;i<this._edges.size();i++){var r=this._edges.get(i),n=r.getCoordinates();if(e.equals(n[0])&&t.equals(n[1]))return r}return null},id.prototype.interfaces_=function(){return[]},id.prototype.getClass=function(){return id},id.linkResultDirectedEdges=function(e){for(var t=e.iterator();t.hasNext();)t.next().getEdges().linkResultDirectedEdges()};var rd=function(){this._geometryFactory=null,this._shellList=new vu;var e=arguments[0];this._geometryFactory=e};rd.prototype.sortShellsAndHoles=function(e,t,i){for(var r=e.iterator();r.hasNext();){var n=r.next();n.isHole()?i.add(n):t.add(n)}},rd.prototype.computePolygons=function(e){for(var t=new vu,i=e.iterator();i.hasNext();){var r=i.next().toPolygon(this._geometryFactory);t.add(r)}return t},rd.prototype.placeFreeHoles=function(e,t){for(var i=t.iterator();i.hasNext();){var r=i.next();if(null===r.getShell()){var n=this.findEdgeRingContaining(r,e);if(null===n)throw new zc("unable to assign hole to a shell",r.getCoordinate(0));r.setShell(n)}}},rd.prototype.buildMinimalEdgeRings=function(e,t,i){for(var r=new vu,n=e.iterator();n.hasNext();){var a=n.next();if(2<a.getMaxNodeDegree()){a.linkDirectedEdgesForMinimalEdgeRings();var o=a.buildMinimalRings(),s=this.findShell(o);null!==s?(this.placePolygonHoles(s,o),t.add(s)):i.addAll(o)}else r.add(a)}return r},rd.prototype.containsPoint=function(e){for(var t=this._shellList.iterator();t.hasNext();)if(t.next().containsPoint(e))return!0;return!1},rd.prototype.buildMaximalEdgeRings=function(e){for(var t=new vu,i=e.iterator();i.hasNext();){var r=i.next();if(r.isInResult()&&r.getLabel().isArea()&&null===r.getEdgeRing()){var n=new qc(r,this._geometryFactory);t.add(n),n.setInResult()}}return t},rd.prototype.placePolygonHoles=function(e,t){for(var i=t.iterator();i.hasNext();){var r=i.next();r.isHole()&&r.setShell(e)}},rd.prototype.getPolygons=function(){return this.computePolygons(this._shellList)},rd.prototype.findEdgeRingContaining=function(e,t){for(var i=e.getLinearRing(),r=i.getEnvelopeInternal(),n=i.getCoordinateN(0),a=null,o=null,s=t.iterator();s.hasNext();){var l=s.next(),u=l.getLinearRing(),c=u.getEnvelopeInternal();null!==a&&(o=a.getLinearRing().getEnvelopeInternal());var d=!1;c.contains(r)&&eu.isPointInRing(n,u.getCoordinates())&&(d=!0),d&&(null===a||o.contains(c))&&(a=l)}return a},rd.prototype.findShell=function(e){for(var t=0,i=null,r=e.iterator();r.hasNext();){var n=r.next();n.isHole()||(i=n,t++)}return Ql.isTrue(t<=1,"found two shells in MinimalEdgeRing list"),i},rd.prototype.add=function(){if(1===arguments.length){var e=arguments[0];this.add(e.getEdgeEnds(),e.getNodes())}else if(2===arguments.length){var t=arguments[0],i=arguments[1];id.linkResultDirectedEdges(i);var r=this.buildMaximalEdgeRings(t),n=new vu,a=this.buildMinimalEdgeRings(r,this._shellList,n);this.sortShellsAndHoles(a,this._shellList,n),this.placeFreeHoles(this._shellList,n)}},rd.prototype.interfaces_=function(){return[]},rd.prototype.getClass=function(){return rd};var nd=function(){};nd.prototype.getBounds=function(){},nd.prototype.interfaces_=function(){return[]},nd.prototype.getClass=function(){return nd};var ad=function(){this._bounds=null,this._item=null;var e=arguments[0],t=arguments[1];this._bounds=e,this._item=t};ad.prototype.getItem=function(){return this._item},ad.prototype.getBounds=function(){return this._bounds},ad.prototype.interfaces_=function(){return[nd,gl]},ad.prototype.getClass=function(){return ad};var od=function(){this._size=null,this._items=null,this._size=0,this._items=new vu,this._items.add(null)};od.prototype.poll=function(){if(this.isEmpty())return null;var e=this._items.get(1);return this._items.set(1,this._items.get(this._size)),this._size-=1,this.reorder(1),e},od.prototype.size=function(){return this._size},od.prototype.reorder=function(e){for(var t=null,i=this._items.get(e);2*e<=this._size&&((t=2*e)!==this._size&&this._items.get(t+1).compareTo(this._items.get(t))<0&&t++,this._items.get(t).compareTo(i)<0);e=t)this._items.set(e,this._items.get(t));this._items.set(e,i)},od.prototype.clear=function(){this._size=0,this._items.clear()},od.prototype.isEmpty=function(){return 0===this._size},od.prototype.add=function(e){this._items.add(null),this._size+=1;var t=this._size;for(this._items.set(0,e);e.compareTo(this._items.get(Math.trunc(t/2)))<0;t/=2)this._items.set(t,this._items.get(Math.trunc(t/2)));this._items.set(t,e)},od.prototype.interfaces_=function(){return[]},od.prototype.getClass=function(){return od};var sd=function(){};sd.prototype.visitItem=function(e){},sd.prototype.interfaces_=function(){return[]},sd.prototype.getClass=function(){return sd};var ld=function(){};ld.prototype.insert=function(e,t){},ld.prototype.remove=function(e,t){},ld.prototype.query=function(){},ld.prototype.interfaces_=function(){return[]},ld.prototype.getClass=function(){return ld};var ud=function(){if(this._childBoundables=new vu,this._bounds=null,this._level=null,0===arguments.length);else if(1===arguments.length){var e=arguments[0];this._level=e}},cd={serialVersionUID:{configurable:!0}};ud.prototype.getLevel=function(){return this._level},ud.prototype.size=function(){return this._childBoundables.size()},ud.prototype.getChildBoundables=function(){return this._childBoundables},ud.prototype.addChildBoundable=function(e){Ql.isTrue(null===this._bounds),this._childBoundables.add(e)},ud.prototype.isEmpty=function(){return this._childBoundables.isEmpty()},ud.prototype.getBounds=function(){return null===this._bounds&&(this._bounds=this.computeBounds()),this._bounds},ud.prototype.interfaces_=function(){return[nd,gl]},ud.prototype.getClass=function(){return ud},cd.serialVersionUID.get=function(){return 0x5a1e55ec41369800},Object.defineProperties(ud,cd);var dd=function(){};dd.reverseOrder=function(){return{compare:function(e,t){return t.compareTo(e)}}},dd.min=function(e){return dd.sort(e),e.get(0)},dd.sort=function(e,t){var i=e.toArray();t?Uu.sort(i,t):Uu.sort(i);for(var r=e.iterator(),n=0,a=i.length;n<a;n++)r.next(),r.set(i[n])},dd.singletonList=function(e){var t=new vu;return t.add(e),t};var hd=function(){this._boundable1=null,this._boundable2=null,this._distance=null,this._itemDistance=null;var e=arguments[0],t=arguments[1],i=arguments[2];this._boundable1=e,this._boundable2=t,this._itemDistance=i,this._distance=this.distance()};hd.prototype.expandToQueue=function(e,t){var i=hd.isComposite(this._boundable1),r=hd.isComposite(this._boundable2);if(i&&r)return hd.area(this._boundable1)>hd.area(this._boundable2)?this.expand(this._boundable1,this._boundable2,e,t):this.expand(this._boundable2,this._boundable1,e,t),null;if(i)return this.expand(this._boundable1,this._boundable2,e,t),null;if(r)return this.expand(this._boundable2,this._boundable1,e,t),null;throw new cl("neither boundable is composite")},hd.prototype.isLeaves=function(){return!(hd.isComposite(this._boundable1)||hd.isComposite(this._boundable2))},hd.prototype.compareTo=function(e){var t=e;return this._distance<t._distance?-1:this._distance>t._distance?1:0},hd.prototype.expand=function(e,t,i,r){for(var n=e.getChildBoundables().iterator();n.hasNext();){var a=n.next(),o=new hd(a,t,this._itemDistance);o.getDistance()<r&&i.add(o)}},hd.prototype.getBoundable=function(e){return 0===e?this._boundable1:this._boundable2},hd.prototype.getDistance=function(){return this._distance},hd.prototype.distance=function(){return this.isLeaves()?this._itemDistance.distance(this._boundable1,this._boundable2):this._boundable1.getBounds().distance(this._boundable2.getBounds())},hd.prototype.interfaces_=function(){return[pl]},hd.prototype.getClass=function(){return hd},hd.area=function(e){return e.getBounds().getArea()},hd.isComposite=function(e){return e instanceof ud};var pd=function e(){if(this._root=null,this._built=!1,this._itemBoundables=new vu,this._nodeCapacity=null,0===arguments.length){var t=e.DEFAULT_NODE_CAPACITY;this._nodeCapacity=t}else if(1===arguments.length){var i=arguments[0];Ql.isTrue(1<i,"Node capacity must be greater than 1"),this._nodeCapacity=i}},fd={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};pd.prototype.getNodeCapacity=function(){return this._nodeCapacity},pd.prototype.lastNode=function(e){return e.get(e.size()-1)},pd.prototype.size=function(){if(0===arguments.length)return this.isEmpty()?0:(this.build(),this.size(this._root));if(1===arguments.length){for(var e=arguments[0],t=0,i=e.getChildBoundables().iterator();i.hasNext();){var r=i.next();r instanceof ud?t+=this.size(r):r instanceof ad&&(t+=1)}return t}},pd.prototype.removeItem=function(e,t){for(var i=null,r=e.getChildBoundables().iterator();r.hasNext();){var n=r.next();n instanceof ad&&n.getItem()===t&&(i=n)}return null!==i&&(e.getChildBoundables().remove(i),!0)},pd.prototype.itemsTree=function(){if(0===arguments.length){this.build();var e=this.itemsTree(this._root);return null===e?new vu:e}if(1===arguments.length){for(var t=arguments[0],i=new vu,r=t.getChildBoundables().iterator();r.hasNext();){var n=r.next();if(n instanceof ud){var a=this.itemsTree(n);null!==a&&i.add(a)}else n instanceof ad?i.add(n.getItem()):Ql.shouldNeverReachHere()}return i.size()<=0?null:i}},pd.prototype.insert=function(e,t){Ql.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new ad(e,t))},pd.prototype.boundablesAtLevel=function(){if(1===arguments.length){var e=arguments[0],t=new vu;return this.boundablesAtLevel(e,this._root,t),t}if(3===arguments.length){var i=arguments[0],r=arguments[1],n=arguments[2];if(Ql.isTrue(-2<i),r.getLevel()===i)return n.add(r),null;for(var a=r.getChildBoundables().iterator();a.hasNext();){var o=a.next();o instanceof ud?this.boundablesAtLevel(i,o,n):(Ql.isTrue(o instanceof ad),-1===i&&n.add(o))}return null}},pd.prototype.query=function(){if(1===arguments.length){var e=arguments[0];this.build();var t=new vu;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),e)&&this.query(e,this._root,t),t}if(2===arguments.length){var i=arguments[0],r=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),i)&&this.query(i,this._root,r)}else if(3===arguments.length)if(Al(arguments[2],sd)&&arguments[0]instanceof Object&&arguments[1]instanceof ud)for(var n=arguments[0],a=arguments[1],o=arguments[2],s=a.getChildBoundables(),l=0;l<s.size();l++){var u=s.get(l);this.getIntersectsOp().intersects(u.getBounds(),n)&&(u instanceof ud?this.query(n,u,o):u instanceof ad?o.visitItem(u.getItem()):Ql.shouldNeverReachHere())}else if(Al(arguments[2],gu)&&arguments[0]instanceof Object&&arguments[1]instanceof ud)for(var c=arguments[0],d=arguments[1],h=arguments[2],p=d.getChildBoundables(),f=0;f<p.size();f++){var m=p.get(f);this.getIntersectsOp().intersects(m.getBounds(),c)&&(m instanceof ud?this.query(c,m,h):m instanceof ad?h.add(m.getItem()):Ql.shouldNeverReachHere())}},pd.prototype.build=function(){if(this._built)return null;this._root=this._itemBoundables.isEmpty()?this.createNode(0):this.createHigherLevels(this._itemBoundables,-1),this._itemBoundables=null,this._built=!0},pd.prototype.getRoot=function(){return this.build(),this._root},pd.prototype.remove=function(){if(2===arguments.length){var e=arguments[0],t=arguments[1];return this.build(),!!this.getIntersectsOp().intersects(this._root.getBounds(),e)&&this.remove(e,this._root,t)}if(3===arguments.length){var i=arguments[0],r=arguments[1],n=arguments[2],a=this.removeItem(r,n);if(a)return!0;for(var o=null,s=r.getChildBoundables().iterator();s.hasNext();){var l=s.next();if(this.getIntersectsOp().intersects(l.getBounds(),i)&&l instanceof ud&&(a=this.remove(i,l,n))){o=l;break}}return null!==o&&o.getChildBoundables().isEmpty()&&r.getChildBoundables().remove(o),a}},pd.prototype.createHigherLevels=function(e,t){Ql.isTrue(!e.isEmpty());var i=this.createParentBoundables(e,t+1);return 1===i.size()?i.get(0):this.createHigherLevels(i,t+1)},pd.prototype.depth=function(){if(0===arguments.length)return this.isEmpty()?0:(this.build(),this.depth(this._root));if(1===arguments.length){for(var e=arguments[0],t=0,i=e.getChildBoundables().iterator();i.hasNext();){var r=i.next();if(r instanceof ud){var n=this.depth(r);t<n&&(t=n)}}return t+1}},pd.prototype.createParentBoundables=function(e,t){Ql.isTrue(!e.isEmpty());var i=new vu;i.add(this.createNode(t));var r=new vu(e);dd.sort(r,this.getComparator());for(var n=r.iterator();n.hasNext();){var a=n.next();this.lastNode(i).getChildBoundables().size()===this.getNodeCapacity()&&i.add(this.createNode(t)),this.lastNode(i).addChildBoundable(a)}return i},pd.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()},pd.prototype.interfaces_=function(){return[gl]},pd.prototype.getClass=function(){return pd},pd.compareDoubles=function(e,t){return t<e?1:e<t?-1:0},fd.IntersectsOp.get=function(){return md},fd.serialVersionUID.get=function(){return-0x35ef64c82d4c5400},fd.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(pd,fd);var md=function(){},gd=function(){};gd.prototype.distance=function(e,t){},gd.prototype.interfaces_=function(){return[]},gd.prototype.getClass=function(){return gd};var yd=function(u){function v(e){e=e||v.DEFAULT_NODE_CAPACITY,u.call(this,e)}u&&(v.__proto__=u),v.prototype=Object.create(u&&u.prototype);var e={STRtreeNode:{configurable:!0},serialVersionUID:{configurable:!0},xComparator:{configurable:!0},yComparator:{configurable:!0},intersectsOp:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};return(v.prototype.constructor=v).prototype.createParentBoundablesFromVerticalSlices=function(e,t){Ql.isTrue(0<e.length);for(var i=new vu,r=0;r<e.length;r++)i.addAll(this.createParentBoundablesFromVerticalSlice(e[r],t));return i},v.prototype.createNode=function(e){return new vd(e)},v.prototype.size=function(){return 0===arguments.length?u.prototype.size.call(this):u.prototype.size.apply(this,arguments)},v.prototype.insert=function(){if(2!==arguments.length)return u.prototype.insert.apply(this,arguments);var e=arguments[0],t=arguments[1];if(e.isNull())return null;u.prototype.insert.call(this,e,t)},v.prototype.getIntersectsOp=function(){return v.intersectsOp},v.prototype.verticalSlices=function(e,t){for(var i=Math.trunc(Math.ceil(e.size()/t)),r=new Array(t).fill(null),n=e.iterator(),a=0;a<t;a++){r[a]=new vu;for(var o=0;n.hasNext()&&o<i;){var s=n.next();r[a].add(s),o++}}return r},v.prototype.query=function(){if(1===arguments.length){var e=arguments[0];return u.prototype.query.call(this,e)}if(2===arguments.length){var t=arguments[0],i=arguments[1];u.prototype.query.call(this,t,i)}else if(3===arguments.length)if(Al(arguments[2],sd)&&arguments[0]instanceof Object&&arguments[1]instanceof ud){var r=arguments[0],n=arguments[1],a=arguments[2];u.prototype.query.call(this,r,n,a)}else if(Al(arguments[2],gu)&&arguments[0]instanceof Object&&arguments[1]instanceof ud){var o=arguments[0],s=arguments[1],l=arguments[2];u.prototype.query.call(this,o,s,l)}},v.prototype.getComparator=function(){return v.yComparator},v.prototype.createParentBoundablesFromVerticalSlice=function(e,t){return u.prototype.createParentBoundables.call(this,e,t)},v.prototype.remove=function(){if(2!==arguments.length)return u.prototype.remove.apply(this,arguments);var e=arguments[0],t=arguments[1];return u.prototype.remove.call(this,e,t)},v.prototype.depth=function(){return 0===arguments.length?u.prototype.depth.call(this):u.prototype.depth.apply(this,arguments)},v.prototype.createParentBoundables=function(e,t){Ql.isTrue(!e.isEmpty());var i=Math.trunc(Math.ceil(e.size()/this.getNodeCapacity())),r=new vu(e);dd.sort(r,v.xComparator);var n=this.verticalSlices(r,Math.trunc(Math.ceil(Math.sqrt(i))));return this.createParentBoundablesFromVerticalSlices(n,t)},v.prototype.nearestNeighbour=function(){if(1===arguments.length){if(Al(arguments[0],gd)){var e=arguments[0],t=new hd(this.getRoot(),this.getRoot(),e);return this.nearestNeighbour(t)}if(arguments[0]instanceof hd){var i=arguments[0];return this.nearestNeighbour(i,dl.POSITIVE_INFINITY)}}else if(2===arguments.length){if(arguments[0]instanceof v&&Al(arguments[1],gd)){var r=arguments[0],n=arguments[1],a=new hd(this.getRoot(),r.getRoot(),n);return this.nearestNeighbour(a)}if(arguments[0]instanceof hd&&"number"==typeof arguments[1]){var o=arguments[0],s=arguments[1],l=s,u=null,c=new od;for(c.add(o);!c.isEmpty()&&0<l;){var d=c.poll(),h=d.getDistance();if(l<=h)break;d.isLeaves()?(l=h,u=d):d.expandToQueue(c,l)}return[u.getBoundable(0).getItem(),u.getBoundable(1).getItem()]}}else if(3===arguments.length){var p=arguments[0],f=arguments[1],m=arguments[2],g=new ad(p,f),y=new hd(this.getRoot(),g,m);return this.nearestNeighbour(y)[0]}},v.prototype.interfaces_=function(){return[ld,gl]},v.prototype.getClass=function(){return v},v.centreX=function(e){return v.avg(e.getMinX(),e.getMaxX())},v.avg=function(e,t){return(e+t)/2},v.centreY=function(e){return v.avg(e.getMinY(),e.getMaxY())},e.STRtreeNode.get=function(){return vd},e.serialVersionUID.get=function(){return 0x39920f7d5f261e0},e.xComparator.get=function(){return{interfaces_:function(){return[ml]},compare:function(e,t){return u.compareDoubles(v.centreX(e.getBounds()),v.centreX(t.getBounds()))}}},e.yComparator.get=function(){return{interfaces_:function(){return[ml]},compare:function(e,t){return u.compareDoubles(v.centreY(e.getBounds()),v.centreY(t.getBounds()))}}},e.intersectsOp.get=function(){return{interfaces_:function(){return[u.IntersectsOp]},intersects:function(e,t){return e.intersects(t)}}},e.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(v,e),v}(pd),vd=function(t){function e(){var e=arguments[0];t.call(this,e)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.computeBounds=function(){for(var e=null,t=this.getChildBoundables().iterator();t.hasNext();){var i=t.next();null===e?e=new Vl(i.getBounds()):e.expandToInclude(i.getBounds())}return e},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(ud),_d=function(){};_d.prototype.interfaces_=function(){return[]},_d.prototype.getClass=function(){return _d},_d.relativeSign=function(e,t){return e<t?-1:t<e?1:0},_d.compare=function(e,t,i){if(t.equals2D(i))return 0;var r=_d.relativeSign(t.x,i.x),n=_d.relativeSign(t.y,i.y);switch(e){case 0:return _d.compareValue(r,n);case 1:return _d.compareValue(n,r);case 2:return _d.compareValue(n,-r);case 3:return _d.compareValue(-r,n);case 4:return _d.compareValue(-r,-n);case 5:return _d.compareValue(-n,-r);case 6:return _d.compareValue(-n,r);case 7:return _d.compareValue(r,-n)}return Ql.shouldNeverReachHere("invalid octant value"),0},_d.compareValue=function(e,t){return e<0?-1:0<e?1:t<0?-1:0<t?1:0};var Cd=function(){this._segString=null,this.coord=null,this.segmentIndex=null,this._segmentOctant=null,this._isInterior=null;var e=arguments[0],t=arguments[1],i=arguments[2],r=arguments[3];this._segString=e,this.coord=new yl(t),this.segmentIndex=i,this._segmentOctant=r,this._isInterior=!t.equals2D(e.getCoordinate(i))};Cd.prototype.getCoordinate=function(){return this.coord},Cd.prototype.print=function(e){e.print(this.coord),e.print(" seg # = "+this.segmentIndex)},Cd.prototype.compareTo=function(e){var t=e;return this.segmentIndex<t.segmentIndex?-1:this.segmentIndex>t.segmentIndex?1:this.coord.equals2D(t.coord)?0:_d.compare(this._segmentOctant,this.coord,t.coord)},Cd.prototype.isEndPoint=function(e){return 0===this.segmentIndex&&!this._isInterior||this.segmentIndex===e},Cd.prototype.isInterior=function(){return this._isInterior},Cd.prototype.interfaces_=function(){return[pl]},Cd.prototype.getClass=function(){return Cd};var xd=function(){this._nodeMap=new ku,this._edge=null;var e=arguments[0];this._edge=e};xd.prototype.getSplitCoordinates=function(){var e=new Cu;this.addEndpoints();for(var t=this.iterator(),i=t.next();t.hasNext();){var r=t.next();this.addEdgeCoordinates(i,r,e),i=r}return e.toCoordinateArray()},xd.prototype.addCollapsedNodes=function(){var e=new vu;this.findCollapsesFromInsertedNodes(e),this.findCollapsesFromExistingVertices(e);for(var t=e.iterator();t.hasNext();){var i=t.next().intValue();this.add(this._edge.getCoordinate(i),i)}},xd.prototype.print=function(e){e.println("Intersections:");for(var t=this.iterator();t.hasNext();)t.next().print(e)},xd.prototype.findCollapsesFromExistingVertices=function(e){for(var t=0;t<this._edge.size()-2;t++){var i=this._edge.getCoordinate(t),r=this._edge.getCoordinate(t+2);i.equals2D(r)&&e.add(new Tl(t+1))}},xd.prototype.addEdgeCoordinates=function(e,t,i){var r=this._edge.getCoordinate(t.segmentIndex),n=t.isInterior()||!t.coord.equals2D(r);i.add(new yl(e.coord),!1);for(var a=e.segmentIndex+1;a<=t.segmentIndex;a++)i.add(this._edge.getCoordinate(a));n&&i.add(new yl(t.coord))},xd.prototype.iterator=function(){return this._nodeMap.values().iterator()},xd.prototype.addSplitEdges=function(e){this.addEndpoints(),this.addCollapsedNodes();for(var t=this.iterator(),i=t.next();t.hasNext();){var r=t.next(),n=this.createSplitEdge(i,r);e.add(n),i=r}},xd.prototype.findCollapseIndex=function(e,t,i){if(!e.coord.equals2D(t.coord))return!1;var r=t.segmentIndex-e.segmentIndex;return t.isInterior()||r--,1===r&&(i[0]=e.segmentIndex+1,!0)},xd.prototype.findCollapsesFromInsertedNodes=function(e){for(var t=new Array(1).fill(null),i=this.iterator(),r=i.next();i.hasNext();){var n=i.next();this.findCollapseIndex(r,n,t)&&e.add(new Tl(t[0])),r=n}},xd.prototype.getEdge=function(){return this._edge},xd.prototype.addEndpoints=function(){var e=this._edge.size()-1;this.add(this._edge.getCoordinate(0),0),this.add(this._edge.getCoordinate(e),e)},xd.prototype.createSplitEdge=function(e,t){var i=t.segmentIndex-e.segmentIndex+2,r=this._edge.getCoordinate(t.segmentIndex),n=t.isInterior()||!t.coord.equals2D(r);n||i--;var a=new Array(i).fill(null),o=0;a[o++]=new yl(e.coord);for(var s=e.segmentIndex+1;s<=t.segmentIndex;s++)a[o++]=this._edge.getCoordinate(s);return n&&(a[o]=new yl(t.coord)),new wd(a,this._edge.getData())},xd.prototype.add=function(e,t){var i=new Cd(this._edge,e,t,this._edge.getSegmentOctant(t)),r=this._nodeMap.get(i);return null!==r?(Ql.isTrue(r.coord.equals2D(e),"Found equal nodes with different coordinates"),r):(this._nodeMap.put(i,i),i)},xd.prototype.checkSplitEdgesCorrectness=function(e){var t=this._edge.getCoordinates(),i=e.get(0).getCoordinate(0);if(!i.equals2D(t[0]))throw new jl("bad split edge start point at "+i);var r=e.get(e.size()-1).getCoordinates(),n=r[r.length-1];if(!n.equals2D(t[t.length-1]))throw new jl("bad split edge end point at "+n)},xd.prototype.interfaces_=function(){return[]},xd.prototype.getClass=function(){return xd};var bd=function(){};bd.prototype.interfaces_=function(){return[]},bd.prototype.getClass=function(){return bd},bd.octant=function(){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var e=arguments[0],t=arguments[1];if(0===e&&0===t)throw new cl("Cannot compute the octant for point ( "+e+", "+t+" )");var i=Math.abs(e),r=Math.abs(t);return 0<=e?0<=t?r<=i?0:1:r<=i?7:6:0<=t?r<=i?3:2:r<=i?4:5}if(arguments[0]instanceof yl&&arguments[1]instanceof yl){var n=arguments[0],a=arguments[1],o=a.x-n.x,s=a.y-n.y;if(0==o&&0==s)throw new cl("Cannot compute the octant for two identical points "+n);return bd.octant(o,s)}};var Ad=function(){};Ad.prototype.getCoordinates=function(){},Ad.prototype.size=function(){},Ad.prototype.getCoordinate=function(e){},Ad.prototype.isClosed=function(){},Ad.prototype.setData=function(e){},Ad.prototype.getData=function(){},Ad.prototype.interfaces_=function(){return[]},Ad.prototype.getClass=function(){return Ad};var Sd=function(){};Sd.prototype.addIntersection=function(e,t){},Sd.prototype.interfaces_=function(){return[Ad]},Sd.prototype.getClass=function(){return Sd};var wd=function(){this._nodeList=new xd(this),this._pts=null,this._data=null;var e=arguments[0],t=arguments[1];this._pts=e,this._data=t};wd.prototype.getCoordinates=function(){return this._pts},wd.prototype.size=function(){return this._pts.length},wd.prototype.getCoordinate=function(e){return this._pts[e]},wd.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},wd.prototype.getSegmentOctant=function(e){return e===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(e),this.getCoordinate(e+1))},wd.prototype.setData=function(e){this._data=e},wd.prototype.safeOctant=function(e,t){return e.equals2D(t)?0:bd.octant(e,t)},wd.prototype.getData=function(){return this._data},wd.prototype.addIntersection=function(){if(2===arguments.length){var e=arguments[0],t=arguments[1];this.addIntersectionNode(e,t)}else if(4===arguments.length){var i=arguments[0],r=arguments[1],n=arguments[3],a=new yl(i.getIntersection(n));this.addIntersection(a,r)}},wd.prototype.toString=function(){return Wl.toLineString(new vc(this._pts))},wd.prototype.getNodeList=function(){return this._nodeList},wd.prototype.addIntersectionNode=function(e,t){var i=t,r=i+1;if(r<this._pts.length){var n=this._pts[r];e.equals2D(n)&&(i=r)}return this._nodeList.add(e,i)},wd.prototype.addIntersections=function(e,t,i){for(var r=0;r<e.getIntersectionNum();r++)this.addIntersection(e,t,i,r)},wd.prototype.interfaces_=function(){return[Sd]},wd.prototype.getClass=function(){return wd},wd.getNodedSubstrings=function(){if(1===arguments.length){var e=arguments[0],t=new vu;return wd.getNodedSubstrings(e,t),t}if(2===arguments.length)for(var i=arguments[0],r=arguments[1],n=i.iterator();n.hasNext();){var a=n.next();a.getNodeList().addSplitEdges(r)}};var Ed=function(){if(this.p0=null,this.p1=null,0===arguments.length)this.p0=new yl,this.p1=new yl;else if(1===arguments.length){var e=arguments[0];this.p0=new yl(e.p0),this.p1=new yl(e.p1)}else if(2===arguments.length)this.p0=arguments[0],this.p1=arguments[1];else if(4===arguments.length){var t=arguments[0],i=arguments[1],r=arguments[2],n=arguments[3];this.p0=new yl(t,i),this.p1=new yl(r,n)}},Td={serialVersionUID:{configurable:!0}};Ed.prototype.minX=function(){return Math.min(this.p0.x,this.p1.x)},Ed.prototype.orientationIndex=function(){if(arguments[0]instanceof Ed){var e=arguments[0],t=eu.orientationIndex(this.p0,this.p1,e.p0),i=eu.orientationIndex(this.p0,this.p1,e.p1);return 0<=t&&0<=i||t<=0&&i<=0?Math.max(t,i):0}if(arguments[0]instanceof yl){var r=arguments[0];return eu.orientationIndex(this.p0,this.p1,r)}},Ed.prototype.toGeometry=function(e){return e.createLineString([this.p0,this.p1])},Ed.prototype.isVertical=function(){return this.p0.x===this.p1.x},Ed.prototype.equals=function(e){if(!(e instanceof Ed))return!1;var t=e;return this.p0.equals(t.p0)&&this.p1.equals(t.p1)},Ed.prototype.intersection=function(e){var t=new Zl;return t.computeIntersection(this.p0,this.p1,e.p0,e.p1),t.hasIntersection()?t.getIntersection(0):null},Ed.prototype.project=function(){if(arguments[0]instanceof yl){var e=arguments[0];if(e.equals(this.p0)||e.equals(this.p1))return new yl(e);var t=this.projectionFactor(e),i=new yl;return i.x=this.p0.x+t*(this.p1.x-this.p0.x),i.y=this.p0.y+t*(this.p1.y-this.p0.y),i}if(arguments[0]instanceof Ed){var r=arguments[0],n=this.projectionFactor(r.p0),a=this.projectionFactor(r.p1);if(1<=n&&1<=a)return null;if(n<=0&&a<=0)return null;var o=this.project(r.p0);n<0&&(o=this.p0),1<n&&(o=this.p1);var s=this.project(r.p1);return a<0&&(s=this.p0),1<a&&(s=this.p1),new Ed(o,s)}},Ed.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()},Ed.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},Ed.prototype.getCoordinate=function(e){return 0===e?this.p0:this.p1},Ed.prototype.distancePerpendicular=function(e){return eu.distancePointLinePerpendicular(e,this.p0,this.p1)},Ed.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)},Ed.prototype.midPoint=function(){return Ed.midPoint(this.p0,this.p1)},Ed.prototype.projectionFactor=function(e){if(e.equals(this.p0))return 0;if(e.equals(this.p1))return 1;var t=this.p1.x-this.p0.x,i=this.p1.y-this.p0.y,r=t*t+i*i;return r<=0?dl.NaN:((e.x-this.p0.x)*t+(e.y-this.p0.y)*i)/r},Ed.prototype.closestPoints=function(e){var t=this.intersection(e);if(null!==t)return[t,t];var i=new Array(2).fill(null),r=dl.MAX_VALUE,n=null,a=this.closestPoint(e.p0);r=a.distance(e.p0),i[0]=a,i[1]=e.p0;var o=this.closestPoint(e.p1);(n=o.distance(e.p1))<r&&(r=n,i[0]=o,i[1]=e.p1);var s=e.closestPoint(this.p0);(n=s.distance(this.p0))<r&&(r=n,i[0]=this.p0,i[1]=s);var l=e.closestPoint(this.p1);return(n=l.distance(this.p1))<r&&(r=n,i[0]=this.p1,i[1]=l),i},Ed.prototype.closestPoint=function(e){var t=this.projectionFactor(e);return 0<t&&t<1?this.project(e):this.p0.distance(e)<this.p1.distance(e)?this.p0:this.p1},Ed.prototype.maxX=function(){return Math.max(this.p0.x,this.p1.x)},Ed.prototype.getLength=function(){return this.p0.distance(this.p1)},Ed.prototype.compareTo=function(e){var t=e,i=this.p0.compareTo(t.p0);return 0!==i?i:this.p1.compareTo(t.p1)},Ed.prototype.reverse=function(){var e=this.p0;this.p0=this.p1,this.p1=e},Ed.prototype.equalsTopo=function(e){return this.p0.equals(e.p0)&&(this.p1.equals(e.p1)||this.p0.equals(e.p1))&&this.p1.equals(e.p0)},Ed.prototype.lineIntersection=function(e){try{return Fl.intersection(this.p0,this.p1,e.p0,e.p1)}catch(e){if(!(e instanceof kl))throw e}return null},Ed.prototype.maxY=function(){return Math.max(this.p0.y,this.p1.y)},Ed.prototype.pointAlongOffset=function(e,t){var i=this.p0.x+e*(this.p1.x-this.p0.x),r=this.p0.y+e*(this.p1.y-this.p0.y),n=this.p1.x-this.p0.x,a=this.p1.y-this.p0.y,o=Math.sqrt(n*n+a*a),s=0,l=0;if(0!==t){if(o<=0)throw new Error("Cannot compute offset from zero-length line segment");s=t*n/o,l=t*a/o}return new yl(i-l,r+s)},Ed.prototype.setCoordinates=function(){if(1===arguments.length){var e=arguments[0];this.setCoordinates(e.p0,e.p1)}else if(2===arguments.length){var t=arguments[0],i=arguments[1];this.p0.x=t.x,this.p0.y=t.y,this.p1.x=i.x,this.p1.y=i.y}},Ed.prototype.segmentFraction=function(e){var t=this.projectionFactor(e);return t<0?t=0:(1<t||dl.isNaN(t))&&(t=1),t},Ed.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},Ed.prototype.isHorizontal=function(){return this.p0.y===this.p1.y},Ed.prototype.distance=function(){if(arguments[0]instanceof Ed){var e=arguments[0];return eu.distanceLineLine(this.p0,this.p1,e.p0,e.p1)}if(arguments[0]instanceof yl){var t=arguments[0];return eu.distancePointLine(t,this.p0,this.p1)}},Ed.prototype.pointAlong=function(e){var t=new yl;return t.x=this.p0.x+e*(this.p1.x-this.p0.x),t.y=this.p0.y+e*(this.p1.y-this.p0.y),t},Ed.prototype.hashCode=function(){var e=dl.doubleToLongBits(this.p0.x);e^=31*dl.doubleToLongBits(this.p0.y);var t=Math.trunc(e)^Math.trunc(e>>32),i=dl.doubleToLongBits(this.p1.x);return i^=31*dl.doubleToLongBits(this.p1.y),t^Math.trunc(i)^Math.trunc(i>>32)},Ed.prototype.interfaces_=function(){return[pl,gl]},Ed.prototype.getClass=function(){return Ed},Ed.midPoint=function(e,t){return new yl((e.x+t.x)/2,(e.y+t.y)/2)},Td.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(Ed,Td);var Pd=function(){this.tempEnv1=new Vl,this.tempEnv2=new Vl,this._overlapSeg1=new Ed,this._overlapSeg2=new Ed};Pd.prototype.overlap=function(){if(2===arguments.length);else if(4===arguments.length){var e=arguments[0],t=arguments[1],i=arguments[2],r=arguments[3];e.getLineSegment(t,this._overlapSeg1),i.getLineSegment(r,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}},Pd.prototype.interfaces_=function(){return[]},Pd.prototype.getClass=function(){return Pd};var Md=function(){this._pts=null,this._start=null,this._end=null,this._env=null,this._context=null,this._id=null;var e=arguments[0],t=arguments[1],i=arguments[2],r=arguments[3];this._pts=e,this._start=t,this._end=i,this._context=r};Md.prototype.getLineSegment=function(e,t){t.p0=this._pts[e],t.p1=this._pts[e+1]},Md.prototype.computeSelect=function(e,t,i,r){var n=this._pts[t],a=this._pts[i];if(r.tempEnv1.init(n,a),i-t==1)return r.select(this,t),null;if(!e.intersects(r.tempEnv1))return null;var o=Math.trunc((t+i)/2);t<o&&this.computeSelect(e,t,o,r),o<i&&this.computeSelect(e,o,i,r)},Md.prototype.getCoordinates=function(){for(var e=new Array(this._end-this._start+1).fill(null),t=0,i=this._start;i<=this._end;i++)e[t++]=this._pts[i];return e},Md.prototype.computeOverlaps=function(e,t){this.computeOverlapsInternal(this._start,this._end,e,e._start,e._end,t)},Md.prototype.setId=function(e){this._id=e},Md.prototype.select=function(e,t){this.computeSelect(e,this._start,this._end,t)},Md.prototype.getEnvelope=function(){if(null===this._env){var e=this._pts[this._start],t=this._pts[this._end];this._env=new Vl(e,t)}return this._env},Md.prototype.getEndIndex=function(){return this._end},Md.prototype.getStartIndex=function(){return this._start},Md.prototype.getContext=function(){return this._context},Md.prototype.getId=function(){return this._id},Md.prototype.computeOverlapsInternal=function(e,t,i,r,n,a){var o=this._pts[e],s=this._pts[t],l=i._pts[r],u=i._pts[n];if(t-e==1&&n-r==1)return a.overlap(this,e,i,r),null;if(a.tempEnv1.init(o,s),a.tempEnv2.init(l,u),!a.tempEnv1.intersects(a.tempEnv2))return null;var c=Math.trunc((e+t)/2),d=Math.trunc((r+n)/2);e<c&&(r<d&&this.computeOverlapsInternal(e,c,i,r,d,a),d<n&&this.computeOverlapsInternal(e,c,i,d,n,a)),c<t&&(r<d&&this.computeOverlapsInternal(c,t,i,r,d,a),d<n&&this.computeOverlapsInternal(c,t,i,d,n,a))},Md.prototype.interfaces_=function(){return[]},Md.prototype.getClass=function(){return Md};var Dd=function(){};Dd.prototype.interfaces_=function(){return[]},Dd.prototype.getClass=function(){return Dd},Dd.getChainStartIndices=function(e){var t=0,i=new vu;i.add(new Tl(t));do{var r=Dd.findChainEnd(e,t);i.add(new Tl(r)),t=r}while(t<e.length-1);return Dd.toIntArray(i)},Dd.findChainEnd=function(e,t){for(var i=t;i<e.length-1&&e[i].equals2D(e[i+1]);)i++;if(i>=e.length-1)return e.length-1;for(var r=Zc.quadrant(e[i],e[i+1]),n=t+1;n<e.length&&(e[n-1].equals2D(e[n])||Zc.quadrant(e[n-1],e[n])===r);)n++;return n-1},Dd.getChains=function(){if(1===arguments.length){var e=arguments[0];return Dd.getChains(e,null)}if(2===arguments.length){for(var t=arguments[0],i=arguments[1],r=new vu,n=Dd.getChainStartIndices(t),a=0;a<n.length-1;a++){var o=new Md(t,n[a],n[a+1],i);r.add(o)}return r}},Dd.toIntArray=function(e){for(var t=new Array(e.size()).fill(null),i=0;i<t.length;i++)t[i]=e.get(i).intValue();return t};var Id=function(){};Id.prototype.computeNodes=function(e){},Id.prototype.getNodedSubstrings=function(){},Id.prototype.interfaces_=function(){return[]},Id.prototype.getClass=function(){return Id};var Od=function(){if(this._segInt=null,0===arguments.length);else if(1===arguments.length){var e=arguments[0];this.setSegmentIntersector(e)}};Od.prototype.setSegmentIntersector=function(e){this._segInt=e},Od.prototype.interfaces_=function(){return[Id]},Od.prototype.getClass=function(){return Od};var Rd=function(t){function e(e){e?t.call(this,e):t.call(this),this._monoChains=new vu,this._index=new yd,this._idCounter=0,this._nodedSegStrings=null,this._nOverlaps=0}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype);var i={SegmentOverlapAction:{configurable:!0}};return(e.prototype.constructor=e).prototype.getMonotoneChains=function(){return this._monoChains},e.prototype.getNodedSubstrings=function(){return wd.getNodedSubstrings(this._nodedSegStrings)},e.prototype.getIndex=function(){return this._index},e.prototype.add=function(e){for(var t=Dd.getChains(e.getCoordinates(),e).iterator();t.hasNext();){var i=t.next();i.setId(this._idCounter++),this._index.insert(i.getEnvelope(),i),this._monoChains.add(i)}},e.prototype.computeNodes=function(e){for(var t=(this._nodedSegStrings=e).iterator();t.hasNext();)this.add(t.next());this.intersectChains()},e.prototype.intersectChains=function(){for(var e=new Ld(this._segInt),t=this._monoChains.iterator();t.hasNext();)for(var i=t.next(),r=this._index.query(i.getEnvelope()).iterator();r.hasNext();){var n=r.next();if(n.getId()>i.getId()&&(i.computeOverlaps(n,e),this._nOverlaps++),this._segInt.isDone())return null}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},i.SegmentOverlapAction.get=function(){return Ld},Object.defineProperties(e,i),e}(Od),Ld=function(o){function e(){o.call(this),this._si=null;var e=arguments[0];this._si=e}return o&&(e.__proto__=o),((e.prototype=Object.create(o&&o.prototype)).constructor=e).prototype.overlap=function(){if(4!==arguments.length)return o.prototype.overlap.apply(this,arguments);var e=arguments[0],t=arguments[1],i=arguments[2],r=arguments[3],n=e.getContext(),a=i.getContext();this._si.processIntersections(n,t,a,r)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Pd),Nd=function e(){if(this._quadrantSegments=e.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=e.CAP_ROUND,this._joinStyle=e.JOIN_ROUND,this._mitreLimit=e.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=e.DEFAULT_SIMPLIFY_FACTOR,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this.setQuadrantSegments(t)}else if(2===arguments.length){var i=arguments[0],r=arguments[1];this.setQuadrantSegments(i),this.setEndCapStyle(r)}else if(4===arguments.length){var n=arguments[0],a=arguments[1],o=arguments[2],s=arguments[3];this.setQuadrantSegments(n),this.setEndCapStyle(a),this.setJoinStyle(o),this.setMitreLimit(s)}},kd={CAP_ROUND:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},JOIN_ROUND:{configurable:!0},JOIN_MITRE:{configurable:!0},JOIN_BEVEL:{configurable:!0},DEFAULT_QUADRANT_SEGMENTS:{configurable:!0},DEFAULT_MITRE_LIMIT:{configurable:!0},DEFAULT_SIMPLIFY_FACTOR:{configurable:!0}};Nd.prototype.getEndCapStyle=function(){return this._endCapStyle},Nd.prototype.isSingleSided=function(){return this._isSingleSided},Nd.prototype.setQuadrantSegments=function(e){this._quadrantSegments=e,0===this._quadrantSegments&&(this._joinStyle=Nd.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=Nd.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),e<=0&&(this._quadrantSegments=1),this._joinStyle!==Nd.JOIN_ROUND&&(this._quadrantSegments=Nd.DEFAULT_QUADRANT_SEGMENTS)},Nd.prototype.getJoinStyle=function(){return this._joinStyle},Nd.prototype.setJoinStyle=function(e){this._joinStyle=e},Nd.prototype.setSimplifyFactor=function(e){this._simplifyFactor=e<0?0:e},Nd.prototype.getSimplifyFactor=function(){return this._simplifyFactor},Nd.prototype.getQuadrantSegments=function(){return this._quadrantSegments},Nd.prototype.setEndCapStyle=function(e){this._endCapStyle=e},Nd.prototype.getMitreLimit=function(){return this._mitreLimit},Nd.prototype.setMitreLimit=function(e){this._mitreLimit=e},Nd.prototype.setSingleSided=function(e){this._isSingleSided=e},Nd.prototype.interfaces_=function(){return[]},Nd.prototype.getClass=function(){return Nd},Nd.bufferDistanceError=function(e){var t=Math.PI/2/e;return 1-Math.cos(t/2)},kd.CAP_ROUND.get=function(){return 1},kd.CAP_FLAT.get=function(){return 2},kd.CAP_SQUARE.get=function(){return 3},kd.JOIN_ROUND.get=function(){return 1},kd.JOIN_MITRE.get=function(){return 2},kd.JOIN_BEVEL.get=function(){return 3},kd.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8},kd.DEFAULT_MITRE_LIMIT.get=function(){return 5},kd.DEFAULT_SIMPLIFY_FACTOR.get=function(){return.01},Object.defineProperties(Nd,kd);var Bd=function(e){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=eu.COUNTERCLOCKWISE,this._inputLine=e||null},Fd={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};Bd.prototype.isDeletable=function(e,t,i,r){var n=this._inputLine[e],a=this._inputLine[t],o=this._inputLine[i];return!!this.isConcave(n,a,o)&&!!this.isShallow(n,a,o,r)&&this.isShallowSampled(n,a,e,i,r)},Bd.prototype.deleteShallowConcavities=function(){for(var e=1,t=this.findNextNonDeletedIndex(e),i=this.findNextNonDeletedIndex(t),r=!1;i<this._inputLine.length;){var n=!1;this.isDeletable(e,t,i,this._distanceTol)&&(this._isDeleted[t]=Bd.DELETE,r=n=!0),e=n?i:t,t=this.findNextNonDeletedIndex(e),i=this.findNextNonDeletedIndex(t)}return r},Bd.prototype.isShallowConcavity=function(e,t,i,r){return eu.computeOrientation(e,t,i)===this._angleOrientation&&eu.distancePointLine(t,e,i)<r},Bd.prototype.isShallowSampled=function(e,t,i,r,n){var a=Math.trunc((r-i)/Bd.NUM_PTS_TO_CHECK);a<=0&&(a=1);for(var o=i;o<r;o+=a)if(!this.isShallow(e,t,this._inputLine[o],n))return!1;return!0},Bd.prototype.isConcave=function(e,t,i){var r=eu.computeOrientation(e,t,i)===this._angleOrientation;return r},Bd.prototype.simplify=function(e){this._distanceTol=Math.abs(e),e<0&&(this._angleOrientation=eu.CLOCKWISE),this._isDeleted=new Array(this._inputLine.length).fill(null);for(;this.deleteShallowConcavities(););return this.collapseLine()},Bd.prototype.findNextNonDeletedIndex=function(e){for(var t=e+1;t<this._inputLine.length&&this._isDeleted[t]===Bd.DELETE;)t++;return t},Bd.prototype.isShallow=function(e,t,i,r){return eu.distancePointLine(t,e,i)<r},Bd.prototype.collapseLine=function(){for(var e=new Cu,t=0;t<this._inputLine.length;t++)this._isDeleted[t]!==Bd.DELETE&&e.add(this._inputLine[t]);return e.toCoordinateArray()},Bd.prototype.interfaces_=function(){return[]},Bd.prototype.getClass=function(){return Bd},Bd.simplify=function(e,t){return new Bd(e).simplify(t)},Fd.INIT.get=function(){return 0},Fd.DELETE.get=function(){return 1},Fd.KEEP.get=function(){return 1},Fd.NUM_PTS_TO_CHECK.get=function(){return 10},Object.defineProperties(Bd,Fd);var Vd=function(){this._ptList=null,this._precisionModel=null,this._minimimVertexDistance=0,this._ptList=new vu},zd={COORDINATE_ARRAY_TYPE:{configurable:!0}};Vd.prototype.getCoordinates=function(){return this._ptList.toArray(Vd.COORDINATE_ARRAY_TYPE)},Vd.prototype.setPrecisionModel=function(e){this._precisionModel=e},Vd.prototype.addPt=function(e){var t=new yl(e);if(this._precisionModel.makePrecise(t),this.isRedundant(t))return null;this._ptList.add(t)},Vd.prototype.revere=function(){},Vd.prototype.addPts=function(e,t){if(t)for(var i=0;i<e.length;i++)this.addPt(e[i]);else for(var r=e.length-1;0<=r;r--)this.addPt(e[r])},Vd.prototype.isRedundant=function(e){if(this._ptList.size()<1)return!1;var t=this._ptList.get(this._ptList.size()-1);return e.distance(t)<this._minimimVertexDistance},Vd.prototype.toString=function(){return(new Tc).createLineString(this.getCoordinates()).toString()},Vd.prototype.closeRing=function(){if(this._ptList.size()<1)return null;var e=new yl(this._ptList.get(0)),t=this._ptList.get(this._ptList.size()-1);if(e.equals(t))return null;this._ptList.add(e)},Vd.prototype.setMinimumVertexDistance=function(e){this._minimimVertexDistance=e},Vd.prototype.interfaces_=function(){return[]},Vd.prototype.getClass=function(){return Vd},zd.COORDINATE_ARRAY_TYPE.get=function(){return new Array(0).fill(null)},Object.defineProperties(Vd,zd);var Ud=function(){},Gd={PI_TIMES_2:{configurable:!0},PI_OVER_2:{configurable:!0},PI_OVER_4:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},CLOCKWISE:{configurable:!0},NONE:{configurable:!0}};Ud.prototype.interfaces_=function(){return[]},Ud.prototype.getClass=function(){return Ud},Ud.toDegrees=function(e){return 180*e/Math.PI},Ud.normalize=function(e){for(;e>Math.PI;)e-=Ud.PI_TIMES_2;for(;e<=-Math.PI;)e+=Ud.PI_TIMES_2;return e},Ud.angle=function(){if(1===arguments.length){var e=arguments[0];return Math.atan2(e.y,e.x)}if(2===arguments.length){var t=arguments[0],i=arguments[1],r=i.x-t.x,n=i.y-t.y;return Math.atan2(n,r)}},Ud.isAcute=function(e,t,i){var r=e.x-t.x,n=e.y-t.y;return 0<r*(i.x-t.x)+n*(i.y-t.y)},Ud.isObtuse=function(e,t,i){var r=e.x-t.x,n=e.y-t.y;return r*(i.x-t.x)+n*(i.y-t.y)<0},Ud.interiorAngle=function(e,t,i){var r=Ud.angle(t,e),n=Ud.angle(t,i);return Math.abs(n-r)},Ud.normalizePositive=function(e){if(e<0){for(;e<0;)e+=Ud.PI_TIMES_2;Ud.PI_TIMES_2<=e&&(e=0)}else{for(;Ud.PI_TIMES_2<=e;)e-=Ud.PI_TIMES_2;e<0&&(e=0)}return e},Ud.angleBetween=function(e,t,i){var r=Ud.angle(t,e),n=Ud.angle(t,i);return Ud.diff(r,n)},Ud.diff=function(e,t){var i=null;return(i=e<t?t-e:e-t)>Math.PI&&(i=2*Math.PI-i),i},Ud.toRadians=function(e){return e*Math.PI/180},Ud.getTurn=function(e,t){var i=Math.sin(t-e);return 0<i?Ud.COUNTERCLOCKWISE:i<0?Ud.CLOCKWISE:Ud.NONE},Ud.angleBetweenOriented=function(e,t,i){var r=Ud.angle(t,e),n=Ud.angle(t,i)-r;return n<=-Math.PI?n+Ud.PI_TIMES_2:n>Math.PI?n-Ud.PI_TIMES_2:n},Gd.PI_TIMES_2.get=function(){return 2*Math.PI},Gd.PI_OVER_2.get=function(){return Math.PI/2},Gd.PI_OVER_4.get=function(){return Math.PI/4},Gd.COUNTERCLOCKWISE.get=function(){return eu.COUNTERCLOCKWISE},Gd.CLOCKWISE.get=function(){return eu.CLOCKWISE},Gd.NONE.get=function(){return eu.COLLINEAR},Object.defineProperties(Ud,Gd);var $d=function e(){this._maxCurveSegmentError=0,this._filletAngleQuantum=null,this._closingSegLengthFactor=1,this._segList=null,this._distance=0,this._precisionModel=null,this._bufParams=null,this._li=null,this._s0=null,this._s1=null,this._s2=null,this._seg0=new Ed,this._seg1=new Ed,this._offset0=new Ed,this._offset1=new Ed,this._side=0,this._hasNarrowConcaveAngle=!1;var t=arguments[0],i=arguments[1],r=arguments[2];this._precisionModel=t,this._bufParams=i,this._li=new Zl,this._filletAngleQuantum=Math.PI/2/i.getQuadrantSegments(),8<=i.getQuadrantSegments()&&i.getJoinStyle()===Nd.JOIN_ROUND&&(this._closingSegLengthFactor=e.MAX_CLOSING_SEG_LEN_FACTOR),this.init(r)},Hd={OFFSET_SEGMENT_SEPARATION_FACTOR:{configurable:!0},INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},CURVE_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},MAX_CLOSING_SEG_LEN_FACTOR:{configurable:!0}};$d.prototype.addNextSegment=function(e,t){if(this._s0=this._s1,this._s1=this._s2,this._s2=e,this._seg0.setCoordinates(this._s0,this._s1),this.computeOffsetSegment(this._seg0,this._side,this._distance,this._offset0),this._seg1.setCoordinates(this._s1,this._s2),this.computeOffsetSegment(this._seg1,this._side,this._distance,this._offset1),this._s1.equals(this._s2))return null;var i=eu.computeOrientation(this._s0,this._s1,this._s2),r=i===eu.CLOCKWISE&&this._side===Nc.LEFT||i===eu.COUNTERCLOCKWISE&&this._side===Nc.RIGHT;0===i?this.addCollinear(t):r?this.addOutsideTurn(i,t):this.addInsideTurn(i,t)},$d.prototype.addLineEndCap=function(e,t){var i=new Ed(e,t),r=new Ed;this.computeOffsetSegment(i,Nc.LEFT,this._distance,r);var n=new Ed;this.computeOffsetSegment(i,Nc.RIGHT,this._distance,n);var a=t.x-e.x,o=t.y-e.y,s=Math.atan2(o,a);switch(this._bufParams.getEndCapStyle()){case Nd.CAP_ROUND:this._segList.addPt(r.p1),this.addFilletArc(t,s+Math.PI/2,s-Math.PI/2,eu.CLOCKWISE,this._distance),this._segList.addPt(n.p1);break;case Nd.CAP_FLAT:this._segList.addPt(r.p1),this._segList.addPt(n.p1);break;case Nd.CAP_SQUARE:var l=new yl;l.x=Math.abs(this._distance)*Math.cos(s),l.y=Math.abs(this._distance)*Math.sin(s);var u=new yl(r.p1.x+l.x,r.p1.y+l.y),c=new yl(n.p1.x+l.x,n.p1.y+l.y);this._segList.addPt(u),this._segList.addPt(c)}},$d.prototype.getCoordinates=function(){return this._segList.getCoordinates()},$d.prototype.addMitreJoin=function(e,t,i,r){var n=!0,a=null;try{a=Fl.intersection(t.p0,t.p1,i.p0,i.p1),(r<=0?1:a.distance(e)/Math.abs(r))>this._bufParams.getMitreLimit()&&(n=!1)}catch(e){if(!(e instanceof kl))throw e;a=new yl(0,0),n=!1}n?this._segList.addPt(a):this.addLimitedMitreJoin(t,i,r,this._bufParams.getMitreLimit())},$d.prototype.addFilletCorner=function(e,t,i,r,n){var a=t.x-e.x,o=t.y-e.y,s=Math.atan2(o,a),l=i.x-e.x,u=i.y-e.y,c=Math.atan2(u,l);r===eu.CLOCKWISE?s<=c&&(s+=2*Math.PI):c<=s&&(s-=2*Math.PI),this._segList.addPt(t),this.addFilletArc(e,s,c,r,n),this._segList.addPt(i)},$d.prototype.addOutsideTurn=function(e,t){if(this._offset0.p1.distance(this._offset1.p0)<this._distance*$d.OFFSET_SEGMENT_SEPARATION_FACTOR)return this._segList.addPt(this._offset0.p1),null;this._bufParams.getJoinStyle()===Nd.JOIN_MITRE?this.addMitreJoin(this._s1,this._offset0,this._offset1,this._distance):this._bufParams.getJoinStyle()===Nd.JOIN_BEVEL?this.addBevelJoin(this._offset0,this._offset1):(t&&this._segList.addPt(this._offset0.p1),this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,e,this._distance),this._segList.addPt(this._offset1.p0))},$d.prototype.createSquare=function(e){this._segList.addPt(new yl(e.x+this._distance,e.y+this._distance)),this._segList.addPt(new yl(e.x+this._distance,e.y-this._distance)),this._segList.addPt(new yl(e.x-this._distance,e.y-this._distance)),this._segList.addPt(new yl(e.x-this._distance,e.y+this._distance)),this._segList.closeRing()},$d.prototype.addSegments=function(e,t){this._segList.addPts(e,t)},$d.prototype.addFirstSegment=function(){this._segList.addPt(this._offset1.p0)},$d.prototype.addLastSegment=function(){this._segList.addPt(this._offset1.p1)},$d.prototype.initSideSegments=function(e,t,i){this._s1=e,this._s2=t,this._side=i,this._seg1.setCoordinates(e,t),this.computeOffsetSegment(this._seg1,i,this._distance,this._offset1)},$d.prototype.addLimitedMitreJoin=function(e,t,i,r){var n=this._seg0.p1,a=Ud.angle(n,this._seg0.p0),o=Ud.angleBetweenOriented(this._seg0.p0,n,this._seg1.p1)/2,s=Ud.normalize(a+o),l=Ud.normalize(s+Math.PI),u=r*i,c=i-u*Math.abs(Math.sin(o)),d=n.x+u*Math.cos(l),h=n.y+u*Math.sin(l),p=new yl(d,h),f=new Ed(n,p),m=f.pointAlongOffset(1,c),g=f.pointAlongOffset(1,-c);this._side===Nc.LEFT?(this._segList.addPt(m),this._segList.addPt(g)):(this._segList.addPt(g),this._segList.addPt(m))},$d.prototype.computeOffsetSegment=function(e,t,i,r){var n=t===Nc.LEFT?1:-1,a=e.p1.x-e.p0.x,o=e.p1.y-e.p0.y,s=Math.sqrt(a*a+o*o),l=n*i*a/s,u=n*i*o/s;r.p0.x=e.p0.x-u,r.p0.y=e.p0.y+l,r.p1.x=e.p1.x-u,r.p1.y=e.p1.y+l},$d.prototype.addFilletArc=function(e,t,i,r,n){var a=r===eu.CLOCKWISE?-1:1,o=Math.abs(t-i),s=Math.trunc(o/this._filletAngleQuantum+.5);if(s<1)return null;for(var l=o/s,u=0,c=new yl;u<o;){var d=t+a*u;c.x=e.x+n*Math.cos(d),c.y=e.y+n*Math.sin(d),this._segList.addPt(c),u+=l}},$d.prototype.addInsideTurn=function(e,t){if(this._li.computeIntersection(this._offset0.p0,this._offset0.p1,this._offset1.p0,this._offset1.p1),this._li.hasIntersection())this._segList.addPt(this._li.getIntersection(0));else if(this._hasNarrowConcaveAngle=!0,this._offset0.p1.distance(this._offset1.p0)<this._distance*$d.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR)this._segList.addPt(this._offset0.p1);else{if(this._segList.addPt(this._offset0.p1),0<this._closingSegLengthFactor){var i=new yl((this._closingSegLengthFactor*this._offset0.p1.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset0.p1.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(i);var r=new yl((this._closingSegLengthFactor*this._offset1.p0.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset1.p0.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(r)}else this._segList.addPt(this._s1);this._segList.addPt(this._offset1.p0)}},$d.prototype.createCircle=function(e){var t=new yl(e.x+this._distance,e.y);this._segList.addPt(t),this.addFilletArc(e,0,2*Math.PI,-1,this._distance),this._segList.closeRing()},$d.prototype.addBevelJoin=function(e,t){this._segList.addPt(e.p1),this._segList.addPt(t.p0)},$d.prototype.init=function(e){this._distance=e,this._maxCurveSegmentError=e*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new Vd,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(e*$d.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},$d.prototype.addCollinear=function(e){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2),2<=this._li.getIntersectionNum()&&(this._bufParams.getJoinStyle()===Nd.JOIN_BEVEL||this._bufParams.getJoinStyle()===Nd.JOIN_MITRE?(e&&this._segList.addPt(this._offset0.p1),this._segList.addPt(this._offset1.p0)):this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,eu.CLOCKWISE,this._distance))},$d.prototype.closeRing=function(){this._segList.closeRing()},$d.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle},$d.prototype.interfaces_=function(){return[]},$d.prototype.getClass=function(){return $d},Hd.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return.001},Hd.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return.001},Hd.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},Hd.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties($d,Hd);var Wd=function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var e=arguments[0],t=arguments[1];this._precisionModel=e,this._bufParams=t};Wd.prototype.getOffsetCurve=function(e,t){if(0===(this._distance=t))return null;var i=t<0,r=Math.abs(t),n=this.getSegGen(r);e.length<=1?this.computePointCurve(e[0],n):this.computeOffsetCurve(e,i,n);var a=n.getCoordinates();return i&&xu.reverse(a),a},Wd.prototype.computeSingleSidedBufferCurve=function(e,t,i){var r=this.simplifyTolerance(this._distance);if(t){i.addSegments(e,!0);var n=Bd.simplify(e,-r),a=n.length-1;i.initSideSegments(n[a],n[a-1],Nc.LEFT),i.addFirstSegment();for(var o=a-2;0<=o;o--)i.addNextSegment(n[o],!0)}else{i.addSegments(e,!1);var s=Bd.simplify(e,r),l=s.length-1;i.initSideSegments(s[0],s[1],Nc.LEFT),i.addFirstSegment();for(var u=2;u<=l;u++)i.addNextSegment(s[u],!0)}i.addLastSegment(),i.closeRing()},Wd.prototype.computeRingBufferCurve=function(e,t,i){var r=this.simplifyTolerance(this._distance);t===Nc.RIGHT&&(r=-r);var n=Bd.simplify(e,r),a=n.length-1;i.initSideSegments(n[a-1],n[0],t);for(var o=1;o<=a;o++){var s=1!==o;i.addNextSegment(n[o],s)}i.closeRing()},Wd.prototype.computeLineBufferCurve=function(e,t){var i=this.simplifyTolerance(this._distance),r=Bd.simplify(e,i),n=r.length-1;t.initSideSegments(r[0],r[1],Nc.LEFT);for(var a=2;a<=n;a++)t.addNextSegment(r[a],!0);t.addLastSegment(),t.addLineEndCap(r[n-1],r[n]);var o=Bd.simplify(e,-i),s=o.length-1;t.initSideSegments(o[s],o[s-1],Nc.LEFT);for(var l=s-2;0<=l;l--)t.addNextSegment(o[l],!0);t.addLastSegment(),t.addLineEndCap(o[1],o[0]),t.closeRing()},Wd.prototype.computePointCurve=function(e,t){switch(this._bufParams.getEndCapStyle()){case Nd.CAP_ROUND:t.createCircle(e);break;case Nd.CAP_SQUARE:t.createSquare(e)}},Wd.prototype.getLineCurve=function(e,t){if((this._distance=t)<0&&!this._bufParams.isSingleSided())return null;if(0===t)return null;var i=Math.abs(t),r=this.getSegGen(i);if(e.length<=1)this.computePointCurve(e[0],r);else if(this._bufParams.isSingleSided()){var n=t<0;this.computeSingleSidedBufferCurve(e,n,r)}else this.computeLineBufferCurve(e,r);return r.getCoordinates()},Wd.prototype.getBufferParameters=function(){return this._bufParams},Wd.prototype.simplifyTolerance=function(e){return e*this._bufParams.getSimplifyFactor()},Wd.prototype.getRingCurve=function(e,t,i){if(this._distance=i,e.length<=2)return this.getLineCurve(e,i);if(0===i)return Wd.copyCoordinates(e);var r=this.getSegGen(i);return this.computeRingBufferCurve(e,t,r),r.getCoordinates()},Wd.prototype.computeOffsetCurve=function(e,t,i){var r=this.simplifyTolerance(this._distance);if(t){var n=Bd.simplify(e,-r),a=n.length-1;i.initSideSegments(n[a],n[a-1],Nc.LEFT),i.addFirstSegment();for(var o=a-2;0<=o;o--)i.addNextSegment(n[o],!0)}else{var s=Bd.simplify(e,r),l=s.length-1;i.initSideSegments(s[0],s[1],Nc.LEFT),i.addFirstSegment();for(var u=2;u<=l;u++)i.addNextSegment(s[u],!0)}i.addLastSegment()},Wd.prototype.getSegGen=function(e){return new $d(this._precisionModel,this._bufParams,e)},Wd.prototype.interfaces_=function(){return[]},Wd.prototype.getClass=function(){return Wd},Wd.copyCoordinates=function(e){for(var t=new Array(e.length).fill(null),i=0;i<t.length;i++)t[i]=new yl(e[i]);return t};var jd=function(){this._subgraphs=null,this._seg=new Ed,this._cga=new eu;var e=arguments[0];this._subgraphs=e},qd={DepthSegment:{configurable:!0}};jd.prototype.findStabbedSegments=function(){var e=this;if(1===arguments.length){for(var t=arguments[0],i=new vu,r=this._subgraphs.iterator();r.hasNext();){var n=r.next(),a=n.getEnvelope();t.y<a.getMinY()||t.y>a.getMaxY()||e.findStabbedSegments(t,n.getDirectedEdges(),i)}return i}if(3===arguments.length)if(Al(arguments[2],gu)&&arguments[0]instanceof yl&&arguments[1]instanceof ed)for(var o=arguments[0],s=arguments[1],l=arguments[2],u=s.getEdge().getCoordinates(),c=0;c<u.length-1;c++){e._seg.p0=u[c],e._seg.p1=u[c+1],e._seg.p0.y>e._seg.p1.y&&e._seg.reverse();var d=Math.max(e._seg.p0.x,e._seg.p1.x);if(!(d<o.x||e._seg.isHorizontal()||o.y<e._seg.p0.y||o.y>e._seg.p1.y||eu.computeOrientation(e._seg.p0,e._seg.p1,o)===eu.RIGHT)){var h=s.getDepth(Nc.LEFT);e._seg.p0.equals(u[c])||(h=s.getDepth(Nc.RIGHT));var p=new Qd(e._seg,h);l.add(p)}}else if(Al(arguments[2],gu)&&arguments[0]instanceof yl&&Al(arguments[1],gu))for(var f=arguments[0],m=arguments[1],g=arguments[2],y=m.iterator();y.hasNext();){var v=y.next();v.isForward()&&e.findStabbedSegments(f,v,g)}},jd.prototype.getDepth=function(e){var t=this.findStabbedSegments(e);return 0===t.size()?0:dd.min(t)._leftDepth},jd.prototype.interfaces_=function(){return[]},jd.prototype.getClass=function(){return jd},qd.DepthSegment.get=function(){return Qd},Object.defineProperties(jd,qd);var Qd=function(){this._upwardSeg=null,this._leftDepth=null;var e=arguments[0],t=arguments[1];this._upwardSeg=new Ed(e),this._leftDepth=t};Qd.prototype.compareTo=function(e){var t=e;if(this._upwardSeg.minX()>=t._upwardSeg.maxX())return 1;if(this._upwardSeg.maxX()<=t._upwardSeg.minX())return-1;var i=this._upwardSeg.orientationIndex(t._upwardSeg);return 0!==i||0!=(i=-1*t._upwardSeg.orientationIndex(this._upwardSeg))?i:this._upwardSeg.compareTo(t._upwardSeg)},Qd.prototype.compareX=function(e,t){var i=e.p0.compareTo(t.p0);return 0!==i?i:e.p1.compareTo(t.p1)},Qd.prototype.toString=function(){return this._upwardSeg.toString()},Qd.prototype.interfaces_=function(){return[pl]},Qd.prototype.getClass=function(){return Qd};var Yd=function(e,t,i){this.p0=e||null,this.p1=t||null,this.p2=i||null};Yd.prototype.area=function(){return Yd.area(this.p0,this.p1,this.p2)},Yd.prototype.signedArea=function(){return Yd.signedArea(this.p0,this.p1,this.p2)},Yd.prototype.interpolateZ=function(e){if(null===e)throw new cl("Supplied point is null.");return Yd.interpolateZ(e,this.p0,this.p1,this.p2)},Yd.prototype.longestSideLength=function(){return Yd.longestSideLength(this.p0,this.p1,this.p2)},Yd.prototype.isAcute=function(){return Yd.isAcute(this.p0,this.p1,this.p2)},Yd.prototype.circumcentre=function(){return Yd.circumcentre(this.p0,this.p1,this.p2)},Yd.prototype.area3D=function(){return Yd.area3D(this.p0,this.p1,this.p2)},Yd.prototype.centroid=function(){return Yd.centroid(this.p0,this.p1,this.p2)},Yd.prototype.inCentre=function(){return Yd.inCentre(this.p0,this.p1,this.p2)},Yd.prototype.interfaces_=function(){return[]},Yd.prototype.getClass=function(){return Yd},Yd.area=function(e,t,i){return Math.abs(((i.x-e.x)*(t.y-e.y)-(t.x-e.x)*(i.y-e.y))/2)},Yd.signedArea=function(e,t,i){return((i.x-e.x)*(t.y-e.y)-(t.x-e.x)*(i.y-e.y))/2},Yd.det=function(e,t,i,r){return e*r-t*i},Yd.interpolateZ=function(e,t,i,r){var n=t.x,a=t.y,o=i.x-n,s=r.x-n,l=i.y-a,u=r.y-a,c=o*u-s*l,d=e.x-n,h=e.y-a,p=(u*d-s*h)/c,f=(-l*d+o*h)/c;return t.z+p*(i.z-t.z)+f*(r.z-t.z)},Yd.longestSideLength=function(e,t,i){var r=e.distance(t),n=t.distance(i),a=i.distance(e),o=r;return o<n&&(o=n),o<a&&(o=a),o},Yd.isAcute=function(e,t,i){return!!Ud.isAcute(e,t,i)&&!!Ud.isAcute(t,i,e)&&!!Ud.isAcute(i,e,t)},Yd.circumcentre=function(e,t,i){var r=i.x,n=i.y,a=e.x-r,o=e.y-n,s=t.x-r,l=t.y-n,u=2*Yd.det(a,o,s,l),c=Yd.det(o,a*a+o*o,l,s*s+l*l),d=Yd.det(a,a*a+o*o,s,s*s+l*l);return new yl(r-c/u,n+d/u)},Yd.perpendicularBisector=function(e,t){var i=t.x-e.x,r=t.y-e.y,n=new Fl(e.x+i/2,e.y+r/2,1),a=new Fl(e.x-r+i/2,e.y+i+r/2,1);return new Fl(n,a)},Yd.angleBisector=function(e,t,i){var r=t.distance(e),n=r/(r+t.distance(i)),a=i.x-e.x,o=i.y-e.y;return new yl(e.x+n*a,e.y+n*o)},Yd.area3D=function(e,t,i){var r=t.x-e.x,n=t.y-e.y,a=t.z-e.z,o=i.x-e.x,s=i.y-e.y,l=i.z-e.z,u=n*l-a*s,c=a*o-r*l,d=r*s-n*o,h=u*u+c*c+d*d,p=Math.sqrt(h)/2;return p},Yd.centroid=function(e,t,i){var r=(e.x+t.x+i.x)/3,n=(e.y+t.y+i.y)/3;return new yl(r,n)},Yd.inCentre=function(e,t,i){var r=t.distance(i),n=e.distance(i),a=e.distance(t),o=r+n+a,s=(r*e.x+n*t.x+a*i.x)/o,l=(r*e.y+n*t.y+a*i.y)/o;return new yl(s,l)};var Xd=function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new vu;var e=arguments[0],t=arguments[1],i=arguments[2];this._inputGeom=e,this._distance=t,this._curveBuilder=i};Xd.prototype.addPoint=function(e){if(this._distance<=0)return null;var t=e.getCoordinates(),i=this._curveBuilder.getLineCurve(t,this._distance);this.addCurve(i,xl.EXTERIOR,xl.INTERIOR)},Xd.prototype.addPolygon=function(e){var t=this._distance,i=Nc.LEFT;this._distance<0&&(t=-this._distance,i=Nc.RIGHT);var r=e.getExteriorRing(),n=xu.removeRepeatedPoints(r.getCoordinates());if(this._distance<0&&this.isErodedCompletely(r,this._distance))return null;if(this._distance<=0&&n.length<3)return null;this.addPolygonRing(n,t,i,xl.EXTERIOR,xl.INTERIOR);for(var a=0;a<e.getNumInteriorRing();a++){var o=e.getInteriorRingN(a),s=xu.removeRepeatedPoints(o.getCoordinates());0<this._distance&&this.isErodedCompletely(o,-this._distance)||this.addPolygonRing(s,t,Nc.opposite(i),xl.INTERIOR,xl.EXTERIOR)}},Xd.prototype.isTriangleErodedCompletely=function(e,t){var i=new Yd(e[0],e[1],e[2]),r=i.inCentre();return eu.distancePointLine(r,i.p0,i.p1)<Math.abs(t)},Xd.prototype.addLineString=function(e){if(this._distance<=0&&!this._curveBuilder.getBufferParameters().isSingleSided())return null;var t=xu.removeRepeatedPoints(e.getCoordinates()),i=this._curveBuilder.getLineCurve(t,this._distance);this.addCurve(i,xl.EXTERIOR,xl.INTERIOR)},Xd.prototype.addCurve=function(e,t,i){if(null===e||e.length<2)return null;var r=new wd(e,new Hc(0,xl.BOUNDARY,t,i));this._curveList.add(r)},Xd.prototype.getCurves=function(){return this.add(this._inputGeom),this._curveList},Xd.prototype.addPolygonRing=function(e,t,i,r,n){if(0===t&&e.length<dc.MINIMUM_VALID_SIZE)return null;var a=r,o=n;e.length>=dc.MINIMUM_VALID_SIZE&&eu.isCCW(e)&&(a=n,o=r,i=Nc.opposite(i));var s=this._curveBuilder.getRingCurve(e,i,t);this.addCurve(s,a,o)},Xd.prototype.add=function(e){if(e.isEmpty())return null;e instanceof uc?this.addPolygon(e):e instanceof ac?this.addLineString(e):e instanceof sc?this.addPoint(e):(e instanceof cc||e instanceof qu||e instanceof hc||e instanceof ju)&&this.addCollection(e)},Xd.prototype.isErodedCompletely=function(e,t){var i=e.getCoordinates();if(i.length<4)return t<0;if(4===i.length)return this.isTriangleErodedCompletely(i,t);var r=e.getEnvelopeInternal(),n=Math.min(r.getHeight(),r.getWidth());return t<0&&2*Math.abs(t)>n},Xd.prototype.addCollection=function(e){for(var t=0;t<e.getNumGeometries();t++){var i=e.getGeometryN(t);this.add(i)}},Xd.prototype.interfaces_=function(){return[]},Xd.prototype.getClass=function(){return Xd};var Zd=function(){};Zd.prototype.locate=function(e){},Zd.prototype.interfaces_=function(){return[]},Zd.prototype.getClass=function(){return Zd};var Jd=function(){this._parent=null,this._atStart=null,this._max=null,this._index=null,this._subcollectionIterator=null;var e=arguments[0];this._parent=e,this._atStart=!0,this._index=0,this._max=e.getNumGeometries()};Jd.prototype.next=function(){if(this._atStart)return this._atStart=!1,Jd.isAtomic(this._parent)&&this._index++,this._parent;if(null!==this._subcollectionIterator){if(this._subcollectionIterator.hasNext())return this._subcollectionIterator.next();this._subcollectionIterator=null}if(this._index>=this._max)throw new yu;var e=this._parent.getGeometryN(this._index++);return e instanceof ju?(this._subcollectionIterator=new Jd(e),this._subcollectionIterator.next()):e},Jd.prototype.remove=function(){throw new Error(this.getClass().getName())},Jd.prototype.hasNext=function(){if(this._atStart)return!0;if(null!==this._subcollectionIterator){if(this._subcollectionIterator.hasNext())return!0;this._subcollectionIterator=null}return!(this._index>=this._max)},Jd.prototype.interfaces_=function(){return[mu]},Jd.prototype.getClass=function(){return Jd},Jd.isAtomic=function(e){return!(e instanceof ju)};var Kd=function(){this._geom=null;var e=arguments[0];this._geom=e};Kd.prototype.locate=function(e){return Kd.locate(e,this._geom)},Kd.prototype.interfaces_=function(){return[Zd]},Kd.prototype.getClass=function(){return Kd},Kd.isPointInRing=function(e,t){return!!t.getEnvelopeInternal().intersects(e)&&eu.isPointInRing(e,t.getCoordinates())},Kd.containsPointInPolygon=function(e,t){if(t.isEmpty())return!1;var i=t.getExteriorRing();if(!Kd.isPointInRing(e,i))return!1;for(var r=0;r<t.getNumInteriorRing();r++){var n=t.getInteriorRingN(r);if(Kd.isPointInRing(e,n))return!1}return!0},Kd.containsPoint=function(e,t){if(t instanceof uc)return Kd.containsPointInPolygon(e,t);if(t instanceof ju)for(var i=new Jd(t);i.hasNext();){var r=i.next();if(r!==t&&Kd.containsPoint(e,r))return!0}return!1},Kd.locate=function(e,t){return t.isEmpty()?xl.EXTERIOR:Kd.containsPoint(e,t)?xl.INTERIOR:xl.EXTERIOR};var eh=function(){this._edgeMap=new ku,this._edgeList=null,this._ptInAreaLocation=[xl.NONE,xl.NONE]};eh.prototype.getNextCW=function(e){this.getEdges();var t=this._edgeList.indexOf(e),i=t-1;return 0===t&&(i=this._edgeList.size()-1),this._edgeList.get(i)},eh.prototype.propagateSideLabels=function(e){for(var t=xl.NONE,i=this.iterator();i.hasNext();){var r=i.next().getLabel();r.isArea(e)&&r.getLocation(e,Nc.LEFT)!==xl.NONE&&(t=r.getLocation(e,Nc.LEFT))}if(t===xl.NONE)return null;for(var n=t,a=this.iterator();a.hasNext();){var o=a.next(),s=o.getLabel();if(s.getLocation(e,Nc.ON)===xl.NONE&&s.setLocation(e,Nc.ON,n),s.isArea(e)){var l=s.getLocation(e,Nc.LEFT),u=s.getLocation(e,Nc.RIGHT);if(u!==xl.NONE){if(u!==n)throw new zc("side location conflict",o.getCoordinate());l===xl.NONE&&Ql.shouldNeverReachHere("found single null side (at "+o.getCoordinate()+")"),n=l}else Ql.isTrue(s.getLocation(e,Nc.LEFT)===xl.NONE,"found single null side"),s.setLocation(e,Nc.RIGHT,n),s.setLocation(e,Nc.LEFT,n)}}},eh.prototype.getCoordinate=function(){var e=this.iterator();return e.hasNext()?e.next().getCoordinate():null},eh.prototype.print=function(e){Bl.out.println("EdgeEndStar: "+this.getCoordinate());for(var t=this.iterator();t.hasNext();)t.next().print(e)},eh.prototype.isAreaLabelsConsistent=function(e){return this.computeEdgeEndLabels(e.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)},eh.prototype.checkAreaLabelsConsistent=function(e){var t=this.getEdges();if(t.size()<=0)return!0;var i=t.size()-1,r=t.get(i).getLabel().getLocation(e,Nc.LEFT);Ql.isTrue(r!==xl.NONE,"Found unlabelled area edge");for(var n=r,a=this.iterator();a.hasNext();){var o=a.next().getLabel();Ql.isTrue(o.isArea(e),"Found non-area edge");var s=o.getLocation(e,Nc.LEFT),l=o.getLocation(e,Nc.RIGHT);if(s===l)return!1;if(l!==n)return!1;n=s}return!0},eh.prototype.findIndex=function(e){this.iterator();for(var t=0;t<this._edgeList.size();t++)if(this._edgeList.get(t)===e)return t;return-1},eh.prototype.iterator=function(){return this.getEdges().iterator()},eh.prototype.getEdges=function(){return null===this._edgeList&&(this._edgeList=new vu(this._edgeMap.values())),this._edgeList},eh.prototype.getLocation=function(e,t,i){return this._ptInAreaLocation[e]===xl.NONE&&(this._ptInAreaLocation[e]=Kd.locate(t,i[e].getGeometry())),this._ptInAreaLocation[e]},eh.prototype.toString=function(){var e=new El;e.append("EdgeEndStar: "+this.getCoordinate()),e.append("\n");for(var t=this.iterator();t.hasNext();){var i=t.next();e.append(i),e.append("\n")}return e.toString()},eh.prototype.computeEdgeEndLabels=function(e){for(var t=this.iterator();t.hasNext();)t.next().computeLabel(e)},eh.prototype.computeLabelling=function(e){this.computeEdgeEndLabels(e[0].getBoundaryNodeRule()),this.propagateSideLabels(0),this.propagateSideLabels(1);for(var t=[!1,!1],i=this.iterator();i.hasNext();)for(var r=i.next().getLabel(),n=0;n<2;n++)r.isLine(n)&&r.getLocation(n)===xl.BOUNDARY&&(t[n]=!0);for(var a=this.iterator();a.hasNext();)for(var o=a.next(),s=o.getLabel(),l=0;l<2;l++)if(s.isAnyNull(l)){var u=xl.NONE;if(t[l])u=xl.EXTERIOR;else{var c=o.getCoordinate();u=this.getLocation(l,c,e)}s.setAllLocationsIfNull(l,u)}},eh.prototype.getDegree=function(){return this._edgeMap.size()},eh.prototype.insertEdgeEnd=function(e,t){this._edgeMap.put(e,t),this._edgeList=null},eh.prototype.interfaces_=function(){return[]},eh.prototype.getClass=function(){return eh};var th=function(a){function e(){a.call(this),this._resultAreaEdgeList=null,this._label=null,this._SCANNING_FOR_INCOMING=1,this._LINKING_TO_OUTGOING=2}return a&&(e.__proto__=a),((e.prototype=Object.create(a&&a.prototype)).constructor=e).prototype.linkResultDirectedEdges=function(){this.getResultAreaEdges();for(var e=null,t=null,i=this._SCANNING_FOR_INCOMING,r=0;r<this._resultAreaEdgeList.size();r++){var n=this._resultAreaEdgeList.get(r),a=n.getSym();if(n.getLabel().isArea())switch(null===e&&n.isInResult()&&(e=n),i){case this._SCANNING_FOR_INCOMING:if(!a.isInResult())continue;t=a,i=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(!n.isInResult())continue;t.setNext(n),i=this._SCANNING_FOR_INCOMING}}if(i===this._LINKING_TO_OUTGOING){if(null===e)throw new zc("no outgoing dirEdge found",this.getCoordinate());Ql.isTrue(e.isInResult(),"unable to link last incoming dirEdge"),t.setNext(e)}},e.prototype.insert=function(e){var t=e;this.insertEdgeEnd(t,t)},e.prototype.getRightmostEdge=function(){var e=this.getEdges(),t=e.size();if(t<1)return null;var i=e.get(0);if(1===t)return i;var r=e.get(t-1),n=i.getQuadrant(),a=r.getQuadrant();return Zc.isNorthern(n)&&Zc.isNorthern(a)?i:Zc.isNorthern(n)||Zc.isNorthern(a)?0!==i.getDy()?i:0!==r.getDy()?r:(Ql.shouldNeverReachHere("found two horizontal edges incident on node"),null):r},e.prototype.print=function(e){Bl.out.println("DirectedEdgeStar: "+this.getCoordinate());for(var t=this.iterator();t.hasNext();){var i=t.next();e.print("out "),i.print(e),e.println(),e.print("in "),i.getSym().print(e),e.println()}},e.prototype.getResultAreaEdges=function(){if(null!==this._resultAreaEdgeList)return this._resultAreaEdgeList;this._resultAreaEdgeList=new vu;for(var e=this.iterator();e.hasNext();){var t=e.next();(t.isInResult()||t.getSym().isInResult())&&this._resultAreaEdgeList.add(t)}return this._resultAreaEdgeList},e.prototype.updateLabelling=function(e){for(var t=this.iterator();t.hasNext();){var i=t.next().getLabel();i.setAllLocationsIfNull(0,e.getLocation(0)),i.setAllLocationsIfNull(1,e.getLocation(1))}},e.prototype.linkAllDirectedEdges=function(){this.getEdges();for(var e=null,t=null,i=this._edgeList.size()-1;0<=i;i--){var r=this._edgeList.get(i),n=r.getSym();null===t&&(t=n),null!==e&&n.setNext(e),e=r}t.setNext(e)},e.prototype.computeDepths=function(){if(1===arguments.length){var e=arguments[0],t=this.findIndex(e),i=e.getDepth(Nc.LEFT),r=e.getDepth(Nc.RIGHT),n=this.computeDepths(t+1,this._edgeList.size(),i),a=this.computeDepths(0,t,n);if(a!==r)throw new zc("depth mismatch at "+e.getCoordinate())}else if(3===arguments.length){for(var o=arguments[0],s=arguments[1],l=arguments[2],u=l,c=o;c<s;c++){var d=this._edgeList.get(c);d.setEdgeDepths(Nc.RIGHT,u),u=d.getDepth(Nc.LEFT)}return u}},e.prototype.mergeSymLabels=function(){for(var e=this.iterator();e.hasNext();){var t=e.next();t.getLabel().merge(t.getSym().getLabel())}},e.prototype.linkMinimalDirectedEdges=function(e){for(var t=null,i=null,r=this._SCANNING_FOR_INCOMING,n=this._resultAreaEdgeList.size()-1;0<=n;n--){var a=this._resultAreaEdgeList.get(n),o=a.getSym();switch(null===t&&a.getEdgeRing()===e&&(t=a),r){case this._SCANNING_FOR_INCOMING:if(o.getEdgeRing()!==e)continue;i=o,r=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(a.getEdgeRing()!==e)continue;i.setNextMin(a),r=this._SCANNING_FOR_INCOMING}}r===this._LINKING_TO_OUTGOING&&(Ql.isTrue(null!==t,"found null for first outgoing dirEdge"),Ql.isTrue(t.getEdgeRing()===e,"unable to link last incoming dirEdge"),i.setNextMin(t))},e.prototype.getOutgoingDegree=function(){if(0===arguments.length){for(var e=0,t=this.iterator();t.hasNext();){var i=t.next();i.isInResult()&&e++}return e}if(1===arguments.length){for(var r=arguments[0],n=0,a=this.iterator();a.hasNext();){var o=a.next();o.getEdgeRing()===r&&n++}return n}},e.prototype.getLabel=function(){return this._label},e.prototype.findCoveredLineEdges=function(){for(var e=xl.NONE,t=this.iterator();t.hasNext();){var i=t.next(),r=i.getSym();if(!i.isLineEdge()){if(i.isInResult()){e=xl.INTERIOR;break}if(r.isInResult()){e=xl.EXTERIOR;break}}}if(e===xl.NONE)return null;for(var n=e,a=this.iterator();a.hasNext();){var o=a.next(),s=o.getSym();o.isLineEdge()?o.getEdge().setCovered(n===xl.INTERIOR):(o.isInResult()&&(n=xl.EXTERIOR),s.isInResult()&&(n=xl.INTERIOR))}},e.prototype.computeLabelling=function(e){a.prototype.computeLabelling.call(this,e),this._label=new Hc(xl.NONE);for(var t=this.iterator();t.hasNext();)for(var i=t.next().getEdge().getLabel(),r=0;r<2;r++){var n=i.getLocation(r);n!==xl.INTERIOR&&n!==xl.BOUNDARY||this._label.setLocation(r,xl.INTERIOR)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(eh),ih=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),((t.prototype=Object.create(e&&e.prototype)).constructor=t).prototype.createNode=function(e){return new Yc(e,new th)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(td),rh=function e(){this._pts=null,this._orientation=null;var t=arguments[0];this._pts=t,this._orientation=e.orientation(t)};rh.prototype.compareTo=function(e){var t=e;return rh.compareOriented(this._pts,this._orientation,t._pts,t._orientation)},rh.prototype.interfaces_=function(){return[pl]},rh.prototype.getClass=function(){return rh},rh.orientation=function(e){return 1===xu.increasingDirection(e)},rh.compareOriented=function(e,t,i,r){for(var n=t?1:-1,a=r?1:-1,o=t?e.length:-1,s=r?i.length:-1,l=t?0:e.length-1,u=r?0:i.length-1;;){var c=e[l].compareTo(i[u]);if(0!==c)return c;var d=(l+=n)===o,h=(u+=a)===s;if(d&&!h)return-1;if(!d&&h)return 1;if(d&&h)return 0}};var nh=function(){this._edges=new vu,this._ocaMap=new ku};nh.prototype.print=function(e){e.print("MULTILINESTRING ( ");for(var t=0;t<this._edges.size();t++){var i=this._edges.get(t);0<t&&e.print(","),e.print("(");for(var r=i.getCoordinates(),n=0;n<r.length;n++)0<n&&e.print(","),e.print(r[n].x+" "+r[n].y);e.println(")")}e.print(") ")},nh.prototype.addAll=function(e){for(var t=e.iterator();t.hasNext();)this.add(t.next())},nh.prototype.findEdgeIndex=function(e){for(var t=0;t<this._edges.size();t++)if(this._edges.get(t).equals(e))return t;return-1},nh.prototype.iterator=function(){return this._edges.iterator()},nh.prototype.getEdges=function(){return this._edges},nh.prototype.get=function(e){return this._edges.get(e)},nh.prototype.findEqualEdge=function(e){var t=new rh(e.getCoordinates());return this._ocaMap.get(t)},nh.prototype.add=function(e){this._edges.add(e);var t=new rh(e.getCoordinates());this._ocaMap.put(t,e)},nh.prototype.interfaces_=function(){return[]},nh.prototype.getClass=function(){return nh};var ah=function(){};ah.prototype.processIntersections=function(e,t,i,r){},ah.prototype.isDone=function(){},ah.prototype.interfaces_=function(){return[]},ah.prototype.getClass=function(){return ah};var oh=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._hasInterior=!1,this._properIntersectionPoint=null,this._li=null,this._isSelfIntersection=null,this.numIntersections=0,this.numInteriorIntersections=0,this.numProperIntersections=0,this.numTests=0;var e=arguments[0];this._li=e};oh.prototype.isTrivialIntersection=function(e,t,i,r){if(e===i&&1===this._li.getIntersectionNum()){if(oh.isAdjacentSegments(t,r))return!0;if(e.isClosed()){var n=e.size()-1;if(0===t&&r===n||0===r&&t===n)return!0}}return!1},oh.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},oh.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},oh.prototype.getLineIntersector=function(){return this._li},oh.prototype.hasProperIntersection=function(){return this._hasProper},oh.prototype.processIntersections=function(e,t,i,r){if(e===i&&t===r)return null;this.numTests++;var n=e.getCoordinates()[t],a=e.getCoordinates()[t+1],o=i.getCoordinates()[r],s=i.getCoordinates()[r+1];this._li.computeIntersection(n,a,o,s),this._li.hasIntersection()&&(this.numIntersections++,this._li.isInteriorIntersection()&&(this.numInteriorIntersections++,this._hasInterior=!0),this.isTrivialIntersection(e,t,i,r)||(this._hasIntersection=!0,e.addIntersections(this._li,t,0),i.addIntersections(this._li,r,1),this._li.isProper()&&(this.numProperIntersections++,this._hasProper=!0,this._hasProperInterior=!0)))},oh.prototype.hasIntersection=function(){return this._hasIntersection},oh.prototype.isDone=function(){return!1},oh.prototype.hasInteriorIntersection=function(){return this._hasInterior},oh.prototype.interfaces_=function(){return[ah]},oh.prototype.getClass=function(){return oh},oh.isAdjacentSegments=function(e,t){return 1===Math.abs(e-t)};var sh=function(){this.coord=null,this.segmentIndex=null,this.dist=null;var e=arguments[0],t=arguments[1],i=arguments[2];this.coord=new yl(e),this.segmentIndex=t,this.dist=i};sh.prototype.getSegmentIndex=function(){return this.segmentIndex},sh.prototype.getCoordinate=function(){return this.coord},sh.prototype.print=function(e){e.print(this.coord),e.print(" seg # = "+this.segmentIndex),e.println(" dist = "+this.dist)},sh.prototype.compareTo=function(e){var t=e;return this.compare(t.segmentIndex,t.dist)},sh.prototype.isEndPoint=function(e){return 0===this.segmentIndex&&0===this.dist||this.segmentIndex===e},sh.prototype.toString=function(){return this.coord+" seg # = "+this.segmentIndex+" dist = "+this.dist},sh.prototype.getDistance=function(){return this.dist},sh.prototype.compare=function(e,t){return this.segmentIndex<e?-1:this.segmentIndex>e?1:this.dist<t?-1:this.dist>t?1:0},sh.prototype.interfaces_=function(){return[pl]},sh.prototype.getClass=function(){return sh};var lh=function(){this._nodeMap=new ku,this.edge=null;var e=arguments[0];this.edge=e};lh.prototype.print=function(e){e.println("Intersections:");for(var t=this.iterator();t.hasNext();)t.next().print(e)},lh.prototype.iterator=function(){return this._nodeMap.values().iterator()},lh.prototype.addSplitEdges=function(e){this.addEndpoints();for(var t=this.iterator(),i=t.next();t.hasNext();){var r=t.next(),n=this.createSplitEdge(i,r);e.add(n),i=r}},lh.prototype.addEndpoints=function(){var e=this.edge.pts.length-1;this.add(this.edge.pts[0],0,0),this.add(this.edge.pts[e],e,0)},lh.prototype.createSplitEdge=function(e,t){var i=t.segmentIndex-e.segmentIndex+2,r=this.edge.pts[t.segmentIndex],n=0<t.dist||!t.coord.equals2D(r);n||i--;var a=new Array(i).fill(null),o=0;a[o++]=new yl(e.coord);for(var s=e.segmentIndex+1;s<=t.segmentIndex;s++)a[o++]=this.edge.pts[s];return n&&(a[o]=t.coord),new ph(a,new Hc(this.edge._label))},lh.prototype.add=function(e,t,i){var r=new sh(e,t,i),n=this._nodeMap.get(r);return null!==n?n:(this._nodeMap.put(r,r),r)},lh.prototype.isIntersection=function(e){for(var t=this.iterator();t.hasNext();)if(t.next().coord.equals(e))return!0;return!1},lh.prototype.interfaces_=function(){return[]},lh.prototype.getClass=function(){return lh};var uh=function(){};uh.prototype.getChainStartIndices=function(e){var t=0,i=new vu;i.add(new Tl(t));do{var r=this.findChainEnd(e,t);i.add(new Tl(r)),t=r}while(t<e.length-1);return uh.toIntArray(i)},uh.prototype.findChainEnd=function(e,t){for(var i=Zc.quadrant(e[t],e[t+1]),r=t+1;r<e.length&&Zc.quadrant(e[r-1],e[r])===i;)r++;return r-1},uh.prototype.interfaces_=function(){return[]},uh.prototype.getClass=function(){return uh},uh.toIntArray=function(e){for(var t=new Array(e.size()).fill(null),i=0;i<t.length;i++)t[i]=e.get(i).intValue();return t};var ch=function(){this.e=null,this.pts=null,this.startIndex=null,this.env1=new Vl,this.env2=new Vl;var e=arguments[0];this.e=e,this.pts=e.getCoordinates();var t=new uh;this.startIndex=t.getChainStartIndices(this.pts)};ch.prototype.getCoordinates=function(){return this.pts},ch.prototype.getMaxX=function(e){var t=this.pts[this.startIndex[e]].x,i=this.pts[this.startIndex[e+1]].x;return i<t?t:i},ch.prototype.getMinX=function(e){var t=this.pts[this.startIndex[e]].x,i=this.pts[this.startIndex[e+1]].x;return t<i?t:i},ch.prototype.computeIntersectsForChain=function(){if(4===arguments.length){var e=arguments[0],t=arguments[1],i=arguments[2],r=arguments[3];this.computeIntersectsForChain(this.startIndex[e],this.startIndex[e+1],t,t.startIndex[i],t.startIndex[i+1],r)}else if(6===arguments.length){var n=arguments[0],a=arguments[1],o=arguments[2],s=arguments[3],l=arguments[4],u=arguments[5],c=this.pts[n],d=this.pts[a],h=o.pts[s],p=o.pts[l];if(a-n==1&&l-s==1)return u.addIntersections(this.e,n,o.e,s),null;if(this.env1.init(c,d),this.env2.init(h,p),!this.env1.intersects(this.env2))return null;var f=Math.trunc((n+a)/2),m=Math.trunc((s+l)/2);n<f&&(s<m&&this.computeIntersectsForChain(n,f,o,s,m,u),m<l&&this.computeIntersectsForChain(n,f,o,m,l,u)),f<a&&(s<m&&this.computeIntersectsForChain(f,a,o,s,m,u),m<l&&this.computeIntersectsForChain(f,a,o,m,l,u))}},ch.prototype.getStartIndexes=function(){return this.startIndex},ch.prototype.computeIntersects=function(e,t){for(var i=0;i<this.startIndex.length-1;i++)for(var r=0;r<e.startIndex.length-1;r++)this.computeIntersectsForChain(i,e,r,t)},ch.prototype.interfaces_=function(){return[]},ch.prototype.getClass=function(){return ch};var dh=function e(){this._depth=Array(2).fill().map(function(){return Array(3)});for(var t=0;t<2;t++)for(var i=0;i<3;i++)this._depth[t][i]=e.NULL_VALUE},hh={NULL_VALUE:{configurable:!0}};dh.prototype.getDepth=function(e,t){return this._depth[e][t]},dh.prototype.setDepth=function(e,t,i){this._depth[e][t]=i},dh.prototype.isNull=function(){if(0===arguments.length){for(var e=0;e<2;e++)for(var t=0;t<3;t++)if(this._depth[e][t]!==dh.NULL_VALUE)return!1;return!0}if(1===arguments.length){var i=arguments[0];return this._depth[i][1]===dh.NULL_VALUE}if(2===arguments.length){var r=arguments[0],n=arguments[1];return this._depth[r][n]===dh.NULL_VALUE}},dh.prototype.normalize=function(){for(var e=0;e<2;e++)if(!this.isNull(e)){var t=this._depth[e][1];this._depth[e][2]<t&&(t=this._depth[e][2]),t<0&&(t=0);for(var i=1;i<3;i++){var r=0;this._depth[e][i]>t&&(r=1),this._depth[e][i]=r}}},dh.prototype.getDelta=function(e){return this._depth[e][Nc.RIGHT]-this._depth[e][Nc.LEFT]},dh.prototype.getLocation=function(e,t){return this._depth[e][t]<=0?xl.EXTERIOR:xl.INTERIOR},dh.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]},dh.prototype.add=function(){if(1===arguments.length)for(var e=arguments[0],t=0;t<2;t++)for(var i=1;i<3;i++){var r=e.getLocation(t,i);r!==xl.EXTERIOR&&r!==xl.INTERIOR||(this.isNull(t,i)?this._depth[t][i]=dh.depthAtLocation(r):this._depth[t][i]+=dh.depthAtLocation(r))}else if(3===arguments.length){var n=arguments[0],a=arguments[1],o=arguments[2];o===xl.INTERIOR&&this._depth[n][a]++}},dh.prototype.interfaces_=function(){return[]},dh.prototype.getClass=function(){return dh},dh.depthAtLocation=function(e){return e===xl.EXTERIOR?0:e===xl.INTERIOR?1:dh.NULL_VALUE},hh.NULL_VALUE.get=function(){return-1},Object.defineProperties(dh,hh);var ph=function(r){function o(){if(r.call(this),this.pts=null,this._env=null,this.eiList=new lh(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new dh,this._depthDelta=0,1===arguments.length){var e=arguments[0];o.call(this,e,null)}else if(2===arguments.length){var t=arguments[0],i=arguments[1];this.pts=t,this._label=i}}return r&&(o.__proto__=r),((o.prototype=Object.create(r&&r.prototype)).constructor=o).prototype.getDepth=function(){return this._depth},o.prototype.getCollapsedEdge=function(){var e=new Array(2).fill(null);return e[0]=this.pts[0],e[1]=this.pts[1],new o(e,Hc.toLineLabel(this._label))},o.prototype.isIsolated=function(){return this._isIsolated},o.prototype.getCoordinates=function(){return this.pts},o.prototype.setIsolated=function(e){this._isIsolated=e},o.prototype.setName=function(e){this._name=e},o.prototype.equals=function(e){if(!(e instanceof o))return!1;var t=e;if(this.pts.length!==t.pts.length)return!1;for(var i=!0,r=!0,n=this.pts.length,a=0;a<this.pts.length;a++)if(this.pts[a].equals2D(t.pts[a])||(i=!1),this.pts[a].equals2D(t.pts[--n])||(r=!1),!i&&!r)return!1;return!0},o.prototype.getCoordinate=function(){if(0===arguments.length)return 0<this.pts.length?this.pts[0]:null;if(1===arguments.length){var e=arguments[0];return this.pts[e]}},o.prototype.print=function(e){e.print("edge "+this._name+": "),e.print("LINESTRING (");for(var t=0;t<this.pts.length;t++)0<t&&e.print(","),e.print(this.pts[t].x+" "+this.pts[t].y);e.print(") "+this._label+" "+this._depthDelta)},o.prototype.computeIM=function(e){o.updateIM(this._label,e)},o.prototype.isCollapsed=function(){return!!this._label.isArea()&&3===this.pts.length&&!!this.pts[0].equals(this.pts[2])},o.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])},o.prototype.getMaximumSegmentIndex=function(){return this.pts.length-1},o.prototype.getDepthDelta=function(){return this._depthDelta},o.prototype.getNumPoints=function(){return this.pts.length},o.prototype.printReverse=function(e){e.print("edge "+this._name+": ");for(var t=this.pts.length-1;0<=t;t--)e.print(this.pts[t]+" ");e.println("")},o.prototype.getMonotoneChainEdge=function(){return null===this._mce&&(this._mce=new ch(this)),this._mce},o.prototype.getEnvelope=function(){if(null===this._env){this._env=new Vl;for(var e=0;e<this.pts.length;e++)this._env.expandToInclude(this.pts[e])}return this._env},o.prototype.addIntersection=function(e,t,i,r){var n=new yl(e.getIntersection(r)),a=t,o=e.getEdgeDistance(i,r),s=a+1;if(s<this.pts.length){var l=this.pts[s];n.equals2D(l)&&(a=s,o=0)}this.eiList.add(n,a,o)},o.prototype.toString=function(){var e=new El;e.append("edge "+this._name+": "),e.append("LINESTRING (");for(var t=0;t<this.pts.length;t++)0<t&&e.append(","),e.append(this.pts[t].x+" "+this.pts[t].y);return e.append(") "+this._label+" "+this._depthDelta),e.toString()},o.prototype.isPointwiseEqual=function(e){if(this.pts.length!==e.pts.length)return!1;for(var t=0;t<this.pts.length;t++)if(!this.pts[t].equals2D(e.pts[t]))return!1;return!0},o.prototype.setDepthDelta=function(e){this._depthDelta=e},o.prototype.getEdgeIntersectionList=function(){return this.eiList},o.prototype.addIntersections=function(e,t,i){for(var r=0;r<e.getIntersectionNum();r++)this.addIntersection(e,t,i,r)},o.prototype.interfaces_=function(){return[]},o.prototype.getClass=function(){return o},o.updateIM=function(){if(2!==arguments.length)return r.prototype.updateIM.apply(this,arguments);var e=arguments[0],t=arguments[1];t.setAtLeastIfValid(e.getLocation(0,Nc.ON),e.getLocation(1,Nc.ON),1),e.isArea()&&(t.setAtLeastIfValid(e.getLocation(0,Nc.LEFT),e.getLocation(1,Nc.LEFT),2),t.setAtLeastIfValid(e.getLocation(0,Nc.RIGHT),e.getLocation(1,Nc.RIGHT),2))},o}(Qc),fh=function(e){this._workingPrecisionModel=null,this._workingNoder=null,this._geomFact=null,this._graph=null,this._edgeList=new nh,this._bufParams=e||null};fh.prototype.setWorkingPrecisionModel=function(e){this._workingPrecisionModel=e},fh.prototype.insertUniqueEdge=function(e){var t=this._edgeList.findEqualEdge(e);if(null!==t){var i=t.getLabel(),r=e.getLabel();t.isPointwiseEqual(e)||(r=new Hc(e.getLabel())).flip(),i.merge(r);var n=fh.depthDelta(r),a=t.getDepthDelta()+n;t.setDepthDelta(a)}else this._edgeList.add(e),e.setDepthDelta(fh.depthDelta(e.getLabel()))},fh.prototype.buildSubgraphs=function(e,t){for(var i=new vu,r=e.iterator();r.hasNext();){var n=r.next(),a=n.getRightmostCoordinate(),o=new jd(i).getDepth(a);n.computeDepth(o),n.findResultEdges(),i.add(n),t.add(n.getDirectedEdges(),n.getNodes())}},fh.prototype.createSubgraphs=function(e){for(var t=new vu,i=e.getNodes().iterator();i.hasNext();){var r=i.next();if(!r.isVisited()){var n=new Gc;n.create(r),t.add(n)}}return dd.sort(t,dd.reverseOrder()),t},fh.prototype.createEmptyResultGeometry=function(){return this._geomFact.createPolygon()},fh.prototype.getNoder=function(e){if(null!==this._workingNoder)return this._workingNoder;var t=new Rd,i=new Zl;return i.setPrecisionModel(e),t.setSegmentIntersector(new oh(i)),t},fh.prototype.buffer=function(e,t){var i=this._workingPrecisionModel;null===i&&(i=e.getPrecisionModel()),this._geomFact=e.getFactory();var r=new Wd(i,this._bufParams),n=new Xd(e,t,r).getCurves();if(n.size()<=0)return this.createEmptyResultGeometry();this.computeNodedEdges(n,i),this._graph=new id(new ih),this._graph.addEdges(this._edgeList.getEdges());var a=this.createSubgraphs(this._graph),o=new rd(this._geomFact);this.buildSubgraphs(a,o);var s=o.getPolygons();return s.size()<=0?this.createEmptyResultGeometry():this._geomFact.buildGeometry(s)},fh.prototype.computeNodedEdges=function(e,t){var i=this.getNoder(t);i.computeNodes(e);for(var r=i.getNodedSubstrings().iterator();r.hasNext();){var n=r.next(),a=n.getCoordinates();if(2!==a.length||!a[0].equals2D(a[1])){var o=n.getData(),s=new ph(n.getCoordinates(),new Hc(o));this.insertUniqueEdge(s)}}},fh.prototype.setNoder=function(e){this._workingNoder=e},fh.prototype.interfaces_=function(){return[]},fh.prototype.getClass=function(){return fh},fh.depthDelta=function(e){var t=e.getLocation(0,Nc.LEFT),i=e.getLocation(0,Nc.RIGHT);return t===xl.INTERIOR&&i===xl.EXTERIOR?1:t===xl.EXTERIOR&&i===xl.INTERIOR?-1:0},fh.convertSegStrings=function(e){for(var t=new Tc,i=new vu;e.hasNext();){var r=e.next(),n=t.createLineString(r.getCoordinates());i.add(n)}return t.buildGeometry(i)};var mh=function(){if(this._noder=null,this._scaleFactor=null,this._offsetX=null,this._offsetY=null,this._isScaled=!1,2===arguments.length){var e=arguments[0],t=arguments[1];this._noder=e,this._scaleFactor=t,this._offsetX=0,this._offsetY=0,this._isScaled=!this.isIntegerPrecision()}else if(4===arguments.length){var i=arguments[0],r=arguments[1],n=arguments[2],a=arguments[3];this._noder=i,this._scaleFactor=r,this._offsetX=n,this._offsetY=a,this._isScaled=!this.isIntegerPrecision()}};mh.prototype.rescale=function(){if(Al(arguments[0],pu))for(var e=arguments[0],t=e.iterator();t.hasNext();){var i=t.next();this.rescale(i.getCoordinates())}else if(arguments[0]instanceof Array){for(var r=arguments[0],n=0;n<r.length;n++)r[n].x=r[n].x/this._scaleFactor+this._offsetX,r[n].y=r[n].y/this._scaleFactor+this._offsetY;2===r.length&&r[0].equals2D(r[1])&&Bl.out.println(r)}},mh.prototype.scale=function(){if(Al(arguments[0],pu)){for(var e=arguments[0],t=new vu,i=e.iterator();i.hasNext();){var r=i.next();t.add(new wd(this.scale(r.getCoordinates()),r.getData()))}return t}if(arguments[0]instanceof Array){for(var n=arguments[0],a=new Array(n.length).fill(null),o=0;o<n.length;o++)a[o]=new yl(Math.round((n[o].x-this._offsetX)*this._scaleFactor),Math.round((n[o].y-this._offsetY)*this._scaleFactor),n[o].z);var s=xu.removeRepeatedPoints(a);return s}},mh.prototype.isIntegerPrecision=function(){return 1===this._scaleFactor},mh.prototype.getNodedSubstrings=function(){var e=this._noder.getNodedSubstrings();return this._isScaled&&this.rescale(e),e},mh.prototype.computeNodes=function(e){var t=e;this._isScaled&&(t=this.scale(e)),this._noder.computeNodes(t)},mh.prototype.interfaces_=function(){return[Id]},mh.prototype.getClass=function(){return mh};var gh=function(){this._li=new Zl,this._segStrings=null;var e=arguments[0];this._segStrings=e},yh={fact:{configurable:!0}};gh.prototype.checkEndPtVertexIntersections=function(){if(0===arguments.length)for(var e=this._segStrings.iterator();e.hasNext();){var t=e.next(),i=t.getCoordinates();this.checkEndPtVertexIntersections(i[0],this._segStrings),this.checkEndPtVertexIntersections(i[i.length-1],this._segStrings)}else if(2===arguments.length)for(var r=arguments[0],n=arguments[1],a=n.iterator();a.hasNext();)for(var o=a.next(),s=o.getCoordinates(),l=1;l<s.length-1;l++)if(s[l].equals(r))throw new jl("found endpt/interior pt intersection at index "+l+" :pt "+r)},gh.prototype.checkInteriorIntersections=function(){if(0===arguments.length)for(var e=this._segStrings.iterator();e.hasNext();)for(var t=e.next(),i=this._segStrings.iterator();i.hasNext();){var r=i.next();this.checkInteriorIntersections(t,r)}else if(2===arguments.length)for(var n=arguments[0],a=arguments[1],o=n.getCoordinates(),s=a.getCoordinates(),l=0;l<o.length-1;l++)for(var u=0;u<s.length-1;u++)this.checkInteriorIntersections(n,l,a,u);else if(4===arguments.length){var c=arguments[0],d=arguments[1],h=arguments[2],p=arguments[3];if(c===h&&d===p)return null;var f=c.getCoordinates()[d],m=c.getCoordinates()[d+1],g=h.getCoordinates()[p],y=h.getCoordinates()[p+1];if(this._li.computeIntersection(f,m,g,y),this._li.hasIntersection()&&(this._li.isProper()||this.hasInteriorIntersection(this._li,f,m)||this.hasInteriorIntersection(this._li,g,y)))throw new jl("found non-noded intersection at "+f+"-"+m+" and "+g+"-"+y)}},gh.prototype.checkValid=function(){this.checkEndPtVertexIntersections(),this.checkInteriorIntersections(),this.checkCollapses()},gh.prototype.checkCollapses=function(){if(0===arguments.length)for(var e=this._segStrings.iterator();e.hasNext();){var t=e.next();this.checkCollapses(t)}else if(1===arguments.length)for(var i=arguments[0],r=i.getCoordinates(),n=0;n<r.length-2;n++)this.checkCollapse(r[n],r[n+1],r[n+2])},gh.prototype.hasInteriorIntersection=function(e,t,i){for(var r=0;r<e.getIntersectionNum();r++){var n=e.getIntersection(r);if(!n.equals(t)&&!n.equals(i))return!0}return!1},gh.prototype.checkCollapse=function(e,t,i){if(e.equals(i))throw new jl("found non-noded collapse at "+gh.fact.createLineString([e,t,i]))},gh.prototype.interfaces_=function(){return[]},gh.prototype.getClass=function(){return gh},yh.fact.get=function(){return new Tc},Object.defineProperties(gh,yh);var vh=function(){this._li=null,this._pt=null,this._originalPt=null,this._ptScaled=null,this._p0Scaled=null,this._p1Scaled=null,this._scaleFactor=null,this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,this._corner=new Array(4).fill(null),this._safeEnv=null;var e=arguments[0],t=arguments[1],i=arguments[2];if(this._originalPt=e,this._pt=e,this._scaleFactor=t,this._li=i,t<=0)throw new cl("Scale factor must be non-zero");1!==t&&(this._pt=new yl(this.scale(e.x),this.scale(e.y)),this._p0Scaled=new yl,this._p1Scaled=new yl),this.initCorners(this._pt)},_h={SAFE_ENV_EXPANSION_FACTOR:{configurable:!0}};vh.prototype.intersectsScaled=function(e,t){var i=Math.min(e.x,t.x),r=Math.max(e.x,t.x),n=Math.min(e.y,t.y),a=Math.max(e.y,t.y),o=this._maxx<i||this._minx>r||this._maxy<n||this._miny>a;if(o)return!1;var s=this.intersectsToleranceSquare(e,t);return Ql.isTrue(!(o&&s),"Found bad envelope test"),s},vh.prototype.initCorners=function(e){this._minx=e.x-.5,this._maxx=e.x+.5,this._miny=e.y-.5,this._maxy=e.y+.5,this._corner[0]=new yl(this._maxx,this._maxy),this._corner[1]=new yl(this._minx,this._maxy),this._corner[2]=new yl(this._minx,this._miny),this._corner[3]=new yl(this._maxx,this._miny)},vh.prototype.intersects=function(e,t){return 1===this._scaleFactor?this.intersectsScaled(e,t):(this.copyScaled(e,this._p0Scaled),this.copyScaled(t,this._p1Scaled),this.intersectsScaled(this._p0Scaled,this._p1Scaled))},vh.prototype.scale=function(e){return Math.round(e*this._scaleFactor)},vh.prototype.getCoordinate=function(){return this._originalPt},vh.prototype.copyScaled=function(e,t){t.x=this.scale(e.x),t.y=this.scale(e.y)},vh.prototype.getSafeEnvelope=function(){if(null===this._safeEnv){var e=vh.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new Vl(this._originalPt.x-e,this._originalPt.x+e,this._originalPt.y-e,this._originalPt.y+e)}return this._safeEnv},vh.prototype.intersectsPixelClosure=function(e,t){return this._li.computeIntersection(e,t,this._corner[0],this._corner[1]),!!(this._li.hasIntersection()||(this._li.computeIntersection(e,t,this._corner[1],this._corner[2]),this._li.hasIntersection()||(this._li.computeIntersection(e,t,this._corner[2],this._corner[3]),this._li.hasIntersection()||(this._li.computeIntersection(e,t,this._corner[3],this._corner[0]),this._li.hasIntersection()))))},vh.prototype.intersectsToleranceSquare=function(e,t){var i=!1,r=!1;return this._li.computeIntersection(e,t,this._corner[0],this._corner[1]),!!(this._li.isProper()||(this._li.computeIntersection(e,t,this._corner[1],this._corner[2]),this._li.isProper()||(this._li.hasIntersection()&&(i=!0),this._li.computeIntersection(e,t,this._corner[2],this._corner[3]),this._li.isProper()||(this._li.hasIntersection()&&(r=!0),this._li.computeIntersection(e,t,this._corner[3],this._corner[0]),this._li.isProper()||i&&r||e.equals(this._pt)||t.equals(this._pt)))))},vh.prototype.addSnappedNode=function(e,t){var i=e.getCoordinate(t),r=e.getCoordinate(t+1);return!!this.intersects(i,r)&&(e.addIntersection(this.getCoordinate(),t),!0)},vh.prototype.interfaces_=function(){return[]},vh.prototype.getClass=function(){return vh},_h.SAFE_ENV_EXPANSION_FACTOR.get=function(){return.75},Object.defineProperties(vh,_h);var Ch=function(){this.tempEnv1=new Vl,this.selectedSegment=new Ed};Ch.prototype.select=function(){if(1===arguments.length);else if(2===arguments.length){var e=arguments[0],t=arguments[1];e.getLineSegment(t,this.selectedSegment),this.select(this.selectedSegment)}},Ch.prototype.interfaces_=function(){return[]},Ch.prototype.getClass=function(){return Ch};var xh=function(){this._index=null;var e=arguments[0];this._index=e},bh={HotPixelSnapAction:{configurable:!0}};xh.prototype.snap=function(){if(1===arguments.length){var e=arguments[0];return this.snap(e,null,-1)}if(3===arguments.length){var t=arguments[0],i=arguments[1],r=arguments[2],n=t.getSafeEnvelope(),a=new Ah(t,i,r);return this._index.query(n,{interfaces_:function(){return[sd]},visitItem:function(e){e.select(n,a)}}),a.isNodeAdded()}},xh.prototype.interfaces_=function(){return[]},xh.prototype.getClass=function(){return xh},bh.HotPixelSnapAction.get=function(){return Ah},Object.defineProperties(xh,bh);var Ah=function(r){function e(){r.call(this),this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var e=arguments[0],t=arguments[1],i=arguments[2];this._hotPixel=e,this._parentEdge=t,this._hotPixelVertexIndex=i}return r&&(e.__proto__=r),((e.prototype=Object.create(r&&r.prototype)).constructor=e).prototype.isNodeAdded=function(){return this._isNodeAdded},e.prototype.select=function(){if(2!==arguments.length)return r.prototype.select.apply(this,arguments);var e=arguments[0],t=arguments[1],i=e.getContext();if(null!==this._parentEdge&&i===this._parentEdge&&t===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(i,t)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Ch),Sh=function(){this._li=null,this._interiorIntersections=null;var e=arguments[0];this._li=e,this._interiorIntersections=new vu};Sh.prototype.processIntersections=function(e,t,i,r){if(e===i&&t===r)return null;var n=e.getCoordinates()[t],a=e.getCoordinates()[t+1],o=i.getCoordinates()[r],s=i.getCoordinates()[r+1];if(this._li.computeIntersection(n,a,o,s),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var l=0;l<this._li.getIntersectionNum();l++)this._interiorIntersections.add(this._li.getIntersection(l));e.addIntersections(this._li,t,0),i.addIntersections(this._li,r,1)}},Sh.prototype.isDone=function(){return!1},Sh.prototype.getInteriorIntersections=function(){return this._interiorIntersections},Sh.prototype.interfaces_=function(){return[ah]},Sh.prototype.getClass=function(){return Sh};var wh=function(){this._pm=null,this._li=null,this._scaleFactor=null,this._noder=null,this._pointSnapper=null,this._nodedSegStrings=null;var e=arguments[0];this._pm=e,this._li=new Zl,this._li.setPrecisionModel(e),this._scaleFactor=e.getScale()};wh.prototype.checkCorrectness=function(e){var t=wd.getNodedSubstrings(e),i=new gh(t);try{i.checkValid()}catch(e){if(!(e instanceof Nl))throw e;e.printStackTrace()}},wh.prototype.getNodedSubstrings=function(){return wd.getNodedSubstrings(this._nodedSegStrings)},wh.prototype.snapRound=function(e,t){var i=this.findInteriorIntersections(e,t);this.computeIntersectionSnaps(i),this.computeVertexSnaps(e)},wh.prototype.findInteriorIntersections=function(e,t){var i=new Sh(t);return this._noder.setSegmentIntersector(i),this._noder.computeNodes(e),i.getInteriorIntersections()},wh.prototype.computeVertexSnaps=function(){if(Al(arguments[0],pu))for(var e=arguments[0],t=e.iterator();t.hasNext();){var i=t.next();this.computeVertexSnaps(i)}else if(arguments[0]instanceof wd)for(var r=arguments[0],n=r.getCoordinates(),a=0;a<n.length;a++){var o=new vh(n[a],this._scaleFactor,this._li),s=this._pointSnapper.snap(o,r,a);s&&r.addIntersection(n[a],a)}},wh.prototype.computeNodes=function(e){this._nodedSegStrings=e,this._noder=new Rd,this._pointSnapper=new xh(this._noder.getIndex()),this.snapRound(e,this._li)},wh.prototype.computeIntersectionSnaps=function(e){for(var t=e.iterator();t.hasNext();){var i=t.next(),r=new vh(i,this._scaleFactor,this._li);this._pointSnapper.snap(r)}},wh.prototype.interfaces_=function(){return[Id]},wh.prototype.getClass=function(){return wh};var Eh=function(){if(this._argGeom=null,this._distance=null,this._bufParams=new Nd,this._resultGeometry=null,this._saveException=null,1===arguments.length){var e=arguments[0];this._argGeom=e}else if(2===arguments.length){var t=arguments[0],i=arguments[1];this._argGeom=t,this._bufParams=i}},Th={CAP_ROUND:{configurable:!0},CAP_BUTT:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},MAX_PRECISION_DIGITS:{configurable:!0}};Eh.prototype.bufferFixedPrecision=function(e){var t=new mh(new wh(new Ac(1)),e.getScale()),i=new fh(this._bufParams);i.setWorkingPrecisionModel(e),i.setNoder(t),this._resultGeometry=i.buffer(this._argGeom,this._distance)},Eh.prototype.bufferReducedPrecision=function(){var e=this;if(0===arguments.length){for(var t=Eh.MAX_PRECISION_DIGITS;0<=t;t--){try{e.bufferReducedPrecision(t)}catch(t){if(!(t instanceof zc))throw t;e._saveException=t}if(null!==e._resultGeometry)return null}throw this._saveException}if(1===arguments.length){var i=arguments[0],r=Eh.precisionScaleFactor(this._argGeom,this._distance,i),n=new Ac(r);this.bufferFixedPrecision(n)}},Eh.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),null!==this._resultGeometry)return null;var e=this._argGeom.getFactory().getPrecisionModel();e.getType()===Ac.FIXED?this.bufferFixedPrecision(e):this.bufferReducedPrecision()},Eh.prototype.setQuadrantSegments=function(e){this._bufParams.setQuadrantSegments(e)},Eh.prototype.bufferOriginalPrecision=function(){try{var e=new fh(this._bufParams);this._resultGeometry=e.buffer(this._argGeom,this._distance)}catch(e){if(!(e instanceof jl))throw e;this._saveException=e}},Eh.prototype.getResultGeometry=function(e){return this._distance=e,this.computeGeometry(),this._resultGeometry},Eh.prototype.setEndCapStyle=function(e){this._bufParams.setEndCapStyle(e)},Eh.prototype.interfaces_=function(){return[]},Eh.prototype.getClass=function(){return Eh},Eh.bufferOp=function(){if(2===arguments.length){var e=arguments[0],t=arguments[1],i=new Eh(e),r=i.getResultGeometry(t);return r}if(3===arguments.length){if(Number.isInteger(arguments[2])&&arguments[0]instanceof ru&&"number"==typeof arguments[1]){var n=arguments[0],a=arguments[1],o=arguments[2],s=new Eh(n);s.setQuadrantSegments(o);var l=s.getResultGeometry(a);return l}if(arguments[2]instanceof Nd&&arguments[0]instanceof ru&&"number"==typeof arguments[1]){var u=arguments[0],c=arguments[1],d=arguments[2],h=new Eh(u,d),p=h.getResultGeometry(c);return p}}else if(4===arguments.length){var f=arguments[0],m=arguments[1],g=arguments[2],y=arguments[3],v=new Eh(f);v.setQuadrantSegments(g),v.setEndCapStyle(y);var _=v.getResultGeometry(m);return _}},Eh.precisionScaleFactor=function(e,t,i){var r=e.getEnvelopeInternal(),n=Sl.max(Math.abs(r.getMaxX()),Math.abs(r.getMaxY()),Math.abs(r.getMinX()),Math.abs(r.getMinY()))+2*(0<t?t:0),a=i-Math.trunc(Math.log(n)/Math.log(10)+1);return Math.pow(10,a)},Th.CAP_ROUND.get=function(){return Nd.CAP_ROUND},Th.CAP_BUTT.get=function(){return Nd.CAP_FLAT},Th.CAP_FLAT.get=function(){return Nd.CAP_FLAT},Th.CAP_SQUARE.get=function(){return Nd.CAP_SQUARE},Th.MAX_PRECISION_DIGITS.get=function(){return 12},Object.defineProperties(Eh,Th);var Ph=function(){this._pt=[new yl,new yl],this._distance=dl.NaN,this._isNull=!0};Ph.prototype.getCoordinates=function(){return this._pt},Ph.prototype.getCoordinate=function(e){return this._pt[e]},Ph.prototype.setMinimum=function(){if(1===arguments.length){var e=arguments[0];this.setMinimum(e._pt[0],e._pt[1])}else if(2===arguments.length){var t=arguments[0],i=arguments[1];if(this._isNull)return this.initialize(t,i),null;var r=t.distance(i);r<this._distance&&this.initialize(t,i,r)}},Ph.prototype.initialize=function(){if(0===arguments.length)this._isNull=!0;else if(2===arguments.length){var e=arguments[0],t=arguments[1];this._pt[0].setCoordinate(e),this._pt[1].setCoordinate(t),this._distance=e.distance(t),this._isNull=!1}else if(3===arguments.length){var i=arguments[0],r=arguments[1],n=arguments[2];this._pt[0].setCoordinate(i),this._pt[1].setCoordinate(r),this._distance=n,this._isNull=!1}},Ph.prototype.getDistance=function(){return this._distance},Ph.prototype.setMaximum=function(){if(1===arguments.length){var e=arguments[0];this.setMaximum(e._pt[0],e._pt[1])}else if(2===arguments.length){var t=arguments[0],i=arguments[1];if(this._isNull)return this.initialize(t,i),null;var r=t.distance(i);r>this._distance&&this.initialize(t,i,r)}},Ph.prototype.interfaces_=function(){return[]},Ph.prototype.getClass=function(){return Ph};var Mh=function(){};Mh.prototype.interfaces_=function(){return[]},Mh.prototype.getClass=function(){return Mh},Mh.computeDistance=function(){if(arguments[2]instanceof Ph&&arguments[0]instanceof ac&&arguments[1]instanceof yl)for(var e=arguments[0],t=arguments[1],i=arguments[2],r=e.getCoordinates(),n=new Ed,a=0;a<r.length-1;a++){n.setCoordinates(r[a],r[a+1]);var o=n.closestPoint(t);i.setMinimum(o,t)}else if(arguments[2]instanceof Ph&&arguments[0]instanceof uc&&arguments[1]instanceof yl){var s=arguments[0],l=arguments[1],u=arguments[2];Mh.computeDistance(s.getExteriorRing(),l,u);for(var c=0;c<s.getNumInteriorRing();c++)Mh.computeDistance(s.getInteriorRingN(c),l,u)}else if(arguments[2]instanceof Ph&&arguments[0]instanceof ru&&arguments[1]instanceof yl){var d=arguments[0],h=arguments[1],p=arguments[2];if(d instanceof ac)Mh.computeDistance(d,h,p);else if(d instanceof uc)Mh.computeDistance(d,h,p);else if(d instanceof ju)for(var f=d,m=0;m<f.getNumGeometries();m++){var g=f.getGeometryN(m);Mh.computeDistance(g,h,p)}else p.setMinimum(d.getCoordinate(),h)}else if(arguments[2]instanceof Ph&&arguments[0]instanceof Ed&&arguments[1]instanceof yl){var y=arguments[0],v=arguments[1],_=arguments[2],C=y.closestPoint(v);_.setMinimum(C,v)}};var Dh=function(e){this._maxPtDist=new Ph,this._inputGeom=e||null},Ih={MaxPointDistanceFilter:{configurable:!0},MaxMidpointDistanceFilter:{configurable:!0}};Dh.prototype.computeMaxMidpointDistance=function(e){var t=new Rh(this._inputGeom);e.apply(t),this._maxPtDist.setMaximum(t.getMaxPointDistance())},Dh.prototype.computeMaxVertexDistance=function(e){var t=new Oh(this._inputGeom);e.apply(t),this._maxPtDist.setMaximum(t.getMaxPointDistance())},Dh.prototype.findDistance=function(e){return this.computeMaxVertexDistance(e),this.computeMaxMidpointDistance(e),this._maxPtDist.getDistance()},Dh.prototype.getDistancePoints=function(){return this._maxPtDist},Dh.prototype.interfaces_=function(){return[]},Dh.prototype.getClass=function(){return Dh},Ih.MaxPointDistanceFilter.get=function(){return Oh},Ih.MaxMidpointDistanceFilter.get=function(){return Rh},Object.defineProperties(Dh,Ih);var Oh=function(e){this._maxPtDist=new Ph,this._minPtDist=new Ph,this._geom=e||null};Oh.prototype.filter=function(e){this._minPtDist.initialize(),Mh.computeDistance(this._geom,e,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},Oh.prototype.getMaxPointDistance=function(){return this._maxPtDist},Oh.prototype.interfaces_=function(){return[ou]},Oh.prototype.getClass=function(){return Oh};var Rh=function(e){this._maxPtDist=new Ph,this._minPtDist=new Ph,this._geom=e||null};Rh.prototype.filter=function(e,t){if(0===t)return null;var i=e.getCoordinate(t-1),r=e.getCoordinate(t),n=new yl((i.x+r.x)/2,(i.y+r.y)/2);this._minPtDist.initialize(),Mh.computeDistance(this._geom,n,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},Rh.prototype.isDone=function(){return!1},Rh.prototype.isGeometryChanged=function(){return!1},Rh.prototype.getMaxPointDistance=function(){return this._maxPtDist},Rh.prototype.interfaces_=function(){return[Wu]},Rh.prototype.getClass=function(){return Rh};var Lh=function(e){this._comps=e||null};Lh.prototype.filter=function(e){e instanceof uc&&this._comps.add(e)},Lh.prototype.interfaces_=function(){return[Hu]},Lh.prototype.getClass=function(){return Lh},Lh.getPolygons=function(){if(1===arguments.length){var e=arguments[0];return Lh.getPolygons(e,new vu)}if(2===arguments.length){var t=arguments[0],i=arguments[1];return t instanceof uc?i.add(t):t instanceof ju&&t.apply(new Lh(i)),i}};var Nh=function(){if(this._lines=null,this._isForcedToLineString=!1,1===arguments.length){var e=arguments[0];this._lines=e}else if(2===arguments.length){var t=arguments[0],i=arguments[1];this._lines=t,this._isForcedToLineString=i}};Nh.prototype.filter=function(e){if(this._isForcedToLineString&&e instanceof dc){var t=e.getFactory().createLineString(e.getCoordinateSequence());return this._lines.add(t),null}e instanceof ac&&this._lines.add(e)},Nh.prototype.setForceToLineString=function(e){this._isForcedToLineString=e},Nh.prototype.interfaces_=function(){return[iu]},Nh.prototype.getClass=function(){return Nh},Nh.getGeometry=function(){if(1===arguments.length){var e=arguments[0];return e.getFactory().buildGeometry(Nh.getLines(e))}if(2===arguments.length){var t=arguments[0],i=arguments[1];return t.getFactory().buildGeometry(Nh.getLines(t,i))}},Nh.getLines=function(){if(1===arguments.length){var e=arguments[0];return Nh.getLines(e,!1)}if(2===arguments.length){if(Al(arguments[0],pu)&&Al(arguments[1],pu)){for(var t=arguments[0],i=arguments[1],r=t.iterator();r.hasNext();){var n=r.next();Nh.getLines(n,i)}return i}if(arguments[0]instanceof ru&&"boolean"==typeof arguments[1]){var a=arguments[0],o=arguments[1],s=new vu;return a.apply(new Nh(s,o)),s}if(arguments[0]instanceof ru&&Al(arguments[1],pu)){var l=arguments[0],u=arguments[1];return l instanceof ac?u.add(l):l.apply(new Nh(u)),u}}else if(3===arguments.length){if("boolean"==typeof arguments[2]&&Al(arguments[0],pu)&&Al(arguments[1],pu)){for(var c=arguments[0],d=arguments[1],h=arguments[2],p=c.iterator();p.hasNext();){var f=p.next();Nh.getLines(f,d,h)}return d}if("boolean"==typeof arguments[2]&&arguments[0]instanceof ru&&Al(arguments[1],pu)){var m=arguments[0],g=arguments[1],y=arguments[2];return m.apply(new Nh(g,y)),g}}};var kh=function(){if(this._boundaryRule=su.OGC_SFS_BOUNDARY_RULE,this._isIn=null,this._numBoundaries=null,0===arguments.length);else if(1===arguments.length){var e=arguments[0];if(null===e)throw new cl("Rule must be non-null");this._boundaryRule=e}};kh.prototype.locateInternal=function(){if(arguments[0]instanceof yl&&arguments[1]instanceof uc){var e=arguments[0],t=arguments[1];if(t.isEmpty())return xl.EXTERIOR;var i=t.getExteriorRing(),r=this.locateInPolygonRing(e,i);if(r===xl.EXTERIOR)return xl.EXTERIOR;if(r===xl.BOUNDARY)return xl.BOUNDARY;for(var n=0;n<t.getNumInteriorRing();n++){var a=t.getInteriorRingN(n),o=this.locateInPolygonRing(e,a);if(o===xl.INTERIOR)return xl.EXTERIOR;if(o===xl.BOUNDARY)return xl.BOUNDARY}return xl.INTERIOR}if(arguments[0]instanceof yl&&arguments[1]instanceof ac){var s=arguments[0],l=arguments[1];if(!l.getEnvelopeInternal().intersects(s))return xl.EXTERIOR;var u=l.getCoordinates();return l.isClosed()||!s.equals(u[0])&&!s.equals(u[u.length-1])?eu.isOnLine(s,u)?xl.INTERIOR:xl.EXTERIOR:xl.BOUNDARY}if(arguments[0]instanceof yl&&arguments[1]instanceof sc){var c=arguments[0],d=arguments[1],h=d.getCoordinate();return h.equals2D(c)?xl.INTERIOR:xl.EXTERIOR}},kh.prototype.locateInPolygonRing=function(e,t){return t.getEnvelopeInternal().intersects(e)?eu.locatePointInRing(e,t.getCoordinates()):xl.EXTERIOR},kh.prototype.intersects=function(e,t){return this.locate(e,t)!==xl.EXTERIOR},kh.prototype.updateLocationInfo=function(e){e===xl.INTERIOR&&(this._isIn=!0),e===xl.BOUNDARY&&this._numBoundaries++},kh.prototype.computeLocation=function(e,t){if(t instanceof sc&&this.updateLocationInfo(this.locateInternal(e,t)),t instanceof ac)this.updateLocationInfo(this.locateInternal(e,t));else if(t instanceof uc)this.updateLocationInfo(this.locateInternal(e,t));else if(t instanceof qu)for(var i=t,r=0;r<i.getNumGeometries();r++){var n=i.getGeometryN(r);this.updateLocationInfo(this.locateInternal(e,n))}else if(t instanceof hc)for(var a=t,o=0;o<a.getNumGeometries();o++){var s=a.getGeometryN(o);this.updateLocationInfo(this.locateInternal(e,s))}else if(t instanceof ju)for(var l=new Jd(t);l.hasNext();){var u=l.next();u!==t&&this.computeLocation(e,u)}},kh.prototype.locate=function(e,t){return t.isEmpty()?xl.EXTERIOR:t instanceof ac||t instanceof uc?this.locateInternal(e,t):(this._isIn=!1,this._numBoundaries=0,this.computeLocation(e,t),this._boundaryRule.isInBoundary(this._numBoundaries)?xl.BOUNDARY:0<this._numBoundaries||this._isIn?xl.INTERIOR:xl.EXTERIOR)},kh.prototype.interfaces_=function(){return[]},kh.prototype.getClass=function(){return kh};var Bh=function e(){if(this._component=null,this._segIndex=null,this._pt=null,2===arguments.length){var t=arguments[0],i=arguments[1];e.call(this,t,e.INSIDE_AREA,i)}else if(3===arguments.length){var r=arguments[0],n=arguments[1],a=arguments[2];this._component=r,this._segIndex=n,this._pt=a}},Fh={INSIDE_AREA:{configurable:!0}};Bh.prototype.isInsideArea=function(){return this._segIndex===Bh.INSIDE_AREA},Bh.prototype.getCoordinate=function(){return this._pt},Bh.prototype.getGeometryComponent=function(){return this._component},Bh.prototype.getSegmentIndex=function(){return this._segIndex},Bh.prototype.interfaces_=function(){return[]},Bh.prototype.getClass=function(){return Bh},Fh.INSIDE_AREA.get=function(){return-1},Object.defineProperties(Bh,Fh);var Vh=function(e){this._pts=e||null};Vh.prototype.filter=function(e){e instanceof sc&&this._pts.add(e)},Vh.prototype.interfaces_=function(){return[Hu]},Vh.prototype.getClass=function(){return Vh},Vh.getPoints=function(){if(1===arguments.length){var e=arguments[0];return e instanceof sc?dd.singletonList(e):Vh.getPoints(e,new vu)}if(2===arguments.length){var t=arguments[0],i=arguments[1];return t instanceof sc?i.add(t):t instanceof ju&&t.apply(new Vh(i)),i}};var zh=function(){this._locations=null;var e=arguments[0];this._locations=e};zh.prototype.filter=function(e){(e instanceof sc||e instanceof ac||e instanceof uc)&&this._locations.add(new Bh(e,0,e.getCoordinate()))},zh.prototype.interfaces_=function(){return[Hu]},zh.prototype.getClass=function(){return zh},zh.getLocations=function(e){var t=new vu;return e.apply(new zh(t)),t};var Uh=function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new kh,this._minDistanceLocation=null,this._minDistance=dl.MAX_VALUE,2===arguments.length){var e=arguments[0],t=arguments[1];this._geom=[e,t],this._terminateDistance=0}else if(3===arguments.length){var i=arguments[0],r=arguments[1],n=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=i,this._geom[1]=r,this._terminateDistance=n}};Uh.prototype.computeContainmentDistance=function(){if(0===arguments.length){var e=new Array(2).fill(null);if(this.computeContainmentDistance(0,e),this._minDistance<=this._terminateDistance)return null;this.computeContainmentDistance(1,e)}else if(2===arguments.length){var t=arguments[0],i=arguments[1],r=1-t,n=Lh.getPolygons(this._geom[t]);if(0<n.size()){var a=zh.getLocations(this._geom[r]);if(this.computeContainmentDistance(a,n,i),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[r]=i[0],this._minDistanceLocation[t]=i[1],null}}else if(3===arguments.length)if(arguments[2]instanceof Array&&Al(arguments[0],gu)&&Al(arguments[1],gu)){for(var o=arguments[0],s=arguments[1],l=arguments[2],u=0;u<o.size();u++)for(var c=o.get(u),d=0;d<s.size();d++)if(this.computeContainmentDistance(c,s.get(d),l),this._minDistance<=this._terminateDistance)return null}else if(arguments[2]instanceof Array&&arguments[0]instanceof Bh&&arguments[1]instanceof uc){var h=arguments[0],p=arguments[1],f=arguments[2],m=h.getCoordinate();if(xl.EXTERIOR!==this._ptLocator.locate(m,p))return this._minDistance=0,f[0]=h,f[1]=new Bh(p,m),null}},Uh.prototype.computeMinDistanceLinesPoints=function(e,t,i){for(var r=0;r<e.size();r++)for(var n=e.get(r),a=0;a<t.size();a++){var o=t.get(a);if(this.computeMinDistance(n,o,i),this._minDistance<=this._terminateDistance)return null}},Uh.prototype.computeFacetDistance=function(){var e=new Array(2).fill(null),t=Nh.getLines(this._geom[0]),i=Nh.getLines(this._geom[1]),r=Vh.getPoints(this._geom[0]),n=Vh.getPoints(this._geom[1]);return this.computeMinDistanceLines(t,i,e),this.updateMinDistance(e,!1),this._minDistance<=this._terminateDistance?null:(e[0]=null,e[1]=null,this.computeMinDistanceLinesPoints(t,n,e),this.updateMinDistance(e,!1),this._minDistance<=this._terminateDistance?null:(e[0]=null,e[1]=null,this.computeMinDistanceLinesPoints(i,r,e),this.updateMinDistance(e,!0),this._minDistance<=this._terminateDistance?null:(e[0]=null,e[1]=null,this.computeMinDistancePoints(r,n,e),void this.updateMinDistance(e,!1))))},Uh.prototype.nearestLocations=function(){return this.computeMinDistance(),this._minDistanceLocation},Uh.prototype.updateMinDistance=function(e,t){if(null===e[0])return null;t?(this._minDistanceLocation[0]=e[1],this._minDistanceLocation[1]=e[0]):(this._minDistanceLocation[0]=e[0],this._minDistanceLocation[1]=e[1])},Uh.prototype.nearestPoints=function(){return this.computeMinDistance(),[this._minDistanceLocation[0].getCoordinate(),this._minDistanceLocation[1].getCoordinate()]},Uh.prototype.computeMinDistance=function(){if(0===arguments.length){if(null!==this._minDistanceLocation)return null;if(this._minDistanceLocation=new Array(2).fill(null),this.computeContainmentDistance(),this._minDistance<=this._terminateDistance)return null;this.computeFacetDistance()}else if(3===arguments.length)if(arguments[2]instanceof Array&&arguments[0]instanceof ac&&arguments[1]instanceof sc){var e=arguments[0],t=arguments[1],i=arguments[2];if(e.getEnvelopeInternal().distance(t.getEnvelopeInternal())>this._minDistance)return null;for(var r=e.getCoordinates(),n=t.getCoordinate(),a=0;a<r.length-1;a++){var o=eu.distancePointLine(n,r[a],r[a+1]);if(o<this._minDistance){this._minDistance=o;var s=new Ed(r[a],r[a+1]),l=s.closestPoint(n);i[0]=new Bh(e,a,l),i[1]=new Bh(t,0,n)}if(this._minDistance<=this._terminateDistance)return null}}else if(arguments[2]instanceof Array&&arguments[0]instanceof ac&&arguments[1]instanceof ac){var u=arguments[0],c=arguments[1],d=arguments[2];if(u.getEnvelopeInternal().distance(c.getEnvelopeInternal())>this._minDistance)return null;for(var h=u.getCoordinates(),p=c.getCoordinates(),f=0;f<h.length-1;f++)for(var m=0;m<p.length-1;m++){var g=eu.distanceLineLine(h[f],h[f+1],p[m],p[m+1]);if(g<this._minDistance){this._minDistance=g;var y=new Ed(h[f],h[f+1]),v=new Ed(p[m],p[m+1]),_=y.closestPoints(v);d[0]=new Bh(u,f,_[0]),d[1]=new Bh(c,m,_[1])}if(this._minDistance<=this._terminateDistance)return null}}},Uh.prototype.computeMinDistancePoints=function(e,t,i){for(var r=0;r<e.size();r++)for(var n=e.get(r),a=0;a<t.size();a++){var o=t.get(a),s=n.getCoordinate().distance(o.getCoordinate());if(s<this._minDistance&&(this._minDistance=s,i[0]=new Bh(n,0,n.getCoordinate()),i[1]=new Bh(o,0,o.getCoordinate())),this._minDistance<=this._terminateDistance)return null}},Uh.prototype.distance=function(){if(null===this._geom[0]||null===this._geom[1])throw new cl("null geometries are not supported");return this._geom[0].isEmpty()||this._geom[1].isEmpty()?0:(this.computeMinDistance(),this._minDistance)},Uh.prototype.computeMinDistanceLines=function(e,t,i){for(var r=0;r<e.size();r++)for(var n=e.get(r),a=0;a<t.size();a++){var o=t.get(a);if(this.computeMinDistance(n,o,i),this._minDistance<=this._terminateDistance)return null}},Uh.prototype.interfaces_=function(){return[]},Uh.prototype.getClass=function(){return Uh},Uh.distance=function(e,t){return new Uh(e,t).distance()},Uh.isWithinDistance=function(e,t,i){return new Uh(e,t,i).distance()<=i},Uh.nearestPoints=function(e,t){return new Uh(e,t).nearestPoints()};var Gh=function(){this._pt=[new yl,new yl],this._distance=dl.NaN,this._isNull=!0};Gh.prototype.getCoordinates=function(){return this._pt},Gh.prototype.getCoordinate=function(e){return this._pt[e]},Gh.prototype.setMinimum=function(){if(1===arguments.length){var e=arguments[0];this.setMinimum(e._pt[0],e._pt[1])}else if(2===arguments.length){var t=arguments[0],i=arguments[1];if(this._isNull)return this.initialize(t,i),null;var r=t.distance(i);r<this._distance&&this.initialize(t,i,r)}},Gh.prototype.initialize=function(){if(0===arguments.length)this._isNull=!0;else if(2===arguments.length){var e=arguments[0],t=arguments[1];this._pt[0].setCoordinate(e),this._pt[1].setCoordinate(t),this._distance=e.distance(t),this._isNull=!1}else if(3===arguments.length){var i=arguments[0],r=arguments[1],n=arguments[2];this._pt[0].setCoordinate(i),this._pt[1].setCoordinate(r),this._distance=n,this._isNull=!1}},Gh.prototype.toString=function(){return Wl.toLineString(this._pt[0],this._pt[1])},Gh.prototype.getDistance=function(){return this._distance},Gh.prototype.setMaximum=function(){if(1===arguments.length){var e=arguments[0];this.setMaximum(e._pt[0],e._pt[1])}else if(2===arguments.length){var t=arguments[0],i=arguments[1];if(this._isNull)return this.initialize(t,i),null;var r=t.distance(i);r>this._distance&&this.initialize(t,i,r)}},Gh.prototype.interfaces_=function(){return[]},Gh.prototype.getClass=function(){return Gh};var $h=function(){};$h.prototype.interfaces_=function(){return[]},$h.prototype.getClass=function(){return $h},$h.computeDistance=function(){if(arguments[2]instanceof Gh&&arguments[0]instanceof ac&&arguments[1]instanceof yl)for(var e=arguments[0],t=arguments[1],i=arguments[2],r=new Ed,n=e.getCoordinates(),a=0;a<n.length-1;a++){r.setCoordinates(n[a],n[a+1]);var o=r.closestPoint(t);i.setMinimum(o,t)}else if(arguments[2]instanceof Gh&&arguments[0]instanceof uc&&arguments[1]instanceof yl){var s=arguments[0],l=arguments[1],u=arguments[2];$h.computeDistance(s.getExteriorRing(),l,u);for(var c=0;c<s.getNumInteriorRing();c++)$h.computeDistance(s.getInteriorRingN(c),l,u)}else if(arguments[2]instanceof Gh&&arguments[0]instanceof ru&&arguments[1]instanceof yl){var d=arguments[0],h=arguments[1],p=arguments[2];if(d instanceof ac)$h.computeDistance(d,h,p);else if(d instanceof uc)$h.computeDistance(d,h,p);else if(d instanceof ju)for(var f=d,m=0;m<f.getNumGeometries();m++){var g=f.getGeometryN(m);$h.computeDistance(g,h,p)}else p.setMinimum(d.getCoordinate(),h)}else if(arguments[2]instanceof Gh&&arguments[0]instanceof Ed&&arguments[1]instanceof yl){var y=arguments[0],v=arguments[1],_=arguments[2],C=y.closestPoint(v);_.setMinimum(C,v)}};var Hh=function(){this._g0=null,this._g1=null,this._ptDist=new Gh,this._densifyFrac=0;var e=arguments[0],t=arguments[1];this._g0=e,this._g1=t},Wh={MaxPointDistanceFilter:{configurable:!0},MaxDensifiedByFractionDistanceFilter:{configurable:!0}};Hh.prototype.getCoordinates=function(){return this._ptDist.getCoordinates()},Hh.prototype.setDensifyFraction=function(e){if(1<e||e<=0)throw new cl("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=e},Hh.prototype.compute=function(e,t){this.computeOrientedDistance(e,t,this._ptDist),this.computeOrientedDistance(t,e,this._ptDist)},Hh.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()},Hh.prototype.computeOrientedDistance=function(e,t,i){var r=new jh(t);if(e.apply(r),i.setMaximum(r.getMaxPointDistance()),0<this._densifyFrac){var n=new qh(t,this._densifyFrac);e.apply(n),i.setMaximum(n.getMaxPointDistance())}},Hh.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()},Hh.prototype.interfaces_=function(){return[]},Hh.prototype.getClass=function(){return Hh},Hh.distance=function(){if(2===arguments.length){var e=arguments[0],t=arguments[1],i=new Hh(e,t);return i.distance()}if(3===arguments.length){var r=arguments[0],n=arguments[1],a=arguments[2],o=new Hh(r,n);return o.setDensifyFraction(a),o.distance()}},Wh.MaxPointDistanceFilter.get=function(){return jh},Wh.MaxDensifiedByFractionDistanceFilter.get=function(){return qh},Object.defineProperties(Hh,Wh);var jh=function(){this._maxPtDist=new Gh,this._minPtDist=new Gh,this._euclideanDist=new $h,this._geom=null;var e=arguments[0];this._geom=e};jh.prototype.filter=function(e){this._minPtDist.initialize(),$h.computeDistance(this._geom,e,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},jh.prototype.getMaxPointDistance=function(){return this._maxPtDist},jh.prototype.interfaces_=function(){return[ou]},jh.prototype.getClass=function(){return jh};var qh=function(){this._maxPtDist=new Gh,this._minPtDist=new Gh,this._geom=null,this._numSubSegs=0;var e=arguments[0],t=arguments[1];this._geom=e,this._numSubSegs=Math.trunc(Math.round(1/t))};qh.prototype.filter=function(e,t){if(0===t)return null;for(var i=e.getCoordinate(t-1),r=e.getCoordinate(t),n=(r.x-i.x)/this._numSubSegs,a=(r.y-i.y)/this._numSubSegs,o=0;o<this._numSubSegs;o++){var s=i.x+o*n,l=i.y+o*a,u=new yl(s,l);this._minPtDist.initialize(),$h.computeDistance(this._geom,u,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)}},qh.prototype.isDone=function(){return!1},qh.prototype.isGeometryChanged=function(){return!1},qh.prototype.getMaxPointDistance=function(){return this._maxPtDist},qh.prototype.interfaces_=function(){return[Wu]},qh.prototype.getClass=function(){return qh};var Qh=function(e,t,i){this._minValidDistance=null,this._maxValidDistance=null,this._minDistanceFound=null,this._maxDistanceFound=null,this._isValid=!0,this._errMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=e||null,this._bufDistance=t||null,this._result=i||null},Yh={VERBOSE:{configurable:!0},MAX_DISTANCE_DIFF_FRAC:{configurable:!0}};Qh.prototype.checkMaximumDistance=function(e,t,i){var r=new Hh(t,e);if(r.setDensifyFraction(.25),this._maxDistanceFound=r.orientedDistance(),this._maxDistanceFound>i){this._isValid=!1;var n=r.getCoordinates();this._errorLocation=n[1],this._errorIndicator=e.getFactory().createLineString(n),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+Wl.toLineString(n[0],n[1])+")"}},Qh.prototype.isValid=function(){var e=Math.abs(this._bufDistance),t=Qh.MAX_DISTANCE_DIFF_FRAC*e;return this._minValidDistance=e-t,this._maxValidDistance=e+t,!(!this._input.isEmpty()&&!this._result.isEmpty())||(0<this._bufDistance?this.checkPositiveValid():this.checkNegativeValid(),Qh.VERBOSE&&Bl.out.println("Min Dist= "+this._minDistanceFound+" err= "+(1-this._minDistanceFound/this._bufDistance)+" Max Dist= "+this._maxDistanceFound+" err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)},Qh.prototype.checkNegativeValid=function(){if(!(this._input instanceof uc||this._input instanceof hc||this._input instanceof ju))return null;var e=this.getPolygonLines(this._input);if(this.checkMinimumDistance(e,this._result,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(e,this._result,this._maxValidDistance)},Qh.prototype.getErrorIndicator=function(){return this._errorIndicator},Qh.prototype.checkMinimumDistance=function(e,t,i){var r=new Uh(e,t,i);if(this._minDistanceFound=r.distance(),this._minDistanceFound<i){this._isValid=!1;var n=r.nearestPoints();this._errorLocation=r.nearestPoints()[1],this._errorIndicator=e.getFactory().createLineString(n),this._errMsg="Distance between buffer curve and input is too small ("+this._minDistanceFound+" at "+Wl.toLineString(n[0],n[1])+" )"}},Qh.prototype.checkPositiveValid=function(){var e=this._result.getBoundary();if(this.checkMinimumDistance(this._input,e,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(this._input,e,this._maxValidDistance)},Qh.prototype.getErrorLocation=function(){return this._errorLocation},Qh.prototype.getPolygonLines=function(e){for(var t=new vu,i=new Nh(t),r=Lh.getPolygons(e).iterator();r.hasNext();)r.next().apply(i);return e.getFactory().buildGeometry(t)},Qh.prototype.getErrorMessage=function(){return this._errMsg},Qh.prototype.interfaces_=function(){return[]},Qh.prototype.getClass=function(){return Qh},Yh.VERBOSE.get=function(){return!1},Yh.MAX_DISTANCE_DIFF_FRAC.get=function(){return.012},Object.defineProperties(Qh,Yh);var Xh=function(e,t,i){this._isValid=!0,this._errorMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=e||null,this._distance=t||null,this._result=i||null},Zh={VERBOSE:{configurable:!0},MAX_ENV_DIFF_FRAC:{configurable:!0}};Xh.prototype.isValid=function(){return this.checkPolygonal(),this._isValid&&(this.checkExpectedEmpty(),this._isValid&&(this.checkEnvelope(),this._isValid&&(this.checkArea(),this._isValid&&this.checkDistance()))),this._isValid},Xh.prototype.checkEnvelope=function(){if(this._distance<0)return null;var e=this._distance*Xh.MAX_ENV_DIFF_FRAC;0===e&&(e=.001);var t=new Vl(this._input.getEnvelopeInternal());t.expandBy(this._distance);var i=new Vl(this._result.getEnvelopeInternal());i.expandBy(e),i.contains(t)||(this._isValid=!1,this._errorMsg="Buffer envelope is incorrect",this._errorIndicator=this._input.getFactory().toGeometry(i)),this.report("Envelope")},Xh.prototype.checkDistance=function(){var e=new Qh(this._input,this._distance,this._result);e.isValid()||(this._isValid=!1,this._errorMsg=e.getErrorMessage(),this._errorLocation=e.getErrorLocation(),this._errorIndicator=e.getErrorIndicator()),this.report("Distance")},Xh.prototype.checkArea=function(){var e=this._input.getArea(),t=this._result.getArea();0<this._distance&&t<e&&(this._isValid=!1,this._errorMsg="Area of positive buffer is smaller than input",this._errorIndicator=this._result),this._distance<0&&e<t&&(this._isValid=!1,this._errorMsg="Area of negative buffer is larger than input",this._errorIndicator=this._result),this.report("Area")},Xh.prototype.checkPolygonal=function(){this._result instanceof uc||this._result instanceof hc||(this._isValid=!1),this._errorMsg="Result is not polygonal",this._errorIndicator=this._result,this.report("Polygonal")},Xh.prototype.getErrorIndicator=function(){return this._errorIndicator},Xh.prototype.getErrorLocation=function(){return this._errorLocation},Xh.prototype.checkExpectedEmpty=function(){return 2<=this._input.getDimension()||0<this._distance?null:(this._result.isEmpty()||(this._isValid=!1,this._errorMsg="Result is non-empty",this._errorIndicator=this._result),void this.report("ExpectedEmpty"))},Xh.prototype.report=function(e){if(!Xh.VERBOSE)return null;Bl.out.println("Check "+e+": "+(this._isValid?"passed":"FAILED"))},Xh.prototype.getErrorMessage=function(){return this._errorMsg},Xh.prototype.interfaces_=function(){return[]},Xh.prototype.getClass=function(){return Xh},Xh.isValidMsg=function(e,t,i){var r=new Xh(e,t,i);return r.isValid()?null:r.getErrorMessage()},Xh.isValid=function(e,t,i){return!!new Xh(e,t,i).isValid()},Zh.VERBOSE.get=function(){return!1},Zh.MAX_ENV_DIFF_FRAC.get=function(){return.012},Object.defineProperties(Xh,Zh);var Jh=function(){this._pts=null,this._data=null;var e=arguments[0],t=arguments[1];this._pts=e,this._data=t};Jh.prototype.getCoordinates=function(){return this._pts},Jh.prototype.size=function(){return this._pts.length},Jh.prototype.getCoordinate=function(e){return this._pts[e]},Jh.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},Jh.prototype.getSegmentOctant=function(e){return e===this._pts.length-1?-1:bd.octant(this.getCoordinate(e),this.getCoordinate(e+1))},Jh.prototype.setData=function(e){this._data=e},Jh.prototype.getData=function(){return this._data},Jh.prototype.toString=function(){return Wl.toLineString(new vc(this._pts))},Jh.prototype.interfaces_=function(){return[Ad]},Jh.prototype.getClass=function(){return Jh};var Kh=function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new vu,this._intersectionCount=0,this._keepIntersections=!0;var e=arguments[0];this._li=e,this._interiorIntersection=null};Kh.prototype.getInteriorIntersection=function(){return this._interiorIntersection},Kh.prototype.setCheckEndSegmentsOnly=function(e){this._isCheckEndSegmentsOnly=e},Kh.prototype.getIntersectionSegments=function(){return this._intSegments},Kh.prototype.count=function(){return this._intersectionCount},Kh.prototype.getIntersections=function(){return this._intersections},Kh.prototype.setFindAllIntersections=function(e){this._findAllIntersections=e},Kh.prototype.setKeepIntersections=function(e){this._keepIntersections=e},Kh.prototype.processIntersections=function(e,t,i,r){if(!this._findAllIntersections&&this.hasIntersection())return null;if(e===i&&t===r)return null;if(this._isCheckEndSegmentsOnly&&!this.isEndSegment(e,t)&&!this.isEndSegment(i,r))return null;var n=e.getCoordinates()[t],a=e.getCoordinates()[t+1],o=i.getCoordinates()[r],s=i.getCoordinates()[r+1];this._li.computeIntersection(n,a,o,s),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=n,this._intSegments[1]=a,this._intSegments[2]=o,this._intSegments[3]=s,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)},Kh.prototype.isEndSegment=function(e,t){return 0===t||t>=e.size()-2},Kh.prototype.hasIntersection=function(){return null!==this._interiorIntersection},Kh.prototype.isDone=function(){return!this._findAllIntersections&&null!==this._interiorIntersection},Kh.prototype.interfaces_=function(){return[ah]},Kh.prototype.getClass=function(){return Kh},Kh.createAllIntersectionsFinder=function(e){var t=new Kh(e);return t.setFindAllIntersections(!0),t},Kh.createAnyIntersectionFinder=function(e){return new Kh(e)},Kh.createIntersectionCounter=function(e){var t=new Kh(e);return t.setFindAllIntersections(!0),t.setKeepIntersections(!1),t};var ep=function(){this._li=new Zl,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var e=arguments[0];this._segStrings=e};ep.prototype.execute=function(){if(null!==this._segInt)return null;this.checkInteriorIntersections()},ep.prototype.getIntersections=function(){return this._segInt.getIntersections()},ep.prototype.isValid=function(){return this.execute(),this._isValid},ep.prototype.setFindAllIntersections=function(e){this._findAllIntersections=e},ep.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new Kh(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var e=new Rd;if(e.setSegmentIntersector(this._segInt),e.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null},ep.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new zc(this.getErrorMessage(),this._segInt.getInteriorIntersection())},ep.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var e=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+Wl.toLineString(e[0],e[1])+" and "+Wl.toLineString(e[2],e[3])},ep.prototype.interfaces_=function(){return[]},ep.prototype.getClass=function(){return ep},ep.computeIntersections=function(e){var t=new ep(e);return t.setFindAllIntersections(!0),t.isValid(),t.getIntersections()};var tp=function e(){this._nv=null;var t=arguments[0];this._nv=new ep(e.toSegmentStrings(t))};tp.prototype.checkValid=function(){this._nv.checkValid()},tp.prototype.interfaces_=function(){return[]},tp.prototype.getClass=function(){return tp},tp.toSegmentStrings=function(e){for(var t=new vu,i=e.iterator();i.hasNext();){var r=i.next();t.add(new Jh(r.getCoordinates(),r))}return t},tp.checkValid=function(e){new tp(e).checkValid()};var ip=function(e){this._mapOp=e};ip.prototype.map=function(e){for(var t=new vu,i=0;i<e.getNumGeometries();i++){var r=this._mapOp.map(e.getGeometryN(i));r.isEmpty()||t.add(r)}return e.getFactory().createGeometryCollection(Tc.toGeometryArray(t))},ip.prototype.interfaces_=function(){return[]},ip.prototype.getClass=function(){return ip},ip.map=function(e,t){return new ip(t).map(e)};var rp=function(){this._op=null,this._geometryFactory=null,this._ptLocator=null,this._lineEdgesList=new vu,this._resultLineList=new vu;var e=arguments[0],t=arguments[1],i=arguments[2];this._op=e,this._geometryFactory=t,this._ptLocator=i};rp.prototype.collectLines=function(e){for(var t=this._op.getGraph().getEdgeEnds().iterator();t.hasNext();){var i=t.next();this.collectLineEdge(i,e,this._lineEdgesList),this.collectBoundaryTouchEdge(i,e,this._lineEdgesList)}},rp.prototype.labelIsolatedLine=function(e,t){var i=this._ptLocator.locate(e.getCoordinate(),this._op.getArgGeometry(t));e.getLabel().setLocation(t,i)},rp.prototype.build=function(e){return this.findCoveredLineEdges(),this.collectLines(e),this.buildLines(e),this._resultLineList},rp.prototype.collectLineEdge=function(e,t,i){var r=e.getLabel(),n=e.getEdge();e.isLineEdge()&&(e.isVisited()||!Bp.isResultOfOp(r,t)||n.isCovered()||(i.add(n),e.setVisitedEdge(!0)))},rp.prototype.findCoveredLineEdges=function(){for(var e=this._op.getGraph().getNodes().iterator();e.hasNext();)e.next().getEdges().findCoveredLineEdges();for(var t=this._op.getGraph().getEdgeEnds().iterator();t.hasNext();){var i=t.next(),r=i.getEdge();if(i.isLineEdge()&&!r.isCoveredSet()){var n=this._op.isCoveredByA(i.getCoordinate());r.setCovered(n)}}},rp.prototype.labelIsolatedLines=function(e){for(var t=e.iterator();t.hasNext();){var i=t.next(),r=i.getLabel();i.isIsolated()&&(r.isNull(0)?this.labelIsolatedLine(i,0):this.labelIsolatedLine(i,1))}},rp.prototype.buildLines=function(e){for(var t=this._lineEdgesList.iterator();t.hasNext();){var i=t.next(),r=this._geometryFactory.createLineString(i.getCoordinates());this._resultLineList.add(r),i.setInResult(!0)}},rp.prototype.collectBoundaryTouchEdge=function(e,t,i){var r=e.getLabel();return e.isLineEdge()||e.isVisited()||e.isInteriorAreaEdge()||e.getEdge().isInResult()?null:(Ql.isTrue(!(e.isInResult()||e.getSym().isInResult())||!e.getEdge().isInResult()),void(Bp.isResultOfOp(r,t)&&t===Bp.INTERSECTION&&(i.add(e.getEdge()),e.setVisitedEdge(!0))))},rp.prototype.interfaces_=function(){return[]},rp.prototype.getClass=function(){return rp};var np=function(){this._op=null,this._geometryFactory=null,this._resultPointList=new vu;var e=arguments[0],t=arguments[1];this._op=e,this._geometryFactory=t};np.prototype.filterCoveredNodeToPoint=function(e){var t=e.getCoordinate();if(!this._op.isCoveredByLA(t)){var i=this._geometryFactory.createPoint(t);this._resultPointList.add(i)}},np.prototype.extractNonCoveredResultNodes=function(e){for(var t=this._op.getGraph().getNodes().iterator();t.hasNext();){var i=t.next();if(!(i.isInResult()||i.isIncidentEdgeInResult()||0!==i.getEdges().getDegree()&&e!==Bp.INTERSECTION)){var r=i.getLabel();Bp.isResultOfOp(r,e)&&this.filterCoveredNodeToPoint(i)}}},np.prototype.build=function(e){return this.extractNonCoveredResultNodes(e),this._resultPointList},np.prototype.interfaces_=function(){return[]},np.prototype.getClass=function(){return np};var ap=function(){this._inputGeom=null,this._factory=null,this._pruneEmptyGeometry=!0,this._preserveGeometryCollectionType=!0,this._preserveCollections=!1,this._preserveType=!1};ap.prototype.transformPoint=function(e,t){return this._factory.createPoint(this.transformCoordinates(e.getCoordinateSequence(),e))},ap.prototype.transformPolygon=function(e,t){var i=!0,r=this.transformLinearRing(e.getExteriorRing(),e);null!==r&&r instanceof dc&&!r.isEmpty()||(i=!1);for(var n=new vu,a=0;a<e.getNumInteriorRing();a++){var o=this.transformLinearRing(e.getInteriorRingN(a),e);null===o||o.isEmpty()||(o instanceof dc||(i=!1),n.add(o))}if(i)return this._factory.createPolygon(r,n.toArray([]));var s=new vu;return null!==r&&s.add(r),s.addAll(n),this._factory.buildGeometry(s)},ap.prototype.createCoordinateSequence=function(e){return this._factory.getCoordinateSequenceFactory().create(e)},ap.prototype.getInputGeometry=function(){return this._inputGeom},ap.prototype.transformMultiLineString=function(e,t){for(var i=new vu,r=0;r<e.getNumGeometries();r++){var n=this.transformLineString(e.getGeometryN(r),e);null!==n&&(n.isEmpty()||i.add(n))}return this._factory.buildGeometry(i)},ap.prototype.transformCoordinates=function(e,t){return this.copy(e)},ap.prototype.transformLineString=function(e,t){return this._factory.createLineString(this.transformCoordinates(e.getCoordinateSequence(),e))},ap.prototype.transformMultiPoint=function(e,t){for(var i=new vu,r=0;r<e.getNumGeometries();r++){var n=this.transformPoint(e.getGeometryN(r),e);null!==n&&(n.isEmpty()||i.add(n))}return this._factory.buildGeometry(i)},ap.prototype.transformMultiPolygon=function(e,t){for(var i=new vu,r=0;r<e.getNumGeometries();r++){var n=this.transformPolygon(e.getGeometryN(r),e);null!==n&&(n.isEmpty()||i.add(n))}return this._factory.buildGeometry(i)},ap.prototype.copy=function(e){return e.copy()},ap.prototype.transformGeometryCollection=function(e,t){for(var i=new vu,r=0;r<e.getNumGeometries();r++){var n=this.transform(e.getGeometryN(r));null!==n&&(this._pruneEmptyGeometry&&n.isEmpty()||i.add(n))}return this._preserveGeometryCollectionType?this._factory.createGeometryCollection(Tc.toGeometryArray(i)):this._factory.buildGeometry(i)},ap.prototype.transform=function(e){if(this._inputGeom=e,this._factory=e.getFactory(),e instanceof sc)return this.transformPoint(e,null);if(e instanceof cc)return this.transformMultiPoint(e,null);if(e instanceof dc)return this.transformLinearRing(e,null);if(e instanceof ac)return this.transformLineString(e,null);if(e instanceof qu)return this.transformMultiLineString(e,null);if(e instanceof uc)return this.transformPolygon(e,null);if(e instanceof hc)return this.transformMultiPolygon(e,null);if(e instanceof ju)return this.transformGeometryCollection(e,null);throw new cl("Unknown Geometry subtype: "+e.getClass().getName())},ap.prototype.transformLinearRing=function(e,t){var i=this.transformCoordinates(e.getCoordinateSequence(),e);if(null===i)return this._factory.createLinearRing(null);var r=i.size();return 0<r&&r<4&&!this._preserveType?this._factory.createLineString(i):this._factory.createLinearRing(i)},ap.prototype.interfaces_=function(){return[]},ap.prototype.getClass=function(){return ap};var op=function e(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new Ed,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof ac&&"number"==typeof arguments[1]){var t=arguments[0],i=arguments[1];e.call(this,t.getCoordinates(),i)}else if(arguments[0]instanceof Array&&"number"==typeof arguments[1]){var r=arguments[0],n=arguments[1];this._srcPts=r,this._isClosed=e.isClosed(r),this._snapTolerance=n}};op.prototype.snapVertices=function(e,t){for(var i=this._isClosed?e.size()-1:e.size(),r=0;r<i;r++){var n=e.get(r),a=this.findSnapForVertex(n,t);null!==a&&(e.set(r,new yl(a)),0===r&&this._isClosed&&e.set(e.size()-1,new yl(a)))}},op.prototype.findSnapForVertex=function(e,t){for(var i=0;i<t.length;i++){if(e.equals2D(t[i]))return null;if(e.distance(t[i])<this._snapTolerance)return t[i]}return null},op.prototype.snapTo=function(e){var t=new Cu(this._srcPts);return this.snapVertices(t,e),this.snapSegments(t,e),t.toCoordinateArray()},op.prototype.snapSegments=function(e,t){if(0===t.length)return null;var i=t.length;t[0].equals2D(t[t.length-1])&&(i=t.length-1);for(var r=0;r<i;r++){var n=t[r],a=this.findSegmentIndexToSnap(n,e);0<=a&&e.add(a+1,new yl(n),!1)}},op.prototype.findSegmentIndexToSnap=function(e,t){for(var i=dl.MAX_VALUE,r=-1,n=0;n<t.size()-1;n++){if(this._seg.p0=t.get(n),this._seg.p1=t.get(n+1),this._seg.p0.equals2D(e)||this._seg.p1.equals2D(e)){if(this._allowSnappingToSourceVertices)continue;return-1}var a=this._seg.distance(e);a<this._snapTolerance&&a<i&&(i=a,r=n)}return r},op.prototype.setAllowSnappingToSourceVertices=function(e){this._allowSnappingToSourceVertices=e},op.prototype.interfaces_=function(){return[]},op.prototype.getClass=function(){return op},op.isClosed=function(e){return!(e.length<=1)&&e[0].equals2D(e[e.length-1])};var sp=function(e){this._srcGeom=e||null},lp={SNAP_PRECISION_FACTOR:{configurable:!0}};sp.prototype.snapTo=function(e,t){var i=this.extractTargetCoordinates(e);return new up(t,i).transform(this._srcGeom)},sp.prototype.snapToSelf=function(e,t){var i=this.extractTargetCoordinates(this._srcGeom),r=new up(e,i,!0).transform(this._srcGeom),n=r;return t&&Al(n,lc)&&(n=r.buffer(0)),n},sp.prototype.computeSnapTolerance=function(e){return this.computeMinimumSegmentLength(e)/10},sp.prototype.extractTargetCoordinates=function(e){for(var t=new Vu,i=e.getCoordinates(),r=0;r<i.length;r++)t.add(i[r]);return t.toArray(new Array(0).fill(null))},sp.prototype.computeMinimumSegmentLength=function(e){for(var t=dl.MAX_VALUE,i=0;i<e.length-1;i++){var r=e[i].distance(e[i+1]);r<t&&(t=r)}return t},sp.prototype.interfaces_=function(){return[]},sp.prototype.getClass=function(){return sp},sp.snap=function(e,t,i){var r=new Array(2).fill(null),n=new sp(e);r[0]=n.snapTo(t,i);var a=new sp(t);return r[1]=a.snapTo(r[0],i),r},sp.computeOverlaySnapTolerance=function(){if(1===arguments.length){var e=arguments[0],t=sp.computeSizeBasedSnapTolerance(e),i=e.getPrecisionModel();if(i.getType()===Ac.FIXED){var r=1/i.getScale()*2/1.415;t<r&&(t=r)}return t}if(2===arguments.length){var n=arguments[0],a=arguments[1];return Math.min(sp.computeOverlaySnapTolerance(n),sp.computeOverlaySnapTolerance(a))}},sp.computeSizeBasedSnapTolerance=function(e){var t=e.getEnvelopeInternal();return Math.min(t.getHeight(),t.getWidth())*sp.SNAP_PRECISION_FACTOR},sp.snapToSelf=function(e,t,i){return new sp(e).snapToSelf(t,i)},lp.SNAP_PRECISION_FACTOR.get=function(){return 1e-9},Object.defineProperties(sp,lp);var up=function(r){function e(e,t,i){r.call(this),this._snapTolerance=e||null,this._snapPts=t||null,this._isSelfSnap=void 0!==i&&i}return r&&(e.__proto__=r),((e.prototype=Object.create(r&&r.prototype)).constructor=e).prototype.snapLine=function(e,t){var i=new op(e,this._snapTolerance);return i.setAllowSnappingToSourceVertices(this._isSelfSnap),i.snapTo(t)},e.prototype.transformCoordinates=function(e,t){var i=e.toCoordinateArray(),r=this.snapLine(i,this._snapPts);return this._factory.getCoordinateSequenceFactory().create(r)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(ap),cp=function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null};cp.prototype.getCommon=function(){return dl.longBitsToDouble(this._commonBits)},cp.prototype.add=function(e){var t=dl.doubleToLongBits(e);return this._isFirst?(this._commonBits=t,this._commonSignExp=cp.signExpBits(this._commonBits),this._isFirst=!1,null):cp.signExpBits(t)!==this._commonSignExp?(this._commonBits=0,null):(this._commonMantissaBitsCount=cp.numCommonMostSigMantissaBits(this._commonBits,t),void(this._commonBits=cp.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))))},cp.prototype.toString=function(){if(1===arguments.length){var e=arguments[0],t=dl.longBitsToDouble(e),i=dl.toBinaryString(e),r="0000000000000000000000000000000000000000000000000000000000000000"+i,n=r.substring(r.length-64),a=n.substring(0,1)+" "+n.substring(1,12)+"(exp) "+n.substring(12)+" [ "+t+" ]";return a}},cp.prototype.interfaces_=function(){return[]},cp.prototype.getClass=function(){return cp},cp.getBit=function(e,t){return 0!=(e&1<<t)?1:0},cp.signExpBits=function(e){return e>>52},cp.zeroLowerBits=function(e,t){return e&~((1<<t)-1)},cp.numCommonMostSigMantissaBits=function(e,t){for(var i=0,r=52;0<=r;r--){if(cp.getBit(e,r)!==cp.getBit(t,r))return i;i++}return 52};var dp=function(){this._commonCoord=null,this._ccFilter=new pp},hp={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};dp.prototype.addCommonBits=function(e){var t=new fp(this._commonCoord);e.apply(t),e.geometryChanged()},dp.prototype.removeCommonBits=function(e){if(0===this._commonCoord.x&&0===this._commonCoord.y)return e;var t=new yl(this._commonCoord);t.x=-t.x,t.y=-t.y;var i=new fp(t);return e.apply(i),e.geometryChanged(),e},dp.prototype.getCommonCoordinate=function(){return this._commonCoord},dp.prototype.add=function(e){e.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()},dp.prototype.interfaces_=function(){return[]},dp.prototype.getClass=function(){return dp},hp.CommonCoordinateFilter.get=function(){return pp},hp.Translater.get=function(){return fp},Object.defineProperties(dp,hp);var pp=function(){this._commonBitsX=new cp,this._commonBitsY=new cp};pp.prototype.filter=function(e){this._commonBitsX.add(e.x),this._commonBitsY.add(e.y)},pp.prototype.getCommonCoordinate=function(){return new yl(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())},pp.prototype.interfaces_=function(){return[ou]},pp.prototype.getClass=function(){return pp};var fp=function(){this.trans=null;var e=arguments[0];this.trans=e};fp.prototype.filter=function(e,t){var i=e.getOrdinate(t,0)+this.trans.x,r=e.getOrdinate(t,1)+this.trans.y;e.setOrdinate(t,0,i),e.setOrdinate(t,1,r)},fp.prototype.isDone=function(){return!1},fp.prototype.isGeometryChanged=function(){return!0},fp.prototype.interfaces_=function(){return[Wu]},fp.prototype.getClass=function(){return fp};var mp=function(e,t){this._geom=new Array(2).fill(null),this._snapTolerance=null,this._cbr=null,this._geom[0]=e,this._geom[1]=t,this.computeSnapTolerance()};mp.prototype.selfSnap=function(e){return new sp(e).snapTo(e,this._snapTolerance)},mp.prototype.removeCommonBits=function(e){this._cbr=new dp,this._cbr.add(e[0]),this._cbr.add(e[1]);var t=new Array(2).fill(null);return t[0]=this._cbr.removeCommonBits(e[0].copy()),t[1]=this._cbr.removeCommonBits(e[1].copy()),t},mp.prototype.prepareResult=function(e){return this._cbr.addCommonBits(e),e},mp.prototype.getResultGeometry=function(e){var t=this.snap(this._geom),i=Bp.overlayOp(t[0],t[1],e);return this.prepareResult(i)},mp.prototype.checkValid=function(e){e.isValid()||Bl.out.println("Snapped geometry is invalid")},mp.prototype.computeSnapTolerance=function(){this._snapTolerance=sp.computeOverlaySnapTolerance(this._geom[0],this._geom[1])},mp.prototype.snap=function(e){var t=this.removeCommonBits(e);return sp.snap(t[0],t[1],this._snapTolerance)},mp.prototype.interfaces_=function(){return[]},mp.prototype.getClass=function(){return mp},mp.overlayOp=function(e,t,i){return new mp(e,t).getResultGeometry(i)},mp.union=function(e,t){return mp.overlayOp(e,t,Bp.UNION)},mp.intersection=function(e,t){return mp.overlayOp(e,t,Bp.INTERSECTION)},mp.symDifference=function(e,t){return mp.overlayOp(e,t,Bp.SYMDIFFERENCE)},mp.difference=function(e,t){return mp.overlayOp(e,t,Bp.DIFFERENCE)};var gp=function(e,t){this._geom=new Array(2).fill(null),this._geom[0]=e,this._geom[1]=t};gp.prototype.getResultGeometry=function(e){var t=null,i=!1,r=null;try{t=Bp.overlayOp(this._geom[0],this._geom[1],e),i=!0}catch(e){if(!(e instanceof jl))throw e;r=e}if(!i)try{t=mp.overlayOp(this._geom[0],this._geom[1],e)}catch(e){throw e instanceof jl?r:e}return t},gp.prototype.interfaces_=function(){return[]},gp.prototype.getClass=function(){return gp},gp.overlayOp=function(e,t,i){return new gp(e,t).getResultGeometry(i)},gp.union=function(e,t){return gp.overlayOp(e,t,Bp.UNION)},gp.intersection=function(e,t){return gp.overlayOp(e,t,Bp.INTERSECTION)},gp.symDifference=function(e,t){return gp.overlayOp(e,t,Bp.SYMDIFFERENCE)},gp.difference=function(e,t){return gp.overlayOp(e,t,Bp.DIFFERENCE)};var yp=function(){this.mce=null,this.chainIndex=null;var e=arguments[0],t=arguments[1];this.mce=e,this.chainIndex=t};yp.prototype.computeIntersections=function(e,t){this.mce.computeIntersectsForChain(this.chainIndex,e.mce,e.chainIndex,t)},yp.prototype.interfaces_=function(){return[]},yp.prototype.getClass=function(){return yp};var vp=function e(){if(this._label=null,this._xValue=null,this._eventType=null,this._insertEvent=null,this._deleteEventIndex=null,this._obj=null,2===arguments.length){var t=arguments[0],i=arguments[1];this._eventType=e.DELETE,this._xValue=t,this._insertEvent=i}else if(3===arguments.length){var r=arguments[0],n=arguments[1],a=arguments[2];this._eventType=e.INSERT,this._label=r,this._xValue=n,this._obj=a}},_p={INSERT:{configurable:!0},DELETE:{configurable:!0}};vp.prototype.isDelete=function(){return this._eventType===vp.DELETE},vp.prototype.setDeleteEventIndex=function(e){this._deleteEventIndex=e},vp.prototype.getObject=function(){return this._obj},vp.prototype.compareTo=function(e){var t=e;return this._xValue<t._xValue?-1:this._xValue>t._xValue?1:this._eventType<t._eventType?-1:this._eventType>t._eventType?1:0},vp.prototype.getInsertEvent=function(){return this._insertEvent},vp.prototype.isInsert=function(){return this._eventType===vp.INSERT},vp.prototype.isSameLabel=function(e){return null!==this._label&&this._label===e._label},vp.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex},vp.prototype.interfaces_=function(){return[pl]},vp.prototype.getClass=function(){return vp},_p.INSERT.get=function(){return 1},_p.DELETE.get=function(){return 2},Object.defineProperties(vp,_p);var Cp=function(){};Cp.prototype.interfaces_=function(){return[]},Cp.prototype.getClass=function(){return Cp};var xp=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._properIntersectionPoint=null,this._li=null,this._includeProper=null,this._recordIsolated=null,this._isSelfIntersection=null,this._numIntersections=0,this.numTests=0,this._bdyNodes=null,this._isDone=!1,this._isDoneWhenProperInt=!1;var e=arguments[0],t=arguments[1],i=arguments[2];this._li=e,this._includeProper=t,this._recordIsolated=i};xp.prototype.isTrivialIntersection=function(e,t,i,r){if(e===i&&1===this._li.getIntersectionNum()){if(xp.isAdjacentSegments(t,r))return!0;if(e.isClosed()){var n=e.getNumPoints()-1;if(0===t&&r===n||0===r&&t===n)return!0}}return!1},xp.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},xp.prototype.setIsDoneIfProperInt=function(e){this._isDoneWhenProperInt=e},xp.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},xp.prototype.isBoundaryPointInternal=function(e,t){for(var i=t.iterator();i.hasNext();){var r=i.next().getCoordinate();if(e.isIntersection(r))return!0}return!1},xp.prototype.hasProperIntersection=function(){return this._hasProper},xp.prototype.hasIntersection=function(){return this._hasIntersection},xp.prototype.isDone=function(){return this._isDone},xp.prototype.isBoundaryPoint=function(e,t){return!(null===t||!this.isBoundaryPointInternal(e,t[0])&&!this.isBoundaryPointInternal(e,t[1]))},xp.prototype.setBoundaryNodes=function(e,t){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=e,this._bdyNodes[1]=t},xp.prototype.addIntersections=function(e,t,i,r){if(e===i&&t===r)return null;this.numTests++;var n=e.getCoordinates()[t],a=e.getCoordinates()[t+1],o=i.getCoordinates()[r],s=i.getCoordinates()[r+1];this._li.computeIntersection(n,a,o,s),this._li.hasIntersection()&&(this._recordIsolated&&(e.setIsolated(!1),i.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(e,t,i,r)||(this._hasIntersection=!0,!this._includeProper&&this._li.isProper()||(e.addIntersections(this._li,t,0),i.addIntersections(this._li,r,1)),this._li.isProper()&&(this._properIntersectionPoint=this._li.getIntersection(0).copy(),this._hasProper=!0,this._isDoneWhenProperInt&&(this._isDone=!0),this.isBoundaryPoint(this._li,this._bdyNodes)||(this._hasProperInterior=!0))))},xp.prototype.interfaces_=function(){return[]},xp.prototype.getClass=function(){return xp},xp.isAdjacentSegments=function(e,t){return 1===Math.abs(e-t)};var bp=function(e){function t(){e.call(this),this.events=new vu,this.nOverlaps=null}return e&&(t.__proto__=e),((t.prototype=Object.create(e&&e.prototype)).constructor=t).prototype.prepareEvents=function(){dd.sort(this.events);for(var e=0;e<this.events.size();e++){var t=this.events.get(e);t.isDelete()&&t.getInsertEvent().setDeleteEventIndex(e)}},t.prototype.computeIntersections=function(){if(1===arguments.length){var e=arguments[0];this.nOverlaps=0,this.prepareEvents();for(var t=0;t<this.events.size();t++){var i=this.events.get(t);if(i.isInsert()&&this.processOverlaps(t,i.getDeleteEventIndex(),i,e),e.isDone())break}}else if(3===arguments.length)if(arguments[2]instanceof xp&&Al(arguments[0],gu)&&Al(arguments[1],gu)){var r=arguments[0],n=arguments[1],a=arguments[2];this.addEdges(r,r),this.addEdges(n,n),this.computeIntersections(a)}else if("boolean"==typeof arguments[2]&&Al(arguments[0],gu)&&arguments[1]instanceof xp){var o=arguments[0],s=arguments[1],l=arguments[2];l?this.addEdges(o,null):this.addEdges(o),this.computeIntersections(s)}},t.prototype.addEdge=function(e,t){for(var i=e.getMonotoneChainEdge(),r=i.getStartIndexes(),n=0;n<r.length-1;n++){var a=new yp(i,n),o=new vp(t,i.getMinX(n),a);this.events.add(o),this.events.add(new vp(i.getMaxX(n),o))}},t.prototype.processOverlaps=function(e,t,i,r){for(var n=i.getObject(),a=e;a<t;a++){var o=this.events.get(a);if(o.isInsert()){var s=o.getObject();i.isSameLabel(o)||(n.computeIntersections(s,r),this.nOverlaps++)}}},t.prototype.addEdges=function(){if(1===arguments.length)for(var e=arguments[0],t=e.iterator();t.hasNext();){var i=t.next();this.addEdge(i,i)}else if(2===arguments.length)for(var r=arguments[0],n=arguments[1],a=r.iterator();a.hasNext();){var o=a.next();this.addEdge(o,n)}},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(Cp),Ap=function(){this._min=dl.POSITIVE_INFINITY,this._max=dl.NEGATIVE_INFINITY},Sp={NodeComparator:{configurable:!0}};Ap.prototype.getMin=function(){return this._min},Ap.prototype.intersects=function(e,t){return!(this._min>t||this._max<e)},Ap.prototype.getMax=function(){return this._max},Ap.prototype.toString=function(){return Wl.toLineString(new yl(this._min,0),new yl(this._max,0))},Ap.prototype.interfaces_=function(){return[]},Ap.prototype.getClass=function(){return Ap},Sp.NodeComparator.get=function(){return wp},Object.defineProperties(Ap,Sp);var wp=function(){};wp.prototype.compare=function(e,t){var i=e,r=t,n=(i._min+i._max)/2,a=(r._min+r._max)/2;return n<a?-1:a<n?1:0},wp.prototype.interfaces_=function(){return[ml]},wp.prototype.getClass=function(){return wp};var Ep=function(r){function e(){r.call(this),this._item=null;var e=arguments[0],t=arguments[1],i=arguments[2];this._min=e,this._max=t,this._item=i}return r&&(e.__proto__=r),((e.prototype=Object.create(r&&r.prototype)).constructor=e).prototype.query=function(e,t,i){if(!this.intersects(e,t))return null;i.visitItem(this._item)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Ap),Tp=function(i){function e(){i.call(this),this._node1=null,this._node2=null;var e=arguments[0],t=arguments[1];this._node1=e,this._node2=t,this.buildExtent(this._node1,this._node2)}return i&&(e.__proto__=i),((e.prototype=Object.create(i&&i.prototype)).constructor=e).prototype.buildExtent=function(e,t){this._min=Math.min(e._min,t._min),this._max=Math.max(e._max,t._max)},e.prototype.query=function(e,t,i){if(!this.intersects(e,t))return null;null!==this._node1&&this._node1.query(e,t,i),null!==this._node2&&this._node2.query(e,t,i)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Ap),Pp=function(){this._leaves=new vu,this._root=null,this._level=0};Pp.prototype.buildTree=function(){dd.sort(this._leaves,new Ap.NodeComparator);for(var e=this._leaves,t=null,i=new vu;;){if(this.buildLevel(e,i),1===i.size())return i.get(0);t=e,e=i,i=t}},Pp.prototype.insert=function(e,t,i){if(null!==this._root)throw new Error("Index cannot be added to once it has been queried");this._leaves.add(new Ep(e,t,i))},Pp.prototype.query=function(e,t,i){this.init(),this._root.query(e,t,i)},Pp.prototype.buildRoot=function(){if(null!==this._root)return null;this._root=this.buildTree()},Pp.prototype.printNode=function(e){Bl.out.println(Wl.toLineString(new yl(e._min,this._level),new yl(e._max,this._level)))},Pp.prototype.init=function(){if(null!==this._root)return null;this.buildRoot()},Pp.prototype.buildLevel=function(e,t){this._level++,t.clear();for(var i=0;i<e.size();i+=2){var r=e.get(i);if(null===(i+1<e.size()?e.get(i):null))t.add(r);else{var n=new Tp(e.get(i),e.get(i+1));t.add(n)}}},Pp.prototype.interfaces_=function(){return[]},Pp.prototype.getClass=function(){return Pp};var Mp=function(){this._items=new vu};Mp.prototype.visitItem=function(e){this._items.add(e)},Mp.prototype.getItems=function(){return this._items},Mp.prototype.interfaces_=function(){return[sd]},Mp.prototype.getClass=function(){return Mp};var Dp=function(){this._index=null;var e=arguments[0];if(!Al(e,lc))throw new cl("Argument must be Polygonal");this._index=new Rp(e)},Ip={SegmentVisitor:{configurable:!0},IntervalIndexedGeometry:{configurable:!0}};Dp.prototype.locate=function(e){var t=new Kl(e),i=new Op(t);return this._index.query(e.y,e.y,i),t.getLocation()},Dp.prototype.interfaces_=function(){return[Zd]},Dp.prototype.getClass=function(){return Dp},Ip.SegmentVisitor.get=function(){return Op},Ip.IntervalIndexedGeometry.get=function(){return Rp},Object.defineProperties(Dp,Ip);var Op=function(){this._counter=null;var e=arguments[0];this._counter=e};Op.prototype.visitItem=function(e){var t=e;this._counter.countSegment(t.getCoordinate(0),t.getCoordinate(1))},Op.prototype.interfaces_=function(){return[sd]},Op.prototype.getClass=function(){return Op};var Rp=function(){this._index=new Pp;var e=arguments[0];this.init(e)};Rp.prototype.init=function(e){for(var t=Nh.getLines(e).iterator();t.hasNext();){var i=t.next().getCoordinates();this.addLine(i)}},Rp.prototype.addLine=function(e){for(var t=1;t<e.length;t++){var i=new Ed(e[t-1],e[t]),r=Math.min(i.p0.y,i.p1.y),n=Math.max(i.p0.y,i.p1.y);this._index.insert(r,n,i)}},Rp.prototype.query=function(){if(2===arguments.length){var e=arguments[0],t=arguments[1],i=new Mp;return this._index.query(e,t,i),i.getItems()}if(3===arguments.length){var r=arguments[0],n=arguments[1],a=arguments[2];this._index.query(r,n,a)}},Rp.prototype.interfaces_=function(){return[]},Rp.prototype.getClass=function(){return Rp};var Lp=function(o){function a(){if(o.call(this),this._parentGeom=null,this._lineEdgeMap=new bc,this._boundaryNodeRule=null,this._useBoundaryDeterminationRule=!0,this._argIndex=null,this._boundaryNodes=null,this._hasTooFewPoints=!1,this._invalidPoint=null,this._areaPtLocator=null,this._ptLocator=new kh,2===arguments.length){var e=arguments[0],t=arguments[1],i=su.OGC_SFS_BOUNDARY_RULE;this._argIndex=e,this._parentGeom=t,this._boundaryNodeRule=i,null!==t&&this.add(t)}else if(3===arguments.length){var r=arguments[0],n=arguments[1],a=arguments[2];this._argIndex=r,this._parentGeom=n,this._boundaryNodeRule=a,null!==n&&this.add(n)}}return o&&(a.__proto__=o),((a.prototype=Object.create(o&&o.prototype)).constructor=a).prototype.insertBoundaryPoint=function(e,t){var i=this._nodes.addNode(t).getLabel(),r=1;i.getLocation(e,Nc.ON)===xl.BOUNDARY&&r++;var n=a.determineBoundary(this._boundaryNodeRule,r);i.setLocation(e,n)},a.prototype.computeSelfNodes=function(){if(2===arguments.length){var e=arguments[0],t=arguments[1];return this.computeSelfNodes(e,t,!1)}if(3===arguments.length){var i=arguments[0],r=arguments[1],n=arguments[2],a=new xp(i,!0,!1);a.setIsDoneIfProperInt(n);var o=this.createEdgeSetIntersector(),s=this._parentGeom instanceof dc||this._parentGeom instanceof uc||this._parentGeom instanceof hc,l=r||!s;return o.computeIntersections(this._edges,a,l),this.addSelfIntersectionNodes(this._argIndex),a}},a.prototype.computeSplitEdges=function(e){for(var t=this._edges.iterator();t.hasNext();)t.next().eiList.addSplitEdges(e)},a.prototype.computeEdgeIntersections=function(e,t,i){var r=new xp(t,i,!0);return r.setBoundaryNodes(this.getBoundaryNodes(),e.getBoundaryNodes()),this.createEdgeSetIntersector().computeIntersections(this._edges,e._edges,r),r},a.prototype.getGeometry=function(){return this._parentGeom},a.prototype.getBoundaryNodeRule=function(){return this._boundaryNodeRule},a.prototype.hasTooFewPoints=function(){return this._hasTooFewPoints},a.prototype.addPoint=function(){if(arguments[0]instanceof sc){var e=arguments[0],t=e.getCoordinate();this.insertPoint(this._argIndex,t,xl.INTERIOR)}else if(arguments[0]instanceof yl){var i=arguments[0];this.insertPoint(this._argIndex,i,xl.INTERIOR)}},a.prototype.addPolygon=function(e){this.addPolygonRing(e.getExteriorRing(),xl.EXTERIOR,xl.INTERIOR);for(var t=0;t<e.getNumInteriorRing();t++){var i=e.getInteriorRingN(t);this.addPolygonRing(i,xl.INTERIOR,xl.EXTERIOR)}},a.prototype.addEdge=function(e){this.insertEdge(e);var t=e.getCoordinates();this.insertPoint(this._argIndex,t[0],xl.BOUNDARY),this.insertPoint(this._argIndex,t[t.length-1],xl.BOUNDARY)},a.prototype.addLineString=function(e){var t=xu.removeRepeatedPoints(e.getCoordinates());if(t.length<2)return this._hasTooFewPoints=!0,this._invalidPoint=t[0],null;var i=new ph(t,new Hc(this._argIndex,xl.INTERIOR));this._lineEdgeMap.put(e,i),this.insertEdge(i),Ql.isTrue(2<=t.length,"found LineString with single point"),this.insertBoundaryPoint(this._argIndex,t[0]),this.insertBoundaryPoint(this._argIndex,t[t.length-1])},a.prototype.getInvalidPoint=function(){return this._invalidPoint},a.prototype.getBoundaryPoints=function(){for(var e=this.getBoundaryNodes(),t=new Array(e.size()).fill(null),i=0,r=e.iterator();r.hasNext();){var n=r.next();t[i++]=n.getCoordinate().copy()}return t},a.prototype.getBoundaryNodes=function(){return null===this._boundaryNodes&&(this._boundaryNodes=this._nodes.getBoundaryNodes(this._argIndex)),this._boundaryNodes},a.prototype.addSelfIntersectionNode=function(e,t,i){if(this.isBoundaryNode(e,t))return null;i===xl.BOUNDARY&&this._useBoundaryDeterminationRule?this.insertBoundaryPoint(e,t):this.insertPoint(e,t,i)},a.prototype.addPolygonRing=function(e,t,i){if(e.isEmpty())return null;var r=xu.removeRepeatedPoints(e.getCoordinates());if(r.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=r[0],null;var n=t,a=i;eu.isCCW(r)&&(n=i,a=t);var o=new ph(r,new Hc(this._argIndex,xl.BOUNDARY,n,a));this._lineEdgeMap.put(e,o),this.insertEdge(o),this.insertPoint(this._argIndex,r[0],xl.BOUNDARY)},a.prototype.insertPoint=function(e,t,i){var r=this._nodes.addNode(t),n=r.getLabel();null===n?r._label=new Hc(e,i):n.setLocation(e,i)},a.prototype.createEdgeSetIntersector=function(){return new bp},a.prototype.addSelfIntersectionNodes=function(e){for(var t=this._edges.iterator();t.hasNext();)for(var i=t.next(),r=i.getLabel().getLocation(e),n=i.eiList.iterator();n.hasNext();){var a=n.next();this.addSelfIntersectionNode(e,a.coord,r)}},a.prototype.add=function(){if(1!==arguments.length)return o.prototype.add.apply(this,arguments);var e=arguments[0];if(e.isEmpty())return null;if(e instanceof hc&&(this._useBoundaryDeterminationRule=!1),e instanceof uc)this.addPolygon(e);else if(e instanceof ac)this.addLineString(e);else if(e instanceof sc)this.addPoint(e);else if(e instanceof cc)this.addCollection(e);else if(e instanceof qu)this.addCollection(e);else if(e instanceof hc)this.addCollection(e);else{if(!(e instanceof ju))throw new Error(e.getClass().getName());this.addCollection(e)}},a.prototype.addCollection=function(e){for(var t=0;t<e.getNumGeometries();t++){var i=e.getGeometryN(t);this.add(i)}},a.prototype.locate=function(e){return Al(this._parentGeom,lc)&&50<this._parentGeom.getNumGeometries()?(null===this._areaPtLocator&&(this._areaPtLocator=new Dp(this._parentGeom)),this._areaPtLocator.locate(e)):this._ptLocator.locate(e,this._parentGeom)},a.prototype.findEdge=function(){if(1!==arguments.length)return o.prototype.findEdge.apply(this,arguments);var e=arguments[0];return this._lineEdgeMap.get(e)},a.prototype.interfaces_=function(){return[]},a.prototype.getClass=function(){return a},a.determineBoundary=function(e,t){return e.isInBoundary(t)?xl.BOUNDARY:xl.INTERIOR},a}(id),Np=function(){if(this._li=new Zl,this._resultPrecisionModel=null,this._arg=null,1===arguments.length){var e=arguments[0];this.setComputationPrecision(e.getPrecisionModel()),this._arg=new Array(1).fill(null),this._arg[0]=new Lp(0,e)}else if(2===arguments.length){var t=arguments[0],i=arguments[1],r=su.OGC_SFS_BOUNDARY_RULE;0<=t.getPrecisionModel().compareTo(i.getPrecisionModel())?this.setComputationPrecision(t.getPrecisionModel()):this.setComputationPrecision(i.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new Lp(0,t,r),this._arg[1]=new Lp(1,i,r)}else if(3===arguments.length){var n=arguments[0],a=arguments[1],o=arguments[2];0<=n.getPrecisionModel().compareTo(a.getPrecisionModel())?this.setComputationPrecision(n.getPrecisionModel()):this.setComputationPrecision(a.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new Lp(0,n,o),this._arg[1]=new Lp(1,a,o)}};Np.prototype.getArgGeometry=function(e){return this._arg[e].getGeometry()},Np.prototype.setComputationPrecision=function(e){this._resultPrecisionModel=e,this._li.setPrecisionModel(this._resultPrecisionModel)},Np.prototype.interfaces_=function(){return[]},Np.prototype.getClass=function(){return Np};var kp=function(){};kp.prototype.interfaces_=function(){return[]},kp.prototype.getClass=function(){return kp},kp.map=function(){if(arguments[0]instanceof ru&&Al(arguments[1],kp.MapOp)){for(var e=arguments[0],t=arguments[1],i=new vu,r=0;r<e.getNumGeometries();r++){var n=t.map(e.getGeometryN(r));null!==n&&i.add(n)}return e.getFactory().buildGeometry(i)}if(Al(arguments[0],pu)&&Al(arguments[1],kp.MapOp)){for(var a=arguments[0],o=arguments[1],s=new vu,l=a.iterator();l.hasNext();){var u=l.next(),c=o.map(u);null!==c&&s.add(c)}return s}},kp.MapOp=function(){};var Bp=function(i){function a(){var e=arguments[0],t=arguments[1];i.call(this,e,t),this._ptLocator=new kh,this._geomFact=null,this._resultGeom=null,this._graph=null,this._edgeList=new nh,this._resultPolyList=new vu,this._resultLineList=new vu,this._resultPointList=new vu,this._graph=new id(new ih),this._geomFact=e.getFactory()}return i&&(a.__proto__=i),((a.prototype=Object.create(i&&i.prototype)).constructor=a).prototype.insertUniqueEdge=function(e){var t=this._edgeList.findEqualEdge(e);if(null!==t){var i=t.getLabel(),r=e.getLabel();t.isPointwiseEqual(e)||(r=new Hc(e.getLabel())).flip();var n=t.getDepth();n.isNull()&&n.add(i),n.add(r),i.merge(r)}else this._edgeList.add(e)},a.prototype.getGraph=function(){return this._graph},a.prototype.cancelDuplicateResultEdges=function(){for(var e=this._graph.getEdgeEnds().iterator();e.hasNext();){var t=e.next(),i=t.getSym();t.isInResult()&&i.isInResult()&&(t.setInResult(!1),i.setInResult(!1))}},a.prototype.isCoveredByLA=function(e){return!!this.isCovered(e,this._resultLineList)||!!this.isCovered(e,this._resultPolyList)},a.prototype.computeGeometry=function(e,t,i,r){var n=new vu;return n.addAll(e),n.addAll(t),n.addAll(i),n.isEmpty()?a.createEmptyResult(r,this._arg[0].getGeometry(),this._arg[1].getGeometry(),this._geomFact):this._geomFact.buildGeometry(n)},a.prototype.mergeSymLabels=function(){for(var e=this._graph.getNodes().iterator();e.hasNext();)e.next().getEdges().mergeSymLabels()},a.prototype.isCovered=function(e,t){for(var i=t.iterator();i.hasNext();){var r=i.next();if(this._ptLocator.locate(e,r)!==xl.EXTERIOR)return!0}return!1},a.prototype.replaceCollapsedEdges=function(){for(var e=new vu,t=this._edgeList.iterator();t.hasNext();){var i=t.next();i.isCollapsed()&&(t.remove(),e.add(i.getCollapsedEdge()))}this._edgeList.addAll(e)},a.prototype.updateNodeLabelling=function(){for(var e=this._graph.getNodes().iterator();e.hasNext();){var t=e.next(),i=t.getEdges().getLabel();t.getLabel().merge(i)}},a.prototype.getResultGeometry=function(e){return this.computeOverlay(e),this._resultGeom},a.prototype.insertUniqueEdges=function(e){for(var t=e.iterator();t.hasNext();){var i=t.next();this.insertUniqueEdge(i)}},a.prototype.computeOverlay=function(e){this.copyPoints(0),this.copyPoints(1),this._arg[0].computeSelfNodes(this._li,!1),this._arg[1].computeSelfNodes(this._li,!1),this._arg[0].computeEdgeIntersections(this._arg[1],this._li,!0);var t=new vu;this._arg[0].computeSplitEdges(t),this._arg[1].computeSplitEdges(t),this.insertUniqueEdges(t),this.computeLabelsFromDepths(),this.replaceCollapsedEdges(),tp.checkValid(this._edgeList.getEdges()),this._graph.addEdges(this._edgeList.getEdges()),this.computeLabelling(),this.labelIncompleteNodes(),this.findResultAreaEdges(e),this.cancelDuplicateResultEdges();var i=new rd(this._geomFact);i.add(this._graph),this._resultPolyList=i.getPolygons();var r=new rp(this,this._geomFact,this._ptLocator);this._resultLineList=r.build(e);var n=new np(this,this._geomFact,this._ptLocator);this._resultPointList=n.build(e),this._resultGeom=this.computeGeometry(this._resultPointList,this._resultLineList,this._resultPolyList,e)},a.prototype.labelIncompleteNode=function(e,t){var i=this._ptLocator.locate(e.getCoordinate(),this._arg[t].getGeometry());e.getLabel().setLocation(t,i)},a.prototype.copyPoints=function(e){for(var t=this._arg[e].getNodeIterator();t.hasNext();){var i=t.next();this._graph.addNode(i.getCoordinate()).setLabel(e,i.getLabel().getLocation(e))}},a.prototype.findResultAreaEdges=function(e){for(var t=this._graph.getEdgeEnds().iterator();t.hasNext();){var i=t.next(),r=i.getLabel();r.isArea()&&!i.isInteriorAreaEdge()&&a.isResultOfOp(r.getLocation(0,Nc.RIGHT),r.getLocation(1,Nc.RIGHT),e)&&i.setInResult(!0)}},a.prototype.computeLabelsFromDepths=function(){for(var e=this._edgeList.iterator();e.hasNext();){var t=e.next(),i=t.getLabel(),r=t.getDepth();if(!r.isNull()){r.normalize();for(var n=0;n<2;n++)i.isNull(n)||!i.isArea()||r.isNull(n)||(0===r.getDelta(n)?i.toLine(n):(Ql.isTrue(!r.isNull(n,Nc.LEFT),"depth of LEFT side has not been initialized"),i.setLocation(n,Nc.LEFT,r.getLocation(n,Nc.LEFT)),Ql.isTrue(!r.isNull(n,Nc.RIGHT),"depth of RIGHT side has not been initialized"),i.setLocation(n,Nc.RIGHT,r.getLocation(n,Nc.RIGHT))))}}},a.prototype.computeLabelling=function(){for(var e=this._graph.getNodes().iterator();e.hasNext();)e.next().getEdges().computeLabelling(this._arg);this.mergeSymLabels(),this.updateNodeLabelling()},a.prototype.labelIncompleteNodes=function(){for(var e=this._graph.getNodes().iterator();e.hasNext();){var t=e.next(),i=t.getLabel();t.isIsolated()&&(i.isNull(0)?this.labelIncompleteNode(t,0):this.labelIncompleteNode(t,1)),t.getEdges().updateLabelling(i)}},a.prototype.isCoveredByA=function(e){return!!this.isCovered(e,this._resultPolyList)},a.prototype.interfaces_=function(){return[]},a.prototype.getClass=function(){return a},a}(Np);Bp.overlayOp=function(e,t,i){return new Bp(e,t).getResultGeometry(i)},Bp.intersection=function(e,t){if(e.isEmpty()||t.isEmpty())return Bp.createEmptyResult(Bp.INTERSECTION,e,t,e.getFactory());if(e.isGeometryCollection()){var i=t;return ip.map(e,{interfaces_:function(){return[kp.MapOp]},map:function(e){return e.intersection(i)}})}return e.checkNotGeometryCollection(e),e.checkNotGeometryCollection(t),gp.overlayOp(e,t,Bp.INTERSECTION)},Bp.symDifference=function(e,t){if(e.isEmpty()||t.isEmpty()){if(e.isEmpty()&&t.isEmpty())return Bp.createEmptyResult(Bp.SYMDIFFERENCE,e,t,e.getFactory());if(e.isEmpty())return t.copy();if(t.isEmpty())return e.copy()}return e.checkNotGeometryCollection(e),e.checkNotGeometryCollection(t),gp.overlayOp(e,t,Bp.SYMDIFFERENCE)},Bp.resultDimension=function(e,t,i){var r=t.getDimension(),n=i.getDimension(),a=-1;switch(e){case Bp.INTERSECTION:a=Math.min(r,n);break;case Bp.UNION:a=Math.max(r,n);break;case Bp.DIFFERENCE:a=r;break;case Bp.SYMDIFFERENCE:a=Math.max(r,n)}return a},Bp.createEmptyResult=function(e,t,i,r){var n=null;switch(Bp.resultDimension(e,t,i)){case-1:n=r.createGeometryCollection(new Array(0).fill(null));break;case 0:n=r.createPoint();break;case 1:n=r.createLineString();break;case 2:n=r.createPolygon()}return n},Bp.difference=function(e,t){return e.isEmpty()?Bp.createEmptyResult(Bp.DIFFERENCE,e,t,e.getFactory()):t.isEmpty()?e.copy():(e.checkNotGeometryCollection(e),e.checkNotGeometryCollection(t),gp.overlayOp(e,t,Bp.DIFFERENCE))},Bp.isResultOfOp=function(){if(2===arguments.length){var e=arguments[0],t=arguments[1],i=e.getLocation(0),r=e.getLocation(1);return Bp.isResultOfOp(i,r,t)}if(3===arguments.length){var n=arguments[0],a=arguments[1],o=arguments[2];switch(n===xl.BOUNDARY&&(n=xl.INTERIOR),a===xl.BOUNDARY&&(a=xl.INTERIOR),o){case Bp.INTERSECTION:return n===xl.INTERIOR&&a===xl.INTERIOR;case Bp.UNION:return n===xl.INTERIOR||a===xl.INTERIOR;case Bp.DIFFERENCE:return n===xl.INTERIOR&&a!==xl.INTERIOR;case Bp.SYMDIFFERENCE:return n===xl.INTERIOR&&a!==xl.INTERIOR||n!==xl.INTERIOR&&a===xl.INTERIOR}return!1}},Bp.INTERSECTION=1,Bp.UNION=2,Bp.DIFFERENCE=3,Bp.SYMDIFFERENCE=4;var Fp=function(){this._g=null,this._boundaryDistanceTolerance=null,this._linework=null,this._ptLocator=new kh,this._seg=new Ed;var e=arguments[0],t=arguments[1];this._g=e,this._boundaryDistanceTolerance=t,this._linework=this.extractLinework(e)};Fp.prototype.isWithinToleranceOfBoundary=function(e){for(var t=0;t<this._linework.getNumGeometries();t++)for(var i=this._linework.getGeometryN(t).getCoordinateSequence(),r=0;r<i.size()-1;r++)if(i.getCoordinate(r,this._seg.p0),i.getCoordinate(r+1,this._seg.p1),this._seg.distance(e)<=this._boundaryDistanceTolerance)return!0;return!1},Fp.prototype.getLocation=function(e){return this.isWithinToleranceOfBoundary(e)?xl.BOUNDARY:this._ptLocator.locate(e,this._g)},Fp.prototype.extractLinework=function(e){var t=new Vp;e.apply(t);var i=t.getLinework(),r=Tc.toLineStringArray(i);return e.getFactory().createMultiLineString(r)},Fp.prototype.interfaces_=function(){return[]},Fp.prototype.getClass=function(){return Fp};var Vp=function(){this._linework=null,this._linework=new vu};Vp.prototype.getLinework=function(){return this._linework},Vp.prototype.filter=function(e){if(e instanceof uc){var t=e;this._linework.add(t.getExteriorRing());for(var i=0;i<t.getNumInteriorRing();i++)this._linework.add(t.getInteriorRingN(i))}},Vp.prototype.interfaces_=function(){return[Hu]},Vp.prototype.getClass=function(){return Vp};var zp=function(){this._g=null,this._doLeft=!0,this._doRight=!0;var e=arguments[0];this._g=e};zp.prototype.extractPoints=function(e,t,i){for(var r=e.getCoordinates(),n=0;n<r.length-1;n++)this.computeOffsetPoints(r[n],r[n+1],t,i)},zp.prototype.setSidesToGenerate=function(e,t){this._doLeft=e,this._doRight=t},zp.prototype.getPoints=function(e){for(var t=new vu,i=Nh.getLines(this._g).iterator();i.hasNext();){var r=i.next();this.extractPoints(r,e,t)}return t},zp.prototype.computeOffsetPoints=function(e,t,i,r){var n=t.x-e.x,a=t.y-e.y,o=Math.sqrt(n*n+a*a),s=i*n/o,l=i*a/o,u=(t.x+e.x)/2,c=(t.y+e.y)/2;if(this._doLeft){var d=new yl(u-l,c+s);r.add(d)}if(this._doRight){var h=new yl(u+l,c-s);r.add(h)}},zp.prototype.interfaces_=function(){return[]},zp.prototype.getClass=function(){return zp};var Up=function e(){this._geom=null,this._locFinder=null,this._location=new Array(3).fill(null),this._invalidLocation=null,this._boundaryDistanceTolerance=e.TOLERANCE,this._testCoords=new vu;var t=arguments[0],i=arguments[1],r=arguments[2];this._boundaryDistanceTolerance=e.computeBoundaryDistanceTolerance(t,i),this._geom=[t,i,r],this._locFinder=[new Fp(this._geom[0],this._boundaryDistanceTolerance),new Fp(this._geom[1],this._boundaryDistanceTolerance),new Fp(this._geom[2],this._boundaryDistanceTolerance)]},Gp={TOLERANCE:{configurable:!0}};Up.prototype.reportResult=function(e,t,i){Bl.out.println("Overlay result invalid - A:"+xl.toLocationSymbol(t[0])+" B:"+xl.toLocationSymbol(t[1])+" expected:"+(i?"i":"e")+" actual:"+xl.toLocationSymbol(t[2]))},Up.prototype.isValid=function(e){this.addTestPts(this._geom[0]),this.addTestPts(this._geom[1]);var t=this.checkValid(e);return t},Up.prototype.checkValid=function(){if(1===arguments.length){for(var e=arguments[0],t=0;t<this._testCoords.size();t++){var i=this._testCoords.get(t);if(!this.checkValid(e,i))return this._invalidLocation=i,!1}return!0}if(2===arguments.length){var r=arguments[0],n=arguments[1];return this._location[0]=this._locFinder[0].getLocation(n),this._location[1]=this._locFinder[1].getLocation(n),this._location[2]=this._locFinder[2].getLocation(n),!!Up.hasLocation(this._location,xl.BOUNDARY)||this.isValidResult(r,this._location)}},Up.prototype.addTestPts=function(e){var t=new zp(e);this._testCoords.addAll(t.getPoints(5*this._boundaryDistanceTolerance))},Up.prototype.isValidResult=function(e,t){var i=Bp.isResultOfOp(t[0],t[1],e),r=!(i^t[2]===xl.INTERIOR);return r||this.reportResult(e,t,i),r},Up.prototype.getInvalidLocation=function(){return this._invalidLocation},Up.prototype.interfaces_=function(){return[]},Up.prototype.getClass=function(){return Up},Up.hasLocation=function(e,t){for(var i=0;i<3;i++)if(e[i]===t)return!0;return!1},Up.computeBoundaryDistanceTolerance=function(e,t){return Math.min(sp.computeSizeBasedSnapTolerance(e),sp.computeSizeBasedSnapTolerance(t))},Up.isValid=function(e,t,i,r){return new Up(e,t,r).isValid(i)},Gp.TOLERANCE.get=function(){return 1e-6},Object.defineProperties(Up,Gp);var $p=function e(t){this._geomFactory=null,this._skipEmpty=!1,this._inputGeoms=null,this._geomFactory=e.extractFactory(t),this._inputGeoms=t};$p.prototype.extractElements=function(e,t){if(null===e)return null;for(var i=0;i<e.getNumGeometries();i++){var r=e.getGeometryN(i);this._skipEmpty&&r.isEmpty()||t.add(r)}},$p.prototype.combine=function(){for(var e=new vu,t=this._inputGeoms.iterator();t.hasNext();){var i=t.next();this.extractElements(i,e)}return 0===e.size()?null!==this._geomFactory?this._geomFactory.createGeometryCollection(null):null:this._geomFactory.buildGeometry(e)},$p.prototype.interfaces_=function(){return[]},$p.prototype.getClass=function(){return $p},$p.combine=function(){if(1===arguments.length){var e=arguments[0],t=new $p(e);return t.combine()}if(2===arguments.length){var i=arguments[0],r=arguments[1],n=new $p($p.createList(i,r));return n.combine()}if(3===arguments.length){var a=arguments[0],o=arguments[1],s=arguments[2],l=new $p($p.createList(a,o,s));return l.combine()}},$p.extractFactory=function(e){return e.isEmpty()?null:e.iterator().next().getFactory()},$p.createList=function(){if(2===arguments.length){var e=arguments[0],t=arguments[1],i=new vu;return i.add(e),i.add(t),i}if(3===arguments.length){var r=arguments[0],n=arguments[1],a=arguments[2],o=new vu;return o.add(r),o.add(n),o.add(a),o}};var Hp=function(){this._inputPolys=null,this._geomFactory=null;var e=arguments[0];this._inputPolys=e,null===this._inputPolys&&(this._inputPolys=new vu)},Wp={STRTREE_NODE_CAPACITY:{configurable:!0}};Hp.prototype.reduceToGeometries=function(e){for(var t=new vu,i=e.iterator();i.hasNext();){var r=i.next(),n=null;Al(r,gu)?n=this.unionTree(r):r instanceof ru&&(n=r),t.add(n)}return t},Hp.prototype.extractByEnvelope=function(e,t,i){for(var r=new vu,n=0;n<t.getNumGeometries();n++){var a=t.getGeometryN(n);a.getEnvelopeInternal().intersects(e)?r.add(a):i.add(a)}return this._geomFactory.buildGeometry(r)},Hp.prototype.unionOptimized=function(e,t){var i=e.getEnvelopeInternal(),r=t.getEnvelopeInternal();if(!i.intersects(r))return $p.combine(e,t);if(e.getNumGeometries()<=1&&t.getNumGeometries()<=1)return this.unionActual(e,t);var n=i.intersection(r);return this.unionUsingEnvelopeIntersection(e,t,n)},Hp.prototype.union=function(){if(null===this._inputPolys)throw new Error("union() method cannot be called twice");if(this._inputPolys.isEmpty())return null;this._geomFactory=this._inputPolys.iterator().next().getFactory();for(var e=new yd(Hp.STRTREE_NODE_CAPACITY),t=this._inputPolys.iterator();t.hasNext();){var i=t.next();e.insert(i.getEnvelopeInternal(),i)}this._inputPolys=null;var r=e.itemsTree();return this.unionTree(r)},Hp.prototype.binaryUnion=function(){if(1===arguments.length){var e=arguments[0];return this.binaryUnion(e,0,e.size())}if(3===arguments.length){var t=arguments[0],i=arguments[1],r=arguments[2];if(r-i<=1){var n=Hp.getGeometry(t,i);return this.unionSafe(n,null)}if(r-i==2)return this.unionSafe(Hp.getGeometry(t,i),Hp.getGeometry(t,i+1));var a=Math.trunc((r+i)/2),o=this.binaryUnion(t,i,a),s=this.binaryUnion(t,a,r);return this.unionSafe(o,s)}},Hp.prototype.repeatedUnion=function(e){for(var t=null,i=e.iterator();i.hasNext();){var r=i.next();t=null===t?r.copy():t.union(r)}return t},Hp.prototype.unionSafe=function(e,t){return null===e&&null===t?null:null===e?t.copy():null===t?e.copy():this.unionOptimized(e,t)},Hp.prototype.unionActual=function(e,t){return Hp.restrictToPolygons(e.union(t))},Hp.prototype.unionTree=function(e){var t=this.reduceToGeometries(e);return this.binaryUnion(t)},Hp.prototype.unionUsingEnvelopeIntersection=function(e,t,i){var r=new vu,n=this.extractByEnvelope(i,e,r),a=this.extractByEnvelope(i,t,r),o=this.unionActual(n,a);return r.add(o),$p.combine(r)},Hp.prototype.bufferUnion=function(){if(1===arguments.length){var e=arguments[0],t=e.get(0).getFactory(),i=t.buildGeometry(e),r=i.buffer(0);return r}if(2===arguments.length){var n=arguments[0],a=arguments[1],o=n.getFactory(),s=o.createGeometryCollection([n,a]),l=s.buffer(0);return l}},Hp.prototype.interfaces_=function(){return[]},Hp.prototype.getClass=function(){return Hp},Hp.restrictToPolygons=function(e){if(Al(e,lc))return e;var t=Lh.getPolygons(e);return 1===t.size()?t.get(0):e.getFactory().createMultiPolygon(Tc.toPolygonArray(t))},Hp.getGeometry=function(e,t){return t>=e.size()?null:e.get(t)},Hp.union=function(e){return new Hp(e).union()},Wp.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(Hp,Wp);var jp=function(){};function qp(){return new Qp}function Qp(){this.reset()}jp.prototype.interfaces_=function(){return[]},jp.prototype.getClass=function(){return jp},jp.union=function(e,t){if(e.isEmpty()||t.isEmpty()){if(e.isEmpty()&&t.isEmpty())return Bp.createEmptyResult(Bp.UNION,e,t,e.getFactory());if(e.isEmpty())return t.copy();if(t.isEmpty())return e.copy()}return e.checkNotGeometryCollection(e),e.checkNotGeometryCollection(t),gp.overlayOp(e,t,Bp.UNION)},Qp.prototype={constructor:Qp,reset:function(){this.s=this.t=0},add:function(e){Xp(Yp,e,this.t),Xp(this,Yp.s,this.s),this.s?this.t+=Yp.t:this.s=Yp.t},valueOf:function(){return this.s}};var Yp=new Qp;function Xp(e,t,i){var r=e.s=t+i,n=r-t,a=r-n;e.t=t-a+(i-n)}var Zp=1e-6,Jp=Math.PI,Kp=Jp/2,ef=Jp/4,tf=2*Jp,rf=180/Jp,nf=Jp/180,af=Math.abs,of=Math.atan,sf=Math.atan2,lf=Math.cos,uf=Math.sin,cf=Math.sqrt;function df(e){return 1<e?0:e<-1?Jp:Math.acos(e)}function hf(e){return 1<e?Kp:e<-1?-Kp:Math.asin(e)}function pf(){}function ff(e,t){e&&gf.hasOwnProperty(e.type)&&gf[e.type](e,t)}var mf={Feature:function(e,t){ff(e.geometry,t)},FeatureCollection:function(e,t){for(var i=e.features,r=-1,n=i.length;++r<n;)ff(i[r].geometry,t)}},gf={Sphere:function(e,t){t.sphere()},Point:function(e,t){e=e.coordinates,t.point(e[0],e[1],e[2])},MultiPoint:function(e,t){for(var i=e.coordinates,r=-1,n=i.length;++r<n;)e=i[r],t.point(e[0],e[1],e[2])},LineString:function(e,t){yf(e.coordinates,t,0)},MultiLineString:function(e,t){for(var i=e.coordinates,r=-1,n=i.length;++r<n;)yf(i[r],t,0)},Polygon:function(e,t){vf(e.coordinates,t)},MultiPolygon:function(e,t){for(var i=e.coordinates,r=-1,n=i.length;++r<n;)vf(i[r],t)},GeometryCollection:function(e,t){for(var i=e.geometries,r=-1,n=i.length;++r<n;)ff(i[r],t)}};function yf(e,t,i){var r,n=-1,a=e.length-i;for(t.lineStart();++n<a;)r=e[n],t.point(r[0],r[1],r[2]);t.lineEnd()}function vf(e,t){var i=-1,r=e.length;for(t.polygonStart();++i<r;)yf(e[i],t,1);t.polygonEnd()}function _f(e){return[sf(e[1],e[0]),hf(e[2])]}function Cf(e){var t=e[0],i=e[1],r=lf(i);return[r*lf(t),r*uf(t),uf(i)]}function xf(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function bf(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function Af(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function Sf(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function wf(e){var t=cf(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}function Ef(i,r){function e(e,t){return e=i(e,t),r(e[0],e[1])}return i.invert&&r.invert&&(e.invert=function(e,t){return(e=r.invert(e,t))&&i.invert(e[0],e[1])}),e}function Tf(e,t){return[Jp<e?e-tf:e<-Jp?e+tf:e,t]}function Pf(i){return function(e,t){return[(e+=i)>Jp?e-tf:e<-Jp?e+tf:e,t]}}function Mf(e){var t=Pf(e);return t.invert=Pf(-e),t}function Df(e,t){var s=lf(e),l=uf(e),u=lf(t),c=uf(t);function i(e,t){var i=lf(t),r=lf(e)*i,n=uf(e)*i,a=uf(t),o=a*s+r*l;return[sf(n*u-o*c,r*s-a*l),hf(o*u+n*c)]}return i.invert=function(e,t){var i=lf(t),r=lf(e)*i,n=uf(e)*i,a=uf(t),o=a*u-n*c;return[sf(n*u+a*c,r*s+o*l),hf(o*s-r*l)]},i}function If(e,t){(t=Cf(t))[0]-=e,wf(t);var i=df(-t[1]);return((-t[2]<0?-i:i)+tf-Zp)%tf}function Of(){var i,t=[];return{point:function(e,t){i.push([e,t])},lineStart:function(){t.push(i=[])},lineEnd:pf,rejoin:function(){1<t.length&&t.push(t.pop().concat(t.shift()))},result:function(){var e=t;return t=[],i=null,e}}}function Rf(e,t){return af(e[0]-t[0])<Zp&&af(e[1]-t[1])<Zp}function Lf(e,t,i,r){this.x=e,this.z=t,this.o=i,this.e=r,this.v=!1,this.n=this.p=null}function Nf(e,t,i,r,a){var o,n,s=[],l=[];if(e.forEach(function(e){if(!((t=e.length-1)<=0)){var t,i,r=e[0],n=e[t];if(Rf(r,n)){for(a.lineStart(),o=0;o<t;++o)a.point((r=e[o])[0],r[1]);a.lineEnd()}else s.push(i=new Lf(r,e,null,!0)),l.push(i.o=new Lf(r,null,i,!1)),s.push(i=new Lf(n,e,null,!1)),l.push(i.o=new Lf(n,null,i,!0))}}),s.length){for(l.sort(t),kf(s),kf(l),o=0,n=l.length;o<n;++o)l[o].e=i=!i;for(var u,c,d=s[0];;){for(var h=d,p=!0;h.v;)if((h=h.n)===d)return;u=h.z,a.lineStart();do{if(h.v=h.o.v=!0,h.e){if(p)for(o=0,n=u.length;o<n;++o)a.point((c=u[o])[0],c[1]);else r(h.x,h.n.x,1,a);h=h.n}else{if(p)for(u=h.p.z,o=u.length-1;0<=o;--o)a.point((c=u[o])[0],c[1]);else r(h.x,h.p.x,-1,a);h=h.p}u=(h=h.o).z,p=!p}while(!h.v);a.lineEnd()}}}function kf(e){if(t=e.length){for(var t,i,r=0,n=e[0];++r<t;)n.n=i=e[r],i.p=n,n=i;n.n=i=e[0],i.p=n}}function Bf(e){for(var t,i,r,n=e.length,a=-1,o=0;++a<n;)o+=e[a].length;for(i=new Array(o);0<=--n;)for(t=(r=e[n]).length;0<=--t;)i[--o]=r[t];return i}qp(),qp(),qp(),Tf.invert=Tf;var Ff=1e9,Vf=-Ff;var zf=qp();function Uf(e){return e}qp(),qp(),qp();var Gf=1/0,$f=Gf,Hf=-Gf,Wf=Hf,jf={point:function(e,t){e<Gf&&(Gf=e),Hf<e&&(Hf=e),t<$f&&($f=t),Wf<t&&(Wf=t)},lineStart:pf,lineEnd:pf,polygonStart:pf,polygonEnd:pf,result:function(){var e=[[Gf,$f],[Hf,Wf]];return Hf=Wf=-($f=Gf=1/0),e}};function qf(v,_,C,x){return function(r,s){var l,u,c,n=_(s),t=r.invert(x[0],x[1]),d=Of(),h=_(d),p=!1,i={point:a,lineStart:o,lineEnd:f,polygonStart:function(){i.point=m,i.lineStart=g,i.lineEnd=y,u=[],l=[]},polygonEnd:function(){i.point=a,i.lineStart=o,i.lineEnd=f,u=Bf(u);var e=function(e,t){var i=t[0],r=t[1],n=[uf(i),-lf(i),0],a=0,o=0;zf.reset();for(var s=0,l=e.length;s<l;++s)if(c=(u=e[s]).length)for(var u,c,d=u[c-1],h=d[0],p=d[1]/2+ef,f=uf(p),m=lf(p),g=0;g<c;++g,h=v,f=C,m=x,d=y){var y=u[g],v=y[0],_=y[1]/2+ef,C=uf(_),x=lf(_),b=v-h,A=0<=b?1:-1,S=A*b,w=Jp<S,E=f*C;if(zf.add(sf(E*A*uf(S),m*x+E*lf(S))),a+=w?b+A*tf:b,w^i<=h^i<=v){var T=bf(Cf(d),Cf(y));wf(T);var P=bf(n,T);wf(P);var M=(w^0<=b?-1:1)*hf(P[2]);(M<r||r===M&&(T[0]||T[1]))&&(o+=w^0<=b?1:-1)}}return(a<-1e-6||a<Zp&&zf<-1e-6)^1&o}(l,t);u.length?(p||(s.polygonStart(),p=!0),Nf(u,Yf,e,C,s)):e&&(p||(s.polygonStart(),p=!0),s.lineStart(),C(null,null,1,s),s.lineEnd()),p&&(s.polygonEnd(),p=!1),u=l=null},sphere:function(){s.polygonStart(),s.lineStart(),C(null,null,1,s),s.lineEnd(),s.polygonEnd()}};function a(e,t){var i=r(e,t);v(e=i[0],t=i[1])&&s.point(e,t)}function e(e,t){var i=r(e,t);n.point(i[0],i[1])}function o(){i.point=e,n.lineStart()}function f(){i.point=a,n.lineEnd()}function m(e,t){c.push([e,t]);var i=r(e,t);h.point(i[0],i[1])}function g(){h.lineStart(),c=[]}function y(){m(c[0][0],c[0][1]),h.lineEnd();var e,t,i,r,n=h.clean(),a=d.result(),o=a.length;if(c.pop(),l.push(c),c=null,o)if(1&n){if(0<(t=(i=a[0]).length-1)){for(p||(s.polygonStart(),p=!0),s.lineStart(),e=0;e<t;++e)s.point((r=i[e])[0],r[1]);s.lineEnd()}}else 1<o&&2&n&&a.push(a.pop().concat(a.shift())),u.push(a.filter(Qf))}return i}}function Qf(e){return 1<e.length}function Yf(e,t){return((e=e.x)[0]<0?e[1]-Kp-Zp:Kp-e[1])-((t=t.x)[0]<0?t[1]-Kp-Zp:Kp-t[1])}qp();var Xf=qf(function(){return!0},function(n){var a,o=NaN,s=NaN,l=NaN;return{lineStart:function(){n.lineStart(),a=1},point:function(e,t){var i=0<e?Jp:-Jp,r=af(e-o);af(r-Jp)<Zp?(n.point(o,s=0<(s+t)/2?Kp:-Kp),n.point(l,s),n.lineEnd(),n.lineStart(),n.point(i,s),n.point(e,s),a=0):l!==i&&Jp<=r&&(af(o-l)<Zp&&(o-=l*Zp),af(e-i)<Zp&&(e-=i*Zp),s=function(e,t,i,r){var n,a,o=uf(e-i);return af(o)>Zp?of((uf(t)*(a=lf(r))*uf(i)-uf(r)*(n=lf(t))*uf(e))/(n*a*o)):(t+r)/2}(o,s,e,t),n.point(l,s),n.lineEnd(),n.lineStart(),n.point(i,s),a=0),n.point(o=e,s=t),l=i},lineEnd:function(){n.lineEnd(),o=s=NaN},clean:function(){return 2-a}}},function(e,t,i,r){var n;if(null==e)n=i*Kp,r.point(-Jp,n),r.point(0,n),r.point(Jp,n),r.point(Jp,0),r.point(Jp,-n),r.point(0,-n),r.point(-Jp,-n),r.point(-Jp,0),r.point(-Jp,n);else if(af(e[0]-t[0])>Zp){var a=e[0]<t[0]?Jp:-Jp;n=i*a/2,r.point(-a,n),r.point(0,n),r.point(a,n)}else r.point(t[0],t[1])},[-Jp,-Kp]);function Zf(r){return function(e){var t=new Jf;for(var i in r)t[i]=r[i];return t.stream=e,t}}function Jf(){}function Kf(e,t,i){var r=t[1][0]-t[0][0],n=t[1][1]-t[0][1],a=e.clipExtent&&e.clipExtent();e.scale(150).translate([0,0]),null!=a&&e.clipExtent(null),function(e,t){e&&mf.hasOwnProperty(e.type)?mf[e.type](e,t):ff(e,t)}(i,e.stream(jf));var o=jf.result(),s=Math.min(r/(o[1][0]-o[0][0]),n/(o[1][1]-o[0][1])),l=+t[0][0]+(r-s*(o[1][0]+o[0][0]))/2,u=+t[0][1]+(n-s*(o[1][1]+o[0][1]))/2;return null!=a&&e.clipExtent(a),e.scale(150*s).translate([l,u])}Jf.prototype={constructor:Jf,point:function(e,t){this.stream.point(e,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var em=lf(30*nf);function tm(e,t){return+t?function(M,D){function I(e,t,i,r,n,a,o,s,l,u,c,d,h,p){var f=o-e,m=s-t,g=f*f+m*m;if(4*D<g&&h--){var y=r+u,v=n+c,_=a+d,C=cf(y*y+v*v+_*_),x=hf(_/=C),b=af(af(_)-1)<Zp||af(i-l)<Zp?(i+l)/2:sf(v,y),A=M(b,x),S=A[0],w=A[1],E=S-e,T=w-t,P=m*E-f*T;(D<P*P/g||.3<af((f*E+m*T)/g-.5)||r*u+n*c+a*d<em)&&(I(e,t,i,r,n,a,S,w,b,y/=C,v/=C,_,h,p),p.point(S,w),I(S,w,b,y,v,_,o,s,l,u,c,d,h,p))}}return function(n){var i,r,a,o,s,l,u,c,d,h,p,f,m={point:e,lineStart:t,lineEnd:y,polygonStart:function(){n.polygonStart(),m.lineStart=v},polygonEnd:function(){n.polygonEnd(),m.lineStart=t}};function e(e,t){e=M(e,t),n.point(e[0],e[1])}function t(){c=NaN,m.point=g,n.lineStart()}function g(e,t){var i=Cf([e,t]),r=M(e,t);I(c,d,u,h,p,f,c=r[0],d=r[1],u=e,h=i[0],p=i[1],f=i[2],16,n),n.point(c,d)}function y(){m.point=e,n.lineEnd()}function v(){t(),m.point=_,m.lineEnd=C}function _(e,t){g(i=e,t),r=c,a=d,o=h,s=p,l=f,m.point=g}function C(){I(c,d,u,h,p,f,r,a,i,o,s,l,16,n),(m.lineEnd=y)()}return m}}(e,t):function(i){return Zf({point:function(e,t){e=i(e,t),this.stream.point(e[0],e[1])}})}(e)}var im=Zf({point:function(e,t){this.stream.point(e*nf,t*nf)}});function rm(M){return function(){var i,r,n,t,a,o,s,l,u,c,d=150,h=480,p=250,f=0,m=0,g=0,y=0,v=0,_=null,C=Xf,x=null,b=Uf,A=.5,S=tm(E,A);function w(e){return[(e=a(e[0]*nf,e[1]*nf))[0]*d+r,n-e[1]*d]}function e(e){return(e=a.invert((e[0]-r)/d,(n-e[1])/d))&&[e[0]*rf,e[1]*rf]}function E(e,t){return[(e=i(e,t))[0]*d+r,n-e[1]*d]}function T(){a=Ef(t=function(e,t,i){return(e%=tf)?t||i?Ef(Mf(e),Df(t,i)):Mf(e):t||i?Df(t,i):Tf}(g,y,v),i);var e=i(f,m);return r=h-e[0]*d,n=p+e[1]*d,P()}function P(){return u=c=null,w}return w.stream=function(e){return u&&c===e?u:u=im(C(t,S(b(c=e))))},w.clipAngle=function(e){return arguments.length?(C=+e?function(n,a){var E=lf(n),p=0<E,f=af(E)>Zp;function m(e,t){return lf(e)*lf(t)>E}function g(e,t,i){var r=[1,0,0],n=bf(Cf(e),Cf(t)),a=xf(n,n),o=n[0],s=a-o*o;if(!s)return!i&&e;var l=E*a/s,u=-E*o/s,c=bf(r,n),d=Sf(r,l);Af(d,Sf(n,u));var h=c,p=xf(d,h),f=xf(h,h),m=p*p-f*(xf(d,d)-1);if(!(m<0)){var g=cf(m),y=Sf(h,(-p-g)/f);if(Af(y,d),y=_f(y),!i)return y;var v,_=e[0],C=t[0],x=e[1],b=t[1];C<_&&(v=_,_=C,C=v);var A=C-_,S=af(A-Jp)<Zp;if(!S&&b<x&&(v=x,x=b,b=v),S||A<Zp?S?0<x+b^y[1]<(af(y[0]-_)<Zp?x:b):x<=y[1]&&y[1]<=b:Jp<A^(_<=y[0]&&y[0]<=C)){var w=Sf(h,(-p+g)/f);return Af(w,d),[y,_f(w)]}}}function y(e,t){var i=p?n:Jp-n,r=0;return e<-i?r|=1:i<e&&(r|=2),t<-i?r|=4:i<t&&(r|=8),r}return qf(m,function(s){var l,u,c,d,h;return{lineStart:function(){d=c=!1,h=1},point:function(e,t){var i,r=[e,t],n=m(e,t),a=p?n?0:y(e,t):n?y(e+(e<0?Jp:-Jp),t):0;if(!l&&(d=c=n)&&s.lineStart(),n===c||(i=g(l,r))&&!Rf(l,i)&&!Rf(r,i)||(r[0]+=Zp,r[1]+=Zp,n=m(r[0],r[1])),n!==c)h=0,n?(s.lineStart(),i=g(r,l),s.point(i[0],i[1])):(i=g(l,r),s.point(i[0],i[1]),s.lineEnd()),l=i;else if(f&&l&&p^n){var o;a&u||!(o=g(r,l,!0))||(h=0,p?(s.lineStart(),s.point(o[0][0],o[0][1]),s.point(o[1][0],o[1][1]),s.lineEnd()):(s.point(o[1][0],o[1][1]),s.lineEnd(),s.lineStart(),s.point(o[0][0],o[0][1])))}!n||l&&Rf(l,r)||s.point(r[0],r[1]),l=r,c=n,u=a},lineEnd:function(){c&&s.lineEnd(),l=null},clean:function(){return h|(d&&c)<<1}}},function(e,t,i,r){!function(e,t,i,r,n,a){if(i){var o=lf(t),s=uf(t),l=r*i;null==n?(n=t+r*tf,a=t-l/2):(n=If(o,n),a=If(o,a),(0<r?n<a:a<n)&&(n+=r*tf));for(var u,c=n;0<r?a<c:c<a;c-=l)u=_f([o,-s*lf(c),-s*uf(c)]),e.point(u[0],u[1])}}(r,n,a,i,e,t)},p?[0,-n]:[-Jp,n-Jp])}(_=e*nf,6*nf):(_=null,Xf),P()):_*rf},w.clipExtent=function(e){return arguments.length?(b=null==e?(x=o=s=l=null,Uf):function(y,v,_,C){function x(e,t){return y<=e&&e<=_&&v<=t&&t<=C}function b(e,t,i,r){var n=0,a=0;if(null==e||(n=o(e,i))!==(a=o(t,i))||s(e,t)<0^0<i)for(;r.point(0===n||3===n?y:_,1<n?C:v),(n=(n+i+4)%4)!==a;);else r.point(t[0],t[1])}function o(e,t){return af(e[0]-y)<Zp?0<t?0:3:af(e[0]-_)<Zp?0<t?2:1:af(e[1]-v)<Zp?0<t?1:0:0<t?3:2}function A(e,t){return s(e.x,t.x)}function s(e,t){var i=o(e,1),r=o(t,1);return i!==r?i-r:0===i?t[1]-e[1]:1===i?e[0]-t[0]:2===i?e[1]-t[1]:t[0]-e[0]}return function(r){var n,d,a,o,s,l,u,c,h,p,f,m=r,e=Of(),t={point:i,lineStart:function(){t.point=g,d&&d.push(a=[]),h=!(p=!0),u=c=NaN},lineEnd:function(){n&&(g(o,s),l&&h&&e.rejoin(),n.push(e.result())),t.point=i,h&&m.lineEnd()},polygonStart:function(){m=e,n=[],d=[],f=!0},polygonEnd:function(){var e=function(){for(var e=0,t=0,i=d.length;t<i;++t)for(var r,n,a=d[t],o=1,s=a.length,l=a[0],u=l[0],c=l[1];o<s;++o)r=u,n=c,u=(l=a[o])[0],c=l[1],n<=C?C<c&&(c-n)*(y-r)<(u-r)*(C-n)&&++e:c<=C&&(u-r)*(C-n)<(c-n)*(y-r)&&--e;return e}(),t=f&&e,i=(n=Bf(n)).length;(t||i)&&(r.polygonStart(),t&&(r.lineStart(),b(null,null,1,r),r.lineEnd()),i&&Nf(n,A,e,b,r),r.polygonEnd()),m=r,n=d=a=null}};function i(e,t){x(e,t)&&m.point(e,t)}function g(e,t){var i=x(e,t);if(d&&a.push([e,t]),p)o=e,s=t,p=!1,(l=i)&&(m.lineStart(),m.point(e,t));else if(i&&h)m.point(e,t);else{var r=[u=Math.max(Vf,Math.min(Ff,u)),c=Math.max(Vf,Math.min(Ff,c))],n=[e=Math.max(Vf,Math.min(Ff,e)),t=Math.max(Vf,Math.min(Ff,t))];!function(e,t,i,r,n,a){var o,s=e[0],l=e[1],u=0,c=1,d=t[0]-s,h=t[1]-l;if(o=i-s,d||!(0<o)){if(o/=d,d<0){if(o<u)return;o<c&&(c=o)}else if(0<d){if(c<o)return;u<o&&(u=o)}if(o=n-s,d||!(o<0)){if(o/=d,d<0){if(c<o)return;u<o&&(u=o)}else if(0<d){if(o<u)return;o<c&&(c=o)}if(o=r-l,h||!(0<o)){if(o/=h,h<0){if(o<u)return;o<c&&(c=o)}else if(0<h){if(c<o)return;u<o&&(u=o)}if(o=a-l,h||!(o<0)){if(o/=h,h<0){if(c<o)return;u<o&&(u=o)}else if(0<h){if(o<u)return;o<c&&(c=o)}return 0<u&&(e[0]=s+u*d,e[1]=l+u*h),c<1&&(t[0]=s+c*d,t[1]=l+c*h),!0}}}}}(r,n,y,v,_,C)?i&&(m.lineStart(),m.point(e,t),f=!1):(h||(m.lineStart(),m.point(r[0],r[1])),m.point(n[0],n[1]),i||m.lineEnd(),f=!1)}u=e,c=t,h=i}return t}}(x=+e[0][0],o=+e[0][1],s=+e[1][0],l=+e[1][1]),P()):null==x?null:[[x,o],[s,l]]},w.scale=function(e){return arguments.length?(d=+e,T()):d},w.translate=function(e){return arguments.length?(h=+e[0],p=+e[1],T()):[h,p]},w.center=function(e){return arguments.length?(f=e[0]%360*nf,m=e[1]%360*nf,T()):[f*rf,m*rf]},w.rotate=function(e){return arguments.length?(g=e[0]%360*nf,y=e[1]%360*nf,v=2<e.length?e[2]%360*nf:0,T()):[g*rf,y*rf,v*rf]},w.precision=function(e){return arguments.length?(S=tm(E,A=e*e),P()):cf(A)},w.fitExtent=function(e,t){return Kf(w,e,t)},w.fitSize=function(e,t){return function(e,t,i){return Kf(e,[[0,0],t],i)}(w,e,t)},function(){return i=function(){return M}.apply(this,arguments),w.invert=i.invert&&e,T()}}()()}var nm=function(e,t){var i=lf(e),r=lf(t),n=function(e){return(e=df(e))&&e/uf(e)}(i*r);return[n*r*uf(e),n*uf(t)]};function am(e,i,r,n){var t=e.properties||{},a="Feature"===e.type?e.geometry:e;if("GeometryCollection"===a.type){var o=[];return F(e,function(e){var t=am(e,i,r,n);t&&o.push(t)}),W(o)}var s=function(e){var t=ai(e).geometry.coordinates,i=[-t[0],-t[1]];return rm(nm).scale(79.4188).clipAngle(179.999).rotate(i).scale(p)}(a),l={type:a.type,coordinates:function t(e,i){return"object"!=typeof e[0]?i(e):e.map(function(e){return t(e,i)})}(a.coordinates,s)},u=(new Rc).read(l),c=f(m(i,r),"meters"),d=Eh.bufferOp(u,c,n);if(!function e(t){return Array.isArray(t[0])?e(t[0]):isNaN(t[0])}((d=(new Lc).write(d)).coordinates))return G({type:d.type,coordinates:function t(e,i){return"object"!=typeof e[0]?i.invert(e):e.map(function(e){return t(e,i)})}(d.coordinates,s)},t)}function om(e,t,i){void 0===i&&(i={});var r=Y(e),n=Y(t),a=sl(r.coordinates,n.coordinates);return 0===a.length?null:1===a.length?V(a[0],i.properties):d(a,i.properties)}function sm(e,t,i){void 0===i&&(i={});var r=Y(e),n=Y(t),a=ll(r.coordinates,n.coordinates);return 0===a.length?null:1===a.length?V(a[0],i.properties):d(a,i.properties)}function lm(e,t,i){void 0===i&&(i={});var r=JSON.stringify(i.properties||{}),n=e[0],a=e[1],o=e[2],s=e[3],l=(a+s)/2,u=(n+o)/2,c=2*t/mt([n,l],[o,l],i)*(o-n),d=2*t/mt([u,a],[u,s],i)*(s-a),h=c/2,p=2*h,f=Math.sqrt(3)/2*d,m=o-n,g=s-a,y=.75*p,v=f,_=(m-p)/(p-h/2),C=Math.floor(_),x=(C*y-h/2-m)/2-h/2+y/2,b=Math.floor((g-f)/f),A=(g-b*f)/2,S=f/2<b*f-g;S&&(A-=f/4);for(var w=[],E=[],T=0;T<6;T++){var P=2*Math.PI/6*T;w.push(Math.cos(P)),E.push(Math.sin(P))}for(var M=[],D=0;D<=C;D++)for(var I=0;I<=b;I++){var O=D%2==1;if(!(0===I&&O||0===I&&S)){var R=D*y+n-x,L=I*v+a+A;if(O&&(L-=f/2),!0===i.triangles)cm([R,L],c/2,d/2,JSON.parse(r),w,E).forEach(function(e){i.mask?sm(i.mask,e)&&M.push(e):M.push(e)});else{var N=um([R,L],c/2,d/2,JSON.parse(r),w,E);i.mask?sm(i.mask,N)&&M.push(N):M.push(N)}}}return W(M)}function um(e,t,i,r,n,a){for(var o=[],s=0;s<6;s++){var l=e[0]+t*n[s],u=e[1]+i*a[s];o.push([l,u])}return o.push(o[0].slice()),V([o],r)}function cm(e,t,i,r,n,a){for(var o=[],s=0;s<6;s++){var l=[];l.push(e),l.push([e[0]+t*n[s],e[1]+i*a[s]]),l.push([e[0]+t*n[(s+1)%6],e[1]+i*a[(s+1)%6]]),l.push(e),o.push(V([l],r))}return o}function dm(e){if(e.features.length<=1)return e;var s=function(e){var t=be(),r=[];return U(e,function(e,t){var i=ae(e);r.push({minX:i[0],minY:i[1],maxX:i[2],maxY:i[3],geojson:e,index:t})}),t.load(r),t}(e),l=[],u={};return U(e,function(e,t){if(u[t])return!0;for(s.remove({index:t},hm),u[t]=!0;;){var i=ae(e),r=s.search({minX:i[0],minY:i[1],maxX:i[2],maxY:i[3]});if(0<r.length)for(var n=r.map(function(e){return u[e.index]=!0,s.remove({index:e.index},hm),e.geojson}),a=0,o=n.length;a<o;a++)e=om(e,n[a]);if(0===r.length)break}l.push(e)}),W(l)}function hm(e,t){return e.index===t.index}function pm(e,t,i){return void 0===i&&(i={}),function(e,t,i,r){void 0===r&&(r={});for(var n=[],a=e[0],o=e[1],s=e[2],l=e[3],u=t/mt([a,o],[s,o],r)*(s-a),c=i/mt([a,o],[a,l],r)*(l-o),d=s-a,h=l-o,p=Math.floor(d/u),f=Math.floor(h/c),m=(h-f*c)/2,g=a+(d-p*u)/2,y=0;y<p;y++){for(var v=o+m,_=0;_<f;_++){var C=V([[[g,v],[g,v+c],[g+u,v+c],[g+u,v],[g,v]]],r.properties);r.mask?qa(r.mask,C)&&n.push(C):n.push(C),v+=c}g+=u}return W(n)}(e,t,t,i)}function fm(e,t,i){void 0===i&&(i={});for(var r=[],n=t/mt([e[0],e[1]],[e[2],e[1]],i)*(e[2]-e[0]),a=t/mt([e[0],e[1]],[e[0],e[3]],i)*(e[3]-e[1]),o=0,s=e[0];s<=e[2];){for(var l=0,u=e[1];u<=e[3];){var c=null,d=null;o%2==0&&l%2==0?(c=V([[[s,u],[s,u+a],[s+n,u],[s,u]]],i.properties),d=V([[[s,u+a],[s+n,u+a],[s+n,u],[s,u+a]]],i.properties)):o%2==0&&l%2==1?(c=V([[[s,u],[s+n,u+a],[s+n,u],[s,u]]],i.properties),d=V([[[s,u],[s,u+a],[s+n,u+a],[s,u]]],i.properties)):l%2==0&&o%2==1?(c=V([[[s,u],[s,u+a],[s+n,u+a],[s,u]]],i.properties),d=V([[[s,u],[s+n,u+a],[s+n,u],[s,u]]],i.properties)):l%2==1&&o%2==1&&(c=V([[[s,u],[s,u+a],[s+n,u],[s,u]]],i.properties),d=V([[[s,u+a],[s+n,u+a],[s+n,u],[s,u+a]]],i.properties)),i.mask?(sm(i.mask,c)&&r.push(c),sm(i.mask,d)&&r.push(d)):(r.push(c),r.push(d)),u+=a,l++}o++,s+=n}return W(r)}nm.invert=function(e,t){var i=cf(e*e+t*t),r=function(e){return e}(i),n=uf(r),a=lf(r);return[sf(e*n,i*a),hf(i&&t*n/i)]},e.along=function(e,t,i){void 0===i&&(i={});for(var r=Y(e).coordinates,n=0,a=0;a<r.length&&!(n<=t&&a===r.length-1);a++){if(t<=n){var o=t-n;if(o){var s=ni(r[a],r[a-1])-180;return ii(r[a],o,s,i)}return $(r[a])}n+=mt(r[a],r[a+1],i)}return $(r[r.length-1])},e.angle=function(e,t,i,r){if(void 0===r&&(r={}),!q(r))throw new Error("options is invalid");if(!e)throw new Error("startPoint is required");if(!t)throw new Error("midPoint is required");if(!i)throw new Error("endPoint is required");var n=e,a=t,o=i,s=g(!0!==r.mercator?ni(n,a):cn(n,a)),l=g(!0!==r.mercator?ni(o,a):cn(o,a)),u=Math.abs(s-l);return!0===r.explementary?360-u:u},e.applyFilter=xs,e.area=mr,e.areaFactors=a,e.bbox=ae,e.bboxClip=function(e,t){var i=Y(e),r=i.type,n="Feature"===e.type?e.properties:{},a=i.coordinates;switch(r){case"LineString":case"MultiLineString":var o=[];return"LineString"===r&&(a=[a]),a.forEach(function(e){!function(e,t,i){var r,n,a,o,s,l=e.length,u=tn(e[0],t),c=[];for(i=i||[],r=1;r<l;r++){for(o=e[r-1],n=a=tn(s=e[r],t);;){if(!(u|n)){c.push(o),n!==a?(c.push(s),r<l-1&&(i.push(c),c=[])):r===l-1&&c.push(s);break}if(u&n)break;u?u=tn(o=en(o,s,u,t),t):n=tn(s=en(o,s,n,t),t)}u=a}c.length&&i.push(c)}(e,t,o)}),1===o.length?H(o[0],n):c(o,n);case"Polygon":return V(rn(a,t),n);case"MultiPolygon":return d(a.map(function(e){return rn(e,t)}),n);default:throw new Error("geometry "+r+" not supported")}},e.bboxPolygon=Kt,e.bearing=ni,e.bearingToAngle=g,e.bearingToAzimuth=g,e.bezier=Jt,e.bezierSpline=Jt,e.booleanClockwise=mn,e.booleanContains=function(e,t){var i=Y(e),r=Y(t),n=i.type,a=r.type,o=i.coordinates,s=r.coordinates;switch(n){case"Point":switch(a){case"Point":return ka(o,s);default:throw new Error("feature2 "+a+" geometry not supported")}case"MultiPoint":switch(a){case"Point":return function(e,t){var i,r=!1;for(i=0;i<e.coordinates.length;i++)if(ka(e.coordinates[i],t.coordinates)){r=!0;break}return r}(i,r);case"MultiPoint":return function(e,t){for(var i=0,r=t.coordinates;i<r.length;i++){for(var n=r[i],a=!1,o=0,s=e.coordinates;o<s.length;o++)if(ka(n,s[o])){a=!0;break}if(!a)return!1}return!0}(i,r);default:throw new Error("feature2 "+a+" geometry not supported")}case"LineString":switch(a){case"Point":return xr(r,i,{ignoreEndVertices:!0});case"LineString":return function(e,t){for(var i=!1,r=0,n=t.coordinates;r<n.length;r++){var a=n[r];if(xr({type:"Point",coordinates:a},e,{ignoreEndVertices:!0})&&(i=!0),!xr({type:"Point",coordinates:a},e,{ignoreEndVertices:!1}))return!1}return i}(i,r);case"MultiPoint":return function(e,t){for(var i=!1,r=0,n=t.coordinates;r<n.length;r++){var a=n[r];if(xr(a,e,{ignoreEndVertices:!0})&&(i=!0),!xr(a,e))return!1}return!!i}(i,r);default:throw new Error("feature2 "+a+" geometry not supported")}case"Polygon":switch(a){case"Point":return ht(r,i,{ignoreBoundary:!0});case"LineString":return function(e,t){var i,r,n=!1,a=0,o=ae(e),s=ae(t);if(!Na(o,s))return!1;for(;a<t.coordinates.length-1;a++)if(ht({type:"Point",coordinates:(i=t.coordinates[a],r=t.coordinates[a+1],[(i[0]+r[0])/2,(i[1]+r[1])/2])},e,{ignoreBoundary:!0})){n=!0;break}return n}(i,r);case"Polygon":return function(e,t){if("Feature"===e.type&&null===e.geometry)return!1;if("Feature"===t.type&&null===t.geometry)return!1;var i=ae(e),r=ae(t);if(!Na(i,r))return!1;for(var n=Y(t).coordinates,a=0,o=n;a<o.length;a++)for(var s=0,l=o[a];s<l.length;s++)if(!ht(l[s],e))return!1;return!0}(i,r);case"MultiPoint":return function(e,t){for(var i=0,r=t.coordinates;i<r.length;i++)if(!ht(r[i],e,{ignoreBoundary:!0}))return!1;return!0}(i,r);default:throw new Error("feature2 "+a+" geometry not supported")}default:throw new Error("feature1 "+n+" geometry not supported")}},e.booleanCrosses=function(e,t){var i=Y(e),r=Y(t),n=i.type,a=r.type;switch(n){case"MultiPoint":switch(a){case"LineString":return Ba(i,r);case"Polygon":return Va(i,r);default:throw new Error("feature2 "+a+" geometry not supported")}case"LineString":switch(a){case"MultiPoint":return Ba(r,i);case"LineString":return function(e,t){if(0<ar(e,t).features.length)for(var i=0;i<e.coordinates.length-1;i++)for(var r=0;r<t.coordinates.length-1;r++){var n=!0;if(0!==r&&r!==t.coordinates.length-2||(n=!1),za(e.coordinates[i],e.coordinates[i+1],t.coordinates[r],n))return!0}return!1}(i,r);case"Polygon":return Fa(i,r);default:throw new Error("feature2 "+a+" geometry not supported")}case"Polygon":switch(a){case"MultiPoint":return Va(r,i);case"LineString":return Fa(r,i);default:throw new Error("feature2 "+a+" geometry not supported")}default:throw new Error("feature1 "+n+" geometry not supported")}},e.booleanDisjoint=Oa,e.booleanEqual=function(e,t){return Y(e).type===Y(t).type&&new Wa({precision:6}).compare(Gt(e),Gt(t))},e.booleanIntersects=qa,e.booleanOverlap=ja,e.booleanParallel=function(e,t){if(!e)throw new Error("line1 is required");if(!t)throw new Error("line2 is required");if("LineString"!==ao(e,"line1"))throw new Error("line1 must be a LineString");if("LineString"!==ao(t,"line2"))throw new Error("line2 must be a LineString");for(var i=Li(Gt(e)).features,r=Li(Gt(t)).features,n=0;n<i.length;n++){var a=i[n].geometry.coordinates;if(!r[n])break;if(o=a,s=r[n].geometry.coordinates,g(cn(o[0],o[1]))!==g(cn(s[0],s[1])))return!1}var o,s;return!0},e.booleanPointInPolygon=ht,e.booleanPointOnLine=xr,e.booleanWithin=Ar,e.buffer=function(e,i,t){var r=(t=t||{}).units||"kilometers",n=t.steps||8;if(!e)throw new Error("geojson is required");if("object"!=typeof t)throw new Error("options must be an object");if("number"!=typeof n)throw new Error("steps must be an number");if(void 0===i)throw new Error("radius is required");if(n<=0)throw new Error("steps must be greater than 0");var a=[];switch(e.type){case"GeometryCollection":return F(e,function(e){var t=am(e,i,r,n);t&&a.push(t)}),W(a);case"FeatureCollection":return N(e,function(e){var t=am(e,i,r,n);t&&N(t,function(e){e&&a.push(e)})}),W(a)}return am(e,i,r,n)},e.center=ai,e.centerMean=Zo,e.centerMedian=function(e,t){if(void 0===t&&(t={}),!q(t=t||{}))throw new Error("options is invalid");var i=t.counter||10;if(!j(i))throw new Error("counter must be a number");var r=t.weight,n=Zo(e,{weight:t.weight}),a=W([]);N(e,function(e){var t;a.features.push(oi(e,{properties:{weight:null===(t=e.properties)||void 0===t?void 0:t[r]}}))});var o={tolerance:t.tolerance,medianCandidates:[]};return function e(o,t,i,r,n){var a=r.tolerance||.001,s=0,l=0,u=0,c=0;if(N(i,function(e){var t,i=null===(t=e.properties)||void 0===t?void 0:t.weight,r=null==i?1:i;if(!j(r=Number(r)))throw new Error("weight value must be a number");if(0<r){c+=1;var n=r*mt(e,o);0===n&&(n=1);var a=r/n;s+=e.geometry.coordinates[0]*a,l+=e.geometry.coordinates[1]*a,u+=a}}),c<1)throw new Error("no features to measure");var d=s/u,h=l/u;return 1===c||0===n||Math.abs(d-t[0])<a&&Math.abs(h-t[1])<a?$([d,h],{medianCandidates:r.medianCandidates}):(r.medianCandidates.push([d,h]),e([d,h],o,i,r,n-1))}(n.geometry.coordinates,[0,0],a,o,i)},e.centerOfMass=function e(t,i){switch(void 0===i&&(i={}),X(t)){case"Point":return $(Q(t),i.properties);case"Polygon":var r=[];I(t,function(e){r.push(e)});var n,a,o,s,l,u,c,d,h=oi(t,{properties:i.properties}),p=h.geometry.coordinates,f=0,m=0,g=0,y=r.map(function(e){return[e[0]-p[0],e[1]-p[1]]});for(n=0;n<r.length-1;n++)s=(a=y[n])[0],u=a[1],l=(o=y[n+1])[0],g+=d=s*(c=o[1])-l*u,f+=(s+l)*d,m+=(u+c)*d;if(0===g)return h;var v=1/(.5*g*6);return $([p[0]+v*f,p[1]+v*m],i.properties);default:var _=dt(t);return _?e(_,{properties:i.properties}):oi(t,{properties:i.properties})}},e.centroid=oi,e.circle=ri,e.cleanCoords=Gt,e.clone=Ct,e.clusterEach=vs,e.clusterReduce=_s,e.clusters=Ss,e.clustersDbscan=function(i,e,t){void 0===t&&(t={}),!0!==t.mutate&&(i=Ct(i)),t.minPoints=t.minPoints||3;var r=new Ja.DBSCAN,n=r.run(B(i),C(e,t.units),t.minPoints,mt),a=-1;return n.forEach(function(e){a++,e.forEach(function(e){var t=i.features[e];t.properties||(t.properties={}),t.properties.cluster=a,t.properties.dbscan="core"})}),r.noise.forEach(function(e){var t=i.features[e];t.properties||(t.properties={}),t.properties.cluster?t.properties.dbscan="edge":t.properties.dbscan="noise"}),i},e.clustersKmeans=function(e,t){void 0===t&&(t={});var i=e.features.length;t.numberOfClusters=t.numberOfClusters||Math.round(Math.sqrt(i/2)),t.numberOfClusters>i&&(t.numberOfClusters=i),!0!==t.mutate&&(e=Ct(e));var r=B(e),n=r.slice(0,t.numberOfClusters),a=no(r,t.numberOfClusters,n),o={};return a.centroids.forEach(function(e,t){o[t]=e}),N(e,function(e,t){var i=a.idxs[t];e.properties.cluster=i,e.properties.centroid=o[i]}),e},e.collect=function(e,t,i,n){var a=be(6),r=t.features.map(function(e){var t;return{minX:e.geometry.coordinates[0],minY:e.geometry.coordinates[1],maxX:e.geometry.coordinates[0],maxY:e.geometry.coordinates[1],property:null===(t=e.properties)||void 0===t?void 0:t[i]}});return a.load(r),e.features.forEach(function(t){t.properties||(t.properties={});var e=ae(t),i=a.search({minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}),r=[];i.forEach(function(e){ht([e.minX,e.minY],t)&&r.push(e.property)}),t.properties[n]=r}),e},e.collectionOf=M,e.combine=function(e){var a={MultiPoint:{coordinates:[],properties:[]},MultiLineString:{coordinates:[],properties:[]},MultiPolygon:{coordinates:[],properties:[]}};return N(e,function(e){var t,i,r,n;switch(null===(n=e.geometry)||void 0===n?void 0:n.type){case"Point":a.MultiPoint.coordinates.push(e.geometry.coordinates),a.MultiPoint.properties.push(e.properties);break;case"MultiPoint":(t=a.MultiPoint.coordinates).push.apply(t,e.geometry.coordinates),a.MultiPoint.properties.push(e.properties);break;case"LineString":a.MultiLineString.coordinates.push(e.geometry.coordinates),a.MultiLineString.properties.push(e.properties);break;case"MultiLineString":(i=a.MultiLineString.coordinates).push.apply(i,e.geometry.coordinates),a.MultiLineString.properties.push(e.properties);break;case"Polygon":a.MultiPolygon.coordinates.push(e.geometry.coordinates),a.MultiPolygon.properties.push(e.properties);break;case"MultiPolygon":(r=a.MultiPolygon.coordinates).push.apply(r,e.geometry.coordinates),a.MultiPolygon.properties.push(e.properties)}}),W(Object.keys(a).filter(function(e){return a[e].coordinates.length}).sort().map(function(e){return G({type:e,coordinates:a[e].coordinates},{collectedProperties:a[e].properties})}))},e.concave=function(e,s){void 0===s&&(s={});var l=s.maxEdge||1/0,t=gt(function(e){var i=[],r={};return N(e,function(e){if(e.geometry){var t=e.geometry.coordinates.join("-");r.hasOwnProperty(t)||(i.push(e),r[t]=!0)}}),W(i)}(e));if(t.features=t.features.filter(function(e){var t=e.geometry.coordinates[0][0],i=e.geometry.coordinates[0][1],r=e.geometry.coordinates[0][2],n=mt(t,i,s),a=mt(i,r,s),o=mt(t,r,s);return n<=l&&a<=l&&o<=l}),t.features.length<1)return null;var i=Ut(t);return 1===i.coordinates.length&&(i.coordinates=i.coordinates[0],i.type="Polygon"),G(i)},e.containsNumber=E,e.convertArea=x,e.convertDistance=C,e.convertLength=C,e.convex=dt,e.coordAll=B,e.coordEach=I,e.coordReduce=O,e.createBins=Cs,e.degrees2radians=_,e.degreesToRadians=_,e.destination=ii,e.difference=function(e,t){var i=Y(e),r=Y(t),n=e.properties||{},a=function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];return ol.run("difference",e,i)}(i.coordinates,r.coordinates);return 0===a.length?null:1===a.length?V(a[0],n):d(a,n)},e.dissolve=function(e,t){if(!q(t=t||{}))throw new Error("options is invalid");var a=t.propertyName;M(e,"Polygon","dissolve");var i=Ct(e),o=i.features,s=[];o.forEach(function(e,t){e.properties.origIndexPosition=t});var l=rr();for(var u in l.load(i),o){var c=o[u],d=!1;if(l.search(c).features.forEach(function(e){c=o[u];var t,i=e.properties.origIndexPosition;if(0<s.length&&0!==i)if(i>s[s.length-1])i-=s.length;else{var r=function(r,e){var n,a;if(!Array.isArray(e))throw new Error("Get closest expects an array as second argument");return e.forEach(function(e,t){var i=e-r;0<=i&&(void 0===a||i<a)&&(a=i,n=t)}),n}(i,s);0!==r&&(i-=r)}if(i!==+u){var n=o[i];n&&c&&(void 0!==a&&n.properties[a]!==c.properties[a]||ja(c,n)&&(t=n,0<ar(H(B(c)),H(B(t))).features.length)&&(o[u]=om(c,n),s.push(e.properties.origIndexPosition),s.sort(function(e,t){return e-t}),l.remove(e),o.splice(i,1),c.properties.origIndexPosition=u,l.remove(c,function(e,t){return e.properties.origIndexPosition===t.properties.origIndexPosition}),d=!0))}}),d){if(!c)continue;c.properties.origIndexPosition=u,l.insert(c),u--}}return o.forEach(function(e){delete e.properties.origIndexPosition,delete e.bbox}),i},e.distance=mt,e.distanceToDegrees=y,e.distanceToRadians=m,e.distanceWeight=is,e.earthRadius=p,e.ellipse=Yo,e.envelope=ei,e.explode=si,e.factors=r,e.feature=G,e.featureCollection=W,e.featureEach=N,e.featureOf=P,e.featureReduce=k,e.filterProperties=As,e.findPoint=re,e.findSegment=ie,e.flatten=function(e){if(!e)throw new Error("geojson is required");var t=[];return U(e,function(e){t.push(e)}),W(t)},e.flattenEach=U,e.flattenReduce=Z,e.flip=function(e,t){if(!q(t=t||{}))throw new Error("options is invalid");var i=t.mutate;if(!e)throw new Error("geojson is required");return!1!==i&&void 0!==i||(e=Ct(e)),I(e,function(e){var t=e[0],i=e[1];e[0]=i,e[1]=t}),e},e.geojsonType=T,e.geomEach=F,e.geomReduce=z,e.geometry=i,e.geometryCollection=u,e.getCluster=ys,e.getCoord=Q,e.getCoords=w,e.getGeom=Y,e.getType=X,e.greatCircle=function(e,t,i){if("object"!=typeof(i=i||{}))throw new Error("options is invalid");var r=i.properties,n=i.npoints,a=i.offset;return e=Q(e),t=Q(t),r=r||{},n=n||100,a=a||10,new zr({x:e[0],y:e[1]},{x:t[0],y:t[1]},r).Arc(n,{offset:a}).json()},e.helpers=S,e.hexGrid=lm,e.inside=ht,e.interpolate=function(t,e,s){if("object"!=typeof(s=s||{}))throw new Error("options is invalid");var l=s.gridType,u=s.property,c=s.weight;if(!t)throw new Error("points is required");if(M(t,"Point","input must contain Points"),!e)throw new Error("cellSize is required");if(void 0!==c&&"number"!=typeof c)throw new Error("weight must be a number");u=u||"elevation",l=l||"square",c=c||1;var i,r=ae(t);switch(l){case"point":case"points":i=Er(r,e,s);break;case"square":case"squares":i=pm(r,e,s);break;case"hex":case"hexes":i=lm(r,e,s);break;case"triangle":case"triangles":i=fm(r,e,s);break;default:throw new Error("invalid gridType")}var d=[];return N(i,function(n){var a=0,o=0;N(t,function(e){var t,i=mt("point"===l?n:oi(n),e,s);if(void 0!==u&&(t=e.properties[u]),void 0===t&&(t=e.geometry.coordinates[2]),void 0===t)throw new Error("zValue is missing");0===i&&(a=t);var r=1/Math.pow(i,c);o+=r,a+=r*t});var e=Ct(n);e.properties[u]=a/o,d.push(e)}),W(d)},e.intersect=sm,e.invariant=D,e.isNumber=j,e.isObject=q,e.isobands=function(e,t,i){if(!q(i=i||{}))throw new Error("options is invalid");var r=i.zProperty||"elevation",n=i.commonProperties||{},a=i.breaksProperties||[];if(M(e,"Point","Input must contain Points"),!t)throw new Error("breaks is required");if(!Array.isArray(t))throw new Error("breaks is not an Array");if(!q(n))throw new Error("commonProperties is not an Object");if(!Array.isArray(a))throw new Error("breaksProperties is not an Array");var o=function(t,e){if(!q(e=e||{}))throw new Error("options is invalid");var i=e.zProperty||"elevation",r=e.flip,n=e.flags;M(t,"Point","input must contain Points");for(var a=function(e,i){var r={};return N(t,function(e){var t=w(e)[1];r[t]||(r[t]=[]),r[t].push(e)}),Object.keys(r).map(function(e){return r[e].sort(function(e,t){return w(e)[0]-w(t)[0]})}).sort(function(e,t){return i?w(e[0])[1]-w(t[0])[1]:w(t[0])[1]-w(e[0])[1]})}(0,r),o=[],s=0;s<a.length;s++){for(var l=a[s],u=[],c=0;c<l.length;c++){var d=l[c];d.properties[i]?u.push(d.properties[i]):u.push(0),!0===n&&(d.properties.matrixPosition=[s,c])}o.push(u)}return o}(e,{zProperty:r,flip:!0}),s=function(e,t,i){for(var r=[],n=1;n<t.length;n++){var a=+t[n-1],o=+t[n],s=ya(ga(xn(e,a,o-a))),l={};l.groupedRings=s,l[i]=a+"-"+o,r.push(l)}return r}(o,t,r);return W((s=function(e,t,i){var r=ae(i),n=r[2]-r[0],a=r[3]-r[1],o=r[0],s=r[1],l=t[0].length-1,u=t.length-1,c=n/l,d=a/u,h=function(e){e[0]=e[0]*c+o,e[1]=e[1]*d+s};return e.forEach(function(e){e.groupedRings.forEach(function(e){e.forEach(function(e){e.forEach(h)})})}),e}(s,o,e)).map(function(e,t){if(a[t]&&!q(a[t]))throw new Error("Each mappedProperty is required to be an Object");var i=ue({},n,a[t]);return i[r]=e[r],d(e.groupedRings,i)}))},e.isolines=function(e,t,i){if(!q(i=i||{}))throw new Error("options is invalid");var r=i.zProperty||"elevation",n=i.commonProperties||{},a=i.breaksProperties||[];if(M(e,"Point","Input must contain Points"),!t)throw new Error("breaks is required");if(!Array.isArray(t))throw new Error("breaks must be an Array");if(!q(n))throw new Error("commonProperties must be an Object");if(!Array.isArray(a))throw new Error("breaksProperties must be an Array");var o=function(t,e){if(!q(e=e||{}))throw new Error("options is invalid");var i=e.zProperty||"elevation",r=e.flip,n=e.flags;M(t,"Point","input must contain Points");for(var a=function(e,i){var r={};return N(t,function(e){var t=w(e)[1];r[t]||(r[t]=[]),r[t].push(e)}),Object.keys(r).map(function(e){return r[e].sort(function(e,t){return w(e)[0]-w(t)[0]})}).sort(function(e,t){return i?w(e[0])[1]-w(t[0])[1]:w(t[0])[1]-w(e[0])[1]})}(0,r),o=[],s=0;s<a.length;s++){for(var l=a[s],u=[],c=0;c<l.length;c++){var d=l[c];d.properties[i]?u.push(d.properties[i]):u.push(0),!0===n&&(d.properties.matrixPosition=[s,c])}o.push(u)}return o}(e,{zProperty:r,flip:!0});return W(function(e,t,i){var r=ae(i),n=r[2]-r[0],a=r[3]-r[1],o=r[0],s=r[1],l=t[0].length-1,u=t.length-1,c=n/l,d=a/u,h=function(e){e[0]=e[0]*c+o,e[1]=e[1]*d+s};return e.forEach(function(e){I(e,h)}),e}(function(e,t,i,r,n){for(var a=[],o=1;o<t.length;o++){var s=+t[o],l=ue({},r,n[o]);l[i]=s;var u=c(he(e,s),l);a.push(u)}return a}(o,t,r,n,a),o,e))},e.kinks=function(e){var t,i,v={type:"FeatureCollection",features:[]};if("LineString"===(i="Feature"===e.type?e.geometry:e).type)t=[i.coordinates];else if("MultiLineString"===i.type)t=i.coordinates;else if("MultiPolygon"===i.type)t=[].concat.apply([],i.coordinates);else{if("Polygon"!==i.type)throw new Error("Input must be a LineString, MultiLineString, Polygon, or MultiPolygon Feature or Geometry");t=i.coordinates}return t.forEach(function(y){t.forEach(function(e){for(var t=0;t<y.length-1;t++)for(var i=t;i<e.length-1;i++){if(y===e){if(1===Math.abs(t-i))continue;if(0===t&&i===y.length-2&&y[t][0]===y[y.length-1][0]&&y[t][1]===y[y.length-1][1])continue}var r=(n=y[t][0],a=y[t][1],o=y[t+1][0],s=y[t+1][1],l=e[i][0],u=e[i][1],c=e[i+1][0],d=e[i+1][1],g=m=f=p=h=void 0,g={x:null,y:null,onLine1:!1,onLine2:!1},0==(h=(d-u)*(o-n)-(c-l)*(s-a))?null!==g.x&&null!==g.y&&g:(m=(o-n)*(p=a-u)-(s-a)*(f=n-l),p=((c-l)*p-(d-u)*f)/h,f=m/h,g.x=n+p*(o-n),g.y=a+p*(s-a),0<=p&&p<=1&&(g.onLine1=!0),0<=f&&f<=1&&(g.onLine2=!0),!(!g.onLine1||!g.onLine2)&&[g.x,g.y]));r&&v.features.push($([r[0],r[1]]))}var n,a,o,s,l,u,c,d,h,p,f,m,g})}),v},e.length=_r,e.lengthToDegrees=y,e.lengthToRadians=m,e.lineArc=Wr,e.lineChunk=function(e,t,i){if(!q(i=i||{}))throw new Error("options is invalid");var r=i.units,n=i.reverse;if(!e)throw new Error("geojson is required");if(t<=0)throw new Error("segmentLength must be greater than 0");var a=[];return U(e,function(e){n&&(e.geometry.coordinates=e.geometry.coordinates.reverse()),function(e,t,i,r){var n=_r(e,{units:i});if(n<=t)return r(e);var a=n/t;Number.isInteger(a)||(a=Math.floor(a)+1);for(var o=0;o<a;o++)r(Cr(e,t*o,t*(o+1),{units:i}))}(e,t,r,function(e){a.push(e)})}),W(a)},e.lineDistance=_r,e.lineEach=ee,e.lineIntersect=ar,e.lineOffset=function(e,t,i){if(!q(i=i||{}))throw new Error("options is invalid");var r=i.units;if(!e)throw new Error("geojson is required");if(null==t||isNaN(t))throw new Error("distance is required");var n=X(e),a=e.properties;switch(n){case"LineString":return wa(e,t,r);case"MultiLineString":var o=[];return U(e,function(e){o.push(wa(e,t,r).geometry.coordinates)}),c(o,a);default:throw new Error("geometry "+n+" is not supported")}},e.lineOverlap=sn,e.lineReduce=te,e.lineSegment=Li,e.lineSlice=function(e,t,i){var r=w(i);if("LineString"!==X(i))throw new Error("line must be a LineString");for(var n,a=sr(i,e),o=sr(i,t),s=[(n=a.properties.index<=o.properties.index?[a,o]:[o,a])[0].geometry.coordinates],l=n[0].properties.index+1;l<n[1].properties.index+1;l++)s.push(r[l]);return s.push(n[1].geometry.coordinates),H(s,i.properties)},e.lineSliceAlong=Cr,e.lineSplit=function(e,t){if(!e)throw new Error("line is required");if(!t)throw new Error("splitter is required");var i=X(e),r=X(t);if("LineString"!==i)throw new Error("line must be LineString");if("FeatureCollection"===r)throw new Error("splitter cannot be a FeatureCollection");if("GeometryCollection"===r)throw new Error("splitter cannot be a GeometryCollection");var n=Tr(t,{precision:7});switch(r){case"Point":return Gr(e,n);case"MultiPoint":return Ur(e,n);case"LineString":case"MultiLineString":case"Polygon":case"MultiPolygon":return Ur(e,ar(e,n))}},e.lineString=H,e.lineStringToPolygon=Xr,e.lineStrings=s,e.lineToPolygon=Xr,e.mask=function(e,t){var n,a,i=function(e){return V(e&&e.geometry.coordinates||[[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]])}(t),r=(n=[],a=[],U(e,function(e){var t=e.geometry.coordinates,i=t[0],r=t.slice(1);n.push(V([i])),r.forEach(function(e){a.push(V([e]))})}),[W(n),W(a)]),o=r[0],s=r[1];return function(e,t,i){var r=[];return r.push(e.geometry.coordinates[0]),U(t,function(e){r.push(e.geometry.coordinates[0])}),U(i,function(e){r.push(e.geometry.coordinates[0])}),V(r)}(i,o=dm(o),s=dm(s))},e.meta=ne,e.midpoint=function(e,t){return ii(e,mt(e,t)/2,ni(e,t))},e.moranIndex=function(e,t){var i=t.inputField,r=t.threshold||1e5,n=t.p||2,a=t.binary||!1,o=is(e,{alpha:t.alpha||-1,binary:a,p:n,standardization:t.standardization||!0,threshold:r}),s=[];N(e,function(e){var t=e.properties||{};s.push(t[i])});for(var l=rs(s),u=function(e){for(var t=rs(e),i=0,r=0,n=e;r<n.length;r++){var a=n[r];i+=Math.pow(a-t,2)}return i/e.length}(s),c=0,d=0,h=0,p=0,f=o.length,m=0;m<f;m++){for(var g=0,y=0;y<f;y++)c+=o[m][y]*(s[m]-l)*(s[y]-l),d+=o[m][y],h+=Math.pow(o[m][y]+o[y][m],2),g+=o[m][y]+o[y][m];p+=Math.pow(g,2)}var v=c/d/u,_=-1/(f-1),C=(f*f*(h*=.5)-f*p+d*d*3)/((f-1)*(f+1)*(d*d))-_*_,x=Math.sqrt(C);return{expectedMoranIndex:_,moranIndex:v,stdNorm:x,zNorm:(v-_)/x}},e.multiLineString=c,e.multiPoint=l,e.multiPolygon=d,e.nearest=Ri,e.nearestPoint=Ri,e.nearestPointOnLine=sr,e.nearestPointToLine=function(e,i,t){void 0===t&&(t={});var r=t.units,n=t.properties||{},a=function(e){var t=[];switch(e.geometry?e.geometry.type:e.type){case"GeometryCollection":return F(e,function(e){"Point"===e.type&&t.push({type:"Feature",properties:{},geometry:e})}),{type:"FeatureCollection",features:t};case"FeatureCollection":return e.features=e.features.filter(function(e){return"Point"===e.geometry.type}),e;default:throw new Error("points must be a Point Collection")}}(e);if(!a.features.length)throw new Error("points must contain features");if(!i)throw new Error("line is required");if("LineString"!==X(i))throw new Error("line must be a LineString");var o=1/0,s=null;return N(a,function(e){var t=ur(e,i,{units:r});t<o&&(o=t,s=e)}),s&&(s.properties=ue({dist:o},s.properties,n)),s},e.planepoint=function(e,t){var i=Q(e),r=Y(t).coordinates[0];if(r.length<4)throw new Error("OuterRing of a Polygon must have 4 or more Positions.");var n=t.properties||{},a=n.a,o=n.b,s=n.c,l=i[0],u=i[1],c=r[0][0],d=r[0][1],h=void 0!==a?a:r[0][2],p=r[1][0],f=r[1][1],m=void 0!==o?o:r[1][2],g=r[2][0],y=r[2][1],v=void 0!==s?s:r[2][2];return(v*(l-c)*(u-f)+h*(l-p)*(u-y)+m*(l-g)*(u-d)-m*(l-c)*(u-y)-v*(l-p)*(u-d)-h*(l-g)*(u-f))/((l-c)*(u-f)+(l-p)*(u-y)+(l-g)*(u-d)-(l-c)*(u-y)-(l-p)*(u-d)-(l-g)*(u-f))},e.point=$,e.pointGrid=Er,e.pointOnFeature=hr,e.pointOnLine=sr,e.pointOnSurface=hr,e.pointToLineDistance=ur,e.points=n,e.pointsWithinPolygon=ft,e.polygon=V,e.polygonSmooth=function(e,t){var l=[],u=t.iterations||1;if(!e)throw new Error("inputPolys is required");return F(e,function(e,t,i){var r,n,a;switch(e.type){case"Polygon":r=[[]];for(var o=0;o<u;o++)a=[[]],n=e,0<o&&(n=V(r).geometry),Ko(n,a),r=a.slice(0);l.push(V(r,i));break;case"MultiPolygon":r=[[[]]];for(var s=0;s<u;s++)a=[[[]]],n=e,0<s&&(n=d(r).geometry),es(n,a),r=a.slice(0);l.push(d(r,i));break;default:throw new Error("geometry is invalid, must be Polygon or MultiPolygon")}}),W(l)},e.polygonTangents=function(e,t){var i,r,n,a=w(e),o=w(t),s=ae(t),l=0,u=null;switch(a[0]>s[0]&&a[0]<s[2]&&a[1]>s[1]&&a[1]<s[3]&&(l=(u=Ri(e,si(t))).properties.featureIndex),X(t)){case"Polygon":i=o[0][l],r=o[0][0],null!==u&&u.geometry.coordinates[1]<a[1]&&(r=o[0][l]),n=fn(o[0][0],o[0][o[0].length-1],a);var c=pn(o[0],a,n,void 0,i,r);i=c[0],r=c[1];break;case"MultiPolygon":for(var d=0,h=0,p=0,f=0;f<o[0].length;f++){d=f;for(var m=!1,g=0;g<o[0][f].length;g++){if(h=g,p===l){m=!0;break}p++}if(m)break}i=o[0][d][h],r=o[0][d][h],n=fn(o[0][0][0],o[0][0][o[0][0].length-1],a),o.forEach(function(e){var t=pn(e[0],a,n,void 0,i,r);i=t[0],r=t[1]})}return W([$(i),$(r)])},e.polygonToLine=qr,e.polygonToLineString=qr,e.polygonize=function(e){var t=Ia.fromGeoJson(e);t.deleteDangles(),t.deleteCutEdges();var i=[],r=[];return t.getEdgeRings().filter(function(e){return e.isValid()}).forEach(function(e){e.isHole()?i.push(e):r.push(e)}),i.forEach(function(e){Da.findEdgeRingContaining(e,r)&&r.push(e)}),W(r.map(function(e){return e.toPolygon()}))},e.polygons=o,e.projection=us,e.propEach=R,e.propReduce=L,e.propertiesContainsFilter=bs,e.radians2degrees=v,e.radiansToDegrees=v,e.radiansToDistance=f,e.radiansToLength=f,e.random=gs,e.randomLineString=ps,e.randomPoint=ds,e.randomPolygon=hs,e.randomPosition=cs,e.rewind=function(e,t){if(!q(t=t||{}))throw new Error("options is invalid");var i=t.reverse||!1,r=t.mutate||!1;if(!e)throw new Error("<geojson> is required");if("boolean"!=typeof i)throw new Error("<reverse> must be a boolean");if("boolean"!=typeof r)throw new Error("<mutate> must be a boolean");!1===r&&(e=Ct(e));var n=[];switch(e.type){case"GeometryCollection":return F(e,function(e){gn(e,i)}),e;case"FeatureCollection":return N(e,function(e){N(gn(e,i),function(e){n.push(e)})}),W(n)}return gn(e,i)},e.rhumbBearing=cn,e.rhumbDestination=hn,e.rhumbDistance=lr,e.round=h,e.sample=function(e,t){if(!e)throw new Error("featurecollection is required");if(null==t)throw new Error("num is required");if("number"!=typeof t)throw new Error("num must be a number");return W(function(e,t){for(var i,r,n=e.slice(0),a=e.length,o=a-t;a-- >o;)i=n[r=Math.floor((a+1)*Math.random())],n[r]=n[a],n[a]=i;return n.slice(o)}(e.features,t))},e.sector=function(e,t,i,r,n){if(!q(n=n||{}))throw new Error("options is invalid");var a=n.properties;if(!e)throw new Error("center is required");if(null==i)throw new Error("bearing1 is required");if(null==r)throw new Error("bearing2 is required");if(!t)throw new Error("radius is required");if("object"!=typeof n)throw new Error("options must be an object");if(un(i)===un(r))return ri(e,t,n);var o=w(e),s=Wr(e,t,i,r,n),l=[[o]];return I(s,function(e){l[0].push(e)}),l[0].push(o),V(l,a)},e.segmentEach=J,e.segmentReduce=K,e.shortestPath=function(e,t,i){if(!q(i=i||{}))throw new Error("options is invalid");var r=i.resolution,n=i.minDistance,a=i.obstacles||W([]);if(!e)throw new Error("start is required");if(!t)throw new Error("end is required");if(r&&!j(r)||r<=0)throw new Error("options.resolution must be a number, greater than 0");if(n)throw new Error("options.minDistance is not yet implemented");var o=Q(e),s=Q(t);switch(e=$(o),t=$(s),X(a)){case"FeatureCollection":if(0===a.features.length)return H([o,s]);break;case"Polygon":a=W([G(Y(a))]);break;default:throw new Error("invalid obstacles")}var l=a;l.features.push(e),l.features.push(t);var u=ae(xa(Kt(ae(l)),1.15));r=r||mt([u[0],u[1]],[u[2],u[1]],i)/100,l.features.pop(),l.features.pop();for(var c=u[0],d=u[1],h=u[2],p=u[3],f=r/mt([c,d],[h,d],i)*(h-c),m=r/mt([c,d],[c,p],i)*(p-d),g=h-c,y=p-d,v=Math.floor(g/f),_=Math.floor(y/m),C=(g-v*f)/2,x=[],b=[],A=[],S=[],w=1/0,E=1/0,T=p-(y-_*m)/2,P=0;d<=T;){for(var M=[],D=[],I=c+C,O=0;I<=h;){var R=$([I,T]),L=ho(R,a);M.push(L?0:1),D.push(I+"|"+T);var N=mt(R,e);!L&&N<w&&(w=N,A={x:O,y:P});var k=mt(R,t);!L&&k<E&&(E=k,S={x:O,y:P}),I+=f,O++}b.push(M),x.push(D),T-=m,P++}var B=new lo(b,{diagonal:!0}),F=B.grid[A.y][A.x],V=B.grid[S.y][S.x],z=so.search(B,F,V),U=[o];return z.forEach(function(e){var t=x[e.x][e.y].split("|");U.push([+t[0],+t[1]])}),U.push(s),Gt(H(U))},e.simplify=function(e,t){if(!q(t=t||{}))throw new Error("options is invalid");var i=void 0!==t.tolerance?t.tolerance:1,r=t.highQuality||!1,n=t.mutate||!1;if(!e)throw new Error("geojson is required");if(i&&i<0)throw new Error("invalid tolerance");return!0!==n&&(e=Ct(e)),F(e,function(e){!function(e,t,i){var r=e.type;if("Point"===r||"MultiPoint"===r)return;Gt(e,!0);var n=e.coordinates;switch(r){case"LineString":e.coordinates=Yt(n,t,i);break;case"MultiLineString":e.coordinates=n.map(function(e){return Yt(e,t,i)});break;case"Polygon":e.coordinates=Xt(n,t,i);break;case"MultiPolygon":e.coordinates=n.map(function(e){return Xt(e,t,i)})}}(e,i,r)}),e},e.square=ti,e.squareGrid=pm,e.standardDeviationalEllipse=function(e,t){if(!q(t=t||{}))throw new Error("options is invalid");var i=t.steps||64,r=t.weight,n=t.properties||{};if(!j(i))throw new Error("steps must be a number");if(!q(n))throw new Error("properties must be a number");var a=B(e).length,o=Zo(e,{weight:r}),s=0,l=0,u=0;N(e,function(e){var t=e.properties[r]||1,i=Jo(w(e),w(o));s+=Math.pow(i.x,2)*t,l+=Math.pow(i.y,2)*t,u+=i.x*i.y*t});var c=s-l,d=Math.sqrt(Math.pow(c,2)+4*Math.pow(u,2)),h=2*u,p=Math.atan((c+d)/h),f=180*p/Math.PI,m=0,g=0,y=0;N(e,function(e){var t=e.properties[r]||1,i=Jo(w(e),w(o));m+=Math.pow(i.x*Math.cos(p)-i.y*Math.sin(p),2)*t,g+=Math.pow(i.x*Math.sin(p)+i.y*Math.cos(p),2)*t,y+=t});var v=Math.sqrt(2*m/y),_=Math.sqrt(2*g/y),C=Yo(o,v,_,{units:"degrees",angle:f,steps:i,properties:n}),x=ft(e,W([C])),b={meanCenterCoordinates:w(o),semiMajorAxis:v,semiMinorAxis:_,numberOfFeatures:a,angle:f,percentageWithinEllipse:100*B(x).length/a};return C.properties.standardDeviationalEllipse=b,C},e.tag=function(e,i,r,n){return e=Ct(e),i=Ct(i),N(e,function(t){t.properties||(t.properties={}),N(i,function(e){void 0===t.properties[n]&&ht(t,e)&&(t.properties[n]=e.properties[r])})}),e},e.tesselate=function(e){if(!e.geometry||"Polygon"!==e.geometry.type&&"MultiPolygon"!==e.geometry.type)throw new Error("input must be a Polygon or MultiPolygon");var t={type:"FeatureCollection",features:[]};return"Polygon"===e.geometry.type?t.features=Oi(e.geometry.coordinates):e.geometry.coordinates.forEach(function(e){t.features=t.features.concat(Oi(e))}),t},e.tin=gt,e.toMercator=ns,e.toWgs84=as,e.transformRotate=Ca,e.transformScale=xa,e.transformTranslate=function(e,i,r,t){if(!q(t=t||{}))throw new Error("options is invalid");var n=t.units,a=t.zTranslation,o=t.mutate;if(!e)throw new Error("geojson is required");if(null==i||isNaN(i))throw new Error("distance is required");if(a&&"number"!=typeof a&&isNaN(a))throw new Error("zTranslation is not a number");if(a=void 0!==a?a:0,0===i&&0===a)return e;if(null==r||isNaN(r))throw new Error("direction is required");return i<0&&(i=-i,r+=180),!1!==o&&void 0!==o||(e=Ct(e)),I(e,function(e){var t=w(hn(e,i,r,{units:n}));e[0]=t[0],e[1]=t[1],a&&3===e.length&&(e[2]+=a)}),e},e.triangleGrid=fm,e.truncate=Tr,e.union=om,e.unitsFactors=t,e.unkinkPolygon=function(e){var i=[];return U(e,function(t){"Polygon"===t.geometry.type&&N(function(e){if("Feature"!=e.type)throw new Error("The input must a geojson object of type Feature");if(void 0===e.geometry||null==e.geometry)throw new Error("The input must a geojson object with a non-empty geometry");if("Polygon"!=e.geometry.type)throw new Error("The input must be a geojson Polygon");for(var t=e.geometry.coordinates.length,i=[],r=0;r<t;r++){var n=e.geometry.coordinates[r];Rr(n[0],n[n.length-1])||n.push(n[0]),i.push.apply(i,n.slice(0,n.length-1))}if(!function(e){for(var t={},i=1,r=0,n=e.length;r<n;++r){if(t.hasOwnProperty(e[r])){i=0;break}t[e[r]]=1}return i}(i))throw new Error("The input polygon may not have duplicate vertices (except for the first and last vertex of each ring)");var a=i.length,o=function(e,p,t){if("Polygon"!==e.geometry.type)throw new Error("The input feature must be a Polygon");void 0===t&&(t=1);var f=e.geometry.coordinates,m=[],g={};if(t){for(var i=[],r=0;r<f.length;r++)for(var n=0;n<f[r].length-1;n++)i.push(d(r,n));var a=be();a.load(i)}for(var o=0;o<f.length;o++)for(var s=0;s<f[o].length-1;s++)if(t)a.search(d(o,s)).forEach(function(e){var t=e.ring,i=e.edge;c(o,s,t,i)});else for(var l=0;l<f.length;l++)for(var u=0;u<f[l].length-1;u++)c(o,s,l,u);return p||(m={type:"Feature",geometry:{type:"MultiPoint",coordinates:m}}),m;function c(e,t,i,r){var n,a,o=f[e][t],s=f[e][t+1],l=f[i][r],u=f[i][r+1],c=function(e,t,i,r){if(Pr(e,i)||Pr(e,r)||Pr(t,i)||Pr(r,i))return null;var n=e[0],a=e[1],o=t[0],s=t[1],l=i[0],u=i[1],c=r[0],d=r[1],h=(n-o)*(u-d)-(a-s)*(l-c);return 0==h?null:[((n*s-a*o)*(l-c)-(n-o)*(l*d-u*c))/h,((n*s-a*o)*(u-d)-(a-s)*(l*d-u*c))/h]}(o,s,l,u);if(null!==c&&(n=s[0]!==o[0]?(c[0]-o[0])/(s[0]-o[0]):(c[1]-o[1])/(s[1]-o[1]),a=u[0]!==l[0]?(c[0]-l[0])/(u[0]-l[0]):(c[1]-l[1])/(u[1]-l[1]),!(1<=n||n<=0||1<=a||a<=0))){var d=c,h=!g[d];h&&(g[d]=!0),p?m.push(p(c,e,t,o,s,n,i,r,l,u,a,h)):m.push(c)}}function d(e,t){var i,r,n,a,o=f[e][t],s=f[e][t+1];return r=o[0]<s[0]?(i=o[0],s[0]):(i=s[0],o[0]),a=o[1]<s[1]?(n=o[1],s[1]):(n=s[1],o[1]),{minX:i,minY:n,maxX:r,maxY:a,ring:e,edge:t}}}(e,function(e,t,i,r,n,a,o,s,l,u,c,d){return[e,t,i,r,n,a,o,s,l,u,c,d]}),s=o.length;if(0==s){var l=[];for(r=0;r<t;r++)l.push(V([e.geometry.coordinates[r]],{parent:-1,winding:Or(e.geometry.coordinates[r])}));var u=W(l);return k(),B(),u}var c=[],d=[];for(r=0;r<t;r++){c.push([]);for(var h=0;h<e.geometry.coordinates[r].length-1;h++)c[r].push([new Mr(e.geometry.coordinates[r][Lr(h+1,e.geometry.coordinates[r].length-1)],1,[r,h],[r,Lr(h+1,e.geometry.coordinates[r].length-1)],void 0)]),d.push(new Dr(e.geometry.coordinates[r][h],[r,Lr(h-1,e.geometry.coordinates[r].length-1)],[r,h],void 0,void 0,!1,!0))}for(r=0;r<s;r++)c[o[r][1]][o[r][2]].push(new Mr(o[r][0],o[r][5],[o[r][1],o[r][2]],[o[r][6],o[r][7]],void 0)),o[r][11]&&d.push(new Dr(o[r][0],[o[r][1],o[r][2]],[o[r][6],o[r][7]],void 0,void 0,!0,!0));var p=d.length;for(r=0;r<c.length;r++)for(h=0;h<c[r].length;h++)c[r][h].sort(function(e,t){return e.param<t.param?-1:1});var f=[];for(r=0;r<p;r++)f.push({minX:d[r].coord[0],minY:d[r].coord[1],maxX:d[r].coord[0],maxY:d[r].coord[1],index:r});var m=be();for(m.load(f),r=0;r<c.length;r++)for(h=0;h<c[r].length;h++)for(var g=0;g<c[r][h].length;g++){v=g==c[r][h].length-1?c[r][Lr(h+1,e.geometry.coordinates[r].length-1)][0].coord:c[r][h][g+1].coord;var y=m.search({minX:v[0],minY:v[1],maxX:v[0],maxY:v[1]})[0];c[r][h][g].nxtIsectAlongEdgeIn=y.index}for(r=0;r<c.length;r++)for(h=0;h<c[r].length;h++)for(g=0;g<c[r][h].length;g++){var v=c[r][h][g].coord,_=(y=m.search({minX:v[0],minY:v[1],maxX:v[0],maxY:v[1]})[0]).index;_<a?d[_].nxtIsectAlongRingAndEdge2=c[r][h][g].nxtIsectAlongEdgeIn:Rr(d[_].ringAndEdge1,c[r][h][g].ringAndEdgeIn)?d[_].nxtIsectAlongRingAndEdge1=c[r][h][g].nxtIsectAlongEdgeIn:d[_].nxtIsectAlongRingAndEdge2=c[r][h][g].nxtIsectAlongEdgeIn}var C=[];for(h=r=0;h<t;h++){var x=r;for(g=0;g<e.geometry.coordinates[h].length-1;g++)d[r].coord[0]<d[x].coord[0]&&(x=r),r++;var b=d[x].nxtIsectAlongRingAndEdge2;for(g=0;g<d.length;g++)if(d[g].nxtIsectAlongRingAndEdge1==x||d[g].nxtIsectAlongRingAndEdge2==x){var A=g;break}var S=Ir([d[A].coord,d[x].coord,d[b].coord],!0)?1:-1;C.push({isect:x,parent:-1,winding:S})}for(C.sort(function(e,t){return d[e.isect].coord>d[t.isect].coord?-1:1}),l=[];0<C.length;){var w=C.pop(),E=w.isect,T=w.parent,P=w.winding,M=l.length,D=[d[E].coord],I=E;if(d[E].ringAndEdge1Walkable)var O=d[E].ringAndEdge1,R=d[E].nxtIsectAlongRingAndEdge1;else O=d[E].ringAndEdge2,R=d[E].nxtIsectAlongRingAndEdge2;for(;!Rr(d[E].coord,d[R].coord);){D.push(d[R].coord);var L=void 0;for(r=0;r<C.length;r++)if(C[r].isect==R){L=r;break}if(null!=L&&C.splice(L,1),Rr(O,d[R].ringAndEdge1)){if(O=d[R].ringAndEdge2,d[R].ringAndEdge2Walkable=!1,d[R].ringAndEdge1Walkable){var N={isect:R};Ir([d[I].coord,d[R].coord,d[d[R].nxtIsectAlongRingAndEdge2].coord],1==P)?(N.parent=T,N.winding=-P):(N.parent=M,N.winding=P),C.push(N)}R=d[I=R].nxtIsectAlongRingAndEdge2}else O=d[R].ringAndEdge1,d[R].ringAndEdge1Walkable=!1,d[R].ringAndEdge2Walkable&&(N={isect:R},Ir([d[I].coord,d[R].coord,d[d[R].nxtIsectAlongRingAndEdge1].coord],1==P)?(N.parent=T,N.winding=-P):(N.parent=M,N.winding=P),C.push(N)),R=d[I=R].nxtIsectAlongRingAndEdge1}D.push(d[R].coord),l.push(V([D],{index:M,parent:T,winding:P,netWinding:void 0}))}function k(){for(var e=[],t=0;t<u.features.length;t++)-1==u.features[t].properties.parent&&e.push(t);if(1<e.length)for(t=0;t<e.length;t++){for(var i=-1,r=0;r<u.features.length;r++)e[t]!=r&&ht(u.features[e[t]].geometry.coordinates[0][0],u.features[r],{ignoreBoundary:!0})&&mr(u.features[r])<1/0&&(i=r);u.features[e[t]].properties.parent=i}}function B(){for(var e=0;e<u.features.length;e++)if(-1==u.features[e].properties.parent){var t=u.features[e].properties.winding;u.features[e].properties.netWinding=t,F(e,t)}}function F(e,t){for(var i=0;i<u.features.length;i++)if(u.features[i].properties.parent==e){var r=t+u.features[i].properties.winding;u.features[i].properties.netWinding=r,F(i,r)}}return u=W(l),k(),B(),u}(t),function(e){i.push(V(e.geometry.coordinates,t.properties))})}),W(i)},e.validateBBox=b,e.validateId=A,e.voronoi=function(e,t){if(!q(t=t||{}))throw new Error("options is invalid");var i=t.bbox||[-180,-85,180,85];if(!e)throw new Error("points is required");if(!Array.isArray(i))throw new Error("bbox is invalid");return M(e,"Point","points"),W(function(){var n=fo,a=mo,t=null;function i(r){return new qo(r.map(function(e,t){var i=[Math.round(n(e,t,r)/Ho)*Ho,Math.round(a(e,t,r)/Ho)*Ho];return i.index=t,i.data=e,i}),t)}return i.polygons=function(e){return i(e).polygons()},i.links=function(e){return i(e).links()},i.triangles=function(e){return i(e).triangles()},i.x=function(e){return arguments.length?(n="function"==typeof e?e:po(+e),i):n},i.y=function(e){return arguments.length?(a="function"==typeof e?e:po(+e),i):a},i.extent=function(e){return arguments.length?(t=null==e?null:[[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]],i):t&&[[t[0][0],t[0][1]],[t[1][0],t[1][1]]]},i.size=function(e){return arguments.length?(t=null==e?null:[[0,0],[+e[0],+e[1]]],i):t&&[t[1][0]-t[0][0],t[1][1]-t[0][1]]},i}().x(function(e){return e.geometry.coordinates[0]}).y(function(e){return e.geometry.coordinates[1]}).extent([[i[0],i[1]],[i[2],i[3]]]).polygons(e.features).map(Qo))},e.within=ft,Object.defineProperty(e,"__esModule",{value:!0})}(tmp$5.turf={});var turf=tmp$5.turf;function GwBufferAnalysis(e,t){this._earthCtrl=e,this._options=t,this.position=t.position,this.radius=t.radius,this.color=t.color,this._bufferEntity=null}function car3ToPoints(e){for(var t=[],i=0;i<e.length;i+=2){var r=[];r.push(e[i],e[i+1]),t.push(r)}return t}GwBufferAnalysis.prototype.ellipsoid=Ellipsoid.WGS84,GwBufferAnalysis.prototype.initBuffer=function(){var e=turf.point(this.position);this.createBuffer(e,this.color,this._earthCtrl,this.radius)},GwBufferAnalysis.prototype.initPolylineBuffer=function(){var e=car3ToPoints(this.position),t=new turf.lineString(e);this.createBuffer(t,this.color,this._earthCtrl,this.radius)},GwBufferAnalysis.prototype.initPolygonBuffer=function(){var e=car3ToPoints(this.position);e.push(e[0]);var t=turf.polygon([e]);this.createBuffer(t,this.color,this._earthCtrl,this.radius)},GwBufferAnalysis.prototype.removeFromMap=function(){null!==this._bufferEntity&&this._earthCtrl.entities.remove(this._bufferEntity)};var parse=function(e){for(var t=[],i=0;i<e.length;i++)t=t.concat(e[i]);return t};GwBufferAnalysis.prototype.createBuffer=function(r,e,t,n){var i=t,a=0,o=new Entity,s=new PolygonHierarchy;return o.animation=!0,o.polygon={material:e,hierarchy:new CallbackProperty(function(e,t){a<=n?a+=.02:a=.02;var i=parse(turf.buffer(r,a,{units:"kilometers"}).geometry.coordinates[0]);return s.positions=Cartesian3.fromDegreesArray(i,this.ellipsoid,t),s},!1)},this._bufferEntity=i.entities.add(o),this._bufferEntity};var LinearSampler={};function MultiResourceImageryProvider(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).style,i=e.tileMatrixSetID;this._layer=e.layer,this._style=t,this._tileMatrixSetID=i,this._format=defaultValue(e.format,"image/jpeg"),this._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=defined(e.tilingScheme)?e.tilingScheme:new WebMercatorTilingScheme({ellipsoid:e.ellipsoid}),this._tileWidth=defaultValue(e.tileWidth,256),this._tileHeight=defaultValue(e.tileHeight,256),this._minimumLevel=defaultValue(e.minimumLevel,0),this._maximumLevel=e.maximumLevel,this._rectangle=defaultValue(e.rectangle,this._tilingScheme.rectangle),this._dimensions=e.dimensions,this._reload=void 0,this._imageryProviders=[],this._readyPromise=when.resolve(!0);var r=this._tilingScheme.positionToTileXY(Rectangle.southwest(this._rectangle),this._minimumLevel),n=this._tilingScheme.positionToTileXY(Rectangle.northeast(this._rectangle),this._minimumLevel);Math.abs(n.x-r.x),Math.abs(n.y-r.y);this._errorEvent=new Event;var a=e.credit;this._credit="string"==typeof a?new Credit(a):a}function MultiResourceTerrainProvider(e,t){this.mEarthCtrl=e,this.mCoreMap=e.coreMap,this.options=t,this.dataSource=null,this.initialize()}function DefaultProxy(e){this.proxy=e}LinearSampler.create=function(){return[0,0,0,1,0]},LinearSampler.make=function(e,t,i,r){return[e,t,i,r,e]},LinearSampler.assign=function(e,t,i,r,n){e[0]=t,e[1]=i,e[2]=r,e[3]=n,e[4]=t},LinearSampler.resetKey=function(e,t,i){e[2]=t,e[3]=i},LinearSampler.resetKeyRange=function(e,t,i){e[2]=t,e[3]=t+i},LinearSampler.getValue=function(e,t){return e[0]===e[1]?e[1]:(t=Math.min(t,e[3]),e[4]=e[0]+(t-e[2])/(e[3]-e[2])*(e[1]-e[0]),e[4])},LinearSampler.getValueExp=function(e,t){if(e[0]===e[1])return e[1];var i=((t=Math.min(t,e[3]))-e[2])/(e[3]-e[2]);return i*=i,i*=e[1]-e[0],i+=e[0],e[4]=i},Object.defineProperties(MultiResourceImageryProvider.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},format:{get:function(){return this._format}},ready:{value:!0},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}},clock:{get:function(){return this._timeDynamicImagery.clock},set:function(e){this._timeDynamicImagery.clock=e}},times:{get:function(){return this._timeDynamicImagery.times},set:function(e){this._timeDynamicImagery.times=e}},dimensions:{get:function(){return this._dimensions},set:function(e){this._dimensions!==e&&(this._dimensions=e,defined(this._reload)&&this._reload())}},imageryProviders:{get:function(){return this._imageryProviders}}}),MultiResourceImageryProvider.prototype.requestImage=function(e,t,i,r){for(var n=0;n<this._imageryProviders.length;n++){return this._imageryProviders[0].requestImage(e,t,i,r)}},MultiResourceTerrainProvider.prototype.initialize=function(){var a=this;$.ajax({url:this.options.url,cache:this.options.cache||!1,async:this.options.async||!0,success:function(e){GeoJsonDataSource.load(e).then(function(e){a.mEarthCtrl.dataSources.add(e);for(var t=(a.dataSource=e).entities.values,i=0;i<t.length;i++){var r=t[i],n={positions:r.polyline._positions,shape:computeCircle(50),material:Color.RED};r.polylineVolume=n}a.options.success&&a.options.success(e)})},error:function(e){console.log("error"),a.options.error&&a.options.error(e)}})},MultiResourceTerrainProvider.prototype.destroy=function(){this.mEarthCtrl.datasource.remove(this.datasource,!0)},DefaultProxy.prototype.getURL=function(e){var t=-1===this.proxy.indexOf("?")?"?":"";return this.proxy+t+encodeURIComponent(e)};var tmp$6=(l5m=[function(e,r,t){function i(e){return(i="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})(e)}var a=t(73),c=t(35);t(3),r.easeCubicInOut=function(e){if(e<=0)return 0;if(1<=e)return 1;var t=e*e,i=t*e;return 4*(e<.5?i:3*(e-t)+i-.75)},r.bezier=function(e,t,i,r){var n=new a(e,t,i,r);return function(e){return n.solve(e)}},r.ease=r.bezier(.25,.1,.25,1),r.clamp=function(e,t,i){return Math.min(i,Math.max(t,e))},r.wrap=function(e,t,i){var r=i-t,n=((e-t)%r+r)%r+t;return n===t?i:n},r.asyncAll=function(e,t,r){if(!e.length)return r(null,[]);var n=e.length,a=new Array(e.length),o=null;e.forEach(function(e,i){t(e,function(e,t){e&&(o=e),a[i]=t,0==--n&&r(o,a)})})},r.values=function(e){var t=[];for(var i in e)t.push(e[i]);return t},r.keysDifference=function(e,t){var i=[];for(var r in e)r in t||i.push(r);return i},r.extend=function(e){for(var t=arguments.length,i=new Array(1<t?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];for(var n=0,a=i;n<a.length;n++){var o=a[n];for(var s in o)e[s]=o[s]}return e},r.pick=function(e,t){for(var i={},r=0;r<t.length;r++){var n=t[r];n in e&&(i[n]=e[n])}return i};var n=1;r.uniqueId=function(){return n++},r.bindAll=function(e,t){e.forEach(function(e){t[e]&&(t[e]=t[e].bind(t))})},r.getCoordinatesCenter=function(e){for(var t=1/0,i=1/0,r=-1/0,n=-1/0,a=0;a<e.length;a++)t=Math.min(t,e[a].column),i=Math.min(i,e[a].row),r=Math.max(r,e[a].column),n=Math.max(n,e[a].row);var o=r-t,s=n-i,l=Math.max(o,s),u=Math.max(0,Math.floor(-Math.log(l)/Math.LN2));return new c((t+r)/2,(i+n)/2,0).zoomTo(u)},r.endsWith=function(e,t){return-1!==e.indexOf(t,e.length-t.length)},r.mapObject=function(e,t,i){var r={};for(var n in e)r[n]=t.call(i||this,e[n],n,e);return r},r.filterObject=function(e,t,i){var r={};for(var n in e)t.call(i||this,e[n],n,e)&&(r[n]=e[n]);return r},r.deepEqual=t(74),r.clone=function(e){return Array.isArray(e)?e.map(r.clone):"object"===i(e)&&e?r.mapObject(e,r.clone):e},r.arraysIntersect=function(e,t){for(var i=0;i<e.length;i++)if(0<=t.indexOf(e[i]))return!0;return!1};var o={};r.warnOnce=function(e){o[e]||("undefined"!=typeof console&&console.warn(e),o[e]=!0)},r.isCounterClockwise=function(e,t,i){return(i.y-e.y)*(t.x-e.x)>(t.y-e.y)*(i.x-e.x)},r.calculateSignedArea=function(e){for(var t,i,r=0,n=0,a=e.length,o=a-1;n<a;o=n++)t=e[n],r+=((i=e[o]).x-t.x)*(t.y+i.y);return r},r.isClosedPolygon=function(e){if(e.length<4)return!1;var t=e[0],i=e[e.length-1];return!(0<Math.abs(t.x-i.x)||0<Math.abs(t.y-i.y))&&.01<Math.abs(r.calculateSignedArea(e))},r.sphericalToCartesian=function(e){var t=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var i=[],r=!0,n=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(r=(o=s.next()).done)&&(i.push(o.value),!t||i.length!==t);r=!0);}catch(e){n=!0,a=e}finally{try{r||null==s.return||s.return()}finally{if(n)throw a}}return i}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}(e,3),i=t[0],r=t[1],n=t[2];return r+=90,r*=Math.PI/180,n*=Math.PI/180,{x:i*Math.cos(r)*Math.sin(n),y:i*Math.sin(r)*Math.sin(n),z:i*Math.cos(n)}},r.parseCacheControl=function(e){var a={};if(e.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,function(e,t,i,r){var n=i||r;return a[t]=!n||n.toLowerCase(),""}),a["max-age"]){var t=parseInt(a["max-age"],10);isNaN(t)?delete a["max-age"]:a["max-age"]=t}return a}},function(b,e,A){(function(t){var e=A(135);function a(e,t){if(e===t)return 0;for(var i=e.length,r=t.length,n=0,a=Math.min(i,r);n<a;++n)if(e[n]!==t[n]){i=e[n],r=t[n];break}return i<r?-1:r<i?1:0}function o(e){return t.Buffer&&"function"==typeof t.Buffer.isBuffer?t.Buffer.isBuffer(e):!(null==e||!e._isBuffer)}var c=A(136),r=Object.prototype.hasOwnProperty,d=Array.prototype.slice,i="foo"===function(){}.name;function s(e){return Object.prototype.toString.call(e)}function l(e){return!o(e)&&"function"==typeof t.ArrayBuffer&&("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):!!e&&(e instanceof DataView||!!(e.buffer&&e.buffer instanceof ArrayBuffer)))}var u=b.exports=g,n=/\s*function\s+([^\(\s]*)\s*/;function h(e){if(c.isFunction(e)){if(i)return e.name;var t=e.toString().match(n);return t&&t[1]}}function p(e,t){return"string"==typeof e?e.length<t?e:e.slice(0,t):e}function f(e){if(i||!c.isFunction(e))return c.inspect(e);var t=h(e);return"[Function"+(t?": "+t:"")+"]"}function m(e,t,i,r,n){throw new u.AssertionError({message:i,actual:e,expected:t,operator:r,stackStartFunction:n})}function g(e,t){e||m(e,!0,t,"==",u.ok)}function y(e,t,i,r){if(e===t)return!0;if(o(e)&&o(t))return 0===a(e,t);if(c.isDate(e)&&c.isDate(t))return e.getTime()===t.getTime();if(c.isRegExp(e)&&c.isRegExp(t))return e.source===t.source&&e.global===t.global&&e.multiline===t.multiline&&e.lastIndex===t.lastIndex&&e.ignoreCase===t.ignoreCase;if(null!==e&&"object"==typeof e||null!==t&&"object"==typeof t){if(l(e)&&l(t)&&s(e)===s(t)&&!(e instanceof Float32Array||e instanceof Float64Array))return 0===a(new Uint8Array(e.buffer),new Uint8Array(t.buffer));if(o(e)!==o(t))return!1;var n=(r=r||{actual:[],expected:[]}).actual.indexOf(e);return-1!==n&&n===r.expected.indexOf(t)||(r.actual.push(e),r.expected.push(t),function(e,t,i,r){if(null==e||null==t)return!1;if(c.isPrimitive(e)||c.isPrimitive(t))return e===t;if(i&&Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1;var n=v(e),a=v(t);if(n&&!a||!n&&a)return!1;if(n)return y(e=d.call(e),t=d.call(t),i);var o,s,l=x(e),u=x(t);if(l.length!==u.length)return!1;for(l.sort(),u.sort(),s=l.length-1;0<=s;s--)if(l[s]!==u[s])return!1;for(s=l.length-1;0<=s;s--)if(!y(e[o=l[s]],t[o],i,r))return!1;return!0}(e,t,i,r))}return i?e===t:e==t}function v(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function _(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(e){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function C(e,t,i,r){var n;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof i&&(r=i,i=null),n=function(e){var t;try{e()}catch(e){t=e}return t}(t),r=(i&&i.name?" ("+i.name+").":".")+(r?" "+r:"."),e&&!n&&m(n,i,"Missing expected exception"+r);var a="string"==typeof r,o=!e&&n&&!i;if((!e&&c.isError(n)&&a&&_(n,i)||o)&&m(n,i,"Got unwanted exception"+r),e&&n&&i&&!_(n,i)||!e&&n)throw n}u.AssertionError=function(e){var t;this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=p(f((t=this).actual),128)+" "+t.operator+" "+p(f(t.expected),128),this.generatedMessage=!0);var i=e.stackStartFunction||m;if(Error.captureStackTrace)Error.captureStackTrace(this,i);else{var r=new Error;if(r.stack){var n=r.stack,a=h(i),o=n.indexOf("\n"+a);if(0<=o){var s=n.indexOf("\n",o+1);n=n.substring(s+1)}this.stack=n}}},c.inherits(u.AssertionError,Error),u.fail=m,u.ok=g,u.equal=function(e,t,i){e!=t&&m(e,t,i,"==",u.equal)},u.notEqual=function(e,t,i){e==t&&m(e,t,i,"!=",u.notEqual)},u.deepEqual=function(e,t,i){y(e,t,!1)||m(e,t,i,"deepEqual",u.deepEqual)},u.deepStrictEqual=function(e,t,i){y(e,t,!0)||m(e,t,i,"deepStrictEqual",u.deepStrictEqual)},u.notDeepEqual=function(e,t,i){y(e,t,!1)&&m(e,t,i,"notDeepEqual",u.notDeepEqual)},u.notDeepStrictEqual=function e(t,i,r){y(t,i,!0)&&m(t,i,r,"notDeepStrictEqual",e)},u.strictEqual=function(e,t,i){e!==t&&m(e,t,i,"===",u.strictEqual)},u.notStrictEqual=function(e,t,i){e===t&&m(e,t,i,"!==",u.notStrictEqual)},u.throws=function(e,t,i){C(!0,e,t,i)},u.doesNotThrow=function(e,t,i){C(!1,e,t,i)},u.ifError=function(e){if(e)throw e},u.strict=e(function e(t,i){t||m(t,!0,i,"==",e)},u,{equal:u.strictEqual,deepEqual:u.deepStrictEqual,notEqual:u.notStrictEqual,notDeepEqual:u.notDeepStrictEqual}),u.strict.strict=u.strict;var x=Object.keys||function(e){var t=[];for(var i in e)r.call(e,i)&&t.push(i);return t}}).call(this,A(134))},function(e,t,i){var r=i(5),n=r.performance&&r.performance.now?r.performance.now.bind(r.performance):Date.now.bind(Date),a=r.requestAnimationFrame||r.mozRequestAnimationFrame||r.webkitRequestAnimationFrame||r.msRequestAnimationFrame,o=r.cancelAnimationFrame||r.mozCancelAnimationFrame||r.webkitCancelAnimationFrame||r.msCancelAnimationFrame;e.exports={now:n,frame:function(e){return a(e)},cancelFrame:function(e){return o(e)},getImageData:function(e){var t=r.document.createElement("canvas"),i=t.getContext("2d");if(!i)throw new Error("failed to create canvas 2d context");return t.width=e.width,t.height=e.height,i.drawImage(e,0,0,e.width,e.height),i.getImageData(0,0,e.width,e.height)},hardwareConcurrency:r.navigator.hardwareConcurrency||4,get devicePixelRatio(){return r.devicePixelRatio},supportsWebp:!1};var s=r.document.createElement("img");s.onload=function(){e.exports.supportsWebp=!0},s.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="},function(e,t,i){function r(e,t){this.x=e,this.y=t}(e.exports=r).prototype={clone:function(){return new r(this.x,this.y)},add:function(e){return this.clone()._add(e)},sub:function(e){return this.clone()._sub(e)},multByPoint:function(e){return this.clone()._multByPoint(e)},divByPoint:function(e){return this.clone()._divByPoint(e)},mult:function(e){return this.clone()._mult(e)},div:function(e){return this.clone()._div(e)},rotate:function(e){return this.clone()._rotate(e)},rotateAround:function(e,t){return this.clone()._rotateAround(e,t)},matMult:function(e){return this.clone()._matMult(e)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(e){return this.x===e.x&&this.y===e.y},dist:function(e){return Math.sqrt(this.distSqr(e))},distSqr:function(e){var t=e.x-this.x,i=e.y-this.y;return t*t+i*i},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith:function(e){return this.angleWithSep(e.x,e.y)},angleWithSep:function(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult:function(e){var t=e[0]*this.x+e[1]*this.y,i=e[2]*this.x+e[3]*this.y;return this.x=t,this.y=i,this},_add:function(e){return this.x+=e.x,this.y+=e.y,this},_sub:function(e){return this.x-=e.x,this.y-=e.y,this},_mult:function(e){return this.x*=e,this.y*=e,this},_div:function(e){return this.x/=e,this.y/=e,this},_multByPoint:function(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint:function(e){return this.x/=e.x,this.y/=e.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var e=this.y;return this.y=this.x,this.x=-e,this},_rotate:function(e){var t=Math.cos(e),i=Math.sin(e),r=t*this.x-i*this.y,n=i*this.x+t*this.y;return this.x=r,this.y=n,this},_rotateAround:function(e,t){var i=Math.cos(e),r=Math.sin(e),n=t.x+i*(this.x-t.x)-r*(this.y-t.y),a=t.y+r*(this.x-t.x)+i*(this.y-t.y);return this.x=n,this.y=a,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},r.convert=function(e){return e instanceof r?e:Array.isArray(e)?new r(e[0],e[1]):e}},function(e,t,i){function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function n(e,t,i){return t&&r(e.prototype,t),i&&r(e,i),e}var a=i(1),s=i(0),l=s.clone,u=s.extend,c=s.easeCubicInOut,d=i(26),h=i(30).normalizePropertyExpression,p=(i(12),i(11).register),f=(n(B,[{key:"isDataDriven",value:function(){return"source"===this.expression.kind||"composite"===this.expression.kind}},{key:"possiblyEvaluate",value:function(e){return this.property.possiblyEvaluate(this,e)}}]),B),m=(n(k,[{key:"transitioned",value:function(e,t){return new y(this.property,this.value,t,u({},e.transition,this.transition),e.now)}},{key:"untransitioned",value:function(){return new y(this.property,this.value,null,{},0)}}]),k),g=(n(N,[{key:"getValue",value:function(e){return l(this._values[e].value.value)}},{key:"setValue",value:function(e,t){this._values.hasOwnProperty(e)||(this._values[e]=new m(this._values[e].property)),this._values[e].value=new f(this._values[e].property,null===t?void 0:l(t))}},{key:"getTransition",value:function(e){return l(this._values[e].transition)}},{key:"setTransition",value:function(e,t){this._values.hasOwnProperty(e)||(this._values[e]=new m(this._values[e].property)),this._values[e].transition=l(t)||void 0}},{key:"serialize",value:function(){for(var e={},t=0,i=Object.keys(this._values);t<i.length;t++){var r=i[t],n=this.getValue(r);void 0!==n&&(e[r]=n);var a=this.getTransition(r);void 0!==a&&(e["".concat(r,"-transition")]=a)}return e}},{key:"transitioned",value:function(e,t){for(var i=new v(this._properties),r=0,n=Object.keys(this._values);r<n.length;r++){var a=n[r];i._values[a]=this._values[a].transitioned(e,t._values[a])}return i}},{key:"untransitioned",value:function(){for(var e=new v(this._properties),t=0,i=Object.keys(this._values);t<i.length;t++){var r=i[t];e._values[r]=this._values[r].untransitioned()}return e}}]),N),y=(n(L,[{key:"possiblyEvaluate",value:function(e){var t=e.now||0,i=this.value.possiblyEvaluate(e),r=this.prior;if(r){if(t>this.end)return this.prior=null,i;if(this.value.isDataDriven())return this.prior=null,i;if(t<this.begin)return r.possiblyEvaluate(e);var n=(t-this.begin)/(this.end-this.begin);return this.property.interpolate(r.possiblyEvaluate(e),i,c(n))}return i}}]),L),v=(n(R,[{key:"possiblyEvaluate",value:function(e){for(var t=new x(this._properties),i=0,r=Object.keys(this._values);i<r.length;i++){var n=r[i];t._values[n]=this._values[n].possiblyEvaluate(e)}return t}},{key:"hasTransition",value:function(){for(var e=0,t=Object.keys(this._values);e<t.length;e++){var i=t[e];if(this._values[i].prior)return!0}return!1}}]),R),_=(n(O,[{key:"getValue",value:function(e){return l(this._values[e].value)}},{key:"setValue",value:function(e,t){this._values[e]=new f(this._values[e].property,null===t?void 0:l(t))}},{key:"serialize",value:function(){for(var e={},t=0,i=Object.keys(this._values);t<i.length;t++){var r=i[t],n=this.getValue(r);void 0!==n&&(e[r]=n)}return e}},{key:"possiblyEvaluate",value:function(e){for(var t=new x(this._properties),i=0,r=Object.keys(this._values);i<r.length;i++){var n=r[i];t._values[n]=this._values[n].possiblyEvaluate(e)}return t}}]),O),C=(n(I,[{key:"isConstant",value:function(){return"constant"===this.value.kind}},{key:"constantOr",value:function(e){return"constant"===this.value.kind?this.value.value:e}},{key:"evaluate",value:function(e){return this.property.evaluate(this.value,this.globals,e)}}]),I),x=(n(D,[{key:"get",value:function(e){return this._values[e]}}]),D),b=(n(M,[{key:"possiblyEvaluate",value:function(e,t){return a(!e.isDataDriven()),e.expression.evaluate(t)}},{key:"interpolate",value:function(e,t,i){var r=d[this.specification.type];return r?r(e,t,i):e}}]),M),A=(n(P,[{key:"possiblyEvaluate",value:function(e,t){return"constant"===e.expression.kind||"camera"===e.expression.kind?new C(this,{kind:"constant",value:e.expression.evaluate(t)},t):new C(this,e.expression,t)}},{key:"interpolate",value:function(e,t,i){if("constant"!==e.value.kind||"constant"!==t.value.kind)return e;if(void 0!==e.value.value&&void 0!==t.value.value){var r=d[this.specification.type];return r?new C(this,{kind:"constant",value:r(e.value.value,t.value.value,i)},e.globals):e}}},{key:"evaluate",value:function(e,t,i){return"constant"===e.kind?e.value:e.evaluate(t,i)}}]),P),S=(n(T,[{key:"possiblyEvaluate",value:function(e,t){if(void 0!==e.value){if("constant"!==e.expression.kind)return a(!e.isDataDriven()),this._calculate(e.expression.evaluate({zoom:t.zoom-1}),e.expression.evaluate({zoom:t.zoom}),e.expression.evaluate({zoom:t.zoom+1}),t);var i=e.expression.evaluate(t);return this._calculate(i,i,i,t)}}},{key:"_calculate",value:function(e,t,i,r){var n=r.zoom,a=n-Math.floor(n),o=r.crossFadingFactor();return n>r.zoomHistory.lastIntegerZoom?{from:e,to:t,fromScale:2,toScale:1,t:a+(1-a)*o}:{from:i,to:t,fromScale:.5,toScale:1,t:1-(1-o)*a}}},{key:"interpolate",value:function(e){return e}}]),T),w=(n(E,[{key:"possiblyEvaluate",value:function(){}},{key:"interpolate",value:function(){}}]),E);function E(e){o(this,E),this.specification=e}function T(e){o(this,T),this.specification=e}function P(e){o(this,P),this.specification=e}function M(e){o(this,M),this.specification=e}function D(e){o(this,D),this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)}function I(e,t,i){o(this,I),this.property=e,this.value=t,this.globals=i}function O(e){o(this,O),this._properties=e,this._values=Object.create(e.defaultPropertyValues)}function R(e){o(this,R),this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)}function L(e,t,i,r,n){o(this,L),this.property=e,this.value=t,this.begin=n+r.delay||0,this.end=this.begin+r.duration||0,e.specification.transition&&(r.delay||r.duration)&&(this.prior=i)}function N(e){o(this,N),this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues)}function k(e){o(this,k),this.property=e,this.value=new f(e,void 0)}function B(e,t){o(this,B),this.property=e,this.value=t,this.expression=h(void 0===t?e.specification.default:t,e.specification)}p("DataDrivenProperty",A),p("DataConstantProperty",b),p("CrossFadedProperty",S),p("HeatmapColorProperty",w),e.exports={PropertyValue:f,Transitionable:g,Transitioning:v,Layout:_,PossiblyEvaluatedPropertyValue:C,PossiblyEvaluated:x,DataConstantProperty:b,DataDrivenProperty:A,CrossFadedProperty:S,HeatmapColorProperty:w,Properties:function e(t){for(var i in o(this,e),this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},t){var r=t[i],n=this.defaultPropertyValues[i]=new f(r,void 0),a=this.defaultTransitionablePropertyValues[i]=new m(r);this.defaultTransitioningPropertyValues[i]=a.untransitioned(),this.defaultPossiblyEvaluatedValues[i]=n.possiblyEvaluate({})}}}},function(e,t){e.exports=self},function(e,t){e.exports=8192},function(e,t){e.exports=function(e,t,i){this.message=(e?"".concat(e,": "):"")+i,null!=t&&t.__line__&&(this.line=t.__line__)}},function(e,t){var i={kind:"null"},r={kind:"number"},n={kind:"string"},a={kind:"boolean"},o={kind:"color"},s={kind:"object"},l={kind:"value"};function u(e,t){return{kind:"array",itemType:e,N:t}}function c(e){if("array"!==e.kind)return e.kind;var t=c(e.itemType);return"number"==typeof e.N?"array<".concat(t,", ").concat(e.N,">"):"value"===e.itemType.kind?"array":"array<".concat(t,">")}var d=[i,r,n,a,o,s,u(l)];e.exports={NullType:i,NumberType:r,StringType:n,BooleanType:a,ColorType:o,ObjectType:s,ValueType:l,array:u,ErrorType:{kind:"error"},toString:c,checkSubtype:function e(t,i){if("error"===i.kind)return null;if("array"===t.kind){if("array"===i.kind&&!e(t.itemType,i.itemType)&&("number"!=typeof t.N||t.N===i.N))return null}else{if(t.kind===i.kind)return null;if("value"===t.kind)for(var r=0,n=d;r<n.length;r++)if(!e(n[r],i))return null}return"Expected ".concat(c(t)," but found ").concat(c(i)," instead.")}}},function(e,t,i){var o=i(3),n=i(5);t.create=function(e,t,i){var r=n.document.createElement(e);return t&&(r.className=t),i&&i.appendChild(r),r},t.createNS=function(e,t){return n.document.createElementNS(e,t)};var r=n.document.documentElement.style;function a(e){for(var t=0;t<e.length;t++)if(e[t]in r)return e[t];return e[0]}var s,l=a(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]);t.disableDrag=function(){l&&(s=r[l],r[l]="none")},t.enableDrag=function(){l&&(r[l]=s)};var u=a(["transform","WebkitTransform"]);t.setTransform=function(e,t){e.style[u]=t};function c(e){e.preventDefault(),e.stopPropagation(),n.removeEventListener("click",c,!0)}t.suppressClick=function(){n.addEventListener("click",c,!0),n.setTimeout(function(){n.removeEventListener("click",c,!0)},0)},t.mousePos=function(e,t){var i=e.getBoundingClientRect();return t=t.touches?t.touches[0]:t,new o(t.clientX-i.left-e.clientLeft,t.clientY-i.top-e.clientTop)},t.touchPos=function(e,t){for(var i=e.getBoundingClientRect(),r=[],n="touchend"===t.type?t.changedTouches:t.touches,a=0;a<n.length;a++)r.push(new o(n[a].clientX-i.left-e.clientLeft,n[a].clientY-i.top-e.clientTop));return r},t.remove=function(e){e.parentNode&&e.parentNode.removeChild(e)}},function(e,t,i){var m=i(0);function r(e,t,i){i[e]=i[e]||[],i[e].push(t)}function g(e,t,i){if(i&&i[e]){var r=i[e].indexOf(t);-1!==r&&i[e].splice(r,1)}}var n=(function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(a.prototype,[{key:"on",value:function(e,t){return this._listeners=this._listeners||{},r(e,t,this._listeners),this}},{key:"off",value:function(e,t){return g(e,t,this._listeners),g(e,t,this._oneTimeListeners),this}},{key:"once",value:function(e,t){return this._oneTimeListeners=this._oneTimeListeners||{},r(e,t,this._oneTimeListeners),this}},{key:"fire",value:function(e,t){if(this.listens(e)){t=m.extend({},t,{type:e,target:this});var i=this._listeners&&this._listeners[e]?this._listeners[e].slice():[],r=!0,n=!1,a=void 0;try{for(var o,s=i[Symbol.iterator]();!(r=(o=s.next()).done);r=!0)o.value.call(this,t)}catch(e){n=!0,a=e}finally{try{r||null==s.return||s.return()}finally{if(n)throw a}}var l=this._oneTimeListeners&&this._oneTimeListeners[e]?this._oneTimeListeners[e].slice():[],u=!0,c=!1,d=void 0;try{for(var h,p=l[Symbol.iterator]();!(u=(h=p.next()).done);u=!0){var f=h.value;g(e,f,this._oneTimeListeners),f.call(this,t)}}catch(e){c=!0,d=e}finally{try{u||null==p.return||p.return()}finally{if(c)throw d}}this._eventedParent&&this._eventedParent.fire(e,m.extend({},t,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData))}else m.endsWith(e,"error")&&console.error(t&&t.error||t||"Empty error event");return this}},{key:"listens",value:function(e){return this._listeners&&this._listeners[e]&&0<this._listeners[e].length||this._oneTimeListeners&&this._oneTimeListeners[e]&&0<this._oneTimeListeners[e].length||this._eventedParent&&this._eventedParent.listens(e)}},{key:"setEventedParent",value:function(e,t){return this._eventedParent=e,this._eventedParentData=t,this}}]),a);function a(){!function(e){if(!(e instanceof a))throw new TypeError("Cannot call a class as a function")}(this)}e.exports=n},function(e,t,i){function g(e){return(g="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})(e)}var y=i(1),r=i(102),n=i(12),a=i(30),o=a.StylePropertyFunction,s=a.StyleExpression,l=a.StyleExpressionWithErrorHandling,u=a.ZoomDependentExpression,c=a.ZoomConstantExpression,d=i(42).CompoundExpression,h=i(90),v=i(5).ImageData,_={};function p(e,t){var i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{};y(!_[e],"".concat(e," is already registered.")),Object.defineProperty(t,"_classRegistryKey",{value:e,writeable:!1}),_[e]={klass:t,omit:i.omit||[],shallow:i.shallow||[]}}for(var f in p("Object",Object),r.serialize=function(e,t){var i=e.toArrayBuffer();return t&&t.push(i),i},r.deserialize=function(e){return new r(e)},p("Grid",r),p("Color",n),p("StylePropertyFunction",o),p("StyleExpression",s,{omit:["_evaluator"]}),p("StyleExpressionWithErrorHandling",l,{omit:["_evaluator"]}),p("ZoomDependentExpression",u),p("ZoomConstantExpression",c),p("CompoundExpression",d,{omit:["_evaluate"]}),h)h[f]._classRegistryKey||p("Expression_".concat(f),h[f]);e.exports={register:p,serialize:function e(t,i){if(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp)return t;if(t instanceof ArrayBuffer)return i&&i.push(t),t;if(ArrayBuffer.isView(t)){var r=t;return i&&i.push(r.buffer),r}if(t instanceof v)return i&&i.push(t.data.buffer),t;if(Array.isArray(t)){var n=[],a=!0,o=!1,s=void 0;try{for(var l,u=t[Symbol.iterator]();!(a=(l=u.next()).done);a=!0){var c=l.value;n.push(e(c,i))}}catch(e){o=!0,s=e}finally{try{a||null==u.return||u.return()}finally{if(o)throw s}}return n}if("object"!==g(t))throw new Error("can't serialize object of type ".concat(g(t)));var d=t.constructor,h=d._classRegistryKey;if(!h)throw new Error("can't serialize object of unregistered class");y(_[h]);var p={};if(d.serialize)p._serialized=d.serialize(t,i);else for(var f in t)if(t.hasOwnProperty(f)&&!(0<=_[h].omit.indexOf(f))){var m=t[f];p[f]=0<=_[h].shallow.indexOf(f)?m:e(m,i)}return{name:h,properties:p}},deserialize:function t(e){if(null==e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp||e instanceof ArrayBuffer||ArrayBuffer.isView(e)||e instanceof v)return e;if(Array.isArray(e))return e.map(function(e){return t(e)});if("object"!==g(e))throw new Error("can't deserialize object of type ".concat(g(e)));var i=e,r=i.name,n=i.properties;if(!r)throw new Error("can't deserialize object of anonymous class");var a=_[r].klass;if(!a)throw new Error("can't deserialize unregistered class ".concat(r));if(a.deserialize)return a.deserialize(n._serialized);for(var o=Object.create(a.prototype),s=0,l=Object.keys(n);s<l.length;s++){var u=l[s];o[u]=0<=_[r].shallow.indexOf(u)?n[u]:t(n[u])}return o}}},function(e,t,i){function r(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var n,a,o=i(80).parseCSSColor,s=(a=[{key:"parse",value:function(e){if(e){if(e instanceof l)return e;if("string"==typeof e){var t=o(e);if(t)return new l(t[0]/255*t[3],t[1]/255*t[3],t[2]/255*t[3],t[3])}}}}],r((n=l).prototype,[{key:"toString",value:function(){var t=this,e=[this.r,this.g,this.b].map(function(e){return Math.round(255*e/t.a)});return"rgba(".concat(e.concat(this.a).join(","),")")}}]),r(n,a),l);function l(e,t,i){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:1;!function(e){if(!(e instanceof l))throw new TypeError("Cannot call a class as a function")}(this),this.r=e,this.g=t,this.b=i,this.a=r}s.black=new s(0,0,0,1),s.white=new s(1,1,1,1),s.transparent=new s(0,0,0,0),e.exports=s},function(e,t,i){e.exports=i(140)},function(e,t,i){function r(e){return(r="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})(e)}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function o(e,t,i){return t&&a(e.prototype,t),i&&a(e,i),e}function s(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function l(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&c(e,t)}function c(e,t){return(c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var d=i(1),h=i(23).StructArray,p=i(23).Struct,f=i(11).register,m=i(3),g=(u(y,h),o(y,[{key:"_refreshViews",value:function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}},{key:"emplaceBack",value:function(e,t){var i=this.length;this.resize(i+1);var r=2*i;return this.int16[0+r]=e,this.int16[1+r]=t,i}}]),y);function y(){return n(this,y),s(this,l(y).apply(this,arguments))}g.prototype.bytesPerElement=4,f("StructArrayLayout2i4",g);var v=(u(_,h),o(_,[{key:"_refreshViews",value:function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}},{key:"emplaceBack",value:function(e,t,i,r){var n=this.length;this.resize(n+1);var a=4*n;return this.int16[0+a]=e,this.int16[1+a]=t,this.int16[2+a]=i,this.int16[3+a]=r,n}}]),_);function _(){return n(this,_),s(this,l(_).apply(this,arguments))}v.prototype.bytesPerElement=8,f("StructArrayLayout4i8",v);var C=(u(x,h),o(x,[{key:"_refreshViews",value:function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}},{key:"emplaceBack",value:function(e,t,i,r,n,a){var o=this.length;this.resize(o+1);var s=6*o;return this.int16[0+s]=e,this.int16[1+s]=t,this.int16[2+s]=i,this.int16[3+s]=r,this.int16[4+s]=n,this.int16[5+s]=a,o}}]),x);function x(){return n(this,x),s(this,l(x).apply(this,arguments))}C.prototype.bytesPerElement=12,f("StructArrayLayout2i4i12",C);var b=(u(A,h),o(A,[{key:"_refreshViews",value:function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}},{key:"emplaceBack",value:function(e,t,i,r,n,a,o,s){var l=this.length;this.resize(l+1);var u=6*l,c=12*l;return this.int16[0+u]=e,this.int16[1+u]=t,this.int16[2+u]=i,this.int16[3+u]=r,this.uint8[8+c]=n,this.uint8[9+c]=a,this.uint8[10+c]=o,this.uint8[11+c]=s,l}}]),A);function A(){return n(this,A),s(this,l(A).apply(this,arguments))}b.prototype.bytesPerElement=12,f("StructArrayLayout4i4ub12",b);var S=(u(w,h),o(w,[{key:"_refreshViews",value:function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}},{key:"emplaceBack",value:function(e,t,i,r,n,a,o,s){var l=this.length;this.resize(l+1);var u=8*l;return this.int16[0+u]=e,this.int16[1+u]=t,this.int16[2+u]=i,this.int16[3+u]=r,this.uint16[4+u]=n,this.uint16[5+u]=a,this.uint16[6+u]=o,this.uint16[7+u]=s,l}}]),w);function w(){return n(this,w),s(this,l(w).apply(this,arguments))}S.prototype.bytesPerElement=16,f("StructArrayLayout4i4ui16",S);var E=(u(T,h),o(T,[{key:"_refreshViews",value:function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}},{key:"emplaceBack",value:function(e,t,i){var r=this.length;this.resize(r+1);var n=3*r;return this.float32[0+n]=e,this.float32[1+n]=t,this.float32[2+n]=i,r}}]),T);function T(){return n(this,T),s(this,l(T).apply(this,arguments))}E.prototype.bytesPerElement=12,f("StructArrayLayout3f12",E);var P=(u(M,h),o(M,[{key:"_refreshViews",value:function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}},{key:"emplaceBack",value:function(e){var t=this.length;this.resize(t+1);var i=1*t;return this.uint32[0+i]=e,t}}]),M);function M(){return n(this,M),s(this,l(M).apply(this,arguments))}P.prototype.bytesPerElement=4,f("StructArrayLayout1ul4",P);var D=(u(I,h),o(I,[{key:"_refreshViews",value:function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}},{key:"emplaceBack",value:function(e,t,i,r,n,a,o,s,l,u,c){var d=this.length;this.resize(d+1);var h=12*d,p=6*d;return this.int16[0+h]=e,this.int16[1+h]=t,this.int16[2+h]=i,this.int16[3+h]=r,this.int16[4+h]=n,this.int16[5+h]=a,this.uint32[3+p]=o,this.uint16[8+h]=s,this.uint16[9+h]=l,this.int16[10+h]=u,this.int16[11+h]=c,d}}]),I);function I(){return n(this,I),s(this,l(I).apply(this,arguments))}D.prototype.bytesPerElement=24,f("StructArrayLayout6i1ul2ui2i24",D);var O=(u(R,h),o(R,[{key:"_refreshViews",value:function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}},{key:"emplaceBack",value:function(e,t,i,r,n,a){var o=this.length;this.resize(o+1);var s=6*o;return this.int16[0+s]=e,this.int16[1+s]=t,this.int16[2+s]=i,this.int16[3+s]=r,this.int16[4+s]=n,this.int16[5+s]=a,o}}]),R);function R(){return n(this,R),s(this,l(R).apply(this,arguments))}O.prototype.bytesPerElement=12,f("StructArrayLayout2i2i2i12",O);var L=(u(N,h),o(N,[{key:"_refreshViews",value:function(){this.uint8=new Uint8Array(this.arrayBuffer)}},{key:"emplaceBack",value:function(e,t){var i=this.length;this.resize(i+1);var r=4*i;return this.uint8[0+r]=e,this.uint8[1+r]=t,i}}]),N);function N(){return n(this,N),s(this,l(N).apply(this,arguments))}L.prototype.bytesPerElement=4,f("StructArrayLayout2ub4",L);var k=(u(B,h),o(B,[{key:"_refreshViews",value:function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}},{key:"emplaceBack",value:function(e,t,i,r,n,a,o,s,l,u,c,d,h,p){var f=this.length;this.resize(f+1);var m=20*f,g=10*f,y=40*f;return this.int16[0+m]=e,this.int16[1+m]=t,this.uint16[2+m]=i,this.uint16[3+m]=r,this.uint32[2+g]=n,this.uint32[3+g]=a,this.uint32[4+g]=o,this.uint16[10+m]=s,this.uint16[11+m]=l,this.uint16[12+m]=u,this.float32[7+g]=c,this.float32[8+g]=d,this.uint8[36+y]=h,this.uint8[37+y]=p,f}}]),B);function B(){return n(this,B),s(this,l(B).apply(this,arguments))}k.prototype.bytesPerElement=40,f("StructArrayLayout2i2ui3ul3ui2f2ub40",k);var F=(u(V,h),o(V,[{key:"_refreshViews",value:function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}},{key:"emplaceBack",value:function(e){var t=this.length;this.resize(t+1);var i=1*t;return this.float32[0+i]=e,t}}]),V);function V(){return n(this,V),s(this,l(V).apply(this,arguments))}F.prototype.bytesPerElement=4,f("StructArrayLayout1f4",F);var z=(u(U,h),o(U,[{key:"_refreshViews",value:function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}},{key:"emplaceBack",value:function(e,t,i){var r=this.length;this.resize(r+1);var n=3*r;return this.int16[0+n]=e,this.int16[1+n]=t,this.int16[2+n]=i,r}}]),U);function U(){return n(this,U),s(this,l(U).apply(this,arguments))}z.prototype.bytesPerElement=6,f("StructArrayLayout3i6",z);var G=(u($,h),o($,[{key:"_refreshViews",value:function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}},{key:"emplaceBack",value:function(e,t,i){var r=this.length;this.resize(r+1);var n=2*r,a=4*r;return this.uint32[0+n]=e,this.uint16[2+a]=t,this.uint16[3+a]=i,r}}]),$);function $(){return n(this,$),s(this,l($).apply(this,arguments))}G.prototype.bytesPerElement=8,f("StructArrayLayout1ul2ui8",G);var H=(u(W,h),o(W,[{key:"_refreshViews",value:function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}},{key:"emplaceBack",value:function(e,t,i){var r=this.length;this.resize(r+1);var n=3*r;return this.uint16[0+n]=e,this.uint16[1+n]=t,this.uint16[2+n]=i,r}}]),W);function W(){return n(this,W),s(this,l(W).apply(this,arguments))}H.prototype.bytesPerElement=6,f("StructArrayLayout3ui6",H);var j=(u(q,h),o(q,[{key:"_refreshViews",value:function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}},{key:"emplaceBack",value:function(e,t){var i=this.length;this.resize(i+1);var r=2*i;return this.uint16[0+r]=e,this.uint16[1+r]=t,i}}]),q);function q(){return n(this,q),s(this,l(q).apply(this,arguments))}j.prototype.bytesPerElement=4,f("StructArrayLayout2ui4",j);var Q=(u(Y,h),o(Y,[{key:"_refreshViews",value:function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}},{key:"emplaceBack",value:function(e,t){var i=this.length;this.resize(i+1);var r=2*i;return this.float32[0+r]=e,this.float32[1+r]=t,i}}]),Y);function Y(){return n(this,Y),s(this,l(Y).apply(this,arguments))}Q.prototype.bytesPerElement=8,f("StructArrayLayout2f8",Q);var X=(u(Z,h),o(Z,[{key:"_refreshViews",value:function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}},{key:"emplaceBack",value:function(e,t,i,r){var n=this.length;this.resize(n+1);var a=4*n;return this.float32[0+a]=e,this.float32[1+a]=t,this.float32[2+a]=i,this.float32[3+a]=r,n}}]),Z);function Z(){return n(this,Z),s(this,l(Z).apply(this,arguments))}X.prototype.bytesPerElement=16,f("StructArrayLayout4f16",X);var J=(u(K,p),o(K,[{key:"anchorPointX",get:function(){return this._structArray.int16[this._pos2+0]},set:function(e){this._structArray.int16[this._pos2+0]=e}},{key:"anchorPointY",get:function(){return this._structArray.int16[this._pos2+1]},set:function(e){this._structArray.int16[this._pos2+1]=e}},{key:"x1",get:function(){return this._structArray.int16[this._pos2+2]},set:function(e){this._structArray.int16[this._pos2+2]=e}},{key:"y1",get:function(){return this._structArray.int16[this._pos2+3]},set:function(e){this._structArray.int16[this._pos2+3]=e}},{key:"x2",get:function(){return this._structArray.int16[this._pos2+4]},set:function(e){this._structArray.int16[this._pos2+4]=e}},{key:"y2",get:function(){return this._structArray.int16[this._pos2+5]},set:function(e){this._structArray.int16[this._pos2+5]=e}},{key:"featureIndex",get:function(){return this._structArray.uint32[this._pos4+3]},set:function(e){this._structArray.uint32[this._pos4+3]=e}},{key:"sourceLayerIndex",get:function(){return this._structArray.uint16[this._pos2+8]},set:function(e){this._structArray.uint16[this._pos2+8]=e}},{key:"bucketIndex",get:function(){return this._structArray.uint16[this._pos2+9]},set:function(e){this._structArray.uint16[this._pos2+9]=e}},{key:"radius",get:function(){return this._structArray.int16[this._pos2+10]},set:function(e){this._structArray.int16[this._pos2+10]=e}},{key:"signedDistanceFromAnchor",get:function(){return this._structArray.int16[this._pos2+11]},set:function(e){this._structArray.int16[this._pos2+11]=e}},{key:"anchorPoint",get:function(){return new m(this.anchorPointX,this.anchorPointY)}}]),K);function K(){return n(this,K),s(this,l(K).apply(this,arguments))}J.prototype.size=24;var ee=(u(te,D),o(te,[{key:"get",value:function(e){return d(!this.isTransferred),new J(this,e)}}]),te);function te(){return n(this,te),s(this,l(te).apply(this,arguments))}f("CollisionBoxArray",ee);var ie=(u(re,p),o(re,[{key:"anchorX",get:function(){return this._structArray.int16[this._pos2+0]},set:function(e){this._structArray.int16[this._pos2+0]=e}},{key:"anchorY",get:function(){return this._structArray.int16[this._pos2+1]},set:function(e){this._structArray.int16[this._pos2+1]=e}},{key:"glyphStartIndex",get:function(){return this._structArray.uint16[this._pos2+2]},set:function(e){this._structArray.uint16[this._pos2+2]=e}},{key:"numGlyphs",get:function(){return this._structArray.uint16[this._pos2+3]},set:function(e){this._structArray.uint16[this._pos2+3]=e}},{key:"vertexStartIndex",get:function(){return this._structArray.uint32[this._pos4+2]},set:function(e){this._structArray.uint32[this._pos4+2]=e}},{key:"lineStartIndex",get:function(){return this._structArray.uint32[this._pos4+3]},set:function(e){this._structArray.uint32[this._pos4+3]=e}},{key:"lineLength",get:function(){return this._structArray.uint32[this._pos4+4]},set:function(e){this._structArray.uint32[this._pos4+4]=e}},{key:"segment",get:function(){return this._structArray.uint16[this._pos2+10]},set:function(e){this._structArray.uint16[this._pos2+10]=e}},{key:"lowerSize",get:function(){return this._structArray.uint16[this._pos2+11]},set:function(e){this._structArray.uint16[this._pos2+11]=e}},{key:"upperSize",get:function(){return this._structArray.uint16[this._pos2+12]},set:function(e){this._structArray.uint16[this._pos2+12]=e}},{key:"lineOffsetX",get:function(){return this._structArray.float32[this._pos4+7]},set:function(e){this._structArray.float32[this._pos4+7]=e}},{key:"lineOffsetY",get:function(){return this._structArray.float32[this._pos4+8]},set:function(e){this._structArray.float32[this._pos4+8]=e}},{key:"writingMode",get:function(){return this._structArray.uint8[this._pos1+36]},set:function(e){this._structArray.uint8[this._pos1+36]=e}},{key:"hidden",get:function(){return this._structArray.uint8[this._pos1+37]},set:function(e){this._structArray.uint8[this._pos1+37]=e}}]),re);function re(){return n(this,re),s(this,l(re).apply(this,arguments))}ie.prototype.size=40;var ne=(u(ae,k),o(ae,[{key:"get",value:function(e){return d(!this.isTransferred),new ie(this,e)}}]),ae);function ae(){return n(this,ae),s(this,l(ae).apply(this,arguments))}f("PlacedSymbolArray",ne);var oe=(u(se,p),o(se,[{key:"offsetX",get:function(){return this._structArray.float32[this._pos4+0]},set:function(e){this._structArray.float32[this._pos4+0]=e}}]),se);function se(){return n(this,se),s(this,l(se).apply(this,arguments))}oe.prototype.size=4;var le=(u(ue,F),o(ue,[{key:"getoffsetX",value:function(e){return this.float32[1*e+0]}},{key:"get",value:function(e){return d(!this.isTransferred),new oe(this,e)}}]),ue);function ue(){return n(this,ue),s(this,l(ue).apply(this,arguments))}f("GlyphOffsetArray",le);var ce=(u(de,p),o(de,[{key:"x",get:function(){return this._structArray.int16[this._pos2+0]},set:function(e){this._structArray.int16[this._pos2+0]=e}},{key:"y",get:function(){return this._structArray.int16[this._pos2+1]},set:function(e){this._structArray.int16[this._pos2+1]=e}},{key:"tileUnitDistanceFromAnchor",get:function(){return this._structArray.int16[this._pos2+2]},set:function(e){this._structArray.int16[this._pos2+2]=e}}]),de);function de(){return n(this,de),s(this,l(de).apply(this,arguments))}ce.prototype.size=6;var he=(u(pe,z),o(pe,[{key:"getx",value:function(e){return this.int16[3*e+0]}},{key:"gety",value:function(e){return this.int16[3*e+1]}},{key:"gettileUnitDistanceFromAnchor",value:function(e){return this.int16[3*e+2]}},{key:"get",value:function(e){return d(!this.isTransferred),new ce(this,e)}}]),pe);function pe(){return n(this,pe),s(this,l(pe).apply(this,arguments))}f("SymbolLineVertexArray",he);var fe=(u(me,p),o(me,[{key:"featureIndex",get:function(){return this._structArray.uint32[this._pos4+0]},set:function(e){this._structArray.uint32[this._pos4+0]=e}},{key:"sourceLayerIndex",get:function(){return this._structArray.uint16[this._pos2+2]},set:function(e){this._structArray.uint16[this._pos2+2]=e}},{key:"bucketIndex",get:function(){return this._structArray.uint16[this._pos2+3]},set:function(e){this._structArray.uint16[this._pos2+3]=e}}]),me);function me(){return n(this,me),s(this,l(me).apply(this,arguments))}fe.prototype.size=8;var ge=(u(ye,G),o(ye,[{key:"get",value:function(e){return d(!this.isTransferred),new fe(this,e)}}]),ye);function ye(){return n(this,ye),s(this,l(ye).apply(this,arguments))}f("FeatureIndexArray",ge),e.exports={StructArrayLayout2i4:g,StructArrayLayout4i8:v,StructArrayLayout2i4i12:C,StructArrayLayout4i4ub12:b,StructArrayLayout4i4ui16:S,StructArrayLayout3f12:E,StructArrayLayout1ul4:P,StructArrayLayout6i1ul2ui2i24:D,StructArrayLayout2i2i2i12:O,StructArrayLayout2ub4:L,StructArrayLayout2i2ui3ul3ui2f2ub40:k,StructArrayLayout1f4:F,StructArrayLayout3i6:z,StructArrayLayout1ul2ui8:G,StructArrayLayout3ui6:H,StructArrayLayout2ui4:j,StructArrayLayout2f8:Q,StructArrayLayout4f16:X,PosArray:g,RasterBoundsArray:v,CircleLayoutArray:g,FillLayoutArray:g,FillExtrusionLayoutArray:C,HeatmapLayoutArray:g,LineLayoutArray:b,SymbolLayoutArray:S,SymbolDynamicLayoutArray:E,SymbolOpacityArray:P,CollisionBoxLayoutArray:O,CollisionCircleLayoutArray:O,CollisionVertexArray:L,TriangleIndexArray:H,LineIndexArray:j,CollisionBoxArray:ee,PlacedSymbolArray:ne,GlyphOffsetArray:le,SymbolLineVertexArray:he,FeatureIndexArray:ge}},function(e,t){function r(e,t,i){!function(e){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}(this),this.func=e,this.mask=t,this.range=i}r.ReadOnly=!1,r.ReadWrite=!0,r.disabled=new r(519,r.ReadOnly,[0,1]),e.exports=r},function(e,t,i){function r(e){return(r="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})(e)}function n(e){var r="function"==typeof Map?new Map:void 0;return(n=function(e){if(null===e||(t=e,-1===Function.toString.call(t).indexOf("[native code]")))return e;var t;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(e))return r.get(e);r.set(e,i)}function i(){return a(e,arguments,s(this).constructor)}return i.prototype=Object.create(e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),o(i,e)})(e)}function a(e,t,i){return(a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}()?Reflect.construct:function(e,t,i){var r=[null];r.push.apply(r,t);var n=new(Function.bind.apply(e,r));return i&&o(n,i.prototype),n}).apply(null,arguments)}function o(e,t){return(o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var l=i(5),u={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};t.ResourceType=u,"function"==typeof Object.freeze&&Object.freeze(u);var c=(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&o(e,t)}(d,n(Error)),d);function d(e,t){var i;return function(e){if(!(e instanceof d))throw new TypeError("Cannot call a class as a function")}(this),(i=function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,s(d).call(this,e))).status=t,i}function h(e){var t=new l.XMLHttpRequest;for(var i in t.open("GET",e.url,!0),e.headers)t.setRequestHeader(i,e.headers[i]);return t.withCredentials="include"===e.credentials,t}t.getJSON=function(e,t){var i=h(e);return i.setRequestHeader("Accept","application/json"),i.onerror=function(){t(new Error(i.statusText))},i.onload=function(){if(200<=i.status&&i.status<300&&i.response){var e;try{e=JSON.parse(i.response)}catch(e){return t(e)}t(null,e)}else t(new c(i.statusText,i.status))},i.send(),i},t.getArrayBuffer=function(e,t){var i=h(e);return i.responseType="arraybuffer",i.onerror=function(){t(new Error(i.statusText))},i.onload=function(){var e=i.response;if(0===e.byteLength&&200===i.status)return t(new Error("http status 200 returned without content."));200<=i.status&&i.status<300&&i.response?t(null,{data:e,cacheControl:i.getResponseHeader("Cache-Control"),expires:i.getResponseHeader("Expires")}):t(new c(i.statusText,i.status))},i.send(),i},t.getImage=function(e,a){return t.getArrayBuffer(e,function(e,t){if(e)a(e);else if(t){var i=new l.Image,r=l.URL||l.webkitURL;i.onload=function(){a(null,i),r.revokeObjectURL(i.src)};var n=new l.Blob([new Uint8Array(t.data)],{type:"image/png"});i.cacheControl=t.cacheControl,i.expires=t.expires,i.src=t.data.byteLength?r.createObjectURL(n):"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII="}})},t.getVideo=function(e,t){var i,r,n=l.document.createElement("video");n.onloadstart=function(){t(null,n)};for(var a=0;a<e.length;a++){var o=l.document.createElement("source");i=e[a],r=void 0,(r=l.document.createElement("a")).href=i,r.protocol===l.document.location.protocol&&r.host===l.document.location.host||(n.crossOrigin="Anonymous"),o.src=e[a],n.appendChild(o)}return n}},function(e,t){function i(e){return(i="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})(e)}e.exports=function(e){return e instanceof Number?"number":e instanceof String?"string":e instanceof Boolean?"boolean":Array.isArray(e)?"array":null===e?"null":i(e)}},function(e,t){function o(e,t,i,r,n,a){!function(e){if(!(e instanceof o))throw new TypeError("Cannot call a class as a function")}(this),this.test=e,this.ref=t,this.mask=i,this.fail=r,this.depthFail=n,this.pass=a}o.disabled=new o({func:519,mask:0},0,0,7680,7680,7680),e.exports=o},function(e,t,i){function a(e){return(a="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})(e)}function o(e){return(o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var n=i(0),s=i(13),l=i(54),u=i(10),c=i(4),d=c.Layout,h=c.Transitionable,p=(c.Transitioning,c.Properties,function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)}(f,u),function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(f.prototype,[{key:"getLayoutProperty",value:function(e){return"visibility"===e?this.visibility:this._unevaluatedLayout.getValue(e)}},{key:"setLayoutProperty",value:function(e,t,i){if(null!=t){var r="layers.".concat(this.id,".layout.").concat(e);if(this._validate(l.layoutProperty,r,e,t,i))return}"visibility"!==e?this._unevaluatedLayout.setValue(e,t):this.visibility="none"===t?t:"visible"}},{key:"getPaintProperty",value:function(e){return n.endsWith(e,"-transition")?this._transitionablePaint.getTransition(e.slice(0,-"-transition".length)):this._transitionablePaint.getValue(e)}},{key:"setPaintProperty",value:function(e,t,i){if(null!=t){var r="layers.".concat(this.id,".paint.").concat(e);if(this._validate(l.paintProperty,r,e,t,i))return}n.endsWith(e,"-transition")?this._transitionablePaint.setTransition(e.slice(0,-"-transition".length),t||void 0):this._transitionablePaint.setValue(e,t)}},{key:"isHidden",value:function(e){return!!(this.minzoom&&e<this.minzoom)||!!(this.maxzoom&&e>=this.maxzoom)||"none"===this.visibility}},{key:"updateTransitions",value:function(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)}},{key:"hasTransition",value:function(){return this._transitioningPaint.hasTransition()}},{key:"recalculate",value:function(e){this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e)),this.paint=this._transitioningPaint.possiblyEvaluate(e)}},{key:"serialize",value:function(){var e={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return"none"===this.visibility&&(e.layout=e.layout||{},e.layout.visibility="none"),n.filterObject(e,function(e,t){return!(void 0===e||"layout"===t&&!Object.keys(e).length||"paint"===t&&!Object.keys(e).length)})}},{key:"_validate",value:function(e,t,i,r,n){return(!n||!1!==n.validate)&&l.emitErrors(this,e.call(l,{key:t,layerType:this.type,objectKey:i,value:r,styleSpec:s,style:{glyphs:!0,sprite:!0}}))}},{key:"hasOffscreenPass",value:function(){return!1}},{key:"resize",value:function(){}}]),f);function f(e,t){var i;for(var r in function(e){if(!(e instanceof f))throw new TypeError("Cannot call a class as a function")}(this),(i=function(e,t){return!t||"object"!==a(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,o(f).call(this))).id=e.id,i.metadata=e.metadata,i.type=e.type,i.minzoom=e.minzoom,i.maxzoom=e.maxzoom,i.visibility="visible","background"!==e.type&&(i.source=e.source,i.sourceLayer=e["source-layer"],i.filter=e.filter),i._featureFilter=function(){return!0},t.layout&&(i._unevaluatedLayout=new d(t.layout)),i._transitionablePaint=new h(t.paint),e.paint)i.setPaintProperty(r,e.paint[r],{validate:!1});for(var n in e.layout)i.setLayoutProperty(n,e.layout[n],{validate:!1});return i._transitioningPaint=i._transitionablePaint.untransitioned(),i}e.exports=p;var m={circle:i(151),heatmap:i(155),hillshade:i(158),fill:i(160),"fill-extrusion":i(165),line:i(169),symbol:i(174),background:i(180),raster:i(182)};p.create=function(e){return new m[e.type](e)}},function(e,t,i){var r=i(5),o=r.HTMLImageElement,s=r.HTMLCanvasElement,l=r.HTMLVideoElement,u=r.ImageData,n=(function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(c.prototype,[{key:"update",value:function(e,t){var i=e.width,r=e.height;this.size=[i,r];var n=this.context,a=n.gl;a.bindTexture(a.TEXTURE_2D,this.texture),n.pixelStoreUnpack.set(1),this.format===a.RGBA&&!1!==t&&n.pixelStoreUnpackPremultiplyAlpha.set(!0),e instanceof o||e instanceof s||e instanceof l||e instanceof u?a.texImage2D(a.TEXTURE_2D,0,this.format,this.format,a.UNSIGNED_BYTE,e):a.texImage2D(a.TEXTURE_2D,0,this.format,i,r,0,this.format,a.UNSIGNED_BYTE,e.data)}},{key:"bind",value:function(e,t,i){var r=this.context.gl;r.bindTexture(r.TEXTURE_2D,this.texture),e!==this.filter&&(r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,e),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,i||e),this.filter=e),t!==this.wrap&&(r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,t),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,t),this.wrap=t)}},{key:"destroy",value:function(){this.context.gl.deleteTexture(this.texture),this.texture=null}}]),c);function c(e,t,i,r){!function(e){if(!(e instanceof c))throw new TypeError("Cannot call a class as a function")}(this),this.context=e;var n=t.width,a=t.height;this.size=[n,a],this.format=i,this.texture=e.gl.createTexture(),this.update(t,r)}e.exports=n},function(e,t,r){function i(e){return(i="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})(e)}function n(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var a,o,s=r(0).wrap,l=(o=[{key:"convert",value:function(e){if(e instanceof u)return e;if(Array.isArray(e)&&(2===e.length||3===e.length))return new u(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&"object"===i(e)&&null!==e)return new u(Number(e.lng),Number(e.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")}}],n((a=u).prototype,[{key:"wrap",value:function(){return new u(s(this.lng,-180,180),this.lat)}},{key:"toArray",value:function(){return[this.lng,this.lat]}},{key:"toString",value:function(){return"LngLat(".concat(this.lng,", ").concat(this.lat,")")}},{key:"toBounds",value:function(e){var t=360*e/40075017,i=t/Math.cos(Math.PI/180*this.lat);return new(r(39))(new u(this.lng-i,this.lat-t),new u(this.lng+i,this.lat+t))}}]),n(a,o),u);function u(e,t){if(function(e){if(!(e instanceof u))throw new TypeError("Cannot call a class as a function")}(this),isNaN(e)||isNaN(t))throw new Error("Invalid LngLat object: (".concat(e,", ").concat(t,")"));if(this.lng=+e,this.lat=+t,90<this.lat||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}e.exports=l},function(e,t,i){var r,n;e.exports=((r=new Float32Array(3))[0]=0,r[1]=0,r[2]=0,(n=new Float32Array(4))[0]=0,n[1]=0,n[2]=0,n[3]=0,{vec3:{transformMat3:function(e,t,i){var r=t[0],n=t[1],a=t[2];return e[0]=r*i[0]+n*i[3]+a*i[6],e[1]=r*i[1]+n*i[4]+a*i[7],e[2]=r*i[2]+n*i[5]+a*i[8],e}},vec4:{transformMat4:function(e,t,i){var r=t[0],n=t[1],a=t[2],o=t[3];return e[0]=i[0]*r+i[4]*n+i[8]*a+i[12]*o,e[1]=i[1]*r+i[5]*n+i[9]*a+i[13]*o,e[2]=i[2]*r+i[6]*n+i[10]*a+i[14]*o,e[3]=i[3]*r+i[7]*n+i[11]*a+i[15]*o,e}},mat2:{create:function(){var e=new Float32Array(4);return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e},rotate:function(e,t,i){var r=t[0],n=t[1],a=t[2],o=t[3],s=Math.sin(i),l=Math.cos(i);return e[0]=r*l+a*s,e[1]=n*l+o*s,e[2]=r*-s+a*l,e[3]=n*-s+o*l,e},scale:function(e,t,i){var r=t[0],n=t[1],a=t[2],o=t[3],s=i[0],l=i[1];return e[0]=r*s,e[1]=n*s,e[2]=a*l,e[3]=o*l,e}},mat3:{create:function(){var e=new Float32Array(9);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},fromRotation:function(e,t){var i=Math.sin(t),r=Math.cos(t);return e[0]=r,e[1]=i,e[2]=0,e[3]=-i,e[4]=r,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}},mat4:{create:function(){var e=new Float32Array(16);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},identity:function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},translate:function(e,t,i){var r,n,a,o,s,l,u,c,d,h,p,f,m=i[0],g=i[1],y=i[2];return t===e?(e[12]=t[0]*m+t[4]*g+t[8]*y+t[12],e[13]=t[1]*m+t[5]*g+t[9]*y+t[13],e[14]=t[2]*m+t[6]*g+t[10]*y+t[14],e[15]=t[3]*m+t[7]*g+t[11]*y+t[15]):(r=t[0],n=t[1],a=t[2],o=t[3],s=t[4],l=t[5],u=t[6],c=t[7],d=t[8],h=t[9],p=t[10],f=t[11],e[0]=r,e[1]=n,e[2]=a,e[3]=o,e[4]=s,e[5]=l,e[6]=u,e[7]=c,e[8]=d,e[9]=h,e[10]=p,e[11]=f,e[12]=r*m+s*g+d*y+t[12],e[13]=n*m+l*g+h*y+t[13],e[14]=a*m+u*g+p*y+t[14],e[15]=o*m+c*g+f*y+t[15]),e},scale:function(e,t,i){var r=i[0],n=i[1],a=i[2];return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},multiply:function(e,t,i){var r=t[0],n=t[1],a=t[2],o=t[3],s=t[4],l=t[5],u=t[6],c=t[7],d=t[8],h=t[9],p=t[10],f=t[11],m=t[12],g=t[13],y=t[14],v=t[15],_=i[0],C=i[1],x=i[2],b=i[3];return e[0]=_*r+C*s+x*d+b*m,e[1]=_*n+C*l+x*h+b*g,e[2]=_*a+C*u+x*p+b*y,e[3]=_*o+C*c+x*f+b*v,_=i[4],C=i[5],x=i[6],b=i[7],e[4]=_*r+C*s+x*d+b*m,e[5]=_*n+C*l+x*h+b*g,e[6]=_*a+C*u+x*p+b*y,e[7]=_*o+C*c+x*f+b*v,_=i[8],C=i[9],x=i[10],b=i[11],e[8]=_*r+C*s+x*d+b*m,e[9]=_*n+C*l+x*h+b*g,e[10]=_*a+C*u+x*p+b*y,e[11]=_*o+C*c+x*f+b*v,_=i[12],C=i[13],x=i[14],b=i[15],e[12]=_*r+C*s+x*d+b*m,e[13]=_*n+C*l+x*h+b*g,e[14]=_*a+C*u+x*p+b*y,e[15]=_*o+C*c+x*f+b*v,e},perspective:function(e,t,i,r,n){var a=1/Math.tan(t/2),o=1/(r-n);return e[0]=a/i,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=(n+r)*o,e[11]=-1,e[12]=0,e[13]=0,e[14]=2*n*r*o,e[15]=0,e},rotateX:function(e,t,i){var r=Math.sin(i),n=Math.cos(i),a=t[4],o=t[5],s=t[6],l=t[7],u=t[8],c=t[9],d=t[10],h=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*n+u*r,e[5]=o*n+c*r,e[6]=s*n+d*r,e[7]=l*n+h*r,e[8]=u*n-a*r,e[9]=c*n-o*r,e[10]=d*n-s*r,e[11]=h*n-l*r,e},rotateZ:function(e,t,i){var r=Math.sin(i),n=Math.cos(i),a=t[0],o=t[1],s=t[2],l=t[3],u=t[4],c=t[5],d=t[6],h=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*n+u*r,e[1]=o*n+c*r,e[2]=s*n+d*r,e[3]=l*n+h*r,e[4]=u*n-a*r,e[5]=c*n-o*r,e[6]=d*n-s*r,e[7]=h*n-l*r,e},invert:function(e,t){var i=t[0],r=t[1],n=t[2],a=t[3],o=t[4],s=t[5],l=t[6],u=t[7],c=t[8],d=t[9],h=t[10],p=t[11],f=t[12],m=t[13],g=t[14],y=t[15],v=i*s-r*o,_=i*l-n*o,C=i*u-a*o,x=r*l-n*s,b=r*u-a*s,A=n*u-a*l,S=c*m-d*f,w=c*g-h*f,E=c*y-p*f,T=d*g-h*m,P=d*y-p*m,M=h*y-p*g,D=v*M-_*P+C*T+x*E-b*w+A*S;return D?(D=1/D,e[0]=(s*M-l*P+u*T)*D,e[1]=(n*P-r*M-a*T)*D,e[2]=(m*A-g*b+y*x)*D,e[3]=(h*b-d*A-p*x)*D,e[4]=(l*E-o*M-u*w)*D,e[5]=(i*M-n*E+a*w)*D,e[6]=(g*C-f*A-y*_)*D,e[7]=(c*A-h*C+p*_)*D,e[8]=(o*P-s*E+u*S)*D,e[9]=(r*E-i*P-a*S)*D,e[10]=(f*b-m*C+y*v)*D,e[11]=(d*C-c*b-p*v)*D,e[12]=(s*w-o*T-l*S)*D,e[13]=(i*T-r*w+n*S)*D,e[14]=(m*_-f*x-g*v)*D,e[15]=(c*x-d*_+h*v)*D,e):null},ortho:function(e,t,i,r,n,a,o){var s=1/(t-i),l=1/(r-n),u=1/(a-o);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*u,e[11]=0,e[12]=(t+i)*s,e[13]=(n+r)*l,e[14]=(o+a)*u,e[15]=1,e}}})},function(e,t,i){function r(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var a,o,l=i(1),u={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},s=(o=[{key:"serialize",value:function(e,t){return l(!e.isTransferred),e._trim(),t&&(e.isTransferred=!0,t.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}}},{key:"deserialize",value:function(e){var t=Object.create(this.prototype);return t.arrayBuffer=e.arrayBuffer,t.length=e.length,t.capacity=e.arrayBuffer.byteLength/t.bytesPerElement,t._refreshViews(),t}}],r((a=c).prototype,[{key:"_trim",value:function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}},{key:"clear",value:function(){this.length=0}},{key:"resize",value:function(e){l(!this.isTransferred),this.reserve(e),this.length=e}},{key:"reserve",value:function(e){if(e>this.capacity){this.capacity=Math.max(e,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var t=this.uint8;this._refreshViews(),t&&this.uint8.set(t)}}},{key:"_refreshViews",value:function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}]),r(a,o),c);function c(){n(this,c),this.isTransferred=!1,this.capacity=-1,this.resize(0)}function d(e,t){return Math.ceil(e/t)*t}e.exports.StructArray=s,e.exports.Struct=function e(t,i){n(this,e),this._structArray=t,this._pos1=i*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},e.exports.viewTypes=u,e.exports.createLayout=function(e){var a=1<arguments.length&&void 0!==arguments[1]?arguments[1]:1,o=0,s=0;return{members:e.map(function(e){l(e.name.length);var t,i=(t=e.type,u[t].BYTES_PER_ELEMENT),r=o=d(o,Math.max(a,i)),n=e.components||1;return s=Math.max(s,i),o+=i*n,{name:e.name,type:e.type,components:n,offset:r}}),size:d(o,Math.max(s,a)),alignment:a}}},function(e,t){function i(e){return e instanceof Number||e instanceof String||e instanceof Boolean?e.valueOf():e}e.exports=i,e.exports.deep=function e(t){return Array.isArray(t)?t.map(e):i(t)}},function(e,t,i){function c(e){return(c="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})(e)}var d=i(1),h=i(12),r=i(8),p=r.NullType,f=r.NumberType,m=r.StringType,g=r.BooleanType,y=r.ColorType,v=r.ObjectType,_=r.ValueType,C=r.array;e.exports={Color:h,validateRGBA:function(e,t,i,r){return"number"==typeof e&&0<=e&&e<=255&&"number"==typeof t&&0<=t&&t<=255&&"number"==typeof i&&0<=i&&i<=255?void 0===r||"number"==typeof r&&0<=r&&r<=1?null:"Invalid rgba value [".concat([e,t,i,r].join(", "),"]: 'a' must be between 0 and 1."):"Invalid rgba value [".concat(("number"==typeof r?[e,t,i,r]:[e,t,i]).join(", "),"]: 'r', 'g', and 'b' must be between 0 and 255.")},isValue:function e(t){if(null===t)return!0;if("string"==typeof t)return!0;if("boolean"==typeof t)return!0;if("number"==typeof t)return!0;if(t instanceof h)return!0;if(Array.isArray(t)){var i=!0,r=!1,n=void 0;try{for(var a,o=t[Symbol.iterator]();!(i=(a=o.next()).done);i=!0)if(!e(a.value))return!1}catch(e){r=!0,n=e}finally{try{i||null==o.return||o.return()}finally{if(r)throw n}}return!0}if("object"!==c(t))return!1;for(var s in t)if(!e(t[s]))return!1;return!0},typeOf:function e(t){if(null===t)return p;if("string"==typeof t)return m;if("boolean"==typeof t)return g;if("number"==typeof t)return f;if(t instanceof h)return y;if(Array.isArray(t)){var i,r=t.length,n=!0,a=!1,o=void 0;try{for(var s,l=t[Symbol.iterator]();!(n=(s=l.next()).done);n=!0){var u=e(s.value);if(i){if(i===u)continue;i=_;break}i=u}}catch(e){a=!0,o=e}finally{try{n||null==l.return||l.return()}finally{if(a)throw o}}return C(i||_,r)}return d("object"===c(t)),v}}},function(e,t,i){var r=i(12);function n(e,t,i){return e*(1-i)+t*i}e.exports={number:n,color:function(e,t,i){return new r(n(e.r,t.r,i),n(e.g,t.g,i),n(e.b,t.b,i),n(e.a,t.a,i))},array:function(e,i,r){return e.map(function(e,t){return n(e,i[t],r)})}}},function(e,t,i){function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function n(e,t,i){return t&&r(e.prototype,t),i&&r(e,i),e}function o(e,t,i){a(this,o),this.wrap=e,this.canonical=t,this.key=m(e,t.z,t.x,t.y),this.posMatrix=i}var s=i(198),l=i(1),u=i(11).register,c=i(35),d=(n(f,[{key:"equals",value:function(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}},{key:"url",value:function(e,t){var i=s.getTileBBox(this.x,this.y,this.z),r=function(e,t,i){for(var r,n="",a=e;0<a;a--)n+=(t&(r=1<<a-1)?1:0)+(i&r?2:0);return n}(this.z,this.x,this.y);return e[(this.x+this.y)%e.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace("{z}",String(this.z)).replace("{x}",String(this.x)).replace("{y}",String("tms"===t?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",r).replace("{bbox-epsg-3857}",i)}}]),f),h=(n(p,[{key:"scaledTo",value:function(e){l(e<=this.overscaledZ);var t=this.canonical.z-e;return e>this.canonical.z?new p(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new p(e,this.wrap,e,this.canonical.x>>t,this.canonical.y>>t)}},{key:"isChildOf",value:function(e){var t=this.canonical.z-e.canonical.z;return 0===e.overscaledZ||e.overscaledZ<this.overscaledZ&&e.canonical.x===this.canonical.x>>t&&e.canonical.y===this.canonical.y>>t}},{key:"children",value:function(e){if(this.overscaledZ>=e)return[new p(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var t=this.canonical.z+1,i=2*this.canonical.x,r=2*this.canonical.y;return[new p(t,this.wrap,t,i,r),new p(t,this.wrap,t,1+i,r),new p(t,this.wrap,t,i,1+r),new p(t,this.wrap,t,1+i,1+r)]}},{key:"isLessThan",value:function(e){return this.wrap<e.wrap||!(this.wrap>e.wrap)&&(this.overscaledZ<e.overscaledZ||!(this.overscaledZ>e.overscaledZ)&&(this.canonical.x<e.canonical.x||!(this.canonical.x>e.canonical.x)&&this.canonical.y<e.canonical.y))}},{key:"wrapped",value:function(){return new p(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}},{key:"overscaleFactor",value:function(){return Math.pow(2,this.overscaledZ-this.canonical.z)}},{key:"toUnwrapped",value:function(){return new o(this.wrap,this.canonical,this.posMatrix)}},{key:"toString",value:function(){return"".concat(this.overscaledZ,"/").concat(this.canonical.x,"/").concat(this.canonical.y)}},{key:"toCoordinate",value:function(){return new c(this.canonical.x+Math.pow(2,this.wrap),this.canonical.y,this.canonical.z)}}]),p);function p(e,t,i,r,n){a(this,p),l(i<=e),this.overscaledZ=e,this.wrap=t,this.canonical=new d(i,+r,+n),this.key=m(t,e,r,n)}function f(e,t,i){a(this,f),l(0<=e&&e<=25),l(0<=t&&t<Math.pow(2,e)),l(0<=i&&i<Math.pow(2,e)),this.z=e,this.x=t,this.y=i,this.key=m(0,e,t,i)}function m(e,t,i,r){(e*=2)<0&&(e=-1*e-1);var n=1<<t;return 32*(n*n*e+n*r+i)+t}u("CanonicalTileID",d),u("OverscaledTileID",h,{omit:["posMatrix"]}),e.exports={CanonicalTileID:d,OverscaledTileID:h,UnwrappedTileID:o}},function(e,t,i){var r=i(6);e.exports=function(e,t,i){return t*(r/e.tileSize)}},function(e,t,l){var u=l(41),c=l(24),d=l(30).isExpression,h=l(57).isFunction;e.exports=function(e){var t=l(91),i=l(94),r=l(43),n={"*":function(){return[]},array:l(92),boolean:l(148),number:l(93),color:l(149),constants:l(75),enum:l(58),filter:l(59),function:l(91),layer:l(95),object:l(43),source:l(99),light:l(100),string:l(101)},a=e.value,o=e.valueSpec,s=e.styleSpec;return o.function&&h(c(a))?t(e):o.function&&d(c.deep(a))?i(e):o.type&&n[o.type]?n[o.type](e):r(u({},e,{valueSpec:o.type?s[o.type]:o}))}},function(e,t,i){function n(e){return(n="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})(e)}function a(e){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function l(e,t,i){return t&&s(e.prototype,t),i&&s(e,i),e}var u=i(1),c=i(41),d=i(76),h=i(77),p=i(55),f=i(42).CompoundExpression,m=i(86),g=i(56),y=i(88),v=i(89),_=i(90),C=i(84),x=i(31),b=i(146),A=b.success,S=b.error,w=(l(P,[{key:"evaluate",value:function(e,t){return this._evaluator||(this._evaluator=new p),this._evaluator.globals=e,this._evaluator.feature=t,this.expression.evaluate(this._evaluator)}}]),P),E=(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)}(T,w),l(T,[{key:"evaluate",value:function(e,t){this._evaluator||(this._evaluator=new p),this._evaluator.globals=e,this._evaluator.feature=t;try{var i=this.expression.evaluate(this._evaluator);if(null==i)return this._defaultValue;if(this._enumValues&&!(i in this._enumValues))throw new x("Expected value to be one of ".concat(Object.keys(this._enumValues).map(function(e){return JSON.stringify(e)}).join(", "),", but found ").concat(JSON.stringify(i)," instead."));return i}catch(e){return this._warningHistory[e.message]||(this._warningHistory[e.message]=!0,"undefined"!=typeof console&&console.warn(e.message)),this._defaultValue}}}]),T);function T(e,t){var i,r;return o(this,T),(i=function(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,a(T).call(this,e)))._warningHistory={},i._defaultValue="color"===(r=t).type&&B(r.default)?new V(0,0,0,0):"color"===r.type?V.parse(r.default)||null:void 0===r.default?null:r.default,"enum"===t.type&&(i._enumValues=t.values),i}function P(e){o(this,P),this.expression=e}function M(e){return Array.isArray(e)&&0<e.length&&"string"==typeof e[0]&&e[0]in _}function D(e,t){var i,r,n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{},a=new h(_,[],(r={color:$,string:H,number:W,enum:H,boolean:j},"array"===(i=t).type?Q(r[i.value]||q,i.length):r[i.type]||null)),o=a.parse(e);return o?!1===n.handleErrors?A(new w(o)):A(new E(o,t)):(u(0<a.errors.length),S(a.errors))}var I=(l(L,[{key:"evaluate",value:function(e,t){return this._styleExpression.evaluate(e,t)}}]),L),O=(l(R,[{key:"evaluate",value:function(e,t){return this._styleExpression.evaluate(e,t)}},{key:"interpolationFactor",value:function(e,t,i){return this._interpolationType?g.interpolationFactor(this._interpolationType,e,t,i):0}}]),R);function R(e,t,i){o(this,R),this.kind=e,this.zoomStops=i.labels,this._styleExpression=t,i instanceof g&&(this._interpolationType=i.interpolation)}function L(e,t){o(this,L),this.kind=e,this._styleExpression=t}function N(e,t){if("error"===(e=D(e,t,2<arguments.length&&void 0!==arguments[2]?arguments[2]:{})).result)return e;var i=e.value.expression,r=C.isFeatureConstant(i);if(!r&&!t["property-function"])return S([new d("","property expressions not supported")]);var n=C.isGlobalPropertyConstant(i,["zoom"]);if(!n&&!1===t["zoom-function"])return S([new d("","zoom expressions not supported")]);var a=function i(e){var r=null;if(e instanceof v)r=i(e.result);else if(e instanceof y){var t=!0,n=!1,a=void 0;try{for(var o,s=e.args[Symbol.iterator]();!(t=(o=s.next()).done);t=!0){var l=o.value;if(r=i(l))break}}catch(i){n=!0,a=i}finally{try{t||null==s.return||s.return()}finally{if(n)throw a}}}else(e instanceof m||e instanceof g)&&e.input instanceof f&&"zoom"===e.input.name&&(r=e);return r instanceof d||e.eachChild(function(e){var t=i(e);t instanceof d?r=t:!r&&t?r=new d("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):r&&t&&r!==t&&(r=new d("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),r}(i);return a||n?a instanceof d?S([a]):a instanceof g&&"piecewise-constant"===t.function?S([new d("",'"interpolate" expressions cannot be used with this property')]):A(a?new O(r?"camera":"composite",e.value,a):new I(r?"constant":"source",e.value)):S([new d("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}var k=i(57),B=k.isFunction,F=k.createFunction,V=i(25).Color,z=(l(U,null,[{key:"deserialize",value:function(e){return new U(e._parameters,e._specification)}},{key:"serialize",value:function(e){return{_parameters:e._parameters,_specification:e._specification}}}]),U);function U(e,t){o(this,U),this._parameters=e,this._specification=t,c(this,F(this._parameters,this._specification))}e.exports={StyleExpression:w,StyleExpressionWithErrorHandling:E,isExpression:M,createExpression:D,createPropertyExpression:N,normalizePropertyExpression:function(e,t){if(B(e))return new z(e,t);if(M(e)){var i=N(e,t);if("error"===i.result)throw new Error(i.value.map(function(e){return"".concat(e.key,": ").concat(e.message)}).join(", "));return i.value}var r=e;return"string"==typeof e&&"color"===t.type&&(r=V.parse(e)),{kind:"constant",evaluate:function(){return r}}},ZoomConstantExpression:I,ZoomDependentExpression:O,StylePropertyFunction:z};var G=i(8),$=G.ColorType,H=G.StringType,W=G.NumberType,j=G.BooleanType,q=G.ValueType,Q=G.array},function(e,t){var i=(function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(r.prototype,[{key:"toJSON",value:function(){return this.message}}]),r);function r(e){!function(e){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}(this),this.name="ExpressionEvaluationError",this.message=e}e.exports=i},function(e,t,i){function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function n(e,t,i){return t&&r(e.prototype,t),i&&r(e,i),e}var a=i(153).packUint8ToFloat,o=(i(12),i(11).register),h=i(4).PossiblyEvaluatedPropertyValue,s=i(14),l=s.StructArrayLayout1f4,u=s.StructArrayLayout2f8,d=s.StructArrayLayout4f16;function p(e){return[a(255*e.r,255*e.g),a(255*e.b,255*e.a)]}var f=(n(A,[{key:"defines",value:function(){return["#define HAS_UNIFORM_u_".concat(this.name)]}},{key:"populatePaintArray",value:function(){}},{key:"upload",value:function(){}},{key:"destroy",value:function(){}},{key:"setUniforms",value:function(e,t,i,r){var n=r.constantOr(this.value),a=e.gl;"color"===this.type?a.uniform4f(t.uniforms["u_".concat(this.name)],n.r,n.g,n.b,n.a):a.uniform1f(t.uniforms["u_".concat(this.name)],n)}}]),A),m=(n(b,[{key:"defines",value:function(){return[]}},{key:"populatePaintArray",value:function(e,t){var i=this.paintVertexArray,r=i.length;i.reserve(e);var n=this.expression.evaluate({zoom:0},t);if("color"===this.type)for(var a=p(n),o=r;o<e;o++)i.emplaceBack(a[0],a[1]);else{for(var s=r;s<e;s++)i.emplaceBack(n);this.statistics.max=Math.max(this.statistics.max,n)}}},{key:"upload",value:function(e){this.paintVertexArray&&(this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes))}},{key:"destroy",value:function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}},{key:"setUniforms",value:function(e,t){e.gl.uniform1f(t.uniforms["a_".concat(this.name,"_t")],0)}}]),b),g=(n(x,[{key:"defines",value:function(){return[]}},{key:"populatePaintArray",value:function(e,t){var i=this.paintVertexArray,r=i.length;i.reserve(e);var n=this.expression.evaluate({zoom:this.zoom},t),a=this.expression.evaluate({zoom:this.zoom+1},t);if("color"===this.type)for(var o=p(n),s=p(a),l=r;l<e;l++)i.emplaceBack(o[0],o[1],s[0],s[1]);else{for(var u=r;u<e;u++)i.emplaceBack(n,a);this.statistics.max=Math.max(this.statistics.max,n,a)}}},{key:"upload",value:function(e){this.paintVertexArray&&(this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes))}},{key:"destroy",value:function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}},{key:"interpolationFactor",value:function(e){return this.useIntegerZoom?this.expression.interpolationFactor(Math.floor(e),this.zoom,this.zoom+1):this.expression.interpolationFactor(e,this.zoom,this.zoom+1)}},{key:"setUniforms",value:function(e,t,i){e.gl.uniform1f(t.uniforms["a_".concat(this.name,"_t")],this.interpolationFactor(i.zoom))}}]),x),y=(n(C,[{key:"populatePaintArrays",value:function(e,t){for(var i in this.binders)this.binders[i].populatePaintArray(e,t)}},{key:"defines",value:function(){var e=[];for(var t in this.binders)e.push.apply(e,this.binders[t].defines());return e}},{key:"setUniforms",value:function(e,t,i,r){for(var n in this.binders)this.binders[n].setUniforms(e,t,r,i.get(n))}},{key:"getPaintVertexBuffers",value:function(){return this._buffers}},{key:"upload",value:function(e){for(var t in this.binders)this.binders[t].upload(e);var i=[];for(var r in this.binders){var n=this.binders[r];(n instanceof m||n instanceof g)&&n.paintVertexBuffer&&i.push(n.paintVertexBuffer)}this._buffers=i}},{key:"destroy",value:function(){for(var e in this.binders)this.binders[e].destroy()}}],[{key:"createDynamic",value:function(e,t,i){var r,n,a=new C,o=[];for(var s in e.paint._values)if(i(s)){var l=e.paint.get(s);if(l instanceof h&&l.property.specification["property-function"]){var u=(r=s,n=e.type,{"text-opacity":"opacity","icon-opacity":"opacity","text-color":"fill_color","icon-color":"fill_color","text-halo-color":"halo_color","icon-halo-color":"halo_color","text-halo-blur":"halo_blur","icon-halo-blur":"halo_blur","text-halo-width":"halo_width","icon-halo-width":"halo_width","line-gap-width":"gapwidth"}[r]||r.replace("".concat(n,"-"),"").replace(/-/g,"_")),c=l.property.specification.type,d=l.property.useIntegerZoom;"constant"===l.value.kind?(a.binders[s]=new f(l.value,u,c),o.push("/u_".concat(u))):"source"===l.value.kind?(a.binders[s]=new m(l.value,u,c),o.push("/a_".concat(u))):(a.binders[s]=new g(l.value,u,c,d,t),o.push("/z_".concat(u)))}}return a.cacheKey=o.sort().join(""),a}}]),C),v=(n(_,[{key:"populatePaintArrays",value:function(e,t){for(var i in this.programConfigurations)this.programConfigurations[i].populatePaintArrays(e,t)}},{key:"get",value:function(e){return this.programConfigurations[e]}},{key:"upload",value:function(e){for(var t in this.programConfigurations)this.programConfigurations[t].upload(e)}},{key:"destroy",value:function(){for(var e in this.programConfigurations)this.programConfigurations[e].destroy()}}]),_);function _(e,t,i){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:function(){return!0};c(this,_);var n=!0,a=!(this.programConfigurations={}),o=void 0;try{for(var s,l=t[Symbol.iterator]();!(n=(s=l.next()).done);n=!0){var u=s.value;this.programConfigurations[u.id]=y.createDynamic(u,i,r),this.programConfigurations[u.id].layoutAttributes=e}}catch(e){a=!0,o=e}finally{try{n||null==l.return||l.return()}finally{if(a)throw o}}}function C(){c(this,C),this.binders={},this.cacheKey="",this._buffers=[]}function x(e,t,i,r,n){c(this,x),this.expression=e,this.name=t,this.type=i,this.useIntegerZoom=r,this.zoom=n,this.statistics={max:-1/0};var a="color"===i?d:u;this.paintVertexAttributes=[{name:"a_".concat(t),type:"Float32",components:"color"===i?4:2,offset:0}],this.paintVertexArray=new a}function b(e,t,i){c(this,b),this.expression=e,this.name=t,this.type=i,this.statistics={max:-1/0};var r="color"===i?u:l;this.paintVertexAttributes=[{name:"a_".concat(t),type:"Float32",components:"color"===i?2:1,offset:0}],this.paintVertexArray=new r}function A(e,t,i){c(this,A),this.value=e,this.name=t,this.type=i,this.statistics={max:-1/0}}o("ConstantBinder",f),o("SourceExpressionBinder",m),o("CompositeExpressionBinder",g),o("ProgramConfiguration",y,{omit:["_buffers"]}),o("ProgramConfigurationSet",v),e.exports={ProgramConfiguration:y,ProgramConfigurationSet:v}},function(e,t,i){function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function a(e,t,i){return t&&n(e.prototype,t),i&&n(e,i),e}var h=i(1),o=i(11).register;function s(e,t,i,r){var n=t.width,a=t.height;if(r){if(r.length!==n*a*i)throw new RangeError("mismatched image size")}else r=new Uint8Array(n*a*i);return e.width=n,e.height=a,e.data=r,e}function l(e,t,i){var r=t.width,n=t.height;if(r!==e.width||n!==e.height){var a=s({},{width:r,height:n},i);u(e,a,{x:0,y:0},{x:0,y:0},{width:Math.min(e.width,r),height:Math.min(e.height,n)},i),e.width=r,e.height=n,e.data=a.data}}function u(e,t,i,r,n,a){if(0===n.width||0===n.height)return t;if(n.width>e.width||n.height>e.height||i.x>e.width-n.width||i.y>e.height-n.height)throw new RangeError("out of range source coordinates for image copy");if(n.width>t.width||n.height>t.height||r.x>t.width-n.width||r.y>t.height-n.height)throw new RangeError("out of range destination coordinates for image copy");var o=e.data,s=t.data;h(o!==s);for(var l=0;l<n.height;l++)for(var u=((i.y+l)*e.width+i.x)*a,c=((r.y+l)*t.width+r.x)*a,d=0;d<n.width*a;d++)s[c+d]=o[u+d];return t}var c=(a(f,[{key:"resize",value:function(e){l(this,e,1)}},{key:"clone",value:function(){return new f({width:this.width,height:this.height},new Uint8Array(this.data))}}],[{key:"copy",value:function(e,t,i,r,n){u(e,t,i,r,n,1)}}]),f),d=(a(p,[{key:"resize",value:function(e){l(this,e,4)}},{key:"clone",value:function(){return new p({width:this.width,height:this.height},new Uint8Array(this.data))}}],[{key:"copy",value:function(e,t,i,r,n){u(e,t,i,r,n,4)}}]),p);function p(e,t){r(this,p),s(this,e,4,t)}function f(e,t){r(this,f),s(this,e,1,t)}o("AlphaImage",c),o("RGBAImage",d),e.exports={AlphaImage:c,RGBAImage:d}},function(e,t,i){var o=i(64),s=i(2),r="See https://www.mapbox.com/api-documentation/#access-tokens";function a(e,t){var i=c(o.API_URL);if(e.protocol=i.protocol,e.authority=i.authority,"/"!==i.path&&(e.path="".concat(i.path).concat(e.path)),!o.REQUIRE_ACCESS_TOKEN)return d(e);if(!(t=t||o.ACCESS_TOKEN))throw new Error("An API access token is required to use Mapbox GL. ".concat(r));if("s"===t[0])throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). ".concat(r));return e.params.push("access_token=".concat(t)),d(e)}function l(e){return 0===e.indexOf("mapbox:")}t.isMapboxURL=l,t.normalizeStyleURL=function(e,t){if(!l(e))return e;var i=c(e);return i.path="/styles/v1".concat(i.path),a(i,t)},t.normalizeGlyphsURL=function(e,t){if(!l(e))return e;var i=c(e);return i.path="/fonts/v1".concat(i.path),a(i,t)},t.normalizeSourceURL=function(e,t){if(!l(e))return e;var i=c(e);return i.path="/v4/".concat(i.authority,".json"),i.params.push("secure"),a(i,t)},t.normalizeSpriteURL=function(e,t,i,r){var n=c(e);return l(e)?(n.path="/styles/v1".concat(n.path,"/sprite").concat(t).concat(i),a(n,r)):(n.path+="".concat(t).concat(i),d(n))};var u=/(\.(png|jpg)\d*)(?=$)/;t.normalizeTileURL=function(e,t,i){if(!t||!l(t))return e;var r=c(e),n=2<=s.devicePixelRatio||512===i?"@2x":"",a=s.supportsWebp?".webp":"$1";return r.path=r.path.replace(u,"".concat(n).concat(a)),function(e){for(var t=0;t<e.length;t++)0===e[t].indexOf("access_token=tk.")&&(e[t]="access_token=".concat(o.ACCESS_TOKEN||""))}(r.params),d(r)};var n=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function c(e){var t=e.match(n);if(!t)throw new Error("Unable to parse URL object");return{protocol:t[1],authority:t[2],path:t[3]||"/",params:t[4]?t[4].split("&"):[]}}function d(e){var t=e.params.length?"?".concat(e.params.join("&")):"";return"".concat(e.protocol,"://").concat(e.authority).concat(e.path).concat(t)}},function(e,t){var i=(function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(r.prototype,[{key:"clone",value:function(){return new r(this.column,this.row,this.zoom)}},{key:"zoomTo",value:function(e){return this.clone()._zoomTo(e)}},{key:"sub",value:function(e){return this.clone()._sub(e)}},{key:"_zoomTo",value:function(e){var t=Math.pow(2,e-this.zoom);return this.column*=t,this.row*=t,this.zoom=e,this}},{key:"_sub",value:function(e){return e=e.zoomTo(this.zoom),this.column-=e.column,this.row-=e.row,this}}]),r);function r(e,t,i){!function(e){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}(this),this.column=e,this.row=t,this.zoom=i}e.exports=i},function(n,e,t){var a=t(0).warnOnce,i=t(11).register,o=Math.pow(2,16)-1,r=(function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(s.prototype,[{key:"prepareSegment",value:function(e,t,i){var r=this.segments[this.segments.length-1];return o<e&&a("Max vertices per segment is ".concat(o,": bucket requested ").concat(e)),(!r||r.vertexLength+e>n.exports.MAX_VERTEX_ARRAY_LENGTH)&&(r={vertexOffset:t.length,primitiveOffset:i.length,vertexLength:0,primitiveLength:0},this.segments.push(r)),r}},{key:"get",value:function(){return this.segments}},{key:"destroy",value:function(){var e=!0,t=!1,i=void 0;try{for(var r,n=this.segments[Symbol.iterator]();!(e=(r=n.next()).done);e=!0){var a=r.value;for(var o in a.vaos)a.vaos[o].destroy()}}catch(e){t=!0,i=e}finally{try{e||null==n.return||n.return()}finally{if(t)throw i}}}}]),s);function s(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[];!function(e){if(!(e instanceof s))throw new TypeError("Cannot call a class as a function")}(this),this.segments=e}i("SegmentVector",r),n.exports={SegmentVector:r,MAX_VERTEX_ARRAY_LENGTH:o}},function(e,t,i){e.exports={LineIndexArray:i(14).LineIndexArray,TriangleIndexArray:i(14).TriangleIndexArray}},function(e,t,i){var s=i(0),l=i(6),u=(16,{min:-1*Math.pow(2,15),max:Math.pow(2,15)-1});e.exports=function(e){for(var t=l/e.extent,i=e.loadGeometry(),r=0;r<i.length;r++)for(var n=i[r],a=0;a<n.length;a++){var o=n[a];o.x=Math.round(o.x*t),o.y=Math.round(o.y*t),(o.x<u.min||o.x>u.max||o.y<u.min||o.y>u.max)&&s.warnOnce("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return i}},function(e,t,i){function r(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var n,a,o=i(21),s=(a=[{key:"convert",value:function(e){return!e||e instanceof l?e:new l(e)}}],r((n=l).prototype,[{key:"setNorthEast",value:function(e){return this._ne=e instanceof o?new o(e.lng,e.lat):o.convert(e),this}},{key:"setSouthWest",value:function(e){return this._sw=e instanceof o?new o(e.lng,e.lat):o.convert(e),this}},{key:"extend",value:function(e){var t,i,r=this._sw,n=this._ne;if(e instanceof o)i=t=e;else{if(!(e instanceof l))return Array.isArray(e)?e.every(Array.isArray)?this.extend(l.convert(e)):this.extend(o.convert(e)):this;if(t=e._sw,i=e._ne,!t||!i)return this}return r||n?(r.lng=Math.min(t.lng,r.lng),r.lat=Math.min(t.lat,r.lat),n.lng=Math.max(i.lng,n.lng),n.lat=Math.max(i.lat,n.lat)):(this._sw=new o(t.lng,t.lat),this._ne=new o(i.lng,i.lat)),this}},{key:"getCenter",value:function(){return new o((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}},{key:"getSouthWest",value:function(){return this._sw}},{key:"getNorthEast",value:function(){return this._ne}},{key:"getNorthWest",value:function(){return new o(this.getWest(),this.getNorth())}},{key:"getSouthEast",value:function(){return new o(this.getEast(),this.getSouth())}},{key:"getWest",value:function(){return this._sw.lng}},{key:"getSouth",value:function(){return this._sw.lat}},{key:"getEast",value:function(){return this._ne.lng}},{key:"getNorth",value:function(){return this._ne.lat}},{key:"toArray",value:function(){return[this._sw.toArray(),this._ne.toArray()]}},{key:"toString",value:function(){return"LngLatBounds(".concat(this._sw.toString(),", ").concat(this._ne.toString(),")")}},{key:"isEmpty",value:function(){return!(this._sw&&this._ne)}}]),r(n,a),l);function l(e,t){!function(e){if(!(e instanceof l))throw new TypeError("Cannot call a class as a function")}(this),e&&(t?this.setSouthWest(e).setNorthEast(t):4===e.length?this.setSouthWest([e[0],e[1]]).setNorthEast([e[2],e[3]]):this.setSouthWest(e[0]).setNorthEast(e[1]))}e.exports=s},function(e,t,i){var A=i(1),r=(function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(n.prototype,[{key:"bind",value:function(e,t,i,r,n,a,o,s){this.context=e;for(var l=this.boundPaintVertexBuffers.length!==r.length,u=0;!l&&u<r.length;u++)this.boundPaintVertexBuffers[u]!==r[u]&&(l=!0);var c=!this.vao||this.boundProgram!==t||this.boundLayoutVertexBuffer!==i||l||this.boundIndexBuffer!==n||this.boundVertexOffset!==a||this.boundDynamicVertexBuffer!==o||this.boundDynamicVertexBuffer2!==s;!e.extVertexArrayObject||c?this.freshBind(t,i,r,n,a,o,s):(e.bindVertexArrayOES.set(this.vao),o&&o.bind(),n&&n.dynamicDraw&&n.bind(),s&&s.bind())}},{key:"freshBind",value:function(e,t,i,r,n,a,o){var s,l=e.numAttributes,u=this.context,c=u.gl;if(u.extVertexArrayObject)this.vao&&this.destroy(),this.vao=u.extVertexArrayObject.createVertexArrayOES(),u.bindVertexArrayOES.set(this.vao),s=0,this.boundProgram=e,this.boundLayoutVertexBuffer=t,this.boundPaintVertexBuffers=i,this.boundIndexBuffer=r,this.boundVertexOffset=n,this.boundDynamicVertexBuffer=a,this.boundDynamicVertexBuffer2=o;else{s=u.currentNumAttributes||0;for(var d=l;d<s;d++)A(0!==d),c.disableVertexAttribArray(d)}t.enableAttributes(c,e);var h=!0,p=!1,f=void 0;try{for(var m,g=i[Symbol.iterator]();!(h=(m=g.next()).done);h=!0)m.value.enableAttributes(c,e)}catch(e){p=!0,f=e}finally{try{h||null==g.return||g.return()}finally{if(p)throw f}}a&&a.enableAttributes(c,e),o&&o.enableAttributes(c,e),t.bind(),t.setVertexAttribPointers(c,e,n);var y=!0,v=!1,_=void 0;try{for(var C,x=i[Symbol.iterator]();!(y=(C=x.next()).done);y=!0){var b=C.value;b.bind(),b.setVertexAttribPointers(c,e,n)}}catch(e){v=!0,_=e}finally{try{y||null==x.return||x.return()}finally{if(v)throw _}}a&&(a.bind(),a.setVertexAttribPointers(c,e,n)),r&&r.bind(),o&&(o.bind(),o.setVertexAttribPointers(c,e,n)),u.currentNumAttributes=l}},{key:"destroy",value:function(){this.vao&&(this.context.extVertexArrayObject.deleteVertexArrayOES(this.vao),this.vao=null)}}]),n);function n(){!function(e){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}(this),this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}e.exports=r},function(e,t){e.exports=function(e){for(var t=arguments.length,i=new Array(1<t?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];for(var n=0,a=i;n<a.length;n++){var o=a[n];for(var s in o)e[s]=o[s]}return e}},function(e,t,i){function T(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var i=[],r=!0,n=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(r=(o=s.next()).done)&&(i.push(o.value),!t||i.length!==t);r=!0);}catch(e){n=!0,a=e}finally{try{r||null==s.return||s.return()}finally{if(n)throw a}}return i}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function r(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var n,a,P=i(8).toString,M=i(77),D=(i(55),i(1)),o=(a=[{key:"parse",value:function(i,e){var t=i[0],r=I.definitions[t];if(!r)return e.error('Unknown expression "'.concat(t,'". If you wanted a literal array, use ["literal", [...]].'),0);for(var n=Array.isArray(r)?r[0]:r.type,a=Array.isArray(r)?[[r[1],r[2]]]:r.overloads,o=a.filter(function(e){var t=T(e,1)[0];return!Array.isArray(t)||t.length===i.length-1}),s=[],l=1;l<i.length;l++){var u=i[l],c=void 0;if(1===o.length){var d=o[0][0];c=Array.isArray(d)?d[l-1]:d.type}var h=e.parse(u,1+s.length,c);if(!h)return null;s.push(h)}var p=null,f=!0,m=!1,g=void 0;try{for(var y,v=o[Symbol.iterator]();!(f=(y=v.next()).done);f=!0){var _=T(y.value,2),C=_[0],x=_[1];if(p=new M(e.registry,e.path,null,e.scope),Array.isArray(C)&&C.length!==s.length)p.error("Expected ".concat(C.length," arguments, but found ").concat(s.length," instead."));else{for(var b=0;b<s.length;b++){var A=Array.isArray(C)?C[b]:C.type,S=s[b];p.concat(b+1).checkSubtype(A,S.type)}if(0===p.errors.length)return new I(t,n,x,s)}}}catch(e){m=!0,g=e}finally{try{f||null==v.return||v.return()}finally{if(m)throw g}}if(D(!p||0<p.errors.length),1===o.length)e.errors.push.apply(e.errors,p.errors);else{var w=(o.length?o:a).map(function(e){var t;return t=T(e,1)[0],Array.isArray(t)?"(".concat(t.map(P).join(", "),")"):"(".concat(P(t.type),"...)")}).join(" | "),E=s.map(function(e){return P(e.type)}).join(", ");e.error("Expected arguments of type ".concat(w,", but found (").concat(E,") instead."))}return null}},{key:"register",value:function(e,t){for(var i in D(!I.definitions),I.definitions=t)e[i]=I}}],r((n=I).prototype,[{key:"evaluate",value:function(e){return this._evaluate(e,this.args)}},{key:"eachChild",value:function(e){this.args.forEach(e)}},{key:"possibleOutputs",value:function(){return[void 0]}}]),r(n,a),I);function I(e,t,i,r){!function(e){if(!(e instanceof I))throw new TypeError("Cannot call a class as a function")}(this),this.name=e,this.type=t,this._evaluate=i,this.args=r}e.exports={CompoundExpression:o,varargs:function(e){return{type:e}}}},function(e,t,i){var f=i(7),m=i(17),g=i(29);e.exports=function(e){var t=e.key,i=e.value,r=e.valueSpec||{},n=e.objectElementValidators||{},a=e.style,o=e.styleSpec,s=[],l=m(i);if("object"!==l)return[new f(t,i,"object expected, ".concat(l," found"))];for(var u in i){var c=u.split(".")[0],d=r[c]||r["*"],h=void 0;if(n[c])h=n[c];else if(r[c])h=g;else if(n["*"])h=n["*"];else{if(!r["*"]){s.push(new f(t,i[u],'unknown property "'.concat(u,'"')));continue}h=g}s=s.concat(h({key:(t?"".concat(t,"."):t)+u,value:i[u],valueSpec:d,style:a,styleSpec:o,object:i,objectKey:u},i))}for(var p in r)n[p]||r[p].required&&void 0===r[p].default&&void 0===i[p]&&s.push(new f(t,i,'missing required property "'.concat(p,'"')));return s}},function(e,t,i){var c=i(0).isCounterClockwise;function l(e,t,i){if(1<e.length){if(u(e,t))return!0;for(var r=0;r<t.length;r++)if(d(t[r],e,i))return!0}for(var n=0;n<e.length;n++)if(d(e[n],t,i))return!0;return!1}function u(e,t){if(0===e.length||0===t.length)return!1;for(var i=0;i<e.length-1;i++)for(var r=e[i],n=e[i+1],a=0;a<t.length-1;a++)if(o=r,s=n,l=t[a],u=t[a+1],c(o,l,u)!==c(s,l,u)&&c(o,s,l)!==c(o,s,u))return!0;var o,s,l,u;return!1}function d(e,t,i){var r=i*i;if(1===t.length)return e.distSqr(t[0])<r;for(var n=1;n<t.length;n++)if(a(e,t[n-1],t[n])<r)return!0;return!1}function a(e,t,i){var r=t.distSqr(i);if(0===r)return e.distSqr(t);var n=((e.x-t.x)*(i.x-t.x)+(e.y-t.y)*(i.y-t.y))/r;return n<0?e.distSqr(t):1<n?e.distSqr(i):e.distSqr(i.sub(t)._mult(n)._add(t))}function h(e,t){for(var i,r,n,a=!1,o=0;o<e.length;o++)for(var s=0,l=(i=e[o]).length-1;s<i.length;l=s++)r=i[s],n=i[l],r.y>t.y!=n.y>t.y&&t.x<(n.x-r.x)*(t.y-r.y)/(n.y-r.y)+r.x&&(a=!a);return a}function p(e,t){for(var i=!1,r=0,n=e.length-1;r<e.length;n=r++){var a=e[r],o=e[n];a.y>t.y!=o.y>t.y&&t.x<(o.x-a.x)*(t.y-a.y)/(o.y-a.y)+a.x&&(i=!i)}return i}e.exports={multiPolygonIntersectsBufferedMultiPoint:function(e,t,i){for(var r=0;r<e.length;r++)for(var n=e[r],a=0;a<t.length;a++)for(var o=t[a],s=0;s<o.length;s++){var l=o[s];if(p(n,l))return!0;if(d(l,n,i))return!0}return!1},multiPolygonIntersectsMultiPolygon:function(e,t){if(1===e.length&&1===e[0].length)return h(t,e[0][0]);for(var i=0;i<t.length;i++)for(var r=t[i],n=0;n<r.length;n++)if(h(e,r[n]))return!0;for(var a=0;a<e.length;a++){for(var o=e[a],s=0;s<o.length;s++)if(h(t,o[s]))return!0;for(var l=0;l<t.length;l++)if(u(o,t[l]))return!0}return!1},multiPolygonIntersectsBufferedMultiLine:function(e,t,i){for(var r=0;r<t.length;r++)for(var n=t[r],a=0;a<e.length;a++){var o=e[a];if(3<=o.length)for(var s=0;s<n.length;s++)if(p(o,n[s]))return!0;if(l(o,n,i))return!0}return!1},polygonIntersectsPolygon:function(e,t){for(var i=0;i<e.length;i++)if(p(t,e[i]))return!0;for(var r=0;r<t.length;r++)if(p(e,t[r]))return!0;return!!u(e,t)},distToSegmentSquared:a}},function(e,t,i){var a=i(0),o={vector:i(196),raster:i(114),"raster-dem":i(197),geojson:i(115),video:i(199),image:i(52),canvas:i(200)};t.create=function(e,t,i,r){var n=new o[t.type](e,t,i,r);if(n.id!==e)throw new Error("Expected Source id to be ".concat(e," instead of ").concat(n.id));return a.bindAll(["load","abort","unload","serialize","prepare"],n),n},t.getType=function(e){return o[e]},t.setType=function(e,t){o[e]=t}},function(e,t,i){var r=i(23).createLayout;e.exports=r([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}])},function(e,t,i){var d=i(3);e.exports={getMaximumPaintValue:function(e,t,i){var r=t.paint.get(e).value;return"constant"===r.kind?r.value:i.programConfigurations.get(t.id).binders[e].statistics.max},translateDistance:function(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])},translate:function(e,t,i,r,n){if(!t[0]&&!t[1])return e;var a=d.convert(t);"viewport"===i&&a._rotate(-r);for(var o=[],s=0;s<e.length;s++){for(var l=e[s],u=[],c=0;c<l.length;c++)u.push(l[c].sub(a._mult(n)));o.push(u)}return o}}},function(e,t,i){e.exports.VectorTile=i(172),e.exports.VectorTileFeature=i(107),e.exports.VectorTileLayer=i(106)},function(r,e,t){var n=t(16),i=t(10),a=t(5),o=!1,s=null;r.exports.evented=new i,r.exports.registerForPluginAvailability=function(e){return s?e({pluginBlobURL:s,errorCallback:r.exports.errorCallback}):r.exports.evented.once("pluginAvailable",e),e},r.exports.createBlobURL=function(e){return a.URL.createObjectURL(new a.Blob([e.data],{type:"text/javascript"}))},r.exports.clearRTLTextPlugin=function(){o=!1,s=null},r.exports.setRTLTextPlugin=function(e,i){if(o)throw new Error("setRTLTextPlugin cannot be called multiple times.");o=!0,r.exports.errorCallback=i,n.getArrayBuffer({url:e},function(e,t){e?i(e):t&&(s=r.exports.createBlobURL(t),r.exports.evented.fire("pluginAvailable",{pluginBlobURL:s,errorCallback:i}))})},r.exports.applyArabicShaping=null,r.exports.processBidirectionalText=null},function(e,t,i){var d=i(30).normalizePropertyExpression,n=i(26),h=i(0);e.exports={getSizeData:function(e,t){var i=t.expression;if("constant"===i.kind)return{functionType:"constant",layoutSize:i.evaluate({zoom:e+1})};if("source"===i.kind)return{functionType:"source"};for(var r=i.zoomStops,n=0;n<r.length&&r[n]<=e;)n++;for(var a=n=Math.max(0,n-1);a<r.length&&r[a]<e+1;)a++;a=Math.min(r.length-1,a);var o={min:r[n],max:r[a]};return"composite"===i.kind?{functionType:"composite",zoomRange:o,propertyValue:t.value}:{functionType:"camera",layoutSize:i.evaluate({zoom:e+1}),zoomRange:o,sizeRange:{min:i.evaluate({zoom:o.min}),max:i.evaluate({zoom:o.max})},propertyValue:t.value}},evaluateSizeForFeature:function(e,t,i){var r=t;return"source"===e.functionType?i.lowerSize/10:"composite"===e.functionType?n.number(i.lowerSize/10,i.upperSize/10,r.uSizeT):r.uSize},evaluateSizeForZoom:function(e,t,i){if("constant"===e.functionType)return{uSizeT:0,uSize:e.layoutSize};if("source"===e.functionType)return{uSizeT:0,uSize:0};if("camera"===e.functionType){var r=e.propertyValue,n=e.zoomRange,a=e.sizeRange,o=d(r,i.specification),s=h.clamp(o.interpolationFactor(t,n.min,n.max),0,1);return{uSizeT:0,uSize:a.min+s*(a.max-a.min)}}var l=e.propertyValue,u=e.zoomRange,c=d(l,i.specification);return{uSizeT:h.clamp(c.interpolationFactor(t,u.min,u.max),0,1),uSize:0}}}},function(e,t,i){var r=i(13),n=i(4),a=n.Properties,o=n.DataConstantProperty,s=n.DataDrivenProperty,l=(n.CrossFadedProperty,n.HeatmapColorProperty,new a({"symbol-placement":new o(r.layout_symbol["symbol-placement"]),"symbol-spacing":new o(r.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new o(r.layout_symbol["symbol-avoid-edges"]),"icon-allow-overlap":new o(r.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new o(r.layout_symbol["icon-ignore-placement"]),"icon-optional":new o(r.layout_symbol["icon-optional"]),"icon-rotation-alignment":new o(r.layout_symbol["icon-rotation-alignment"]),"icon-size":new s(r.layout_symbol["icon-size"]),"icon-text-fit":new o(r.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new o(r.layout_symbol["icon-text-fit-padding"]),"icon-image":new s(r.layout_symbol["icon-image"]),"icon-rotate":new s(r.layout_symbol["icon-rotate"]),"icon-padding":new o(r.layout_symbol["icon-padding"]),"icon-keep-upright":new o(r.layout_symbol["icon-keep-upright"]),"icon-offset":new s(r.layout_symbol["icon-offset"]),"icon-anchor":new s(r.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new o(r.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new o(r.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new o(r.layout_symbol["text-rotation-alignment"]),"text-field":new s(r.layout_symbol["text-field"]),"text-font":new s(r.layout_symbol["text-font"]),"text-size":new s(r.layout_symbol["text-size"]),"text-max-width":new s(r.layout_symbol["text-max-width"]),"text-line-height":new o(r.layout_symbol["text-line-height"]),"text-letter-spacing":new s(r.layout_symbol["text-letter-spacing"]),"text-justify":new s(r.layout_symbol["text-justify"]),"text-anchor":new s(r.layout_symbol["text-anchor"]),"text-max-angle":new o(r.layout_symbol["text-max-angle"]),"text-rotate":new s(r.layout_symbol["text-rotate"]),"text-padding":new o(r.layout_symbol["text-padding"]),"text-keep-upright":new o(r.layout_symbol["text-keep-upright"]),"text-transform":new s(r.layout_symbol["text-transform"]),"text-offset":new s(r.layout_symbol["text-offset"]),"text-allow-overlap":new o(r.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new o(r.layout_symbol["text-ignore-placement"]),"text-optional":new o(r.layout_symbol["text-optional"])})),u=new a({"icon-opacity":new s(r.paint_symbol["icon-opacity"]),"icon-color":new s(r.paint_symbol["icon-color"]),"icon-halo-color":new s(r.paint_symbol["icon-halo-color"]),"icon-halo-width":new s(r.paint_symbol["icon-halo-width"]),"icon-halo-blur":new s(r.paint_symbol["icon-halo-blur"]),"icon-translate":new o(r.paint_symbol["icon-translate"]),"icon-translate-anchor":new o(r.paint_symbol["icon-translate-anchor"]),"text-opacity":new s(r.paint_symbol["text-opacity"]),"text-color":new s(r.paint_symbol["text-color"]),"text-halo-color":new s(r.paint_symbol["text-halo-color"]),"text-halo-width":new s(r.paint_symbol["text-halo-width"]),"text-halo-blur":new s(r.paint_symbol["text-halo-blur"]),"text-translate":new o(r.paint_symbol["text-translate"]),"text-translate-anchor":new o(r.paint_symbol["text-translate-anchor"])});e.exports={paint:u,layout:l}},function(e,t,i){function a(e){return(a="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})(e)}function o(e){return(o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var s=i(0),l=i(27).CanonicalTileID,u=i(21),c=i(3),n=i(10),d=i(16),h=i(2),p=i(6),f=i(14).RasterBoundsArray,m=i(46),g=i(40),y=i(20),v=(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)}(_,n),function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(_.prototype,[{key:"load",value:function(){var i=this;this.fire("dataloading",{dataType:"source"}),this.url=this.options.url,d.getImage(this.map._transformRequest(this.url,d.ResourceType.Image),function(e,t){e?i.fire("error",{error:e}):t&&(i.image=h.getImageData(t),i._finishLoading())})}},{key:"_finishLoading",value:function(){this.map&&(this.setCoordinates(this.coordinates),this.fire("data",{dataType:"source",sourceDataType:"metadata"}))}},{key:"onAdd",value:function(e){this.map=e,this.load()}},{key:"setCoordinates",value:function(e){this.coordinates=e;var t=this.map,i=e.map(function(e){return t.transform.locationCoordinate(u.convert(e)).zoomTo(0)}),r=this.centerCoord=s.getCoordinatesCenter(i);r.column=Math.floor(r.column),r.row=Math.floor(r.row),this.tileID=new l(r.zoom,r.column,r.row),this.minzoom=this.maxzoom=r.zoom;var n=i.map(function(e){var t=e.zoomTo(r.zoom);return new c(Math.round((t.column-r.column)*p),Math.round((t.row-r.row)*p))});return this._boundsArray=new f,this._boundsArray.emplaceBack(n[0].x,n[0].y,0,0),this._boundsArray.emplaceBack(n[1].x,n[1].y,p,0),this._boundsArray.emplaceBack(n[3].x,n[3].y,0,p),this._boundsArray.emplaceBack(n[2].x,n[2].y,p,p),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire("data",{dataType:"source",sourceDataType:"content"}),this}},{key:"prepare",value:function(){if(0!==Object.keys(this.tiles).length&&this.image){var e=this.map.painter.context,t=e.gl;for(var i in this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,m.members)),this.boundsVAO||(this.boundsVAO=new g),this.texture||(this.texture=new y(e,this.image,t.RGBA),this.texture.bind(t.LINEAR,t.CLAMP_TO_EDGE)),this.tiles){var r=this.tiles[i];"loaded"!==r.state&&(r.state="loaded",r.texture=this.texture)}}}},{key:"loadTile",value:function(e,t){this.tileID&&this.tileID.equals(e.tileID.canonical)?(this.tiles[String(e.tileID.wrap)]=e).buckets={}:e.state="errored",t(null)}},{key:"serialize",value:function(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}},{key:"hasTransition",value:function(){return!1}}]),_);function _(e,t,i,r){var n;return function(e){if(!(e instanceof _))throw new TypeError("Cannot call a class as a function")}(this),(n=function(e,t){return!t||"object"!==a(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,o(_).call(this))).id=e,n.dispatcher=i,n.coordinates=t.coordinates,n.type="image",n.minzoom=0,n.maxzoom=22,n.tileSize=512,n.tiles={},n.setEventedParent(r),n.options=t,n}e.exports=v},function(e,t,i){function s(e){return(s="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})(e)}function o(e){return(o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function l(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var f=i(1),n=i(10),d=i(19),h=i(184),u=i(185),c=i(187),p=i(192),m=i(193),g=i(0),a=i(16),y=i(34),S=i(2),v=i(194),_=i(54),C=i(45).getType,x=i(45).setType,b=i(116),A=i(117),w=(i(115),i(13)),E=i(209),T=i(214),P=i(216),M=i(49),D=i(217),I=i(108),O=i(123),R=g.pick(P.operations,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData"]),L=g.pick(P.operations,["setCenter","setZoom","setBearing","setPitch"]),N=(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)}(k,n),function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(k.prototype,[{key:"loadURL",value:function(e){var i=this,t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};this.fire("dataloading",{dataType:"style"});var r="boolean"==typeof t.validate?t.validate:!y.isMapboxURL(e);e=y.normalizeStyleURL(e,t.accessToken);var n=this.map._transformRequest(e,a.ResourceType.Style);a.getJSON(n,function(e,t){e?i.fire("error",{error:e}):t&&i._load(t,r)})}},{key:"loadJSON",value:function(e){var t=this,i=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};this.fire("dataloading",{dataType:"style"}),S.frame(function(){t._load(e,!1!==i.validate)})}},{key:"_load",value:function(e,t){var r=this;if(!t||!_.emitErrors(this,_(e))){for(var i in this._loaded=!0,(this.stylesheet=e).sources)this.addSource(i,e.sources[i],{validate:!1});e.sprite?h(e.sprite,this.map._transformRequest,function(e,t){if(e)r.fire("error",e);else if(t)for(var i in t)r.imageManager.addImage(i,t[i]);r.imageManager.setLoaded(!0),r.fire("data",{dataType:"style"})}):this.imageManager.setLoaded(!0),this.glyphManager.setURL(e.glyphs);var n=T(this.stylesheet.layers);this._order=n.map(function(e){return e.id});var a=!0,o=!(this._layers={}),s=void 0;try{for(var l,u=n[Symbol.iterator]();!(a=(l=u.next()).done);a=!0){var c=l.value;(c=d.create(c)).setEventedParent(this,{layer:{id:c.id}}),this._layers[c.id]=c}}catch(e){o=!0,s=e}finally{try{a||null==u.return||u.return()}finally{if(o)throw s}}this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new p(this.stylesheet.light),this.fire("data",{dataType:"style"}),this.fire("style.load")}}},{key:"_validateLayer",value:function(e){var t=this.sourceCaches[e.source];if(t){var i=e.sourceLayer;if(i){var r=t.getSource();("geojson"===r.type||r.vectorLayerIds&&-1===r.vectorLayerIds.indexOf(i))&&this.fire("error",{error:new Error('Source layer "'.concat(i,'" ')+'does not exist on source "'.concat(r.id,'" ')+'as specified by style layer "'.concat(e.id,'"'))})}}}},{key:"loaded",value:function(){if(!this._loaded)return!1;if(Object.keys(this._updatedSources).length)return!1;for(var e in this.sourceCaches)if(!this.sourceCaches[e].loaded())return!1;return!!this.imageManager.isLoaded()}},{key:"_serializeLayers",value:function(e){var t=this;return e.map(function(e){return t._layers[e].serialize()})}},{key:"hasTransitions",value:function(){if(this.light&&this.light.hasTransition())return!0;for(var e in this.sourceCaches)if(this.sourceCaches[e].hasTransition())return!0;for(var t in this._layers)if(this._layers[t].hasTransition())return!0;return!1}},{key:"_checkLoaded",value:function(){if(!this._loaded)throw new Error("Style is not done loading")}},{key:"update",value:function(e){if(this._loaded){if(this._changed){var t=Object.keys(this._updatedLayers),i=Object.keys(this._removedLayers);for(var r in(t.length||i.length)&&this._updateWorkerLayers(t,i),this._updatedSources){var n=this._updatedSources[r];f("reload"===n||"clear"===n),"reload"===n?this._reloadSource(r):"clear"===n&&this._clearSource(r)}for(var a in this._updatedPaintProps)this._layers[a].updateTransitions(e);this.light.updateTransitions(e),this._resetUpdates(),this.fire("data",{dataType:"style"})}for(var o in this.sourceCaches)this.sourceCaches[o].used=!1;var s=!0,l=!1,u=void 0;try{for(var c,d=this._order[Symbol.iterator]();!(s=(c=d.next()).done);s=!0){var h=c.value,p=this._layers[h];p.recalculate(e),!p.isHidden(e.zoom)&&p.source&&(this.sourceCaches[p.source].used=!0)}}catch(e){l=!0,u=e}finally{try{s||null==d.return||d.return()}finally{if(l)throw u}}this.light.recalculate(e),this.z=e.zoom}}},{key:"_updateWorkerLayers",value:function(e,t){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(e),removedIds:t})}},{key:"_resetUpdates",value:function(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={}}},{key:"setState",value:function(e){var t=this;if(this._checkLoaded(),_.emitErrors(this,_(e)))return!1;(e=g.clone(e)).layers=T(e.layers);var i=P(this.serialize(),e).filter(function(e){return!(e.command in L)});if(0===i.length)return!1;var r=i.filter(function(e){return!(e.command in R)});if(0<r.length)throw new Error("Unimplemented: ".concat(r.map(function(e){return e.command}).join(", "),"."));return i.forEach(function(e){"setTransition"!==e.command&&t[e.command].apply(t,e.args)}),this.stylesheet=e,!0}},{key:"addImage",value:function(e,t){if(this.getImage(e))return this.fire("error",{error:new Error("An image with this name already exists.")});this.imageManager.addImage(e,t),this.fire("data",{dataType:"style"})}},{key:"getImage",value:function(e){return this.imageManager.getImage(e)}},{key:"removeImage",value:function(e){if(!this.getImage(e))return this.fire("error",{error:new Error("No image with this name exists.")});this.imageManager.removeImage(e),this.fire("data",{dataType:"style"})}},{key:"addSource",value:function(e,t,i){var r=this;if(this._checkLoaded(),void 0!==this.sourceCaches[e])throw new Error("There is already a source with this ID");if(!t.type)throw new Error("The type property must be defined, but the only the following properties were given: ".concat(Object.keys(t).join(", "),"."));if(!(0<=["vector","raster","geojson","video","image","canvas"].indexOf(t.type)&&this._validate(_.source,"sources.".concat(e),t,null,i))){var n=this.sourceCaches[e]=new A(e,t,this.dispatcher);n.style=this,n.setEventedParent(this,function(){return{isSourceLoaded:r.loaded(),source:n.serialize(),sourceId:e}}),n.onAdd(this.map),this._changed=!0}}},{key:"removeSource",value:function(e){if(this._checkLoaded(),void 0===this.sourceCaches[e])throw new Error("There is no source with this ID");for(var t in this._layers)if(this._layers[t].source===e)return this.fire("error",{error:new Error('Source "'.concat(e,'" cannot be removed while layer "').concat(t,'" is using it.'))});var i=this.sourceCaches[e];delete this.sourceCaches[e],delete this._updatedSources[e],i.fire("data",{sourceDataType:"metadata",dataType:"source",sourceId:e}),i.setEventedParent(null),i.clearTiles(),i.onRemove&&i.onRemove(this.map),this._changed=!0}},{key:"setGeoJSONSourceData",value:function(e,t){this._checkLoaded(),f(void 0!==this.sourceCaches[e],"There is no source with this ID");var i=this.sourceCaches[e].getSource();f("geojson"===i.type),i.setData(t),this._changed=!0}},{key:"getSource",value:function(e){return this.sourceCaches[e]&&this.sourceCaches[e].getSource()}},{key:"addLayer",value:function(e,t,i){this._checkLoaded();var r=e.id;if("object"===s(e.source)&&(this.addSource(r,e.source),e=g.clone(e),e=g.extend(e,{source:r})),!this._validate(_.layer,"layers.".concat(r),e,{arrayIndex:-1},i)){var n=d.create(e);this._validateLayer(n),n.setEventedParent(this,{layer:{id:r}});var a=t?this._order.indexOf(t):this._order.length;if(t&&-1===a)this.fire("error",{error:new Error('Layer with id "'.concat(t,'" does not exist on this map.'))});else{if(this._order.splice(a,0,r),this._layerOrderChanged=!0,this._layers[r]=n,this._removedLayers[r]&&n.source){var o=this._removedLayers[r];delete this._removedLayers[r],o.type!==n.type?this._updatedSources[n.source]="clear":(this._updatedSources[n.source]="reload",this.sourceCaches[n.source].pause())}this._updateLayer(n)}}}},{key:"moveLayer",value:function(e,t){if(this._checkLoaded(),this._changed=!0,this._layers[e]){var i=this._order.indexOf(e);this._order.splice(i,1);var r=t?this._order.indexOf(t):this._order.length;t&&-1===r?this.fire("error",{error:new Error('Layer with id "'.concat(t,'" does not exist on this map.'))}):(this._order.splice(r,0,e),this._layerOrderChanged=!0)}else this.fire("error",{error:new Error("The layer '".concat(e,"' does not exist in ")+"the map's style and cannot be moved.")})}},{key:"removeLayer",value:function(e){this._checkLoaded();var t=this._layers[e];if(t){t.setEventedParent(null);var i=this._order.indexOf(e);this._order.splice(i,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[e]=t,delete this._layers[e],delete this._updatedLayers[e],delete this._updatedPaintProps[e]}else this.fire("error",{error:new Error("The layer '".concat(e,"' does not exist in ")+"the map's style and cannot be removed.")})}},{key:"getLayer",value:function(e){return this._layers[e]}},{key:"setLayerZoomRange",value:function(e,t,i){this._checkLoaded();var r=this.getLayer(e);r?r.minzoom===t&&r.maxzoom===i||(null!=t&&(r.minzoom=t),null!=i&&(r.maxzoom=i),this._updateLayer(r)):this.fire("error",{error:new Error("The layer '".concat(e,"' does not exist in ")+"the map's style and cannot have zoom extent.")})}},{key:"setFilter",value:function(e,t){this._checkLoaded();var i=this.getLayer(e);if(i){if(!g.deepEqual(i.filter,t))return null==t?(i.filter=void 0,void this._updateLayer(i)):void(this._validate(_.filter,"layers.".concat(i.id,".filter"),t)||(i.filter=g.clone(t),this._updateLayer(i)))}else this.fire("error",{error:new Error("The layer '".concat(e,"' does not exist in ")+"the map's style and cannot be filtered.")})}},{key:"getFilter",value:function(e){return g.clone(this.getLayer(e).filter)}},{key:"setLayoutProperty",value:function(e,t,i){this._checkLoaded();var r=this.getLayer(e);r?g.deepEqual(r.getLayoutProperty(t),i)||(r.setLayoutProperty(t,i),this._updateLayer(r)):this.fire("error",{error:new Error("The layer '".concat(e,"' does not exist in ")+"the map's style and cannot be styled.")})}},{key:"getLayoutProperty",value:function(e,t){return this.getLayer(e).getLayoutProperty(t)}},{key:"setPaintProperty",value:function(e,t,i){this._checkLoaded();var r=this.getLayer(e);if(r){if(!g.deepEqual(r.getPaintProperty(t),i)){var n=r._transitionablePaint._values[t].value.isDataDriven();r.setPaintProperty(t,i),(r._transitionablePaint._values[t].value.isDataDriven()||n)&&this._updateLayer(r),this._changed=!0,this._updatedPaintProps[e]=!0}}else this.fire("error",{error:new Error("The layer '".concat(e,"' does not exist in ")+"the map's style and cannot be styled.")})}},{key:"getPaintProperty",value:function(e,t){return this.getLayer(e).getPaintProperty(t)}},{key:"getTransition",value:function(){return g.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}},{key:"serialize",value:function(){var t=this;return g.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:g.mapObject(this.sourceCaches,function(e){return e.serialize()}),layers:this._order.map(function(e){return t._layers[e].serialize()})},function(e){return void 0!==e})}},{key:"_updateLayer",value:function(e){this._updatedLayers[e.id]=!0,e.source&&!this._updatedSources[e.source]&&(this._updatedSources[e.source]="reload",this.sourceCaches[e.source].pause()),this._changed=!0}},{key:"_flattenRenderedFeatures",value:function(e){for(var t=[],i=this._order.length-1;0<=i;i--){var r=this._order[i],n=!0,a=!1,o=void 0;try{for(var s,l=e[Symbol.iterator]();!(n=(s=l.next()).done);n=!0){var u=s.value[r];if(u){var c=!0,d=!1,h=void 0;try{for(var p,f=u[Symbol.iterator]();!(c=(p=f.next()).done);c=!0){var m=p.value;t.push(m)}}catch(e){d=!0,h=e}finally{try{c||null==f.return||f.return()}finally{if(d)throw h}}}}}catch(e){a=!0,o=e}finally{try{n||null==l.return||l.return()}finally{if(a)throw o}}}return t}},{key:"queryRenderedFeatures",value:function(e,t,i,r){t&&t.filter&&this._validate(_.filter,"queryRenderedFeatures.filter",t.filter);var n={};if(t&&t.layers){if(!Array.isArray(t.layers))return this.fire("error",{error:"parameters.layers must be an Array."}),[];var a=!0,o=!1,s=void 0;try{for(var l,u=t.layers[Symbol.iterator]();!(a=(l=u.next()).done);a=!0){var c=l.value,d=this._layers[c];if(!d)return this.fire("error",{error:"The layer '".concat(c,"' does not exist ")+"in the map's style and cannot be queried for features."}),[];n[d.source]=!0}}catch(e){o=!0,s=e}finally{try{a||null==u.return||u.return()}finally{if(o)throw s}}}var h=[];for(var p in this.sourceCaches)if(!t.layers||n[p]){var f=b.rendered(this.sourceCaches[p],this._layers,e,t,i,r,this.collisionIndex);h.push(f)}return this._flattenRenderedFeatures(h)}},{key:"querySourceFeatures",value:function(e,t){t&&t.filter&&this._validate(_.filter,"querySourceFeatures.filter",t.filter);var i=this.sourceCaches[e];return i?b.source(i,t):[]}},{key:"addSourceType",value:function(e,t,i){return C(e)?i(new Error('A source type called "'.concat(e,'" already exists.'))):(x(e,t),t.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:e,url:t.workerSourceURL},i):i(null,null))}},{key:"getLight",value:function(){return this.light.getLight()}},{key:"setLight",value:function(e){this._checkLoaded();var t=this.light.getLight(),i=!1;for(var r in e)if(!g.deepEqual(e[r],t[r])){i=!0;break}if(i){var n={now:S.now(),transition:g.extend({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(e),this.light.updateTransitions(n)}}},{key:"_validate",value:function(e,t,i,r,n){return(!n||!1!==n.validate)&&_.emitErrors(this,e.call(_,g.extend({key:t,style:this.serialize(),value:i,styleSpec:w},r)))}},{key:"_remove",value:function(){for(var e in M.evented.off("pluginAvailable",this._rtlTextPluginCallback),this.sourceCaches)this.sourceCaches[e].clearTiles();this.dispatcher.remove()}},{key:"_clearSource",value:function(e){this.sourceCaches[e].clearTiles()}},{key:"_reloadSource",value:function(e){this.sourceCaches[e].resume(),this.sourceCaches[e].reload()}},{key:"_updateSources",value:function(e){for(var t in this.sourceCaches)this.sourceCaches[t].update(e)}},{key:"_generateCollisionBoxes",value:function(){for(var e in this.sourceCaches)this._reloadSource(e)}},{key:"_updatePlacement",value:function(e,t,i){var r=this,n=!1,a=!1,o={},s=!0,l=!1,u=void 0;try{for(var c,d=this._order[Symbol.iterator]();!(s=(c=d.next()).done);s=!0){var h=c.value,p=this._layers[h];if("symbol"===p.type){o[p.source]||function(){var t=r.sourceCaches[p.source];o[p.source]=t.getRenderableIds().map(function(e){return t.getTileByID(e)}).sort(function(e,t){return t.tileID.overscaledZ-e.tileID.overscaledZ||(e.tileID.isLessThan(t.tileID)?-1:1)})}();var f=this.crossTileSymbolIndex.addLayer(p,o[p.source]);n=n||f}}}catch(e){l=!0,u=e}finally{try{s||null==d.return||d.return()}finally{if(l)throw u}}var m=this._layerOrderChanged;if((m||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(S.now()))&&(this.pauseablePlacement=new D(e,this._order,m,t,i),this._layerOrderChanged=!1),this.pauseablePlacement.isDone())this.placement.setStale();else{if(this.pauseablePlacement.continuePlacement(this._order,this._layers,o),this.pauseablePlacement.isDone()){var g=this.pauseablePlacement.placement;a=g.commit(this.placement,S.now()),this.placement&&!a&&!n||(this.placement=g,this.collisionIndex=this.placement.collisionIndex),this.placement.setRecent(S.now(),g.stale)}n&&this.pauseablePlacement.placement.setStale()}if(a||n){var y=!0,v=!1,_=void 0;try{for(var C,x=this._order[Symbol.iterator]();!(y=(C=x.next()).done);y=!0){var b=C.value,A=this._layers[b];"symbol"===A.type&&this.placement.updateLayerOpacities(A,o[A.source])}}catch(e){v=!0,_=e}finally{try{y||null==x.return||x.return()}finally{if(v)throw _}}}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(S.now())}},{key:"getImages",value:function(e,t,i){this.imageManager.getImages(t.icons,i)}},{key:"getGlyphs",value:function(e,t,i){this.glyphManager.getGlyphs(t.stacks,i)}}]),k);function k(e){var a,t,i,r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};!function(e){if(!(e instanceof k))throw new TypeError("Cannot call a class as a function")}(this),(t=this,i=o(k).call(this),a=!i||"object"!==s(i)&&"function"!=typeof i?l(t):i).map=e,a.dispatcher=new v(E(),l(a)),a.imageManager=new u,a.glyphManager=new c(e._transformRequest,r.localIdeographFontFamily),a.lineAtlas=new m(256,512),a.crossTileSymbolIndex=new O,a._layers={},a._order=[],a.sourceCaches={},a.zoomHistory=new I,a._loaded=!1,a._resetUpdates();var n=l(a);return a._rtlTextPluginCallback=M.registerForPluginAvailability(function(e){for(var t in n.dispatcher.broadcast("loadRTLTextPlugin",e.pluginBlobURL,e.errorCallback),n.sourceCaches)n.sourceCaches[t].reload()}),a.on("data",function(e){if("source"===e.dataType&&"metadata"===e.sourceDataType){var t=a.sourceCaches[e.sourceId];if(t){var i=t.getSource();if(i&&i.vectorLayerIds)for(var r in a._layers){var n=a._layers[r];n.source===i.id&&a._validateLayer(n)}}}}),a}e.exports=N},function(e,t,i){e.exports=i(141),e.exports.emitErrors=function(e,t){if(t&&t.length){var i=!0,r=!1,n=void 0;try{for(var a,o=t[Symbol.iterator]();!(i=(a=o.next()).done);i=!0){var s=a.value.message;e.fire("error",{error:new Error(s)})}}catch(e){r=!0,n=e}finally{try{i||null==o.return||o.return()}finally{if(r)throw n}}return!0}return!1}},function(e,t,i){var r=i(1),n=i(78),a=i(25).Color,o=["Unknown","Point","LineString","Polygon"],s=(function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(l.prototype,[{key:"id",value:function(){return this.feature&&"id"in this.feature?this.feature.id:null}},{key:"geometryType",value:function(){return this.feature?"number"==typeof this.feature.type?o[this.feature.type]:this.feature.type:null}},{key:"properties",value:function(){return this.feature&&this.feature.properties||{}}},{key:"pushScope",value:function(e){this.scope=this.scope.concat(e)}},{key:"popScope",value:function(){r(this.scope.parent),this.scope=this.scope.parent}},{key:"parseColor",value:function(e){var t=this._parseColorCache[e];return t=t||(this._parseColorCache[e]=a.parse(e))}}]),l);function l(){!function(e){if(!(e instanceof l))throw new TypeError("Cannot call a class as a function")}(this),this.scope=new n,this._parseColorCache={}}e.exports=s},function(e,t,i){function y(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}function v(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function _(e){if(Array.isArray(e))return e}function r(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var n,a,o=i(73),d=i(26),s=i(8),C=s.toString,x=s.NumberType,h=i(87).findStopLessThanOrEqualTo,l=(a=[{key:"interpolationFactor",value:function(e,t,i,r){var n=0;if("exponential"===e.name)n=u(t,e.base,i,r);else if("linear"===e.name)n=u(t,1,i,r);else if("cubic-bezier"===e.name){var a=e.controlPoints;n=new o(a[0],a[1],a[2],a[3]).solve(u(t,1,i,r))}return n}},{key:"parse",value:function(e,t){var i,r=_(i=e)||y(i)||v(),n=r[1],a=r[2],o=r.slice(3);if(!Array.isArray(n)||0===n.length)return t.error("Expected an interpolation type expression.",1);if("linear"===n[0])n={name:"linear"};else if("exponential"===n[0]){var s=n[1];if("number"!=typeof s)return t.error("Exponential interpolation requires a numeric base.",1,1);n={name:"exponential",base:s}}else{if("cubic-bezier"!==n[0])return t.error("Unknown interpolation type ".concat(String(n[0])),1,0);var l=n.slice(1);if(4!==l.length||l.some(function(e){return"number"!=typeof e||e<0||1<e}))return t.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:l}}if(e.length-1<4)return t.error("Expected at least 4 arguments, but found only ".concat(e.length-1,"."));if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");if(!(a=t.parse(a,2,x)))return null;var u=[],c=null;t.expectedType&&"value"!==t.expectedType.kind&&(c=t.expectedType);for(var d=0;d<o.length;d+=2){var h=o[d],p=o[d+1],f=d+3,m=d+4;if("number"!=typeof h)return t.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',f);if(u.length&&u[u.length-1][0]>=h)return t.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',f);var g=t.parse(p,m,c);if(!g)return null;c=c||g.type,u.push([h,g])}return"number"===c.kind||"color"===c.kind||"array"===c.kind&&"number"===c.itemType.kind&&"number"==typeof c.N?new b(c,n,a,u):t.error("Type ".concat(C(c)," is not interpolatable."))}}],r((n=b).prototype,[{key:"evaluate",value:function(e){var t=this.labels,i=this.outputs;if(1===t.length)return i[0].evaluate(e);var r=this.input.evaluate(e);if(r<=t[0])return i[0].evaluate(e);var n=t.length;if(r>=t[n-1])return i[n-1].evaluate(e);var a=h(t,r),o=t[a],s=t[a+1],l=b.interpolationFactor(this.interpolation,r,o,s),u=i[a].evaluate(e),c=i[a+1].evaluate(e);return d[this.type.kind.toLowerCase()](u,c,l)}},{key:"eachChild",value:function(e){e(this.input);var t=!0,i=!1,r=void 0;try{for(var n,a=this.outputs[Symbol.iterator]();!(t=(n=a.next()).done);t=!0)e(n.value)}catch(e){i=!0,r=e}finally{try{t||null==a.return||a.return()}finally{if(i)throw r}}}},{key:"possibleOutputs",value:function(){var e;return(e=[]).concat.apply(e,function(e){return function(e){if(Array.isArray(e)){for(var t=0,i=new Array(e.length);t<e.length;t++)i[t]=e[t];return i}}(e)||y(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}(this.outputs.map(function(e){return e.possibleOutputs()})))}}]),r(n,a),b);function b(e,t,i,r){!function(e){if(!(e instanceof b))throw new TypeError("Cannot call a class as a function")}(this),this.type=e,this.interpolation=t,this.input=i,this.labels=[];var n,a,o=!0,s=!(this.outputs=[]),l=void 0;try{for(var u,c=r[Symbol.iterator]();!(o=(u=c.next()).done);o=!0){var d=(n=u.value,a=2,_(n)||function(e,t){var i=[],r=!0,n=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(r=(o=s.next()).done)&&(i.push(o.value),!t||i.length!==t);r=!0);}catch(e){n=!0,a=e}finally{try{r||null==s.return||s.return()}finally{if(n)throw a}}return i}(n,a)||v()),h=d[0],p=d[1];this.labels.push(h),this.outputs.push(p)}}catch(e){s=!0,l=e}finally{try{o||null==c.return||c.return()}finally{if(s)throw l}}}function u(e,t,i,r){var n=r-i,a=e-i;return 0==n?0:1===t?a/n:(Math.pow(t,a)-1)/(Math.pow(t,n)-1)}e.exports=l},function(e,t,i){function E(e){return(E="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})(e)}var T=i(147),P=i(12),M=i(41),g=i(17),y=i(26),D=i(56);function v(e){return e}function I(e,t,i){return void 0!==e?e:void 0!==t?t:void 0!==i?i:void 0}function O(e,t,i,r,n){return I(E(i)===n?r[i]:void 0,e.default,t.default)}function R(e,t,i){if("number"!==g(i))return I(e.default,t.default);var r=e.stops.length;if(1===r)return e.stops[0][1];if(i<=e.stops[0][0])return e.stops[0][1];if(i>=e.stops[r-1][0])return e.stops[r-1][1];var n=_(e.stops,i);return e.stops[n][1]}function L(e,t,i){var r=void 0!==e.base?e.base:1;if("number"!==g(i))return I(e.default,t.default);var n=e.stops.length;if(1===n)return e.stops[0][1];if(i<=e.stops[0][0])return e.stops[0][1];if(i>=e.stops[n-1][0])return e.stops[n-1][1];var a,o,s,l,u,c=_(e.stops,i),d=(a=i,o=r,s=e.stops[c][0],l=e.stops[c+1][0]-s,u=a-s,0==l?0:1===o?u/l:(Math.pow(o,u)-1)/(Math.pow(o,l)-1)),h=e.stops[c][1],p=e.stops[c+1][1],f=y[t.type]||v;if(e.colorSpace&&"rgb"!==e.colorSpace){var m=T[e.colorSpace];f=function(e,t){return m.reverse(m.interpolate(m.forward(e),m.forward(t),d))}}return"function"==typeof h.evaluate?{evaluate:function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];var r=h.evaluate.apply(void 0,t),n=p.evaluate.apply(void 0,t);if(void 0!==r&&void 0!==n)return f(r,n,d)}}:f(h,p,d)}function N(e,t,i){return"color"===t.type?i=P.parse(i):g(i)===t.type||"enum"===t.type&&t.values[i]||(i=void 0),I(i,e.default,t.default)}function _(e,t){for(var i,r,n=0,a=e.length-1,o=0;n<=a;){if(i=e[o=Math.floor((n+a)/2)][0],r=e[o+1][0],t===i||i<t&&t<r)return o;i<t?n=o+1:t<i&&(a=o-1)}return Math.max(o-1,0)}e.exports={createFunction:function e(r,n){var a,o,s,t="color"===n.type,i=r.stops&&"object"===E(r.stops[0][0]),l=i||void 0!==r.property,u=i||!l,c=r.type||("interpolated"===n.function?"exponential":"interval");if(t&&((r=M({},r)).stops&&(r.stops=r.stops.map(function(e){return[e[0],P.parse(e[1])]})),r.default?r.default=P.parse(r.default):r.default=P.parse(n.default)),r.colorSpace&&"rgb"!==r.colorSpace&&!T[r.colorSpace])throw new Error("Unknown color space: ".concat(r.colorSpace));if("exponential"===c)a=L;else if("interval"===c)a=R;else if("categorical"===c){a=O,o=Object.create(null);var d=!0,h=!1,p=void 0;try{for(var f,m=r.stops[Symbol.iterator]();!(d=(f=m.next()).done);d=!0){var g=f.value;o[g[0]]=g[1]}}catch(e){h=!0,p=e}finally{try{d||null==m.return||m.return()}finally{if(h)throw p}}s=E(r.stops[0][0])}else{if("identity"!==c)throw new Error('Unknown function type "'.concat(c,'"'));a=N}if(i){for(var y={},v=[],_=0;_<r.stops.length;_++){var C=r.stops[_],x=C[0].zoom;void 0===y[x]&&(y[x]={zoom:x,type:r.type,property:r.property,default:r.default,stops:[]},v.push(x)),y[x].stops.push([C[0].value,C[1]])}for(var b=[],A=0,S=v;A<S.length;A++){var w=S[A];b.push([y[w].zoom,e(y[w],n)])}return{kind:"composite",interpolationFactor:D.interpolationFactor.bind(void 0,{name:"linear"}),zoomStops:b.map(function(e){return e[0]}),evaluate:function(e,t){var i=e.zoom;return L({stops:b,base:r.base},n,i).evaluate(i,t)}}}return u?{kind:"camera",interpolationFactor:"exponential"===c?D.interpolationFactor.bind(void 0,{name:"exponential",base:void 0!==r.base?r.base:1}):function(){return 0},zoomStops:r.stops.map(function(e){return e[0]}),evaluate:function(e){var t=e.zoom;return a(r,n,t,o,s)}}:{kind:"source",evaluate:function(e,t){var i=t&&t.properties?t.properties[r.property]:void 0;return void 0===i?I(r.default,n.default):a(r,n,i,o,s)}}},isFunction:function(e){return"object"===E(e)&&null!==e&&!Array.isArray(e)}}},function(e,t,i){var a=i(7),o=i(24);e.exports=function(e){var t=e.key,i=e.value,r=e.valueSpec,n=[];return Array.isArray(r.values)?-1===r.values.indexOf(o(i))&&n.push(new a(t,i,"expected one of [".concat(r.values.join(", "),"], ").concat(JSON.stringify(i)," found"))):-1===Object.keys(r.values).indexOf(o(i))&&n.push(new a(t,i,"expected one of [".concat(Object.keys(r.values).join(", "),"], ").concat(JSON.stringify(i)," found"))),n}},function(e,t,i){var u=i(7),r=i(94),c=i(58),d=i(17),h=i(24),n=i(41),a=i(60).isExpressionFilter;e.exports=function(e){return a(h.deep(e.value))?r(n({},e,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function e(t){var i=t.value,r=t.key;if("array"!==d(i))return[new u(r,i,"array expected, ".concat(d(i)," found"))];var n,a=t.styleSpec,o=[];if(i.length<1)return[new u(r,i,"filter array must have at least 1 element")];switch(o=o.concat(c({key:"".concat(r,"[0]"),value:i[0],valueSpec:a.filter_operator,style:t.style,styleSpec:t.styleSpec})),h(i[0])){case"<":case"<=":case">":case">=":2<=i.length&&"$type"===h(i[1])&&o.push(new u(r,i,'"$type" cannot be use with operator "'.concat(i[0],'"')));case"==":case"!=":3!==i.length&&o.push(new u(r,i,'filter array for operator "'.concat(i[0],'" must have 3 elements')));case"in":case"!in":2<=i.length&&"string"!==(n=d(i[1]))&&o.push(new u("".concat(r,"[1]"),i[1],"string expected, ".concat(n," found")));for(var s=2;s<i.length;s++)n=d(i[s]),"$type"===h(i[1])?o=o.concat(c({key:"".concat(r,"[").concat(s,"]"),value:i[s],valueSpec:a.geometry_type,style:t.style,styleSpec:t.styleSpec})):"string"!==n&&"number"!==n&&"boolean"!==n&&o.push(new u("".concat(r,"[").concat(s,"]"),i[s],"string, number, or boolean expected, ".concat(n," found")));break;case"any":case"all":case"none":for(var l=1;l<i.length;l++)o=o.concat(e({key:"".concat(r,"[").concat(l,"]"),value:i[l],style:t.style,styleSpec:t.styleSpec}));break;case"has":case"!has":n=d(i[1]),2!==i.length?o.push(new u(r,i,'filter array for "'.concat(i[0],'" operator must have 2 elements'))):"string"!==n&&o.push(new u("".concat(r,"[1]"),i[1],"string expected, ".concat(n," found")))}return o}(e)}},function(e,t,i){function r(e){return(r="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})(e)}var n=i(30).createExpression;function s(e){if(!Array.isArray(e)||0===e.length)return!1;switch(e[0]){case"has":return 2<=e.length&&"$id"!==e[1]&&"$type"!==e[1];case"in":case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3===e.length&&(Array.isArray(e[1])||Array.isArray(e[2]));case"any":case"all":var t=!0,i=!1,r=void 0;try{for(var n,a=e.slice(1)[Symbol.iterator]();!(t=(n=a.next()).done);t=!0){var o=n.value;if(!s(o)&&"boolean"!=typeof o)return!1}}catch(e){i=!0,r=e}finally{try{t||null==a.return||a.return()}finally{if(i)throw r}}return!0;default:return!0}}e.exports=function(e){if(!e)return function(){return!0};s(e)||(e=l(e));var i=n(e,a);if("error"===i.result)throw new Error(i.value.map(function(e){return"".concat(e.key,": ").concat(e.message)}).join(", "));return function(e,t){return i.value.evaluate(e,t)}},e.exports.isExpressionFilter=s;var a={type:"boolean",default:!1,function:!0,"property-function":!0,"zoom-function":!0};function o(e,t){return e<t?-1:t<e?1:0}function l(e){if(!e)return!0;var t,i=e[0];return e.length<=1?"any"!==i:"=="===i?u(e[1],e[2],"=="):"!="===i?h(u(e[1],e[2],"==")):"<"===i||">"===i||"<="===i||">="===i?u(e[1],e[2],i):"any"===i?(t=e.slice(1),["any"].concat(t.map(l))):"all"===i?["all"].concat(e.slice(1).map(l)):"none"===i?["all"].concat(e.slice(1).map(l).map(h)):"in"===i?c(e[1],e.slice(2)):"!in"===i?h(c(e[1],e.slice(2))):"has"===i?d(e[1]):"!has"!==i||h(d(e[1]))}function u(e,t,i){switch(e){case"$type":return["filter-type-".concat(i),t];case"$id":return["filter-id-".concat(i),t];default:return["filter-".concat(i),e,t]}}function c(e,t){if(0===t.length)return!1;switch(e){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return 200<t.length&&!t.some(function(e){return r(e)!==r(t[0])})?["filter-in-large",e,["literal",t.sort(o)]]:["filter-in-small",e,["literal",t]]}}function d(e){switch(e){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",e]}}function h(e){return["!",e]}},function(e,t,i){var r=i(108),n=(function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(a.prototype,[{key:"crossFadingFactor",value:function(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}}]),a);function a(e,t){!function(e){if(!(e instanceof a))throw new TypeError("Cannot call a class as a function")}(this),this.zoom=e,t?(this.now=t.now,this.fadeDuration=t.fadeDuration,this.zoomHistory=t.zoomHistory,this.transition=t.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new r,this.transition={})}e.exports=n},function(e,t,i){function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function a(e,t,i){return t&&n(e.prototype,t),i&&n(e,i),e}var o=i(175),s=o.symbolLayoutAttributes,l=o.collisionVertexAttributes,u=o.collisionBoxLayout,c=o.collisionCircleLayout,d=o.dynamicLayoutAttributes,h=i(14),p=h.SymbolLayoutArray,f=h.SymbolDynamicLayoutArray,m=h.SymbolOpacityArray,g=h.CollisionBoxLayoutArray,y=h.CollisionCircleLayoutArray,v=h.CollisionVertexArray,_=h.PlacedSymbolArray,C=h.GlyphOffsetArray,x=h.SymbolLineVertexArray,b=i(3),A=i(36).SegmentVector,S=i(32).ProgramConfigurationSet,w=i(37),E=w.TriangleIndexArray,T=w.LineIndexArray,D=i(176),I=i(177),O=i(63),R=i(38),L=i(48).VectorTileFeature.types,N=i(110),P=(i(178),i(50).getSizeData),M=i(11).register,k=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function B(e,t,i,r,n,a,o,s){e.emplaceBack(t,i,Math.round(64*r),Math.round(64*n),a,o,s?s[0]:0,s?s[1]:0)}function F(e,t,i){e.emplaceBack(t.x,t.y,i),e.emplaceBack(t.x,t.y,i),e.emplaceBack(t.x,t.y,i),e.emplaceBack(t.x,t.y,i)}var V=(a(z,[{key:"upload",value:function(e,t){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,s.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,t),this.programConfigurations.upload(e),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,d.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,k,!0),this.opacityVertexBuffer.itemSize=1}},{key:"destroy",value:function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())}}]),z);function z(e){r(this,z),this.layoutVertexArray=new p,this.indexArray=new E,this.programConfigurations=e,this.segments=new A,this.dynamicLayoutVertexArray=new f,this.opacityVertexArray=new m,this.placedSymbolArray=new _}M("SymbolBuffers",V);var U=(a(G,[{key:"upload",value:function(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,l.members,!0)}},{key:"destroy",value:function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}}]),G);function G(e,t,i){r(this,G),this.layoutVertexArray=new e,this.layoutAttributes=t,this.indexArray=new i,this.segments=new A,this.collisionVertexArray=new v}M("CollisionBuffers",U);var $=(a(H,[{key:"createArrays",value:function(){this.text=new V(new S(s.members,this.layers,this.zoom,function(e){return/^text/.test(e)})),this.icon=new V(new S(s.members,this.layers,this.zoom,function(e){return/^icon/.test(e)})),this.collisionBox=new U(g,u.members,T),this.collisionCircle=new U(y,c.members,E),this.glyphOffsetArray=new C,this.lineVertexArray=new x}},{key:"populate",value:function(e,t){var i=this.layers[0],r=i.layout,n=r.get("text-font"),a=r.get("text-field"),o=r.get("icon-image"),s=("constant"!==a.value.kind||0<a.value.value.length)&&("constant"!==n.value.kind||0<n.value.value.length),l="constant"!==o.value.kind||o.value.value&&0<o.value.value.length;if(this.features=[],s||l){var u=t.iconDependencies,c=t.glyphDependencies,d={zoom:this.zoom},h=!0,p=!1,f=void 0;try{for(var m,g=e[Symbol.iterator]();!(h=(m=g.next()).done);h=!0){var y=m.value,v=y.feature,_=y.index,C=y.sourceLayerIndex;if(i._featureFilter(d,v)){var x=void 0;s&&(x=i.getValueAndResolveTokens("text-field",v),x=D(x,i,v));var b=void 0;if(l&&(b=i.getValueAndResolveTokens("icon-image",v)),x||b){var A={text:x,icon:b,index:_,sourceLayerIndex:C,geometry:R(v),properties:v.properties,type:L[v.type]};if(void 0!==v.id&&(A.id=v.id),this.features.push(A),b&&(u[b]=!0),x)for(var S=n.evaluate(v).join(","),w=c[S]=c[S]||{},E="map"===r.get("text-rotation-alignment")&&"line"===r.get("symbol-placement"),T=O.allowsVerticalWritingMode(x),P=0;P<x.length;P++)if(w[x.charCodeAt(P)]=!0,E&&T){var M=N.lookup[x.charAt(P)];M&&(w[M.charCodeAt(0)]=!0)}}}}}catch(e){p=!0,f=e}finally{try{h||null==g.return||g.return()}finally{if(p)throw f}}"line"===r.get("symbol-placement")&&(this.features=I(this.features))}}},{key:"isEmpty",value:function(){return 0===this.symbolInstances.length}},{key:"upload",value:function(e){this.text.upload(e,this.sortFeaturesByY),this.icon.upload(e,this.sortFeaturesByY),this.collisionBox.upload(e),this.collisionCircle.upload(e)}},{key:"destroy",value:function(){this.text.destroy(),this.icon.destroy(),this.collisionBox.destroy(),this.collisionCircle.destroy()}},{key:"addToLineVertexArray",value:function(e,t){var i=this.lineVertexArray.length;if(void 0!==e.segment){for(var r=e.dist(t[e.segment+1]),n=e.dist(t[e.segment]),a={},o=e.segment+1;o<t.length;o++)a[o]={x:t[o].x,y:t[o].y,tileUnitDistanceFromAnchor:r},o<t.length-1&&(r+=t[o+1].dist(t[o]));for(var s=e.segment||0;0<=s;s--)a[s]={x:t[s].x,y:t[s].y,tileUnitDistanceFromAnchor:n},0<s&&(n+=t[s-1].dist(t[s]));for(var l=0;l<t.length;l++){var u=a[l];this.lineVertexArray.emplaceBack(u.x,u.y,u.tileUnitDistanceFromAnchor)}}return{lineStartIndex:i,lineLength:this.lineVertexArray.length-i}}},{key:"addSymbols",value:function(e,t,i,r,n,a,o,s,l,u){var c=e.indexArray,d=e.layoutVertexArray,h=e.dynamicLayoutVertexArray,p=e.segments.prepareSegment(4*t.length,e.layoutVertexArray,e.indexArray),f=this.glyphOffsetArray.length,m=p.vertexLength,g=!0,y=!1,v=void 0;try{for(var _,C=t[Symbol.iterator]();!(g=(_=C.next()).done);g=!0){var x=_.value,b=x.tl,A=x.tr,S=x.bl,w=x.br,E=x.tex,T=p.vertexLength,P=x.glyphOffset[1];B(d,s.x,s.y,b.x,P+b.y,E.x,E.y,i),B(d,s.x,s.y,A.x,P+A.y,E.x+E.w,E.y,i),B(d,s.x,s.y,S.x,P+S.y,E.x,E.y+E.h,i),B(d,s.x,s.y,w.x,P+w.y,E.x+E.w,E.y+E.h,i),F(h,s,0),c.emplaceBack(T,T+1,T+2),c.emplaceBack(T+1,T+2,T+3),p.vertexLength+=4,p.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(x.glyphOffset[0])}}catch(e){y=!0,v=e}finally{try{g||null==C.return||C.return()}finally{if(y)throw v}}e.placedSymbolArray.emplaceBack(s.x,s.y,f,this.glyphOffsetArray.length-f,m,l,u,s.segment,i?i[0]:0,i?i[1]:0,r[0],r[1],o,!1),e.programConfigurations.populatePaintArrays(e.layoutVertexArray.length,a)}},{key:"_addCollisionDebugVertex",value:function(e,t,i,r,n){return t.emplaceBack(0,0),e.emplaceBack(i.x,i.y,r.x,r.y,Math.round(n.x),Math.round(n.y))}},{key:"addCollisionDebugVertices",value:function(e,t,i,r,n,a,o,s){var l=n.segments.prepareSegment(4,n.layoutVertexArray,n.indexArray),u=l.vertexLength,c=n.layoutVertexArray,d=n.collisionVertexArray;if(this._addCollisionDebugVertex(c,d,a,o.anchor,new b(e,t)),this._addCollisionDebugVertex(c,d,a,o.anchor,new b(i,t)),this._addCollisionDebugVertex(c,d,a,o.anchor,new b(i,r)),this._addCollisionDebugVertex(c,d,a,o.anchor,new b(e,r)),l.vertexLength+=4,s){var h=n.indexArray;h.emplaceBack(u,u+1,u+2),h.emplaceBack(u,u+2,u+3),l.primitiveLength+=2}else{var p=n.indexArray;p.emplaceBack(u,u+1),p.emplaceBack(u+1,u+2),p.emplaceBack(u+2,u+3),p.emplaceBack(u+3,u),l.primitiveLength+=4}}},{key:"generateCollisionDebugBuffers",value:function(){var e=!0,t=!1,i=void 0;try{for(var r,n=this.symbolInstances[Symbol.iterator]();!(e=(r=n.next()).done);e=!0){var a=r.value;a.textCollisionFeature={boxStartIndex:a.textBoxStartIndex,boxEndIndex:a.textBoxEndIndex},a.iconCollisionFeature={boxStartIndex:a.iconBoxStartIndex,boxEndIndex:a.iconBoxEndIndex};for(var o=0;o<2;o++){var s=a[0===o?"textCollisionFeature":"iconCollisionFeature"];if(s)for(var l=s.boxStartIndex;l<s.boxEndIndex;l++){var u=this.collisionBoxArray.get(l),c=u.x1,d=u.y1,h=u.x2,p=u.y2,f=0<u.radius;this.addCollisionDebugVertices(c,d,h,p,f?this.collisionCircle:this.collisionBox,u.anchorPoint,a,f)}}}}catch(e){t=!0,i=e}finally{try{e||null==n.return||n.return()}finally{if(t)throw i}}}},{key:"deserializeCollisionBoxes",value:function(e,t,i,r,n){for(var a={},o=t;o<i;o++){var s=e.get(o);if(0===s.radius){a.textBox={x1:s.x1,y1:s.y1,x2:s.x2,y2:s.y2,anchorPointX:s.anchorPointX,anchorPointY:s.anchorPointY};break}a.textCircles||(a.textCircles=[]),a.textCircles.push(s.anchorPointX,s.anchorPointY,s.radius,s.signedDistanceFromAnchor,1)}for(var l=r;l<n;l++){var u=e.get(l);if(0===u.radius){a.iconBox={x1:u.x1,y1:u.y1,x2:u.x2,y2:u.y2,anchorPointX:u.anchorPointX,anchorPointY:u.anchorPointY};break}}return a}},{key:"hasTextData",value:function(){return 0<this.text.segments.get().length}},{key:"hasIconData",value:function(){return 0<this.icon.segments.get().length}},{key:"hasCollisionBoxData",value:function(){return 0<this.collisionBox.segments.get().length}},{key:"hasCollisionCircleData",value:function(){return 0<this.collisionCircle.segments.get().length}},{key:"sortFeatures",value:function(e){var n=this;if(this.sortFeaturesByY&&this.sortedAngle!==e&&(this.sortedAngle=e,!(1<this.text.segments.get().length||1<this.icon.segments.get().length))){for(var t=[],i=0;i<this.symbolInstances.length;i++)t.push(i);var a=Math.sin(e),o=Math.cos(e);t.sort(function(e,t){var i=n.symbolInstances[e],r=n.symbolInstances[t];return(a*i.anchor.x+o*i.anchor.y|0)-(a*r.anchor.x+o*r.anchor.y|0)||r.featureIndex-i.featureIndex}),this.text.indexArray.clear(),this.icon.indexArray.clear();for(var r=0,s=t;r<s.length;r++){var l=s[r],u=this.symbolInstances[l],c=!0,d=!1,h=void 0;try{for(var p,f=u.placedTextSymbolIndices[Symbol.iterator]();!(c=(p=f.next()).done);c=!0)for(var m=p.value,g=this.text.placedSymbolArray.get(m),y=g.vertexStartIndex+4*g.numGlyphs,v=g.vertexStartIndex;v<y;v+=4)this.text.indexArray.emplaceBack(v,v+1,v+2),this.text.indexArray.emplaceBack(v+1,v+2,v+3)}catch(e){d=!0,h=e}finally{try{c||null==f.return||f.return()}finally{if(d)throw h}}var _=this.icon.placedSymbolArray.get(l);if(_.numGlyphs){var C=_.vertexStartIndex;this.icon.indexArray.emplaceBack(C,C+1,C+2),this.icon.indexArray.emplaceBack(C+1,C+2,C+3)}}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}]),H);function H(e){r(this,H),this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(function(e){return e.id}),this.index=e.index,this.pixelRatio=e.pixelRatio;var t=this.layers[0]._unevaluatedLayout._values;this.textSizeData=P(this.zoom,t["text-size"]),this.iconSizeData=P(this.zoom,t["icon-size"]);var i=this.layers[0].layout;this.sortFeaturesByY=i.get("text-allow-overlap")||i.get("icon-allow-overlap")||i.get("text-ignore-placement")||i.get("icon-ignore-placement")}M("SymbolBucket",$,{omit:["layers","collisionBoxArray","features","compareText"],shallow:["symbolInstances"]}),$.MAX_GLYPHS=65535,$.addDynamicAttributes=F,e.exports=$},function(e,s,t){var i=t(109);e.exports.allowsIdeographicBreaking=function(e){var t=!0,i=!1,r=void 0;try{for(var n,a=e[Symbol.iterator]();!(t=(n=a.next()).done);t=!0){var o=n.value;if(!s.charAllowsIdeographicBreaking(o.charCodeAt(0)))return!1}}catch(e){i=!0,r=e}finally{try{t||null==a.return||a.return()}finally{if(i)throw r}}return!0},e.exports.allowsVerticalWritingMode=function(e){var t=!0,i=!1,r=void 0;try{for(var n,a=e[Symbol.iterator]();!(t=(n=a.next()).done);t=!0){var o=n.value;if(s.charHasUprightVerticalOrientation(o.charCodeAt(0)))return!0}}catch(e){i=!0,r=e}finally{try{t||null==a.return||a.return()}finally{if(i)throw r}}return!1},e.exports.allowsLetterSpacing=function(e){var t=!0,i=!1,r=void 0;try{for(var n,a=e[Symbol.iterator]();!(t=(n=a.next()).done);t=!0){var o=n.value;if(!s.charAllowsLetterSpacing(o.charCodeAt(0)))return!1}}catch(e){i=!0,r=e}finally{try{t||null==a.return||a.return()}finally{if(i)throw r}}return!0},e.exports.charAllowsLetterSpacing=function(e){return!(i.Arabic(e)||i["Arabic Supplement"](e)||i["Arabic Extended-A"](e)||i["Arabic Presentation Forms-A"](e)||i["Arabic Presentation Forms-B"](e))},e.exports.charAllowsIdeographicBreaking=function(e){return!!(!(e<11904)&&(i["Bopomofo Extended"](e)||i.Bopomofo(e)||i["CJK Compatibility Forms"](e)||i["CJK Compatibility Ideographs"](e)||i["CJK Compatibility"](e)||i["CJK Radicals Supplement"](e)||i["CJK Strokes"](e)||i["CJK Symbols and Punctuation"](e)||i["CJK Unified Ideographs Extension A"](e)||i["CJK Unified Ideographs"](e)||i["Enclosed CJK Letters and Months"](e)||i["Halfwidth and Fullwidth Forms"](e)||i.Hiragana(e)||i["Ideographic Description Characters"](e)||i["Kangxi Radicals"](e)||i["Katakana Phonetic Extensions"](e)||i.Katakana(e)||i["Vertical Forms"](e)||i["Yi Radicals"](e)||i["Yi Syllables"](e)))},s.charHasUprightVerticalOrientation=function(e){return!!(746===e||747===e||!(e<4352)&&(i["Bopomofo Extended"](e)||i.Bopomofo(e)||i["CJK Compatibility Forms"](e)&&!(65097<=e&&e<=65103)||i["CJK Compatibility Ideographs"](e)||i["CJK Compatibility"](e)||i["CJK Radicals Supplement"](e)||i["CJK Strokes"](e)||!(!i["CJK Symbols and Punctuation"](e)||12296<=e&&e<=12305||12308<=e&&e<=12319||12336===e)||i["CJK Unified Ideographs Extension A"](e)||i["CJK Unified Ideographs"](e)||i["Enclosed CJK Letters and Months"](e)||i["Hangul Compatibility Jamo"](e)||i["Hangul Jamo Extended-A"](e)||i["Hangul Jamo Extended-B"](e)||i["Hangul Jamo"](e)||i["Hangul Syllables"](e)||i.Hiragana(e)||i["Ideographic Description Characters"](e)||i.Kanbun(e)||i["Kangxi Radicals"](e)||i["Katakana Phonetic Extensions"](e)||i.Katakana(e)&&12540!==e||!(!i["Halfwidth and Fullwidth Forms"](e)||65288===e||65289===e||65293===e||65306<=e&&e<=65310||65339===e||65341===e||65343===e||65371<=e&&e<=65503||65507===e||65512<=e&&e<=65519)||!(!i["Small Form Variants"](e)||65112<=e&&e<=65118||65123<=e&&e<=65126)||i["Unified Canadian Aboriginal Syllabics"](e)||i["Unified Canadian Aboriginal Syllabics Extended"](e)||i["Vertical Forms"](e)||i["Yijing Hexagram Symbols"](e)||i["Yi Syllables"](e)||i["Yi Radicals"](e)))},s.charHasNeutralVerticalOrientation=function(e){return!!(i["Latin-1 Supplement"](e)&&(167===e||169===e||174===e||177===e||188===e||189===e||190===e||215===e||247===e)||i["General Punctuation"](e)&&(8214===e||8224===e||8225===e||8240===e||8241===e||8251===e||8252===e||8258===e||8263===e||8264===e||8265===e||8273===e)||i["Letterlike Symbols"](e)||i["Number Forms"](e)||i["Miscellaneous Technical"](e)&&(8960<=e&&e<=8967||8972<=e&&e<=8991||8996<=e&&e<=9e3||9003===e||9085<=e&&e<=9114||9150<=e&&e<=9165||9167===e||9169<=e&&e<=9179||9186<=e&&e<=9215)||i["Control Pictures"](e)&&9251!==e||i["Optical Character Recognition"](e)||i["Enclosed Alphanumerics"](e)||i["Geometric Shapes"](e)||i["Miscellaneous Symbols"](e)&&!(9754<=e&&e<=9759)||i["Miscellaneous Symbols and Arrows"](e)&&(11026<=e&&e<=11055||11088<=e&&e<=11097||11192<=e&&e<=11243)||i["CJK Symbols and Punctuation"](e)||i.Katakana(e)||i["Private Use Area"](e)||i["CJK Compatibility Forms"](e)||i["Small Form Variants"](e)||i["Halfwidth and Fullwidth Forms"](e)||8734===e||8756===e||8757===e||9984<=e&&e<=10087||10102<=e&&e<=10131||65532===e||65533===e)},s.charHasRotatedVerticalOrientation=function(e){return!(s.charHasUprightVerticalOrientation(e)||s.charHasNeutralVerticalOrientation(e))}},function(e,t){e.exports={API_URL:"https://api.mapbox.com",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null}},function(e,t,i){e.exports=n;var r=i(190);function n(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length}function a(e){return e.type===n.Bytes?e.readVarint()+e.pos:e.pos+1}function o(e,t,i){return i?4294967296*t+(e>>>0):4294967296*(t>>>0)+(e>>>0)}function s(e,t,i){var r=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(7*Math.LN2));i.realloc(r);for(var n=i.pos-1;e<=n;n--)i.buf[n+r]=i.buf[n]}function l(e,t){for(var i=0;i<e.length;i++)t.writeVarint(e[i])}function u(e,t){for(var i=0;i<e.length;i++)t.writeSVarint(e[i])}function c(e,t){for(var i=0;i<e.length;i++)t.writeFloat(e[i])}function d(e,t){for(var i=0;i<e.length;i++)t.writeDouble(e[i])}function h(e,t){for(var i=0;i<e.length;i++)t.writeBoolean(e[i])}function p(e,t){for(var i=0;i<e.length;i++)t.writeFixed32(e[i])}function f(e,t){for(var i=0;i<e.length;i++)t.writeSFixed32(e[i])}function m(e,t){for(var i=0;i<e.length;i++)t.writeFixed64(e[i])}function g(e,t){for(var i=0;i<e.length;i++)t.writeSFixed64(e[i])}function y(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+16777216*e[t+3]}function v(e,t,i){e[i]=t,e[i+1]=t>>>8,e[i+2]=t>>>16,e[i+3]=t>>>24}function _(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}n.Varint=0,n.Fixed64=1,n.Bytes=2,n.Fixed32=5,n.prototype={destroy:function(){this.buf=null},readFields:function(e,t,i){for(i=i||this.length;this.pos<i;){var r=this.readVarint(),n=r>>3,a=this.pos;this.type=7&r,e(n,t,this),this.pos===a&&this.skip(r)}return t},readMessage:function(e,t){return this.readFields(e,t,this.readVarint()+this.pos)},readFixed32:function(){var e=y(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=_(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=y(this.buf,this.pos)+4294967296*y(this.buf,this.pos+4);return this.pos+=8,e},readSFixed64:function(){var e=y(this.buf,this.pos)+4294967296*_(this.buf,this.pos+4);return this.pos+=8,e},readFloat:function(){var e=r.read(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=r.read(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(e){var t,i,r=this.buf;return t=127&(i=r[this.pos++]),i<128?t:(t|=(127&(i=r[this.pos++]))<<7,i<128?t:(t|=(127&(i=r[this.pos++]))<<14,i<128?t:(t|=(127&(i=r[this.pos++]))<<21,i<128?t:function(e,t,i){var r,n,a=i.buf;if(r=(112&(n=a[i.pos++]))>>4,n<128)return o(e,r,t);if(r|=(127&(n=a[i.pos++]))<<3,n<128)return o(e,r,t);if(r|=(127&(n=a[i.pos++]))<<10,n<128)return o(e,r,t);if(r|=(127&(n=a[i.pos++]))<<17,n<128)return o(e,r,t);if(r|=(127&(n=a[i.pos++]))<<24,n<128)return o(e,r,t);if(r|=(1&(n=a[i.pos++]))<<31,n<128)return o(e,r,t);throw new Error("Expected varint not more than 10 bytes")}(t|=(15&(i=r[this.pos]))<<28,e,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var e=this.readVarint();return e%2==1?(e+1)/-2:e/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var e=this.readVarint()+this.pos,t=function(e,t,i){for(var r="",n=t;n<i;){var a,o,s,l=e[n],u=null,c=239<l?4:223<l?3:191<l?2:1;if(i<n+c)break;1===c?l<128&&(u=l):2===c?128==(192&(a=e[n+1]))&&(u=(31&l)<<6|63&a)<=127&&(u=null):3===c?(a=e[n+1],o=e[n+2],128==(192&a)&&128==(192&o)&&((u=(15&l)<<12|(63&a)<<6|63&o)<=2047||55296<=u&&u<=57343)&&(u=null)):4===c&&(a=e[n+1],o=e[n+2],s=e[n+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&((u=(15&l)<<18|(63&a)<<12|(63&o)<<6|63&s)<=65535||1114112<=u)&&(u=null)),null===u?(u=65533,c=1):65535<u&&(u-=65536,r+=String.fromCharCode(u>>>10&1023|55296),u=56320|1023&u),r+=String.fromCharCode(u),n+=c}return r}(this.buf,this.pos,e);return this.pos=e,t},readBytes:function(){var e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t},readPackedVarint:function(e,t){if(this.type!==n.Bytes)return e.push(this.readVarint(t));var i=a(this);for(e=e||[];this.pos<i;)e.push(this.readVarint(t));return e},readPackedSVarint:function(e){if(this.type!==n.Bytes)return e.push(this.readSVarint());var t=a(this);for(e=e||[];this.pos<t;)e.push(this.readSVarint());return e},readPackedBoolean:function(e){if(this.type!==n.Bytes)return e.push(this.readBoolean());var t=a(this);for(e=e||[];this.pos<t;)e.push(this.readBoolean());return e},readPackedFloat:function(e){if(this.type!==n.Bytes)return e.push(this.readFloat());var t=a(this);for(e=e||[];this.pos<t;)e.push(this.readFloat());return e},readPackedDouble:function(e){if(this.type!==n.Bytes)return e.push(this.readDouble());var t=a(this);for(e=e||[];this.pos<t;)e.push(this.readDouble());return e},readPackedFixed32:function(e){if(this.type!==n.Bytes)return e.push(this.readFixed32());var t=a(this);for(e=e||[];this.pos<t;)e.push(this.readFixed32());return e},readPackedSFixed32:function(e){if(this.type!==n.Bytes)return e.push(this.readSFixed32());var t=a(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed32());return e},readPackedFixed64:function(e){if(this.type!==n.Bytes)return e.push(this.readFixed64());var t=a(this);for(e=e||[];this.pos<t;)e.push(this.readFixed64());return e},readPackedSFixed64:function(e){if(this.type!==n.Bytes)return e.push(this.readSFixed64());var t=a(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed64());return e},skip:function(e){var t=7&e;if(t===n.Varint)for(;127<this.buf[this.pos++];);else if(t===n.Bytes)this.pos=this.readVarint()+this.pos;else if(t===n.Fixed32)this.pos+=4;else{if(t!==n.Fixed64)throw new Error("Unimplemented type: "+t);this.pos+=8}},writeTag:function(e,t){this.writeVarint(e<<3|t)},realloc:function(e){for(var t=this.length||16;t<this.pos+e;)t*=2;if(t!==this.length){var i=new Uint8Array(t);i.set(this.buf),this.buf=i,this.length=t}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(e){this.realloc(4),v(this.buf,e,this.pos),this.pos+=4},writeSFixed32:function(e){this.realloc(4),v(this.buf,e,this.pos),this.pos+=4},writeFixed64:function(e){this.realloc(8),v(this.buf,-1&e,this.pos),v(this.buf,Math.floor(e*(1/4294967296)),this.pos+4),this.pos+=8},writeSFixed64:function(e){this.realloc(8),v(this.buf,-1&e,this.pos),v(this.buf,Math.floor(e*(1/4294967296)),this.pos+4),this.pos+=8},writeVarint:function(u){268435455<(u=+u||0)||u<0?function(e,t){var i,r,n,a,o,s,l;if(0<=u?(i=u%4294967296|0,r=u/4294967296|0):(r=~(-u/4294967296),4294967295^(i=~(-u%4294967296))?i=i+1|0:r=r+1|(i=0)),0x10000000000000000<=u||u<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");t.realloc(10),s=i,(l=t).buf[l.pos++]=127&s|128,s>>>=7,l.buf[l.pos++]=127&s|128,s>>>=7,l.buf[l.pos++]=127&s|128,s>>>=7,l.buf[l.pos++]=127&s|128,s>>>=7,l.buf[l.pos]=127&s,o=(7&(n=r))<<4,(a=t).buf[a.pos++]|=o|((n>>>=3)?128:0),n&&(a.buf[a.pos++]=127&n|((n>>>=7)?128:0),n&&(a.buf[a.pos++]=127&n|((n>>>=7)?128:0),n&&(a.buf[a.pos++]=127&n|((n>>>=7)?128:0),n&&(a.buf[a.pos++]=127&n|((n>>>=7)?128:0),n&&(a.buf[a.pos++]=127&n)))))}(0,this):(this.realloc(4),this.buf[this.pos++]=127&u|(127<u?128:0),u<=127||(this.buf[this.pos++]=127&(u>>>=7)|(127<u?128:0),u<=127||(this.buf[this.pos++]=127&(u>>>=7)|(127<u?128:0),u<=127||(this.buf[this.pos++]=u>>>7&127))))},writeSVarint:function(e){this.writeVarint(e<0?2*-e-1:2*e)},writeBoolean:function(e){this.writeVarint(Boolean(e))},writeString:function(e){e=String(e),this.realloc(4*e.length),this.pos++;var t=this.pos;this.pos=function(e,t,i){for(var r,n,a=0;a<t.length;a++){if(55295<(r=t.charCodeAt(a))&&r<57344){if(!n){56319<r||a+1===t.length?(e[i++]=239,e[i++]=191,e[i++]=189):n=r;continue}if(r<56320){e[i++]=239,e[i++]=191,e[i++]=189,n=r;continue}r=n-55296<<10|r-56320|65536,n=null}else n&&(e[i++]=239,e[i++]=191,e[i++]=189,n=null);r<128?e[i++]=r:(r<2048?e[i++]=r>>6|192:(r<65536?e[i++]=r>>12|224:(e[i++]=r>>18|240,e[i++]=r>>12&63|128),e[i++]=r>>6&63|128),e[i++]=63&r|128)}return i}(this.buf,e,this.pos);var i=this.pos-t;128<=i&&s(t,i,this),this.pos=t-1,this.writeVarint(i),this.pos+=i},writeFloat:function(e){this.realloc(4),r.write(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),r.write(this.buf,e,this.pos,!0,52,8),this.pos+=8},writeBytes:function(e){var t=e.length;this.writeVarint(t),this.realloc(t);for(var i=0;i<t;i++)this.buf[this.pos++]=e[i]},writeRawMessage:function(e,t){this.pos++;var i=this.pos;e(t,this);var r=this.pos-i;128<=r&&s(i,r,this),this.pos=i-1,this.writeVarint(r),this.pos+=r},writeMessage:function(e,t,i){this.writeTag(e,n.Bytes),this.writeRawMessage(t,i)},writePackedVarint:function(e,t){t.length&&this.writeMessage(e,l,t)},writePackedSVarint:function(e,t){t.length&&this.writeMessage(e,u,t)},writePackedBoolean:function(e,t){t.length&&this.writeMessage(e,h,t)},writePackedFloat:function(e,t){t.length&&this.writeMessage(e,c,t)},writePackedDouble:function(e,t){t.length&&this.writeMessage(e,d,t)},writePackedFixed32:function(e,t){t.length&&this.writeMessage(e,p,t)},writePackedSFixed32:function(e,t){t.length&&this.writeMessage(e,f,t)},writePackedFixed64:function(e,t){t.length&&this.writeMessage(e,m,t)},writePackedSFixed64:function(e,t){t.length&&this.writeMessage(e,g,t)},writeBytesField:function(e,t){this.writeTag(e,n.Bytes),this.writeBytes(t)},writeFixed32Field:function(e,t){this.writeTag(e,n.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(e,t){this.writeTag(e,n.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(e,t){this.writeTag(e,n.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(e,t){this.writeTag(e,n.Fixed64),this.writeSFixed64(t)},writeVarintField:function(e,t){this.writeTag(e,n.Varint),this.writeVarint(t)},writeSVarintField:function(e,t){this.writeTag(e,n.Varint),this.writeSVarint(t)},writeStringField:function(e,t){this.writeTag(e,n.Bytes),this.writeString(t)},writeFloatField:function(e,t){this.writeTag(e,n.Fixed32),this.writeFloat(t)},writeDoubleField:function(e,t){this.writeTag(e,n.Fixed64),this.writeDouble(t)},writeBooleanField:function(e,t){this.writeVarintField(e,Boolean(t))}}},function(e,t,i){var V=i(3),r=i(22),o=r.mat4,D=r.vec4,I=i(50),z=i(62).addDynamicAttributes,O=i(51).layout,R=i(205).WritingMode;function U(e,t){var i=[e.x,e.y,0,1];a(i,i,t);var r=i[3];return{point:new V(i[0]/r,i[1]/r),signedDistanceFromCamera:r}}function G(e,t,i,r,n,a,o,s,l,u,c,d){var h=s.glyphStartIndex+s.numGlyphs,p=s.lineStartIndex,f=s.lineStartIndex+s.lineLength,m=t.getoffsetX(s.glyphStartIndex),g=t.getoffsetX(h-1),y=W(e*m,i,r,n,a,o,s.segment,p,f,l,u,c,d);if(!y)return null;var v=W(e*g,i,r,n,a,o,s.segment,p,f,l,u,c,d);return v?{first:y,last:v}:null}function $(e,t,i,r){return e===R.horizontal&&Math.abs(i.y-t.y)>Math.abs(i.x-t.x)*r?{useVertical:!0}:(e===R.vertical?t.y<i.y:t.x>i.x)?{needsFlipping:!0}:null}function L(e,t,i,r,n,a,o,s,l,u,c,d,h,p){var f,m=t/24,g=e.lineOffsetX*t,y=e.lineOffsetY*t;if(1<e.numGlyphs){var v=e.glyphStartIndex+e.numGlyphs,_=e.lineStartIndex,C=e.lineStartIndex+e.lineLength,x=G(m,s,g,y,i,c,d,e,l,a,h,!1);if(!x)return{notEnoughRoom:!0};var b=U(x.first.point,o).point,A=U(x.last.point,o).point;if(r&&!i){var S=$(e.writingMode,b,A,p);if(S)return S}f=[x.first];for(var w=e.glyphStartIndex+1;w<v-1;w++)f.push(W(m*s.getoffsetX(w),g,y,i,c,d,e.segment,_,C,l,a,h,!1));f.push(x.last)}else{if(r&&!i){var E=U(d,n).point,T=e.lineStartIndex+e.segment+1,P=new V(l.getx(T),l.gety(T)),M=U(P,n),D=0<M.signedDistanceFromCamera?M.point:H(d,P,E,1,n),I=$(e.writingMode,E,D,p);if(I)return I}var O=W(m*s.getoffsetX(e.glyphStartIndex),g,y,i,c,d,e.segment,e.lineStartIndex,e.lineStartIndex+e.lineLength,l,a,h,!1);if(!O)return{notEnoughRoom:!0};f=[O]}var R=!0,L=!1,N=void 0;try{for(var k,B=f[Symbol.iterator]();!(R=(k=B.next()).done);R=!0){var F=k.value;z(u,F.point,F.angle)}}catch(e){L=!0,N=e}finally{try{R||null==B.return||B.return()}finally{if(L)throw N}}return{}}function H(e,t,i,r,n){var a=U(e.add(e.sub(t)._unit()),n).point,o=i.sub(a);return i.add(o._mult(r/o.mag()))}function W(e,t,i,r,n,a,o,s,l,u,c,d,h){var p=r?e-t:e+t,f=0<p?1:-1,m=0;r&&(f*=-1,m=Math.PI),f<0&&(m+=Math.PI);for(var g=0<f?s+o:s+o+1,y=g,v=n,_=n,C=0,x=0,b=Math.abs(p);C+x<=b;){if((g+=f)<s||l<=g)return null;if(_=v,void 0===(v=d[g])){var A=new V(u.getx(g),u.gety(g)),S=U(A,c);if(0<S.signedDistanceFromCamera)v=d[g]=S.point;else{var w=g-f;v=H(0===C?a:new V(u.getx(w),u.gety(w)),A,_,b-C+1,c)}}C+=x,x=_.dist(v)}var E=(b-C)/x,T=v.sub(_),P=T.mult(E)._add(_);return P._add(T._unit()._perp()._mult(i*f)),{point:P,angle:m+Math.atan2(v.y-_.y,v.x-_.x),tileDistance:h?{prevTileDistance:g-f===y?0:u.gettileUnitDistanceFromAnchor(g-f),lastSegmentViewportDistance:b-C}:null}}e.exports={updateLineLabels:function(e,t,i,r,n,a,o,s){var l,u,c,d,h=r?e.textSizeData:e.iconSizeData,p=I.evaluateSizeForZoom(h,i.transform.zoom,O.properties[r?"text-size":"icon-size"]),f=[256/i.width*2+1,256/i.height*2+1],m=r?e.text.dynamicLayoutVertexArray:e.icon.dynamicLayoutVertexArray;m.clear();for(var g=e.lineVertexArray,y=r?e.text.placedSymbolArray:e.icon.placedSymbolArray,v=i.transform.width/i.transform.height,_=!1,C=0;C<y.length;C++){var x=y.get(C);if(x.hidden||x.writingMode===R.vertical&&!_)N(x.numGlyphs,m);else{_=!1;var b=[x.anchorX,x.anchorY,0,1];if(D.transformMat4(b,b,t),u=f,void 0,c=(l=b)[0]/l[3],d=l[1]/l[3],c>=-u[0]&&c<=u[0]&&d>=-u[1]&&d<=u[1]){var A=.5+b[3]/i.transform.cameraToCenterDistance*.5,S=I.evaluateSizeForFeature(h,p,x),w=o?S*A:S/A,E=new V(x.anchorX,x.anchorY),T=U(E,n).point,P={},M=L(x,w,!1,s,t,n,a,e.glyphOffsetArray,g,m,T,E,P,v);_=M.useVertical,(M.notEnoughRoom||_||M.needsFlipping&&L(x,w,!0,s,t,n,a,e.glyphOffsetArray,g,m,T,E,P,v).notEnoughRoom)&&N(x.numGlyphs,m)}else N(x.numGlyphs,m)}}r?e.text.dynamicLayoutVertexBuffer.updateData(m):e.icon.dynamicLayoutVertexBuffer.updateData(m)},getLabelPlaneMatrix:function(e,t,i,r,n){var a=o.identity(new Float32Array(16));return t?(o.identity(a),o.scale(a,a,[1/n,1/n,1]),i||o.rotateZ(a,a,r.angle)):(o.scale(a,a,[r.width/2,-r.height/2,1]),o.translate(a,a,[1,-1,0]),o.multiply(a,a,e)),a},getGlCoordMatrix:function(e,t,i,r,n){var a=o.identity(new Float32Array(16));return t?(o.multiply(a,a,e),o.scale(a,a,[n,n,1]),i||o.rotateZ(a,a,-r.angle)):(o.scale(a,a,[1,-1,1]),o.translate(a,a,[-1,-1,0]),o.scale(a,a,[2/r.width,2/r.height,1])),a},project:U,placeFirstAndLastGlyph:G,xyTransformMat4:a};var n=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function N(e,t){for(var i=0;i<e;i++){var r=t.length;t.resize(r+4),t.float32.set(n,3*r)}}function a(e,t,i){var r=t[0],n=t[1];return e[0]=i[0]*r+i[4]*n+i[12],e[1]=i[1]*r+i[5]*n+i[13],e[3]=i[3]*r+i[7]*n+i[15],e}},function(e,t,i){var r=i(206),n=i(207),a=i(208),o=(i(15),i(18),i(68)),s=i(0),l=i(122),u=l.ClearColor,c=l.ClearDepth,d=l.ClearStencil,h=l.ColorMask,p=l.DepthMask,f=l.StencilMask,m=l.StencilFunc,g=l.StencilOp,y=l.StencilTest,v=l.DepthRange,_=l.DepthTest,C=l.DepthFunc,x=l.Blend,b=l.BlendFunc,A=l.BlendColor,S=l.Program,w=l.LineWidth,E=l.ActiveTextureUnit,T=l.Viewport,P=l.BindFramebuffer,M=l.BindRenderbuffer,D=l.BindTexture,I=l.BindVertexBuffer,O=l.BindElementBuffer,R=l.BindVertexArrayOES,L=l.PixelStoreUnpack,N=l.PixelStoreUnpackPremultiplyAlpha,k=(function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(B.prototype,[{key:"createIndexBuffer",value:function(e,t){return new r(this,e,t)}},{key:"createVertexBuffer",value:function(e,t,i){return new n(this,e,t,i)}},{key:"createRenderbuffer",value:function(e,t,i){var r=this.gl,n=r.createRenderbuffer();return this.bindRenderbuffer.set(n),r.renderbufferStorage(r.RENDERBUFFER,e,t,i),this.bindRenderbuffer.set(null),n}},{key:"createFramebuffer",value:function(e,t){return new a(this,e,t)}},{key:"clear",value:function(e){var t=e.color,i=e.depth,r=this.gl,n=0;t&&(n|=r.COLOR_BUFFER_BIT,this.clearColor.set(t),this.colorMask.set([!0,!0,!0,!0])),void 0!==i&&(n|=r.DEPTH_BUFFER_BIT,this.clearDepth.set(i),this.depthMask.set(!0)),r.clear(n)}},{key:"setDepthMode",value:function(e){e.func!==this.gl.ALWAYS||e.mask?(this.depthTest.set(!0),this.depthFunc.set(e.func),this.depthMask.set(e.mask),this.depthRange.set(e.range)):this.depthTest.set(!1)}},{key:"setStencilMode",value:function(e){e.func!==this.gl.ALWAYS||e.mask?(this.stencilTest.set(!0),this.stencilMask.set(e.mask),this.stencilOp.set([e.fail,e.depthFail,e.pass]),this.stencilFunc.set({func:e.test.func,ref:e.ref,mask:e.test.mask})):this.stencilTest.set(!1)}},{key:"setColorMode",value:function(e){s.deepEqual(e.blendFunction,o.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(e.blendFunction),this.blendColor.set(e.blendColor)),this.colorMask.set(e.mask)}}]),B);function B(e){!function(e){if(!(e instanceof B))throw new TypeError("Cannot call a class as a function")}(this),this.gl=e,this.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object"),this.lineWidthRange=e.getParameter(e.ALIASED_LINE_WIDTH_RANGE),this.clearColor=new u(this),this.clearDepth=new c(this),this.clearStencil=new d(this),this.colorMask=new h(this),this.depthMask=new p(this),this.stencilMask=new f(this),this.stencilFunc=new m(this),this.stencilOp=new g(this),this.stencilTest=new y(this),this.depthRange=new v(this),this.depthTest=new _(this),this.depthFunc=new C(this),this.blend=new x(this),this.blendFunc=new b(this),this.blendColor=new A(this),this.program=new S(this),this.lineWidth=new w(this),this.activeTexture=new E(this),this.viewport=new T(this),this.bindFramebuffer=new P(this),this.bindRenderbuffer=new M(this),this.bindTexture=new D(this),this.bindVertexBuffer=new I(this),this.bindElementBuffer=new O(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new R(this),this.pixelStoreUnpack=new L(this),this.pixelStoreUnpackPremultiplyAlpha=new N(this),this.extTextureFilterAnisotropic=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=e.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.extTextureHalfFloat=e.getExtension("OES_texture_half_float"),this.extTextureHalfFloat&&e.getExtension("OES_texture_half_float_linear")}e.exports=k},function(e,t,i){function r(e,t,i){!function(e){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}(this),this.blendFunction=e,this.blendColor=t,this.mask=i}var n=i(12);r.disabled=new r(r.Replace=[1,0],n.transparent,[!1,!1,!1,!1]),r.unblended=new r(r.Replace,n.transparent,[!0,!0,!0,!0]),r.alphaBlended=new r([1,771],n.transparent,[!0,!0,!0,!0]),e.exports=r},function(e,t,i){function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function n(e,t,i){return t&&r(e.prototype,t),i&&r(e,i),e}function D(e,t,i){a(this,D),this.text=e,this.icon=t,this.skipFade=i}var o=i(120),d=i(6),I=i(50),h=i(66),O=i(51).layout,R=i(1),p=i(28),s=(n(f,[{key:"isHidden",value:function(){return 0===this.opacity&&!this.placed}}]),f),E=(n(c,[{key:"isHidden",value:function(){return this.text.isHidden()&&this.icon.isHidden()}}]),c),l=(n(u,[{key:"placeLayerTile",value:function(e,t,i,r){var n=t.getBucket(e);if(n){var a=n.layers[0].layout,o=Math.pow(2,this.transform.zoom-t.tileID.overscaledZ),s=t.tileSize/d,l=this.transform.calculatePosMatrix(t.tileID.toUnwrapped()),u=h.getLabelPlaneMatrix(l,"map"===a.get("text-pitch-alignment"),"map"===a.get("text-rotation-alignment"),this.transform,p(t,1,this.transform.zoom)),c=h.getLabelPlaneMatrix(l,"map"===a.get("icon-pitch-alignment"),"map"===a.get("icon-rotation-alignment"),this.transform,p(t,1,this.transform.zoom));this.placeLayerBucket(n,l,u,c,o,s,i,r,t.collisionBoxArray,t.tileID.key,e.source)}}},{key:"placeLayerBucket",value:function(e,t,i,r,n,a,o,s,l,u,c){var d=e.layers[0].layout,h=I.evaluateSizeForZoom(e.textSizeData,this.transform.zoom,O.properties["text-size"]),p=!e.hasTextData()||d.get("text-optional"),f=!e.hasIconData()||d.get("icon-optional"),m=!0,g=!1,y=void 0;try{for(var v,_=e.symbolInstances[Symbol.iterator]();!(m=(v=_.next()).done);m=!0){var C=v.value;if(!s[C.crossTileID]){var x=!1,b=!1,A=!0,S=null,w=null,E=null;C.collisionArrays||(C.collisionArrays=e.deserializeCollisionBoxes(l,C.textBoxStartIndex,C.textBoxEndIndex,C.iconBoxStartIndex,C.iconBoxEndIndex)),C.collisionArrays.textBox&&(x=0<(S=this.collisionIndex.placeCollisionBox(C.collisionArrays.textBox,d.get("text-allow-overlap"),a,t)).box.length,A=A&&S.offscreen);var T=C.collisionArrays.textCircles;if(T){var P=e.text.placedSymbolArray.get(C.placedTextSymbolIndices[0]),M=I.evaluateSizeForFeature(e.textSizeData,h,P);w=this.collisionIndex.placeCollisionCircles(T,d.get("text-allow-overlap"),n,a,C.key,P,e.lineVertexArray,e.glyphOffsetArray,M,t,i,o,"map"===d.get("text-pitch-alignment")),x=d.get("text-allow-overlap")||0<w.circles.length,A=A&&w.offscreen}C.collisionArrays.iconBox&&(b=0<(E=this.collisionIndex.placeCollisionBox(C.collisionArrays.iconBox,d.get("icon-allow-overlap"),a,t)).box.length,A=A&&E.offscreen),p||f?f?p||(b=b&&x):x=b&&x:b=x=b&&x,x&&S&&this.collisionIndex.insertCollisionBox(S.box,d.get("text-ignore-placement"),u,c,e.bucketInstanceId,C.textBoxStartIndex),b&&E&&this.collisionIndex.insertCollisionBox(E.box,d.get("icon-ignore-placement"),u,c,e.bucketInstanceId,C.iconBoxStartIndex),x&&w&&this.collisionIndex.insertCollisionCircles(w.circles,d.get("text-ignore-placement"),u,c,e.bucketInstanceId,C.textBoxStartIndex),R(0!==C.crossTileID),R(0!==e.bucketInstanceId),this.placements[C.crossTileID]=new D(x,b,A||e.justReloaded),s[C.crossTileID]=!0}}}catch(e){g=!0,y=e}finally{try{m||null==_.return||_.return()}finally{if(g)throw y}}e.justReloaded=!1}},{key:"commit",value:function(e,t){this.commitTime=t;var i=!1,r=e&&0!==this.fadeDuration?(this.commitTime-e.commitTime)/this.fadeDuration:1,n=e?e.opacities:{};for(var a in this.placements){var o=this.placements[a],s=n[a];i=s?(this.opacities[a]=new E(s,r,o.text,o.icon),i||o.text!==s.text.placed||o.icon!==s.icon.placed):(this.opacities[a]=new E(null,r,o.text,o.icon,o.skipFade),i||o.text||o.icon)}for(var l in n){var u=n[l];if(!this.opacities[l]){var c=new E(u,r,!1,!1);c.isHidden()||(this.opacities[l]=c,i=i||u.text.placed||u.icon.placed)}}return i}},{key:"updateLayerOpacities",value:function(e,t){var i={},r=!0,n=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(r=(o=s.next()).done);r=!0){var l=o.value,u=l.getBucket(e);u&&this.updateBucketOpacities(u,i,l.collisionBoxArray)}}catch(e){n=!0,a=e}finally{try{r||null==s.return||s.return()}finally{if(n)throw a}}}},{key:"updateBucketOpacities",value:function(e,t,i){e.hasTextData()&&e.text.opacityVertexArray.clear(),e.hasIconData()&&e.icon.opacityVertexArray.clear(),e.hasCollisionBoxData()&&e.collisionBox.collisionVertexArray.clear(),e.hasCollisionCircleData()&&e.collisionCircle.collisionVertexArray.clear();for(var r=e.layers[0].layout,n=new E(null,0,r.get("text-allow-overlap"),r.get("icon-allow-overlap"),!0),a=0;a<e.symbolInstances.length;a++){var o=e.symbolInstances[a],s=t[o.crossTileID],l=this.opacities[o.crossTileID];l?s&&(l=n):(l=n,this.opacities[o.crossTileID]=l),t[o.crossTileID]=!0;var u=0<o.numGlyphVertices||0<o.numVerticalGlyphVertices,c=0<o.numIconVertices;if(u){for(var d=P(l.text),h=(o.numGlyphVertices+o.numVerticalGlyphVertices)/4,p=0;p<h;p++)e.text.opacityVertexArray.emplaceBack(d);var f=!0,m=!1,g=void 0;try{for(var y,v=o.placedTextSymbolIndices[Symbol.iterator]();!(f=(y=v.next()).done);f=!0){var _=y.value;e.text.placedSymbolArray.get(_).hidden=l.text.isHidden()}}catch(e){m=!0,g=e}finally{try{f||null==v.return||v.return()}finally{if(m)throw g}}}if(c){for(var C=P(l.icon),x=0;x<o.numIconVertices/4;x++)e.icon.opacityVertexArray.emplaceBack(C);e.icon.placedSymbolArray.get(a).hidden=l.icon.isHidden()}o.collisionArrays||(o.collisionArrays=e.deserializeCollisionBoxes(i,o.textBoxStartIndex,o.textBoxEndIndex,o.iconBoxStartIndex,o.iconBoxEndIndex));var b=o.collisionArrays;if(b){b.textBox&&e.hasCollisionBoxData()&&T(e.collisionBox.collisionVertexArray,l.text.placed,!1),b.iconBox&&e.hasCollisionBoxData()&&T(e.collisionBox.collisionVertexArray,l.icon.placed,!1);var A=b.textCircles;if(A&&e.hasCollisionCircleData())for(var S=0;S<A.length;S+=5){var w=s||0===A[S+4];T(e.collisionCircle.collisionVertexArray,l.text.placed,w)}}}e.sortFeatures(this.transform.angle),e.hasTextData()&&e.text.opacityVertexBuffer&&e.text.opacityVertexBuffer.updateData(e.text.opacityVertexArray),e.hasIconData()&&e.icon.opacityVertexBuffer&&e.icon.opacityVertexBuffer.updateData(e.icon.opacityVertexArray),e.hasCollisionBoxData()&&e.collisionBox.collisionVertexBuffer&&e.collisionBox.collisionVertexBuffer.updateData(e.collisionBox.collisionVertexArray),e.hasCollisionCircleData()&&e.collisionCircle.collisionVertexBuffer&&e.collisionCircle.collisionVertexBuffer.updateData(e.collisionCircle.collisionVertexArray),R(e.text.opacityVertexArray.length===e.text.layoutVertexArray.length/4),R(e.icon.opacityVertexArray.length===e.icon.layoutVertexArray.length/4)}},{key:"symbolFadeChange",value:function(e){return 0===this.fadeDuration?1:(e-this.commitTime)/this.fadeDuration}},{key:"hasTransitions",value:function(e){return this.symbolFadeChange(e)<1||this.stale}},{key:"stillRecent",value:function(e){return this.recentUntil>e}},{key:"setRecent",value:function(e,t){this.stale=t,this.recentUntil=e+this.fadeDuration}},{key:"setStale",value:function(){this.stale=!0}}]),u);function u(e,t){a(this,u),this.transform=e.clone(),this.collisionIndex=new o(this.transform),this.recentUntil=-1/0,this.placements={},this.opacities={},this.stale=!1,this.fadeDuration=t}function c(e,t,i,r,n){a(this,c),this.text=new s(e?e.text:null,t,i,n),this.icon=new s(e?e.icon:null,t,r,n)}function f(e,t,i,r){a(this,f),this.opacity=e?Math.max(0,Math.min(1,e.opacity+(e.placed?t:-t))):r&&i?1:0,this.placed=i}function T(e,t,i){e.emplaceBack(t?1:0,i?1:0),e.emplaceBack(t?1:0,i?1:0),e.emplaceBack(t?1:0,i?1:0),e.emplaceBack(t?1:0,i?1:0)}var m=Math.pow(2,25),g=Math.pow(2,24),y=Math.pow(2,17),v=Math.pow(2,16),_=Math.pow(2,9),C=Math.pow(2,8),x=Math.pow(2,1);function P(e){if(0===e.opacity&&!e.placed)return 0;if(1===e.opacity&&e.placed)return 4294967295;var t=e.placed?1:0,i=Math.floor(127*e.opacity);return i*m+t*g+i*y+t*v+i*_+t*C+i*x+t}e.exports=l},function(e,t,i){var c=i(1),l=i(28);t.isPatternMissing=function(e,t){if(!e)return!1;var i=t.imageManager.getPattern(e.from),r=t.imageManager.getPattern(e.to);return!i||!r},t.prepare=function(e,t,i){var r=t.context,n=r.gl,a=t.imageManager.getPattern(e.from),o=t.imageManager.getPattern(e.to);c(a&&o),n.uniform1i(i.uniforms.u_image,0),n.uniform2fv(i.uniforms.u_pattern_tl_a,a.tl),n.uniform2fv(i.uniforms.u_pattern_br_a,a.br),n.uniform2fv(i.uniforms.u_pattern_tl_b,o.tl),n.uniform2fv(i.uniforms.u_pattern_br_b,o.br);var s=t.imageManager.getPixelSize(),l=s.width,u=s.height;n.uniform2fv(i.uniforms.u_texsize,[l,u]),n.uniform1f(i.uniforms.u_mix,e.t),n.uniform2fv(i.uniforms.u_pattern_size_a,a.displaySize),n.uniform2fv(i.uniforms.u_pattern_size_b,o.displaySize),n.uniform1f(i.uniforms.u_scale_a,e.fromScale),n.uniform1f(i.uniforms.u_scale_b,e.toScale),r.activeTexture.set(n.TEXTURE0),t.imageManager.bind(t.context)},t.setTile=function(e,t,i){var r=t.context.gl;r.uniform1f(i.uniforms.u_tile_units_to_pixels,1/l(e,1,t.transform.tileZoom(e)));var n=Math.pow(2,e.tileID.overscaledZ),a=e.tileSize*Math.pow(2,t.transform.tileZoom(e))/n,o=a*(e.tileID.canonical.x+e.tileID.wrap*n),s=a*e.tileID.canonical.y;r.uniform2f(i.uniforms.u_pixel_coord_upper,o>>16,s>>16),r.uniform2f(i.uniforms.u_pixel_coord_lower,65535&o,65535&s)}},function(e,t,i){var r=i(72),n=i(2),a=i(132).version,o=i(133),s=i(295),l=i(296),u=i(128),c=i(297),d=i(298),h=i(299),p=i(129),f=i(53),m=i(21),g=i(39),y=i(3),v=i(10),_=i(64),C=i(49),x=i(300);e.exports={version:a,supported:r,workerCount:Math.max(Math.floor(n.hardwareConcurrency/2),1),setRTLTextPlugin:C.setRTLTextPlugin,Map:o,NavigationControl:s,GeolocateControl:l,AttributionControl:u,ScaleControl:c,FullscreenControl:d,Popup:h,Marker:p,Style:f,LngLat:m,LngLatBounds:g,Point:y,Evented:v,config:_,BasicRenderer:x,get accessToken(){return _.ACCESS_TOKEN},set accessToken(e){_.ACCESS_TOKEN=e}}},function(e,t,i){function a(e){return!!("undefined"!=typeof window&&"undefined"!=typeof document&&Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray&&Function.prototype&&Function.prototype.bind&&Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions&&"JSON"in window&&"parse"in JSON&&"stringify"in JSON&&function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var e,t,i=new Blob([""],{type:"text/javascript"}),r=URL.createObjectURL(i);try{t=new Worker(r),e=!0}catch(t){e=!1}return t&&t.terminate(),URL.revokeObjectURL(r),e}()&&"Uint8ClampedArray"in window&&ArrayBuffer.isView&&(t=e&&e.failIfMajorPerformanceCaveat,void 0===o[t]&&(o[t]=(i=t,r=document.createElement("canvas"),(n=Object.create(a.webGLContextAttributes)).failIfMajorPerformanceCaveat=i,r.probablySupportsContext?r.probablySupportsContext("webgl",n)||r.probablySupportsContext("experimental-webgl",n):r.supportsContext?r.supportsContext("webgl",n)||r.supportsContext("experimental-webgl",n):r.getContext("webgl",n)||r.getContext("experimental-webgl",n))),o[t]));var t,i,r,n}e.exports?e.exports=a:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=a);var o={};a.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}},function(e,t){function i(e,t,i,r){this.cx=3*e,this.bx=3*(i-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(r-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=r,this.p2x=i,this.p2y=r}(e.exports=i).prototype.sampleCurveX=function(e){return((this.ax*e+this.bx)*e+this.cx)*e},i.prototype.sampleCurveY=function(e){return((this.ay*e+this.by)*e+this.cy)*e},i.prototype.sampleCurveDerivativeX=function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},i.prototype.solveCurveX=function(e,t){var i,r,n,a,o;for(void 0===t&&(t=1e-6),n=e,o=0;o<8;o++){if(a=this.sampleCurveX(n)-e,Math.abs(a)<t)return n;var s=this.sampleCurveDerivativeX(n);if(Math.abs(s)<1e-6)break;n-=a/s}if((n=e)<(i=0))return i;if(n>(r=1))return r;for(;i<r;){if(a=this.sampleCurveX(n),Math.abs(a-e)<t)return n;a<e?i=n:r=n,n=.5*(r-i)+i}return n},i.prototype.solve=function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))}},function(e,t){function a(e){return(a="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})(e)}e.exports=function e(t,i){if(Array.isArray(t)){if(!Array.isArray(i)||t.length!==i.length)return!1;for(var r=0;r<t.length;r++)if(!e(t[r],i[r]))return!1;return!0}if("object"!==a(t)||null===t||null===i)return t===i;if("object"!==a(i))return!1;if(Object.keys(t).length!==Object.keys(i).length)return!1;for(var n in t)if(!e(t[n],i[n]))return!1;return!0}},function(e,t,i){var r=i(7);e.exports=function(e){var t=e.key,i=e.value;return i?[new r(t,i,"constants have been deprecated as of v8")]:[]}},function(e,t){function r(e){return(r="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})(e)}function i(e){var r="function"==typeof Map?new Map:void 0;return(i=function(e){if(null===e||(t=e,-1===Function.toString.call(t).indexOf("[native code]")))return e;var t;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(e))return r.get(e);r.set(e,i)}function i(){return n(e,arguments,o(this).constructor)}return i.prototype=Object.create(e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),a(i,e)})(e)}function n(e,t,i){return(n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}()?Reflect.construct:function(e,t,i){var r=[null];r.push.apply(r,t);var n=new(Function.bind.apply(e,r));return i&&a(n,i.prototype),n}).apply(null,arguments)}function a(e,t){return(a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function o(e){return(o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var s=(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(l,i(Error)),l);function l(e,t){var i;return function(e){if(!(e instanceof l))throw new TypeError("Cannot call a class as a function")}(this),(i=function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,o(l).call(this,t))).message=t,i.key=e,i}e.exports=s},function(e,t,h){function p(e){return(p="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})(e)}var a=h(78),r=h(8).checkSubtype,o=h(76),f=h(79),m=h(81),g=h(82),y=h(83),i=(function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(s.prototype,[{key:"parse",value:function(e,t,i,r){var n=4<arguments.length&&void 0!==arguments[4]?arguments[4]:{},a=this;if(t&&(a=a.concat(t,i,r)),null!==e&&"string"!=typeof e&&"boolean"!=typeof e&&"number"!=typeof e||(e=["literal",e]),Array.isArray(e)){if(0===e.length)return a.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var o=e[0];if("string"!=typeof o)return a.error("Expression name must be a string, but found ".concat(p(o),' instead. If you wanted a literal array, use ["literal", [...]].'),0),null;var s=a.registry[o];if(s){var l=s.parse(e,a);if(!l)return null;if(a.expectedType){var u=a.expectedType,c=l.type;if("string"!==u.kind&&"number"!==u.kind&&"boolean"!==u.kind||"value"!==c.kind)if("array"===u.kind&&"value"===c.kind)n.omitTypeAnnotations||(l=new g(u,l));else if("color"!==u.kind||"value"!==c.kind&&"string"!==c.kind){if(a.checkSubtype(a.expectedType,l.type))return null}else n.omitTypeAnnotations||(l=new y(u,[l]));else n.omitTypeAnnotations||(l=new m(u,[l]))}if(!(l instanceof f)&&function(e){var t=h(42).CompoundExpression,i=h(84),r=i.isGlobalPropertyConstant,n=i.isFeatureConstant;if(e instanceof h(85))return!1;if(e instanceof t&&"error"===e.name)return!1;var a=!0;return e.eachChild(function(e){e instanceof f||(a=!1)}),!!a&&n(e)&&r(e,["zoom","heatmap-density"])}(l)){var d=new(h(55));try{l=new f(l.type,l.evaluate(d))}catch(e){return a.error(e.message),null}}return l}return a.error('Unknown expression "'.concat(o,'". If you wanted a literal array, use ["literal", [...]].'),0)}return void 0===e?a.error("'undefined' value invalid. Use null instead."):"object"===p(e)?a.error('Bare objects invalid. Use ["literal", {...}] instead.'):a.error("Expected an array, but found ".concat(p(e)," instead."))}},{key:"concat",value:function(e,t,i){var r="number"==typeof e?this.path.concat(e):this.path,n=i?this.scope.concat(i):this.scope;return new s(this.registry,r,t||null,n,this.errors)}},{key:"error",value:function(e){for(var t=arguments.length,i=new Array(1<t?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];var n="".concat(this.key).concat(i.map(function(e){return"[".concat(e,"]")}).join(""));this.errors.push(new o(n,e))}},{key:"checkSubtype",value:function(e,t){var i=r(e,t);return i&&this.error(i),i}}]),s);function s(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:[],i=2<arguments.length?arguments[2]:void 0,r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:new a,n=4<arguments.length&&void 0!==arguments[4]?arguments[4]:[];!function(e){if(!(e instanceof s))throw new TypeError("Cannot call a class as a function")}(this),this.registry=e,this.path=t,this.key=t.map(function(e){return"[".concat(e,"]")}).join(""),this.scope=r,this.errors=n,this.expectedType=i}e.exports=i},function(e,t){var i=(function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(h.prototype,[{key:"concat",value:function(e){return new h(this,e)}},{key:"get",value:function(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error("".concat(e," not found in scope."))}},{key:"has",value:function(e){return!!this.bindings[e]||!!this.parent&&this.parent.has(e)}}]),h);function h(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:[];!function(e){if(!(e instanceof h))throw new TypeError("Cannot call a class as a function")}(this),this.parent=e;var i,r,n=!0,a=!(this.bindings={}),o=void 0;try{for(var s,l=t[Symbol.iterator]();!(n=(s=l.next()).done);n=!0){var u=(i=s.value,r=2,function(e){if(Array.isArray(e))return e}(i)||function(e,t){var i=[],r=!0,n=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(r=(o=s.next()).done)&&(i.push(o.value),!t||i.length!==t);r=!0);}catch(e){n=!0,a=e}finally{try{r||null==s.return||s.return()}finally{if(n)throw a}}return i}(i,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()),c=u[0],d=u[1];this.bindings[c]=d}}catch(e){a=!0,o=e}finally{try{n||null==l.return||l.return()}finally{if(a)throw o}}}e.exports=i},function(e,t,i){function r(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var n,a,o=i(25),s=o.isValue,l=o.typeOf,u=(a=[{key:"parse",value:function(e,t){if(2!==e.length)return t.error("'literal' expression requires exactly one argument, but found ".concat(e.length-1," instead."));if(!s(e[1]))return t.error("invalid value");var i=e[1],r=l(i),n=t.expectedType;return"array"!==r.kind||0!==r.N||!n||"array"!==n.kind||"number"==typeof n.N&&0!==n.N||(r=n),new c(r,i)}}],r((n=c).prototype,[{key:"evaluate",value:function(){return this.value}},{key:"eachChild",value:function(){}},{key:"possibleOutputs",value:function(){return[this.value]}}]),r(n,a),c);function c(e,t){!function(e){if(!(e instanceof c))throw new TypeError("Cannot call a class as a function")}(this),this.type=e,this.value=t}e.exports=u},function(e,t){var p={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function f(e){return(e=Math.round(e))<0?0:255<e?255:e}function i(e){return e<0?0:1<e?1:e}function m(e){return"%"===e[e.length-1]?f(parseFloat(e)/100*255):f(parseInt(e))}function g(e){return"%"===e[e.length-1]?i(parseFloat(e)/100):i(parseFloat(e))}function y(e,t,i){return i<0?i+=1:1<i&&(i-=1),6*i<1?e+(t-e)*i*6:2*i<1?t:3*i<2?e+(t-e)*(2/3-i)*6:e}try{t.parseCSSColor=function(e){var t,i=e.replace(/ /g,"").toLowerCase();if(i in p)return p[i].slice();if("#"===i[0])return 4===i.length?0<=(t=parseInt(i.substr(1),16))&&t<=4095?[(3840&t)>>4|(3840&t)>>8,240&t|(240&t)>>4,15&t|(15&t)<<4,1]:null:7===i.length&&0<=(t=parseInt(i.substr(1),16))&&t<=16777215?[(16711680&t)>>16,(65280&t)>>8,255&t,1]:null;var r=i.indexOf("("),n=i.indexOf(")");if(-1!==r&&n+1===i.length){var a=i.substr(0,r),o=i.substr(r+1,n-(r+1)).split(","),s=1;switch(a){case"rgba":if(4!==o.length)return null;s=g(o.pop());case"rgb":return 3!==o.length?null:[m(o[0]),m(o[1]),m(o[2]),s];case"hsla":if(4!==o.length)return null;s=g(o.pop());case"hsl":if(3!==o.length)return null;var l=(parseFloat(o[0])%360+360)%360/360,u=g(o[1]),c=g(o[2]),d=c<=.5?c*(u+1):c+u-c*u,h=2*c-d;return[f(255*y(h,d,l+1/3)),f(255*y(h,d,l)),f(255*y(h,d,l-1/3)),s];default:return null}}return null}}catch(e){}},function(e,t,i){function r(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var n,a,s=i(1),o=i(8),l=o.ObjectType,u=o.ValueType,c=o.StringType,d=o.NumberType,h=o.BooleanType,p=i(31),f=i(8),m=f.checkSubtype,g=f.toString,y=i(25).typeOf,v={string:c,number:d,boolean:h,object:l},_=(a=[{key:"parse",value:function(e,t){if(e.length<2)return t.error("Expected at least one argument.");var i=e[0];s(v[i],i);for(var r=v[i],n=[],a=1;a<e.length;a++){var o=t.parse(e[a],a,u);if(!o)return null;n.push(o)}return new C(r,n)}}],r((n=C).prototype,[{key:"evaluate",value:function(e){for(var t=0;t<this.args.length;t++){var i=this.args[t].evaluate(e);if(!m(this.type,y(i)))return i;if(t===this.args.length-1)throw new p("Expected value to be of type ".concat(g(this.type),", but found ").concat(g(y(i))," instead."))}return s(!1),null}},{key:"eachChild",value:function(e){this.args.forEach(e)}},{key:"possibleOutputs",value:function(){var e;return(e=[]).concat.apply(e,function(e){return function(e){if(Array.isArray(e)){for(var t=0,i=new Array(e.length);t<e.length;t++)i[t]=e[t];return i}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}(this.args.map(function(e){return e.possibleOutputs()})))}}]),r(n,a),C);function C(e,t){!function(e){if(!(e instanceof C))throw new TypeError("Cannot call a class as a function")}(this),this.type=e,this.args=t}e.exports=_},function(e,t,i){function r(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var n,a,o=i(8),s=o.toString,l=o.array,u=o.ValueType,c=o.StringType,d=o.NumberType,h=o.BooleanType,p=o.checkSubtype,f=i(25).typeOf,m=i(31),g={string:c,number:d,boolean:h},y=(a=[{key:"parse",value:function(e,t){if(e.length<2||4<e.length)return t.error("Expected 1, 2, or 3 arguments, but found ".concat(e.length-1," instead."));var i,r;if(2<e.length){var n=e[1];if("string"!=typeof n||!(n in g))return t.error('The item type argument of "array" must be one of string, number, boolean',1);i=g[n]}else i=u;if(3<e.length){if("number"!=typeof e[2]||e[2]<0||e[2]!==Math.floor(e[2]))return t.error('The length argument to "array" must be a positive integer literal',2);r=e[2]}var a=l(i,r),o=t.parse(e[e.length-1],e.length-1,u);return o?new v(a,o):null}}],r((n=v).prototype,[{key:"evaluate",value:function(e){var t=this.input.evaluate(e);if(p(this.type,f(t)))throw new m("Expected value to be of type ".concat(s(this.type),", but found ").concat(s(f(t))," instead."));return t}},{key:"eachChild",value:function(e){e(this.input)}},{key:"possibleOutputs",value:function(){return this.input.possibleOutputs()}}]),r(n,a),v);function v(e,t){!function(e){if(!(e instanceof v))throw new TypeError("Cannot call a class as a function")}(this),this.type=e,this.input=t}e.exports=y},function(e,t,i){function r(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var n,a,s=i(1),o=i(8),l=o.ColorType,u=o.ValueType,c=o.NumberType,d=i(25),g=d.Color,y=d.validateRGBA,v=i(31),h={"to-number":c,"to-color":l},p=(a=[{key:"parse",value:function(e,t){if(e.length<2)return t.error("Expected at least one argument.");var i=e[0];s(h[i],i);for(var r=h[i],n=[],a=1;a<e.length;a++){var o=t.parse(e[a],a,u);if(!o)return null;n.push(o)}return new f(r,n)}}],r((n=f).prototype,[{key:"evaluate",value:function(e){if("color"===this.type.kind){var t,i,r=!0,n=!1,a=void 0;try{for(var o,s=this.args[Symbol.iterator]();!(r=(o=s.next()).done);r=!0)if(t=o.value.evaluate(e),i=null,"string"==typeof t){var l=e.parseColor(t);if(l)return l}else if(Array.isArray(t)&&!(i=t.length<3||4<t.length?"Invalid rbga value ".concat(JSON.stringify(t),": expected an array containing either three or four numeric values."):y(t[0],t[1],t[2],t[3])))return new g(t[0]/255,t[1]/255,t[2]/255,t[3])}catch(e){n=!0,a=e}finally{try{r||null==s.return||s.return()}finally{if(n)throw a}}throw new v(i||"Could not parse color from value '".concat("string"==typeof t?t:JSON.stringify(t),"'"))}var u=null,c=!0,d=!1,h=void 0;try{for(var p,f=this.args[Symbol.iterator]();!(c=(p=f.next()).done);c=!0)if(null!==(u=p.value.evaluate(e))){var m=Number(u);if(!isNaN(m))return m}}catch(e){d=!0,h=e}finally{try{c||null==f.return||f.return()}finally{if(d)throw h}}throw new v("Could not convert ".concat(JSON.stringify(u)," to number."))}},{key:"eachChild",value:function(e){this.args.forEach(e)}},{key:"possibleOutputs",value:function(){var e;return(e=[]).concat.apply(e,function(e){return function(e){if(Array.isArray(e)){for(var t=0,i=new Array(e.length);t<e.length;t++)i[t]=e[t];return i}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}(this.args.map(function(e){return e.possibleOutputs()})))}}]),r(n,a),f);function f(e,t){!function(e){if(!(e instanceof f))throw new TypeError("Cannot call a class as a function")}(this),this.type=e,this.args=t}e.exports=p},function(e,t,i){var n=i(42).CompoundExpression;e.exports={isFeatureConstant:function t(e){if(e instanceof n){if("get"===e.name&&1===e.args.length)return!1;if("has"===e.name&&1===e.args.length)return!1;if("properties"===e.name||"geometry-type"===e.name||"id"===e.name)return!1;if(e.name.startsWith("filter-"))return!1}var i=!0;return e.eachChild(function(e){i&&!t(e)&&(i=!1)}),i},isGlobalPropertyConstant:function t(e,i){if(e instanceof n&&0<=i.indexOf(e.name))return!1;var r=!0;return e.eachChild(function(e){r&&!t(e,i)&&(r=!1)}),r}}},function(e,t){function i(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var r,n,a=(n=[{key:"parse",value:function(e,t){if(2!==e.length||"string"!=typeof e[1])return t.error("'var' expression requires exactly one string literal argument.");var i=e[1];return t.scope.has(i)?new o(i,t.scope.get(i).type):t.error('Unknown variable "'.concat(i,'". Make sure "').concat(i,'" has been bound in an enclosing "let" expression before using it.'),1)}}],i((r=o).prototype,[{key:"evaluate",value:function(e){return e.scope.get(this.name).evaluate(e)}},{key:"eachChild",value:function(){}},{key:"possibleOutputs",value:function(){return[void 0]}}]),i(r,n),o);function o(e,t){!function(e){if(!(e instanceof o))throw new TypeError("Cannot call a class as a function")}(this),this.type=t,this.name=e}e.exports=a},function(e,t,i){function f(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}function m(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function g(e){if(Array.isArray(e))return e}function r(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var n,a,y=i(8).NumberType,o=i(87).findStopLessThanOrEqualTo,s=(a=[{key:"parse",value:function(e,t){var i,r=g(i=e)||f(i)||m(),n=r[1],a=r.slice(2);if(e.length-1<4)return t.error("Expected at least 4 arguments, but found only ".concat(e.length-1,"."));if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");if(!(n=t.parse(n,1,y)))return null;var o=[],s=null;t.expectedType&&"value"!==t.expectedType.kind&&(s=t.expectedType),a.unshift(-1/0);for(var l=0;l<a.length;l+=2){var u=a[l],c=a[l+1],d=l+1,h=l+2;if("number"!=typeof u)return t.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',d);if(o.length&&o[o.length-1][0]>=u)return t.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',d);var p=t.parse(c,h,s);if(!p)return null;s=s||p.type,o.push([u,p])}return new v(s,n,o)}}],r((n=v).prototype,[{key:"evaluate",value:function(e){var t=this.labels,i=this.outputs;if(1===t.length)return i[0].evaluate(e);var r=this.input.evaluate(e);if(r<=t[0])return i[0].evaluate(e);var n=t.length;return r>=t[n-1]?i[n-1].evaluate(e):i[o(t,r)].evaluate(e)}},{key:"eachChild",value:function(e){e(this.input);var t=!0,i=!1,r=void 0;try{for(var n,a=this.outputs[Symbol.iterator]();!(t=(n=a.next()).done);t=!0)e(n.value)}catch(e){i=!0,r=e}finally{try{t||null==a.return||a.return()}finally{if(i)throw r}}}},{key:"possibleOutputs",value:function(){var e;return(e=[]).concat.apply(e,function(e){return function(e){if(Array.isArray(e)){for(var t=0,i=new Array(e.length);t<e.length;t++)i[t]=e[t];return i}}(e)||f(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}(this.outputs.map(function(e){return e.possibleOutputs()})))}}]),r(n,a),v);function v(e,t,i){!function(e){if(!(e instanceof v))throw new TypeError("Cannot call a class as a function")}(this),this.type=e,this.input=t,this.labels=[];var r,n,a=!0,o=!(this.outputs=[]),s=void 0;try{for(var l,u=i[Symbol.iterator]();!(a=(l=u.next()).done);a=!0){var c=(r=l.value,n=2,g(r)||function(e,t){var i=[],r=!0,n=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(r=(o=s.next()).done)&&(i.push(o.value),!t||i.length!==t);r=!0);}catch(e){n=!0,a=e}finally{try{r||null==s.return||s.return()}finally{if(n)throw a}}return i}(r,n)||m()),d=c[0],h=c[1];this.labels.push(d),this.outputs.push(h)}}catch(e){o=!0,s=e}finally{try{a||null==u.return||u.return()}finally{if(o)throw s}}}e.exports=s},function(e,t,i){var s=i(31);e.exports={findStopLessThanOrEqualTo:function(e,t){for(var i,r,n=0,a=e.length-1,o=0;n<=a;){if(i=e[o=Math.floor((n+a)/2)],r=e[o+1],t===i||i<t&&t<r)return o;if(i<t)n=o+1;else{if(!(t<i))throw new s("Input is not a number.");a=o-1}}return Math.max(o-1,0)}}},function(e,t,i){function r(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var n,a,h=i(1),o=i(8),p=o.checkSubtype,f=o.ValueType,s=(a=[{key:"parse",value:function(e,t){if(e.length<2)return t.error("Expectected at least one argument.");var i=null,r=t.expectedType;r&&"value"!==r.kind&&(i=r);var n=[],a=!0,o=!1,s=void 0;try{for(var l,u=e.slice(1)[Symbol.iterator]();!(a=(l=u.next()).done);a=!0){var c=l.value,d=t.parse(c,1+n.length,i,void 0,{omitTypeAnnotations:!0});if(!d)return null;i=i||d.type,n.push(d)}}catch(e){o=!0,s=e}finally{try{a||null==u.return||u.return()}finally{if(o)throw s}}return h(i),new m(r&&n.some(function(e){return p(r,e.type)})?f:i,n)}}],r((n=m).prototype,[{key:"evaluate",value:function(e){var t=null,i=!0,r=!1,n=void 0;try{for(var a,o=this.args[Symbol.iterator]();!(i=(a=o.next()).done)&&null===(t=a.value.evaluate(e));i=!0);}catch(e){r=!0,n=e}finally{try{i||null==o.return||o.return()}finally{if(r)throw n}}return t}},{key:"eachChild",value:function(e){this.args.forEach(e)}},{key:"possibleOutputs",value:function(){var e;return(e=[]).concat.apply(e,function(e){return function(e){if(Array.isArray(e)){for(var t=0,i=new Array(e.length);t<e.length;t++)i[t]=e[t];return i}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}(this.args.map(function(e){return e.possibleOutputs()})))}}]),r(n,a),m);function m(e,t){!function(e){if(!(e instanceof m))throw new TypeError("Cannot call a class as a function")}(this),this.type=e,this.args=t}e.exports=s},function(e,t){function s(e){return(s="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})(e)}function i(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var r,n,a=(n=[{key:"parse",value:function(e,t){if(e.length<4)return t.error("Expected at least 3 arguments, but found ".concat(e.length-1," instead."));for(var i=[],r=1;r<e.length-1;r+=2){var n=e[r];if("string"!=typeof n)return t.error("Expected string, but found ".concat(s(n)," instead."),r);if(/[^a-zA-Z0-9_]/.test(n))return t.error("Variable names must contain only alphanumeric characters or '_'.",r);var a=t.parse(e[r+1],r+1);if(!a)return null;i.push([n,a])}var o=t.parse(e[e.length-1],e.length-1,void 0,i);return o?new l(i,o):null}}],i((r=l).prototype,[{key:"evaluate",value:function(e){e.pushScope(this.bindings);var t=this.result.evaluate(e);return e.popScope(),t}},{key:"eachChild",value:function(e){var t=!0,i=!1,r=void 0;try{for(var n,a=this.bindings[Symbol.iterator]();!(t=(n=a.next()).done);t=!0)e(n.value[1])}catch(e){i=!0,r=e}finally{try{t||null==a.return||a.return()}finally{if(i)throw r}}e(this.result)}},{key:"possibleOutputs",value:function(){return this.result.possibleOutputs()}}]),i(r,n),l);function l(e,t){!function(e){if(!(e instanceof l))throw new TypeError("Cannot call a class as a function")}(this),this.type=t.type,this.bindings=[].concat(e),this.result=t}e.exports=a},function(e,t,i){function r(e){return function(e){if(Array.isArray(e)){for(var t=0,i=new Array(e.length);t<e.length;t++)i[t]=e[t];return i}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function s(e){return(s="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})(e)}function u(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var i=[],r=!0,n=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(r=(o=s.next()).done)&&(i.push(o.value),!t||i.length!==t);r=!0);}catch(e){n=!0,a=e}finally{try{r||null==s.return||s.return()}finally{if(n)throw a}}return i}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var n=i(8),a=n.NumberType,o=n.StringType,l=n.BooleanType,c=n.ColorType,d=n.ObjectType,h=n.ValueType,p=n.ErrorType,f=n.array,m=n.toString,g=i(25),y=g.typeOf,v=g.Color,_=g.validateRGBA,C=i(42),x=C.CompoundExpression,b=C.varargs,A=i(31),S=i(89),w=i(85),E=i(79),T=i(81),P=i(82),M=i(83),D=i(142),I=i(143),O=i(144),R=i(86),L=i(56),N=i(88),k=i(145),B={"==":k.Equals,"!=":k.NotEquals,array:P,at:D,boolean:T,case:O,coalesce:N,interpolate:L,let:S,literal:E,match:I,number:T,object:T,step:R,string:T,"to-color":M,"to-number":M,var:w};function F(e,t){var i=u(t,4),r=i[0],n=i[1],a=i[2],o=i[3];r=r.evaluate(e),n=n.evaluate(e),a=a.evaluate(e);var s=o?o.evaluate(e):1,l=_(r,n,a,s);if(l)throw new A(l);return new v(r/255*s,n/255*s,a/255*s,s)}function V(e,t){return e in t}function z(e,t){var i=t[e];return void 0===i?null:i}function U(e,t){return u(t,1)[0].evaluate(e).length}function G(e,t){var i=u(t,2),r=i[0],n=i[1];return r.evaluate(e)<n.evaluate(e)}function $(e,t){var i=u(t,2),r=i[0],n=i[1];return r.evaluate(e)>n.evaluate(e)}function H(e,t){var i=u(t,2),r=i[0],n=i[1];return r.evaluate(e)<=n.evaluate(e)}function W(e,t){var i=u(t,2),r=i[0],n=i[1];return r.evaluate(e)>=n.evaluate(e)}x.register(B,{error:[p,[o],function(e,t){var i=u(t,1)[0];throw new A(i.evaluate(e))}],typeof:[o,[h],function(e,t){var i=u(t,1)[0];return m(y(i.evaluate(e)))}],"to-string":[o,[h],function(e,t){var i=u(t,1)[0],r=s(i=i.evaluate(e));return null===i||"string"===r||"number"===r||"boolean"===r?String(i):i instanceof v?i.toString():JSON.stringify(i)}],"to-boolean":[l,[h],function(e,t){var i=u(t,1)[0];return Boolean(i.evaluate(e))}],"to-rgba":[f(a,4),[c],function(e,t){var i=u(t,1)[0].evaluate(e),r=i.r,n=i.g,a=i.b,o=i.a;return[255*r/o,255*n/o,255*a/o,o]}],rgb:[c,[a,a,a],F],rgba:[c,[a,a,a,a],F],length:{type:a,overloads:[[[o],U],[[f(h)],U]]},has:{type:l,overloads:[[[o],function(e,t){return V(u(t,1)[0].evaluate(e),e.properties())}],[[o,d],function(e,t){var i=u(t,2),r=i[0],n=i[1];return V(r.evaluate(e),n.evaluate(e))}]]},get:{type:h,overloads:[[[o],function(e,t){return z(u(t,1)[0].evaluate(e),e.properties())}],[[o,d],function(e,t){var i=u(t,2),r=i[0],n=i[1];return z(r.evaluate(e),n.evaluate(e))}]]},properties:[d,[],function(e){return e.properties()}],"geometry-type":[o,[],function(e){return e.geometryType()}],id:[h,[],function(e){return e.id()}],zoom:[a,[],function(e){return e.globals.zoom}],"heatmap-density":[a,[],function(e){return e.globals.heatmapDensity||0}],"+":[a,b(a),function(e,t){var i=0,r=!0,n=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(r=(o=s.next()).done);r=!0)i+=o.value.evaluate(e)}catch(e){n=!0,a=e}finally{try{r||null==s.return||s.return()}finally{if(n)throw a}}return i}],"*":[a,b(a),function(e,t){var i=1,r=!0,n=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(r=(o=s.next()).done);r=!0)i*=o.value.evaluate(e)}catch(e){n=!0,a=e}finally{try{r||null==s.return||s.return()}finally{if(n)throw a}}return i}],"-":{type:a,overloads:[[[a,a],function(e,t){var i=u(t,2),r=i[0],n=i[1];return r.evaluate(e)-n.evaluate(e)}],[[a],function(e,t){return-u(t,1)[0].evaluate(e)}]]},"/":[a,[a,a],function(e,t){var i=u(t,2),r=i[0],n=i[1];return r.evaluate(e)/n.evaluate(e)}],"%":[a,[a,a],function(e,t){var i=u(t,2),r=i[0],n=i[1];return r.evaluate(e)%n.evaluate(e)}],ln2:[a,[],function(){return Math.LN2}],pi:[a,[],function(){return Math.PI}],e:[a,[],function(){return Math.E}],"^":[a,[a,a],function(e,t){var i=u(t,2),r=i[0],n=i[1];return Math.pow(r.evaluate(e),n.evaluate(e))}],sqrt:[a,[a],function(e,t){var i=u(t,1)[0];return Math.sqrt(i.evaluate(e))}],log10:[a,[a],function(e,t){var i=u(t,1)[0];return Math.log10(i.evaluate(e))}],ln:[a,[a],function(e,t){var i=u(t,1)[0];return Math.log(i.evaluate(e))}],log2:[a,[a],function(e,t){var i=u(t,1)[0];return Math.log2(i.evaluate(e))}],sin:[a,[a],function(e,t){var i=u(t,1)[0];return Math.sin(i.evaluate(e))}],cos:[a,[a],function(e,t){var i=u(t,1)[0];return Math.cos(i.evaluate(e))}],tan:[a,[a],function(e,t){var i=u(t,1)[0];return Math.tan(i.evaluate(e))}],asin:[a,[a],function(e,t){var i=u(t,1)[0];return Math.asin(i.evaluate(e))}],acos:[a,[a],function(e,t){var i=u(t,1)[0];return Math.acos(i.evaluate(e))}],atan:[a,[a],function(e,t){var i=u(t,1)[0];return Math.atan(i.evaluate(e))}],min:[a,b(a),function(t,e){return Math.min.apply(Math,r(e.map(function(e){return e.evaluate(t)})))}],max:[a,b(a),function(t,e){return Math.max.apply(Math,r(e.map(function(e){return e.evaluate(t)})))}],"filter-==":[l,[o,h],function(e,t){var i=u(t,2),r=i[0],n=i[1];return e.properties()[r.value]===n.value}],"filter-id-==":[l,[h],function(e,t){var i=u(t,1)[0];return e.id()===i.value}],"filter-type-==":[l,[o],function(e,t){var i=u(t,1)[0];return e.geometryType()===i.value}],"filter-<":[l,[o,h],function(e,t){var i=u(t,2),r=i[0],n=i[1],a=e.properties()[r.value],o=n.value;return s(a)===s(o)&&a<o}],"filter-id-<":[l,[h],function(e,t){var i=u(t,1)[0],r=e.id(),n=i.value;return s(r)===s(n)&&r<n}],"filter->":[l,[o,h],function(e,t){var i=u(t,2),r=i[0],n=i[1],a=e.properties()[r.value],o=n.value;return s(a)===s(o)&&o<a}],"filter-id->":[l,[h],function(e,t){var i=u(t,1)[0],r=e.id(),n=i.value;return s(r)===s(n)&&n<r}],"filter-<=":[l,[o,h],function(e,t){var i=u(t,2),r=i[0],n=i[1],a=e.properties()[r.value],o=n.value;return s(a)===s(o)&&a<=o}],"filter-id-<=":[l,[h],function(e,t){var i=u(t,1)[0],r=e.id(),n=i.value;return s(r)===s(n)&&r<=n}],"filter->=":[l,[o,h],function(e,t){var i=u(t,2),r=i[0],n=i[1],a=e.properties()[r.value],o=n.value;return s(a)===s(o)&&o<=a}],"filter-id->=":[l,[h],function(e,t){var i=u(t,1)[0],r=e.id(),n=i.value;return s(r)===s(n)&&n<=r}],"filter-has":[l,[h],function(e,t){return u(t,1)[0].value in e.properties()}],"filter-has-id":[l,[],function(e){return null!==e.id()}],"filter-type-in":[l,[f(o)],function(e,t){return 0<=u(t,1)[0].value.indexOf(e.geometryType())}],"filter-id-in":[l,[f(h)],function(e,t){return 0<=u(t,1)[0].value.indexOf(e.id())}],"filter-in-small":[l,[o,f(h)],function(e,t){var i=u(t,2),r=i[0];return 0<=i[1].value.indexOf(e.properties()[r.value])}],"filter-in-large":[l,[o,f(h)],function(e,t){var i=u(t,2),r=i[0],n=i[1];return function(e,t,i,r){for(;i<=r;){var n=i+r>>1;if(t[n]===e)return!0;t[n]>e?r=n-1:i=1+n}return!1}(e.properties()[r.value],n.value,0,n.value.length-1)}],">":{type:l,overloads:[[[a,a],$],[[o,o],$]]},"<":{type:l,overloads:[[[a,a],G],[[o,o],G]]},">=":{type:l,overloads:[[[a,a],W],[[o,o],W]]},"<=":{type:l,overloads:[[[a,a],H],[[o,o],H]]},all:{type:l,overloads:[[[l,l],function(e,t){var i=u(t,2),r=i[0],n=i[1];return r.evaluate(e)&&n.evaluate(e)}],[b(l),function(e,t){var i=!0,r=!1,n=void 0;try{for(var a,o=t[Symbol.iterator]();!(i=(a=o.next()).done);i=!0)if(!a.value.evaluate(e))return!1}catch(e){r=!0,n=e}finally{try{i||null==o.return||o.return()}finally{if(r)throw n}}return!0}]]},any:{type:l,overloads:[[[l,l],function(e,t){var i=u(t,2),r=i[0],n=i[1];return r.evaluate(e)||n.evaluate(e)}],[b(l),function(e,t){var i=!0,r=!1,n=void 0;try{for(var a,o=t[Symbol.iterator]();!(i=(a=o.next()).done);i=!0)if(a.value.evaluate(e))return!0}catch(e){r=!0,n=e}finally{try{i||null==o.return||o.return()}finally{if(r)throw n}}return!1}]]},"!":[l,[l],function(e,t){return!u(t,1)[0].evaluate(e)}],upcase:[o,[o],function(e,t){return u(t,1)[0].evaluate(e).toUpperCase()}],downcase:[o,[o],function(e,t){return u(t,1)[0].evaluate(e).toLowerCase()}],concat:[o,b(o),function(t,e){return e.map(function(e){return e.evaluate(t)}).join("")}]}),e.exports=B},function(e,t,i){var p=i(7),f=i(17),m=i(29),g=i(43),y=i(92),v=i(93),_=i(24);e.exports=function(e){var o,s,n,l=e.valueSpec,u=_(e.value.type),c={},t="categorical"!==u&&void 0===e.value.property,i=!t,a="array"===f(e.value.stops)&&"array"===f(e.value.stops[0])&&"object"===f(e.value.stops[0][0]),r=g({key:e.key,value:e.value,valueSpec:e.styleSpec.function,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{stops:function(e){if("identity"===u)return[new p(e.key,e.value,'identity function may not have a "stops" property')];var t=[],i=e.value;return t=t.concat(y({key:e.key,value:i,valueSpec:e.valueSpec,style:e.style,styleSpec:e.styleSpec,arrayElementValidator:d})),"array"===f(i)&&0===i.length&&t.push(new p(e.key,i,"array must have at least one stop")),t},default:function(e){return m({key:e.key,value:e.value,valueSpec:l,style:e.style,styleSpec:e.styleSpec})}}});return"identity"===u&&t&&r.push(new p(e.key,e.value,'missing required property "property"')),"identity"===u||e.value.stops||r.push(new p(e.key,e.value,'missing required property "stops"')),"exponential"===u&&"piecewise-constant"===e.valueSpec.function&&r.push(new p(e.key,e.value,"exponential functions not supported")),8<=e.styleSpec.$version&&(i&&!e.valueSpec["property-function"]?r.push(new p(e.key,e.value,"property functions not supported")):t&&!e.valueSpec["zoom-function"]&&"heatmap-color"!==e.objectKey&&r.push(new p(e.key,e.value,"zoom functions not supported"))),"categorical"!==u&&!a||void 0!==e.value.property||r.push(new p(e.key,e.value,'"property" property is required')),r;function d(e){var t=[],i=e.value,r=e.key;if("array"!==f(i))return[new p(r,i,"array expected, ".concat(f(i)," found"))];if(2!==i.length)return[new p(r,i,"array length 2 expected, length ".concat(i.length," found"))];if(a){if("object"!==f(i[0]))return[new p(r,i,"object expected, ".concat(f(i[0])," found"))];if(void 0===i[0].zoom)return[new p(r,i,"object stop key must have zoom")];if(void 0===i[0].value)return[new p(r,i,"object stop key must have value")];if(n&&n>_(i[0].zoom))return[new p(r,i[0].zoom,"stop zoom values must appear in ascending order")];_(i[0].zoom)!==n&&(n=_(i[0].zoom),s=void 0,c={}),t=t.concat(g({key:"".concat(r,"[0]"),value:i[0],valueSpec:{zoom:{}},style:e.style,styleSpec:e.styleSpec,objectElementValidators:{zoom:v,value:h}}))}else t=t.concat(h({key:"".concat(r,"[0]"),value:i[0],valueSpec:{},style:e.style,styleSpec:e.styleSpec},i));return t.concat(m({key:"".concat(r,"[1]"),value:i[1],valueSpec:l,style:e.style,styleSpec:e.styleSpec}))}function h(e,t){var i=f(e.value),r=_(e.value),n=null!==e.value?e.value:t;if(o){if(i!==o)return[new p(e.key,n,"".concat(i," stop domain type must match previous stop domain type ").concat(o))]}else o=i;if("number"!==i&&"string"!==i&&"boolean"!==i)return[new p(e.key,n,"stop domain value must be a number, string, or boolean")];if("number"===i||"categorical"===u)return"categorical"!==u||"number"!==i||isFinite(r)&&Math.floor(r)===r?"categorical"!==u&&"number"===i&&void 0!==s&&r<s?[new p(e.key,n,"stop domain values must appear in ascending order")]:(s=r,"categorical"===u&&r in c?[new p(e.key,n,"stop domain values must be unique")]:(c[r]=!0,[])):[new p(e.key,n,"integer expected, found ".concat(r))];var a="number expected, ".concat(i," found");return l["property-function"]&&void 0===u&&(a+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new p(e.key,n,a)]}}},function(e,t,i){var c=i(17),d=i(29),h=i(7);e.exports=function(e){var t=e.value,i=e.valueSpec,r=e.style,n=e.styleSpec,a=e.key,o=e.arrayElementValidator||d;if("array"!==c(t))return[new h(a,t,"array expected, ".concat(c(t)," found"))];if(i.length&&t.length!==i.length)return[new h(a,t,"array length ".concat(i.length," expected, length ").concat(t.length," found"))];if(i["min-length"]&&t.length<i["min-length"])return[new h(a,t,"array length at least ".concat(i["min-length"]," expected, length ").concat(t.length," found"))];var s={type:i.value};n.$version<7&&(s.function=i.function),"object"===c(i.value)&&(s=i.value);for(var l=[],u=0;u<t.length;u++)l=l.concat(o({array:t,arrayIndex:u,value:t[u],valueSpec:s,style:r,styleSpec:n,key:"".concat(a,"[").concat(u,"]")}));return l}},function(e,t,i){var a=i(17),o=i(7);e.exports=function(e){var t=e.key,i=e.value,r=e.valueSpec,n=a(i);return"number"!==n?[new o(t,i,"number expected, ".concat(n," found"))]:"minimum"in r&&i<r.minimum?[new o(t,i,"".concat(i," is less than the minimum value ").concat(r.minimum))]:"maximum"in r&&i>r.maximum?[new o(t,i,"".concat(i," is greater than the maximum value ").concat(r.maximum))]:[]}},function(e,t,i){var r=i(7),n=i(30),a=n.createExpression,o=n.createPropertyExpression,s=i(24);e.exports=function(t){var e=("property"===t.expressionContext?o:a)(s.deep(t.value),t.valueSpec);return"error"===e.result?e.value.map(function(e){return new r("".concat(t.key).concat(e.key),t.value,e.message)}):"property"===t.expressionContext&&"text-font"===t.propertyKey&&-1!==e.value._styleExpression.expression.possibleOutputs().indexOf(void 0)?[new r(t.key,t.value,'Invalid data expression for "text-font". Output values must be contained as literals within the expression.')]:[]}},function(e,t,i){var f=i(7),m=i(24),g=i(43),y=i(59),v=i(96),_=i(98),C=i(29),x=i(41);e.exports=function(e){var t=[],i=e.value,r=e.key,n=e.style,a=e.styleSpec;i.type||i.ref||t.push(new f(r,i,'either "type" or "ref" is required'));var o,s=m(i.type),l=m(i.ref);if(i.id)for(var u=m(i.id),c=0;c<e.arrayIndex;c++){var d=n.layers[c];m(d.id)===u&&t.push(new f(r,i.id,'duplicate layer id "'.concat(i.id,'", previously used at line ').concat(d.id.__line__)))}if("ref"in i)["type","source","source-layer","filter","layout"].forEach(function(e){e in i&&t.push(new f(r,i[e],'"'.concat(e,'" is prohibited for ref layers')))}),n.layers.forEach(function(e){m(e.id)===l&&(o=e)}),o?o.ref?t.push(new f(r,i.ref,"ref cannot reference another ref layer")):s=m(o.type):t.push(new f(r,i.ref,'ref layer "'.concat(l,'" not found')));else if("background"!==s)if(i.source){var h=n.sources&&n.sources[i.source],p=h&&m(h.type);h?"vector"===p&&"raster"===s?t.push(new f(r,i.source,'layer "'.concat(i.id,'" requires a raster source'))):"raster"===p&&"raster"!==s?t.push(new f(r,i.source,'layer "'.concat(i.id,'" requires a vector source'))):"vector"!==p||i["source-layer"]?"raster-dem"===p&&"hillshade"!==s&&t.push(new f(r,i.source,"raster-dem source can only be used with layer type 'hillshade'.")):t.push(new f(r,i,'layer "'.concat(i.id,'" must specify a "source-layer"'))):t.push(new f(r,i.source,'source "'.concat(i.source,'" not found')))}else t.push(new f(r,i,'missing required property "source"'));return t=t.concat(g({key:r,value:i,valueSpec:a.layer,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{"*":function(){return[]},type:function(){return C({key:"".concat(r,".type"),value:i.type,valueSpec:a.layer.type,style:e.style,styleSpec:e.styleSpec,object:i,objectKey:"type"})},filter:y,layout:function(e){return g({layer:i,key:e.key,value:e.value,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{"*":function(e){return _(x({layerType:s},e))}}})},paint:function(e){return g({layer:i,key:e.key,value:e.value,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{"*":function(e){return v(x({layerType:s},e))}}})}}}))}},function(e,t,i){var r=i(97);e.exports=function(e){return r(e,"paint")}},function(e,t,i){var h=i(29),p=i(7),f=i(17),m=i(57).isFunction,g=i(24);e.exports=function(e,t){var i=e.key,r=e.style,n=e.styleSpec,a=e.value,o=e.objectKey,s=n["".concat(t,"_").concat(e.layerType)];if(!s)return[];var l=o.match(/^(.*)-transition$/);if("paint"===t&&l&&s[l[1]]&&s[l[1]].transition)return h({key:i,value:a,valueSpec:n.transition,style:r,styleSpec:n});var u,c=e.valueSpec||s[o];if(!c)return[new p(i,a,'unknown property "'.concat(o,'"'))];if("string"===f(a)&&c["property-function"]&&!c.tokens&&(u=/^{([^}]+)}$/.exec(a)))return[new p(i,a,'"'.concat(o,'" does not support interpolation syntax\n')+'Use an identity property function instead: `{ "type": "identity", "property": '.concat(JSON.stringify(u[1])," }`."))];var d=[];return"symbol"===e.layerType&&("text-field"===o&&r&&!r.glyphs&&d.push(new p(i,a,'use of "text-field" requires a style "glyphs" property')),"text-font"===o&&m(g.deep(a))&&"identity"===g(a.type)&&d.push(new p(i,a,'"text-font" does not support identity functions'))),d.concat(h({key:e.key,value:a,valueSpec:c,style:r,styleSpec:n,expressionContext:"property",propertyKey:o}))}},function(e,t,i){var r=i(97);e.exports=function(e){return r(e,"layout")}},function(e,t,i){var l=i(7),u=i(24),c=i(43),d=i(58);e.exports=function(e){var t=e.value,i=e.key,r=e.styleSpec,n=e.style;if(!t.type)return[new l(i,t,'"type" is required')];var a=u(t.type),o=[];switch(a){case"vector":case"raster":case"raster-dem":if(o=o.concat(c({key:i,value:t,valueSpec:r["source_".concat(a.replace("-","_"))],style:e.style,styleSpec:r})),"url"in t)for(var s in t)["type","url","tileSize"].indexOf(s)<0&&o.push(new l("".concat(i,".").concat(s),t[s],'a source with a "url" property may not include a "'.concat(s,'" property')));return o;case"geojson":return c({key:i,value:t,valueSpec:r.source_geojson,style:n,styleSpec:r});case"video":return c({key:i,value:t,valueSpec:r.source_video,style:n,styleSpec:r});case"image":return c({key:i,value:t,valueSpec:r.source_image,style:n,styleSpec:r});case"canvas":return c({key:i,value:t,valueSpec:r.source_canvas,style:n,styleSpec:r});default:return d({key:"".concat(i,".type"),value:t.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image","canvas"]},style:n,styleSpec:r})}}},function(e,t,i){var u=i(7),c=i(17),d=i(29);e.exports=function(e){var t=e.value,i=e.styleSpec,r=i.light,n=e.style,a=[],o=c(t);if(void 0===t)return a;if("object"!==o)return a.concat([new u("light",t,"object expected, ".concat(o," found"))]);for(var s in t){var l=s.match(/^(.*)-transition$/);a=l&&r[l[1]]&&r[l[1]].transition?a.concat(d({key:s,value:t[s],valueSpec:i.transition,style:n,styleSpec:i})):r[s]?a.concat(d({key:s,value:t[s],valueSpec:r[s],style:n,styleSpec:i})):a.concat([new u(s,t[s],'unknown property "'.concat(s,'"'))])}return a}},function(e,t,i){var n=i(17),a=i(7);e.exports=function(e){var t=e.value,i=e.key,r=n(t);return"string"!==r?[new a(i,t,"string expected, ".concat(r," found"))]:[]}},function(e,t,i){e.exports=r;var h=3;function r(e,t,i){var r=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;var n=new Int32Array(this.arrayBuffer);e=n[0],t=n[1],i=n[2],this.d=t+2*i;for(var a=0;a<this.d*this.d;a++){var o=n[h+a],s=n[h+a+1];r.push(o===s?null:n.subarray(o,s))}var l=n[h+r.length],u=n[h+r.length+1];this.keys=n.subarray(l,u),this.bboxes=n.subarray(u),this.insert=this._insertReadonly}else{this.d=t+2*i;for(var c=0;c<this.d*this.d;c++)r.push([]);this.keys=[],this.bboxes=[]}this.n=t,this.extent=e,this.padding=i,this.scale=t/e,this.uid=0;var d=i/t*e;this.min=-d,this.max=e+d}r.prototype.insert=function(e,t,i,r,n){this._forEachCell(t,i,r,n,this._insertCell,this.uid++),this.keys.push(e),this.bboxes.push(t),this.bboxes.push(i),this.bboxes.push(r),this.bboxes.push(n)},r.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},r.prototype._insertCell=function(e,t,i,r,n,a){this.cells[n].push(a)},r.prototype.query=function(e,t,i,r,n){var a=this.min,o=this.max;if(e<=a&&t<=a&&o<=i&&o<=r&&!n)return Array.prototype.slice.call(this.keys);var s=[];return this._forEachCell(e,t,i,r,this._queryCell,s,{},n),s},r.prototype._queryCell=function(e,t,i,r,n,a,o,s){var l=this.cells[n];if(null!==l)for(var u=this.keys,c=this.bboxes,d=0;d<l.length;d++){var h=l[d];if(void 0===o[h]){var p=4*h;(s?s(c[0+p],c[1+p],c[2+p],c[3+p]):e<=c[2+p]&&t<=c[3+p]&&i>=c[0+p]&&r>=c[1+p])?(o[h]=!0,a.push(u[h])):o[h]=!1}}},r.prototype._forEachCell=function(e,t,i,r,n,a,o,s){for(var l=this._convertToCellCoord(e),u=this._convertToCellCoord(t),c=this._convertToCellCoord(i),d=this._convertToCellCoord(r),h=l;h<=c;h++)for(var p=u;p<=d;p++){var f=this.d*p+h;if((!s||s(this._convertFromCellCoord(h),this._convertFromCellCoord(p),this._convertFromCellCoord(h+1),this._convertFromCellCoord(p+1)))&&n.call(this,e,t,i,r,f,a,o,s))return}},r.prototype._convertFromCellCoord=function(e){return(e-this.padding)/this.scale},r.prototype._convertToCellCoord=function(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))},r.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var e=this.cells,t=h+this.cells.length+1+1,i=0,r=0;r<this.cells.length;r++)i+=this.cells[r].length;var n=new Int32Array(t+i+this.keys.length+this.bboxes.length);n[0]=this.extent,n[1]=this.n,n[2]=this.padding;for(var a=t,o=0;o<e.length;o++){var s=e[o];n[h+o]=a,n.set(s,a),a+=s.length}return n[h+e.length]=a,n.set(this.keys,a),a+=this.keys.length,n[h+e.length+1]=a,n.set(this.bboxes,a),a+=this.bboxes.length,n.buffer}},function(e,t,i){var r=i(14).CircleLayoutArray,n=i(152).members,a=i(36).SegmentVector,o=i(32).ProgramConfigurationSet,s=i(37).TriangleIndexArray,h=i(38),v=i(6),l=i(11).register;function _(e,t,i,r,n){e.emplaceBack(2*t+(r+1)/2,2*i+(n+1)/2)}var u=(function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(c.prototype,[{key:"populate",value:function(e,t){var i=!0,r=!1,n=void 0;try{for(var a,o=e[Symbol.iterator]();!(i=(a=o.next()).done);i=!0){var s=a.value,l=s.feature,u=s.index,c=s.sourceLayerIndex;if(this.layers[0]._featureFilter({zoom:this.zoom},l)){var d=h(l);this.addFeature(l,d),t.featureIndex.insert(l,d,u,c,this.index)}}}catch(e){r=!0,n=e}finally{try{i||null==o.return||o.return()}finally{if(r)throw n}}}},{key:"isEmpty",value:function(){return 0===this.layoutVertexArray.length}},{key:"upload",value:function(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,n),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.programConfigurations.upload(e)}},{key:"destroy",value:function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}},{key:"addFeature",value:function(e,t){var i=!0,r=!1,n=void 0;try{for(var a,o=t[Symbol.iterator]();!(i=(a=o.next()).done);i=!0){var s=a.value,l=!0,u=!1,c=void 0;try{for(var d,h=s[Symbol.iterator]();!(l=(d=h.next()).done);l=!0){var p=d.value,f=p.x,m=p.y;if(!(f<0||v<=f||m<0||v<=m)){var g=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray),y=g.vertexLength;_(this.layoutVertexArray,f,m,-1,-1),_(this.layoutVertexArray,f,m,1,-1),_(this.layoutVertexArray,f,m,1,1),_(this.layoutVertexArray,f,m,-1,1),this.indexArray.emplaceBack(y,y+1,y+2),this.indexArray.emplaceBack(y,y+3,y+2),g.vertexLength+=4,g.primitiveLength+=2}}}catch(e){u=!0,c=e}finally{try{l||null==h.return||h.return()}finally{if(u)throw c}}}}catch(e){r=!0,n=e}finally{try{i||null==o.return||o.return()}finally{if(r)throw n}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e)}}]),c);function c(e){!function(e){if(!(e instanceof c))throw new TypeError("Cannot call a class as a function")}(this),this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(function(e){return e.id}),this.index=e.index,this.layoutVertexArray=new r,this.indexArray=new s,this.segments=new a,this.programConfigurations=new o(n,e.layers,e.zoom)}l("CircleBucket",u,{omit:["layers"]}),e.exports=u},function(e,t,i){function r(e,t,i){i=i||2;var r,n,a,o,s,l,u,c=t&&t.length,d=c?t[0]*i:e.length,h=m(e,0,d,i,!0),p=[];if(!h||h.next===h.prev)return p;if(c&&(h=function(e,t,i,r){var n,a,o,s=[];for(n=0,a=t.length;n<a;n++)(o=m(e,t[n]*r,n<a-1?t[n+1]*r:e.length,r,!1))===o.next&&(o.steiner=!0),s.push(x(o));for(s.sort(v),n=0;n<s.length;n++)_(s[n],i),i=g(i,i.next);return i}(e,t,h,i)),e.length>80*i){r=a=e[0],n=o=e[1];for(var f=i;f<d;f+=i)(s=e[f])<r&&(r=s),(l=e[f+1])<n&&(n=l),a<s&&(a=s),o<l&&(o=l);u=0!==(u=Math.max(a-r,o-n))?1/u:0}return y(h,p,i,r,n,u),p}function m(e,t,i,r,n){var a,o;if(n===0<T(e,t,i,r))for(a=t;a<i;a+=r)o=l(a,e[a],e[a+1],o);else for(a=i-r;t<=a;a-=r)o=l(a,e[a],e[a+1],o);return o&&s(o,o.next)&&(E(o),o=o.next),o}function g(e,t){if(!e)return e;t=t||e;var i,r=e;do{if(i=!1,r.steiner||!s(r,r.next)&&0!==A(r.prev,r,r.next))r=r.next;else{if(E(r),(r=t=r.prev)===r.next)break;i=!0}}while(i||r!==t);return t}function y(e,t,i,r,n,a,o){if(e){!o&&a&&function(e,t,i,r){for(var n=e;null===n.z&&(n.z=C(n.x,n.y,t,i,r)),n.prevZ=n.prev,n.nextZ=n.next,(n=n.next)!==e;);n.prevZ.nextZ=null,n.prevZ=null,function(e){var t,i,r,n,a,o,s,l,u=1;do{for(i=e,a=e=null,o=0;i;){for(o++,r=i,t=s=0;t<u&&(s++,r=r.nextZ);t++);for(l=u;0<s||0<l&&r;)0!==s&&(0===l||!r||i.z<=r.z)?(i=(n=i).nextZ,s--):(r=(n=r).nextZ,l--),a?a.nextZ=n:e=n,n.prevZ=a,a=n;i=r}a.nextZ=null,u*=2}while(1<o)}(n)}(e,r,n,a);for(var s,l,u=e;e.prev!==e.next;)if(s=e.prev,l=e.next,a?d(e,r,n,a):c(e))t.push(s.i/i),t.push(e.i/i),t.push(l.i/i),E(e),e=l.next,u=l.next;else if((e=l)===u){o?1===o?y(e=h(e,t,i),t,i,r,n,a,2):2===o&&p(e,t,i,r,n,a):y(g(e),t,i,r,n,a,1);break}}}function c(e){var t=e.prev,i=e,r=e.next;if(0<=A(t,i,r))return!1;for(var n=e.next.next;n!==e.prev;){if(b(t.x,t.y,i.x,i.y,r.x,r.y,n.x,n.y)&&0<=A(n.prev,n,n.next))return!1;n=n.next}return!0}function d(e,t,i,r){var n=e.prev,a=e,o=e.next;if(0<=A(n,a,o))return!1;for(var s=n.x<a.x?n.x<o.x?n.x:o.x:a.x<o.x?a.x:o.x,l=n.y<a.y?n.y<o.y?n.y:o.y:a.y<o.y?a.y:o.y,u=n.x>a.x?n.x>o.x?n.x:o.x:a.x>o.x?a.x:o.x,c=n.y>a.y?n.y>o.y?n.y:o.y:a.y>o.y?a.y:o.y,d=C(s,l,t,i,r),h=C(u,c,t,i,r),p=e.prevZ,f=e.nextZ;p&&p.z>=d&&f&&f.z<=h;){if(p!==e.prev&&p!==e.next&&b(n.x,n.y,a.x,a.y,o.x,o.y,p.x,p.y)&&0<=A(p.prev,p,p.next))return!1;if(p=p.prevZ,f!==e.prev&&f!==e.next&&b(n.x,n.y,a.x,a.y,o.x,o.y,f.x,f.y)&&0<=A(f.prev,f,f.next))return!1;f=f.nextZ}for(;p&&p.z>=d;){if(p!==e.prev&&p!==e.next&&b(n.x,n.y,a.x,a.y,o.x,o.y,p.x,p.y)&&0<=A(p.prev,p,p.next))return!1;p=p.prevZ}for(;f&&f.z<=h;){if(f!==e.prev&&f!==e.next&&b(n.x,n.y,a.x,a.y,o.x,o.y,f.x,f.y)&&0<=A(f.prev,f,f.next))return!1;f=f.nextZ}return!0}function h(e,t,i){var r=e;do{var n=r.prev,a=r.next.next;!s(n,a)&&f(n,r,r.next,a)&&S(n,a)&&S(a,n)&&(t.push(n.i/i),t.push(r.i/i),t.push(a.i/i),E(r),E(r.next),r=e=a),r=r.next}while(r!==e);return r}function p(e,t,i,r,n,a){var o,s,l=e;do{for(var u=l.next.next;u!==l.prev;){if(l.i!==u.i&&(s=u,(o=l).next.i!==s.i&&o.prev.i!==s.i&&!function(e,t){var i=e;do{if(i.i!==e.i&&i.next.i!==e.i&&i.i!==t.i&&i.next.i!==t.i&&f(i,i.next,e,t))return!0;i=i.next}while(i!==e);return!1}(o,s)&&S(o,s)&&S(s,o)&&function(e,t){for(var i=e,r=!1,n=(e.x+t.x)/2,a=(e.y+t.y)/2;i.y>a!=i.next.y>a&&i.next.y!==i.y&&n<(i.next.x-i.x)*(a-i.y)/(i.next.y-i.y)+i.x&&(r=!r),(i=i.next)!==e;);return r}(o,s))){var c=w(l,u);return l=g(l,l.next),c=g(c,c.next),y(l,t,i,r,n,a),void y(c,t,i,r,n,a)}u=u.next}l=l.next}while(l!==e)}function v(e,t){return e.x-t.x}function _(e,t){if(t=function(e,t){var i,r=t,n=e.x,a=e.y,o=-1/0;do{if(a<=r.y&&a>=r.next.y&&r.next.y!==r.y){var s=r.x+(a-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=n&&o<s){if((o=s)===n){if(a===r.y)return r;if(a===r.next.y)return r.next}i=r.x<r.next.x?r:r.next}}r=r.next}while(r!==t);if(!i)return null;if(n===o)return i.prev;var l,u=i,c=i.x,d=i.y,h=1/0;for(r=i.next;r!==u;)n>=r.x&&r.x>=c&&n!==r.x&&b(a<d?n:o,a,c,d,a<d?o:n,a,r.x,r.y)&&((l=Math.abs(a-r.y)/(n-r.x))<h||l===h&&r.x>i.x)&&S(r,e)&&(i=r,h=l),r=r.next;return i}(e,t)){var i=w(t,e);g(i,i.next)}}function C(e,t,i,r,n){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)*n)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*n)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function x(e){for(var t=e,i=e;(t.x<i.x||t.x===i.x&&t.y<i.y)&&(i=t),(t=t.next)!==e;);return i}function b(e,t,i,r,n,a,o,s){return 0<=(n-o)*(t-s)-(e-o)*(a-s)&&0<=(e-o)*(r-s)-(i-o)*(t-s)&&0<=(i-o)*(a-s)-(n-o)*(r-s)}function A(e,t,i){return(t.y-e.y)*(i.x-t.x)-(t.x-e.x)*(i.y-t.y)}function s(e,t){return e.x===t.x&&e.y===t.y}function f(e,t,i,r){return!!(s(e,t)&&s(i,r)||s(e,r)&&s(i,t))||0<A(e,t,i)!=0<A(e,t,r)&&0<A(i,r,e)!=0<A(i,r,t)}function S(e,t){return A(e.prev,e,e.next)<0?0<=A(e,t,e.next)&&0<=A(e,e.prev,t):A(e,t,e.prev)<0||A(e,e.next,t)<0}function w(e,t){var i=new o(e.i,e.x,e.y),r=new o(t.i,t.x,t.y),n=e.next,a=t.prev;return(e.next=t).prev=e,(i.next=n).prev=i,(r.next=i).prev=r,(a.next=r).prev=a,r}function l(e,t,i,r){var n=new o(e,t,i);return r?(n.next=r.next,(n.prev=r).next.prev=n,r.next=n):(n.prev=n).next=n,n}function E(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function o(e,t,i){this.i=e,this.x=t,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function T(e,t,i,r){for(var n=0,a=t,o=i-r;a<i;a+=r)n+=(e[o]-e[a])*(e[a+1]+e[o+1]),o=a;return n}e.exports=r,(e.exports.default=r).deviation=function(e,t,i,r){var n=t&&t.length,a=n?t[0]*i:e.length,o=Math.abs(T(e,0,a,i));if(n)for(var s=0,l=t.length;s<l;s++){var u=t[s]*i,c=s<l-1?t[s+1]*i:e.length;o-=Math.abs(T(e,u,c,i))}var d=0;for(s=0;s<r.length;s+=3){var h=r[s]*i,p=r[s+1]*i,f=r[s+2]*i;d+=Math.abs((e[h]-e[f])*(e[1+p]-e[1+h])-(e[h]-e[p])*(e[1+f]-e[1+h]))}return 0===o&&0===d?0:Math.abs((d-o)/o)},r.flatten=function(e){for(var t=e[0][0].length,i={vertices:[],holes:[],dimensions:t},r=0,n=0;n<e.length;n++){for(var a=0;a<e[n].length;a++)for(var o=0;o<t;o++)i.vertices.push(e[n][a][o]);0<n&&(r+=e[n-1].length,i.holes.push(r))}return i}},function(e,t,i){var u=i(163),c=i(0).calculateSignedArea;function d(e,t){return t.area-e.area}e.exports=function(e,t){var i=e.length;if(i<=1)return[e];for(var r,n,a=[],o=0;o<i;o++){var s=c(e[o]);0!==s&&(e[o].area=Math.abs(s),void 0===n&&(n=s<0),n===s<0?(r&&a.push(r),r=[e[o]]):r.push(e[o]))}if(r&&a.push(r),1<t)for(var l=0;l<a.length;l++)a[l].length<=t||(u(a[l],t,1,a[l].length-1,d),a[l]=a[l].slice(0,t));return a}},function(e,t,i){var r=i(107);function n(e,t){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(a,this,t),this.length=this._features.length}function a(e,t,i){15===e?t.version=i.readVarint():1===e?t.name=i.readString():5===e?t.extent=i.readVarint():2===e?t._features.push(i.pos):3===e?t._keys.push(i.readString()):4===e&&t._values.push(function(e){for(var t=null,i=e.readVarint()+e.pos;e.pos<i;){var r=e.readVarint()>>3;t=1==r?e.readString():2==r?e.readFloat():3==r?e.readDouble():4==r?e.readVarint64():5==r?e.readVarint():6==r?e.readSVarint():7==r?e.readBoolean():null}return t}(i))}(e.exports=n).prototype.feature=function(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];var t=this._pbf.readVarint()+this._pbf.pos;return new r(this._pbf,t,this.extent,this._keys,this._values)}},function(e,t,i){var u=i(3);function p(e,t,i,r,n){this.properties={},this.extent=i,this.type=0,this._pbf=e,this._geometry=-1,this._keys=r,this._values=n,e.readFields(a,this,t)}function a(e,t,i){1==e?t.id=i.readVarint():2==e?function(e,t){for(var i=e.readVarint()+e.pos;e.pos<i;){var r=t._keys[e.readVarint()],n=t._values[e.readVarint()];t.properties[r]=n}}(i,t):3==e?t.type=i.readVarint():4==e&&(t._geometry=i.pos)}function f(e){for(var t,i,r=0,n=0,a=e.length,o=a-1;n<a;o=n++)t=e[n],r+=((i=e[o]).x-t.x)*(t.y+i.y);return r}(e.exports=p).types=["Unknown","Point","LineString","Polygon"],p.prototype.loadGeometry=function(){var e=this._pbf;e.pos=this._geometry;for(var t,i=e.readVarint()+e.pos,r=1,n=0,a=0,o=0,s=[];e.pos<i;){if(n<=0){var l=e.readVarint();r=7&l,n=l>>3}if(n--,1===r||2===r)a+=e.readSVarint(),o+=e.readSVarint(),1===r&&(t&&s.push(t),t=[]),t.push(new u(a,o));else{if(7!==r)throw new Error("unknown command "+r);t&&t.push(t[0].clone())}}return t&&s.push(t),s},p.prototype.bbox=function(){var e=this._pbf;e.pos=this._geometry;for(var t=e.readVarint()+e.pos,i=1,r=0,n=0,a=0,o=1/0,s=-1/0,l=1/0,u=-1/0;e.pos<t;){if(r<=0){var c=e.readVarint();i=7&c,r=c>>3}if(r--,1===i||2===i)(n+=e.readSVarint())<o&&(o=n),s<n&&(s=n),(a+=e.readSVarint())<l&&(l=a),u<a&&(u=a);else if(7!==i)throw new Error("unknown command "+i)}return[o,l,s,u]},p.prototype.toGeoJSON=function(e,t,i){var r,n,a=this.extent*Math.pow(2,i),o=this.extent*e,s=this.extent*t,l=this.loadGeometry(),u=p.types[this.type];function c(e){for(var t=0;t<e.length;t++){var i=e[t],r=180-360*(i.y+s)/a;e[t]=[360*(i.x+o)/a-180,360/Math.PI*Math.atan(Math.exp(r*Math.PI/180))-90]}}switch(this.type){case 1:var d=[];for(r=0;r<l.length;r++)d[r]=l[r][0];c(l=d);break;case 2:for(r=0;r<l.length;r++)c(l[r]);break;case 3:for(l=function(e){var t=e.length;if(t<=1)return[e];for(var i,r,n=[],a=0;a<t;a++){var o=f(e[a]);0!==o&&(void 0===r&&(r=o<0),r===o<0?(i&&n.push(i),i=[e[a]]):i.push(e[a]))}return i&&n.push(i),n}(l),r=0;r<l.length;r++)for(n=0;n<l[r].length;n++)c(l[r][n])}1===l.length?l=l[0]:u="Multi"+u;var h={type:"Feature",geometry:{type:u,coordinates:l},properties:this.properties};return"id"in this&&(h.id=this.id),h}},function(e,t){var i=(function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(r.prototype,[{key:"update",value:function(e,t){var i=Math.floor(e);return this.first?(this.first=!1,this.lastIntegerZoom=i,this.lastIntegerZoomTime=0,this.lastZoom=e,this.lastFloorZoom=i,!0):(this.lastFloorZoom>i?(this.lastIntegerZoom=i+1,this.lastIntegerZoomTime=t):this.lastFloorZoom<i&&(this.lastIntegerZoom=i,this.lastIntegerZoomTime=t),e!==this.lastZoom&&(this.lastZoom=e,this.lastFloorZoom=i,!0))}}]),r);function r(){!function(e){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}(this),this.first=!0}e.exports=i},function(e,t){e.exports={"Latin-1 Supplement":function(e){return 128<=e&&e<=255},Arabic:function(e){return 1536<=e&&e<=1791},"Arabic Supplement":function(e){return 1872<=e&&e<=1919},"Arabic Extended-A":function(e){return 2208<=e&&e<=2303},"Hangul Jamo":function(e){return 4352<=e&&e<=4607},"Unified Canadian Aboriginal Syllabics":function(e){return 5120<=e&&e<=5759},"Unified Canadian Aboriginal Syllabics Extended":function(e){return 6320<=e&&e<=6399},"General Punctuation":function(e){return 8192<=e&&e<=8303},"Letterlike Symbols":function(e){return 8448<=e&&e<=8527},"Number Forms":function(e){return 8528<=e&&e<=8591},"Miscellaneous Technical":function(e){return 8960<=e&&e<=9215},"Control Pictures":function(e){return 9216<=e&&e<=9279},"Optical Character Recognition":function(e){return 9280<=e&&e<=9311},"Enclosed Alphanumerics":function(e){return 9312<=e&&e<=9471},"Geometric Shapes":function(e){return 9632<=e&&e<=9727},"Miscellaneous Symbols":function(e){return 9728<=e&&e<=9983},"Miscellaneous Symbols and Arrows":function(e){return 11008<=e&&e<=11263},"CJK Radicals Supplement":function(e){return 11904<=e&&e<=12031},"Kangxi Radicals":function(e){return 12032<=e&&e<=12255},"Ideographic Description Characters":function(e){return 12272<=e&&e<=12287},"CJK Symbols and Punctuation":function(e){return 12288<=e&&e<=12351},Hiragana:function(e){return 12352<=e&&e<=12447},Katakana:function(e){return 12448<=e&&e<=12543},Bopomofo:function(e){return 12544<=e&&e<=12591},"Hangul Compatibility Jamo":function(e){return 12592<=e&&e<=12687},Kanbun:function(e){return 12688<=e&&e<=12703},"Bopomofo Extended":function(e){return 12704<=e&&e<=12735},"CJK Strokes":function(e){return 12736<=e&&e<=12783},"Katakana Phonetic Extensions":function(e){return 12784<=e&&e<=12799},"Enclosed CJK Letters and Months":function(e){return 12800<=e&&e<=13055},"CJK Compatibility":function(e){return 13056<=e&&e<=13311},"CJK Unified Ideographs Extension A":function(e){return 13312<=e&&e<=19903},"Yijing Hexagram Symbols":function(e){return 19904<=e&&e<=19967},"CJK Unified Ideographs":function(e){return 19968<=e&&e<=40959},"Yi Syllables":function(e){return 40960<=e&&e<=42127},"Yi Radicals":function(e){return 42128<=e&&e<=42191},"Hangul Jamo Extended-A":function(e){return 43360<=e&&e<=43391},"Hangul Syllables":function(e){return 44032<=e&&e<=55215},"Hangul Jamo Extended-B":function(e){return 55216<=e&&e<=55295},"Private Use Area":function(e){return 57344<=e&&e<=63743},"CJK Compatibility Ideographs":function(e){return 63744<=e&&e<=64255},"Arabic Presentation Forms-A":function(e){return 64336<=e&&e<=65023},"Vertical Forms":function(e){return 65040<=e&&e<=65055},"CJK Compatibility Forms":function(e){return 65072<=e&&e<=65103},"Small Form Variants":function(e){return 65104<=e&&e<=65135},"Arabic Presentation Forms-B":function(e){return 65136<=e&&e<=65279},"Halfwidth and Fullwidth Forms":function(e){return 65280<=e&&e<=65519}}},function(a,e,t){var o=t(63);a.exports=function(e){for(var t="",i=0;i<e.length;i++){var r=e.charCodeAt(i+1)||null,n=e.charCodeAt(i-1)||null;r&&o.charHasRotatedVerticalOrientation(r)&&!a.exports.lookup[e[i+1]]||n&&o.charHasRotatedVerticalOrientation(n)&&!a.exports.lookup[e[i-1]]||!a.exports.lookup[e[i]]?t+=e[i]:t+=a.exports.lookup[e[i]]}return t},a.exports.lookup={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"}},function(e,t,i){function r(e,t,i){i=i||{},this.w=e||64,this.h=t||64,this.autoResize=!!i.autoResize,this.shelves=[],this.freebins=[],this.stats={},this.bins={},this.maxId=0}function p(e,t,i){this.x=0,this.y=e,this.w=this.free=t,this.h=i}function n(e,t,i,r,n,a,o){this.id=e,this.x=t,this.y=i,this.w=r,this.h=n,this.maxw=a||r,this.maxh=o||n,this.refcount=0}e.exports=(r.prototype.pack=function(e,t){e=[].concat(e),t=t||{};for(var i,r,n,a,o=[],s=0;s<e.length;s++)if(i=e[s].w||e[s].width,r=e[s].h||e[s].height,n=e[s].id,i&&r){if(!(a=this.packOne(i,r,n)))continue;t.inPlace&&(e[s].x=a.x,e[s].y=a.y,e[s].id=a.id),o.push(a)}return this.shrink(),o},r.prototype.packOne=function(e,t,i){var r,n,a,o,s,l,u,c,d={freebin:-1,shelf:-1,waste:1/0},h=0;if("string"==typeof i||"number"==typeof i){if(r=this.getBin(i))return this.ref(r),r;"number"==typeof i&&(this.maxId=Math.max(i,this.maxId))}else i=++this.maxId;for(o=0;o<this.freebins.length;o++){if(t===(r=this.freebins[o]).maxh&&e===r.maxw)return this.allocFreebin(o,e,t,i);t>r.maxh||e>r.maxw||t<=r.maxh&&e<=r.maxw&&(a=r.maxw*r.maxh-e*t)<d.waste&&(d.waste=a,d.freebin=o)}for(o=0;o<this.shelves.length;o++)if(h+=(n=this.shelves[o]).h,!(e>n.free)){if(t===n.h)return this.allocShelf(o,e,t,i);t>n.h||t<n.h&&(a=(n.h-t)*e)<d.waste&&(d.freebin=-1,d.waste=a,d.shelf=o)}return-1!==d.freebin?this.allocFreebin(d.freebin,e,t,i):-1!==d.shelf?this.allocShelf(d.shelf,e,t,i):t<=this.h-h&&e<=this.w?(n=new p(h,this.w,t),this.allocShelf(this.shelves.push(n)-1,e,t,i)):this.autoResize?(s=l=this.h,((u=c=this.w)<=s||u<e)&&(c=2*Math.max(e,u)),(s<u||s<t)&&(l=2*Math.max(t,s)),this.resize(c,l),this.packOne(e,t,i)):null},r.prototype.allocFreebin=function(e,t,i,r){var n=this.freebins.splice(e,1)[0];return n.id=r,n.w=t,n.h=i,n.refcount=0,this.bins[r]=n,this.ref(n),n},r.prototype.allocShelf=function(e,t,i,r){var n=this.shelves[e].alloc(t,i,r);return this.bins[r]=n,this.ref(n),n},r.prototype.shrink=function(){if(0<this.shelves.length){for(var e=0,t=0,i=0;i<this.shelves.length;i++){var r=this.shelves[i];t+=r.h,e=Math.max(r.w-r.free,e)}this.resize(e,t)}},r.prototype.getBin=function(e){return this.bins[e]},r.prototype.ref=function(e){if(1==++e.refcount){var t=e.h;this.stats[t]=1+(0|this.stats[t])}return e.refcount},r.prototype.unref=function(e){return 0===e.refcount?0:(0==--e.refcount&&(this.stats[e.h]--,delete this.bins[e.id],this.freebins.push(e)),e.refcount)},r.prototype.clear=function(){this.shelves=[],this.freebins=[],this.stats={},this.bins={},this.maxId=0},r.prototype.resize=function(e,t){this.w=e,this.h=t;for(var i=0;i<this.shelves.length;i++)this.shelves[i].resize(e);return!0},p.prototype.alloc=function(e,t,i){if(e>this.free||t>this.h)return null;var r=this.x;return this.x+=e,this.free-=e,new n(i,r,this.y,e,t,e,this.h)},p.prototype.resize=function(e){return this.free+=e-this.w,this.w=e,!0},r)},function(e,t,i){var n=i(0),a=i(16),o=i(2),s=i(34).normalizeSourceURL;e.exports=function(e,t,r){function i(e,t){if(e)return r(e);if(t){var i=n.pick(t,["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds"]);t.vector_layers&&(i.vectorLayers=t.vector_layers,i.vectorLayerIds=i.vectorLayers.map(function(e){return e.id})),r(null,i)}}e.url?a.getJSON(t(s(e.url),a.ResourceType.Source),i):o.frame(function(){return i(null,e)})}},function(e,t,i){var r=i(39),n=i(0).clamp,a=(function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(o.prototype,[{key:"validateBounds",value:function(e){return Array.isArray(e)&&4===e.length?[Math.max(-180,e[0]),Math.max(-90,e[1]),Math.min(180,e[2]),Math.min(90,e[3])]:[-180,-90,180,90]}},{key:"contains",value:function(e){var t=Math.floor(this.lngX(this.bounds.getWest(),e.z)),i=Math.floor(this.latY(this.bounds.getNorth(),e.z)),r=Math.ceil(this.lngX(this.bounds.getEast(),e.z)),n=Math.ceil(this.latY(this.bounds.getSouth(),e.z));return e.x>=t&&e.x<r&&e.y>=i&&e.y<n}},{key:"lngX",value:function(e,t){return(e+180)*(Math.pow(2,t)/360)}},{key:"latY",value:function(e,t){var i=n(Math.sin(Math.PI/180*e),-.9999,.9999),r=Math.pow(2,t)/(2*Math.PI);return Math.pow(2,t-1)+.5*Math.log((1+i)/(1-i))*-r}}]),o);function o(e,t,i){!function(e){if(!(e instanceof o))throw new TypeError("Cannot call a class as a function")}(this),this.bounds=r.convert(this.validateBounds(e)),this.minzoom=t||0,this.maxzoom=i||24}e.exports=a},function(e,t,i){function s(e){return(s="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})(e)}function l(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var c=i(0),d=i(16),n=i(10),a=i(112),h=i(34).normalizeTileURL,o=i(113),p=i(20),f=(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)}(m,n),function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(m.prototype,[{key:"load",value:function(){var i=this;this.fire("dataloading",{dataType:"source"}),a(this._options,this.map._transformRequest,function(e,t){e?i.fire("error",e):t&&(c.extend(i,t),t.bounds&&(i.tileBounds=new o(t.bounds,i.minzoom,i.maxzoom)),i.fire("data",{dataType:"source",sourceDataType:"metadata"}),i.fire("data",{dataType:"source",sourceDataType:"content"}))})}},{key:"onAdd",value:function(e){this.map=e,this.load()}},{key:"serialize",value:function(){return c.extend({},this._options)}},{key:"hasTile",value:function(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}},{key:"loadTile",value:function(n,a){var o=this,e=h(n.tileID.canonical.url(this.tiles,this.scheme),this.url,this.tileSize);n.request=d.getImage(this.map._transformRequest(e,d.ResourceType.Tile),function(e,t){if(delete n.request,n.aborted)n.state="unloaded",a(null);else if(e)n.state="errored",a(e);else if(t){o.map._refreshExpiredTiles&&n.setExpiryData(t),delete t.cacheControl,delete t.expires;var i=o.map.painter.context,r=i.gl;n.texture=o.map.painter.getTileTexture(t.width),n.texture?(n.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE,r.LINEAR_MIPMAP_NEAREST),r.texSubImage2D(r.TEXTURE_2D,0,0,0,r.RGBA,r.UNSIGNED_BYTE,t)):(n.texture=new p(i,t,r.RGBA),n.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE,r.LINEAR_MIPMAP_NEAREST),i.extTextureFilterAnisotropic&&r.texParameterf(r.TEXTURE_2D,i.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,i.extTextureFilterAnisotropicMax)),r.generateMipmap(r.TEXTURE_2D),n.state="loaded",a(null)}})}},{key:"abortTile",value:function(e,t){e.request&&(e.request.abort(),delete e.request),t()}},{key:"unloadTile",value:function(e,t){e.texture&&this.map.painter.saveTileTexture(e.texture),t()}},{key:"hasTransition",value:function(){return!1}}]),m);function m(e,t,i,r){var n,a,o;return function(e){if(!(e instanceof m))throw new TypeError("Cannot call a class as a function")}(this),(a=this,n=!(o=l(m).call(this))||"object"!==s(o)&&"function"!=typeof o?u(a):o).id=e,n.dispatcher=i,n.setEventedParent(r),n.type="raster",n.minzoom=0,n.maxzoom=22,n.roundZoom=!0,n.scheme="xyz",n.tileSize=512,n._loaded=!1,n._options=c.extend({},t),c.extend(u(n),c.pick(t,["url","scheme","tileSize"])),n}e.exports=f},function(e,t,i){function o(e){return(o="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})(e)}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var n=i(10),l=i(0),u=i(5),c=i(6),d=i(16).ResourceType,h=i(2),a=(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)}(p,n),function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(p.prototype,[{key:"load",value:function(){var t=this;this.fire("dataloading",{dataType:"source"}),this._updateWorkerData(function(e){e?t.fire("error",{error:e}):t.fire("data",{dataType:"source",sourceDataType:"metadata"})})}},{key:"onAdd",value:function(e){this.map=e,this.load()}},{key:"setData",value:function(e){var t=this;return this._data=e,this.fire("dataloading",{dataType:"source"}),this._updateWorkerData(function(e){if(e)return t.fire("error",{error:e});t.fire("data",{dataType:"source",sourceDataType:"content"})}),this}},{key:"_updateWorkerData",value:function(t){var e,i,r=this,n=l.extend({},this.workerOptions),a=this._data;"string"==typeof a?n.request=this.map._transformRequest((e=a,(i=u.document.createElement("a")).href=e,i.href),d.Source):n.data=JSON.stringify(a),this.workerID=this.dispatcher.send("".concat(this.type,".loadData"),n,function(e){r._loaded=!0,t(e)},this.workerID)}},{key:"loadTile",value:function(i,r){var n=this,a=void 0===i.workerID||"expired"===i.state?"loadTile":"reloadTile",e={type:this.type,uid:i.uid,tileID:i.tileID,zoom:i.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:h.devicePixelRatio,overscaling:i.tileID.overscaleFactor(),showCollisionBoxes:this.map.showCollisionBoxes};i.workerID=this.dispatcher.send(a,e,function(e,t){return i.unloadVectorData(),i.aborted?r(null):e?r(e):(i.loadVectorData(t,n.map.painter,"reloadTile"==a),r(null))},this.workerID)}},{key:"abortTile",value:function(e){e.aborted=!0}},{key:"unloadTile",value:function(e){e.unloadVectorData(),this.dispatcher.send("removeTile",{uid:e.uid,type:this.type,source:this.id},null,e.workerID)}},{key:"onRemove",value:function(){this.dispatcher.broadcast("removeSource",{type:this.type,source:this.id})}},{key:"serialize",value:function(){return l.extend({},this._options,{type:this.type,data:this._data})}},{key:"hasTransition",value:function(){return!1}}]),p);function p(e,t,i,r){var n;!function(e){if(!(e instanceof p))throw new TypeError("Cannot call a class as a function")}(this),(n=function(e,t){return!t||"object"!==o(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,s(p).call(this))).id=e,n.type="geojson",n.minzoom=0,n.maxzoom=18,n.tileSize=512,n.isTileClipped=!0,n.reparseOverscaled=!0,n.dispatcher=i,n.setEventedParent(r),n._data=t.data,n._options=l.extend({},t),void 0!==t.maxzoom&&(n.maxzoom=t.maxzoom),t.type&&(n.type=t.type);var a=c/n.tileSize;return n.workerOptions=l.extend({source:n.id,cluster:t.cluster||!1,geojsonVtOptions:{buffer:(void 0!==t.buffer?t.buffer:128)*a,tolerance:(void 0!==t.tolerance?t.tolerance:.375)*a,extent:c,maxZoom:n.maxzoom},superclusterOptions:{maxZoom:void 0!==t.clusterMaxZoom?Math.min(t.clusterMaxZoom,n.maxzoom-1):n.maxzoom-1,extent:c,radius:(t.clusterRadius||50)*a,log:!1}},t.workerOptions),n}e.exports=a},function(e,t){function m(e,t){var i=e.tileID,r=t.tileID;return i.overscaledZ-r.overscaledZ||i.canonical.y-r.canonical.y||i.wrap-r.wrap||i.canonical.x-r.canonical.x}t.rendered=function(e,t,i,r,n,a,o){var s=e.tilesIn(i);s.sort(m);var l=[],u=!0,c=!1,d=void 0;try{for(var h,p=s[Symbol.iterator]();!(u=(h=p.next()).done);u=!0){var f=h.value;l.push({wrappedTileID:f.tileID.wrapped().key,queryResults:f.tile.queryRenderedFeatures(t,f.queryGeometry,f.scale,r,a,e.id,o)})}}catch(e){c=!0,d=e}finally{try{u||null==p.return||p.return()}finally{if(c)throw d}}return function(e){var t={},i={},r=!0,n=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(r=(o=s.next()).done);r=!0){var l=o.value,u=l.queryResults,c=l.wrappedTileID,d=i[c]=i[c]||{};for(var h in u){var p=u[h],f=d[h]=d[h]||{},m=t[h]=t[h]||[],g=!0,y=!1,v=void 0;try{for(var _,C=p[Symbol.iterator]();!(g=(_=C.next()).done);g=!0){var x=_.value;f[x.featureIndex]||(f[x.featureIndex]=!0,m.push(x.feature))}}catch(e){y=!0,v=e}finally{try{g||null==C.return||C.return()}finally{if(y)throw v}}}}}catch(e){n=!0,a=e}finally{try{r||null==s.return||s.return()}finally{if(n)throw a}}return t}(l)},t.source=function(t,e){for(var i=t.getRenderableIds().map(function(e){return t.getTileByID(e)}),r=[],n={},a=0;a<i.length;a++){var o=i[a],s=o.tileID.canonical.key;n[s]||(n[s]=!0,o.querySourceFeatures(r,e))}return r}},function(e,t,i){function o(e){return(o="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})(e)}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function l(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var u=i(45).create,n=i(118),a=i(10),c=i(121),g=i(35),y=i(0),v=i(6),d=(i(67),i(3)),_=i(2),C=i(27).OverscaledTileID,x=i(1),h=(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)}(b,a),function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(b.prototype,[{key:"onAdd",value:function(e){this.map=e,this._maxTileCacheSize=e?e._maxTileCacheSize:null,this._source&&this._source.onAdd&&this._source.onAdd(e)}},{key:"onRemove",value:function(e){this._source&&this._source.onRemove&&this._source.onRemove(e)}},{key:"loaded",value:function(){if(this._sourceErrored)return!0;if(!this._sourceLoaded)return!1;for(var e in this._tiles){var t=this._tiles[e];if("loaded"!==t.state&&"errored"!==t.state)return!1}return!0}},{key:"getSource",value:function(){return this._source}},{key:"pause",value:function(){this._paused=!0}},{key:"resume",value:function(){if(this._paused){var e=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,e&&this.reload(),this.transform&&this.update(this.transform)}}},{key:"_loadTile",value:function(e,t){return this._source.loadTile(e,t)}},{key:"_unloadTile",value:function(e){if(this._source.unloadTile)return this._source.unloadTile(e,function(){})}},{key:"_abortTile",value:function(e){if(this._source.abortTile)return this._source.abortTile(e,function(){})}},{key:"serialize",value:function(){return this._source.serialize()}},{key:"prepare",value:function(e){for(var t in this._source.prepare&&this._source.prepare(),this._tiles)this._tiles[t].upload(e)}},{key:"getIds",value:function(){var o=this;return Object.keys(this._tiles).map(Number).sort(function(e,t){var i=o._tiles[e].tileID,r=o._tiles[t].tileID,n=new d(i.canonical.x,i.canonical.y).rotate(o.transform.angle),a=new d(r.canonical.x,r.canonical.y).rotate(o.transform.angle);return i.overscaledZ-r.overscaledZ||a.y-n.y||a.x-n.x})}},{key:"getRenderableIds",value:function(){return this.getIds().filter(this._isIdRenderable)}},{key:"hasRenderableParent",value:function(e){var t=this.findLoadedParent(e,0,{});return!!t&&this._isIdRenderable(t.tileID.key)}},{key:"_isIdRenderable",value:function(e){return this._tiles[e]&&this._tiles[e].hasData()&&!this._coveredTiles[e]}},{key:"reload",value:function(){if(this._paused)this._shouldReloadOnResume=!0;else for(var e in this._resetCache(),this._tiles)this._reloadTile(e,"reloading")}},{key:"_reloadTile",value:function(e,t){var i=this._tiles[e];i&&("loading"!==i.state&&(i.state=t),this._loadTile(i,this._tileLoaded.bind(this,i,e,t)))}},{key:"_tileLoaded",value:function(e,t,i,r){if(r)return e.state="errored",void(404!==r.status?this._source.fire("error",{tile:e,error:r}):this.update(this.transform));e.timeAdded=_.now(),"expired"===i&&(e.refreshedUponExpiration=!0),this._setTileReloadTimer(t,e),"raster-dem"===this.getSource().type&&e.dem&&this._backfillDEM(e),this._source.fire("data",{dataType:"source",tile:e,coord:e.tileID}),this.map&&(this.map.painter.tileExtentVAO.vao=null)}},{key:"_backfillDEM",value:function(e){for(var t=this.getRenderableIds(),i=0;i<t.length;i++){var r=t[i];if(e.neighboringTiles&&e.neighboringTiles[r]){var n=this.getTileByID(r);a(e,n),a(n,e)}}function a(e,t){e.needsHillshadePrepare=!0;var i=t.tileID.canonical.x-e.tileID.canonical.x,r=t.tileID.canonical.y-e.tileID.canonical.y,n=Math.pow(2,e.tileID.canonical.z),a=t.tileID.key;0===i&&0==r||1<Math.abs(r)||(1<Math.abs(i)&&(1===Math.abs(i+n)?i+=n:1===Math.abs(i-n)&&(i-=n)),t.dem&&e.dem&&(e.dem.backfillBorder(t.dem,i,r),e.neighboringTiles&&e.neighboringTiles[a]&&(e.neighboringTiles[a].backfilled=!0)))}}},{key:"getTile",value:function(e){return this.getTileByID(e.key)}},{key:"getTileByID",value:function(e){return this._tiles[e]}},{key:"getZoom",value:function(e){return e.zoom+e.scaleZoom(e.tileSize/this._source.tileSize)}},{key:"_findLoadedChildren",value:function(e,t,i){var r=!1;for(var n in this._tiles){var a=this._tiles[n];if(!(i[n]||!a.hasData()||a.tileID.overscaledZ<=e.overscaledZ||a.tileID.overscaledZ>t)){var o=Math.pow(2,a.tileID.canonical.z-e.canonical.z);if(Math.floor(a.tileID.canonical.x/o)===e.canonical.x&&Math.floor(a.tileID.canonical.y/o)===e.canonical.y)for(i[n]=a.tileID,r=!0;a&&a.tileID.overscaledZ-1>e.overscaledZ;){var s=a.tileID.scaledTo(a.tileID.overscaledZ-1);if(!s)break;(a=this._tiles[s.key])&&a.hasData()&&(delete i[n],i[s.key]=s)}}}return r}},{key:"findLoadedParent",value:function(e,t,i){for(var r=e.overscaledZ-1;t<=r;r--){var n=e.scaledTo(r);if(!n)return;var a=String(n.key),o=this._tiles[a];if(o&&o.hasData())return i[a]=n,o;if(this._cache.has(a))return i[a]=n,this._cache.get(a)}}},{key:"updateCacheSize",value:function(e){var t=(Math.ceil(e.width/this._source.tileSize)+1)*(Math.ceil(e.height/this._source.tileSize)+1),i=Math.floor(5*t),r="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,i):i;this._cache.setMaxSize(r)}},{key:"update",value:function(e){var t=this;if(this.transform=e,this._sourceLoaded&&!this._paused){var i;this.updateCacheSize(e),this._coveredTiles={},this.used?this._source.tileID?i=e.getVisibleUnwrappedCoordinates(this._source.tileID).map(function(e){return new C(e.canonical.z,e.wrap,e.canonical.z,e.canonical.x,e.canonical.y)}):(i=e.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(i=i.filter(function(e){return t._source.hasTile(e)}))):i=[];var r,n=(this._source.roundZoom?Math.round:Math.floor)(this.getZoom(e)),a=Math.max(n-b.maxOverzooming,this._source.minzoom),o=Math.max(n+b.maxUnderzooming,this._source.minzoom),s=this._updateRetainedTiles(i,n),l={};if(S(this._source.type))for(var u=Object.keys(s),c=0;c<u.length;c++){var d=u[c],h=s[d];x(h.key===+d);var p=this._tiles[d];if(p&&(void 0===p.fadeEndTime||p.fadeEndTime>=_.now())){this._findLoadedChildren(h,o,s)&&(s[d]=h);var f=this.findLoadedParent(h,a,l);f&&this._addTile(f.tileID)}}for(r in l)s[r]||(this._coveredTiles[r]=!0);for(r in l)s[r]=l[r];for(var m=y.keysDifference(this._tiles,s),g=0;g<m.length;g++)this._removeTile(m[g])}}},{key:"_updateRetainedTiles",value:function(e,t){for(var i={},r={},n=Math.max(t-b.maxOverzooming,this._source.minzoom),a=Math.max(t+b.maxUnderzooming,this._source.minzoom),o=0;o<e.length;o++){var s=e[o],l=this._addTile(s),u=!1;if(l.hasData())i[s.key]=s;else{u=l.wasRequested(),i[s.key]=s;var c=!0;if(t+1>this._source.maxzoom){var d=s.children(this._source.maxzoom)[0],h=this.getTile(d);h&&h.hasData()?i[d.key]=d:c=!1}else{this._findLoadedChildren(s,a,i);for(var p=s.children(this._source.maxzoom),f=0;f<p.length;f++)if(!i[p[f].key]){c=!1;break}}if(!c)for(var m=s.overscaledZ-1;n<=m;--m){var g=s.scaledTo(m);if(r[g.key])break;if(r[g.key]=!0,!(l=this.getTile(g))&&u&&(l=this._addTile(g)),l&&(i[g.key]=g,u=l.wasRequested(),l.hasData()))break}}}return i}},{key:"_addTile",value:function(e){var t=this._tiles[e.key];if(t)return t;(t=this._cache.getAndRemove(e.key))&&this._cacheTimers[e.key]&&(clearTimeout(this._cacheTimers[e.key]),delete this._cacheTimers[e.key],this._setTileReloadTimer(e.key,t));var i=Boolean(t);return i||(t=new n(e,this._source.tileSize*e.overscaleFactor()),this._loadTile(t,this._tileLoaded.bind(this,t,e.key,t.state))),t?(t.uses++,this._tiles[e.key]=t,i||this._source.fire("dataloading",{tile:t,coord:t.tileID,dataType:"source"}),t):null}},{key:"_setTileReloadTimer",value:function(e,t){var i=this;e in this._timers&&(clearTimeout(this._timers[e]),delete this._timers[e]);var r=t.getExpiryTimeout();r&&(this._timers[e]=setTimeout(function(){i._reloadTile(e,"expired"),delete i._timers[e]},r))}},{key:"_setCacheInvalidationTimer",value:function(e,t){var i=this;e in this._cacheTimers&&(clearTimeout(this._cacheTimers[e]),delete this._cacheTimers[e]);var r=t.getExpiryTimeout();r&&(this._cacheTimers[e]=setTimeout(function(){i._cache.remove(e),delete i._cacheTimers[e]},r))}},{key:"_removeTile",value:function(e){var t=this._tiles[e];if(t&&(t.uses--,delete this._tiles[e],this._timers[e]&&(clearTimeout(this._timers[e]),delete this._timers[e]),!(0<t.uses)))if(t.hasData()){t.tileID=t.tileID.wrapped();var i=t.tileID.key;this._cache.add(i,t),this._setCacheInvalidationTimer(i,t)}else t.aborted=!0,this._abortTile(t),this._unloadTile(t)}},{key:"clearTiles",value:function(){for(var e in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(e);this._resetCache()}},{key:"_resetCache",value:function(){for(var e in this._cacheTimers)clearTimeout(this._cacheTimers[e]);this._cacheTimers={},this._cache.reset()}},{key:"tilesIn",value:function(e){for(var t=[],i=this.getIds(),r=1/0,n=1/0,a=-1/0,o=-1/0,s=e[0].zoom,l=0;l<e.length;l++){var u=e[l];r=Math.min(r,u.column),n=Math.min(n,u.row),a=Math.max(a,u.column),o=Math.max(o,u.row)}for(var c=0;c<i.length;c++){var d=this._tiles[i[c]],h=d.tileID,p=[A(h,new g(r,n,s)),A(h,new g(a,o,s))];if(p[0].x<v&&p[0].y<v&&0<=p[1].x&&0<=p[1].y){for(var f=[],m=0;m<e.length;m++)f.push(A(h,e[m]));t.push({tile:d,tileID:h,queryGeometry:[f],scale:Math.pow(2,this.transform.zoom-d.tileID.overscaledZ)})}}return t}},{key:"getVisibleCoordinates",value:function(){var t=this,e=this.getRenderableIds().map(function(e){return t._tiles[e].tileID}),i=!0,r=!1,n=void 0;try{for(var a,o=e[Symbol.iterator]();!(i=(a=o.next()).done);i=!0){var s=a.value;s.posMatrix=this.transform.calculatePosMatrix(s.toUnwrapped())}}catch(t){r=!0,n=t}finally{try{i||null==o.return||o.return()}finally{if(r)throw n}}return e}},{key:"hasTransition",value:function(){if(this._source.hasTransition())return!0;if(S(this._source.type))for(var e in this._tiles){var t=this._tiles[e];if(void 0!==t.fadeEndTime&&t.fadeEndTime>=_.now())return!0}return!1}}]),b);function b(e,t,i){var r,n,a;return function(e){if(!(e instanceof b))throw new TypeError("Cannot call a class as a function")}(this),(n=this,a=s(b).call(this),r=!a||"object"!==o(a)&&"function"!=typeof a?l(n):a).id=e,r.dispatcher=i,r.on("data",function(e){"source"===e.dataType&&"metadata"===e.sourceDataType&&(r._sourceLoaded=!0),r._sourceLoaded&&!r._paused&&"source"===e.dataType&&"content"===e.sourceDataType&&(r.reload(),r.transform&&r.update(r.transform))}),r.on("error",function(){r._sourceErrored=!0}),r._source=u(e,t,i,l(r)),r._tiles={},r._cache=new c(0,r._unloadTile.bind(l(r))),r._timers={},r._cacheTimers={},r._maxTileCacheSize=null,r._isIdRenderable=r._isIdRenderable.bind(l(r)),r._coveredTiles={},r}function A(e,t){var i=t.zoomTo(e.canonical.z);return new d((i.column-(e.canonical.x+e.wrap*Math.pow(2,e.canonical.z)))*v,(i.row-e.canonical.y)*v)}function S(e){return"raster"===e||"image"===e||"video"===e}h.maxOverzooming=10,h.maxUnderzooming=3,e.exports=h},function(e,t,i){var h=i(0),a=i(201).deserialize,u=(i(202),i(48)),c=i(65),d=i(119),p=i(60),f=(i(120),i(62)),r=i(14),m=r.RasterBoundsArray,o=r.CollisionBoxArray,g=i(46),y=i(6),v=i(3),n=i(20),_=i(36).SegmentVector,C=i(37).TriangleIndexArray,s=i(2),l=(function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(x.prototype,[{key:"registerFadeDuration",value:function(e){var t=e+this.timeAdded;t<s.now()||this.fadeEndTime&&t<this.fadeEndTime||(this.fadeEndTime=t)}},{key:"wasRequested",value:function(){return"errored"===this.state||"loaded"===this.state||"reloading"===this.state}},{key:"loadVectorData",value:function(e,t,i){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",e){if(e.rawTileData&&(this.rawTileData=e.rawTileData),this.collisionBoxArray=e.collisionBoxArray,this.featureIndex=e.featureIndex,this.featureIndex.rawTileData=this.rawTileData,this.buckets=a(e.buckets,t.style),i)for(var r in this.buckets){var n=this.buckets[r];n instanceof f&&(n.justReloaded=!0)}e.iconAtlasImage&&(this.iconAtlasImage=e.iconAtlasImage),e.glyphAtlasImage&&(this.glyphAtlasImage=e.glyphAtlasImage)}else this.collisionBoxArray=new o}},{key:"unloadVectorData",value:function(){for(var e in this.buckets)this.buckets[e].destroy();this.buckets={},this.iconAtlasTexture&&this.iconAtlasTexture.destroy(),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.collisionBoxArray=null,this.featureIndex=null,this.state="unloaded"}},{key:"unloadDEMData",value:function(){this.dem=null,this.neighboringTiles=null,this.state="unloaded"}},{key:"getBucket",value:function(e){return this.buckets[e.id]}},{key:"upload",value:function(e){for(var t in this.buckets){var i=this.buckets[t];i.uploaded||(i.upload(e),i.uploaded=!0)}var r=e.gl;this.iconAtlasImage&&(this.iconAtlasTexture=new n(e,this.iconAtlasImage,r.RGBA),this.iconAtlasImage=null),this.glyphAtlasImage&&(this.glyphAtlasTexture=new n(e,this.glyphAtlasImage,r.ALPHA),this.glyphAtlasImage=null)}},{key:"queryRenderedFeatures",value:function(e,t,i,r,n,a,o){if(!this.featureIndex||!this.collisionBoxArray)return{};var s=0,l={};for(var u in e){var c=this.getBucket(e[u]);c&&(s=Math.max(s,e[u].queryRadius(c)),c instanceof f&&void 0!==c.bucketInstanceId&&(l[c.bucketInstanceId]=!0))}return this.featureIndex.query({queryGeometry:t,scale:i,tileSize:this.tileSize,bearing:n,params:r,additionalRadius:s,collisionBoxArray:this.collisionBoxArray,sourceID:a,collisionIndex:o,bucketInstanceIds:l},e)}},{key:"querySourceFeatures",value:function(e,t){if(this.rawTileData){this.vtLayers||(this.vtLayers=new u.VectorTile(new c(this.rawTileData)).layers);var i=t?t.sourceLayer:"",r=this.vtLayers._geojsonTileLayer||this.vtLayers[i];if(r)for(var n=p(t&&t.filter),a={z:this.tileID.overscaledZ,x:this.tileID.canonical.x,y:this.tileID.canonical.y},o=0;o<r.length;o++){var s=r.feature(o);if(n({zoom:this.tileID.overscaledZ},s)){var l=new d(s,a.z,a.x,a.y);l.tile=a,e.push(l)}}}}},{key:"clearMask",value:function(){this.segments&&(this.segments.destroy(),delete this.segments),this.maskedBoundsBuffer&&(this.maskedBoundsBuffer.destroy(),delete this.maskedBoundsBuffer),this.maskedIndexBuffer&&(this.maskedIndexBuffer.destroy(),delete this.maskedIndexBuffer)}},{key:"setMask",value:function(e,t){if(!h.deepEqual(this.mask,e)&&(this.mask=e,this.clearMask(),!h.deepEqual(e,{0:!0}))){var i=new m,r=new C;this.segments=new _,this.segments.prepareSegment(0,i,r);for(var n=Object.keys(e),a=0;a<n.length;a++){var o=e[n[a]],s=y>>o.z,l=new v(o.x*s,o.y*s),u=new v(l.x+s,l.y+s),c=this.segments.prepareSegment(4,i,r);i.emplaceBack(l.x,l.y,l.x,l.y),i.emplaceBack(u.x,l.y,u.x,l.y),i.emplaceBack(l.x,u.y,l.x,u.y),i.emplaceBack(u.x,u.y,u.x,u.y);var d=c.vertexLength;r.emplaceBack(d,d+1,d+2),r.emplaceBack(d+1,d+2,d+3),c.vertexLength+=4,c.primitiveLength+=2}this.maskedBoundsBuffer=t.createVertexBuffer(i,g.members),this.maskedIndexBuffer=t.createIndexBuffer(r)}}},{key:"hasData",value:function(){return"loaded"===this.state||"reloading"===this.state||"expired"===this.state}},{key:"setExpiryData",value:function(e){var t=this.expirationTime;if(e.cacheControl){var i=h.parseCacheControl(e.cacheControl);i["max-age"]&&(this.expirationTime=Date.now()+1e3*i["max-age"])}else e.expires&&(this.expirationTime=new Date(e.expires).getTime());if(this.expirationTime){var r=Date.now(),n=!1;if(this.expirationTime>r)n=!1;else if(t)if(this.expirationTime<t)n=!0;else{var a=this.expirationTime-t;a?this.expirationTime=r+Math.max(a,3e4):n=!0}else n=!0;n?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}}},{key:"getExpiryTimeout",value:function(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-(new Date).getTime(),Math.pow(2,31)-1)}}]),x);function x(e,t){!function(e){if(!(e instanceof x))throw new TypeError("Cannot call a class as a function")}(this),this.tileID=e,this.uid=h.uniqueId(),this.uses=0,this.tileSize=t,this.buckets={},this.expirationTime=null,this.expiredRequestCount=0,this.state="loading"}e.exports=l},function(e,t){var i=(function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(n.prototype,[{key:"toJSON",value:function(){var e={geometry:this.geometry};for(var t in this)"_geometry"!==t&&"_vectorTileFeature"!==t&&(e[t]=this[t]);return e}},{key:"geometry",get:function(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry},set:function(e){this._geometry=e}}]),n);function n(e,t,i,r){!function(e){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}(this),this.type="Feature",(this._vectorTileFeature=e)._z=t,e._x=i,e._y=r,this.properties=e.properties,null!=e.id&&(this.id=e.id)}e.exports=i},function(e,t,i){var F=i(3),k=i(44),r=i(204),V=(i(22).mat4,i(66)),n=(function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(a.prototype,[{key:"placeCollisionBox",value:function(e,t,i,r){var n=this.projectAndGetPerspectiveRatio(r,e.anchorPointX,e.anchorPointY),a=i*n.perspectiveRatio,o=e.x1*a+n.point.x,s=e.y1*a+n.point.y,l=e.x2*a+n.point.x,u=e.y2*a+n.point.y;return!t&&this.grid.hitTest(o,s,l,u)?{box:[],offscreen:!1}:{box:[o,s,l,u],offscreen:this.isOffscreen(o,s,l,u)}}},{key:"approximateTileDistance",value:function(e,t,i,r,n){var a=n?1:r/this.pitchfactor,o=e.lastSegmentViewportDistance*i;return e.prevTileDistance+o+(a-1)*o*Math.abs(Math.sin(t))}},{key:"placeCollisionCircles",value:function(e,t,i,r,n,a,o,s,l,u,c,d,h){var p=[],f=this.projectAnchor(u,a.anchorX,a.anchorY),m=l/24,g=a.lineOffsetX*l,y=a.lineOffsetY*l,v=new F(a.anchorX,a.anchorY),_=V.project(v,c).point,C=V.placeFirstAndLastGlyph(m,s,g,y,!1,_,v,a,o,c,{},!0),x=!1,b=!0,A=f.perspectiveRatio*r,S=1/(r*i),w=0,E=0;C&&(w=this.approximateTileDistance(C.first.tileDistance,C.first.angle,S,f.cameraDistance,h),E=this.approximateTileDistance(C.last.tileDistance,C.last.angle,S,f.cameraDistance,h));for(var T=0;T<e.length;T+=5){var P=e[T],M=e[T+1],D=e[T+2],I=e[T+3];if(!C||I<-w||E<I)z(e,T,!1);else{var O=this.projectPoint(u,P,M),R=D*A;if(0<p.length){var L=O.x-p[p.length-4],N=O.y-p[p.length-3];if(L*L+N*N<R*R*2&&T+8<e.length){var k=e[T+8];if(-w<k&&k<E){z(e,T,!1);continue}}}var B=T/5;if(p.push(O.x,O.y,R,B),z(e,T,!0),b=b&&this.isOffscreen(O.x-R,O.y-R,O.x+R,O.y+R),!t&&this.grid.hitTestCircle(O.x,O.y,R)){if(!d)return{circles:[],offscreen:!1};x=!0}}}return{circles:x?[]:p,offscreen:b}}},{key:"queryRenderedSymbols",value:function(e,t,i,r,n,a){var o={},s=[];if(0===e.length||0===this.grid.keysLength()&&0===this.ignoredGrid.keysLength())return s;for(var l=this.transform.calculatePosMatrix(t.toUnwrapped()),u=[],c=1/0,d=1/0,h=-1/0,p=-1/0,f=0;f<e.length;f++)for(var m=e[f],g=0;g<m.length;g++){var y=this.projectPoint(l,m[g].x,m[g].y);c=Math.min(c,y.x),d=Math.min(d,y.y),h=Math.max(h,y.x),p=Math.max(p,y.y),u.push(y)}for(var v=t.key,_=[],C=this.grid.query(c,d,h,p),x=0;x<C.length;x++)C[x].sourceID===n&&C[x].tileID===v&&a[C[x].bucketInstanceId]&&_.push(C[x].boxIndex);for(var b=this.ignoredGrid.query(c,d,h,p),A=0;A<b.length;A++)b[A].sourceID===n&&b[A].tileID===v&&_.push(b[A].boxIndex);for(var S=0;S<_.length;S++){var w=r.get(_[S]),E=w.sourceLayerIndex,T=w.featureIndex,P=w.bucketIndex;if(void 0===o[E]&&(o[E]={}),void 0===o[E][T]&&(o[E][T]={}),!o[E][T][P]){var M=this.projectAndGetPerspectiveRatio(l,w.anchorPointX,w.anchorPointY),D=i*M.perspectiveRatio,I=w.x1*D+M.point.x,O=w.y1*D+M.point.y,R=w.x2*D+M.point.x,L=w.y2*D+M.point.y,N=[new F(I,O),new F(R,O),new F(R,L),new F(I,L)];k.polygonIntersectsPolygon(u,N)&&(o[E][T][P]=!0,s.push(_[S]))}}return s}},{key:"insertCollisionBox",value:function(e,t,i,r,n,a){var o={tileID:i,sourceID:r,bucketInstanceId:n,boxIndex:a};(t?this.ignoredGrid:this.grid).insert(o,e[0],e[1],e[2],e[3])}},{key:"insertCollisionCircles",value:function(e,t,i,r,n,a){for(var o=t?this.ignoredGrid:this.grid,s=0;s<e.length;s+=4){var l={tileID:i,sourceID:r,bucketInstanceId:n,boxIndex:a+e[s+3]};o.insertCircle(l,e[s],e[s+1],e[s+2])}}},{key:"projectAnchor",value:function(e,t,i){var r=[t,i,0,1];return V.xyTransformMat4(r,r,e),{perspectiveRatio:.5+this.transform.cameraToCenterDistance/r[3]*.5,cameraDistance:r[3]}}},{key:"projectPoint",value:function(e,t,i){var r=[t,i,0,1];return V.xyTransformMat4(r,r,e),new F((r[0]/r[3]+1)/2*this.transform.width+100,(-r[1]/r[3]+1)/2*this.transform.height+100)}},{key:"projectAndGetPerspectiveRatio",value:function(e,t,i){var r=[t,i,0,1];return V.xyTransformMat4(r,r,e),{point:new F((r[0]/r[3]+1)/2*this.transform.width+100,(-r[1]/r[3]+1)/2*this.transform.height+100),perspectiveRatio:.5+this.transform.cameraToCenterDistance/r[3]*.5}}},{key:"isOffscreen",value:function(e,t,i,r){return i<100||e>=this.screenRightBoundary||r<100||t>this.screenBottomBoundary}}]),a);function a(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:new r(e.width+200,e.height+200,25),i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:new r(e.width+200,e.height+200,25);!function(e){if(!(e instanceof a))throw new TypeError("Cannot call a class as a function")}(this),this.transform=e,this.grid=t,this.ignoredGrid=i,this.pitchfactor=Math.cos(e._pitch)*e.cameraToCenterDistance,this.screenRightBoundary=e.width+100,this.screenBottomBoundary=e.height+100}function z(e,t,i){e[t+4]=i?1:0}e.exports=n},function(e,t){var i=(function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(r.prototype,[{key:"reset",value:function(){for(var e in this.data)this.onRemove(this.data[e]);return this.data={},this.order=[],this}},{key:"add",value:function(e,t){if(this.has(e))this.order.splice(this.order.indexOf(e),1),this.data[e]=t,this.order.push(e);else if(this.data[e]=t,this.order.push(e),this.order.length>this.max){var i=this.getAndRemove(this.order[0]);i&&this.onRemove(i)}return this}},{key:"has",value:function(e){return e in this.data}},{key:"keys",value:function(){return this.order}},{key:"getAndRemove",value:function(e){if(!this.has(e))return null;var t=this.data[e];return delete this.data[e],this.order.splice(this.order.indexOf(e),1),t}},{key:"get",value:function(e){return this.has(e)?this.data[e]:null}},{key:"remove",value:function(e){if(!this.has(e))return this;var t=this.data[e];return delete this.data[e],this.onRemove(t),this.order.splice(this.order.indexOf(e),1),this}},{key:"setMaxSize",value:function(e){for(this.max=e;this.order.length>this.max;){var t=this.getAndRemove(this.order[0]);t&&this.onRemove(t)}return this}}]),r);function r(e,t){!function(e){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}(this),this.max=e,this.onRemove=t,this.reset()}e.exports=i},function(e,t,i){function r(e){return(r="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})(e)}function n(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function a(e){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function c(e,t,i){return t&&u(e.prototype,t),i&&u(e,i),e}var d=i(12),h=i(0),p=(c(ve,[{key:"get",value:function(){return this.current}},{key:"set",value:function(e){var t=this.current;e.r===t.r&&e.g===t.g&&e.b===t.b&&e.a===t.a||(this.context.gl.clearColor(e.r,e.g,e.b,e.a),this.current=e)}}]),ve),f=(c(ye,[{key:"get",value:function(){return this.current}},{key:"set",value:function(e){this.current!==e&&(this.context.gl.clearDepth(e),this.current=e)}}]),ye),m=(c(ge,[{key:"get",value:function(){return this.current}},{key:"set",value:function(e){this.current!==e&&(this.context.gl.clearStencil(e),this.current=e)}}]),ge),g=(c(me,[{key:"get",value:function(){return this.current}},{key:"set",value:function(e){var t=this.current;e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]||(this.context.gl.colorMask(e[0],e[1],e[2],e[3]),this.current=e)}}]),me),y=(c(fe,[{key:"get",value:function(){return this.current}},{key:"set",value:function(e){this.current!==e&&(this.context.gl.depthMask(e),this.current=e)}}]),fe),v=(c(pe,[{key:"get",value:function(){return this.current}},{key:"set",value:function(e){this.current!==e&&(this.context.gl.stencilMask(e),this.current=e)}}]),pe),_=(c(he,[{key:"get",value:function(){return this.current}},{key:"set",value:function(e){var t=this.current;e.func===t.func&&e.ref===t.ref&&e.mask===t.mask||(this.context.gl.stencilFunc(e.func,e.ref,e.mask),this.current=e)}}]),he),C=(c(de,[{key:"get",value:function(){return this.current}},{key:"set",value:function(e){var t=this.current;e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]||(this.context.gl.stencilOp(e[0],e[1],e[2]),this.current=e)}}]),de),x=(c(ce,[{key:"get",value:function(){return this.current}},{key:"set",value:function(e){if(this.current!==e){var t=this.context.gl;e?t.enable(t.STENCIL_TEST):t.disable(t.STENCIL_TEST),this.current=e}}}]),ce),b=(c(ue,[{key:"get",value:function(){return this.current}},{key:"set",value:function(e){var t=this.current;e[0]===t[0]&&e[1]===t[1]||(this.context.gl.depthRange(e[0],e[1]),this.current=e)}}]),ue),A=(c(le,[{key:"get",value:function(){return this.current}},{key:"set",value:function(e){if(this.current!==e){var t=this.context.gl;e?t.enable(t.DEPTH_TEST):t.disable(t.DEPTH_TEST),this.current=e}}}]),le),S=(c(se,[{key:"get",value:function(){return this.current}},{key:"set",value:function(e){this.current!==e&&(this.context.gl.depthFunc(e),this.current=e)}}]),se),w=(c(oe,[{key:"get",value:function(){return this.current}},{key:"set",value:function(e){if(this.current!==e){var t=this.context.gl;e?t.enable(t.BLEND):t.disable(t.BLEND),this.current=e}}}]),oe),E=(c(ae,[{key:"get",value:function(){return this.current}},{key:"set",value:function(e){var t=this.current;e[0]===t[0]&&e[1]===t[1]||(this.context.gl.blendFunc(e[0],e[1]),this.current=e)}}]),ae),T=(c(ne,[{key:"get",value:function(){return this.current}},{key:"set",value:function(e){var t=this.current;e.r===t.r&&e.g===t.g&&e.b===t.b&&e.a===t.a||(this.context.gl.blendColor(e.r,e.g,e.b,e.a),this.current=e)}}]),ne),P=(c(re,[{key:"get",value:function(){return this.current}},{key:"set",value:function(e){this.current!==e&&(this.context.gl.useProgram(e),this.current=e)}}]),re),M=(c(ie,[{key:"get",value:function(){return this.current}},{key:"set",value:function(e){var t=this.context.lineWidthRange,i=h.clamp(e,t[0],t[1]);this.current!==i&&(this.context.gl.lineWidth(i),this.current=e)}}]),ie),D=(c(te,[{key:"get",value:function(){return this.current}},{key:"set",value:function(e){this.current!==e&&(this.context.gl.activeTexture(e),this.current=e)}}]),te),I=(c(ee,[{key:"get",value:function(){return this.current}},{key:"set",value:function(e){var t=this.current;e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]||(this.context.gl.viewport(e[0],e[1],e[2],e[3]),this.current=e)}}]),ee),O=(c(K,[{key:"get",value:function(){return this.current}},{key:"set",value:function(e){if(this.current!==e){var t=this.context.gl;t.bindFramebuffer(t.FRAMEBUFFER,e),this.current=e}}}]),K),R=(c(J,[{key:"get",value:function(){return this.current}},{key:"set",value:function(e){if(this.current!==e){var t=this.context.gl;t.bindRenderbuffer(t.RENDERBUFFER,e),this.current=e}}}]),J),L=(c(Z,[{key:"get",value:function(){return this.current}},{key:"set",value:function(e){if(this.current!==e){var t=this.context.gl;t.bindTexture(t.TEXTURE_2D,e),this.current=e}}}]),Z),N=(c(X,[{key:"get",value:function(){return this.current}},{key:"set",value:function(e){if(this.current!==e){var t=this.context.gl;t.bindBuffer(t.ARRAY_BUFFER,e),this.current=e}}}]),X),k=(c(Y,[{key:"get",value:function(){return this.current}},{key:"set",value:function(e){var t=this.context.gl;t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,e),this.current=e}}]),Y),B=(c(Q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(e){this.current!==e&&this.context.extVertexArrayObject&&(this.context.extVertexArrayObject.bindVertexArrayOES(e),this.current=e)}}]),Q),F=(c(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(e){if(this.current!==e){var t=this.context.gl;t.pixelStorei(t.UNPACK_ALIGNMENT,e),this.current=e}}}]),q),V=(c(j,[{key:"get",value:function(){return this.current}},{key:"set",value:function(e){if(this.current!==e){var t=this.context.gl;t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e),this.current=e}}}]),j),z=(c(W,[{key:"get",value:function(){return this.current}}]),W),U=(o(H,z),c(H,[{key:"set",value:function(e){if(this.dirty||this.current!==e){var t=this.context.gl;this.context.bindFramebuffer.set(this.parent),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,e,0),this.current=e,this.dirty=!1}}},{key:"setDirty",value:function(){this.dirty=!0}}]),H),G=(o($,z),c($,[{key:"set",value:function(e){if(this.current!==e){var t=this.context.gl;this.context.bindFramebuffer.set(this.parent),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.RENDERBUFFER,e),this.current=e}}}]),$);function $(){return l(this,$),n(this,a($).apply(this,arguments))}function H(e,t){var i;return l(this,H),(i=n(this,a(H).call(this,e,t))).dirty=!1,i}function W(e,t){l(this,W),this.context=e,this.current=null,this.parent=t}function j(e){l(this,j),this.context=e,this.current=!1}function q(e){l(this,q),this.context=e,this.current=4}function Q(e){l(this,Q),this.context=e,this.current=null}function Y(e){l(this,Y),this.context=e,this.current=null}function X(e){l(this,X),this.context=e,this.current=null}function Z(e){l(this,Z),this.context=e,this.current=null}function J(e){l(this,J),this.context=e,this.current=null}function K(e){l(this,K),this.context=e,this.current=null}function ee(e){l(this,ee),this.context=e;var t=this.context.gl;this.current=[0,0,t.drawingBufferWidth,t.drawingBufferHeight]}function te(e){l(this,te),this.context=e,this.current=e.gl.TEXTURE0}function ie(e){l(this,ie),this.context=e,this.current=1}function re(e){l(this,re),this.context=e,this.current=null}function ne(e){l(this,ne),this.context=e,this.current=d.transparent}function ae(e){l(this,ae),this.context=e;var t=this.context.gl;this.current=[t.ONE,t.ZERO]}function oe(e){l(this,oe),this.context=e,this.current=!1}function se(e){l(this,se),this.context=e,this.current=e.gl.LESS}function le(e){l(this,le),this.context=e,this.current=!1}function ue(e){l(this,ue),this.context=e,this.current=[0,1]}function ce(e){l(this,ce),this.context=e,this.current=!1}function de(e){l(this,de),this.context=e;var t=this.context.gl;this.current=[t.KEEP,t.KEEP,t.KEEP]}function he(e){l(this,he),this.context=e,this.current={func:e.gl.ALWAYS,ref:0,mask:255}}function pe(e){l(this,pe),this.context=e,this.current=255}function fe(e){l(this,fe),this.context=e,this.current=!0}function me(e){l(this,me),this.context=e,this.current=[!0,!0,!0,!0]}function ge(e){l(this,ge),this.context=e,this.current=0}function ye(e){l(this,ye),this.context=e,this.current=1}function ve(e){l(this,ve),this.context=e,this.current=d.transparent}e.exports={ClearColor:p,ClearDepth:f,ClearStencil:m,ColorMask:g,DepthMask:y,StencilMask:v,StencilFunc:_,StencilOp:C,StencilTest:x,DepthRange:b,DepthTest:A,DepthFunc:S,Blend:w,BlendFunc:E,BlendColor:T,Program:P,LineWidth:M,ActiveTextureUnit:D,Viewport:I,BindFramebuffer:O,BindRenderbuffer:R,BindTexture:L,BindVertexBuffer:N,BindElementBuffer:k,BindVertexArrayOES:B,PixelStoreUnpack:F,PixelStoreUnpackPremultiplyAlpha:V,ColorAttachment:U,DepthAttachment:G}},function(e,t,i){function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function n(e,t,i){return t&&r(e.prototype,t),i&&r(e,i),e}var a=i(6),o=512/a/2,C=(n(f,[{key:"getScaledCoordinates",value:function(e,t){var i=t.canonical.z-this.tileID.canonical.z,r=o/Math.pow(2,i),n=e.anchor;return{x:Math.floor((t.canonical.x*a+n.x)*r),y:Math.floor((t.canonical.y*a+n.y)*r)}}},{key:"findMatches",value:function(e,t,i){var r=this.tileID.canonical.z<t.canonical.z?1:Math.pow(2,this.tileID.canonical.z-t.canonical.z),n=!0,a=!1,o=void 0;try{for(var s,l=e[Symbol.iterator]();!(n=(s=l.next()).done);n=!0){var u=s.value;if(!u.crossTileID){var c=this.indexedSymbolInstances[u.key];if(c){var d=this.getScaledCoordinates(u,t),h=!0,p=!1,f=void 0;try{for(var m,g=c[Symbol.iterator]();!(h=(m=g.next()).done);h=!0){var y=m.value;if(Math.abs(y.coord.x-d.x)<=r&&Math.abs(y.coord.y-d.y)<=r&&!i[y.crossTileID]){i[y.crossTileID]=!0,u.crossTileID=y.crossTileID;break}}}catch(e){p=!0,f=e}finally{try{h||null==g.return||g.return()}finally{if(p)throw f}}}}}}catch(e){a=!0,o=e}finally{try{n||null==l.return||l.return()}finally{if(a)throw o}}}}]),f),s=(n(p,[{key:"generate",value:function(){return++this.maxCrossTileID}}]),p),h=(n(d,[{key:"addBucket",value:function(e,t,i){if(this.indexes[e.overscaledZ]&&this.indexes[e.overscaledZ][e.key]){if(this.indexes[e.overscaledZ][e.key].bucketInstanceId===t.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(e.overscaledZ,this.indexes[e.overscaledZ][e.key])}var r=!0,n=!1,a=void 0;try{for(var o,s=t.symbolInstances[Symbol.iterator]();!(r=(o=s.next()).done);r=!0)o.value.crossTileID=0}catch(e){n=!0,a=e}finally{try{r||null==s.return||s.return()}finally{if(n)throw a}}this.usedCrossTileIDs[e.overscaledZ]||(this.usedCrossTileIDs[e.overscaledZ]={});var l=this.usedCrossTileIDs[e.overscaledZ];for(var u in this.indexes){var c=this.indexes[u];if(Number(u)>e.overscaledZ)for(var d in c){var h=c[d];h.tileID.isChildOf(e)&&h.findMatches(t.symbolInstances,e,l)}else{var p=c[e.scaledTo(Number(u)).key];p&&p.findMatches(t.symbolInstances,e,l)}}var f=!0,m=!1,g=void 0;try{for(var y,v=t.symbolInstances[Symbol.iterator]();!(f=(y=v.next()).done);f=!0){var _=y.value;_.crossTileID||(_.crossTileID=i.generate(),l[_.crossTileID]=!0)}}catch(e){m=!0,g=e}finally{try{f||null==v.return||v.return()}finally{if(m)throw g}}return void 0===this.indexes[e.overscaledZ]&&(this.indexes[e.overscaledZ]={}),this.indexes[e.overscaledZ][e.key]=new C(e,t.symbolInstances,t.bucketInstanceId),!0}},{key:"removeBucketCrossTileIDs",value:function(e,t){for(var i in t.indexedSymbolInstances){var r=!0,n=!1,a=void 0;try{for(var o,s=t.indexedSymbolInstances[i][Symbol.iterator]();!(r=(o=s.next()).done);r=!0){var l=o.value;delete this.usedCrossTileIDs[e][l.crossTileID]}}catch(e){n=!0,a=e}finally{try{r||null==s.return||s.return()}finally{if(n)throw a}}}}},{key:"removeStaleBuckets",value:function(e){var t=!1;for(var i in this.indexes){var r=this.indexes[i];for(var n in r)e[r[n].bucketInstanceId]||(this.removeBucketCrossTileIDs(i,r[n]),delete r[n],t=!0)}return t}}]),d),l=(n(u,[{key:"addLayer",value:function(e,t){var i=this.layerIndexes[e.id];void 0===i&&(i=this.layerIndexes[e.id]=new h);var r=!1,n={},a=!0,o=!1,s=void 0;try{for(var l,u=t[Symbol.iterator]();!(a=(l=u.next()).done);a=!0){var c=l.value,d=c.getBucket(e);d&&(d.bucketInstanceId||(d.bucketInstanceId=++this.maxBucketInstanceId),i.addBucket(c.tileID,d,this.crossTileIDs)&&(r=!0),n[d.bucketInstanceId]=!0)}}catch(e){o=!0,s=e}finally{try{a||null==u.return||u.return()}finally{if(o)throw s}}return i.removeStaleBuckets(n)&&(r=!0),r}}]),u);function u(){c(this,u),this.layerIndexes={},this.crossTileIDs=new s,this.maxBucketInstanceId=0}function d(){c(this,d),this.indexes={},this.usedCrossTileIDs={}}function p(){c(this,p),this.maxCrossTileID=0}function f(e,t,i){c(this,f),this.tileID=e,this.indexedSymbolInstances={},this.bucketInstanceId=i;var r=!0,n=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(r=(o=s.next()).done);r=!0){var l=o.value,u=l.key;this.indexedSymbolInstances[u]||(this.indexedSymbolInstances[u]=[]),this.indexedSymbolInstances[u].push({crossTileID:l.crossTileID,coord:this.getScaledCoordinates(l,e)})}}catch(e){n=!0,a=e}finally{try{r||null==s.return||s.return()}finally{if(n)throw a}}}e.exports=l},function(e,t,i){var C=i(2),c=i(22).mat4,r=i(117),a=i(6),d=i(28),x=i(0),o=i(40),n=i(14),s=n.RasterBoundsArray,l=n.PosArray,u=i(46),h=i(125),p=i(32).ProgramConfiguration,f=i(123),m=i(126),g=i(268),y=i(67),v=i(15),_=i(18),b=i(68),A=(i(20),i(269)),S=i(12),w={symbol:i(270),circle:i(272),heatmap:i(273),line:i(274),fill:i(275),"fill-extrusion":i(276),hillshade:i(277),raster:i(278),background:i(279),debug:i(280)},E=(function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(T.prototype,[{key:"resize",value:function(e,t){var i=this.context.gl;if(this.width=e*C.devicePixelRatio,this.height=t*C.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style){var r=!0,n=!1,a=void 0;try{for(var o,s=this.style._order[Symbol.iterator]();!(r=(o=s.next()).done);r=!0){var l=o.value;this.style._layers[l].resize()}}catch(e){n=!0,a=e}finally{try{r||null==s.return||s.return()}finally{if(n)throw a}}}this.depthRbo&&(i.deleteRenderbuffer(this.depthRbo),this.depthRbo=null)}},{key:"setup",value:function(){var e=this.context,t=new l;t.emplaceBack(0,0),t.emplaceBack(a,0),t.emplaceBack(0,a),t.emplaceBack(a,a),this.tileExtentBuffer=e.createVertexBuffer(t,h.members),this.tileExtentVAO=new o,this.tileExtentPatternVAO=new o;var i=new l;i.emplaceBack(0,0),i.emplaceBack(a,0),i.emplaceBack(a,a),i.emplaceBack(0,a),i.emplaceBack(0,0),this.debugBuffer=e.createVertexBuffer(i,h.members),this.debugVAO=new o;var r=new s;r.emplaceBack(0,0,0,0),r.emplaceBack(a,0,a,0),r.emplaceBack(0,a,0,a),r.emplaceBack(a,a,a,a),this.rasterBoundsBuffer=e.createVertexBuffer(r,u.members),this.rasterBoundsVAO=new o;var n=new l;n.emplaceBack(0,0),n.emplaceBack(1,0),n.emplaceBack(0,1),n.emplaceBack(1,1),this.viewportBuffer=e.createVertexBuffer(n,h.members),this.viewportVAO=new o}},{key:"clearStencil",value:function(){var e=this.context,t=e.gl;e.setColorMode(b.disabled),e.setDepthMode(v.disabled),e.setStencilMode(new _({func:t.ALWAYS,mask:0},0,255,t.ZERO,t.ZERO,t.ZERO));var i=c.create();c.ortho(i,0,this.width,this.height,0,0,1),c.scale(i,i,[t.drawingBufferWidth,t.drawingBufferHeight,0]);var r=this.useProgram("clippingMask");t.uniformMatrix4fv(r.uniforms.u_matrix,!1,i),this.viewportVAO.bind(e,r,this.viewportBuffer,[]),t.drawArrays(t.TRIANGLE_STRIP,0,4)}},{key:"_renderTileClippingMasks",value:function(e){var t=this.context,i=t.gl;t.setColorMode(b.disabled),t.setDepthMode(v.disabled);var r=1,n=!0,a=!(this._tileClippingMaskIDs={}),o=void 0;try{for(var s,l=e[Symbol.iterator]();!(n=(s=l.next()).done);n=!0){var u=s.value,c=this._tileClippingMaskIDs[u.key]=r++;t.setStencilMode(new _({func:i.ALWAYS,mask:0},c,255,i.KEEP,i.KEEP,i.REPLACE));var d=this.useProgram("clippingMask");i.uniformMatrix4fv(d.uniforms.u_matrix,!1,u.posMatrix),this.tileExtentVAO.bind(this.context,d,this.tileExtentBuffer,[]),i.drawArrays(i.TRIANGLE_STRIP,0,this.tileExtentBuffer.length)}}catch(e){a=!0,o=e}finally{try{n||null==l.return||l.return()}finally{if(a)throw o}}}},{key:"stencilModeForClipping",value:function(e){var t=this.context.gl;return new _({func:t.EQUAL,mask:255},this._tileClippingMaskIDs[e.key],0,t.KEEP,t.KEEP,t.REPLACE)}},{key:"colorModeForRenderPass",value:function(){var e=this.context.gl;return this._showOverdrawInspector?new b([e.CONSTANT_COLOR,e.ONE],new S(1/8,1/8,1/8,0),[!0,!0,!0,!0]):"opaque"===this.renderPass?b.unblended:b.alphaBlended}},{key:"depthModeForSublayer",value:function(e,t,i){var r=1-((1+this.currentLayer)*this.numSublayers+e)*this.depthEpsilon,n=r-1+this.depthRange;return new v(i||this.context.gl.LEQUAL,t,[n,r])}},{key:"render",value:function(e,t){var r=this;for(var i in this.style=e,this.options=t,this.lineAtlas=e.lineAtlas,this.imageManager=e.imageManager,this.glyphManager=e.glyphManager,this.symbolFadeChange=e.placement.symbolFadeChange(C.now()),e.sourceCaches){var n=this.style.sourceCaches[i];n.used&&n.prepare(this.context)}function a(e){var t=s[e],i=t.getVisibleCoordinates().map(function(e){return t.getTile(e)});A(i,r.context)}var o=this.style._order,s=x.filterObject(this.style.sourceCaches,function(e){return"raster"===e.getSource().type||"raster-dem"===e.getSource().type});for(var l in s)a(l);this.renderPass="offscreen";var u,c=[];this.depthRboNeedsClear=!0;for(var d=0;d<o.length;d++){var h=this.style._layers[o[d]];h.hasOffscreenPass()&&!h.isHidden(this.transform.zoom)&&(h.source!==(u&&u.id)&&(c=[],(u=this.style.sourceCaches[h.source])&&(c=u.getVisibleCoordinates()).reverse()),c.length&&this.renderLayer(this,u,h,c))}this.context.bindFramebuffer.set(null),this.context.clear({color:t.showOverdrawInspector?S.black:S.transparent,depth:1}),this._showOverdrawInspector=t.showOverdrawInspector,this.depthRange=(e._order.length+2)*this.numSublayers*this.depthEpsilon,this.renderPass="opaque";var p,f=[];for(this.currentLayer=o.length-1,this.currentLayer;0<=this.currentLayer;this.currentLayer--){var m=this.style._layers[o[this.currentLayer]];m.source!==(p&&p.id)&&(f=[],(p=this.style.sourceCaches[m.source])&&(this.clearStencil(),f=p.getVisibleCoordinates(),p.getSource().isTileClipped&&this._renderTileClippingMasks(f))),this.renderLayer(this,p,m,f)}this.renderPass="translucent";var g,y=[];for(this.currentLayer=0,this.currentLayer;this.currentLayer<o.length;this.currentLayer++){var v=this.style._layers[o[this.currentLayer]];v.source!==(g&&g.id)&&(y=[],(g=this.style.sourceCaches[v.source])&&(this.clearStencil(),y=g.getVisibleCoordinates(),g.getSource().isTileClipped&&this._renderTileClippingMasks(y)),y.reverse()),this.renderLayer(this,g,v,y)}if(this.options.showTileBoundaries){var _=this.style.sourceCaches[Object.keys(this.style.sourceCaches)[0]];_&&w.debug(this,_,_.getVisibleCoordinates())}}},{key:"setupOffscreenDepthRenderbuffer",value:function(){var e=this.context;this.depthRbo||(this.depthRbo=e.createRenderbuffer(e.gl.DEPTH_COMPONENT16,this.width,this.height))}},{key:"renderLayer",value:function(e,t,i,r){i.isHidden(this.transform.zoom)||"background"!==i.type&&!r.length||(this.id=i.id,w[i.type](e,t,i,r))}},{key:"translatePosMatrix",value:function(e,t,i,r,n){if(!i[0]&&!i[1])return e;var a=n?"map"===r?this.transform.angle:0:"viewport"===r?-this.transform.angle:0;if(a){var o=Math.sin(a),s=Math.cos(a);i=[i[0]*s-i[1]*o,i[0]*o+i[1]*s]}var l=[n?i[0]:d(t,i[0],this.transform.zoom),n?i[1]:d(t,i[1],this.transform.zoom),0],u=new Float32Array(16);return c.translate(u,e,l),u}},{key:"saveTileTexture",value:function(e){var t=this._tileTextures[e.size[0]];t?t.push(e):this._tileTextures[e.size[0]]=[e]}},{key:"getTileTexture",value:function(e){var t=this._tileTextures[e];return t&&0<t.length?t.pop():null}},{key:"_createProgramCached",value:function(e,t){this.cache=this.cache||{};var i="".concat(e).concat(t.cacheKey||"").concat(this._showOverdrawInspector?"/overdraw":"");return this.cache[i]||(this.cache[i]=new g(this.context,m[e],t,this._showOverdrawInspector)),this.cache[i]}},{key:"useProgram",value:function(e,t){var i=this._createProgramCached(e,t||this.emptyProgramConfiguration);return this.context.program.set(i.program),i}}]),T);function T(e,t){!function(e){if(!(e instanceof T))throw new TypeError("Cannot call a class as a function")}(this),this.context=new y(e),this.transform=t,this._tileTextures={},this.setup(),this.numSublayers=r.maxUnderzooming+r.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.depthRboNeedsClear=!0,this.emptyProgramConfiguration=new p,this.crossTileSymbolIndex=new f}e.exports=E},function(e,t,i){var r=i(23).createLayout;e.exports=r([{name:"a_pos",type:"Int16",components:2}])},function(e,t,i){function r(e){var t=n[e],o={};t.fragmentSource=t.fragmentSource.replace(a,function(e,t,i,r,n){return o[n]=!0,"define"===t?"\n#ifndef HAS_UNIFORM_u_".concat(n,"\nvarying ").concat(i," ").concat(r," ").concat(n,";\n#else\nuniform ").concat(i," ").concat(r," u_").concat(n,";\n#endif\n"):"\n#ifdef HAS_UNIFORM_u_".concat(n,"\n ").concat(i," ").concat(r," ").concat(n," = u_").concat(n,";\n#endif\n")}),t.vertexSource=t.vertexSource.replace(a,function(e,t,i,r,n){var a="float"===r?"vec2":"vec4";return o[n]?"define"===t?"\n#ifndef HAS_UNIFORM_u_".concat(n,"\nuniform lowp float a_").concat(n,"_t;\nattribute ").concat(i," ").concat(a," a_").concat(n,";\nvarying ").concat(i," ").concat(r," ").concat(n,";\n#else\nuniform ").concat(i," ").concat(r," u_").concat(n,";\n#endif\n"):"\n#ifndef HAS_UNIFORM_u_".concat(n,"\n ").concat(n," = unpack_mix_").concat(a,"(a_").concat(n,", a_").concat(n,"_t);\n#else\n ").concat(i," ").concat(r," ").concat(n," = u_").concat(n,";\n#endif\n"):"define"===t?"\n#ifndef HAS_UNIFORM_u_".concat(n,"\nuniform lowp float a_").concat(n,"_t;\nattribute ").concat(i," ").concat(a," a_").concat(n,";\n#else\nuniform ").concat(i," ").concat(r," u_").concat(n,";\n#endif\n"):"\n#ifndef HAS_UNIFORM_u_".concat(n,"\n ").concat(i," ").concat(r," ").concat(n," = unpack_mix_").concat(a,"(a_").concat(n,", a_").concat(n,"_t);\n#else\n ").concat(i," ").concat(r," ").concat(n," = u_").concat(n,";\n#endif\n")})}var n={prelude:{fragmentSource:i(218),vertexSource:i(219)},background:{fragmentSource:i(220),vertexSource:i(221)},backgroundPattern:{fragmentSource:i(222),vertexSource:i(223)},circle:{fragmentSource:i(224),vertexSource:i(225)},clippingMask:{fragmentSource:i(226),vertexSource:i(227)},heatmap:{fragmentSource:i(228),vertexSource:i(229)},heatmapTexture:{fragmentSource:i(230),vertexSource:i(231)},collisionBox:{fragmentSource:i(232),vertexSource:i(233)},collisionCircle:{fragmentSource:i(234),vertexSource:i(235)},debug:{fragmentSource:i(236),vertexSource:i(237)},fill:{fragmentSource:i(238),vertexSource:i(239)},fillOutline:{fragmentSource:i(240),vertexSource:i(241)},fillOutlinePattern:{fragmentSource:i(242),vertexSource:i(243)},fillPattern:{fragmentSource:i(244),vertexSource:i(245)},fillExtrusion:{fragmentSource:i(246),vertexSource:i(247)},fillExtrusionPattern:{fragmentSource:i(248),vertexSource:i(249)},extrusionTexture:{fragmentSource:i(250),vertexSource:i(251)},hillshadePrepare:{fragmentSource:i(252),vertexSource:i(253)},hillshade:{fragmentSource:i(254),vertexSource:i(255)},line:{fragmentSource:i(256),vertexSource:i(257)},linePattern:{fragmentSource:i(258),vertexSource:i(259)},lineSDF:{fragmentSource:i(260),vertexSource:i(261)},raster:{fragmentSource:i(262),vertexSource:i(263)},symbolIcon:{fragmentSource:i(264),vertexSource:i(265)},symbolSDF:{fragmentSource:i(266),vertexSource:i(267)}},a=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g;for(var o in n)r(o);e.exports=n},function(e,t,i){var m=i(9),r=i(0),g=i(5),c=i(2),y=r.bezier(0,0,.25,1),n=(function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(a.prototype,[{key:"isEnabled",value:function(){return!!this._enabled}},{key:"isActive",value:function(){return!!this._active}},{key:"enable",value:function(){this.isEnabled()||(this._el.addEventListener("mousedown",this._onDown),this._enabled=!0)}},{key:"disable",value:function(){this.isEnabled()&&(this._el.removeEventListener("mousedown",this._onDown),this._enabled=!1)}},{key:"_onDown",value:function(e){if(!(this._map.boxZoom&&this._map.boxZoom.isActive()||this._map.dragPan&&this._map.dragPan.isActive()||this.isActive())){if("right"===this._button){var t=e.ctrlKey?0:2,i=e.button;if(void 0!==g.InstallTrigger&&2===e.button&&e.ctrlKey&&0<=g.navigator.platform.toUpperCase().indexOf("MAC")&&(i=0),i!==t)return}else if(e.ctrlKey||0!==e.button)return;m.disableDrag(),g.document.addEventListener("mousemove",this._onMove,{capture:!0}),g.document.addEventListener("mouseup",this._onUp),g.addEventListener("blur",this._onUp),this._active=!1,this._inertia=[[c.now(),this._map.getBearing()]],this._startPos=this._pos=m.mousePos(this._el,e),this._center=this._map.transform.centerPoint,e.preventDefault()}}},{key:"_onMove",value:function(e){this.isActive()||(this._active=!0,this._map.moving=!0,this._fireEvent("rotatestart",e),this._fireEvent("movestart",e),this._pitchWithRotate&&this._fireEvent("pitchstart",e));var t=this._map;t.stop();var i=this._pos,r=m.mousePos(this._el,e),n=.8*(i.x-r.x),a=-.5*(i.y-r.y),o=t.getBearing()-n,s=t.getPitch()-a,l=this._inertia,u=l[l.length-1];this._drainInertiaBuffer(),l.push([c.now(),t._normalizeBearing(o,u[1])]),t.transform.bearing=o,this._pitchWithRotate&&(this._fireEvent("pitch",e),t.transform.pitch=s),this._fireEvent("rotate",e),this._fireEvent("move",e),this._pos=r}},{key:"_onUp",value:function(e){var t=this;if(g.document.removeEventListener("mousemove",this._onMove,{capture:!0}),g.document.removeEventListener("mouseup",this._onUp),g.removeEventListener("blur",this._onUp),m.enableDrag(),this.isActive()){this._active=!1,this._fireEvent("rotateend",e),this._drainInertiaBuffer();var i=this._map,r=i.getBearing(),n=this._inertia,a=function(){Math.abs(r)<t._bearingSnap?i.resetNorth({noMoveStart:!0},{originalEvent:e}):(t._map.moving=!1,t._fireEvent("moveend",e)),t._pitchWithRotate&&t._fireEvent("pitchend",e)};if(n.length<2)a();else{var o=n[0],s=n[n.length-1],l=n[n.length-2],u=i._normalizeBearing(r,l[1]),c=s[1]-o[1],d=c<0?-1:1,h=(s[0]-o[0])/1e3;if(0!=c&&0!=h){var p=Math.abs(.25/h*c);180<p&&(p=180);var f=p/180;u+=d*p*(f/2),Math.abs(i._normalizeBearing(u,0))<this._bearingSnap&&(u=i._normalizeBearing(0,u)),i.rotateTo(u,{duration:1e3*f,easing:y,noMoveStart:!0},{originalEvent:e})}else a()}}}},{key:"_fireEvent",value:function(e,t){return this._map.fire(e,{originalEvent:t})}},{key:"_drainInertiaBuffer",value:function(){for(var e=this._inertia,t=c.now();0<e.length&&160<t-e[0][0];)e.shift()}}]),a);function a(e,t){!function(e){if(!(e instanceof a))throw new TypeError("Cannot call a class as a function")}(this),this._map=e,this._el=t.element||e.getCanvasContainer(),this._button=t.button||"right",this._bearingSnap=t.bearingSnap||0,this._pitchWithRotate=!1!==t.pitchWithRotate,r.bindAll(["_onDown","_onMove","_onUp"],this)}e.exports=n},function(e,t,i){var r=i(9),n=i(0),a=i(64),o=(function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(s.prototype,[{key:"getDefaultPosition",value:function(){return"bottom-right"}},{key:"onAdd",value:function(e){var t=this.options&&this.options.compact;return this._map=e,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),t&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),void 0===t&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container}},{key:"onRemove",value:function(){r.remove(this._container),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0}},{key:"_updateEditLink",value:function(){var e=this._editLink;e=e||(this._editLink=this._container.querySelector(".mapbox-improve-map"));var r=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:a.ACCESS_TOKEN}];if(e){var t=r.reduce(function(e,t,i){return t.value&&(e+="".concat(t.key,"=").concat(t.value).concat(i<r.length-1?"&":"")),e},"?");e.href="https://www.mapbox.com/feedback/".concat(t).concat(this._map._hash?this._map._hash.getHashString(!0):"")}}},{key:"_updateData",value:function(e){e&&"metadata"===e.sourceDataType&&(this._updateAttributions(),this._updateEditLink())}},{key:"_updateAttributions",value:function(){if(this._map.style){var r=[];if(this._map.style.stylesheet){var e=this._map.style.stylesheet;this.styleOwner=e.owner,this.styleId=e.id}var t=this._map.style.sourceCaches;for(var i in t){var n=t[i].getSource();n.attribution&&r.indexOf(n.attribution)<0&&r.push(n.attribution)}r.sort(function(e,t){return e.length-t.length}),r=r.filter(function(e,t){for(var i=t+1;i<r.length;i++)if(0<=r[i].indexOf(e))return!1;return!0}),this._container.innerHTML=r.join(" | "),this._editLink=null}}},{key:"_updateCompact",value:function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact")}}]),s);function s(e){!function(e){if(!(e instanceof s))throw new TypeError("Cannot call a class as a function")}(this),this.options=e,n.bindAll(["_updateEditLink","_updateData","_updateCompact"],this)}e.exports=o},function(e,t,i){var v=i(9),r=i(21),_=i(3),n=i(130),C=i(0).bindAll,a=(function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(x.prototype,[{key:"addTo",value:function(e){return this.remove(),(this._map=e).getCanvasContainer().appendChild(this._element),e.on("move",this._update),e.on("moveend",this._update),this._update(),this._map.on("click",this._onMapClick),this}},{key:"remove",value:function(){return this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),delete this._map),v.remove(this._element),this._popup&&this._popup.remove(),this}},{key:"getLngLat",value:function(){return this._lngLat}},{key:"setLngLat",value:function(e){return this._lngLat=r.convert(e),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}},{key:"getElement",value:function(){return this._element}},{key:"setPopup",value:function(e){return this._popup&&(this._popup.remove(),this._popup=null),e&&("offset"in e.options||(e.options.offset=this._offset),this._popup=e,this._lngLat&&this._popup.setLngLat(this._lngLat)),this}},{key:"_onMapClick",value:function(e){var t=e.originalEvent.target,i=this._element;this._popup&&(t===i||i.contains(t))&&this.togglePopup()}},{key:"getPopup",value:function(){return this._popup}},{key:"togglePopup",value:function(){var e=this._popup;return e&&(e.isOpen()?e.remove():e.addTo(this._map)),this}},{key:"_update",value:function(e){this._map&&(this._map.transform.renderWorldCopies&&(this._lngLat=n(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset),e&&"moveend"!==e.type||(this._pos=this._pos.round()),v.setTransform(this._element,"translate(-50%, -50%) translate(".concat(this._pos.x,"px, ").concat(this._pos.y,"px)")))}},{key:"getOffset",value:function(){return this._offset}},{key:"setOffset",value:function(e){return this._offset=_.convert(e),this._update(),this}}]),x);function x(e,t){if(function(e){if(!(e instanceof x))throw new TypeError("Cannot call a class as a function")}(this),this._offset=_.convert(t&&t.offset||[0,0]),C(["_update","_onMapClick"],this),!e){e=v.create("div");var i=v.createNS("http://www.w3.org/2000/svg","svg");i.setAttributeNS(null,"height","41px"),i.setAttributeNS(null,"width","27px"),i.setAttributeNS(null,"viewBox","0 0 27 41");var r=v.createNS("http://www.w3.org/2000/svg","g");r.setAttributeNS(null,"stroke","none"),r.setAttributeNS(null,"stroke-width","1"),r.setAttributeNS(null,"fill","none"),r.setAttributeNS(null,"fill-rule","evenodd");var n=v.createNS("http://www.w3.org/2000/svg","g");n.setAttributeNS(null,"fill-rule","nonzero");var a=v.createNS("http://www.w3.org/2000/svg","g");a.setAttributeNS(null,"transform","translate(3.0, 29.0)"),a.setAttributeNS(null,"fill","#000000");for(var o=0,s=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];o<s.length;o++){var l=s[o],u=v.createNS("http://www.w3.org/2000/svg","ellipse");u.setAttributeNS(null,"opacity","0.04"),u.setAttributeNS(null,"cx","10.5"),u.setAttributeNS(null,"cy","5.80029008"),u.setAttributeNS(null,"rx",l.rx),u.setAttributeNS(null,"ry",l.ry),a.appendChild(u)}var c=v.createNS("http://www.w3.org/2000/svg","g");c.setAttributeNS(null,"fill","#3FB1CE");var d=v.createNS("http://www.w3.org/2000/svg","path");d.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),c.appendChild(d);var h=v.createNS("http://www.w3.org/2000/svg","g");h.setAttributeNS(null,"opacity","0.25"),h.setAttributeNS(null,"fill","#000000");var p=v.createNS("http://www.w3.org/2000/svg","path");p.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),h.appendChild(p);var f=v.createNS("http://www.w3.org/2000/svg","g");f.setAttributeNS(null,"transform","translate(6.0, 7.0)"),f.setAttributeNS(null,"fill","#FFFFFF");var m=v.createNS("http://www.w3.org/2000/svg","g");m.setAttributeNS(null,"transform","translate(8.0, 8.0)");var g=v.createNS("http://www.w3.org/2000/svg","circle");g.setAttributeNS(null,"fill","#000000"),g.setAttributeNS(null,"opacity","0.25"),g.setAttributeNS(null,"cx","5.5"),g.setAttributeNS(null,"cy","5.5"),g.setAttributeNS(null,"r","5.4999962");var y=v.createNS("http://www.w3.org/2000/svg","circle");y.setAttributeNS(null,"fill","#FFFFFF"),y.setAttributeNS(null,"cx","5.5"),y.setAttributeNS(null,"cy","5.5"),y.setAttributeNS(null,"r","5.4999962"),m.appendChild(g),m.appendChild(y),n.appendChild(a),n.appendChild(c),n.appendChild(h),n.appendChild(f),n.appendChild(m),i.appendChild(n),e.appendChild(i)}e.classList.add("mapboxgl-marker"),this._element=e,this._popup=null}e.exports=a},function(e,t,i){var s=i(21);e.exports=function(e,t,i){if(e=new s(e.lng,e.lat),t){var r=new s(e.lng-360,e.lat),n=new s(e.lng+360,e.lat),a=i.locationPoint(e).distSqr(t);i.locationPoint(r).distSqr(t)<a?e=r:i.locationPoint(n).distSqr(t)<a&&(e=n)}for(;180<Math.abs(e.lng-i.center.lng);){var o=i.locationPoint(e);if(0<=o.x&&0<=o.y&&o.x<=i.width&&o.y<=i.height)break;e.lng>i.center.lng?e.lng-=360:e.lng+=360}return e}},function(e,t,i){e.exports=i(71)},function(e){e.exports={name:"mapbox-gl",description:"A WebGL interactive maps library",version:"2.1.3",main:"dist/mapbox-gl.js",module:"dist/mapbox-gl.js",style:"dist/mapbox-gl.css",license:"SEE LICENSE IN LICENSE.txt",repository:{type:"git",url:"git://github.com/mapbox/mapbox-gl-js.git"},engines:{node:">=6.4.0"},dependencies:{"@mapbox/gl-matrix":"^0.0.1","@mapbox/mapbox-gl-supported":"^1.3.0","@mapbox/point-geometry":"^0.1.0","@mapbox/shelf-pack":"=3.1.0","@mapbox/sphericalmercator":"github:landtechnologies/sphericalmercator#24a1b89b4edc26fcfd6171d61c27e3a9ea2f885c","@mapbox/tiny-sdf":"^1.1.0","@mapbox/unitbezier":"^0.0.0","@mapbox/vector-tile":"^1.3.0","@mapbox/whoots-js":"^3.0.0",brfs:"^1.4.0",bubleify:"^0.7.0",csscolorparser:"~1.0.2",earcut:"^2.1.3","geojson-rewind":"^0.3.0","geojson-vt":"^3.0.0","gray-matter":"^3.0.8","grid-index":"^1.0.0","jsonlint-lines-primitives":"~1.6.0","mapbox-gl-supported":"^1.2.0",minimist:"0.0.8","package-json-versionify":"^1.0.2",pbf:"^3.0.5","point-geometry":"^0.0.0",quickselect:"^1.0.0",rw:"^1.3.3","shuffle-seed":"^1.1.6","sort-object":"^0.3.2",supercluster:"^2.3.0",through2:"^2.0.3",tinyqueue:"^1.1.0",unassertify:"^2.0.0",unflowify:"^1.0.0","vt-pbf":"^3.0.1",webworkify:"^1.5.0"},devDependencies:{"@babel/cli":"^7.4.4","@babel/core":"^7.4.5","@babel/plugin-proposal-class-properties":"^7.4.4","@babel/plugin-transform-flow-strip-types":"^7.4.4","@babel/preset-env":"^7.4.5","@mapbox/batfish":"^0.13.3","@mapbox/mapbox-gl-rtl-text":"^0.1.1","@mapbox/mapbox-gl-test-suite":"file:test/integration","babel-eslint":"^7.0.0","babel-loader":"^8.0.6","babel-preset-es2015":"^6.24.1",benchmark:"~2.1.0",browserify:"^14.0.0",coveralls:"^2.11.8",d3:"^4.12.0",derequire:"^2.0.6",documentation:"5.3.3",ejs:"^2.5.7",envify:"^4.0.0",eslint:"4.1.1","eslint-config-mourner":"^2.0.0","eslint-plugin-flowtype":"^2.34.0","eslint-plugin-html":"^3.0.0","eslint-plugin-node":"^5.1.1","eslint-plugin-react":"^7.3.0","execcommand-copy":"^1.1.0","flow-bin":"^0.62.0","flow-coverage-report":"^0.3.0","flow-remove-types":"^1.0.4","github-slugger":"^1.1.1",gl:"^4.0.1",glob:"^7.0.3","in-publish":"^2.0.0","is-builtin-module":"^1.0.0",jsdom:"^11.2.0","json-stringify-pretty-compact":"^1.0.4",lodash:"^4.16.0",minifyify:"^7.0.1","mock-geolocation":"^1.0.11","npm-run-all":"^4.0.1",nyc:"^10.1.2","object.entries":"^1.0.4",pngjs:"^3.0.0",prismjs:"^1.8.1","prop-types":"^15.6.0",proxyquire:"^1.7.9","raw-loader":"^0.5.1",react:"^16.0.0","react-dom":"^16.0.0","react-helmet":"^5.2.0",remark:"^8.0.0","remark-html":"^5.0.1","remark-react":"^4.0.1",request:"^2.79.0",sinon:"^2.1.0",slugg:"^1.2.1",st:"^1.2.0",stylelint:"^7.10.1",tap:"^10.3.0",watchify:"^3.7.0",webpack:"^4.35.0","webpack-cli":"^3.3.5","worker-loader":"^2.0.0"},browserify:{transform:["unflowify",["bubleify",{bubleError:!0,transforms:{dangerousForOf:!0},objectAssign:"Object.assign"}],"package-json-versionify","unassertify","brfs","./build/minifyify_style_spec","./build/strictify"]},browser:{"./src/util/window.js":"./src/util/browser/window.js","./src/util/web_worker.js":"./src/util/browser/web_worker.js"},scripts:{"build-dev":"browserify src/index.js --debug --ignore-transform unassertify --standalone mapboxgl > dist/mapbox-gl-dev.js && tap --no-coverage test/build/dev.test.js","watch-dev":"watchify src/index.js --debug --ignore-transform unassertify --standalone mapboxgl --outfile dist/mapbox-gl-dev.js --verbose","watch-style-property-editor":"watchify debug/style_property_editor.js --debug -o debug/style_property_editor_generated.js --standalone StylePropertyEditor --verbose","build-min":"browserify src/index.js --debug --plugin [minifyify --map mapbox-gl.js.map --output dist/mapbox-gl.js.map] --standalone mapboxgl | derequire > dist/mapbox-gl.js && tap --no-coverage test/build/min.test.js","build-token":"browserify debug/access_token.js --debug --transform envify > debug/access_token_generated.js","build-benchmarks":'BENCHMARK_VERSION="$(git rev-parse --abbrev-ref HEAD) $(git rev-parse --short=7 HEAD)" browserify bench/benchmarks.js --debug --transform envify --outfile bench/benchmarks_generated.js --verbose',"watch-benchmarks":'BENCHMARK_VERSION="$(git rev-parse --abbrev-ref HEAD) $(git rev-parse --short=7 HEAD)" watchify bench/benchmarks.js --debug --transform envify --outfile bench/benchmarks_generated.js --verbose',"watch-benchmarks-view":"watchify bench/benchmarks_view.js --debug --outfile bench/benchmarks_view_generated.js --verbose","start-server":"st --no-cache --localhost --port 9966 --index index.html .",start:"run-p build-token watch-dev watch-style-property-editor watch-benchmarks watch-benchmarks-view start-server","start-debug":"run-p build-token watch-dev watch-style-property-editor start-server","start-bench":"run-p build-token watch-benchmarks watch-benchmarks-view start-server","build-docs":"documentation build --github --format json --config ./docs/documentation.yml --output docs/components/api.json src/index.js",build:"run-s build-docs && DEPLOY_ENV=production batfish build # invoked by publisher when publishing docs on the mb-pages branch","start-docs":"run-s build-min build-docs && DEPLOY_ENV=local batfish start",lint:"eslint --cache --ignore-path .gitignore src test bench docs docs/pages/example/*.html debug/*.html","lint-docs":"documentation lint src/index.js","lint-css":"stylelint 'dist/mapbox-gl.css'","open-changed-examples":"git diff --name-only mb-pages HEAD -- docs/pages/example/*.html | awk '{print \"http://127.0.0.1:4000/mapbox-gl-js/example/\" substr($0,33,length($0)-37)}' | xargs open",test:"run-s lint lint-css test-flow test-unit","test-suite":"run-s test-render test-query","test-suite-clean":'find test/integration/{render,query}-tests -mindepth 2 -type d -not \\( -exec test -e "{}/style.json" \\; \\) -print | xargs -t rm -r',"test-unit":"tap --reporter classic --no-coverage test/unit","test-render":"node --max-old-space-size=2048 test/render.test.js","test-query":"node test/query.test.js","test-expressions":"node test/expression.test.js","test-flow":"node build/generate-flow-typed-style-spec && flow .","test-flow-cov":"flow-coverage-report -i 'src/**/*.js' -t html","test-cov":"nyc --require=flow-remove-types/register --reporter=text-summary --reporter=lcov --cache run-s test-unit test-expressions test-query test-render",prepublish:"in-publish && run-s build-dev build-min || not-in-publish",codegen:"node build/generate-style-code.js && flow-node build/generate-struct-arrays.js"},bin:{"gl-style-migrate":"src/style-spec/bin/gl-style-migrate","gl-style-validate":"src/style-spec/bin/gl-style-validate","gl-style-format":"src/style-spec/bin/gl-style-format","gl-style-composite":"src/style-spec/bin/gl-style-composite"},files:["build/","dist/","flow-typed/","src/",".flowconfig"]}},function(e,t,i){function s(e){return(s="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})(e)}function l(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function u(e,t,i){return(u="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,i){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=c(e)););return e}(e,t);if(r){var n=Object.getOwnPropertyDescriptor(r,t);return n.get?n.get.call(i):n.value}})(e,t,i||e)}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var d=i(0),f=i(2),h=i(5),n=i(5),m=n.HTMLImageElement,p=n.HTMLElement,a=i(9),o=i(16),g=i(53),y=i(61),v=i(124),_=i(281),C=i(283),x=i(285),b=i(292),A=i(21),S=i(39),w=i(3),E=i(128),T=i(293),P=i(72),M=i(33).RGBAImage;i(294);var D={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:0,maxZoom:22,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,bearingSnap:7,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,maxTileCacheSize:null,transformRequest:null,fadeDuration:300},I=(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)}(O,b),function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(O.prototype,[{key:"addControl",value:function(e,t){void 0===t&&e.getDefaultPosition&&(t=e.getDefaultPosition()),void 0===t&&(t="top-right");var i=e.onAdd(this),r=this._controlPositions[t];return-1!==t.indexOf("bottom")?r.insertBefore(i,r.firstChild):r.appendChild(i),this}},{key:"removeControl",value:function(e){return e.onRemove(this),this}},{key:"resize",value:function(){var e=this._containerDimensions(),t=e[0],i=e[1];return this._resizeCanvas(t,i),this.transform.resize(t,i),this.painter.resize(t,i),this.fire("movestart").fire("move").fire("resize").fire("moveend")}},{key:"getBounds",value:function(){var e=new S(this.transform.pointLocation(new w(0,this.transform.height)),this.transform.pointLocation(new w(this.transform.width,0)));return(this.transform.angle||this.transform.pitch)&&(e.extend(this.transform.pointLocation(new w(this.transform.size.x,0))),e.extend(this.transform.pointLocation(new w(0,this.transform.size.y)))),e}},{key:"getMaxBounds",value:function(){return this.transform.latRange&&2===this.transform.latRange.length&&this.transform.lngRange&&2===this.transform.lngRange.length?new S([this.transform.lngRange[0],this.transform.latRange[0]],[this.transform.lngRange[1],this.transform.latRange[1]]):null}},{key:"setMaxBounds",value:function(e){if(e){var t=S.convert(e);this.transform.lngRange=[t.getWest(),t.getEast()],this.transform.latRange=[t.getSouth(),t.getNorth()],this.transform._constrain(),this._update()}else null==e&&(this.transform.lngRange=null,this.transform.latRange=null,this._update());return this}},{key:"setMinZoom",value:function(e){if(0<=(e=null==e?0:e)&&e<=this.transform.maxZoom)return this.transform.minZoom=e,this._update(),this.getZoom()<e&&this.setZoom(e),this;throw new Error("minZoom must be between ".concat(0," and the current maxZoom, inclusive"))}},{key:"getMinZoom",value:function(){return this.transform.minZoom}},{key:"setMaxZoom",value:function(e){if((e=null==e?22:e)>=this.transform.minZoom)return this.transform.maxZoom=e,this._update(),this.getZoom()>e&&this.setZoom(e),this;throw new Error("maxZoom must be greater than the current minZoom")}},{key:"getMaxZoom",value:function(){return this.transform.maxZoom}},{key:"project",value:function(e){return this.transform.locationPoint(A.convert(e))}},{key:"unproject",value:function(e){return this.transform.pointLocation(w.convert(e))}},{key:"on",value:function(a,o,s){var l=this;if(void 0===s)return u(c(O.prototype),"on",this).call(this,a,o);var e=function(){if("mouseenter"===a||"mouseover"===a){var i=!1;return{layer:o,listener:s,delegates:{mousemove:function(e){var t=l.getLayer(o)?l.queryRenderedFeatures(e.point,{layers:[o]}):[];t.length?i||(i=!0,s.call(l,d.extend({features:t},e,{type:a}))):i=!1},mouseout:function(){i=!1}}}}if("mouseleave"!==a&&"mouseout"!==a)return{layer:o,listener:s,delegates:(e={},t=a,r=function(e){var t=l.getLayer(o)?l.queryRenderedFeatures(e.point,{layers:[o]}):[];t.length&&s.call(l,d.extend({features:t},e))},t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e)};var e,t,r,n=!1;return{layer:o,listener:s,delegates:{mousemove:function(e){(l.getLayer(o)?l.queryRenderedFeatures(e.point,{layers:[o]}):[]).length?n=!0:n&&(n=!1,s.call(l,d.extend({},e,{type:a})))},mouseout:function(e){n&&(n=!1,s.call(l,d.extend({},e,{type:a})))}}}}();for(var t in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[a]=this._delegatedListeners[a]||[],this._delegatedListeners[a].push(e),e.delegates)this.on(t,e.delegates[t]);return this}},{key:"off",value:function(e,t,i){if(void 0===i)return u(c(O.prototype),"off",this).call(this,e,t);if(this._delegatedListeners&&this._delegatedListeners[e])for(var r=this._delegatedListeners[e],n=0;n<r.length;n++){var a=r[n];if(a.layer===t&&a.listener===i){for(var o in a.delegates)this.off(o,a.delegates[o]);return r.splice(n,1),this}}return this}},{key:"queryRenderedFeatures",value:function(e,t){var i;return t=2===arguments.length?(e=arguments[0],arguments[1]):1===arguments.length&&((i=arguments[0])instanceof w||Array.isArray(i))?(e=arguments[0],{}):1===arguments.length?(e=void 0,arguments[0]):(e=void 0,{}),this.style?this.style.queryRenderedFeatures(this._makeQueryGeometry(e),t,this.transform.zoom,this.transform.angle):[]}},{key:"_makeQueryGeometry",value:function(e){var t,i=this;if(void 0===e&&(e=[w.convert([0,0]),w.convert([this.transform.width,this.transform.height])]),e instanceof w||"number"==typeof e[0])t=[w.convert(e)];else{var r=[w.convert(e[0]),w.convert(e[1])];t=[r[0],new w(r[1].x,r[0].y),r[1],new w(r[0].x,r[1].y),r[0]]}return t.map(function(e){return i.transform.pointCoordinate(e)})}},{key:"querySourceFeatures",value:function(e,t){return this.style.querySourceFeatures(e,t)}},{key:"setStyle",value:function(e,t){if((!t||!1!==t.diff&&!t.localIdeographFontFamily)&&this.style&&e&&"object"===s(e))try{return this.style.setState(e)&&this._update(!0),this}catch(e){d.warnOnce("Unable to perform style diff: ".concat(e.message||e.error||e,". Rebuilding the style from scratch."))}return this.style&&(this.style.setEventedParent(null),this.style._remove()),e?(this.style=new g(this,t||{}),this.style.setEventedParent(this,{style:this.style}),"string"==typeof e?this.style.loadURL(e):this.style.loadJSON(e)):delete this.style,this}},{key:"getStyle",value:function(){if(this.style)return this.style.serialize()}},{key:"isStyleLoaded",value:function(){return this.style?this.style.loaded():d.warnOnce("There is no style added to the map.")}},{key:"addSource",value:function(e,t){return this.style.addSource(e,t),this._update(!0),this}},{key:"isSourceLoaded",value:function(e){var t=this.style&&this.style.sourceCaches[e];if(void 0!==t)return t.loaded();this.fire("error",{error:new Error("There is no source with ID '".concat(e,"'"))})}},{key:"areTilesLoaded",value:function(){var e=this.style&&this.style.sourceCaches;for(var t in e){var i=e[t]._tiles;for(var r in i){var n=i[r];if("loaded"!==n.state&&"errored"!==n.state)return!1}}return!0}},{key:"addSourceType",value:function(e,t,i){return this.style.addSourceType(e,t,i)}},{key:"removeSource",value:function(e){return this.style.removeSource(e),this._update(!0),this}},{key:"getSource",value:function(e){return this.style.getSource(e)}},{key:"addImage",value:function(e,t){var i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{},r=i.pixelRatio,n=void 0===r?1:r,a=i.sdf,o=void 0!==a&&a;if(t instanceof m){var s=f.getImageData(t),l=s.width,u=s.height,c=s.data;this.style.addImage(e,{data:new M({width:l,height:u},c),pixelRatio:n,sdf:o})}else{if(void 0===t.width||void 0===t.height)return this.fire("error",{error:new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")});var d=t.width,h=t.height,p=t.data;this.style.addImage(e,{data:new M({width:d,height:h},p.slice(0)),pixelRatio:n,sdf:o})}}},{key:"hasImage",value:function(e){return e?!!this.style.getImage(e):(this.fire("error",{error:new Error("Missing required image id")}),!1)}},{key:"removeImage",value:function(e){this.style.removeImage(e)}},{key:"loadImage",value:function(e,t){o.getImage(this._transformRequest(e,o.ResourceType.Image),t)}},{key:"addLayer",value:function(e,t){return this.style.addLayer(e,t),this._update(!0),this}},{key:"moveLayer",value:function(e,t){return this.style.moveLayer(e,t),this._update(!0),this}},{key:"removeLayer",value:function(e){return this.style.removeLayer(e),this._update(!0),this}},{key:"getLayer",value:function(e){return this.style.getLayer(e)}},{key:"setFilter",value:function(e,t){return this.style.setFilter(e,t),this._update(!0),this}},{key:"setLayerZoomRange",value:function(e,t,i){return this.style.setLayerZoomRange(e,t,i),this._update(!0),this}},{key:"getFilter",value:function(e){return this.style.getFilter(e)}},{key:"setPaintProperty",value:function(e,t,i){return this.style.setPaintProperty(e,t,i),this._update(!0),this}},{key:"getPaintProperty",value:function(e,t){return this.style.getPaintProperty(e,t)}},{key:"setLayoutProperty",value:function(e,t,i){return this.style.setLayoutProperty(e,t,i),this._update(!0),this}},{key:"getLayoutProperty",value:function(e,t){return this.style.getLayoutProperty(e,t)}},{key:"setLight",value:function(e){return this.style.setLight(e),this._update(!0),this}},{key:"getLight",value:function(){return this.style.getLight()}},{key:"getContainer",value:function(){return this._container}},{key:"getCanvasContainer",value:function(){return this._canvasContainer}},{key:"getCanvas",value:function(){return this._canvas}},{key:"_containerDimensions",value:function(){var e=0,t=0;return this._container&&(e=this._container.offsetWidth||400,t=this._container.offsetHeight||300),[e,t]}},{key:"_setupContainer",value:function(){var e=this._container;e.classList.add("mapboxgl-map"),(this._missingCSSContainer=a.create("div","mapboxgl-missing-css",e)).innerHTML="Missing Mapbox GL JS CSS";var t=this._canvasContainer=a.create("div","mapboxgl-canvas-container",e);this._interactive&&t.classList.add("mapboxgl-interactive"),this._canvas=a.create("canvas","mapboxgl-canvas",t),this._canvas.style.position="absolute",this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label","Map");var i=this._containerDimensions();this._resizeCanvas(i[0],i[1]);var r=this._controlContainer=a.create("div","mapboxgl-control-container",e),n=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(function(e){n[e]=a.create("div","mapboxgl-ctrl-".concat(e),r)})}},{key:"_resizeCanvas",value:function(e,t){var i=h.devicePixelRatio||1;this._canvas.width=i*e,this._canvas.height=i*t,this._canvas.style.width="".concat(e,"px"),this._canvas.style.height="".concat(t,"px")}},{key:"_setupPainter",value:function(){var e=d.extend({failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer},P.webGLContextAttributes),t=this._canvas.getContext("webgl",e)||this._canvas.getContext("experimental-webgl",e);t?this.painter=new v(t,this.transform):this.fire("error",{error:new Error("Failed to initialize WebGL")})}},{key:"_contextLost",value:function(e){e.preventDefault(),this._frameId&&(f.cancelFrame(this._frameId),this._frameId=null),this.fire("webglcontextlost",{originalEvent:e})}},{key:"_contextRestored",value:function(e){this._setupPainter(),this.resize(),this._update(),this.fire("webglcontextrestored",{originalEvent:e})}},{key:"loaded",value:function(){return!this._styleDirty&&!this._sourcesDirty&&!(!this.style||!this.style.loaded())}},{key:"_update",value:function(e){this.style&&(this._styleDirty=this._styleDirty||e,this._sourcesDirty=!0,this._rerender())}},{key:"_render",value:function(){this.isEasing()&&this._updateEase();var e=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;var t=this.transform.zoom,i=f.now();this.style.zoomHistory.update(t,i);var r=new y(t,{now:i,fadeDuration:this._fadeDuration,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),n=r.crossFadingFactor();1===n&&n===this._crossFadingFactor||(e=!0,this._crossFadingFactor=n),this.style.update(r)}return this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,this._fadeDuration),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.rotating,zooming:this.zooming,fadeDuration:this._fadeDuration}),this.fire("render"),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire("load")),this.style&&(this.style.hasTransitions()||e)&&(this._styleDirty=!0),(this._sourcesDirty||this._repaint||this._styleDirty||this._placementDirty||this.isEasing())&&this._rerender(),this}},{key:"remove",value:function(){this._hash&&this._hash.remove(),f.cancelFrame(this._frameId),this._frameId=null,this.setStyle(null),void 0!==h&&(h.removeEventListener("resize",this._onWindowResize,!1),h.removeEventListener("online",this._onWindowOnline,!1));var e=this.painter.context.gl.getExtension("WEBGL_lose_context");e&&e.loseContext(),R(this._canvasContainer),R(this._controlContainer),R(this._missingCSSContainer),this._container.classList.remove("mapboxgl-map"),this.fire("remove")}},{key:"_rerender",value:function(){var e=this;this.style&&!this._frameId&&(this._frameId=f.frame(function(){e._frameId=null,e._render()}))}},{key:"_onWindowOnline",value:function(){this._update()}},{key:"_onWindowResize",value:function(){this._trackResize&&this.stop().resize()._update()}},{key:"_onData",value:function(e){this._update("style"===e.dataType),this.fire("".concat(e.dataType,"data"),e)}},{key:"_onDataLoading",value:function(e){this.fire("".concat(e.dataType,"dataloading"),e)}},{key:"showTileBoundaries",get:function(){return!!this._showTileBoundaries},set:function(e){this._showTileBoundaries!==e&&(this._showTileBoundaries=e,this._update())}},{key:"showCollisionBoxes",get:function(){return!!this._showCollisionBoxes},set:function(e){this._showCollisionBoxes!==e&&((this._showCollisionBoxes=e)?this.style._generateCollisionBoxes():this._update())}},{key:"showOverdrawInspector",get:function(){return!!this._showOverdrawInspector},set:function(e){this._showOverdrawInspector!==e&&(this._showOverdrawInspector=e,this._update())}},{key:"repaint",get:function(){return!!this._repaint},set:function(e){this._repaint=e,this._update()}},{key:"vertices",get:function(){return!!this._vertices},set:function(e){this._vertices=e,this._update()}}]),O);function O(e){var t;if(function(e){if(!(e instanceof O))throw new TypeError("Cannot call a class as a function")}(this),null!=(e=d.extend({},D,e)).minZoom&&null!=e.maxZoom&&e.minZoom>e.maxZoom)throw new Error("maxZoom must be greater than minZoom");var i,r,n=new _(e.minZoom,e.maxZoom,e.renderWorldCopies);(i=this,r=c(O).call(this,n,e),t=!r||"object"!==s(r)&&"function"!=typeof r?l(i):r)._interactive=e.interactive,t._maxTileCacheSize=e.maxTileCacheSize,t._failIfMajorPerformanceCaveat=e.failIfMajorPerformanceCaveat,t._preserveDrawingBuffer=e.preserveDrawingBuffer,t._trackResize=e.trackResize,t._bearingSnap=e.bearingSnap,t._refreshExpiredTiles=e.refreshExpiredTiles,t._fadeDuration=e.fadeDuration,t._crossFadingFactor=1;var a=e.transformRequest;if(t._transformRequest=a?function(e,t){return a(e,t)||{url:e}}:function(e){return{url:e}},"string"==typeof e.container){var o=h.document.getElementById(e.container);if(!o)throw new Error("Container '".concat(e.container,"' not found."));t._container=o}else{if(!(e.container instanceof p))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");t._container=e.container}return e.maxBounds&&t.setMaxBounds(e.maxBounds),d.bindAll(["_onWindowOnline","_onWindowResize","_contextLost","_contextRestored","_update","_render","_onData","_onDataLoading"],l(t)),t._setupContainer(),t._setupPainter(),t.on("move",t._update.bind(l(t),!1)),t.on("zoom",t._update.bind(l(t),!0)),t.on("move",function(){t._rerender()}),void 0!==h&&(h.addEventListener("online",t._onWindowOnline,!1),h.addEventListener("resize",t._onWindowResize,!1)),x(l(t),e),t._hash=e.hash&&(new C).addTo(l(t)),t._hash&&t._hash._onHashChange()||t.jumpTo({center:e.center,zoom:e.zoom,bearing:e.bearing,pitch:e.pitch}),t.resize(),e.style&&t.setStyle(e.style,{localIdeographFontFamily:e.localIdeographFontFamily}),e.attributionControl&&t.addControl(new E),t.addControl(new T,e.logoPosition),t.on("style.load",function(){this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),t.on("data",t._onData),t.on("dataloading",t._onDataLoading),t}function R(e){e.parentNode&&e.parentNode.removeChild(e)}e.exports=I},function(e,t){var i;i=function(){return this}();try{i=i||new Function("return this")()}catch(e){"object"==typeof window&&(i=window)}e.exports=i},function(e,t,i){var l=Object.getOwnPropertySymbols,u=Object.prototype.hasOwnProperty,c=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},i=0;i<10;i++)t["_"+String.fromCharCode(i)]=i;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var i,r,n=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),a=1;a<arguments.length;a++){for(var o in i=Object(arguments[a]))u.call(i,o)&&(n[o]=i[o]);if(l){r=l(i);for(var s=0;s<r.length;s++)c.call(i,r[s])&&(n[r[s]]=i[r[s]])}}return n}},function(e,D,f){(function(o){var t=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),i={},r=0;r<t.length;r++)i[t[r]]=Object.getOwnPropertyDescriptor(e,t[r]);return i},s=/%[sdj%]/g;D.format=function(e){if(!A(e)){for(var t=[],i=0;i<arguments.length;i++)t.push(l(arguments[i]));return t.join(" ")}i=1;for(var r=arguments,n=r.length,a=String(e).replace(s,function(e){if("%%"===e)return"%";if(n<=i)return e;switch(e){case"%s":return String(r[i++]);case"%d":return Number(r[i++]);case"%j":try{return JSON.stringify(r[i++])}catch(e){return"[Circular]"}default:return e}}),o=r[i];i<n;o=r[++i])x(o)||!u(o)?a+=" "+o:a+=" "+l(o);return a},D.deprecate=function(e,t){if(void 0!==o&&!0===o.noDeprecation)return e;if(void 0===o)return function(){return D.deprecate(e,t).apply(this,arguments)};var i=!1;return function(){if(!i){if(o.throwDeprecation)throw new Error(t);o.traceDeprecation?console.trace(t):console.error(t),i=!0}return e.apply(this,arguments)}};var e,r={};function l(e,t){var i={seen:[],stylize:a};return 3<=arguments.length&&(i.depth=arguments[2]),4<=arguments.length&&(i.colors=arguments[3]),C(t)?i.showHidden=t:t&&D._extend(i,t),S(i.showHidden)&&(i.showHidden=!1),S(i.depth)&&(i.depth=2),S(i.colors)&&(i.colors=!1),S(i.customInspect)&&(i.customInspect=!0),i.colors&&(i.stylize=n),g(i,e,i.depth)}function n(e,t){var i=l.styles[t];return i?"["+l.colors[i][0]+"m"+e+"["+l.colors[i][1]+"m":e}function a(e,t){return e}function g(t,i,r){if(t.customInspect&&i&&P(i.inspect)&&i.inspect!==D.inspect&&(!i.constructor||i.constructor.prototype!==i)){var e=i.inspect(r,t);return A(e)||(e=g(t,e,r)),e}var n=function(e,t){if(S(t))return e.stylize("undefined","undefined");if(A(t)){var i="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(i,"string")}return b(t)?e.stylize(""+t,"number"):C(t)?e.stylize(""+t,"boolean"):x(t)?e.stylize("null","null"):void 0}(t,i);if(n)return n;var a,o=Object.keys(i),s=(a={},o.forEach(function(e,t){a[e]=!0}),a);if(t.showHidden&&(o=Object.getOwnPropertyNames(i)),T(i)&&(0<=o.indexOf("message")||0<=o.indexOf("description")))return y(i);if(0===o.length){if(P(i)){var l=i.name?": "+i.name:"";return t.stylize("[Function"+l+"]","special")}if(w(i))return t.stylize(RegExp.prototype.toString.call(i),"regexp");if(E(i))return t.stylize(Date.prototype.toString.call(i),"date");if(T(i))return y(i)}var u,c,d,h,p="",f=!1,m=["{","}"];return _(i)&&(f=!0,m=["[","]"]),P(i)&&(p=" [Function"+(i.name?": "+i.name:"")+"]"),w(i)&&(p=" "+RegExp.prototype.toString.call(i)),E(i)&&(p=" "+Date.prototype.toUTCString.call(i)),T(i)&&(p=" "+y(i)),0!==o.length||f&&0!=i.length?r<0?w(i)?t.stylize(RegExp.prototype.toString.call(i),"regexp"):t.stylize("[Object]","special"):(t.seen.push(i),u=f?function(t,i,r,n,e){for(var a=[],o=0,s=i.length;o<s;++o)M(i,String(o))?a.push(v(t,i,r,n,String(o),!0)):a.push("");return e.forEach(function(e){e.match(/^\d+$/)||a.push(v(t,i,r,n,e,!0))}),a}(t,i,r,s,o):o.map(function(e){return v(t,i,r,s,e,f)}),t.seen.pop(),d=p,h=m,60<(c=u).reduce(function(e,t){return t.indexOf("\n"),e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0)?h[0]+(""===d?"":d+"\n ")+" "+c.join(",\n ")+" "+h[1]:h[0]+d+" "+c.join(", ")+" "+h[1]):m[0]+p+m[1]}function y(e){return"["+Error.prototype.toString.call(e)+"]"}function v(e,t,i,r,n,a){var o,s,l;if((l=Object.getOwnPropertyDescriptor(t,n)||{value:t[n]}).get?s=l.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):l.set&&(s=e.stylize("[Setter]","special")),M(r,n)||(o="["+n+"]"),s||(e.seen.indexOf(l.value)<0?-1<(s=x(i)?g(e,l.value,null):g(e,l.value,i-1)).indexOf("\n")&&(s=a?s.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+s.split("\n").map(function(e){return" "+e}).join("\n")):s=e.stylize("[Circular]","special")),S(o)){if(a&&n.match(/^\d+$/))return s;o=(o=JSON.stringify(""+n)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),e.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),e.stylize(o,"string"))}return o+": "+s}function _(e){return Array.isArray(e)}function C(e){return"boolean"==typeof e}function x(e){return null===e}function b(e){return"number"==typeof e}function A(e){return"string"==typeof e}function S(e){return void 0===e}function w(e){return u(e)&&"[object RegExp]"===i(e)}function u(e){return"object"==typeof e&&null!==e}function E(e){return u(e)&&"[object Date]"===i(e)}function T(e){return u(e)&&("[object Error]"===i(e)||e instanceof Error)}function P(e){return"function"==typeof e}function i(e){return Object.prototype.toString.call(e)}function c(e){return e<10?"0"+e.toString(10):e.toString(10)}D.debuglog=function(t){if(S(e)&&(e=o.env.NODE_DEBUG||""),t=t.toUpperCase(),!r[t])if(new RegExp("\\b"+t+"\\b","i").test(e)){var i=o.pid;r[t]=function(){var e=D.format.apply(D,arguments);console.error("%s %d: %s",t,i,e)}}else r[t]=function(){};return r[t]},(D.inspect=l).colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},l.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},D.isArray=_,D.isBoolean=C,D.isNull=x,D.isNullOrUndefined=function(e){return null==e},D.isNumber=b,D.isString=A,D.isSymbol=function(e){return"symbol"==typeof e},D.isUndefined=S,D.isRegExp=w,D.isObject=u,D.isDate=E,D.isError=T,D.isFunction=P,D.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},D.isBuffer=f(138);var d=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function M(e,t){return Object.prototype.hasOwnProperty.call(e,t)}D.log=function(){var e,t;console.log("%s - %s",(t=[c((e=new Date).getHours()),c(e.getMinutes()),c(e.getSeconds())].join(":"),[e.getDate(),d[e.getMonth()],t].join(" ")),D.format.apply(D,arguments))},D.inherits=f(139),D._extend=function(e,t){if(!t||!u(t))return e;for(var i=Object.keys(t),r=i.length;r--;)e[i[r]]=t[i[r]];return e};var h="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function p(e,t){if(!e){var i=new Error("Promise was rejected with a falsy value");i.reason=e,e=i}return t(e)}D.promisify=function(a){if("function"!=typeof a)throw new TypeError('The "original" argument must be of type Function');if(h&&a[h]){var e;if("function"!=typeof(e=a[h]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,h,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var i,r,e=new Promise(function(e,t){i=e,r=t}),t=[],n=0;n<arguments.length;n++)t.push(arguments[n]);t.push(function(e,t){e?r(e):i(t)});try{a.apply(this,t)}catch(e){r(e)}return e}return Object.setPrototypeOf(e,Object.getPrototypeOf(a)),h&&Object.defineProperty(e,h,{value:e,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(e,t(a))},D.promisify.custom=h,D.callbackify=function(a){if("function"!=typeof a)throw new TypeError('The "original" argument must be of type Function');function e(){for(var e=[],t=0;t<arguments.length;t++)e.push(arguments[t]);var i=e.pop();if("function"!=typeof i)throw new TypeError("The last argument must be of type Function");function r(){return i.apply(n,arguments)}var n=this;a.apply(this,e).then(function(e){o.nextTick(r,null,e)},function(e){o.nextTick(p,e,r)})}return Object.setPrototypeOf(e,Object.getPrototypeOf(a)),Object.defineProperties(e,t(a)),e}}).call(this,f(137))},function(e,t){var i,r,n=e.exports={};function a(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(t){if(i===setTimeout)return setTimeout(t,0);if((i===a||!i)&&setTimeout)return i=setTimeout,setTimeout(t,0);try{return i(t,0)}catch(e){try{return i.call(null,t,0)}catch(e){return i.call(this,t,0)}}}!function(){try{i="function"==typeof setTimeout?setTimeout:a}catch(e){i=a}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(e){r=o}}();var l,u=[],c=!1,d=-1;function h(){c&&l&&(c=!1,l.length?u=l.concat(u):d=-1,u.length&&p())}function p(){if(!c){var e=s(h);c=!0;for(var t=u.length;t;){for(l=u,u=[];++d<t;)l&&l[d].run();d=-1,t=u.length}l=null,c=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(e)}}function f(e,t){this.fun=e,this.array=t}function m(){}n.nextTick=function(e){var t=new Array(arguments.length-1);if(1<arguments.length)for(var i=1;i<arguments.length;i++)t[i-1]=arguments[i];u.push(new f(e,t)),1!==u.length||c||s(p)},f.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=m,n.addListener=m,n.once=m,n.off=m,n.removeListener=m,n.removeAllListeners=m,n.emit=m,n.prependListener=m,n.prependOnceListener=m,n.listeners=function(e){return[]},n.binding=function(e){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(e){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},function(e,t){e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;function i(){}i.prototype=t.prototype,e.prototype=new i,e.prototype.constructor=e}},function(e){e.exports={$version:8,$root:{version:{required:!0,type:"enum",values:[8],doc:"Style specification version number. Must be 8.",example:8},name:{type:"string",doc:"A human-readable name for the style.",example:"Bright"},metadata:{type:"*",doc:"Arbitrary properties useful to track with the stylesheet, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'."},center:{type:"array",value:"number",doc:"Default map center in longitude and latitude. The style center will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:[-73.9749,40.7736]},zoom:{type:"number",doc:"Default zoom level. The style zoom will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:12.5},bearing:{type:"number",default:0,period:360,units:"degrees",doc:'Default bearing, in degrees. The bearing is the compass direction that is "up"; for example, a bearing of 90° orients the map so that east is up. This value will be used only if the map has not been positioned by other means (e.g. map options or user interaction).',example:29},pitch:{type:"number",default:0,units:"degrees",doc:"Default pitch, in degrees. Zero is perpendicular to the surface, for a look straight down at the map, while a greater value like 60 looks ahead towards the horizon. The style pitch will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:50},light:{type:"light",doc:"The global light source.",example:{anchor:"viewport",color:"white",intensity:.4}},sources:{required:!0,type:"sources",doc:"Data source specifications.",example:{"mapbox-streets":{type:"vector",url:"mapbox://mapbox.mapbox-streets-v6"}}},sprite:{type:"string",doc:"A base URL for retrieving the sprite image and metadata. The extensions `.png`, `.json` and scale factor `@2x.png` will be automatically appended. This property is required if any layer uses the `background-pattern`, `fill-pattern`, `line-pattern`, `fill-extrusion-pattern`, or `icon-image` properties.",example:"mapbox://sprites/mapbox/bright-v8"},glyphs:{type:"string",doc:"A URL template for loading signed-distance-field glyph sets in PBF format. The URL must include `{fontstack}` and `{range}` tokens. This property is required if any layer uses the `text-field` layout property.",example:"mapbox://fonts/mapbox/{fontstack}/{range}.pbf"},transition:{type:"transition",doc:"A global transition definition to use as a default across properties.",example:{duration:300,delay:0}},layers:{required:!0,type:"array",value:"layer",doc:"Layers will be drawn in the order of this array.",example:[{id:"water",source:"mapbox-streets","source-layer":"water",type:"fill",paint:{"fill-color":"#00ffff"}}]}},sources:{"*":{type:"source",doc:"Specification of a data source. For vector and raster sources, either TileJSON or a URL to a TileJSON must be provided. For image and video sources, a URL must be provided. For GeoJSON sources, a URL or inline GeoJSON must be provided."}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image","source_canvas"],source_vector:{type:{required:!0,type:"enum",values:{vector:{doc:"A vector tile source."}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://<mapid>`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.0511,180,85.0511],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},"*":{type:"*",doc:"Other keys to configure the data source."}},source_raster:{type:{required:!0,type:"enum",values:{raster:{doc:"A raster tile source."}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://<mapid>`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.0511,180,85.0511],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},tileSize:{type:"number",default:512,units:"pixels",doc:"The minimum visual size to display tiles for this layer. Only configurable for raster layers."},scheme:{type:"enum",values:{xyz:{doc:"Slippy map tilenames scheme."},tms:{doc:"OSGeo spec scheme."}},default:"xyz",doc:"Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},"*":{type:"*",doc:"Other keys to configure the data source."}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{doc:"A raster DEM source using Mapbox Terrain RGB"}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://<mapid>`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.0511,180,85.0511],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},tileSize:{type:"number",default:512,units:"pixels",doc:"The minimum visual size to display tiles for this layer. Only configurable for raster layers."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},"*":{type:"*",doc:"Other keys to configure the data source."}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{doc:"A GeoJSON data source."}},doc:"The data type of the GeoJSON source."},data:{type:"*",doc:"A URL to a GeoJSON file, or inline GeoJSON."},maxzoom:{type:"number",default:18,doc:"Maximum zoom level at which to create vector tiles (higher means greater detail at high zoom levels)."},buffer:{type:"number",default:128,maximum:512,minimum:0,doc:"Size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance."},tolerance:{type:"number",default:.375,doc:"Douglas-Peucker simplification tolerance (higher means simpler geometries and faster performance)."},cluster:{type:"boolean",default:!1,doc:"If the data is a collection of point features, setting this to true clusters the points by radius into groups."},clusterRadius:{type:"number",default:50,minimum:0,doc:"Radius of each cluster if clustering is enabled. A value of 512 indicates a radius equal to the width of a tile."},clusterMaxZoom:{type:"number",doc:"Max zoom on which to cluster points if clustering is enabled. Defaults to one zoom less than maxzoom (so that last zoom features are not clustered)."}},source_video:{type:{required:!0,type:"enum",values:{video:{doc:"A video data source."}},doc:"The data type of the video source."},urls:{required:!0,type:"array",value:"string",doc:"URLs to video content in order of preferred format."},coordinates:{required:!0,doc:"Corners of video specified in longitude, latitude pairs.",type:"array",length:4,value:{type:"array",length:2,value:"number",doc:"A single longitude, latitude pair."}}},source_image:{type:{required:!0,type:"enum",values:{image:{doc:"An image data source."}},doc:"The data type of the image source."},url:{required:!0,type:"string",doc:"URL that points to an image."},coordinates:{required:!0,doc:"Corners of image specified in longitude, latitude pairs.",type:"array",length:4,value:{type:"array",length:2,value:"number",doc:"A single longitude, latitude pair."}}},source_canvas:{type:{required:!0,type:"enum",values:{canvas:{doc:"A canvas data source."}},doc:"The data type of the canvas source."},coordinates:{required:!0,doc:"Corners of canvas specified in longitude, latitude pairs.",type:"array",length:4,value:{type:"array",length:2,value:"number",doc:"A single longitude, latitude pair."}},animate:{type:"boolean",default:"true",doc:"Whether the canvas source is animated. If the canvas is static, `animate` should be set to `false` to improve performance."},canvas:{type:"string",required:!0,doc:"HTML ID of the canvas from which to read pixels."}},layer:{id:{type:"string",doc:"Unique layer name.",required:!0},type:{type:"enum",values:{fill:{doc:"A filled polygon with an optional stroked border.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},line:{doc:"A stroked line.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},symbol:{doc:"An icon or a text label.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},circle:{doc:"A filled circle.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},heatmap:{doc:"A heatmap.","sdk-support":{"basic functionality":{js:"0.41.0"}}},"fill-extrusion":{doc:"An extruded (3D) polygon.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},raster:{doc:"Raster map textures such as satellite imagery.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},hillshade:{doc:"Client-side hillshading visualization based on DEM data. Currently, the implementation only supports Mapbox Terrain RGB tiles","sdk-support":{"basic functionality":{js:"0.43.0"}}},background:{doc:"The background color or pattern of the map.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}}},doc:"Rendering type of this layer.",required:!0},metadata:{type:"*",doc:"Arbitrary properties useful to track with the layer, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'."},source:{type:"string",doc:"Name of a source description to be used for this layer. Required for all layer types except `background`."},"source-layer":{type:"string",doc:"Layer to use from a vector tile source. Required for vector tile sources; prohibited for all other source types, including GeoJSON sources."},minzoom:{type:"number",minimum:0,maximum:24,doc:"The minimum zoom level on which the layer gets parsed and appears on."},maxzoom:{type:"number",minimum:0,maximum:24,doc:"The maximum zoom level on which the layer gets parsed and appears on."},filter:{type:"filter",doc:"A expression specifying conditions on source features. Only features that match the filter are displayed."},layout:{type:"layout",doc:"Layout properties for the layer."},paint:{type:"paint",doc:"Default paint properties for this layer."}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}}},layout_fill:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}}},layout_circle:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}}},layout_heatmap:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.41.0"}}}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}}},layout_line:{"line-cap":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{butt:{doc:"A cap with a squared-off end which is drawn to the exact endpoint of the line."},round:{doc:"A cap with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line."},square:{doc:"A cap with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width."}},default:"butt",doc:"The display of line endings.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}},"line-join":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:{bevel:{doc:"A join with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width."},round:{doc:"A join with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line."},miter:{doc:"A join with a sharp, angled corner which is drawn with the outer sides beyond the endpoint of the path until they meet."}},default:"miter",doc:"The display of lines when joining.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}}},"line-miter-limit":{type:"number",default:2,function:"interpolated","zoom-function":!0,doc:"Used to automatically convert miter joins to bevel joins for sharp angles.",requires:[{"line-join":"miter"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}},"line-round-limit":{type:"number",default:1.05,function:"interpolated","zoom-function":!0,doc:"Used to automatically convert round joins to miter joins for shallow angles.",requires:[{"line-join":"round"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}}},layout_symbol:{"symbol-placement":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{point:{doc:"The label is placed at the point where the geometry is located."},line:{doc:"The label is placed along the line of the geometry. Can only be used on `LineString` and `Polygon` geometries."}},default:"point",doc:"Label placement relative to its geometry.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}},"symbol-spacing":{type:"number",default:250,minimum:1,function:"interpolated","zoom-function":!0,units:"pixels",doc:"Distance between two symbol anchors.",requires:[{"symbol-placement":"line"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}},"symbol-avoid-edges":{type:"boolean",function:"piecewise-constant","zoom-function":!0,default:!1,doc:"If true, the symbols will not cross tile edges to avoid mutual collisions. Recommended in layers that don't have enough padding in the vector tile to prevent collisions, or if it is a point symbol layer placed after a line symbol layer.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}},"icon-allow-overlap":{type:"boolean",function:"piecewise-constant","zoom-function":!0,default:!1,doc:"If true, the icon will be visible even if it collides with other previously drawn symbols.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}},"icon-ignore-placement":{type:"boolean",function:"piecewise-constant","zoom-function":!0,default:!1,doc:"If true, other symbols can be visible even if they collide with the icon.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}},"icon-optional":{type:"boolean",function:"piecewise-constant","zoom-function":!0,default:!1,doc:"If true, text will display without their corresponding icons when the icon collides with other symbols and the text does not.",requires:["icon-image","text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}},"icon-rotation-alignment":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{doc:"When `symbol-placement` is set to `point`, aligns icons east-west. When `symbol-placement` is set to `line`, aligns icon x-axes with the line."},viewport:{doc:"Produces icons whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`."},auto:{doc:"When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line`, this is equivalent to `map`."}},default:"auto",doc:"In combination with `symbol-placement`, determines the rotation behavior of icons.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"},"data-driven styling":{}}},"icon-size":{type:"number",default:1,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,units:"factor of the original icon size",doc:"Scales the original size of the icon by the provided factor. The new pixel size of the image will be the original pixel size multiplied by `icon-size`. 1 is the original size; 3 triples the size of the image.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},"icon-text-fit":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{none:{doc:"The icon is displayed at its intrinsic aspect ratio."},width:{doc:"The icon is scaled in the x-dimension to fit the width of the text."},height:{doc:"The icon is scaled in the y-dimension to fit the height of the text."},both:{doc:"The icon is scaled in both x- and y-dimensions."}},default:"none",doc:"Scales the icon to fit around the associated text.",requires:["icon-image","text-field"],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"},"data-driven styling":{}}},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",function:"interpolated","zoom-function":!0,doc:"Size of the additional area added to dimensions determined by `icon-text-fit`, in clockwise order: top, right, bottom, left.",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"},"data-driven styling":{}}},"icon-image":{type:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,doc:"Name of image in sprite to use for drawing an image background. Within literal values and zoom functions, property names enclosed in curly brackets (e.g. `{token}`) are replaced with the value of the named property. Expressions and property functions do not support this syntax; for equivalent functionality in expressions, use the [`concat`](#expressions-concat) and [`get`](#expressions-get) operators.",tokens:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},"icon-rotate":{type:"number",default:0,period:360,function:"interpolated","zoom-function":!0,"property-function":!0,units:"degrees",doc:"Rotates the icon clockwise.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.21.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}}},"icon-padding":{type:"number",default:2,minimum:0,function:"interpolated","zoom-function":!0,units:"pixels",doc:"Size of the additional area around the icon bounding box used for detecting symbol collisions.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}},"icon-keep-upright":{type:"boolean",function:"piecewise-constant","zoom-function":!0,default:!1,doc:"If true, the icon may be flipped to prevent it from being rendered upside-down.",requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":"line"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,doc:"Offset distance of icon from its anchor. Positive values indicate right and down, while negative values indicate left and up. Each component is multiplied by the value of `icon-size` to obtain the final offset in pixels. When combined with `icon-rotate` the offset will be as if the rotated direction was up.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}}},"icon-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:{center:{doc:"The center of the icon is placed closest to the anchor."},left:{doc:"The left side of the icon is placed closest to the anchor."},right:{doc:"The right side of the icon is placed closest to the anchor."},top:{doc:"The top of the icon is placed closest to the anchor."},bottom:{doc:"The bottom of the icon is placed closest to the anchor."},"top-left":{doc:"The top left corner of the icon is placed closest to the anchor."},"top-right":{doc:"The top right corner of the icon is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the icon is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the icon is placed closest to the anchor."}},default:"center",doc:"Part of the icon placed closest to the anchor.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}}},"icon-pitch-alignment":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{doc:"The icon is aligned to the plane of the map."},viewport:{doc:"The icon is aligned to the plane of the viewport."},auto:{doc:"Automatically matches the value of `icon-rotation-alignment`."}},default:"auto",doc:"Orientation of icon when map is pitched.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"},"data-driven styling":{}}},"text-pitch-alignment":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{doc:"The text is aligned to the plane of the map."},viewport:{doc:"The text is aligned to the plane of the viewport."},auto:{doc:"Automatically matches the value of `text-rotation-alignment`."}},default:"auto",doc:"Orientation of text when map is pitched.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"},"data-driven styling":{}}},"text-rotation-alignment":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{doc:"When `symbol-placement` is set to `point`, aligns text east-west. When `symbol-placement` is set to `line`, aligns text x-axes with the line."},viewport:{doc:"Produces glyphs whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`."},auto:{doc:"When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line`, this is equivalent to `map`."}},default:"auto",doc:"In combination with `symbol-placement`, determines the rotation behavior of the individual glyphs forming the text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"},"data-driven styling":{}}},"text-field":{type:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:"",tokens:!0,doc:"Value to use for a text label. Within literal values and zoom functions, property names enclosed in curly brackets (e.g. `{token}`) are replaced with the value of the named property. Expressions and property functions do not support this syntax; for equivalent functionality in expressions, use the [`concat`](#expressions-concat) and [`get`](#expressions-get) operators.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}}},"text-font":{type:"array",value:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:["Open Sans Regular","Arial Unicode MS Regular"],doc:"Font stack to use for displaying text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}},"text-size":{type:"number",default:16,minimum:0,units:"pixels",function:"interpolated","zoom-function":!0,"property-function":!0,doc:"Font size.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",function:"interpolated","zoom-function":!0,"property-function":!0,doc:"The maximum line width for text wrapping.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}}},"text-line-height":{type:"number",default:1.2,units:"ems",function:"interpolated","zoom-function":!0,doc:"Text leading value for multi-line text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}},"text-letter-spacing":{type:"number",default:0,units:"ems",function:"interpolated","zoom-function":!0,"property-function":!0,doc:"Text tracking amount.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}}},"text-justify":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:{left:{doc:"The text is aligned to the left."},center:{doc:"The text is centered."},right:{doc:"The text is aligned to the right."}},default:"center",doc:"Text justification options.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}}},"text-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:{center:{doc:"The center of the text is placed closest to the anchor."},left:{doc:"The left side of the text is placed closest to the anchor."},right:{doc:"The right side of the text is placed closest to the anchor."},top:{doc:"The top of the text is placed closest to the anchor."},bottom:{doc:"The bottom of the text is placed closest to the anchor."},"top-left":{doc:"The top left corner of the text is placed closest to the anchor."},"top-right":{doc:"The top right corner of the text is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the text is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the text is placed closest to the anchor."}},default:"center",doc:"Part of the text placed closest to the anchor.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}}},"text-max-angle":{type:"number",default:45,units:"degrees",function:"interpolated","zoom-function":!0,doc:"Maximum angle change between adjacent characters.",requires:["text-field",{"symbol-placement":"line"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}},"text-rotate":{type:"number",default:0,period:360,units:"degrees",function:"interpolated","zoom-function":!0,"property-function":!0,doc:"Rotates the text clockwise.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",function:"interpolated","zoom-function":!0,doc:"Size of the additional area around the text bounding box used for detecting symbol collisions.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}},"text-keep-upright":{type:"boolean",function:"piecewise-constant","zoom-function":!0,default:!0,doc:"If true, the text may be flipped vertically to prevent it from being rendered upside-down.",requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":"line"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}},"text-transform":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:{none:{doc:"The text is not altered."},uppercase:{doc:"Forces all letters to be displayed in uppercase."},lowercase:{doc:"Forces all letters to be displayed in lowercase."}},default:"none",doc:"Specifies how to capitalize text, similar to the CSS `text-transform` property.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}}},"text-offset":{type:"array",doc:"Offset distance of text from its anchor. Positive values indicate right and down, while negative values indicate left and up.",value:"number",units:"ems",function:"interpolated","zoom-function":!0,"property-function":!0,length:2,default:[0,0],requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},"text-allow-overlap":{type:"boolean",function:"piecewise-constant","zoom-function":!0,default:!1,doc:"If true, the text will be visible even if it collides with other previously drawn symbols.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}},"text-ignore-placement":{type:"boolean",function:"piecewise-constant","zoom-function":!0,default:!1,doc:"If true, other symbols can be visible even if they collide with the text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}},"text-optional":{type:"boolean",function:"piecewise-constant","zoom-function":!0,default:!1,doc:"If true, icons will display without their corresponding text when the text collides with other symbols and the icon does not.",requires:["text-field","icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}}},layout_raster:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}}},layout_hillshade:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.43.0"},"data-driven styling":{}}}},filter:{type:"array",value:"*",doc:"A filter selects specific features from a layer."},filter_operator:{type:"enum",values:{"==":{doc:'`["==", key, value]` equality: `feature[key] = value`'},"!=":{doc:'`["!=", key, value]` inequality: `feature[key] ≠ value`'},">":{doc:'`[">", key, value]` greater than: `feature[key] > value`'},">=":{doc:'`[">=", key, value]` greater than or equal: `feature[key] ≥ value`'},"<":{doc:'`["<", key, value]` less than: `feature[key] < value`'},"<=":{doc:'`["<=", key, value]` less than or equal: `feature[key] ≤ value`'},in:{doc:'`["in", key, v0, ..., vn]` set inclusion: `feature[key] ∈ {v0, ..., vn}`'},"!in":{doc:'`["!in", key, v0, ..., vn]` set exclusion: `feature[key] ∉ {v0, ..., vn}`'},all:{doc:'`["all", f0, ..., fn]` logical `AND`: `f0 ∧ ... ∧ fn`'},any:{doc:'`["any", f0, ..., fn]` logical `OR`: `f0 ∨ ... ∨ fn`'},none:{doc:'`["none", f0, ..., fn]` logical `NOR`: `¬f0 ∧ ... ∧ ¬fn`'},has:{doc:'`["has", key]` `feature[key]` exists'},"!has":{doc:'`["!has", key]` `feature[key]` does not exist'}},doc:"The filter operator."},geometry_type:{type:"enum",values:{Point:{doc:"Filter to point geometries."},LineString:{doc:"Filter to line geometries."},Polygon:{doc:"Filter to polygon geometries."}},doc:"The geometry type for the filter to select."},function:{expression:{type:"expression",doc:"An expression."},stops:{type:"array",doc:"An array of stops.",value:"function_stop"},base:{type:"number",default:1,minimum:0,doc:"The exponential base of the interpolation curve. It controls the rate at which the result increases. Higher values make the result increase more towards the high end of the range. With `1` the stops are interpolated linearly."},property:{type:"string",doc:"The name of a feature property to use as the function input.",default:"$zoom"},type:{type:"enum",values:{identity:{doc:"Return the input value as the output value."},exponential:{doc:"Generate an output by interpolating between stops just less than and just greater than the function input."},interval:{doc:"Return the output value of the stop just less than the function input."},categorical:{doc:"Return the output value of the stop equal to the function input."}},doc:"The interpolation strategy to use in function evaluation.",default:"exponential"},colorSpace:{type:"enum",values:{rgb:{doc:"Use the RGB color space to interpolate color values"},lab:{doc:"Use the LAB color space to interpolate color values."},hcl:{doc:"Use the HCL color space to interpolate color values, interpolating the Hue, Chroma, and Luminance channels individually."}},doc:"The color space in which colors interpolated. Interpolating colors in perceptual color spaces like LAB and HCL tend to produce color ramps that look more consistent and produce colors that can be differentiated more easily than those interpolated in RGB space.",default:"rgb"},default:{type:"*",required:!1,doc:"A value to serve as a fallback function result when a value isn't otherwise available. It is used in the following circumstances:\n* In categorical functions, when the feature value does not match any of the stop domain values.\n* In property and zoom-and-property functions, when a feature does not contain a value for the specified property.\n* In identity functions, when the feature value is not valid for the style property (for example, if the function is being used for a `circle-color` property but the feature property value is not a string or not a valid color).\n* In interval or exponential property and zoom-and-property functions, when the feature value is not numeric.\nIf no default is provided, the style property's default is used in these circumstances."}},function_stop:{type:"array",minimum:0,maximum:22,value:["number","color"],length:2,doc:"Zoom level and value pair."},expression:{type:"array",value:"*",minimum:1,doc:"An expression defines a function that can be used for data-driven style properties or feature filters."},expression_name:{doc:"",type:"enum",values:{let:{doc:'Binds expressions to named variables, which can then be referenced in the result expression using ["var", "variable_name"].',group:"Variable binding"},var:{doc:'References variable bound using "let".',group:"Variable binding"},literal:{doc:"Provides a literal array or object value.",group:"Types"},array:{doc:"Asserts that the input is an array (optionally with a specific item type and length). If, when the input expression is evaluated, it is not of the asserted type, then this assertion will cause the whole expression to be aborted.",group:"Types"},at:{doc:"Retrieves an item from an array.",group:"Lookup"},case:{doc:"Selects the first output whose corresponding test condition evaluates to true.",group:"Decision"},match:{doc:'Selects the output whose label value matches the input value, or the fallback value if no match is found. The `input` can be any string or number expression (e.g. `["get", "building_type"]`). Each label can either be a single literal value or an array of values.',group:"Decision"},coalesce:{doc:"Evaluates each expression in turn until the first non-null value is obtained, and returns that value.",group:"Decision"},step:{doc:'Produces discrete, stepped results by evaluating a piecewise-constant function defined by pairs of input and output values ("stops"). The `input` may be any numeric expression (e.g., `["get", "population"]`). Stop inputs must be numeric literals in strictly ascending order. Returns the output value of the stop just less than the input, or the first input if the input is less than the first stop.',group:"Ramps, scales, curves"},interpolate:{doc:'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). The `input` may be any numeric expression (e.g., `["get", "population"]`). Stop inputs must be numeric literals in strictly ascending order. The output type must be `number`, `array<number>`, or `color`.\n\nInterpolation types:\n- `["linear"]`: interpolates linearly between the pair of stops just less than and just greater than the input.\n- `["exponential", base]`: interpolates exponentially between the stops just less than and just greater than the input. `base` controls the rate at which the output increases: higher values make the output increase more towards the high end of the range. With values close to 1 the output increases linearly.\n- `["cubic-bezier", x1, y1, x2, y2]`: interpolates using the cubic bezier curve defined by the given control points.',group:"Ramps, scales, curves"},ln2:{doc:"Returns mathematical constant ln(2).",group:"Math"},pi:{doc:"Returns the mathematical constant pi.",group:"Math"},e:{doc:"Returns the mathematical constant e.",group:"Math"},typeof:{doc:"Returns a string describing the type of the given value.",group:"Types"},string:{doc:"Asserts that the input value is a string. If multiple values are provided, each one is evaluated in order until a string value is obtained. If none of the inputs are strings, the expression is an error.",group:"Types"},number:{doc:"Asserts that the input value is a number. If multiple values are provided, each one is evaluated in order until a number value is obtained. If none of the inputs are numbers, the expression is an error.",group:"Types"},boolean:{doc:"Asserts that the input value is a boolean. If multiple values are provided, each one is evaluated in order until a boolean value is obtained. If none of the inputs are booleans, the expression is an error.",group:"Types"},object:{doc:"Asserts that the input value is an object. If it is not, the expression is an error.",group:"Types"},"to-string":{doc:'Converts the input value to a string. If the input is `null`, the result is `"null"`. If the input is a boolean, the result is `"true"` or `"false"`. If the input is a number, it is converted to a string as specified by the ["NumberToString" algorithm](https://tc39.github.io/ecma262/#sec-tostring-applied-to-the-number-type) of the ECMAScript Language Specification. If the input is a color, it is converted to a string of the form `"rgba(r,g,b,a)"`, where `r`, `g`, and `b` are numerals ranging from 0 to 255, and `a` ranges from 0 to 1. Otherwise, the input is converted to a string in the format specified by the [`JSON.stringify`](https://tc39.github.io/ecma262/#sec-json.stringify) function of the ECMAScript Language Specification.',group:"Types"},"to-number":{doc:'Converts the input value to a number, if possible. If the input is `null` or `false`, the result is 0. If the input is `true`, the result is 1. If the input is a string, it is converted to a number as specified by the ["ToNumber Applied to the String Type" algorithm](https://tc39.github.io/ecma262/#sec-tonumber-applied-to-the-string-type) of the ECMAScript Language Specification. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.',group:"Types"},"to-boolean":{doc:"Converts the input value to a boolean. The result is `false` when then input is an empty string, 0, `false`, `null`, or `NaN`; otherwise it is `true`.",group:"Types"},"to-rgba":{doc:"Returns a four-element array containing the input color's red, green, blue, and alpha components, in that order.",group:"Color"},"to-color":{doc:"Converts the input value to a color. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.",group:"Types"},rgb:{doc:"Creates a color value from red, green, and blue components, which must range between 0 and 255, and an alpha component of 1. If any component is out of range, the expression is an error.",group:"Color"},rgba:{doc:"Creates a color value from red, green, blue components, which must range between 0 and 255, and an alpha component which must range between 0 and 1. If any component is out of range, the expression is an error.",group:"Color"},get:{doc:"Retrieves a property value from the current feature's properties, or from another object if a second argument is provided. Returns null if the requested property is missing.",group:"Lookup"},has:{doc:"Tests for the presence of an property value in the current feature's properties, or from another object if a second argument is provided.",group:"Lookup"},length:{doc:"Gets the length of an array or string.",group:"Lookup"},properties:{doc:'Gets the feature properties object. Note that in some cases, it may be more efficient to use ["get", "property_name"] directly.',group:"Feature data"},"geometry-type":{doc:"Gets the feature's geometry type: Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon.",group:"Feature data"},id:{doc:"Gets the feature's id, if it has one.",group:"Feature data"},zoom:{doc:'Gets the current zoom level. Note that in style layout and paint properties, ["zoom"] may only appear as the input to a top-level "step" or "interpolate" expression.',group:"Zoom"},"heatmap-density":{doc:"Gets the kernel density estimation of a pixel in a heatmap layer, which is a relative measure of how many data points are crowded around a particular pixel. Can only be used in the `heatmap-color` property.",group:"Heatmap"},"+":{doc:"Returns the sum of the inputs.",group:"Math"},"*":{doc:"Returns the product of the inputs.",group:"Math"},"-":{doc:"For two inputs, returns the result of subtracting the second input from the first. For a single input, returns the result of subtracting it from 0.",group:"Math"},"/":{doc:"Returns the result of floating point division of the first input by the second.",group:"Math"},"%":{doc:"Returns the remainder after integer division of the first input by the second.",group:"Math"},"^":{doc:"Returns the result of raising the first input to the power specified by the second.",group:"Math"},sqrt:{doc:"Returns the square root of the input.",group:"Math"},log10:{doc:"Returns the base-ten logarithm of the input.",group:"Math"},ln:{doc:"Returns the natural logarithm of the input.",group:"Math"},log2:{doc:"Returns the base-two logarithm of the input.",group:"Math"},sin:{doc:"Returns the sine of the input.",group:"Math"},cos:{doc:"Returns the cosine of the input.",group:"Math"},tan:{doc:"Returns the tangent of the input.",group:"Math"},asin:{doc:"Returns the arcsine of the input.",group:"Math"},acos:{doc:"Returns the arccosine of the input.",group:"Math"},atan:{doc:"Returns the arctangent of the input.",group:"Math"},min:{doc:"Returns the minimum value of the inputs.",group:"Math"},max:{doc:"Returns the maximum value of the inputs.",group:"Math"},"==":{doc:"Returns `true` if the input values are equal, `false` otherwise. The inputs must be numbers, strings, or booleans, and both of the same type.",group:"Decision"},"!=":{doc:"Returns `true` if the input values are not equal, `false` otherwise. The inputs must be numbers, strings, or booleans, and both of the same type.",group:"Decision"},">":{doc:"Returns `true` if the first input is strictly greater than the second, `false` otherwise. The inputs must be numbers or strings, and both of the same type.",group:"Decision"},"<":{doc:"Returns `true` if the first input is strictly less than the second, `false` otherwise. The inputs must be numbers or strings, and both of the same type.",group:"Decision"},">=":{doc:"Returns `true` if the first input is greater than or equal to the second, `false` otherwise. The inputs must be numbers or strings, and both of the same type.",group:"Decision"},"<=":{doc:"Returns `true` if the first input is less than or equal to the second, `false` otherwise. The inputs must be numbers or strings, and both of the same type.",group:"Decision"},all:{doc:"Returns `true` if all the inputs are `true`, `false` otherwise. The inputs are evaluated in order, and evaluation is short-circuiting: once an input expression evaluates to `false`, the result is `false` and no further input expressions are evaluated.",group:"Decision"},any:{doc:"Returns `true` if any of the inputs are `true`, `false` otherwise. The inputs are evaluated in order, and evaluation is short-circuiting: once an input expression evaluates to `true`, the result is `true` and no further input expressions are evaluated.",group:"Decision"},"!":{doc:"Logical negation. Returns `true` if the input is `false`, and `false` if the input is `true`.",group:"Decision"},upcase:{doc:"Returns the input string converted to uppercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database.",group:"String"},downcase:{doc:"Returns the input string converted to lowercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database.",group:"String"},concat:{doc:"Returns a string consisting of the concatenation of the inputs.",group:"String"}}},light:{anchor:{type:"enum",default:"viewport",values:{map:{doc:"The position of the light source is aligned to the rotation of the map."},viewport:{doc:"The position of the light source is aligned to the rotation of the viewport."}},transition:!1,"zoom-function":!0,"property-function":!1,function:"piecewise-constant",doc:"Whether extruded geometries are lit relative to the map or viewport.",example:"map","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},position:{type:"array",default:[1.15,210,30],length:3,value:"number",transition:!0,function:"interpolated","zoom-function":!0,"property-function":!1,doc:"Position of the light source relative to lit (extruded) geometries, in [r radial coordinate, a azimuthal angle, p polar angle] where r indicates the distance from the center of the base of an object to its light, a indicates the position of the light relative to 0° (0° when `light.anchor` is set to `viewport` corresponds to the top of the viewport, or 0° when `light.anchor` is set to `map` corresponds to due north, and degrees proceed clockwise), and p indicates the height of the light (from 0°, directly above, to 180°, directly below).",example:[1.5,90,80],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},color:{type:"color",default:"#ffffff",function:"interpolated","zoom-function":!0,"property-function":!1,transition:!0,doc:"Color tint for lighting extruded geometries.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},intensity:{type:"number",default:.5,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!1,transition:!0,doc:"Intensity of lighting (on a scale from 0 to 1). Higher numbers will present as more extreme contrast.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",function:"piecewise-constant","zoom-function":!0,default:!0,doc:"Whether or not the fill should be antialiased.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}},"fill-opacity":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!0,default:1,minimum:0,maximum:1,doc:"The opacity of the entire fill layer. In contrast to the `fill-color`, this value will also affect the 1px stroke around the fill, if the stroke is used.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.21.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}}},"fill-color":{type:"color",default:"#000000",doc:"The color of the filled part of this layer. This color can be specified as `rgba` with an alpha component and the color's opacity will not affect the opacity of the 1px stroke, if it is used.",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"fill-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.19.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}}},"fill-outline-color":{type:"color",doc:"The outline color of the fill. Matches the value of `fill-color` if unspecified.",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.19.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}}},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}},"fill-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{doc:"The fill is translated relative to the map."},viewport:{doc:"The fill is translated relative to the viewport."}},doc:"Controls the frame of reference for `fill-translate`.",default:"map",requires:["fill-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}},"fill-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,transition:!0,doc:"Name of image in sprite to use for drawing image fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512).","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!1,default:1,minimum:0,maximum:1,doc:"The opacity of the entire fill extrusion layer. This is rendered on a per-layer, not per-feature, basis, and data-driven styling is not available.",transition:!0,"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},"fill-extrusion-color":{type:"color",default:"#000000",doc:"The base color of the extruded fill. The extrusion's surfaces will be shaded differently based on this color in combination with the root `light` settings. If this color is specified as `rgba` with an alpha component, the alpha component will be ignored; use `fill-extrusion-opacity` to set layer opacity.",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"fill-extrusion-pattern"}],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up (on the flat plane), respectively.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{}}},"fill-extrusion-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{doc:"The fill extrusion is translated relative to the map."},viewport:{doc:"The fill extrusion is translated relative to the viewport."}},doc:"Controls the frame of reference for `fill-extrusion-translate`.",default:"map",requires:["fill-extrusion-translate"],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{}}},"fill-extrusion-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,transition:!0,doc:"Name of image in sprite to use for drawing images on extruded fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512).","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{}}},"fill-extrusion-height":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!0,default:0,minimum:0,units:"meters",doc:"The height with which to extrude this layer.",transition:!0,"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},"fill-extrusion-base":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!0,default:0,minimum:0,units:"meters",doc:"The height with which to extrude the base of this layer. Must be less than or equal to `fill-extrusion-height`.",transition:!0,requires:["fill-extrusion-height"],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}}},paint_line:{"line-opacity":{type:"number",doc:"The opacity at which the line will be drawn.",function:"interpolated","zoom-function":!0,"property-function":!0,default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}}},"line-color":{type:"color",doc:"The color with which the line will be drawn.",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"line-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.23.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}}},"line-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}},"line-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{doc:"The line is translated relative to the map."},viewport:{doc:"The line is translated relative to the viewport."}},doc:"Controls the frame of reference for `line-translate`.",default:"map",requires:["line-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}},"line-width":{type:"number",default:1,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",doc:"Stroke thickness.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.39.0"}}},"line-gap-width":{type:"number",default:0,minimum:0,doc:"Draws a line casing outside of a line's actual path. Value indicates the width of the inner gap.",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}}},"line-offset":{type:"number",default:0,doc:"The line's offset. For linear features, a positive value offsets the line to the right, relative to the direction of the line, and a negative value to the left. For polygon features, a positive value results in an inset, and a negative value results in an outset.",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels","sdk-support":{"basic functionality":{js:"0.12.1",android:"3.0.0",ios:"3.1.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}}},"line-blur":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",doc:"Blur applied to the line, in pixels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}}},"line-dasharray":{type:"array",value:"number",function:"piecewise-constant","zoom-function":!0,doc:"Specifies the lengths of the alternating dashes and gaps that form the dash pattern. The lengths are later scaled by the line width. To convert a dash length to pixels, multiply the length by the current line width.",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}},"line-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,transition:!0,doc:"Name of image in sprite to use for drawing image lines. For seamless patterns, image width must be a factor of two (2, 4, 8, ..., 512).","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",doc:"Circle radius.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.18.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}}},"circle-color":{type:"color",default:"#000000",doc:"The fill color of the circle.",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.18.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}}},"circle-blur":{type:"number",default:0,doc:"Amount to blur the circle. 1 blurs the circle such that only the centerpoint is full opacity.",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.20.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}}},"circle-opacity":{type:"number",doc:"The opacity at which the circle will be drawn.",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.20.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}}},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}},"circle-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{doc:"The circle is translated relative to the map."},viewport:{doc:"The circle is translated relative to the viewport."}},doc:"Controls the frame of reference for `circle-translate`.",default:"map",requires:["circle-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}},"circle-pitch-scale":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{doc:"Circles are scaled according to their apparent distance to the camera."},viewport:{doc:"Circles are not scaled."}},default:"map",doc:"Controls the scaling behavior of the circle when the map is pitched.","sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"},"data-driven styling":{}}},"circle-pitch-alignment":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{doc:"The circle is aligned to the plane of the map."},viewport:{doc:"The circle is aligned to the plane of the viewport."}},default:"viewport",doc:"Orientation of circle when map is pitched.","sdk-support":{"basic functionality":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"},"data-driven styling":{}}},"circle-stroke-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",doc:"The width of the circle's stroke. Strokes are placed outside of the `circle-radius`.","sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}}},"circle-stroke-color":{type:"color",default:"#000000",doc:"The stroke color of the circle.",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,"sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}}},"circle-stroke-opacity":{type:"number",doc:"The opacity of the circle's stroke.",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,"sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}}}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",doc:"Radius of influence of one heatmap point in pixels. Increasing the value makes the heatmap smoother, but less detailed.","sdk-support":{"basic functionality":{js:"0.41.0"},"data-driven styling":{}}},"heatmap-weight":{type:"number",default:1,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!1,doc:"A measure of how much an individual point contributes to the heatmap. A value of 10 would be equivalent to having 10 points of weight 1 in the same spot. Especially useful when combined with clustering.","sdk-support":{"basic functionality":{js:"0.41.0"},"data-driven styling":{js:"0.41.0"}}},"heatmap-intensity":{type:"number",default:1,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!1,transition:!0,doc:"Similar to `heatmap-weight` but controls the intensity of the heatmap globally. Primarily used for adjusting the heatmap based on zoom level.","sdk-support":{"basic functionality":{js:"0.41.0"},"data-driven styling":{}}},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],doc:'Defines the color of each pixel based on its density value in a heatmap. Should be an expression that uses `["heatmap-density"]` as input.',function:"interpolated","zoom-function":!1,"property-function":!1,transition:!1,"sdk-support":{"basic functionality":{js:"0.41.0"},"data-driven styling":{}}},"heatmap-opacity":{type:"number",doc:"The global opacity at which the heatmap layer will be drawn.",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!1,transition:!0,"sdk-support":{"basic functionality":{js:"0.41.0"},"data-driven styling":{}}}},paint_symbol:{"icon-opacity":{doc:"The opacity at which the icon will be drawn.",type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}}},"icon-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,doc:"The color of the icon. This can only be used with sdf icons.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}}},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,doc:"The color of the icon's halo. Icon halos can only be used with SDF icons.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}}},"icon-halo-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",doc:"Distance of halo to the icon outline.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}}},"icon-halo-blur":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",doc:"Fade out the halo towards the outside.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}}},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,transition:!0,units:"pixels",doc:"Distance that the icon's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}},"icon-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{doc:"Icons are translated relative to the map."},viewport:{doc:"Icons are translated relative to the viewport."}},doc:"Controls the frame of reference for `icon-translate`.",default:"map",requires:["icon-image","icon-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}},"text-opacity":{type:"number",doc:"The opacity at which the text will be drawn.",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}}},"text-color":{type:"color",doc:"The color with which the text will be drawn.",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}}},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,doc:"The color of the text's halo, which helps it stand out from backgrounds.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}}},"text-halo-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",doc:"Distance of halo to the font outline. Max text halo width is 1/4 of the font-size.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}}},"text-halo-blur":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",doc:"The halo's fadeout distance towards the outside.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}}},"text-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,transition:!0,units:"pixels",doc:"Distance that the text's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}},"text-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{doc:"The text is translated relative to the map."},viewport:{doc:"The text is translated relative to the viewport."}},doc:"Controls the frame of reference for `text-translate`.",default:"map",requires:["text-field","text-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}}},paint_raster:{"raster-opacity":{type:"number",doc:"The opacity at which the image will be drawn.",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}},"raster-hue-rotate":{type:"number",default:0,period:360,function:"interpolated","zoom-function":!0,transition:!0,units:"degrees",doc:"Rotates hues around the color wheel.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}},"raster-brightness-min":{type:"number",function:"interpolated","zoom-function":!0,doc:"Increase or reduce the brightness of the image. The value is the minimum brightness.",default:0,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}},"raster-brightness-max":{type:"number",function:"interpolated","zoom-function":!0,doc:"Increase or reduce the brightness of the image. The value is the maximum brightness.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}},"raster-saturation":{type:"number",doc:"Increase or reduce the saturation of the image.",default:0,minimum:-1,maximum:1,function:"interpolated","zoom-function":!0,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}},"raster-contrast":{type:"number",doc:"Increase or reduce the contrast of the image.",default:0,minimum:-1,maximum:1,function:"interpolated","zoom-function":!0,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}},"raster-fade-duration":{type:"number",default:300,minimum:0,function:"interpolated","zoom-function":!0,transition:!1,units:"milliseconds",doc:"Fade duration when a new tile is added.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,doc:"The direction of the light source used to generate the hillshading with 0 as the top of the viewport if `hillshade-illumination-anchor` is set to `viewport` and due north if `hillshade-illumination-anchor` is set to `map`.",function:"interpolated","zoom-function":!0,transition:!1},"hillshade-illumination-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{doc:"The hillshade illumination is relative to the north direction."},viewport:{doc:"The hillshade illumination is relative to the top of the viewport."}},default:"viewport",doc:"Direction of light source when map is rotated."},"hillshade-exaggeration":{type:"number",doc:"Intensity of the hillshade",default:.5,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,transition:!0},"hillshade-shadow-color":{type:"color",default:"#000000",doc:"The shading color of areas that face away from the light source.",function:"interpolated","zoom-function":!0,transition:!0},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",doc:"The shading color of areas that faces towards the light source.",function:"interpolated","zoom-function":!0,transition:!0},"hillshade-accent-color":{type:"color",default:"#000000",doc:"The shading color used to accentuate rugged terrain like sharp cliffs and gorges.",function:"interpolated","zoom-function":!0,transition:!0}},paint_background:{"background-color":{type:"color",default:"#000000",doc:"The color with which the background will be drawn.",function:"interpolated","zoom-function":!0,transition:!0,requires:[{"!":"background-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},"background-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,transition:!0,doc:"Name of image in sprite to use for drawing an image background. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512).","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity at which the background will be drawn.",function:"interpolated","zoom-function":!0,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds",doc:"Time allotted for transitions to complete."},delay:{type:"number",default:0,minimum:0,units:"milliseconds",doc:"Length of time before a transition begins."}}}},function(e,t,i){var r=i(75),n=i(29),a=i(13),o=i(150);function s(e,t){t=t||a;var i=[];return i=i.concat(n({key:"",value:e,valueSpec:t.$root,styleSpec:t,style:e,objectElementValidators:{glyphs:o,"*":function(){return[]}}})),e.constants&&(i=i.concat(r({key:"constants",value:e.constants,style:e,styleSpec:t}))),l(i)}function l(e){return[].concat(e).sort(function(e,t){return e.line-t.line})}function u(e){return function(){return l(e.apply(this,arguments))}}s.source=u(i(99)),s.light=u(i(100)),s.layer=u(i(95)),s.filter=u(i(59)),s.paintProperty=u(i(96)),s.layoutProperty=u(i(98)),e.exports=s},function(e,t,i){function r(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var n,a,o=i(8),s=o.array,l=o.ValueType,u=o.NumberType,c=i(31),d=(a=[{key:"parse",value:function(e,t){if(3!==e.length)return t.error("Expected 2 arguments, but found ".concat(e.length-1," instead."));var i=t.parse(e[1],1,u),r=t.parse(e[2],2,s(t.expectedType||l));return i&&r?new h(r.type.itemType,i,r):null}}],r((n=h).prototype,[{key:"evaluate",value:function(e){var t=this.index.evaluate(e),i=this.input.evaluate(e);if(t<0||t>=i.length)throw new c("Array index out of bounds: ".concat(t," > ").concat(i.length,"."));if(t!==Math.floor(t))throw new c("Array index must be an integer, but found ".concat(t," instead."));return i[t]}},{key:"eachChild",value:function(e){e(this.index),e(this.input)}},{key:"possibleOutputs",value:function(){return[void 0]}}]),r(n,a),h);function h(e,t,i){!function(e){if(!(e instanceof h))throw new TypeError("Cannot call a class as a function")}(this),this.type=e,this.index=t,this.input=i}e.exports=d},function(e,t,i){function r(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var n,a,_=i(1),C=i(25).typeOf,o=(a=[{key:"parse",value:function(e,t){if(e.length<5)return t.error("Expected at least 4 arguments, but found only ".concat(e.length-1,"."));if(e.length%2!=1)return t.error("Expected an even number of arguments.");var i,r;t.expectedType&&"value"!==t.expectedType.kind&&(r=t.expectedType);for(var n={},a=[],o=2;o<e.length-1;o+=2){var s=e[o],l=e[o+1];Array.isArray(s)||(s=[s]);var u=t.concat(o);if(0===s.length)return u.error("Expected at least one branch label.");var c=!0,d=!1,h=void 0;try{for(var p,f=s[Symbol.iterator]();!(c=(p=f.next()).done);c=!0){var m=p.value;if("number"!=typeof m&&"string"!=typeof m)return u.error("Branch labels must be numbers or strings.");if("number"==typeof m&&Math.abs(m)>Number.MAX_SAFE_INTEGER)return u.error("Branch labels must be integers no larger than ".concat(Number.MAX_SAFE_INTEGER,"."));if("number"==typeof m&&Math.floor(m)!==m)return u.error("Numeric branch labels must be integer values.");if(i){if(u.checkSubtype(i,C(m)))return null}else i=C(m);if(void 0!==n[String(m)])return u.error("Branch labels must be unique.");n[String(m)]=a.length}}catch(e){d=!0,h=e}finally{try{c||null==f.return||f.return()}finally{if(d)throw h}}var g=t.parse(l,o,r);if(!g)return null;r=r||g.type,a.push(g)}var y=t.parse(e[1],1,i);if(!y)return null;var v=t.parse(e[e.length-1],e.length-1,r);return v?(_(i&&r),new x(i,r,y,n,a,v)):null}}],r((n=x).prototype,[{key:"evaluate",value:function(e){var t=this.input.evaluate(e);return(this.outputs[this.cases[t]]||this.otherwise).evaluate(e)}},{key:"eachChild",value:function(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}},{key:"possibleOutputs",value:function(){var e;return(e=[]).concat.apply(e,function(e){return function(e){if(Array.isArray(e)){for(var t=0,i=new Array(e.length);t<e.length;t++)i[t]=e[t];return i}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}(this.outputs.map(function(e){return e.possibleOutputs()}))).concat(this.otherwise.possibleOutputs())}}]),r(n,a),x);function x(e,t,i,r,n,a){!function(e){if(!(e instanceof x))throw new TypeError("Cannot call a class as a function")}(this),this.inputType=e,this.type=t,this.input=i,this.cases=r,this.outputs=n,this.otherwise=a}e.exports=o},function(e,t,i){function u(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var i=[],r=!0,n=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(r=(o=s.next()).done)&&(i.push(o.value),!t||i.length!==t);r=!0);}catch(e){n=!0,a=e}finally{try{r||null==s.return||s.return()}finally{if(n)throw a}}return i}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function r(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var n,a,l=i(1),c=i(8).BooleanType,o=(a=[{key:"parse",value:function(e,t){if(e.length<4)return t.error("Expected at least 3 arguments, but found only ".concat(e.length-1,"."));if(e.length%2!=0)return t.error("Expected an odd number of arguments.");var i;t.expectedType&&"value"!==t.expectedType.kind&&(i=t.expectedType);for(var r=[],n=1;n<e.length-1;n+=2){var a=t.parse(e[n],n,c);if(!a)return null;var o=t.parse(e[n+1],n+1,i);if(!o)return null;r.push([a,o]),i=i||o.type}var s=t.parse(e[e.length-1],e.length-1,i);return s?(l(i),new d(i,r,s)):null}}],r((n=d).prototype,[{key:"evaluate",value:function(e){var t=!0,i=!1,r=void 0;try{for(var n,a=this.branches[Symbol.iterator]();!(t=(n=a.next()).done);t=!0){var o=u(n.value,2),s=o[0],l=o[1];if(s.evaluate(e))return l.evaluate(e)}}catch(e){i=!0,r=e}finally{try{t||null==a.return||a.return()}finally{if(i)throw r}}return this.otherwise.evaluate(e)}},{key:"eachChild",value:function(e){var t=!0,i=!1,r=void 0;try{for(var n,a=this.branches[Symbol.iterator]();!(t=(n=a.next()).done);t=!0){var o=u(n.value,2),s=o[0],l=o[1];e(s),e(l)}}catch(e){i=!0,r=e}finally{try{t||null==a.return||a.return()}finally{if(i)throw r}}e(this.otherwise)}},{key:"possibleOutputs",value:function(){var e;return(e=[]).concat.apply(e,function(e){return function(e){if(Array.isArray(e)){for(var t=0,i=new Array(e.length);t<e.length;t++)i[t]=e[t];return i}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}(this.branches.map(function(e){var t=u(e,2);return t[0],t[1].possibleOutputs()}))).concat(this.otherwise.possibleOutputs())}}]),r(n,a),d);function d(e,t,i){!function(e){if(!(e instanceof d))throw new TypeError("Cannot call a class as a function")}(this),this.type=e,this.branches=t,this.otherwise=i}e.exports=o},function(e,t,i){function r(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var n=i(8),a=n.ValueType,o=n.BooleanType,s=i(8).toString;function l(e){return"string"===e.kind||"number"===e.kind||"boolean"===e.kind||"null"===e.kind}function u(t){return i=[{key:"parse",value:function(e,t){if(3!==e.length)return t.error("Expected two arguments.");var i=t.parse(e[1],1,a);if(!i)return null;var r=t.parse(e[2],2,a);return r?l(i.type)||l(r.type)?i.type.kind!==r.type.kind&&"value"!==i.type.kind&&"value"!==r.type.kind?t.error("Cannot compare ".concat(s(i.type)," and ").concat(s(r.type),".")):new n(i,r):t.error("Expected at least one argument to be a string, number, boolean, or null, but found (".concat(s(i.type),", ").concat(s(r.type),") instead.")):null}}],r((e=n).prototype,[{key:"evaluate",value:function(e){return t(this.lhs.evaluate(e),this.rhs.evaluate(e))}},{key:"eachChild",value:function(e){e(this.lhs),e(this.rhs)}},{key:"possibleOutputs",value:function(){return[!0,!1]}}]),r(e,i),n;function n(e,t){!function(e){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}(this),this.type=o,this.lhs=e,this.rhs=t}var e,i}e.exports={Equals:u(function(e,t){return e===t}),NotEquals:u(function(e,t){return e!==t})}},function(e,t){e.exports={success:function(e){return{result:"success",value:e}},error:function(e){return{result:"error",value:e}}}},function(e,t,i){var n=i(12),r=i(26).number,a=4/29,o=6/29,s=3*o*o,l=o*o*o,u=Math.PI/180,c=180/Math.PI;function d(e){return l<e?Math.pow(e,1/3):e/s+a}function h(e){return o<e?e*e*e:s*(e-a)}function p(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function f(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function m(e){var t=f(e.r),i=f(e.g),r=f(e.b),n=d((.4124564*t+.3575761*i+.1804375*r)/.95047),a=d((.2126729*t+.7151522*i+.072175*r)/1);return{l:116*a-16,a:500*(n-a),b:200*(a-d((.0193339*t+.119192*i+.9503041*r)/1.08883)),alpha:e.a}}function g(e){var t=(e.l+16)/116,i=isNaN(e.a)?t:t+e.a/500,r=isNaN(e.b)?t:t-e.b/200;return t=1*h(t),i=.95047*h(i),r=1.08883*h(r),new n(p(3.2404542*i-1.5371385*t-.4985314*r),p(-.969266*i+1.8760108*t+.041556*r),p(.0556434*i-.2040259*t+1.0572252*r),e.alpha)}e.exports={lab:{forward:m,reverse:g,interpolate:function(e,t,i){return{l:r(e.l,t.l,i),a:r(e.a,t.a,i),b:r(e.b,t.b,i),alpha:r(e.alpha,t.alpha,i)}}},hcl:{forward:function(e){var t=m(e),i=t.l,r=t.a,n=t.b,a=Math.atan2(n,r)*c;return{h:a<0?360+a:a,c:Math.sqrt(r*r+n*n),l:i,alpha:e.a}},reverse:function(e){var t=e.h*u,i=e.c;return g({l:e.l,a:Math.cos(t)*i,b:Math.sin(t)*i,alpha:e.alpha})},interpolate:function(e,t,i){return{h:function(e,t,i){var r=t-e;return e+i*(180<r||r<-180?r-360*Math.round(r/360):r)}(e.h,t.h,i),c:r(e.c,t.c,i),l:r(e.l,t.l,i),alpha:r(e.alpha,t.alpha,i)}}}}},function(e,t,i){var n=i(17),a=i(7);e.exports=function(e){var t=e.value,i=e.key,r=n(t);return"boolean"!==r?[new a(i,t,"boolean expected, ".concat(r," found"))]:[]}},function(e,t,i){var n=i(7),a=i(17),o=i(80).parseCSSColor;e.exports=function(e){var t=e.key,i=e.value,r=a(i);return"string"!==r?[new n(t,i,"color expected, ".concat(r," found"))]:null===o(i)?[new n(t,i,'color expected, "'.concat(i,'" found'))]:[]}},function(e,t,i){var n=i(7),a=i(101);e.exports=function(e){var t=e.value,i=e.key,r=a(e);return r.length||(-1===t.indexOf("{fontstack}")&&r.push(new n(i,t,'"glyphs" url must include a "{fontstack}" token')),-1===t.indexOf("{range}")&&r.push(new n(i,t,'"glyphs" url must include a "{range}" token'))),r}},function(e,t,i){function r(e){return(r="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})(e)}function n(e){return(n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function a(e,t){return(a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var o=i(19),s=i(103),u=i(44).multiPolygonIntersectsBufferedMultiPoint,l=i(47),c=l.getMaximumPaintValue,d=l.translateDistance,h=l.translate,p=i(154),f=i(4),m=(f.Transitionable,f.Transitioning,f.PossiblyEvaluated,function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(g,o),function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(g.prototype,[{key:"createBucket",value:function(e){return new s(e)}},{key:"queryRadius",value:function(e){var t=e;return c("circle-radius",this,t)+c("circle-stroke-width",this,t)+d(this.paint.get("circle-translate"))}},{key:"queryIntersectsFeature",value:function(e,t,i,r,n,a){var o=h(e,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),n,a),s=this.paint.get("circle-radius").evaluate(t)*a,l=this.paint.get("circle-stroke-width").evaluate(t)*a;return u(o,i,s+l)}}]),g);function g(e){return function(e){if(!(e instanceof g))throw new TypeError("Cannot call a class as a function")}(this),function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,n(g).call(this,e,p))}e.exports=m},function(e,t,i){var r=i(23).createLayout;e.exports=r([{name:"a_pos",components:2,type:"Int16"}],4)},function(e,t,i){var r=i(0);t.packUint8ToFloat=function(e,t){return 256*(e=r.clamp(Math.floor(e),0,255))+r.clamp(Math.floor(t),0,255)}},function(e,t,i){var r=i(13),n=i(4),a=n.Properties,o=n.DataConstantProperty,s=n.DataDrivenProperty,l=(n.CrossFadedProperty,n.HeatmapColorProperty,new a({"circle-radius":new s(r.paint_circle["circle-radius"]),"circle-color":new s(r.paint_circle["circle-color"]),"circle-blur":new s(r.paint_circle["circle-blur"]),"circle-opacity":new s(r.paint_circle["circle-opacity"]),"circle-translate":new o(r.paint_circle["circle-translate"]),"circle-translate-anchor":new o(r.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new o(r.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new o(r.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new s(r.paint_circle["circle-stroke-width"]),"circle-stroke-color":new s(r.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new s(r.paint_circle["circle-stroke-opacity"])}));e.exports={paint:l}},function(e,t,i){function r(e){return(r="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})(e)}function n(e,t,i){return(n="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,i){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=a(e)););return e}(e,t);if(r){var n=Object.getOwnPropertyDescriptor(r,t);return n.get?n.get.call(i):n.value}})(e,t,i||e)}function a(e){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function o(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function s(e,t,i){return t&&o(e.prototype,t),i&&o(e,i),e}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var u=i(19),c=i(156),d=i(33).RGBAImage,h=i(157),p=i(4),f=(p.Transitionable,p.Transitioning,p.PossiblyEvaluated,function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&l(e,t)}(m,u),s(m,[{key:"createBucket",value:function(e){return new c(e)}}]),s(m,[{key:"setPaintProperty",value:function(e,t,i){n(a(m.prototype),"setPaintProperty",this).call(this,e,t,i),"heatmap-color"===e&&this._updateColorRamp()}},{key:"_updateColorRamp",value:function(){for(var e=this._transitionablePaint._values["heatmap-color"].value.expression,t=new Uint8Array(1024),i=t.length,r=4;r<i;r+=4){var n=e.evaluate({heatmapDensity:r/i});t[r+0]=Math.floor(255*n.r/n.a),t[r+1]=Math.floor(255*n.g/n.a),t[r+2]=Math.floor(255*n.b/n.a),t[r+3]=Math.floor(255*n.a)}this.colorRamp=new d({width:256,height:1},t),this.colorRampTexture=null}},{key:"resize",value:function(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)}},{key:"queryRadius",value:function(){return 0}},{key:"queryIntersectsFeature",value:function(){return!1}},{key:"hasOffscreenPass",value:function(){return 0!==this.paint.get("heatmap-opacity")&&"none"!==this.visibility}}]),m);function m(e){var t;return function(e){if(!(e instanceof m))throw new TypeError("Cannot call a class as a function")}(this),(t=function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,a(m).call(this,e,h)))._updateColorRamp(),t}e.exports=f},function(e,t,i){function r(e){return(r="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})(e)}function n(e){return(n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function a(e,t){return(a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var o=i(103),s=i(11).register,l=(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(u,o),u);function u(){return function(e){if(!(e instanceof u))throw new TypeError("Cannot call a class as a function")}(this),function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,n(u).apply(this,arguments))}s("HeatmapBucket",l,{omit:["layers"]}),e.exports=l},function(e,t,i){var r=i(13),n=i(4),a=n.Properties,o=n.DataConstantProperty,s=n.DataDrivenProperty,l=(n.CrossFadedProperty,n.HeatmapColorProperty),u=new a({"heatmap-radius":new s(r.paint_heatmap["heatmap-radius"]),"heatmap-weight":new s(r.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new o(r.paint_heatmap["heatmap-intensity"]),"heatmap-color":new l(r.paint_heatmap["heatmap-color"]),"heatmap-opacity":new o(r.paint_heatmap["heatmap-opacity"])});e.exports={paint:u}},function(e,t,i){function r(e){return(r="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})(e)}function n(e){return(n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function a(e,t){return(a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var o=i(19),s=i(159),l=i(4),u=(l.Transitionable,l.Transitioning,l.PossiblyEvaluated,function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(c,o),function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(c.prototype,[{key:"hasOffscreenPass",value:function(){return 0!==this.paint.get("hillshade-exaggeration")&&"none"!==this.visibility}}]),c);function c(e){return function(e){if(!(e instanceof c))throw new TypeError("Cannot call a class as a function")}(this),function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,n(c).call(this,e,s))}e.exports=u},function(e,t,i){var r=i(13),n=i(4),a=n.Properties,o=n.DataConstantProperty,s=(n.DataDrivenProperty,n.CrossFadedProperty,n.HeatmapColorProperty,new a({"hillshade-illumination-direction":new o(r.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new o(r.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new o(r.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new o(r.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new o(r.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new o(r.paint_hillshade["hillshade-accent-color"])}));e.exports={paint:s}},function(e,t,i){function r(e){return(r="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})(e)}function n(e){return(n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function a(e,t){return(a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var o=i(19),s=i(161),l=i(44).multiPolygonIntersectsMultiPolygon,u=i(47),c=u.translateDistance,d=u.translate,h=i(164),p=i(4),f=(p.Transitionable,p.Transitioning,p.PossiblyEvaluated,function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(m,o),function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(m.prototype,[{key:"recalculate",value:function(e){this.paint=this._transitioningPaint.possiblyEvaluate(e),void 0===this._transitionablePaint.getValue("fill-outline-color")&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}},{key:"createBucket",value:function(e){return new s(e)}},{key:"queryRadius",value:function(){return c(this.paint.get("fill-translate"))}},{key:"queryIntersectsFeature",value:function(e,t,i,r,n,a){var o=d(e,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),n,a);return l(o,i)}}]),m);function m(e){return function(e){if(!(e instanceof m))throw new TypeError("Cannot call a class as a function")}(this),function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,n(m).call(this,e,h))}e.exports=f},function(e,t,i){var r=i(14).FillLayoutArray,n=i(162).members,a=i(36).SegmentVector,o=i(32).ProgramConfigurationSet,s=i(37),l=s.LineIndexArray,u=s.TriangleIndexArray,h=i(38),M=i(104),D=i(105),I=i(1),c=i(11).register,d=(function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(p.prototype,[{key:"populate",value:function(e,t){var i=!0,r=!1,n=void 0;try{for(var a,o=e[Symbol.iterator]();!(i=(a=o.next()).done);i=!0){var s=a.value,l=s.feature,u=s.index,c=s.sourceLayerIndex;if(this.layers[0]._featureFilter({zoom:this.zoom},l)){var d=h(l);this.addFeature(l,d),t.featureIndex.insert(l,d,u,c,this.index)}}}catch(e){r=!0,n=e}finally{try{i||null==o.return||o.return()}finally{if(r)throw n}}}},{key:"isEmpty",value:function(){return 0===this.layoutVertexArray.length}},{key:"upload",value:function(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,n),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.indexBuffer2=e.createIndexBuffer(this.indexArray2),this.programConfigurations.upload(e)}},{key:"destroy",value:function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}},{key:"addFeature",value:function(e,t){var i=!0,r=!1,n=void 0;try{for(var a,o=D(t,500)[Symbol.iterator]();!(i=(a=o.next()).done);i=!0){var s=a.value,l=0,u=!0,c=!1,d=void 0;try{for(var h,p=s[Symbol.iterator]();!(u=(h=p.next()).done);u=!0)l+=h.value.length}catch(e){c=!0,d=e}finally{try{u||null==p.return||p.return()}finally{if(c)throw d}}var f=this.segments.prepareSegment(l,this.layoutVertexArray,this.indexArray),m=f.vertexLength,g=[],y=[],v=!0,_=!1,C=void 0;try{for(var x,b=s[Symbol.iterator]();!(v=(x=b.next()).done);v=!0){var A=x.value;if(0!==A.length){A!==s[0]&&y.push(g.length/2);var S=this.segments2.prepareSegment(A.length,this.layoutVertexArray,this.indexArray2),w=S.vertexLength;this.layoutVertexArray.emplaceBack(A[0].x,A[0].y),this.indexArray2.emplaceBack(w+A.length-1,w),g.push(A[0].x),g.push(A[0].y);for(var E=1;E<A.length;E++)this.layoutVertexArray.emplaceBack(A[E].x,A[E].y),this.indexArray2.emplaceBack(w+E-1,w+E),g.push(A[E].x),g.push(A[E].y);S.vertexLength+=A.length,S.primitiveLength+=A.length}}}catch(e){_=!0,C=e}finally{try{v||null==b.return||b.return()}finally{if(_)throw C}}var T=M(g,y);I(T.length%3==0);for(var P=0;P<T.length;P+=3)this.indexArray.emplaceBack(m+T[P],m+T[P+1],m+T[P+2]);f.vertexLength+=l,f.primitiveLength+=T.length/3}}catch(e){r=!0,n=e}finally{try{i||null==o.return||o.return()}finally{if(r)throw n}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e)}}]),p);function p(e){!function(e){if(!(e instanceof p))throw new TypeError("Cannot call a class as a function")}(this),this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(function(e){return e.id}),this.index=e.index,this.layoutVertexArray=new r,this.indexArray=new u,this.indexArray2=new l,this.programConfigurations=new o(n,e.layers,e.zoom),this.segments=new a,this.segments2=new a}c("FillBucket",d,{omit:["layers"]}),e.exports=d},function(e,t,i){var r=i(23).createLayout;e.exports=r([{name:"a_pos",components:2,type:"Int16"}],4)},function(e,t,i){function f(e,t,i){var r=e[t];e[t]=e[i],e[i]=r}function a(e,t){return e<t?-1:t<e?1:0}e.exports=function(e,t,i,r,n){!function e(t,i,r,n,a){for(;r<n;){if(600<n-r){var o=n-r+1,s=i-r+1,l=Math.log(o),u=.5*Math.exp(2*l/3),c=.5*Math.sqrt(l*u*(o-u)/o)*(s-o/2<0?-1:1);e(t,i,Math.max(r,Math.floor(i-s*u/o+c)),Math.min(n,Math.floor(i+(o-s)*u/o+c)),a)}var d=t[i],h=r,p=n;for(f(t,r,i),0<a(t[n],d)&&f(t,r,n);h<p;){for(f(t,h,p),h++,p--;a(t[h],d)<0;)h++;for(;0<a(t[p],d);)p--}0===a(t[r],d)?f(t,r,p):f(t,++p,n),p<=i&&(r=p+1),i<=p&&(n=p-1)}}(e,t,i||0,r||e.length-1,n||a)}},function(e,t,i){var r=i(13),n=i(4),a=n.Properties,o=n.DataConstantProperty,s=n.DataDrivenProperty,l=n.CrossFadedProperty,u=(n.HeatmapColorProperty,new a({"fill-antialias":new o(r.paint_fill["fill-antialias"]),"fill-opacity":new s(r.paint_fill["fill-opacity"]),"fill-color":new s(r.paint_fill["fill-color"]),"fill-outline-color":new s(r.paint_fill["fill-outline-color"]),"fill-translate":new o(r.paint_fill["fill-translate"]),"fill-translate-anchor":new o(r.paint_fill["fill-translate-anchor"]),"fill-pattern":new l(r.paint_fill["fill-pattern"])}));e.exports={paint:u}},function(e,t,i){function r(e){return(r="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})(e)}function n(e){return(n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function a(e,t){return(a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var o=i(19),s=i(166),l=i(44).multiPolygonIntersectsMultiPolygon,u=i(47),c=u.translateDistance,d=u.translate,h=i(168),p=i(4),f=(p.Transitionable,p.Transitioning,p.PossiblyEvaluated,function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(m,o),function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(m.prototype,[{key:"createBucket",value:function(e){return new s(e)}},{key:"queryRadius",value:function(){return c(this.paint.get("fill-extrusion-translate"))}},{key:"queryIntersectsFeature",value:function(e,t,i,r,n,a){var o=d(e,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),n,a);return l(o,i)}},{key:"hasOffscreenPass",value:function(){return 0!==this.paint.get("fill-extrusion-opacity")&&"none"!==this.visibility}},{key:"resize",value:function(){this.viewportFrame&&(this.viewportFrame.destroy(),this.viewportFrame=null)}}]),m);function m(e){return function(e){if(!(e instanceof m))throw new TypeError("Cannot call a class as a function")}(this),function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,n(m).call(this,e,h))}e.exports=f},function(e,t,i){var r=i(14).FillExtrusionLayoutArray,n=i(167).members,a=i(36),o=a.SegmentVector,H=a.MAX_VERTEX_ARRAY_LENGTH,s=i(32).ProgramConfigurationSet,l=i(37).TriangleIndexArray,h=i(38),W=i(6),j=i(104),q=i(105),Q=i(1),u=i(11).register,c=Math.pow(2,13);function Y(e,t,i,r,n,a,o,s){e.emplaceBack(t,i,2*Math.floor(r*c)+o,n*c*2,a*c*2,Math.round(s))}var d=(function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(p.prototype,[{key:"populate",value:function(e,t){var i=!0,r=!1,n=void 0;try{for(var a,o=e[Symbol.iterator]();!(i=(a=o.next()).done);i=!0){var s=a.value,l=s.feature,u=s.index,c=s.sourceLayerIndex;if(this.layers[0]._featureFilter({zoom:this.zoom},l)){var d=h(l);this.addFeature(l,d),t.featureIndex.insert(l,d,u,c,this.index)}}}catch(e){r=!0,n=e}finally{try{i||null==o.return||o.return()}finally{if(r)throw n}}}},{key:"isEmpty",value:function(){return 0===this.layoutVertexArray.length}},{key:"upload",value:function(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,n),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.programConfigurations.upload(e)}},{key:"destroy",value:function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}},{key:"addFeature",value:function(e,t){var i,r,n,a=!0,o=!1,s=void 0;try{for(var l,u=q(t,500)[Symbol.iterator]();!(a=(l=u.next()).done);a=!0){var c=l.value,d=0,h=!0,p=!1,f=void 0;try{for(var m,g=c[Symbol.iterator]();!(h=(m=g.next()).done);h=!0)d+=m.value.length}catch(e){p=!0,f=e}finally{try{h||null==g.return||g.return()}finally{if(p)throw f}}var y=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray),v=!0,_=!1,C=void 0;try{for(var x,b=c[Symbol.iterator]();!(v=(x=b.next()).done);v=!0){var A=x.value;if(0!==A.length&&!((n=A).every(function(e){return e.x<0})||n.every(function(e){return e.x>W})||n.every(function(e){return e.y<0})||n.every(function(e){return e.y>W})))for(var S=0,w=0;w<A.length;w++){var E=A[w];if(1<=w){var T=A[w-1];if(r=T,!((i=E).x===r.x&&(i.x<0||i.x>W)||i.y===r.y&&(i.y<0||i.y>W))){y.vertexLength+4>H&&(y=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var P=E.sub(T)._perp()._unit(),M=T.dist(E);32768<S+M&&(S=0),Y(this.layoutVertexArray,E.x,E.y,P.x,P.y,0,0,S),Y(this.layoutVertexArray,E.x,E.y,P.x,P.y,0,1,S),S+=M,Y(this.layoutVertexArray,T.x,T.y,P.x,P.y,0,0,S),Y(this.layoutVertexArray,T.x,T.y,P.x,P.y,0,1,S);var D=y.vertexLength;this.indexArray.emplaceBack(D,D+1,D+2),this.indexArray.emplaceBack(D+1,D+2,D+3),y.vertexLength+=4,y.primitiveLength+=2}}}}}catch(e){_=!0,C=e}finally{try{v||null==b.return||b.return()}finally{if(_)throw C}}y.vertexLength+d>H&&(y=this.segments.prepareSegment(d,this.layoutVertexArray,this.indexArray));var I=[],O=[],R=y.vertexLength,L=!0,N=!1,k=void 0;try{for(var B,F=c[Symbol.iterator]();!(L=(B=F.next()).done);L=!0){var V=B.value;if(0!==V.length){V!==c[0]&&O.push(I.length/2);for(var z=0;z<V.length;z++){var U=V[z];Y(this.layoutVertexArray,U.x,U.y,0,0,1,1,0),I.push(U.x),I.push(U.y)}}}}catch(e){N=!0,k=e}finally{try{L||null==F.return||F.return()}finally{if(N)throw k}}var G=j(I,O);Q(G.length%3==0);for(var $=0;$<G.length;$+=3)this.indexArray.emplaceBack(R+G[$],R+G[$+1],R+G[$+2]);y.primitiveLength+=G.length/3,y.vertexLength+=d}}catch(e){o=!0,s=e}finally{try{a||null==u.return||u.return()}finally{if(o)throw s}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e)}}]),p);function p(e){!function(e){if(!(e instanceof p))throw new TypeError("Cannot call a class as a function")}(this),this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(function(e){return e.id}),this.index=e.index,this.layoutVertexArray=new r,this.indexArray=new l,this.programConfigurations=new s(n,e.layers,e.zoom),this.segments=new o}u("FillExtrusionBucket",d,{omit:["layers"]}),e.exports=d},function(e,t,i){var r=i(23).createLayout;e.exports=r([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4)},function(e,t,i){var r=i(13),n=i(4),a=n.Properties,o=n.DataConstantProperty,s=n.DataDrivenProperty,l=n.CrossFadedProperty,u=(n.HeatmapColorProperty,new a({"fill-extrusion-opacity":new o(r["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new s(r["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new o(r["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new o(r["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new l(r["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new s(r["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new s(r["paint_fill-extrusion"]["fill-extrusion-base"])}));e.exports={paint:u}},function(e,t,i){function r(e){return(r="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})(e)}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function o(e,t,i){return t&&a(e.prototype,t),i&&a(e,i),e}function s(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function l(e,t,i){return(l="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,i){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=u(e)););return e}(e,t);if(r){var n=Object.getOwnPropertyDescriptor(r,t);return n.get?n.get.call(i):n.value}})(e,t,i||e)}function u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function c(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&d(e,t)}function d(e,t){return(d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var m=i(3),h=i(19),p=i(170),f=i(44).multiPolygonIntersectsBufferedMultiLine,g=i(47),y=g.getMaximumPaintValue,v=g.translateDistance,_=g.translate,C=i(173),x=i(0).extend,b=i(61),A=i(4),S=(c(w,(A.Transitionable,A.Transitioning,A.Layout,A.PossiblyEvaluated,A.DataDrivenProperty)),o(w,[{key:"possiblyEvaluate",value:function(e,t){return t=new b(Math.floor(t.zoom),{now:t.now,fadeDuration:t.fadeDuration,zoomHistory:t.zoomHistory,transition:t.transition}),l(u(w.prototype),"possiblyEvaluate",this).call(this,e,t)}},{key:"evaluate",value:function(e,t,i){return t=x({},t,{zoom:Math.floor(t.zoom)}),l(u(w.prototype),"evaluate",this).call(this,e,t,i)}}]),new w(C.paint.properties["line-width"].specification));function w(){return n(this,w),s(this,u(w).apply(this,arguments))}S.useIntegerZoom=!0;var E=(c(T,h),o(T,[{key:"recalculate",value:function(e){l(u(T.prototype),"recalculate",this).call(this,e),this.paint._values["line-floorwidth"]=S.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)}},{key:"createBucket",value:function(e){return new p(e)}},{key:"queryRadius",value:function(e){var t=e,i=P(y("line-width",this,t),y("line-gap-width",this,t)),r=y("line-offset",this,t);return i/2+Math.abs(r)+v(this.paint.get("line-translate"))}},{key:"queryIntersectsFeature",value:function(e,t,i,r,n,a){var o=_(e,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),n,a),s=a/2*P(this.paint.get("line-width").evaluate(t),this.paint.get("line-gap-width").evaluate(t)),l=this.paint.get("line-offset").evaluate(t);return l&&(i=function(e,t){for(var i=[],r=new m(0,0),n=0;n<e.length;n++){for(var a=e[n],o=[],s=0;s<a.length;s++){var l=a[s-1],u=a[s],c=a[s+1],d=0===s?r:u.sub(l)._unit()._perp(),h=s===a.length-1?r:c.sub(u)._unit()._perp(),p=d._add(h)._unit(),f=p.x*h.x+p.y*h.y;p._mult(1/f),o.push(p._mult(t)._add(u))}i.push(o)}return i}(i,l*a)),f(o,i,s)}}]),T);function T(e){return n(this,T),s(this,u(T).call(this,e,C))}function P(e,t){return 0<t?t+2*e:e}e.exports=E},function(e,t,i){var r=i(14).LineLayoutArray,n=i(171).members,a=i(36).SegmentVector,o=i(32).ProgramConfigurationSet,s=i(37).TriangleIndexArray,h=i(38),U=i(6),G=i(48).VectorTileFeature.types,l=i(11).register,$=Math.cos(Math.PI/180*37.5),c=Math.pow(2,14)/.5;function d(e,t,i,r,n,a,o){e.emplaceBack(t.x,t.y,r?1:0,n?1:-1,Math.round(63*i.x)+128,Math.round(63*i.y)+128,1+(0===a?0:a<0?-1:1)|(.5*o&63)<<2,.5*o>>6)}var u=(function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(p.prototype,[{key:"populate",value:function(e,t){var i=!0,r=!1,n=void 0;try{for(var a,o=e[Symbol.iterator]();!(i=(a=o.next()).done);i=!0){var s=a.value,l=s.feature,u=s.index,c=s.sourceLayerIndex;if(this.layers[0]._featureFilter({zoom:this.zoom},l)){var d=h(l);this.addFeature(l,d),t.featureIndex.insert(l,d,u,c,this.index)}}}catch(e){r=!0,n=e}finally{try{i||null==o.return||o.return()}finally{if(r)throw n}}}},{key:"isEmpty",value:function(){return 0===this.layoutVertexArray.length}},{key:"upload",value:function(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,n),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.programConfigurations.upload(e)}},{key:"destroy",value:function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}},{key:"addFeature",value:function(e,t){var i=this.layers[0].layout,r=i.get("line-join").evaluate(e),n=i.get("line-cap"),a=i.get("line-miter-limit"),o=i.get("line-round-limit"),s=!0,l=!1,u=void 0;try{for(var c,d=t[Symbol.iterator]();!(s=(c=d.next()).done);s=!0){var h=c.value;this.addLine(h,e,r,n,a,o)}}catch(e){l=!0,u=e}finally{try{s||null==d.return||d.return()}finally{if(l)throw u}}}},{key:"addLine",value:function(e,t,i,r,n,a){for(var o="Polygon"===G[t.type],s=e.length;2<=s&&e[s-1].equals(e[s-2]);)s--;for(var l=0;l<s-1&&e[l].equals(e[l+1]);)l++;if(!(s<(o?3:2))){"bevel"===i&&(n=1.05);var u,c,d,h=U/(512*this.overscaling)*15,p=e[l],f=this.segments.prepareSegment(10*s,this.layoutVertexArray,this.indexArray),m=r,g=o?"butt":r,y=!(this.distance=0),v=void 0,_=void 0,C=void 0,x=void 0;this.e1=this.e2=this.e3=-1,o&&(u=e[s-2],x=p.sub(u)._unit()._perp());for(var b=l;b<s;b++)if(!(_=o&&b===s-1?e[l+1]:e[b+1])||!e[b].equals(_)){x&&(C=x),u&&(v=u),u=e[b],x=_?_.sub(u)._unit()._perp():C;var A=(C=C||x).add(x);0===A.x&&0===A.y||A._unit();var S=A.x*x.x+A.y*x.y,w=0!=S?1/S:1/0,E=S<$&&v&&_;if(E&&l<b){var T=u.dist(v);if(2*h<T){var P=u.sub(u.sub(v)._mult(h/T)._round());this.distance+=P.dist(v),this.addCurrentVertex(P,this.distance,C.mult(1),0,0,!1,f),v=P}}var M=v&&_,D=M?i:_?m:g;if(M&&"round"===D&&(w<a?D="miter":w<=2&&(D="fakeround")),"miter"===D&&n<w&&(D="bevel"),"bevel"===D&&(2<w&&(D="flipbevel"),w<n&&(D="miter")),v&&(this.distance+=u.dist(v)),"miter"===D)A._mult(w),this.addCurrentVertex(u,this.distance,A,0,0,!1,f);else if("flipbevel"===D){if(100<w)A=x.clone().mult(-1);else{var I=0<C.x*x.y-C.y*x.x?-1:1,O=w*C.add(x).mag()/C.sub(x).mag();A._perp()._mult(O*I)}this.addCurrentVertex(u,this.distance,A,0,0,!1,f),this.addCurrentVertex(u,this.distance,A.mult(-1),0,0,!1,f)}else if("bevel"===D||"fakeround"===D){var R=0<C.x*x.y-C.y*x.x,L=-Math.sqrt(w*w-1);if(R?(d=0,c=L):(c=0,d=L),y||this.addCurrentVertex(u,this.distance,C,c,d,!1,f),"fakeround"===D){for(var N=Math.floor(8*(.5-(S-.5))),k=void 0,B=0;B<N;B++)k=x.mult((B+1)/(N+1))._add(C)._unit(),this.addPieSliceVertex(u,this.distance,k,R,f);this.addPieSliceVertex(u,this.distance,A,R,f);for(var F=N-1;0<=F;F--)k=C.mult((F+1)/(N+1))._add(x)._unit(),this.addPieSliceVertex(u,this.distance,k,R,f)}_&&this.addCurrentVertex(u,this.distance,x,-c,-d,!1,f)}else"butt"===D?(y||this.addCurrentVertex(u,this.distance,C,0,0,!1,f),_&&this.addCurrentVertex(u,this.distance,x,0,0,!1,f)):"square"===D?(y||(this.addCurrentVertex(u,this.distance,C,1,1,!1,f),this.e1=this.e2=-1),_&&this.addCurrentVertex(u,this.distance,x,-1,-1,!1,f)):"round"===D&&(y||(this.addCurrentVertex(u,this.distance,C,0,0,!1,f),this.addCurrentVertex(u,this.distance,C,1,1,!0,f),this.e1=this.e2=-1),_&&(this.addCurrentVertex(u,this.distance,x,-1,-1,!0,f),this.addCurrentVertex(u,this.distance,x,0,0,!1,f)));if(E&&b<s-1){var V=u.dist(_);if(2*h<V){var z=u.add(_.sub(u)._mult(h/V)._round());this.distance+=z.dist(u),this.addCurrentVertex(z,this.distance,x.mult(1),0,0,!1,f),u=z}}y=!1}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t)}}},{key:"addCurrentVertex",value:function(e,t,i,r,n,a,o){var s,l=this.layoutVertexArray,u=this.indexArray;s=i.clone(),r&&s._sub(i.perp()._mult(r)),d(l,e,s,a,!1,r,t),this.e3=o.vertexLength++,0<=this.e1&&0<=this.e2&&(u.emplaceBack(this.e1,this.e2,this.e3),o.primitiveLength++),this.e1=this.e2,this.e2=this.e3,s=i.mult(-1),n&&s._sub(i.perp()._mult(n)),d(l,e,s,a,!0,-n,t),this.e3=o.vertexLength++,0<=this.e1&&0<=this.e2&&(u.emplaceBack(this.e1,this.e2,this.e3),o.primitiveLength++),this.e1=this.e2,this.e2=this.e3,c/2<t&&(this.distance=0,this.addCurrentVertex(e,this.distance,i,r,n,a,o))}},{key:"addPieSliceVertex",value:function(e,t,i,r,n){i=i.mult(r?-1:1);var a=this.layoutVertexArray,o=this.indexArray;d(a,e,i,!1,r,0,t),this.e3=n.vertexLength++,0<=this.e1&&0<=this.e2&&(o.emplaceBack(this.e1,this.e2,this.e3),n.primitiveLength++),r?this.e2=this.e3:this.e1=this.e3}}]),p);function p(e){!function(e){if(!(e instanceof p))throw new TypeError("Cannot call a class as a function")}(this),this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(function(e){return e.id}),this.index=e.index,this.layoutVertexArray=new r,this.indexArray=new s,this.programConfigurations=new o(n,e.layers,e.zoom),this.segments=new a}l("LineBucket",u,{omit:["layers"]}),e.exports=u},function(e,t,i){var r=i(23).createLayout;e.exports=r([{name:"a_pos_normal",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4)},function(e,t,i){var n=i(106);function r(e,t,i){if(3===e){var r=new n(i,i.readVarint()+i.pos);r.length&&(t[r.name]=r)}}e.exports=function(e,t){this.layers=e.readFields(r,{},t)}},function(e,t,i){var r=i(13),n=i(4),a=n.Properties,o=n.DataConstantProperty,s=n.DataDrivenProperty,l=n.CrossFadedProperty,u=(n.HeatmapColorProperty,new a({"line-cap":new o(r.layout_line["line-cap"]),"line-join":new s(r.layout_line["line-join"]),"line-miter-limit":new o(r.layout_line["line-miter-limit"]),"line-round-limit":new o(r.layout_line["line-round-limit"])})),c=new a({"line-opacity":new s(r.paint_line["line-opacity"]),"line-color":new s(r.paint_line["line-color"]),"line-translate":new o(r.paint_line["line-translate"]),"line-translate-anchor":new o(r.paint_line["line-translate-anchor"]),"line-width":new s(r.paint_line["line-width"]),"line-gap-width":new s(r.paint_line["line-gap-width"]),"line-offset":new s(r.paint_line["line-offset"]),"line-blur":new s(r.paint_line["line-blur"]),"line-dasharray":new l(r.paint_line["line-dasharray"]),"line-pattern":new l(r.paint_line["line-pattern"])});e.exports={paint:c,layout:u}},function(e,t,i){function r(e){return(r="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})(e)}function n(e,t,i){return(n="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,i){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=a(e)););return e}(e,t);if(r){var n=Object.getOwnPropertyDescriptor(r,t);return n.get?n.get.call(i):n.value}})(e,t,i||e)}function a(e){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function o(e,t){return(o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var s=i(19),l=i(62),u=i(179),c=i(30).isExpression,d=i(1),h=i(51),p=i(4),f=(p.Transitionable,p.Transitioning,p.Layout,p.PossiblyEvaluated,function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&o(e,t)}(m,s),function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(m.prototype,[{key:"recalculate",value:function(e){n(a(m.prototype),"recalculate",this).call(this,e),"auto"===this.layout.get("icon-rotation-alignment")&&("line"===this.layout.get("symbol-placement")?this.layout._values["icon-rotation-alignment"]="map":this.layout._values["icon-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-rotation-alignment")&&("line"===this.layout.get("symbol-placement")?this.layout._values["text-rotation-alignment"]="map":this.layout._values["text-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment"))}},{key:"getValueAndResolveTokens",value:function(e,t){var i=this.layout.get(e).evaluate(t),r=this._unevaluatedLayout._values[e];return r.isDataDriven()||c(r.value)?i:u(t.properties,i)}},{key:"createBucket",value:function(e){return new l(e)}},{key:"queryRadius",value:function(){return 0}},{key:"queryIntersectsFeature",value:function(){return d(!1),!1}}]),m);function m(e){return function(e){if(!(e instanceof m))throw new TypeError("Cannot call a class as a function")}(this),function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,a(m).call(this,e,h))}e.exports=f},function(e,t,i){var r=i(23).createLayout,n={symbolLayoutAttributes:r([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"}]),dynamicLayoutAttributes:r([{name:"a_projected_pos",components:3,type:"Float32"}],4),placementOpacityAttributes:r([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),collisionVertexAttributes:r([{name:"a_placed",components:2,type:"Uint8"}],4),collisionBox:r([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"},{type:"Int16",name:"radius"},{type:"Int16",name:"signedDistanceFromAnchor"}]),collisionBoxLayout:r([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),collisionCircleLayout:r([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),placement:r([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"hidden"}]),glyphOffset:r([{type:"Float32",name:"offsetX"}]),lineVertex:r([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}])};e.exports=n},function(e,t,i){var n=i(49);e.exports=function(e,t,i){var r=t.layout.get("text-transform").evaluate(i);return"uppercase"===r?e=e.toLocaleUpperCase():"lowercase"===r&&(e=e.toLocaleLowerCase()),n.applyArabicShaping&&(e=n.applyArabicShaping(e)),e}},function(e,t){e.exports=function(t){var n={},a={},o=[],i=0;function e(e){o.push(t[e]),i++}function r(e,t,i){var r=a[e];return delete a[e],a[t]=r,o[r].geometry[0].pop(),o[r].geometry[0]=o[r].geometry[0].concat(i[0]),r}function s(e,t,i){var r=n[t];return delete n[t],n[e]=r,o[r].geometry[0].shift(),o[r].geometry[0]=i[0].concat(o[r].geometry[0]),r}function l(e,t,i){var r=i?t[0][t[0].length-1]:t[0][0];return"".concat(e,":").concat(r.x,":").concat(r.y)}for(var u=0;u<t.length;u++){var c=t[u],d=c.geometry,h=c.text;if(h){var p=l(h,d),f=l(h,d,!0);if(p in a&&f in n&&a[p]!==n[f]){var m=s(p,f,d),g=r(p,f,o[m].geometry);delete n[p],delete a[f],a[l(h,o[g].geometry,!0)]=g,o[m].geometry=null}else p in a?r(p,f,d):f in n?s(p,f,d):(e(u),n[p]=i-1,a[f]=i-1)}else e(u)}return o.filter(function(e){return e.geometry})}},function(e,t,i){function a(e){return(a="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})(e)}function o(e){return(o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var n=i(3),s=i(11).register,l=(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)}(u,n),function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(u.prototype,[{key:"clone",value:function(){return new u(this.x,this.y,this.angle,this.segment)}}]),u);function u(e,t,i,r){var n;return function(e){if(!(e instanceof u))throw new TypeError("Cannot call a class as a function")}(this),(n=function(e,t){return!t||"object"!==a(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,o(u).call(this,e,t))).angle=i,void 0!==r&&(n.segment=r),n}s("Anchor",l),e.exports=l},function(e,t){e.exports=function(i,e){return e.replace(/{([^{}]+)}/g,function(e,t){return t in i?String(i[t]):""}).replace(/FORMAT_NUMBER\(([^\)]+)\)/g,function(e,t){return function(e){e=e.split(",");var t=parseFloat(e[0]);return e[2]&&(t*=parseFloat(e[2])),t<1e3?Math.round(t):t<1e5?(t/1e3).toFixed(1)+"K":t<1e6?Math.round(t/1e3)+"K":t<1e9?(t/1e6).toFixed(2)+"M":t<1e12?(t=Math.round(t/1e6).toFixed(0)).slice(0,-3)+","+t.slice(-4,-1)+"M":"HUGE_NUM"}(t)})}},function(e,t,i){function r(e){return(r="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})(e)}function n(e){return(n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function a(e,t){return(a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var o=i(19),s=i(181),l=i(4),u=(l.Transitionable,l.Transitioning,l.PossiblyEvaluated,function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(c,o),c);function c(e){return function(e){if(!(e instanceof c))throw new TypeError("Cannot call a class as a function")}(this),function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,n(c).call(this,e,s))}e.exports=u},function(e,t,i){var r=i(13),n=i(4),a=n.Properties,o=n.DataConstantProperty,s=(n.DataDrivenProperty,n.CrossFadedProperty),l=(n.HeatmapColorProperty,new a({"background-color":new o(r.paint_background["background-color"]),"background-pattern":new s(r.paint_background["background-pattern"]),"background-opacity":new o(r.paint_background["background-opacity"])}));e.exports={paint:l}},function(e,t,i){function r(e){return(r="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})(e)}function n(e){return(n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function a(e,t){return(a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var o=i(19),s=i(183),l=i(4),u=(l.Transitionable,l.Transitioning,l.PossiblyEvaluated,function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(c,o),c);function c(e){return function(e){if(!(e instanceof c))throw new TypeError("Cannot call a class as a function")}(this),function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,n(c).call(this,e,s))}e.exports=u},function(e,t,i){var r=i(13),n=i(4),a=n.Properties,o=n.DataConstantProperty,s=(n.DataDrivenProperty,n.CrossFadedProperty,n.HeatmapColorProperty,new a({"raster-opacity":new o(r.paint_raster["raster-opacity"]),"raster-hue-rotate":new o(r.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new o(r.paint_raster["raster-brightness-min"]),"raster-brightness-max":new o(r.paint_raster["raster-brightness-max"]),"raster-saturation":new o(r.paint_raster["raster-saturation"]),"raster-contrast":new o(r.paint_raster["raster-contrast"]),"raster-fade-duration":new o(r.paint_raster["raster-fade-duration"])}));e.exports={paint:s}},function(e,t,i){var n=i(16),m=i(2),a=i(34).normalizeSpriteURL,g=i(33).RGBAImage;e.exports=function(e,t,d){var h,p,f,i=1<m.devicePixelRatio?"@2x":"";function r(){if(f)d(f);else if(h&&p){var e=m.getImageData(p),t={};for(var i in h){var r=h[i],n=r.width,a=r.height,o=r.x,s=r.y,l=r.sdf,u=r.pixelRatio,c=new g({width:n,height:a});g.copy(e,c,{x:o,y:s},{x:0,y:0},{width:n,height:a}),t[i]={data:c,pixelRatio:u,sdf:l}}d(null,t)}}n.getJSON(t(a(e,i,".json"),n.ResourceType.SpriteJSON),function(e,t){f||(f=e,h=t,r())}),n.getImage(t(a(e,i,".png"),n.ResourceType.SpriteImage),function(e,t){f||(f=e,p=t,r())})}},function(e,t,i){var r=i(111),p=i(33).RGBAImage,f=i(186).imagePosition,n=i(20),a=i(1),o=(function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(s.prototype,[{key:"isLoaded",value:function(){return this.loaded}},{key:"setLoaded",value:function(e){if(this.loaded!==e&&(this.loaded=e)){var t=!0,i=!1,r=void 0;try{for(var n,a=this.requestors[Symbol.iterator]();!(t=(n=a.next()).done);t=!0){var o=n.value,s=o.ids,l=o.callback;this._notify(s,l)}}catch(e){i=!0,r=e}finally{try{t||null==a.return||a.return()}finally{if(i)throw r}}this.requestors=[]}}},{key:"getImage",value:function(e){return this.images[e]}},{key:"addImage",value:function(e,t){a(!this.images[e]),this.images[e]=t}},{key:"removeImage",value:function(e){a(this.images[e]),delete this.images[e];var t=this.patterns[e];t&&(this.shelfPack.unref(t.bin),delete this.patterns[e])}},{key:"getImages",value:function(e,t){var i=!0;if(!this.isLoaded()){var r=!0,n=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(r=(o=s.next()).done);r=!0){var l=o.value;this.images[l]||(i=!1)}}catch(e){n=!0,a=e}finally{try{r||null==s.return||s.return()}finally{if(n)throw a}}}this.isLoaded()||i?this._notify(e,t):this.requestors.push({ids:e,callback:t})}},{key:"_notify",value:function(e,t){var i={},r=!0,n=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(r=(o=s.next()).done);r=!0){var l=o.value,u=this.images[l];u&&(i[l]={data:u.data.clone(),pixelRatio:u.pixelRatio,sdf:u.sdf})}}catch(e){n=!0,a=e}finally{try{r||null==s.return||s.return()}finally{if(n)throw a}}t(null,i)}},{key:"getPixelSize",value:function(){return{width:this.shelfPack.w,height:this.shelfPack.h}}},{key:"getPattern",value:function(e){var t=this.patterns[e];if(t)return t.position;var i=this.getImage(e);if(!i)return null;var r=i.data.width+2,n=i.data.height+2,a=this.shelfPack.packOne(r,n);if(!a)return null;this.atlasImage.resize(this.getPixelSize());var o=i.data,s=this.atlasImage,l=a.x+1,u=a.y+1,c=o.width,d=o.height;p.copy(o,s,{x:0,y:0},{x:l,y:u},{width:c,height:d}),p.copy(o,s,{x:0,y:d-1},{x:l,y:u-1},{width:c,height:1}),p.copy(o,s,{x:0,y:0},{x:l,y:u+d},{width:c,height:1}),p.copy(o,s,{x:c-1,y:0},{x:l-1,y:u},{width:1,height:d}),p.copy(o,s,{x:0,y:0},{x:l+c,y:u},{width:1,height:d}),this.dirty=!0;var h=f(a,i);return this.patterns[e]={bin:a,position:h},h}},{key:"bind",value:function(e){var t=e.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new n(e,this.atlasImage,t.RGBA),this.atlasTexture.bind(t.LINEAR,t.CLAMP_TO_EDGE)}}]),s);function s(){!function(e){if(!(e instanceof s))throw new TypeError("Cannot call a class as a function")}(this),this.images={},this.loaded=!1,this.requestors=[],this.shelfPack=new r(64,64,{autoResize:!0}),this.patterns={},this.atlasImage=new p({width:64,height:64}),this.dirty=!0}e.exports=o},function(e,t,i){var s=i(111),l=i(33).RGBAImage;function u(e,t){var i=t.pixelRatio,r={x:e.x+1,y:e.y+1,w:e.w-2,h:e.h-2};return{pixelRatio:i,textureRect:r,tl:[r.x,r.y],br:[r.x+r.w,r.y+r.h],displaySize:[r.w/i,r.h/i]}}e.exports={imagePosition:u,makeImageAtlas:function(e){var t=new l({width:0,height:0}),i={},r=new s(0,0,{autoResize:!0});for(var n in e){var a=e[n],o=r.packOne(a.data.width+2,a.data.height+2);t.resize({width:r.w,height:r.h}),l.copy(a.data,t,{x:0,y:0},{x:o.x+1,y:o.y+1},a.data),i[n]=u(o,a)}return r.shrink(),t.resize({width:r.w,height:r.h}),{image:t,positions:i}}}},function(e,t,i){var d=i(188),o=i(191),s=i(109),c=i(0).asyncAll,l=i(33).AlphaImage,r=(function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(n.prototype,[{key:"setURL",value:function(e){this.url=e}},{key:"getGlyphs",value:function(e,h){var a=this,t=[];for(var i in e){var r=!0,n=!1,o=void 0;try{for(var s,l=e[i][Symbol.iterator]();!(r=(s=l.next()).done);r=!0){var u=s.value;t.push({stack:i,id:u})}}catch(e){n=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(n)throw o}}}c(t,function(e,i){var r=e.stack,n=e.id,l=a.entries[r],t=(l=l||(a.entries[r]={glyphs:{},requests:{}})).glyphs[n];if(void 0===t)if(t=a._tinySDF(l,r,n))i(null,{stack:r,id:n,glyph:t});else{var u=Math.floor(n/256);if(65535<256*u)i(new Error("glyphs > 65535 not supported"));else{var c=l.requests[u];c||(c=l.requests[u]=[],d(r,u,a.url,a.requestTransform,function(e,t){if(t)for(var i in t)l.glyphs[+i]=t[+i];var r=!0,n=!1,a=void 0;try{for(var o,s=c[Symbol.iterator]();!(r=(o=s.next()).done);r=!0)(0,o.value)(e,t)}catch(e){n=!0,a=e}finally{try{r||null==s.return||s.return()}finally{if(n)throw a}}delete l.requests[u]})),c.push(function(e,t){e?i(e):t&&i(null,{stack:r,id:n,glyph:t[n]||null})})}}else i(null,{stack:r,id:n,glyph:t})},function(e,t){if(e)h(e);else if(t){var i={},r=!0,n=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(r=(o=s.next()).done);r=!0){var l=o.value,u=l.stack,c=l.id,d=l.glyph;(i[u]||(i[u]={}))[c]=d&&{id:d.id,bitmap:d.bitmap.clone(),metrics:d.metrics}}}catch(e){n=!0,a=e}finally{try{r||null==s.return||s.return()}finally{if(n)throw a}}h(null,i)}})}},{key:"_tinySDF",value:function(e,t,i){var r=this.localIdeographFontFamily;if(r&&(s["CJK Unified Ideographs"](i)||s["Hangul Syllables"](i))){var n=e.tinySDF;if(!n){var a="400";/bold/i.test(t)?a="900":/medium/i.test(t)?a="500":/light/i.test(t)&&(a="200"),n=e.tinySDF=new o(24,3,8,.25,r,a)}return{id:i,bitmap:new l({width:30,height:30},n.draw(String.fromCharCode(i))),metrics:{width:24,height:24,left:0,top:-8,advance:24}}}}}]),n);function n(e,t){!function(e){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}(this),this.requestTransform=e,this.localIdeographFontFamily=t,this.entries={}}e.exports=r},function(e,t,i){var s=i(34).normalizeGlyphsURL,l=i(16),c=i(189);e.exports=function(e,t,i,r,u){var n=256*t,a=255+n,o=r(s(i).replace("{fontstack}",e).replace("{range}","".concat(n,"-").concat(a)),l.ResourceType.Glyphs);l.getArrayBuffer(o,function(e,t){if(e)u(e);else if(t){var i={},r=!0,n=!1,a=void 0;try{for(var o,s=c(t.data)[Symbol.iterator]();!(r=(o=s.next()).done);r=!0){var l=o.value;i[l.id]=l}}catch(e){n=!0,a=e}finally{try{r||null==s.return||s.return()}finally{if(n)throw a}}u(null,i)}})}},function(e,t,i){var d=i(33).AlphaImage,r=i(65),h=3;function n(e,t,i){1===e&&i.readMessage(a,t)}function a(e,t,i){if(3===e){var r=i.readMessage(p,{}),n=r.id,a=r.bitmap,o=r.width,s=r.height,l=r.left,u=r.top,c=r.advance;t.push({id:n,bitmap:new d({width:o+2*h,height:s+2*h},a),metrics:{width:o,height:s,left:l,top:u,advance:c}})}}function p(e,t,i){1===e?t.id=i.readVarint():2===e?t.bitmap=i.readBytes():3===e?t.width=i.readVarint():4===e?t.height=i.readVarint():5===e?t.left=i.readSVarint():6===e?t.top=i.readSVarint():7===e&&(t.advance=i.readVarint())}e.exports=function(e){return new r(e).readFields(n,[])},e.exports.GLYPH_PBF_BORDER=h},function(e,t){t.read=function(e,t,i,r,n){var a,o,s=8*n-r-1,l=(1<<s)-1,u=l>>1,c=-7,d=i?n-1:0,h=i?-1:1,p=e[t+d];for(d+=h,a=p&(1<<-c)-1,p>>=-c,c+=s;0<c;a=256*a+e[t+d],d+=h,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=r;0<c;o=256*o+e[t+d],d+=h,c-=8);if(0===a)a=1-u;else{if(a===l)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,r),a-=u}return(p?-1:1)*o*Math.pow(2,a-r)},t.write=function(e,t,i,r,n,a){var o,s,l,u=8*a-n-1,c=(1<<u)-1,d=c>>1,h=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:a-1,f=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=c):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),2<=(t+=1<=o+d?h/l:h*Math.pow(2,1-d))*l&&(o++,l/=2),c<=o+d?(s=0,o=c):1<=o+d?(s=(t*l-1)*Math.pow(2,n),o+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,n),o=0));8<=n;e[i+p]=255&s,p+=f,s/=256,n-=8);for(o=o<<n|s,u+=n;0<u;e[i+p]=255&o,p+=f,o/=256,u-=8);e[i+p-f]|=128*m}},function(e,t,i){e.exports=r,e.exports.default=r;var l=1e20;function r(e,t,i,r,n,a){this.fontSize=e||24,this.buffer=void 0===t?3:t,this.cutoff=r||.25,this.fontFamily=n||"sans-serif",this.fontWeight=a||"normal",this.radius=i||8;var o=this.size=this.fontSize+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=o,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textBaseline="middle",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(o*o),this.gridInner=new Float64Array(o*o),this.f=new Float64Array(o),this.d=new Float64Array(o),this.z=new Float64Array(o+1),this.v=new Int16Array(o),this.middle=Math.round(o/2*(0<=navigator.userAgent.indexOf("Gecko/")?1.2:1))}function o(e,t,i,r,n,a,o){for(var s=0;s<t;s++){for(var l=0;l<i;l++)r[l]=e[l*t+s];for(u(r,n,a,o,i),l=0;l<i;l++)e[l*t+s]=n[l]}for(l=0;l<i;l++){for(s=0;s<t;s++)r[s]=e[l*t+s];for(u(r,n,a,o,t),s=0;s<t;s++)e[l*t+s]=Math.sqrt(n[s])}}function u(e,t,i,r,n){r[i[0]=0]=-l,r[1]=+l;for(var a=1,o=0;a<n;a++){for(var s=(e[a]+a*a-(e[i[o]]+i[o]*i[o]))/(2*a-2*i[o]);s<=r[o];)o--,s=(e[a]+a*a-(e[i[o]]+i[o]*i[o]))/(2*a-2*i[o]);i[++o]=a,r[o]=s,r[o+1]=+l}for(o=a=0;a<n;a++){for(;r[o+1]<a;)o++;t[a]=(a-i[o])*(a-i[o])+e[i[o]]}}r.prototype.draw=function(e){this.ctx.clearRect(0,0,this.size,this.size),this.ctx.fillText(e,this.buffer,this.middle);for(var t=this.ctx.getImageData(0,0,this.size,this.size),i=new Uint8ClampedArray(this.size*this.size),r=0;r<this.size*this.size;r++){var n=t.data[4*r+3]/255;this.gridOuter[r]=1==n?0:0==n?l:Math.pow(Math.max(0,.5-n),2),this.gridInner[r]=1==n?l:0==n?0:Math.pow(Math.max(0,n-.5),2)}for(o(this.gridOuter,this.size,this.size,this.f,this.d,this.v,this.z),o(this.gridInner,this.size,this.size,this.f,this.d,this.v,this.z),r=0;r<this.size*this.size;r++){var a=this.gridOuter[r]-this.gridInner[r];i[r]=Math.max(0,Math.min(255,Math.round(255-255*(a/this.radius+this.cutoff))))}return i}},function(e,t,i){function r(e){return(r="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})(e)}function n(e){return(n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function a(e,t){return(a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function l(e,t,i){return t&&s(e.prototype,t),i&&s(e,i),e}var u=i(13),c=i(0),d=i(10),h=i(54),p=i(0).sphericalToCartesian,f=(i(12),i(26)),m=i(4),g=m.Properties,y=m.Transitionable,v=(m.Transitioning,m.PossiblyEvaluated,m.DataConstantProperty),_=(l(A,[{key:"possiblyEvaluate",value:function(e,t){return p(e.expression.evaluate(t))}},{key:"interpolate",value:function(e,t,i){return{x:f.number(e.x,t.x,i),y:f.number(e.y,t.y,i),z:f.number(e.z,t.z,i)}}}]),A),C=new g({anchor:new v(u.light.anchor),position:new _,color:new v(u.light.color),intensity:new v(u.light.intensity)}),x=(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(b,d),l(b,[{key:"getLight",value:function(){return this._transitionable.serialize()}},{key:"setLight",value:function(e){if(!this._validate(h.light,e))for(var t in e){var i=e[t];c.endsWith(t,"-transition")?this._transitionable.setTransition(t.slice(0,-"-transition".length),i):this._transitionable.setValue(t,i)}}},{key:"updateTransitions",value:function(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}},{key:"hasTransition",value:function(){return this._transitioning.hasTransition()}},{key:"recalculate",value:function(e){this.properties=this._transitioning.possiblyEvaluate(e)}},{key:"_validate",value:function(e,t){return h.emitErrors(this,e.call(h,c.extend({value:t,style:{glyphs:!0,sprite:!0},styleSpec:u})))}}]),b);function b(e){var t;return o(this,b),(t=function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,n(b).call(this)))._transitionable=new y(C),t.setLight(e),t._transitioning=t._transitionable.untransitioned(),t}function A(){o(this,A),this.specification=u.light.position}e.exports=x},function(e,t,i){var S=i(0),r=(function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(n.prototype,[{key:"getDash",value:function(e,t){var i=e.join(",")+String(t);return this.positions[i]||(this.positions[i]=this.addDash(e,t)),this.positions[i]}},{key:"addDash",value:function(e,t){var i=t?7:0,r=2*i+1;if(this.nextRow+r>this.height)return S.warnOnce("LineAtlas out of space"),null;for(var n=0,a=0;a<e.length;a++)n+=e[a];for(var o=this.width/n,s=o/2,l=e.length%2==1,u=-i;u<=i;u++)for(var c=this.nextRow+i+u,d=this.width*c,h=l?-e[e.length-1]:0,p=e[0],f=1,m=0;m<this.width;m++){for(;p<m/o;)h=p,p+=e[f],l&&f===e.length-1&&(p+=e[0]),f++;var g=Math.abs(m-h*o),y=Math.abs(m-p*o),v=Math.min(g,y),_=f%2==1,C=void 0;if(t){var x=i?u/i*(1+s):0;if(_){var b=s-Math.abs(x);C=Math.sqrt(v*v+b*b)}else C=s-Math.sqrt(v*v+x*x)}else C=(_?1:-1)*v;this.data[3+4*(d+m)]=Math.max(0,Math.min(255,C+128))}var A={y:(this.nextRow+i+.5)/this.height,height:2*i/this.height,width:n};return this.nextRow+=r,this.dirty=!0,A}},{key:"bind",value:function(e){var t=e.gl;this.texture?(t.bindTexture(t.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,t.texSubImage2D(t.TEXTURE_2D,0,0,0,this.width,this.height,t.RGBA,t.UNSIGNED_BYTE,this.data))):(this.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,this.width,this.height,0,t.RGBA,t.UNSIGNED_BYTE,this.data))}}]),n);function n(e,t){!function(e){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}(this),this.width=e,this.height=t,this.nextRow=0,this.bytes=4,this.data=new Uint8Array(this.width*this.height*this.bytes),this.positions={}}e.exports=r},function(e,t,i){var o=i(0),s=i(195),r=(function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(l.prototype,[{key:"broadcast",value:function(i,r,e){e=e||function(){},o.asyncAll(this.actors,function(e,t){e.send(i,r,t)},e)}},{key:"send",value:function(e,t,i,r){return"number"==typeof r&&!isNaN(r)||(r=this.currentActor=(this.currentActor+1)%this.actors.length),this.actors[r].send(e,t,i),r}},{key:"remove",value:function(){this.actors.forEach(function(e){e.remove()}),this.actors=[],this.workerPool.release(this.id)}}]),l);function l(e,t){!function(e){if(!(e instanceof l))throw new TypeError("Cannot call a class as a function")}(this),this.workerPool=e,this.actors=[],this.currentActor=0,this.id=o.uniqueId();for(var i=this.workerPool.acquire(this.id),r=0;r<i.length;r++){var n=i[r],a=new s(n,t,this.id);a.name="Worker ".concat(r),this.actors.push(a)}}e.exports=r},function(e,t,i){var r=i(0),n=i(11),s=n.serialize,l=n.deserialize,a=(function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(o.prototype,[{key:"send",value:function(e,t,i,r){var n=i?"".concat(this.mapId,":").concat(this.callbackID++):null;i&&(this.callbacks[n]=i);var a=[];this.target.postMessage({targetMapId:r,sourceMapId:this.mapId,type:e,id:String(n),data:s(t,a)},a)}},{key:"receive",value:function(e){var t,r=this,i=e.data,n=i.id;if(!i.targetMapId||this.mapId===i.targetMapId){var a=function(e,t){var i=[];r.target.postMessage({sourceMapId:r.mapId,type:"<response>",id:String(n),error:e?String(e):null,data:s(t,i)},i)};if("<response>"===i.type)t=this.callbacks[i.id],delete this.callbacks[i.id],t&&i.error?t(new Error(i.error)):t&&t(null,l(i.data));else if(void 0!==i.id&&this.parent[i.type])this.parent[i.type](i.sourceMapId,l(i.data),a);else if(void 0!==i.id&&this.parent.getWorkerSource){var o=i.type.split(".");this.parent.getWorkerSource(i.sourceMapId,o[0])[o[1]](l(i.data),a)}else this.parent[i.type](l(i.data))}}},{key:"remove",value:function(){this.target.removeEventListener("message",this.receive,!1)}}]),o);function o(e,t,i){!function(e){if(!(e instanceof o))throw new TypeError("Cannot call a class as a function")}(this),this.target=e,this.parent=t,this.mapId=i,this.callbacks={},this.callbackID=0,r.bindAll(["receive"],this),this.target.addEventListener("message",this.receive,!1)}e.exports=a},function(e,t,i){function s(e){return(s="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})(e)}function l(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var n=i(10),c=i(0),a=i(112),o=i(34).normalizeTileURL,d=i(113),h=i(16).ResourceType,p=i(2),f=(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)}(m,n),function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(m.prototype,[{key:"load",value:function(){var i=this;this.fire("dataloading",{dataType:"source"}),a(this._options,this.map._transformRequest,function(e,t){e?i.fire("error",e):t&&(c.extend(i,t),t.bounds&&(i.tileBounds=new d(t.bounds,i.minzoom,i.maxzoom)),i.fire("data",{dataType:"source",sourceDataType:"metadata"}),i.fire("data",{dataType:"source",sourceDataType:"content"}))})}},{key:"hasTile",value:function(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}},{key:"onAdd",value:function(e){this.map=e,this.load()}},{key:"serialize",value:function(){return c.extend({},this._options)}},{key:"loadTile",value:function(i,r){var e=i.tileID.overscaleFactor(),t=o(i.tileID.canonical.url(this.tiles,this.scheme),this.url),n={request:this.map._transformRequest(t,h.Tile),uid:i.uid,tileID:i.tileID,zoom:i.tileID.overscaledZ,tileSize:this.tileSize*e,type:this.type,source:this.id,pixelRatio:p.devicePixelRatio,overscaling:e,showCollisionBoxes:this.map.showCollisionBoxes};function a(e,t){return i.aborted?r(null):e?r(e):(this.map._refreshExpiredTiles&&i.setExpiryData(t),i.loadVectorData(t,this.map.painter),r(null),void(i.reloadCallback&&(this.loadTile(i,i.reloadCallback),i.reloadCallback=null)))}void 0===i.workerID||"expired"===i.state?i.workerID=this.dispatcher.send("loadTile",n,a.bind(this)):"loading"===i.state?i.reloadCallback=r:this.dispatcher.send("reloadTile",n,a.bind(this),i.workerID)}},{key:"abortTile",value:function(e){this.dispatcher.send("abortTile",{uid:e.uid,type:this.type,source:this.id},void 0,e.workerID)}},{key:"unloadTile",value:function(e){e.unloadVectorData(),this.dispatcher.send("removeTile",{uid:e.uid,type:this.type,source:this.id},void 0,e.workerID),e.workerID=void 0}},{key:"hasTransition",value:function(){return!1}}]),m);function m(e,t,i,r){var n,a,o;if(function(e){if(!(e instanceof m))throw new TypeError("Cannot call a class as a function")}(this),(a=this,n=!(o=l(m).call(this))||"object"!==s(o)&&"function"!=typeof o?u(a):o).id=e,n.dispatcher=i,n.type="vector",n.minzoom=0,n.maxzoom=22,n.scheme="xyz",n.tileSize=512,n.reparseOverscaled=!0,n.isTileClipped=!0,c.extend(u(n),c.pick(t,["url","scheme","tileSize"])),n._options=c.extend({type:"vector"},t),512!==n.tileSize)throw new Error("vector tile sources must have a tileSize of 512");return n.setEventedParent(r),n}e.exports=f},function(e,t,i){function a(e){return(a="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})(e)}function o(e){return(o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var s=i(16),l=i(0),u=(i(10),i(34).normalizeTileURL),c=i(2),d=i(27).OverscaledTileID,n=(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)}(h,i(114)),function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(h.prototype,[{key:"serialize",value:function(){return{type:"raster-dem",url:this.url,tileSize:this.tileSize,tiles:this.tiles,bounds:this.bounds}}},{key:"loadTile",value:function(n,a){var e=u(n.tileID.canonical.url(this.tiles,this.scheme),this.url,this.tileSize);n.request=s.getImage(this.map._transformRequest(e,s.ResourceType.Tile),function(e,t){if(delete n.request,n.aborted)n.state="unloaded",a(null);else if(e)n.state="errored",a(e);else if(t){this.map._refreshExpiredTiles&&n.setExpiryData(t),delete t.cacheControl,delete t.expires;var i=c.getImageData(t),r={uid:n.uid,coord:n.tileID,source:this.id,rawImageData:i};n.workerID&&"expired"!==n.state||(n.workerID=this.dispatcher.send("loadDEMTile",r,function(e,t){e&&(n.state="errored",a(e)),t&&(n.dem=t,n.needsHillshadePrepare=!0,n.state="loaded",a(null))}.bind(this)))}}.bind(this)),n.neighboringTiles=this._getNeighboringTiles(n.tileID)}},{key:"_getNeighboringTiles",value:function(e){var t=e.canonical,i=Math.pow(2,t.z),r=(t.x-1+i)%i,n=0===t.x?e.wrap-1:e.wrap,a=(t.x+1+i)%i,o=t.x+1===i?e.wrap+1:e.wrap,s={};return s[new d(e.overscaledZ,n,t.z,r,t.y).key]={backfilled:!1},s[new d(e.overscaledZ,o,t.z,a,t.y).key]={backfilled:!1},0<t.y&&(s[new d(e.overscaledZ,n,t.z,r,t.y-1).key]={backfilled:!1},s[new d(e.overscaledZ,e.wrap,t.z,t.x,t.y-1).key]={backfilled:!1},s[new d(e.overscaledZ,o,t.z,a,t.y-1).key]={backfilled:!1}),t.y+1<i&&(s[new d(e.overscaledZ,n,t.z,r,t.y+1).key]={backfilled:!1},s[new d(e.overscaledZ,e.wrap,t.z,t.x,t.y+1).key]={backfilled:!1},s[new d(e.overscaledZ,o,t.z,a,t.y+1).key]={backfilled:!1}),s}},{key:"unloadTile",value:function(e){e.demTexture&&this.map.painter.saveTileTexture(e.demTexture),e.fbo&&(e.fbo.destroy(),delete e.fbo),e.dem&&delete e.dem,delete e.neighboringTiles,e.state="unloaded",this.dispatcher.send("removeDEMTile",{uid:e.uid,source:this.id},void 0,e.workerID)}}]),h);function h(e,t,i,r){var n;return function(e){if(!(e instanceof h))throw new TypeError("Cannot call a class as a function")}(this),(n=function(e,t){return!t||"object"!==a(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,o(h).call(this,e,t,i,r))).type="raster-dem",n.maxzoom=22,n._options=l.extend({},t),n}e.exports=n},function(e,t,i){function r(e,t,i,r,n,a){return a=a||{},e+"?"+["bbox="+o(i,r,n),"format="+(a.format||"image/png"),"service="+(a.service||"WMS"),"version="+(a.version||"1.1.1"),"request="+(a.request||"GetMap"),"srs="+(a.srs||"EPSG:3857"),"width="+(a.width||256),"height="+(a.height||256),"layers="+t].join("&")}function o(e,t,i){var r=a(256*e,256*(t=Math.pow(2,i)-t-1),i),n=a(256*(e+1),256*(t+1),i);return r[0]+","+r[1]+","+n[0]+","+n[1]}function a(e,t,i){var r=2*Math.PI*6378137/256/Math.pow(2,i);return[e*r-2*Math.PI*6378137/2,t*r-2*Math.PI*6378137/2]}i.r(t),i.d(t,"getURL",function(){return r}),i.d(t,"getTileBBox",function(){return o}),i.d(t,"getMercCoords",function(){return a})},function(e,t,i){function a(e){return(a="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})(e)}function o(e){return(o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var n=i(16),s=i(52),l=i(46),u=i(40),c=i(20),d=(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)}(h,s),function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(h.prototype,[{key:"load",value:function(){var i=this,e=this.options;this.urls=e.urls,n.getVideo(e.urls,function(e,t){e?i.fire("error",{error:e}):t&&(i.video=t,i.video.loop=!0,i.video.addEventListener("playing",function(){i.map._rerender()}),i.map&&i.video.play(),i._finishLoading())})}},{key:"getVideo",value:function(){return this.video}},{key:"onAdd",value:function(e){this.map||(this.map=e,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}},{key:"prepare",value:function(){if(!(0===Object.keys(this.tiles).length||this.video.readyState<2)){var e=this.map.painter.context,t=e.gl;for(var i in this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,l.members)),this.boundsVAO||(this.boundsVAO=new u),this.texture?this.video.paused||(this.texture.bind(t.LINEAR,t.CLAMP_TO_EDGE),t.texSubImage2D(t.TEXTURE_2D,0,0,0,t.RGBA,t.UNSIGNED_BYTE,this.video)):(this.texture=new c(e,this.video,t.RGBA),this.texture.bind(t.LINEAR,t.CLAMP_TO_EDGE)),this.tiles){var r=this.tiles[i];"loaded"!==r.state&&(r.state="loaded",r.texture=this.texture)}}}},{key:"serialize",value:function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}},{key:"hasTransition",value:function(){return this.video&&!this.video.paused}}]),h);function h(e,t,i,r){var n;return function(e){if(!(e instanceof h))throw new TypeError("Cannot call a class as a function")}(this),(n=function(e,t){return!t||"object"!==a(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,o(h).call(this,e,t,i,r))).roundZoom=!0,n.type="video",n.options=t,n}e.exports=d},function(e,t,i){function a(e){return(a="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})(e)}function o(e){return(o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var n=i(52),s=i(5),l=i(46),u=i(40),c=i(20),d=(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)}(h,n),function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(h.prototype,[{key:"load",value:function(){this.canvas=this.canvas||s.document.getElementById(this.options.canvas),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire("error",new Error("Canvas dimensions cannot be less than or equal to zero.")):(this.play=function(){this._playing=!0,this.map._rerender()},this.pause=function(){this._playing=!1},this._finishLoading())}},{key:"getCanvas",value:function(){return this.canvas}},{key:"onAdd",value:function(e){this.map=e,this.load(),this.canvas&&this.animate&&this.play()}},{key:"onRemove",value:function(){this.pause()}},{key:"prepare",value:function(){var e=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,e=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,e=!0),!this._hasInvalidDimensions()&&0!==Object.keys(this.tiles).length){var t=this.map.painter.context,i=t.gl;for(var r in this.boundsBuffer||(this.boundsBuffer=t.createVertexBuffer(this._boundsArray,l.members)),this.boundsVAO||(this.boundsVAO=new u),this.texture?e?this.texture.update(this.canvas):this._playing&&(this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE),i.texSubImage2D(i.TEXTURE_2D,0,0,0,i.RGBA,i.UNSIGNED_BYTE,this.canvas)):(this.texture=new c(t,this.canvas,i.RGBA),this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE)),this.tiles){var n=this.tiles[r];"loaded"!==n.state&&(n.state="loaded",n.texture=this.texture)}}}},{key:"serialize",value:function(){return{type:"canvas",canvas:this.canvas,coordinates:this.coordinates}}},{key:"hasTransition",value:function(){return this._playing}},{key:"_hasInvalidDimensions",value:function(){for(var e=0,t=[this.canvas.width,this.canvas.height];e<t.length;e++){var i=t[e];if(isNaN(i)||i<=0)return!0}return!1}}]),h);function h(e,t,i,r){var n;return function(e){if(!(e instanceof h))throw new TypeError("Cannot call a class as a function")}(this),(n=function(e,t){return!t||"object"!==a(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,o(h).call(this,e,t,i,r))).options=t,n.animate=void 0===t.animate||t.animate,n}e.exports=d},function(e,t){e.exports={deserialize:function(e,t){var i={};if(!t)return i;var r=!0,n=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(r=(o=s.next()).done);r=!0){var l=o.value,u=l.layerIds.map(function(e){return t.getLayer(e)}).filter(Boolean);if(0!==u.length){l.layers=u;var c=!0,d=!1,h=void 0;try{for(var p,f=u[Symbol.iterator]();!(c=(p=f.next()).done);c=!0)i[p.value.id]=l}catch(e){d=!0,h=e}finally{try{c||null==f.return||f.return()}finally{if(d)throw h}}}}}catch(e){n=!0,a=e}finally{try{r||null==s.return||s.return()}finally{if(n)throw a}}return i}}},function(e,t,i){i(3);var b=i(38),v=i(6),_=i(60),n=i(102),C=i(203),x=i(48),A=i(65),S=i(119),w=i(0).arraysIntersect,r=(i(27).OverscaledTileID,i(11).register),a=i(14).FeatureIndexArray,o=(function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(s.prototype,[{key:"insert",value:function(e,t,i,r,n){var a=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(i,r,n);for(var o=0;o<t.length;o++){for(var s=t[o],l=[1/0,1/0,-1/0,-1/0],u=0;u<s.length;u++){var c=s[u];l[0]=Math.min(l[0],c.x),l[1]=Math.min(l[1],c.y),l[2]=Math.max(l[2],c.x),l[3]=Math.max(l[3],c.y)}this.grid.insert(a,l[0],l[1],l[2],l[3])}}},{key:"query",value:function(e,t){this.vtLayers||(this.vtLayers=new x.VectorTile(new A(this.rawTileData)).layers,this.sourceLayerCoder=new C(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"]));for(var i={},r=e.params||{},n=v/e.tileSize/e.scale,a=_(r.filter),o=e.queryGeometry,s=e.additionalRadius*n,l=1/0,u=1/0,c=-1/0,d=-1/0,h=0;h<o.length;h++)for(var p=o[h],f=0;f<p.length;f++){var m=p[f];l=Math.min(l,m.x),u=Math.min(u,m.y),c=Math.max(c,m.x),d=Math.max(d,m.y)}var g=this.grid.query(l-s,u-s,c+s,d+s);g.sort(E),this.filterMatching(i,g,this.featureIndexArray,o,a,r.layers,t,e.bearing,n);var y=e.collisionIndex?e.collisionIndex.queryRenderedSymbols(o,this.tileID,v/e.tileSize,e.collisionBoxArray,e.sourceID,e.bucketInstanceIds):[];return y.sort(),this.filterMatching(i,y,e.collisionBoxArray,o,a,r.layers,t,e.bearing,n),i}},{key:"filterMatching",value:function(e,t,i,r,n,a,o,s,l){for(var u,c=0;c<t.length;c++){var d=t[c];if(d!==u){u=d;var h=i.get(d),p=this.bucketLayerIDs[h.bucketIndex];if(!a||w(a,p)){var f=this.sourceLayerCoder.decode(h.sourceLayerIndex),m=this.vtLayers[f].feature(h.featureIndex);if(n({zoom:this.tileID.overscaledZ},m))for(var g=null,y=0;y<p.length;y++){var v=p[y];if(!(a&&a.indexOf(v)<0)){var _=o[v];if(_&&("symbol"===_.type||(g=g||b(m),_.queryIntersectsFeature(r,m,g,this.z,s,l)))){var C=new S(m,this.z,this.x,this.y);C.layer=_.serialize();var x=e[v];void 0===x&&(x=e[v]=[]),x.push({featureIndex:d,feature:C})}}}}}}}},{key:"hasLayer",value:function(e){var t=!0,i=!1,r=void 0;try{for(var n,a=this.bucketLayerIDs[Symbol.iterator]();!(t=(n=a.next()).done);t=!0){var o=n.value,s=!0,l=!1,u=void 0;try{for(var c,d=o[Symbol.iterator]();!(s=(c=d.next()).done);s=!0)if(e===c.value)return!0}catch(e){l=!0,u=e}finally{try{s||null==d.return||d.return()}finally{if(l)throw u}}}}catch(e){i=!0,r=e}finally{try{t||null==a.return||a.return()}finally{if(i)throw r}}return!1}}]),s);function s(e,t,i,r){!function(e){if(!(e instanceof s))throw new TypeError("Cannot call a class as a function")}(this),this.tileID=e,this.overscaling=t,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=i||new n(v,16,0),this.featureIndexArray=r||new a}function E(e,t){return t-e}r("FeatureIndex",o,{omit:["rawTileData","sourceLayerCoder","collisionIndex"]}),e.exports=o},function(e,t,i){var r=i(1),n=(function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(a.prototype,[{key:"encode",value:function(e){return r(e in this._stringToNumber),this._stringToNumber[e]}},{key:"decode",value:function(e){return r(e<this._numberToString.length),this._numberToString[e]}}]),a);function a(e){!function(e){if(!(e instanceof a))throw new TypeError("Cannot call a class as a function")}(this),this._stringToNumber={},this._numberToString=[];for(var t=0;t<e.length;t++){var i=e[t];this._stringToNumber[i]=t,this._numberToString[t]=i}}e.exports=n},function(e,t){var i=(function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(o.prototype,[{key:"keysLength",value:function(){return this.boxKeys.length+this.circleKeys.length}},{key:"insert",value:function(e,t,i,r,n){this._forEachCell(t,i,r,n,this._insertBoxCell,this.boxUid++),this.boxKeys.push(e),this.bboxes.push(t),this.bboxes.push(i),this.bboxes.push(r),this.bboxes.push(n)}},{key:"insertCircle",value:function(e,t,i,r){this._forEachCell(t-r,i-r,t+r,i+r,this._insertCircleCell,this.circleUid++),this.circleKeys.push(e),this.circles.push(t),this.circles.push(i),this.circles.push(r)}},{key:"_insertBoxCell",value:function(e,t,i,r,n,a){this.boxCells[n].push(a)}},{key:"_insertCircleCell",value:function(e,t,i,r,n,a){this.circleCells[n].push(a)}},{key:"_query",value:function(e,t,i,r,n){if(i<0||e>this.width||r<0||t>this.height)return!n&&[];var a=[];if(e<=0&&t<=0&&this.width<=i&&this.height<=r)a=Array.prototype.slice.call(this.boxKeys).concat(this.circleKeys);else{var o={hitTest:n,seenUids:{box:{},circle:{}}};this._forEachCell(e,t,i,r,this._queryCell,a,o)}return n?0<a.length:a}},{key:"_queryCircle",value:function(e,t,i,r){var n=e-i,a=e+i,o=t-i,s=t+i;if(a<0||n>this.width||s<0||o>this.height)return!r&&[];var l=[],u={hitTest:r,circle:{x:e,y:t,radius:i},seenUids:{box:{},circle:{}}};return this._forEachCell(n,o,a,s,this._queryCellCircle,l,u),r?0<l.length:l}},{key:"query",value:function(e,t,i,r){return this._query(e,t,i,r,!1)}},{key:"hitTest",value:function(e,t,i,r){return this._query(e,t,i,r,!0)}},{key:"hitTestCircle",value:function(e,t,i){return this._queryCircle(e,t,i,!0)}},{key:"_queryCell",value:function(e,t,i,r,n,a,o){var s=o.seenUids,l=this.boxCells[n];if(null!==l){var u=this.bboxes,c=!0,d=!1,h=void 0;try{for(var p,f=l[Symbol.iterator]();!(c=(p=f.next()).done);c=!0){var m=p.value;if(!s.box[m]){s.box[m]=!0;var g=4*m;if(e<=u[2+g]&&t<=u[3+g]&&i>=u[0+g]&&r>=u[1+g]){if(o.hitTest)return a.push(!0),!0;a.push(this.boxKeys[m])}}}}catch(e){d=!0,h=e}finally{try{c||null==f.return||f.return()}finally{if(d)throw h}}}var y=this.circleCells[n];if(null!==y){var v=this.circles,_=!0,C=!1,x=void 0;try{for(var b,A=y[Symbol.iterator]();!(_=(b=A.next()).done);_=!0){var S=b.value;if(!s.circle[S]){s.circle[S]=!0;var w=3*S;if(this._circleAndRectCollide(v[w],v[1+w],v[2+w],e,t,i,r)){if(o.hitTest)return a.push(!0),!0;a.push(this.circleKeys[S])}}}}catch(e){C=!0,x=e}finally{try{_||null==A.return||A.return()}finally{if(C)throw x}}}}},{key:"_queryCellCircle",value:function(e,t,i,r,n,a,o){var s=o.circle,l=o.seenUids,u=this.boxCells[n];if(null!==u){var c=this.bboxes,d=!0,h=!1,p=void 0;try{for(var f,m=u[Symbol.iterator]();!(d=(f=m.next()).done);d=!0){var g=f.value;if(!l.box[g]){l.box[g]=!0;var y=4*g;if(this._circleAndRectCollide(s.x,s.y,s.radius,c[0+y],c[1+y],c[2+y],c[3+y]))return a.push(!0),!0}}}catch(e){h=!0,p=e}finally{try{d||null==m.return||m.return()}finally{if(h)throw p}}}var v=this.circleCells[n];if(null!==v){var _=this.circles,C=!0,x=!1,b=void 0;try{for(var A,S=v[Symbol.iterator]();!(C=(A=S.next()).done);C=!0){var w=A.value;if(!l.circle[w]){l.circle[w]=!0;var E=3*w;if(this._circlesCollide(_[E],_[1+E],_[2+E],s.x,s.y,s.radius))return a.push(!0),!0}}}catch(e){x=!0,b=e}finally{try{C||null==S.return||S.return()}finally{if(x)throw b}}}}},{key:"_forEachCell",value:function(e,t,i,r,n,a,o){for(var s=this._convertToXCellCoord(e),l=this._convertToYCellCoord(t),u=this._convertToXCellCoord(i),c=this._convertToYCellCoord(r),d=s;d<=u;d++)for(var h=l;h<=c;h++){var p=this.xCellCount*h+d;if(n.call(this,e,t,i,r,p,a,o))return}}},{key:"_convertToXCellCoord",value:function(e){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(e*this.xScale)))}},{key:"_convertToYCellCoord",value:function(e){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(e*this.yScale)))}},{key:"_circlesCollide",value:function(e,t,i,r,n,a){var o=r-e,s=n-t,l=i+a;return o*o+s*s<l*l}},{key:"_circleAndRectCollide",value:function(e,t,i,r,n,a,o){var s=(a-r)/2,l=Math.abs(e-(r+s));if(s+i<l)return!1;var u=(o-n)/2,c=Math.abs(t-(n+u));if(u+i<c)return!1;if(l<=s||c<=u)return!0;var d=l-s,h=c-u;return d*d+h*h<=i*i}}]),o);function o(e,t,i){!function(e){if(!(e instanceof o))throw new TypeError("Cannot call a class as a function")}(this);var r=this.boxCells=[],n=this.circleCells=[];this.xCellCount=Math.ceil(e/i),this.yCellCount=Math.ceil(t/i);for(var a=0;a<this.xCellCount*this.yCellCount;a++)r.push([]),n.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=e,this.height=t,this.xScale=this.xCellCount/e,this.yScale=this.yCellCount/t,this.boxUid=0,this.circleUid=0}e.exports=i},function(e,t,i){var r,n;function a(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var M=i(63),f=i(110),m=i(49),D={horizontal:1,vertical:2,horizontalOnly:3};e.exports={shapeText:function(e,t,i,r,n,a,o,s,l,u){var c=e.trim();u===D.vertical&&(c=f(c));var d=[],h={positionedGlyphs:d,text:c,top:s[1],bottom:s[1],left:s[0],right:s[0],writingMode:u},p=m.processBidirectionalText;return function(e,t,u,i,r,n,a,o,s){var l=0,c=-17,d=0,h=e.positionedGlyphs,p="right"===n?1:"left"===n?0:.5,f=!0,m=!1,g=void 0;try{for(var y,v=u[Symbol.iterator]();!(f=(y=v.next()).done);f=!0){var _=y.value;if((_=_.trim()).length){for(var C=h.length,x=0;x<_.length;x++){var b=_.charCodeAt(x),A=t[b];A&&(M.charHasUprightVerticalOrientation(b)&&a!==D.horizontal?(h.push({glyph:b,x:l,y:0,vertical:!0}),l+=s+o):(h.push({glyph:b,x:l,y:c,vertical:!1}),l+=A.metrics.advance+o))}if(h.length!==C){var S=l-o;d=Math.max(S,d),O(h,t,C,h.length-1,p)}l=0,c+=i}else c+=i}}catch(e){m=!0,g=e}finally{try{f||null==v.return||v.return()}finally{if(m)throw g}}var w=I(r),E=w.horizontalAlign,T=w.verticalAlign;!function(e,t,i,r,n,a){for(var o=(p-E)*d,s=(-T*u.length+.5)*a,l=0;l<e.length;l++)e[l].x+=o,e[l].y+=s}(h,0,0,0,0,i);var P=u.length*i;e.top+=-T*P,e.bottom=e.top+P,e.left+=-E*d,e.right=e.left+d}(h,t,p?p(c,_(c,o,i,t)):function(e,t){var i=[],r=0,n=!0,a=!1,o=void 0;try{for(var s,l=t[Symbol.iterator]();!(n=(s=l.next()).done);n=!0){var u=s.value;i.push(e.substring(r,u)),r=u}}catch(e){a=!0,o=e}finally{try{n||null==l.return||l.return()}finally{if(a)throw o}}return r<e.length&&i.push(e.substring(r,e.length)),i}(c,_(c,o,i,t)),r,n,a,u,o,l),!!d.length&&h},shapeIcon:function(e,t,i){var r=I(i),n=r.horizontalAlign,a=r.verticalAlign,o=t[0],s=t[1],l=o-e.displaySize[0]*n,u=l+e.displaySize[0],c=s-e.displaySize[1]*a;return{image:e,top:c,bottom:c+e.displaySize[1],left:l,right:u}},WritingMode:D};var p=(a(r={},9,!0),a(r,10,!0),a(r,11,!0),a(r,12,!0),a(r,13,!0),a(r,32,!0),r),g=(a(n={},10,!0),a(n,32,!0),a(n,38,!0),a(n,40,!0),a(n,41,!0),a(n,43,!0),a(n,45,!0),a(n,47,!0),a(n,173,!0),a(n,183,!0),a(n,8203,!0),a(n,8208,!0),a(n,8211,!0),a(n,8231,!0),n);function y(e,t,i,r){var n=Math.pow(e-t,2);return r?e<t?n/2:2*n:n+Math.abs(i)*i}function v(e,t,i,r,n,a){var o=null,s=y(t,i,n,a),l=!0,u=!1,c=void 0;try{for(var d,h=r[Symbol.iterator]();!(l=(d=h.next()).done);l=!0){var p=d.value,f=y(t-p.x,i,n,a)+p.badness;f<=s&&(o=p,s=f)}}catch(e){u=!0,c=e}finally{try{l||null==h.return||h.return()}finally{if(u)throw c}}return{index:e,x:t,priorBreak:o,badness:s}}function _(e,t,i,r){if(!i)return[];if(!e)return[];for(var n=[],a=function(e,t,i,r){for(var n=0,a=0;a<e.length;a++){var o=r[e.charCodeAt(a)];o&&(n+=o.metrics.advance+t)}return n/Math.max(1,Math.ceil(n/i))}(e,t,i,r),o=0,s=0;s<e.length;s++){var l=e.charCodeAt(s),u=r[l];u&&!p[l]&&(o+=u.metrics.advance+t),s<e.length-1&&(g[l]||M.charAllowsIdeographicBreaking(l))&&n.push(v(s+1,o,a,n,(c=l,d=e.charCodeAt(s+1),h=void 0,h=0,10===c&&(h-=1e4),40!==c&&65288!==c||(h+=50),41!==d&&65289!==d||(h+=50),h),!1))}var c,d,h;return function e(t){return t?e(t.priorBreak).concat(t.index):[]}(v(e.length,o,a,n,0,!0))}function I(e){var t=.5,i=.5;switch(e){case"right":case"top-right":case"bottom-right":t=1;break;case"left":case"top-left":case"bottom-left":t=0}switch(e){case"bottom":case"bottom-right":case"bottom-left":i=1;break;case"top":case"top-right":case"top-left":i=0}return{horizontalAlign:t,verticalAlign:i}}function O(e,t,i,r,n){if(n){var a=t[e[r].glyph];if(a)for(var o=a.metrics.advance,s=(e[r].x+o)*n,l=i;l<=r;l++)e[l].x-=s}}},function(e,t,i){var r=i(1),n=(function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(a.prototype,[{key:"unbindVAO",value:function(){this.context.extVertexArrayObject&&this.context.bindVertexArrayOES.set(null)}},{key:"bind",value:function(){this.context.bindElementBuffer.set(this.buffer)}},{key:"updateData",value:function(e){var t=this.context.gl;r(this.dynamicDraw),this.unbindVAO(),this.bind(),t.bufferSubData(t.ELEMENT_ARRAY_BUFFER,0,e.arrayBuffer)}},{key:"destroy",value:function(){var e=this.context.gl;this.buffer&&(e.deleteBuffer(this.buffer),delete this.buffer)}}]),a);function a(e,t,i){!function(e){if(!(e instanceof a))throw new TypeError("Cannot call a class as a function")}(this);var r=(this.context=e).gl;this.buffer=r.createBuffer(),this.dynamicDraw=Boolean(i),this.unbindVAO(),e.bindElementBuffer.set(this.buffer),r.bufferData(r.ELEMENT_ARRAY_BUFFER,t.arrayBuffer,this.dynamicDraw?r.DYNAMIC_DRAW:r.STATIC_DRAW),this.dynamicDraw||delete t.arrayBuffer}e.exports=n},function(e,t,i){var r=i(1),o={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"},n=(function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(a.prototype,[{key:"bind",value:function(){this.context.bindVertexBuffer.set(this.buffer)}},{key:"updateData",value:function(e){r(e.length===this.length);var t=this.context.gl;this.bind(),t.bufferSubData(t.ARRAY_BUFFER,0,e.arrayBuffer)}},{key:"enableAttributes",value:function(e,t){for(var i=0;i<this.attributes.length;i++){var r=this.attributes[i],n=t.attributes[r.name];void 0!==n&&e.enableVertexAttribArray(n)}}},{key:"setVertexAttribPointers",value:function(e,t,i){for(var r=0;r<this.attributes.length;r++){var n=this.attributes[r],a=t.attributes[n.name];void 0!==a&&e.vertexAttribPointer(a,n.components,e[o[n.type]],!1,this.itemSize,n.offset+this.itemSize*(i||0))}}},{key:"destroy",value:function(){var e=this.context.gl;this.buffer&&(e.deleteBuffer(this.buffer),delete this.buffer)}}]),a);function a(e,t,i,r){!function(e){if(!(e instanceof a))throw new TypeError("Cannot call a class as a function")}(this),this.length=t.length,this.attributes=i,this.itemSize=t.bytesPerElement,this.dynamicDraw=r;var n=(this.context=e).gl;this.buffer=n.createBuffer(),e.bindVertexBuffer.set(this.buffer),n.bufferData(n.ARRAY_BUFFER,t.arrayBuffer,this.dynamicDraw?n.DYNAMIC_DRAW:n.STATIC_DRAW),this.dynamicDraw||delete t.arrayBuffer}e.exports=n},function(e,t,i){var r=i(122),a=r.ColorAttachment,o=r.DepthAttachment,n=(function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(s.prototype,[{key:"destroy",value:function(){var e=this.context.gl,t=this.colorAttachment.get();t&&e.deleteTexture(t);var i=this.depthAttachment.get();i&&e.deleteRenderbuffer(i),e.deleteFramebuffer(this.framebuffer)}}]),s);function s(e,t,i){!function(e){if(!(e instanceof s))throw new TypeError("Cannot call a class as a function")}(this),this.context=e,this.width=t,this.height=i;var r=e.gl,n=this.framebuffer=r.createFramebuffer();this.colorAttachment=new a(e,n),this.depthAttachment=new o(e,n)}e.exports=n},function(e,t,i){var r,n=i(210);e.exports=function(){return r=r||new n}},function(e,t,i){var r=i(1),n=i(211),a=(function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(o.prototype,[{key:"acquire",value:function(e){if(!this.workers){var t=i(71).workerCount;for(r("number"==typeof t&&t<1/0),this.workers=[];this.workers.length<t;)this.workers.push(new n)}return this.active[e]=!0,this.workers.slice()}},{key:"release",value:function(e){delete this.active[e],0===Object.keys(this.active).length&&(this.workers.forEach(function(e){e.terminate()}),this.workers=null)}}]),o);function o(){!function(e){if(!(e instanceof o))throw new TypeError("Cannot call a class as a function")}(this),this.active={}}e.exports=a},function(e,t,i){var r=i(212);i(5),e.exports=function(){return new r}},function(e,t,i){e.exports=function(){return i(213)('!function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=86)}([function(t,e,n){"use strict";(function(e){var r=n(90);\n/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>\n * @license MIT\n */function i(t,e){if(t===e)return 0;for(var n=t.length,r=e.length,i=0,o=Math.min(n,r);i<o;++i)if(t[i]!==e[i]){n=t[i],r=e[i];break}return n<r?-1:r<n?1:0}function o(t){return e.Buffer&&"function"==typeof e.Buffer.isBuffer?e.Buffer.isBuffer(t):!(null==t||!t._isBuffer)}var a=n(91),s=Object.prototype.hasOwnProperty,u=Array.prototype.slice,l="foo"===function(){}.name;function c(t){return Object.prototype.toString.call(t)}function f(t){return!o(t)&&("function"==typeof e.ArrayBuffer&&("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(t):!!t&&(t instanceof DataView||!!(t.buffer&&t.buffer instanceof ArrayBuffer))))}var h=t.exports=g,p=/\\s*function\\s+([^\\(\\s]*)\\s*/;function y(t){if(a.isFunction(t)){if(l)return t.name;var e=t.toString().match(p);return e&&e[1]}}function d(t,e){return"string"==typeof t?t.length<e?t:t.slice(0,e):t}function v(t){if(l||!a.isFunction(t))return a.inspect(t);var e=y(t);return"[Function"+(e?": "+e:"")+"]"}function m(t,e,n,r,i){throw new h.AssertionError({message:n,actual:t,expected:e,operator:r,stackStartFunction:i})}function g(t,e){t||m(t,!0,e,"==",h.ok)}function b(t,e,n,r){if(t===e)return!0;if(o(t)&&o(e))return 0===i(t,e);if(a.isDate(t)&&a.isDate(e))return t.getTime()===e.getTime();if(a.isRegExp(t)&&a.isRegExp(e))return t.source===e.source&&t.global===e.global&&t.multiline===e.multiline&&t.lastIndex===e.lastIndex&&t.ignoreCase===e.ignoreCase;if(null!==t&&"object"==typeof t||null!==e&&"object"==typeof e){if(f(t)&&f(e)&&c(t)===c(e)&&!(t instanceof Float32Array||t instanceof Float64Array))return 0===i(new Uint8Array(t.buffer),new Uint8Array(e.buffer));if(o(t)!==o(e))return!1;var s=(r=r||{actual:[],expected:[]}).actual.indexOf(t);return-1!==s&&s===r.expected.indexOf(e)||(r.actual.push(t),r.expected.push(e),function(t,e,n,r){if(null==t||null==e)return!1;if(a.isPrimitive(t)||a.isPrimitive(e))return t===e;if(n&&Object.getPrototypeOf(t)!==Object.getPrototypeOf(e))return!1;var i=x(t),o=x(e);if(i&&!o||!i&&o)return!1;if(i)return t=u.call(t),e=u.call(e),b(t,e,n);var s,l,c=_(t),f=_(e);if(c.length!==f.length)return!1;for(c.sort(),f.sort(),l=c.length-1;l>=0;l--)if(c[l]!==f[l])return!1;for(l=c.length-1;l>=0;l--)if(s=c[l],!b(t[s],e[s],n,r))return!1;return!0}(t,e,n,r))}return n?t===e:t==e}function x(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function w(t,e){if(!t||!e)return!1;if("[object RegExp]"==Object.prototype.toString.call(e))return e.test(t);try{if(t instanceof e)return!0}catch(t){}return!Error.isPrototypeOf(e)&&!0===e.call({},t)}function k(t,e,n,r){var i;if("function"!=typeof e)throw new TypeError(\'"block" argument must be a function\');"string"==typeof n&&(r=n,n=null),i=function(t){var e;try{t()}catch(t){e=t}return e}(e),r=(n&&n.name?" ("+n.name+").":".")+(r?" "+r:"."),t&&!i&&m(i,n,"Missing expected exception"+r);var o="string"==typeof r,s=!t&&i&&!n;if((!t&&a.isError(i)&&o&&w(i,n)||s)&&m(i,n,"Got unwanted exception"+r),t&&i&&n&&!w(i,n)||!t&&i)throw i}h.AssertionError=function(t){this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=function(t){return d(v(t.actual),128)+" "+t.operator+" "+d(v(t.expected),128)}(this),this.generatedMessage=!0);var e=t.stackStartFunction||m;if(Error.captureStackTrace)Error.captureStackTrace(this,e);else{var n=new Error;if(n.stack){var r=n.stack,i=y(e),o=r.indexOf("\\n"+i);if(o>=0){var a=r.indexOf("\\n",o+1);r=r.substring(a+1)}this.stack=r}}},a.inherits(h.AssertionError,Error),h.fail=m,h.ok=g,h.equal=function(t,e,n){t!=e&&m(t,e,n,"==",h.equal)},h.notEqual=function(t,e,n){t==e&&m(t,e,n,"!=",h.notEqual)},h.deepEqual=function(t,e,n){b(t,e,!1)||m(t,e,n,"deepEqual",h.deepEqual)},h.deepStrictEqual=function(t,e,n){b(t,e,!0)||m(t,e,n,"deepStrictEqual",h.deepStrictEqual)},h.notDeepEqual=function(t,e,n){b(t,e,!1)&&m(t,e,n,"notDeepEqual",h.notDeepEqual)},h.notDeepStrictEqual=function t(e,n,r){b(e,n,!0)&&m(e,n,r,"notDeepStrictEqual",t)},h.strictEqual=function(t,e,n){t!==e&&m(t,e,n,"===",h.strictEqual)},h.notStrictEqual=function(t,e,n){t===e&&m(t,e,n,"!==",h.notStrictEqual)},h.throws=function(t,e,n){k(!0,t,e,n)},h.doesNotThrow=function(t,e,n){k(!1,t,e,n)},h.ifError=function(t){if(t)throw t},h.strict=r(function t(e,n){e||m(e,!0,n,"==",t)},h,{equal:h.strictEqual,deepEqual:h.deepStrictEqual,notEqual:h.notStrictEqual,notDeepEqual:h.notDeepStrictEqual}),h.strict.strict=h.strict;var _=Object.keys||function(t){var e=[];for(var n in t)s.call(t,n)&&e.push(n);return e}}).call(this,n(89))},function(t,e,n){function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function o(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}var a=n(0),s=n(2),u=s.clone,l=s.extend,c=s.easeCubicInOut,f=n(19),h=n(14).normalizePropertyExpression,p=(n(13),n(3).register),y=function(){function t(e,n){r(this,t),this.property=e,this.value=n,this.expression=h(void 0===n?e.specification.default:n,e.specification)}return o(t,[{key:"isDataDriven",value:function(){return"source"===this.expression.kind||"composite"===this.expression.kind}},{key:"possiblyEvaluate",value:function(t){return this.property.possiblyEvaluate(this,t)}}]),t}(),d=function(){function t(e){r(this,t),this.property=e,this.value=new y(e,void 0)}return o(t,[{key:"transitioned",value:function(t,e){return new m(this.property,this.value,e,l({},t.transition,this.transition),t.now)}},{key:"untransitioned",value:function(){return new m(this.property,this.value,null,{},0)}}]),t}(),v=function(){function t(e){r(this,t),this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues)}return o(t,[{key:"getValue",value:function(t){return u(this._values[t].value.value)}},{key:"setValue",value:function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new d(this._values[t].property)),this._values[t].value=new y(this._values[t].property,null===e?void 0:u(e))}},{key:"getTransition",value:function(t){return u(this._values[t].transition)}},{key:"setTransition",value:function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new d(this._values[t].property)),this._values[t].transition=u(e)||void 0}},{key:"serialize",value:function(){for(var t={},e=0,n=Object.keys(this._values);e<n.length;e++){var r=n[e],i=this.getValue(r);void 0!==i&&(t[r]=i);var o=this.getTransition(r);void 0!==o&&(t["".concat(r,"-transition")]=o)}return t}},{key:"transitioned",value:function(t,e){for(var n=new g(this._properties),r=0,i=Object.keys(this._values);r<i.length;r++){var o=i[r];n._values[o]=this._values[o].transitioned(t,e._values[o])}return n}},{key:"untransitioned",value:function(){for(var t=new g(this._properties),e=0,n=Object.keys(this._values);e<n.length;e++){var r=n[e];t._values[r]=this._values[r].untransitioned()}return t}}]),t}(),m=function(){function t(e,n,i,o,a){r(this,t),this.property=e,this.value=n,this.begin=a+o.delay||0,this.end=this.begin+o.duration||0,e.specification.transition&&(o.delay||o.duration)&&(this.prior=i)}return o(t,[{key:"possiblyEvaluate",value:function(t){var e=t.now||0,n=this.value.possiblyEvaluate(t),r=this.prior;if(r){if(e>this.end)return this.prior=null,n;if(this.value.isDataDriven())return this.prior=null,n;if(e<this.begin)return r.possiblyEvaluate(t);var i=(e-this.begin)/(this.end-this.begin);return this.property.interpolate(r.possiblyEvaluate(t),n,c(i))}return n}}]),t}(),g=function(){function t(e){r(this,t),this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)}return o(t,[{key:"possiblyEvaluate",value:function(t){for(var e=new w(this._properties),n=0,r=Object.keys(this._values);n<r.length;n++){var i=r[n];e._values[i]=this._values[i].possiblyEvaluate(t)}return e}},{key:"hasTransition",value:function(){for(var t=0,e=Object.keys(this._values);t<e.length;t++){var n=e[t];if(this._values[n].prior)return!0}return!1}}]),t}(),b=function(){function t(e){r(this,t),this._properties=e,this._values=Object.create(e.defaultPropertyValues)}return o(t,[{key:"getValue",value:function(t){return u(this._values[t].value)}},{key:"setValue",value:function(t,e){this._values[t]=new y(this._values[t].property,null===e?void 0:u(e))}},{key:"serialize",value:function(){for(var t={},e=0,n=Object.keys(this._values);e<n.length;e++){var r=n[e],i=this.getValue(r);void 0!==i&&(t[r]=i)}return t}},{key:"possiblyEvaluate",value:function(t){for(var e=new w(this._properties),n=0,r=Object.keys(this._values);n<r.length;n++){var i=r[n];e._values[i]=this._values[i].possiblyEvaluate(t)}return e}}]),t}(),x=function(){function t(e,n,i){r(this,t),this.property=e,this.value=n,this.globals=i}return o(t,[{key:"isConstant",value:function(){return"constant"===this.value.kind}},{key:"constantOr",value:function(t){return"constant"===this.value.kind?this.value.value:t}},{key:"evaluate",value:function(t){return this.property.evaluate(this.value,this.globals,t)}}]),t}(),w=function(){function t(e){r(this,t),this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)}return o(t,[{key:"get",value:function(t){return this._values[t]}}]),t}(),k=function(){function t(e){r(this,t),this.specification=e}return o(t,[{key:"possiblyEvaluate",value:function(t,e){return a(!t.isDataDriven()),t.expression.evaluate(e)}},{key:"interpolate",value:function(t,e,n){var r=f[this.specification.type];return r?r(t,e,n):t}}]),t}(),_=function(){function t(e){r(this,t),this.specification=e}return o(t,[{key:"possiblyEvaluate",value:function(t,e){return"constant"===t.expression.kind||"camera"===t.expression.kind?new x(this,{kind:"constant",value:t.expression.evaluate(e)},e):new x(this,t.expression,e)}},{key:"interpolate",value:function(t,e,n){if("constant"!==t.value.kind||"constant"!==e.value.kind)return t;if(void 0!==t.value.value&&void 0!==e.value.value){var r=f[this.specification.type];return r?new x(this,{kind:"constant",value:r(t.value.value,e.value.value,n)},t.globals):t}}},{key:"evaluate",value:function(t,e,n){return"constant"===t.kind?t.value:t.evaluate(e,n)}}]),t}(),S=function(){function t(e){r(this,t),this.specification=e}return o(t,[{key:"possiblyEvaluate",value:function(t,e){if(void 0!==t.value){if("constant"===t.expression.kind){var n=t.expression.evaluate(e);return this._calculate(n,n,n,e)}return a(!t.isDataDriven()),this._calculate(t.expression.evaluate({zoom:e.zoom-1}),t.expression.evaluate({zoom:e.zoom}),t.expression.evaluate({zoom:e.zoom+1}),e)}}},{key:"_calculate",value:function(t,e,n,r){var i=r.zoom,o=i-Math.floor(i),a=r.crossFadingFactor();return i>r.zoomHistory.lastIntegerZoom?{from:t,to:e,fromScale:2,toScale:1,t:o+(1-o)*a}:{from:n,to:e,fromScale:.5,toScale:1,t:1-(1-a)*o}}},{key:"interpolate",value:function(t){return t}}]),t}(),A=function(){function t(e){r(this,t),this.specification=e}return o(t,[{key:"possiblyEvaluate",value:function(){}},{key:"interpolate",value:function(){}}]),t}();p("DataDrivenProperty",_),p("DataConstantProperty",k),p("CrossFadedProperty",S),p("HeatmapColorProperty",A),t.exports={PropertyValue:y,Transitionable:v,Transitioning:g,Layout:b,PossiblyEvaluatedPropertyValue:x,PossiblyEvaluated:w,DataConstantProperty:k,DataDrivenProperty:_,CrossFadedProperty:S,HeatmapColorProperty:A,Properties:function t(e){for(var n in r(this,t),this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},e){var i=e[n],o=this.defaultPropertyValues[n]=new y(i,void 0),a=this.defaultTransitionablePropertyValues[n]=new d(i);this.defaultTransitioningPropertyValues[n]=a.untransitioned(),this.defaultPossiblyEvaluatedValues[n]=o.possiblyEvaluate({})}}}},function(t,e,n){function r(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var o=n(46),a=n(47);n(6);e.easeCubicInOut=function(t){if(t<=0)return 0;if(t>=1)return 1;var e=t*t,n=e*t;return 4*(t<.5?n:3*(t-e)+n-.75)},e.bezier=function(t,e,n,r){var i=new o(t,e,n,r);return function(t){return i.solve(t)}},e.ease=e.bezier(.25,.1,.25,1),e.clamp=function(t,e,n){return Math.min(n,Math.max(e,t))},e.wrap=function(t,e,n){var r=n-e,i=((t-e)%r+r)%r+e;return i===e?n:i},e.asyncAll=function(t,e,n){if(!t.length)return n(null,[]);var r=t.length,i=new Array(t.length),o=null;t.forEach(function(t,a){e(t,function(t,e){t&&(o=t),i[a]=e,0==--r&&n(o,i)})})},e.values=function(t){var e=[];for(var n in t)e.push(t[n]);return e},e.keysDifference=function(t,e){var n=[];for(var r in t)r in e||n.push(r);return n},e.extend=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];for(var i=0,o=n;i<o.length;i++){var a=o[i];for(var s in a)t[s]=a[s]}return t},e.pick=function(t,e){for(var n={},r=0;r<e.length;r++){var i=e[r];i in t&&(n[i]=t[i])}return n};var s=1;e.uniqueId=function(){return s++},e.bindAll=function(t,e){t.forEach(function(t){e[t]&&(e[t]=e[t].bind(e))})},e.getCoordinatesCenter=function(t){for(var e=1/0,n=1/0,r=-1/0,i=-1/0,o=0;o<t.length;o++)e=Math.min(e,t[o].column),n=Math.min(n,t[o].row),r=Math.max(r,t[o].column),i=Math.max(i,t[o].row);var s=r-e,u=i-n,l=Math.max(s,u),c=Math.max(0,Math.floor(-Math.log(l)/Math.LN2));return new a((e+r)/2,(n+i)/2,0).zoomTo(c)},e.endsWith=function(t,e){return-1!==t.indexOf(e,t.length-e.length)},e.mapObject=function(t,e,n){var r={};for(var i in t)r[i]=e.call(n||this,t[i],i,t);return r},e.filterObject=function(t,e,n){var r={};for(var i in t)e.call(n||this,t[i],i,t)&&(r[i]=t[i]);return r},e.deepEqual=n(88),e.clone=function(t){return Array.isArray(t)?t.map(e.clone):"object"===i(t)&&t?e.mapObject(t,e.clone):t},e.arraysIntersect=function(t,e){for(var n=0;n<t.length;n++)if(e.indexOf(t[n])>=0)return!0;return!1};var u={};e.warnOnce=function(t){u[t]||("undefined"!=typeof console&&console.warn(t),u[t]=!0)},e.isCounterClockwise=function(t,e,n){return(n.y-t.y)*(e.x-t.x)>(e.y-t.y)*(n.x-t.x)},e.calculateSignedArea=function(t){for(var e,n,r=0,i=0,o=t.length,a=o-1;i<o;a=i++)e=t[i],r+=((n=t[a]).x-e.x)*(e.y+n.y);return r},e.isClosedPolygon=function(t){if(t.length<4)return!1;var n=t[0],r=t[t.length-1];return!(Math.abs(n.x-r.x)>0||Math.abs(n.y-r.y)>0)&&Math.abs(e.calculateSignedArea(t))>.01},e.sphericalToCartesian=function(t){var e=r(t,3),n=e[0],i=e[1],o=e[2];return i+=90,i*=Math.PI/180,o*=Math.PI/180,{x:n*Math.cos(i)*Math.sin(o),y:n*Math.sin(i)*Math.sin(o),z:n*Math.cos(o)}},e.parseCacheControl=function(t){var e={};if(t.replace(/(?:^|(?:\\s*\\,\\s*))([^\\x00-\\x20\\(\\)<>@\\,;\\:\\\\"\\/\\[\\]\\?\\=\\{\\}\\x7F]+)(?:\\=(?:([^\\x00-\\x20\\(\\)<>@\\,;\\:\\\\"\\/\\[\\]\\?\\=\\{\\}\\x7F]+)|(?:\\"((?:[^"\\\\]|\\\\.)*)\\")))?/g,function(t,n,r,i){var o=r||i;return e[n]=!o||o.toLowerCase(),""}),e["max-age"]){var n=parseInt(e["max-age"],10);isNaN(n)?delete e["max-age"]:e["max-age"]=n}return e}},function(t,e,n){function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=n(0),o=n(48),a=n(13),s=n(14),u=s.StylePropertyFunction,l=s.StyleExpression,c=s.StyleExpressionWithErrorHandling,f=s.ZoomDependentExpression,h=s.ZoomConstantExpression,p=n(23).CompoundExpression,y=n(63),d=n(36).ImageData,v={};function m(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};i(!v[t],"".concat(t," is already registered.")),Object.defineProperty(e,"_classRegistryKey",{value:t,writeable:!1}),v[t]={klass:e,omit:n.omit||[],shallow:n.shallow||[]}}for(var g in m("Object",Object),o.serialize=function(t,e){var n=t.toArrayBuffer();return e&&e.push(n),n},o.deserialize=function(t){return new o(t)},m("Grid",o),m("Color",a),m("StylePropertyFunction",u),m("StyleExpression",l,{omit:["_evaluator"]}),m("StyleExpressionWithErrorHandling",c,{omit:["_evaluator"]}),m("ZoomDependentExpression",f),m("ZoomConstantExpression",h),m("CompoundExpression",p,{omit:["_evaluate"]}),y)y[g]._classRegistryKey||m("Expression_".concat(g),y[g]);t.exports={register:m,serialize:function t(e,n){if(null==e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp)return e;if(e instanceof ArrayBuffer)return n&&n.push(e),e;if(ArrayBuffer.isView(e)){var o=e;return n&&n.push(o.buffer),o}if(e instanceof d)return n&&n.push(e.data.buffer),e;if(Array.isArray(e)){var a=[],s=!0,u=!1,l=void 0;try{for(var c,f=e[Symbol.iterator]();!(s=(c=f.next()).done);s=!0){var h=c.value;a.push(t(h,n))}}catch(t){u=!0,l=t}finally{try{s||null==f.return||f.return()}finally{if(u)throw l}}return a}if("object"===r(e)){var p=e.constructor,y=p._classRegistryKey;if(!y)throw new Error("can\'t serialize object of unregistered class");i(v[y]);var m={};if(p.serialize)m._serialized=p.serialize(e,n);else for(var g in e)if(e.hasOwnProperty(g)&&!(v[y].omit.indexOf(g)>=0)){var b=e[g];m[g]=v[y].shallow.indexOf(g)>=0?b:t(b,n)}return{name:y,properties:m}}throw new Error("can\'t serialize object of type ".concat(r(e)))},deserialize:function t(e){if(null==e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp||e instanceof ArrayBuffer||ArrayBuffer.isView(e)||e instanceof d)return e;if(Array.isArray(e))return e.map(function(e){return t(e)});if("object"===r(e)){var n=e,i=n.name,o=n.properties;if(!i)throw new Error("can\'t deserialize object of anonymous class");var a=v[i].klass;if(!a)throw new Error("can\'t deserialize unregistered class ".concat(i));if(a.deserialize)return a.deserialize(o._serialized);for(var s=Object.create(a.prototype),u=0,l=Object.keys(o);u<l.length;u++){var c=l[u];s[c]=v[i].shallow.indexOf(c)>=0?o[c]:t(o[c])}return s}throw new Error("can\'t deserialize object of type ".concat(r(e)))}}},function(t,e){var n={kind:"null"},r={kind:"number"},i={kind:"string"},o={kind:"boolean"},a={kind:"color"},s={kind:"object"},u={kind:"value"};function l(t,e){return{kind:"array",itemType:t,N:e}}function c(t){if("array"===t.kind){var e=c(t.itemType);return"number"==typeof t.N?"array<".concat(e,", ").concat(t.N,">"):"value"===t.itemType.kind?"array":"array<".concat(e,">")}return t.kind}var f=[n,r,i,o,a,s,l(u)];t.exports={NullType:n,NumberType:r,StringType:i,BooleanType:o,ColorType:a,ObjectType:s,ValueType:u,array:l,ErrorType:{kind:"error"},toString:c,checkSubtype:function t(e,n){if("error"===n.kind)return null;if("array"===e.kind){if("array"===n.kind&&!t(e.itemType,n.itemType)&&("number"!=typeof e.N||e.N===n.N))return null}else{if(e.kind===n.kind)return null;if("value"===e.kind)for(var r=0,i=f;r<i.length;r++)if(!t(i[r],n))return null}return"Expected ".concat(c(e)," but found ").concat(c(n)," instead.")}}},function(t,e){t.exports=function(t,e,n){this.message=(t?"".concat(t,": "):"")+n,null!=e&&e.__line__&&(this.line=e.__line__)}},function(t,e,n){"use strict";function r(t,e){this.x=t,this.y=e}t.exports=r,r.prototype={clone:function(){return new r(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,n=t.y-this.y;return e*e+n*n},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[0]*this.x+t[1]*this.y,n=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=n,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),n=Math.sin(t),r=e*this.x-n*this.y,i=n*this.x+e*this.y;return this.x=r,this.y=i,this},_rotateAround:function(t,e){var n=Math.cos(t),r=Math.sin(t),i=e.x+n*(this.x-e.x)-r*(this.y-e.y),o=e.y+r*(this.x-e.x)+n*(this.y-e.y);return this.x=i,this.y=o,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},r.convert=function(t){return t instanceof r?t:Array.isArray(t)?new r(t[0],t[1]):t}},function(t,e){function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}t.exports=function(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":n(t)}},function(t,e,n){t.exports=n(102)},function(t,e,n){function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function o(t,e){return!e||"object"!==r(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called");return t}(t):e}function a(t){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function s(t,e){return(s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var u=n(2),l=n(8),c=n(103),f=n(76),h=n(1),p=h.Layout,y=h.Transitionable,d=(h.Transitioning,h.Properties,function(t){function e(t,n){var r;for(var i in function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=o(this,a(e).call(this))).id=t.id,r.metadata=t.metadata,r.type=t.type,r.minzoom=t.minzoom,r.maxzoom=t.maxzoom,r.visibility="visible","background"!==t.type&&(r.source=t.source,r.sourceLayer=t["source-layer"],r.filter=t.filter),r._featureFilter=function(){return!0},n.layout&&(r._unevaluatedLayout=new p(n.layout)),r._transitionablePaint=new y(n.paint),t.paint)r.setPaintProperty(i,t.paint[i],{validate:!1});for(var s in t.layout)r.setLayoutProperty(s,t.layout[s],{validate:!1});return r._transitioningPaint=r._transitionablePaint.untransitioned(),r}var n,r,h;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&s(t,e)}(e,f),n=e,(r=[{key:"getLayoutProperty",value:function(t){return"visibility"===t?this.visibility:this._unevaluatedLayout.getValue(t)}},{key:"setLayoutProperty",value:function(t,e,n){if(null!=e){var r="layers.".concat(this.id,".layout.").concat(t);if(this._validate(c.layoutProperty,r,t,e,n))return}"visibility"!==t?this._unevaluatedLayout.setValue(t,e):this.visibility="none"===e?e:"visible"}},{key:"getPaintProperty",value:function(t){return u.endsWith(t,"-transition")?this._transitionablePaint.getTransition(t.slice(0,-"-transition".length)):this._transitionablePaint.getValue(t)}},{key:"setPaintProperty",value:function(t,e,n){if(null!=e){var r="layers.".concat(this.id,".paint.").concat(t);if(this._validate(c.paintProperty,r,t,e,n))return}u.endsWith(t,"-transition")?this._transitionablePaint.setTransition(t.slice(0,-"-transition".length),e||void 0):this._transitionablePaint.setValue(t,e)}},{key:"isHidden",value:function(t){return!!(this.minzoom&&t<this.minzoom)||(!!(this.maxzoom&&t>=this.maxzoom)||"none"===this.visibility)}},{key:"updateTransitions",value:function(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)}},{key:"hasTransition",value:function(){return this._transitioningPaint.hasTransition()}},{key:"recalculate",value:function(t){this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t)),this.paint=this._transitioningPaint.possiblyEvaluate(t)}},{key:"serialize",value:function(){var t={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return"none"===this.visibility&&(t.layout=t.layout||{},t.layout.visibility="none"),u.filterObject(t,function(t,e){return!(void 0===t||"layout"===e&&!Object.keys(t).length||"paint"===e&&!Object.keys(t).length)})}},{key:"_validate",value:function(t,e,n,r,i){return(!i||!1!==i.validate)&&c.emitErrors(this,t.call(c,{key:e,layerType:this.type,objectKey:n,value:r,styleSpec:l,style:{glyphs:!0,sprite:!0}}))}},{key:"hasOffscreenPass",value:function(){return!1}},{key:"resize",value:function(){}}])&&i(n.prototype,r),h&&i(n,h),e}());t.exports=d;var v={circle:n(108),heatmap:n(112),hillshade:n(115),fill:n(117),"fill-extrusion":n(122),line:n(126),symbol:n(132),background:n(140),raster:n(142)};d.create=function(t){return new v[t.type](t)}},function(t,e,n){function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function a(t,e,n){return e&&o(t.prototype,e),n&&o(t,n),t}function s(t,e){return!e||"object"!==r(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called");return t}(t):e}function u(t){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&c(t,e)}function c(t,e){return(c=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var f=n(0),h=n(17).StructArray,p=n(17).Struct,y=n(3).register,d=n(6),v=function(t){function e(){return i(this,e),s(this,u(e).apply(this,arguments))}return l(e,h),a(e,[{key:"_refreshViews",value:function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}},{key:"emplaceBack",value:function(t,e){var n=this.length;this.resize(n+1);var r=2*n;return this.int16[r+0]=t,this.int16[r+1]=e,n}}]),e}();v.prototype.bytesPerElement=4,y("StructArrayLayout2i4",v);var m=function(t){function e(){return i(this,e),s(this,u(e).apply(this,arguments))}return l(e,h),a(e,[{key:"_refreshViews",value:function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}},{key:"emplaceBack",value:function(t,e,n,r){var i=this.length;this.resize(i+1);var o=4*i;return this.int16[o+0]=t,this.int16[o+1]=e,this.int16[o+2]=n,this.int16[o+3]=r,i}}]),e}();m.prototype.bytesPerElement=8,y("StructArrayLayout4i8",m);var g=function(t){function e(){return i(this,e),s(this,u(e).apply(this,arguments))}return l(e,h),a(e,[{key:"_refreshViews",value:function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}},{key:"emplaceBack",value:function(t,e,n,r,i,o){var a=this.length;this.resize(a+1);var s=6*a;return this.int16[s+0]=t,this.int16[s+1]=e,this.int16[s+2]=n,this.int16[s+3]=r,this.int16[s+4]=i,this.int16[s+5]=o,a}}]),e}();g.prototype.bytesPerElement=12,y("StructArrayLayout2i4i12",g);var b=function(t){function e(){return i(this,e),s(this,u(e).apply(this,arguments))}return l(e,h),a(e,[{key:"_refreshViews",value:function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}},{key:"emplaceBack",value:function(t,e,n,r,i,o,a,s){var u=this.length;this.resize(u+1);var l=6*u,c=12*u;return this.int16[l+0]=t,this.int16[l+1]=e,this.int16[l+2]=n,this.int16[l+3]=r,this.uint8[c+8]=i,this.uint8[c+9]=o,this.uint8[c+10]=a,this.uint8[c+11]=s,u}}]),e}();b.prototype.bytesPerElement=12,y("StructArrayLayout4i4ub12",b);var x=function(t){function e(){return i(this,e),s(this,u(e).apply(this,arguments))}return l(e,h),a(e,[{key:"_refreshViews",value:function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}},{key:"emplaceBack",value:function(t,e,n,r,i,o,a,s){var u=this.length;this.resize(u+1);var l=8*u;return this.int16[l+0]=t,this.int16[l+1]=e,this.int16[l+2]=n,this.int16[l+3]=r,this.uint16[l+4]=i,this.uint16[l+5]=o,this.uint16[l+6]=a,this.uint16[l+7]=s,u}}]),e}();x.prototype.bytesPerElement=16,y("StructArrayLayout4i4ui16",x);var w=function(t){function e(){return i(this,e),s(this,u(e).apply(this,arguments))}return l(e,h),a(e,[{key:"_refreshViews",value:function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}},{key:"emplaceBack",value:function(t,e,n){var r=this.length;this.resize(r+1);var i=3*r;return this.float32[i+0]=t,this.float32[i+1]=e,this.float32[i+2]=n,r}}]),e}();w.prototype.bytesPerElement=12,y("StructArrayLayout3f12",w);var k=function(t){function e(){return i(this,e),s(this,u(e).apply(this,arguments))}return l(e,h),a(e,[{key:"_refreshViews",value:function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}},{key:"emplaceBack",value:function(t){var e=this.length;this.resize(e+1);var n=1*e;return this.uint32[n+0]=t,e}}]),e}();k.prototype.bytesPerElement=4,y("StructArrayLayout1ul4",k);var _=function(t){function e(){return i(this,e),s(this,u(e).apply(this,arguments))}return l(e,h),a(e,[{key:"_refreshViews",value:function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}},{key:"emplaceBack",value:function(t,e,n,r,i,o,a,s,u,l,c){var f=this.length;this.resize(f+1);var h=12*f,p=6*f;return this.int16[h+0]=t,this.int16[h+1]=e,this.int16[h+2]=n,this.int16[h+3]=r,this.int16[h+4]=i,this.int16[h+5]=o,this.uint32[p+3]=a,this.uint16[h+8]=s,this.uint16[h+9]=u,this.int16[h+10]=l,this.int16[h+11]=c,f}}]),e}();_.prototype.bytesPerElement=24,y("StructArrayLayout6i1ul2ui2i24",_);var S=function(t){function e(){return i(this,e),s(this,u(e).apply(this,arguments))}return l(e,h),a(e,[{key:"_refreshViews",value:function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}},{key:"emplaceBack",value:function(t,e,n,r,i,o){var a=this.length;this.resize(a+1);var s=6*a;return this.int16[s+0]=t,this.int16[s+1]=e,this.int16[s+2]=n,this.int16[s+3]=r,this.int16[s+4]=i,this.int16[s+5]=o,a}}]),e}();S.prototype.bytesPerElement=12,y("StructArrayLayout2i2i2i12",S);var A=function(t){function e(){return i(this,e),s(this,u(e).apply(this,arguments))}return l(e,h),a(e,[{key:"_refreshViews",value:function(){this.uint8=new Uint8Array(this.arrayBuffer)}},{key:"emplaceBack",value:function(t,e){var n=this.length;this.resize(n+1);var r=4*n;return this.uint8[r+0]=t,this.uint8[r+1]=e,n}}]),e}();A.prototype.bytesPerElement=4,y("StructArrayLayout2ub4",A);var T=function(t){function e(){return i(this,e),s(this,u(e).apply(this,arguments))}return l(e,h),a(e,[{key:"_refreshViews",value:function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}},{key:"emplaceBack",value:function(t,e,n,r,i,o,a,s,u,l,c,f,h,p){var y=this.length;this.resize(y+1);var d=20*y,v=10*y,m=40*y;return this.int16[d+0]=t,this.int16[d+1]=e,this.uint16[d+2]=n,this.uint16[d+3]=r,this.uint32[v+2]=i,this.uint32[v+3]=o,this.uint32[v+4]=a,this.uint16[d+10]=s,this.uint16[d+11]=u,this.uint16[d+12]=l,this.float32[v+7]=c,this.float32[v+8]=f,this.uint8[m+36]=h,this.uint8[m+37]=p,y}}]),e}();T.prototype.bytesPerElement=40,y("StructArrayLayout2i2ui3ul3ui2f2ub40",T);var j=function(t){function e(){return i(this,e),s(this,u(e).apply(this,arguments))}return l(e,h),a(e,[{key:"_refreshViews",value:function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}},{key:"emplaceBack",value:function(t){var e=this.length;this.resize(e+1);var n=1*e;return this.float32[n+0]=t,e}}]),e}();j.prototype.bytesPerElement=4,y("StructArrayLayout1f4",j);var O=function(t){function e(){return i(this,e),s(this,u(e).apply(this,arguments))}return l(e,h),a(e,[{key:"_refreshViews",value:function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}},{key:"emplaceBack",value:function(t,e,n){var r=this.length;this.resize(r+1);var i=3*r;return this.int16[i+0]=t,this.int16[i+1]=e,this.int16[i+2]=n,r}}]),e}();O.prototype.bytesPerElement=6,y("StructArrayLayout3i6",O);var z=function(t){function e(){return i(this,e),s(this,u(e).apply(this,arguments))}return l(e,h),a(e,[{key:"_refreshViews",value:function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}},{key:"emplaceBack",value:function(t,e,n){var r=this.length;this.resize(r+1);var i=2*r,o=4*r;return this.uint32[i+0]=t,this.uint16[o+2]=e,this.uint16[o+3]=n,r}}]),e}();z.prototype.bytesPerElement=8,y("StructArrayLayout1ul2ui8",z);var P=function(t){function e(){return i(this,e),s(this,u(e).apply(this,arguments))}return l(e,h),a(e,[{key:"_refreshViews",value:function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}},{key:"emplaceBack",value:function(t,e,n){var r=this.length;this.resize(r+1);var i=3*r;return this.uint16[i+0]=t,this.uint16[i+1]=e,this.uint16[i+2]=n,r}}]),e}();P.prototype.bytesPerElement=6,y("StructArrayLayout3ui6",P);var E=function(t){function e(){return i(this,e),s(this,u(e).apply(this,arguments))}return l(e,h),a(e,[{key:"_refreshViews",value:function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}},{key:"emplaceBack",value:function(t,e){var n=this.length;this.resize(n+1);var r=2*n;return this.uint16[r+0]=t,this.uint16[r+1]=e,n}}]),e}();E.prototype.bytesPerElement=4,y("StructArrayLayout2ui4",E);var C=function(t){function e(){return i(this,e),s(this,u(e).apply(this,arguments))}return l(e,h),a(e,[{key:"_refreshViews",value:function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}},{key:"emplaceBack",value:function(t,e){var n=this.length;this.resize(n+1);var r=2*n;return this.float32[r+0]=t,this.float32[r+1]=e,n}}]),e}();C.prototype.bytesPerElement=8,y("StructArrayLayout2f8",C);var M=function(t){function e(){return i(this,e),s(this,u(e).apply(this,arguments))}return l(e,h),a(e,[{key:"_refreshViews",value:function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}},{key:"emplaceBack",value:function(t,e,n,r){var i=this.length;this.resize(i+1);var o=4*i;return this.float32[o+0]=t,this.float32[o+1]=e,this.float32[o+2]=n,this.float32[o+3]=r,i}}]),e}();M.prototype.bytesPerElement=16,y("StructArrayLayout4f16",M);var I=function(t){function e(){return i(this,e),s(this,u(e).apply(this,arguments))}return l(e,p),a(e,[{key:"anchorPointX",get:function(){return this._structArray.int16[this._pos2+0]},set:function(t){this._structArray.int16[this._pos2+0]=t}},{key:"anchorPointY",get:function(){return this._structArray.int16[this._pos2+1]},set:function(t){this._structArray.int16[this._pos2+1]=t}},{key:"x1",get:function(){return this._structArray.int16[this._pos2+2]},set:function(t){this._structArray.int16[this._pos2+2]=t}},{key:"y1",get:function(){return this._structArray.int16[this._pos2+3]},set:function(t){this._structArray.int16[this._pos2+3]=t}},{key:"x2",get:function(){return this._structArray.int16[this._pos2+4]},set:function(t){this._structArray.int16[this._pos2+4]=t}},{key:"y2",get:function(){return this._structArray.int16[this._pos2+5]},set:function(t){this._structArray.int16[this._pos2+5]=t}},{key:"featureIndex",get:function(){return this._structArray.uint32[this._pos4+3]},set:function(t){this._structArray.uint32[this._pos4+3]=t}},{key:"sourceLayerIndex",get:function(){return this._structArray.uint16[this._pos2+8]},set:function(t){this._structArray.uint16[this._pos2+8]=t}},{key:"bucketIndex",get:function(){return this._structArray.uint16[this._pos2+9]},set:function(t){this._structArray.uint16[this._pos2+9]=t}},{key:"radius",get:function(){return this._structArray.int16[this._pos2+10]},set:function(t){this._structArray.int16[this._pos2+10]=t}},{key:"signedDistanceFromAnchor",get:function(){return this._structArray.int16[this._pos2+11]},set:function(t){this._structArray.int16[this._pos2+11]=t}},{key:"anchorPoint",get:function(){return new d(this.anchorPointX,this.anchorPointY)}}]),e}();I.prototype.size=24;var B=function(t){function e(){return i(this,e),s(this,u(e).apply(this,arguments))}return l(e,_),a(e,[{key:"get",value:function(t){return f(!this.isTransferred),new I(this,t)}}]),e}();y("CollisionBoxArray",B);var V=function(t){function e(){return i(this,e),s(this,u(e).apply(this,arguments))}return l(e,p),a(e,[{key:"anchorX",get:function(){return this._structArray.int16[this._pos2+0]},set:function(t){this._structArray.int16[this._pos2+0]=t}},{key:"anchorY",get:function(){return this._structArray.int16[this._pos2+1]},set:function(t){this._structArray.int16[this._pos2+1]=t}},{key:"glyphStartIndex",get:function(){return this._structArray.uint16[this._pos2+2]},set:function(t){this._structArray.uint16[this._pos2+2]=t}},{key:"numGlyphs",get:function(){return this._structArray.uint16[this._pos2+3]},set:function(t){this._structArray.uint16[this._pos2+3]=t}},{key:"vertexStartIndex",get:function(){return this._structArray.uint32[this._pos4+2]},set:function(t){this._structArray.uint32[this._pos4+2]=t}},{key:"lineStartIndex",get:function(){return this._structArray.uint32[this._pos4+3]},set:function(t){this._structArray.uint32[this._pos4+3]=t}},{key:"lineLength",get:function(){return this._structArray.uint32[this._pos4+4]},set:function(t){this._structArray.uint32[this._pos4+4]=t}},{key:"segment",get:function(){return this._structArray.uint16[this._pos2+10]},set:function(t){this._structArray.uint16[this._pos2+10]=t}},{key:"lowerSize",get:function(){return this._structArray.uint16[this._pos2+11]},set:function(t){this._structArray.uint16[this._pos2+11]=t}},{key:"upperSize",get:function(){return this._structArray.uint16[this._pos2+12]},set:function(t){this._structArray.uint16[this._pos2+12]=t}},{key:"lineOffsetX",get:function(){return this._structArray.float32[this._pos4+7]},set:function(t){this._structArray.float32[this._pos4+7]=t}},{key:"lineOffsetY",get:function(){return this._structArray.float32[this._pos4+8]},set:function(t){this._structArray.float32[this._pos4+8]=t}},{key:"writingMode",get:function(){return this._structArray.uint8[this._pos1+36]},set:function(t){this._structArray.uint8[this._pos1+36]=t}},{key:"hidden",get:function(){return this._structArray.uint8[this._pos1+37]},set:function(t){this._structArray.uint8[this._pos1+37]=t}}]),e}();V.prototype.size=40;var L=function(t){function e(){return i(this,e),s(this,u(e).apply(this,arguments))}return l(e,T),a(e,[{key:"get",value:function(t){return f(!this.isTransferred),new V(this,t)}}]),e}();y("PlacedSymbolArray",L);var F=function(t){function e(){return i(this,e),s(this,u(e).apply(this,arguments))}return l(e,p),a(e,[{key:"offsetX",get:function(){return this._structArray.float32[this._pos4+0]},set:function(t){this._structArray.float32[this._pos4+0]=t}}]),e}();F.prototype.size=4;var R=function(t){function e(){return i(this,e),s(this,u(e).apply(this,arguments))}return l(e,j),a(e,[{key:"getoffsetX",value:function(t){return this.float32[1*t+0]}},{key:"get",value:function(t){return f(!this.isTransferred),new F(this,t)}}]),e}();y("GlyphOffsetArray",R);var D=function(t){function e(){return i(this,e),s(this,u(e).apply(this,arguments))}return l(e,p),a(e,[{key:"x",get:function(){return this._structArray.int16[this._pos2+0]},set:function(t){this._structArray.int16[this._pos2+0]=t}},{key:"y",get:function(){return this._structArray.int16[this._pos2+1]},set:function(t){this._structArray.int16[this._pos2+1]=t}},{key:"tileUnitDistanceFromAnchor",get:function(){return this._structArray.int16[this._pos2+2]},set:function(t){this._structArray.int16[this._pos2+2]=t}}]),e}();D.prototype.size=6;var q=function(t){function e(){return i(this,e),s(this,u(e).apply(this,arguments))}return l(e,O),a(e,[{key:"getx",value:function(t){return this.int16[3*t+0]}},{key:"gety",value:function(t){return this.int16[3*t+1]}},{key:"gettileUnitDistanceFromAnchor",value:function(t){return this.int16[3*t+2]}},{key:"get",value:function(t){return f(!this.isTransferred),new D(this,t)}}]),e}();y("SymbolLineVertexArray",q);var N=function(t){function e(){return i(this,e),s(this,u(e).apply(this,arguments))}return l(e,p),a(e,[{key:"featureIndex",get:function(){return this._structArray.uint32[this._pos4+0]},set:function(t){this._structArray.uint32[this._pos4+0]=t}},{key:"sourceLayerIndex",get:function(){return this._structArray.uint16[this._pos2+2]},set:function(t){this._structArray.uint16[this._pos2+2]=t}},{key:"bucketIndex",get:function(){return this._structArray.uint16[this._pos2+3]},set:function(t){this._structArray.uint16[this._pos2+3]=t}}]),e}();N.prototype.size=8;var U=function(t){function e(){return i(this,e),s(this,u(e).apply(this,arguments))}return l(e,z),a(e,[{key:"get",value:function(t){return f(!this.isTransferred),new N(this,t)}}]),e}();y("FeatureIndexArray",U),t.exports={StructArrayLayout2i4:v,StructArrayLayout4i8:m,StructArrayLayout2i4i12:g,StructArrayLayout4i4ub12:b,StructArrayLayout4i4ui16:x,StructArrayLayout3f12:w,StructArrayLayout1ul4:k,StructArrayLayout6i1ul2ui2i24:_,StructArrayLayout2i2i2i12:S,StructArrayLayout2ub4:A,StructArrayLayout2i2ui3ul3ui2f2ub40:T,StructArrayLayout1f4:j,StructArrayLayout3i6:O,StructArrayLayout1ul2ui8:z,StructArrayLayout3ui6:P,StructArrayLayout2ui4:E,StructArrayLayout2f8:C,StructArrayLayout4f16:M,PosArray:v,RasterBoundsArray:m,CircleLayoutArray:v,FillLayoutArray:v,FillExtrusionLayoutArray:g,HeatmapLayoutArray:v,LineLayoutArray:b,SymbolLayoutArray:x,SymbolDynamicLayoutArray:w,SymbolOpacityArray:k,CollisionBoxLayoutArray:S,CollisionCircleLayoutArray:S,CollisionVertexArray:A,TriangleIndexArray:P,LineIndexArray:E,CollisionBoxArray:B,PlacedSymbolArray:L,GlyphOffsetArray:R,SymbolLineVertexArray:q,FeatureIndexArray:U}},function(t,e,n){function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=n(0),o=n(13),a=n(4),s=a.NullType,u=a.NumberType,l=a.StringType,c=a.BooleanType,f=a.ColorType,h=a.ObjectType,p=a.ValueType,y=a.array;t.exports={Color:o,validateRGBA:function(t,e,n,r){return"number"==typeof t&&t>=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof n&&n>=0&&n<=255?void 0===r||"number"==typeof r&&r>=0&&r<=1?null:"Invalid rgba value [".concat([t,e,n,r].join(", "),"]: \'a\' must be between 0 and 1."):"Invalid rgba value [".concat(("number"==typeof r?[t,e,n,r]:[t,e,n]).join(", "),"]: \'r\', \'g\', and \'b\' must be between 0 and 255.")},isValue:function t(e){if(null===e)return!0;if("string"==typeof e)return!0;if("boolean"==typeof e)return!0;if("number"==typeof e)return!0;if(e instanceof o)return!0;if(Array.isArray(e)){var n=!0,i=!1,a=void 0;try{for(var s,u=e[Symbol.iterator]();!(n=(s=u.next()).done);n=!0)if(!t(s.value))return!1}catch(t){i=!0,a=t}finally{try{n||null==u.return||u.return()}finally{if(i)throw a}}return!0}if("object"===r(e)){for(var l in e)if(!t(e[l]))return!1;return!0}return!1},typeOf:function t(e){if(null===e)return s;if("string"==typeof e)return l;if("boolean"==typeof e)return c;if("number"==typeof e)return u;if(e instanceof o)return f;if(Array.isArray(e)){var n,a=e.length,d=!0,v=!1,m=void 0;try{for(var g,b=e[Symbol.iterator]();!(d=(g=b.next()).done);d=!0){var x=t(g.value);if(n){if(n===x)continue;n=p;break}n=x}}catch(t){v=!0,m=t}finally{try{d||null==b.return||b.return()}finally{if(v)throw m}}return y(n||p,a)}return i("object"===r(e)),h}}},function(t,e){function n(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}t.exports=n,t.exports.deep=function t(e){return Array.isArray(e)?e.map(t):n(e)}},function(t,e,n){function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var i=n(49).parseCSSColor,o=function(){function t(e,n,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.r=e,this.g=n,this.b=r,this.a=i}var e,n,o;return e=t,o=[{key:"parse",value:function(e){if(e){if(e instanceof t)return e;if("string"==typeof e){var n=i(e);if(n)return new t(n[0]/255*n[3],n[1]/255*n[3],n[2]/255*n[3],n[3])}}}}],(n=[{key:"toString",value:function(){var t=this,e=[this.r,this.g,this.b].map(function(e){return Math.round(255*e/t.a)});return"rgba(".concat(e.concat(this.a).join(","),")")}}])&&r(e.prototype,n),o&&r(e,o),t}();o.black=new o(0,0,0,1),o.white=new o(1,1,1,1),o.transparent=new o(0,0,0,0),t.exports=o},function(t,e,n){function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){return!e||"object"!==r(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called");return t}(t):e}function o(t){return(o=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function a(t,e){return(a=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function l(t,e,n){return e&&u(t.prototype,e),n&&u(t,n),t}var c=n(0),f=n(22),h=n(50),p=n(51),y=n(33),d=n(23).CompoundExpression,v=n(59),m=n(34),g=n(61),b=n(62),x=n(63),w=n(57),k=n(15),_=n(99),S=_.success,A=_.error,T=function(){function t(e){s(this,t),this.expression=e}return l(t,[{key:"evaluate",value:function(t,e){return this._evaluator||(this._evaluator=new y),this._evaluator.globals=t,this._evaluator.feature=e,this.expression.evaluate(this._evaluator)}}]),t}(),j=function(t){function e(t,n){var r,a;return s(this,e),(r=i(this,o(e).call(this,t)))._warningHistory={},r._defaultValue="color"===(a=n).type&&I(a.default)?new V(0,0,0,0):"color"===a.type?V.parse(a.default)||null:void 0===a.default?null:a.default,"enum"===n.type&&(r._enumValues=n.values),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&a(t,e)}(e,T),l(e,[{key:"evaluate",value:function(t,e){this._evaluator||(this._evaluator=new y),this._evaluator.globals=t,this._evaluator.feature=e;try{var n=this.expression.evaluate(this._evaluator);if(null==n)return this._defaultValue;if(this._enumValues&&!(n in this._enumValues))throw new k("Expected value to be one of ".concat(Object.keys(this._enumValues).map(function(t){return JSON.stringify(t)}).join(", "),", but found ").concat(JSON.stringify(n)," instead."));return n}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}}}]),e}();function O(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in x}function z(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=new p(x,[],function(t){var e={color:R,string:D,number:q,enum:D,boolean:N};if("array"===t.type)return J(e[t.value]||U,t.length);return e[t.type]||null}(e)),i=r.parse(t);return i?!1===n.handleErrors?S(new T(i)):S(new j(i,e)):(c(r.errors.length>0),A(r.errors))}var P=function(){function t(e,n){s(this,t),this.kind=e,this._styleExpression=n}return l(t,[{key:"evaluate",value:function(t,e){return this._styleExpression.evaluate(t,e)}}]),t}(),E=function(){function t(e,n,r){s(this,t),this.kind=e,this.zoomStops=r.labels,this._styleExpression=n,r instanceof m&&(this._interpolationType=r.interpolation)}return l(t,[{key:"evaluate",value:function(t,e){return this._styleExpression.evaluate(t,e)}},{key:"interpolationFactor",value:function(t,e,n){return this._interpolationType?m.interpolationFactor(this._interpolationType,t,e,n):0}}]),t}();function C(t,e){if("error"===(t=z(t,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})).result)return t;var n=t.value.expression,r=w.isFeatureConstant(n);if(!r&&!e["property-function"])return A([new h("","property expressions not supported")]);var i=w.isGlobalPropertyConstant(n,["zoom"]);if(!i&&!1===e["zoom-function"])return A([new h("","zoom expressions not supported")]);var o=function t(e){var n=null;if(e instanceof b)n=t(e.result);else if(e instanceof g){var r=!0,i=!1,o=void 0;try{for(var a,s=e.args[Symbol.iterator]();!(r=(a=s.next()).done);r=!0){var u=a.value;if(n=t(u))break}}catch(t){i=!0,o=t}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}}else(e instanceof v||e instanceof m)&&e.input instanceof d&&"zoom"===e.input.name&&(n=e);if(n instanceof h)return n;e.eachChild(function(e){var r=t(e);r instanceof h?n=r:!n&&r?n=new h("",\'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.\'):n&&r&&n!==r&&(n=new h("",\'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.\'))});return n}(n);return o||i?o instanceof h?A([o]):o instanceof m&&"piecewise-constant"===e.function?A([new h("",\'"interpolate" expressions cannot be used with this property\')]):S(o?new E(r?"camera":"composite",t.value,o):new P(r?"constant":"source",t.value)):A([new h("",\'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.\')])}var M=n(35),I=M.isFunction,B=M.createFunction,V=n(11).Color,L=function(){function t(e,n){s(this,t),this._parameters=e,this._specification=n,f(this,B(this._parameters,this._specification))}return l(t,null,[{key:"deserialize",value:function(e){return new t(e._parameters,e._specification)}},{key:"serialize",value:function(t){return{_parameters:t._parameters,_specification:t._specification}}}]),t}();t.exports={StyleExpression:T,StyleExpressionWithErrorHandling:j,isExpression:O,createExpression:z,createPropertyExpression:C,normalizePropertyExpression:function(t,e){if(I(t))return new L(t,e);if(O(t)){var n=C(t,e);if("error"===n.result)throw new Error(n.value.map(function(t){return"".concat(t.key,": ").concat(t.message)}).join(", "));return n.value}var r=t;return"string"==typeof t&&"color"===e.type&&(r=V.parse(t)),{kind:"constant",evaluate:function(){return r}}},ZoomConstantExpression:P,ZoomDependentExpression:E,StylePropertyFunction:L};var F=n(4),R=F.ColorType,D=F.StringType,q=F.NumberType,N=F.BooleanType,U=F.ValueType,J=F.array},function(t,e){function n(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var r=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.name="ExpressionEvaluationError",this.message=e}var e,r,i;return e=t,(r=[{key:"toJSON",value:function(){return this.message}}])&&n(e.prototype,r),i&&n(e,i),t}();t.exports=r},function(t,e,n){var r=n(22),i=n(12),o=n(14).isExpression,a=n(35).isFunction;t.exports=function(t){var e=n(65),s=n(68),u=n(24),l={"*":function(){return[]},array:n(66),boolean:n(105),number:n(67),color:n(106),constants:n(64),enum:n(37),filter:n(38),function:n(65),layer:n(69),object:n(24),source:n(73),light:n(74),string:n(75)},c=t.value,f=t.valueSpec,h=t.styleSpec;return f.function&&a(i(c))?e(t):f.function&&o(i.deep(c))?s(t):f.type&&l[f.type]?l[f.type](t):u(r({},t,{valueSpec:f.type?h[f.type]:f}))}},function(t,e,n){function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var o=n(0),a={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},s=function(){function t(){i(this,t),this.isTransferred=!1,this.capacity=-1,this.resize(0)}var e,n,a;return e=t,a=[{key:"serialize",value:function(t,e){return o(!t.isTransferred),t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}}},{key:"deserialize",value:function(t){var e=Object.create(this.prototype);return e.arrayBuffer=t.arrayBuffer,e.length=t.length,e.capacity=t.arrayBuffer.byteLength/e.bytesPerElement,e._refreshViews(),e}}],(n=[{key:"_trim",value:function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}},{key:"clear",value:function(){this.length=0}},{key:"resize",value:function(t){o(!this.isTransferred),this.reserve(t),this.length=t}},{key:"reserve",value:function(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}}},{key:"_refreshViews",value:function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}])&&r(e.prototype,n),a&&r(e,a),t}();function u(t,e){return Math.ceil(t/e)*e}t.exports.StructArray=s,t.exports.Struct=function t(e,n){i(this,t),this._structArray=e,this._pos1=n*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},t.exports.viewTypes=a,t.exports.createLayout=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=0,r=0;return{members:t.map(function(t){o(t.name.length);var i,s=(i=t.type,a[i].BYTES_PER_ELEMENT),l=n=u(n,Math.max(e,s)),c=t.components||1;return r=Math.max(r,s),n+=s*c,{name:t.name,type:t.type,components:c,offset:l}}),size:u(n,Math.max(r,e)),alignment:e}}},function(t,e){t.exports=8192},function(t,e,n){var r=n(13);function i(t,e,n){return t*(1-n)+e*n}t.exports={number:i,color:function(t,e,n){return new r(i(t.r,e.r,n),i(t.g,e.g,n),i(t.b,e.b,n),i(t.a,e.a,n))},array:function(t,e,n){return t.map(function(t,r){return i(t,e[r],n)})}}},function(t,e,n){var r=n(2),i=n(18);var o,a=(o=16,{min:-1*Math.pow(2,o-1),max:Math.pow(2,o-1)-1});t.exports=function(t){for(var e=i/t.extent,n=t.loadGeometry(),o=0;o<n.length;o++)for(var s=n[o],u=0;u<s.length;u++){var l=s[u];l.x=Math.round(l.x*e),l.y=Math.round(l.y*e),(l.x<a.min||l.x>a.max||l.y<a.min||l.y>a.max)&&r.warnOnce("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return n}},function(t,e,n){t.exports.VectorTile=n(129),t.exports.VectorTileFeature=n(80),t.exports.VectorTileLayer=n(79)},function(t,e){t.exports=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];for(var i=0,o=n;i<o.length;i++){var a=o[i];for(var s in a)t[s]=a[s]}return t}},function(t,e,n){function r(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var o=n(4).toString,a=n(51),s=(n(33),n(0)),u=function(){function t(e,n,r,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.name=e,this.type=n,this._evaluate=r,this.args=i}var e,n,u;return e=t,u=[{key:"parse",value:function(e,n){var i=e[0],u=t.definitions[i];if(!u)return n.error(\'Unknown expression "\'.concat(i,\'". If you wanted a literal array, use ["literal", [...]].\'),0);for(var l=Array.isArray(u)?u[0]:u.type,c=Array.isArray(u)?[[u[1],u[2]]]:u.overloads,f=c.filter(function(t){var n=r(t,1)[0];return!Array.isArray(n)||n.length===e.length-1}),h=[],p=1;p<e.length;p++){var y=e[p],d=void 0;if(1===f.length){var v=f[0][0];d=Array.isArray(v)?v[p-1]:v.type}var m=n.parse(y,1+h.length,d);if(!m)return null;h.push(m)}var g=null,b=!0,x=!1,w=void 0;try{for(var k,_=f[Symbol.iterator]();!(b=(k=_.next()).done);b=!0){var S=r(k.value,2),A=S[0],T=S[1];if(g=new a(n.registry,n.path,null,n.scope),Array.isArray(A)&&A.length!==h.length)g.error("Expected ".concat(A.length," arguments, but found ").concat(h.length," instead."));else{for(var j=0;j<h.length;j++){var O=Array.isArray(A)?A[j]:A.type,z=h[j];g.concat(j+1).checkSubtype(O,z.type)}if(0===g.errors.length)return new t(i,l,T,h)}}}catch(t){x=!0,w=t}finally{try{b||null==_.return||_.return()}finally{if(x)throw w}}if(s(!g||g.errors.length>0),1===f.length)n.errors.push.apply(n.errors,g.errors);else{var P=(f.length?f:c).map(function(t){var e,n=r(t,1)[0];return e=n,Array.isArray(e)?"(".concat(e.map(o).join(", "),")"):"(".concat(o(e.type),"...)")}).join(" | "),E=h.map(function(t){return o(t.type)}).join(", ");n.error("Expected arguments of type ".concat(P,", but found (").concat(E,") instead."))}return null}},{key:"register",value:function(e,n){for(var r in s(!t.definitions),t.definitions=n,n)e[r]=t}}],(n=[{key:"evaluate",value:function(t){return this._evaluate(t,this.args)}},{key:"eachChild",value:function(t){this.args.forEach(t)}},{key:"possibleOutputs",value:function(){return[void 0]}}])&&i(e.prototype,n),u&&i(e,u),t}();t.exports={CompoundExpression:u,varargs:function(t){return{type:t}}}},function(t,e,n){var r=n(5),i=n(7),o=n(16);t.exports=function(t){var e=t.key,n=t.value,a=t.valueSpec||{},s=t.objectElementValidators||{},u=t.style,l=t.styleSpec,c=[],f=i(n);if("object"!==f)return[new r(e,n,"object expected, ".concat(f," found"))];for(var h in n){var p=h.split(".")[0],y=a[p]||a["*"],d=void 0;if(s[p])d=s[p];else if(a[p])d=o;else if(s["*"])d=s["*"];else{if(!a["*"]){c.push(new r(e,n[h],\'unknown property "\'.concat(h,\'"\')));continue}d=o}c=c.concat(d({key:(e?"".concat(e,"."):e)+h,value:n[h],valueSpec:y,style:u,styleSpec:l,object:n,objectKey:h},n))}for(var v in a)s[v]||a[v].required&&void 0===a[v].default&&void 0===n[v]&&c.push(new r(e,n,\'missing required property "\'.concat(v,\'"\')));return c}},function(t,e,n){function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var i=n(2).warnOnce,o=n(3).register,a=Math.pow(2,16)-1,s=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),this.segments=t}var n,o,s;return n=e,(o=[{key:"prepareSegment",value:function(e,n,r){var o=this.segments[this.segments.length-1];return e>a&&i("Max vertices per segment is ".concat(a,": bucket requested ").concat(e)),(!o||o.vertexLength+e>t.exports.MAX_VERTEX_ARRAY_LENGTH)&&(o={vertexOffset:n.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},this.segments.push(o)),o}},{key:"get",value:function(){return this.segments}},{key:"destroy",value:function(){var t=!0,e=!1,n=void 0;try{for(var r,i=this.segments[Symbol.iterator]();!(t=(r=i.next()).done);t=!0){var o=r.value;for(var a in o.vaos)o.vaos[a].destroy()}}catch(t){e=!0,n=t}finally{try{t||null==i.return||i.return()}finally{if(e)throw n}}}}])&&r(n.prototype,o),s&&r(n,s),e}();o("SegmentVector",s),t.exports={SegmentVector:s,MAX_VERTEX_ARRAY_LENGTH:a}},function(t,e,n){function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function o(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}var a=n(110).packUint8ToFloat,s=(n(13),n(3).register),u=n(1).PossiblyEvaluatedPropertyValue,l=n(10),c=l.StructArrayLayout1f4,f=l.StructArrayLayout2f8,h=l.StructArrayLayout4f16;function p(t){return[a(255*t.r,255*t.g),a(255*t.b,255*t.a)]}var y=function(){function t(e,n,i){r(this,t),this.value=e,this.name=n,this.type=i,this.statistics={max:-1/0}}return o(t,[{key:"defines",value:function(){return["#define HAS_UNIFORM_u_".concat(this.name)]}},{key:"populatePaintArray",value:function(){}},{key:"upload",value:function(){}},{key:"destroy",value:function(){}},{key:"setUniforms",value:function(t,e,n,r){var i=r.constantOr(this.value),o=t.gl;"color"===this.type?o.uniform4f(e.uniforms["u_".concat(this.name)],i.r,i.g,i.b,i.a):o.uniform1f(e.uniforms["u_".concat(this.name)],i)}}]),t}(),d=function(){function t(e,n,i){r(this,t),this.expression=e,this.name=n,this.type=i,this.statistics={max:-1/0};var o="color"===i?f:c;this.paintVertexAttributes=[{name:"a_".concat(n),type:"Float32",components:"color"===i?2:1,offset:0}],this.paintVertexArray=new o}return o(t,[{key:"defines",value:function(){return[]}},{key:"populatePaintArray",value:function(t,e){var n=this.paintVertexArray,r=n.length;n.reserve(t);var i=this.expression.evaluate({zoom:0},e);if("color"===this.type)for(var o=p(i),a=r;a<t;a++)n.emplaceBack(o[0],o[1]);else{for(var s=r;s<t;s++)n.emplaceBack(i);this.statistics.max=Math.max(this.statistics.max,i)}}},{key:"upload",value:function(t){this.paintVertexArray&&(this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes))}},{key:"destroy",value:function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}},{key:"setUniforms",value:function(t,e){t.gl.uniform1f(e.uniforms["a_".concat(this.name,"_t")],0)}}]),t}(),v=function(){function t(e,n,i,o,a){r(this,t),this.expression=e,this.name=n,this.type=i,this.useIntegerZoom=o,this.zoom=a,this.statistics={max:-1/0};var s="color"===i?h:f;this.paintVertexAttributes=[{name:"a_".concat(n),type:"Float32",components:"color"===i?4:2,offset:0}],this.paintVertexArray=new s}return o(t,[{key:"defines",value:function(){return[]}},{key:"populatePaintArray",value:function(t,e){var n=this.paintVertexArray,r=n.length;n.reserve(t);var i=this.expression.evaluate({zoom:this.zoom},e),o=this.expression.evaluate({zoom:this.zoom+1},e);if("color"===this.type)for(var a=p(i),s=p(o),u=r;u<t;u++)n.emplaceBack(a[0],a[1],s[0],s[1]);else{for(var l=r;l<t;l++)n.emplaceBack(i,o);this.statistics.max=Math.max(this.statistics.max,i,o)}}},{key:"upload",value:function(t){this.paintVertexArray&&(this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes))}},{key:"destroy",value:function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}},{key:"interpolationFactor",value:function(t){return this.useIntegerZoom?this.expression.interpolationFactor(Math.floor(t),this.zoom,this.zoom+1):this.expression.interpolationFactor(t,this.zoom,this.zoom+1)}},{key:"setUniforms",value:function(t,e,n){t.gl.uniform1f(e.uniforms["a_".concat(this.name,"_t")],this.interpolationFactor(n.zoom))}}]),t}(),m=function(){function t(){r(this,t),this.binders={},this.cacheKey="",this._buffers=[]}return o(t,[{key:"populatePaintArrays",value:function(t,e){for(var n in this.binders)this.binders[n].populatePaintArray(t,e)}},{key:"defines",value:function(){var t=[];for(var e in this.binders)t.push.apply(t,this.binders[e].defines());return t}},{key:"setUniforms",value:function(t,e,n,r){for(var i in this.binders){this.binders[i].setUniforms(t,e,r,n.get(i))}}},{key:"getPaintVertexBuffers",value:function(){return this._buffers}},{key:"upload",value:function(t){for(var e in this.binders)this.binders[e].upload(t);var n=[];for(var r in this.binders){var i=this.binders[r];(i instanceof d||i instanceof v)&&i.paintVertexBuffer&&n.push(i.paintVertexBuffer)}this._buffers=n}},{key:"destroy",value:function(){for(var t in this.binders)this.binders[t].destroy()}}],[{key:"createDynamic",value:function(e,n,r){var i=new t,o=[];for(var a in e.paint._values)if(r(a)){var s=e.paint.get(a);if(s instanceof u&&s.property.specification["property-function"]){var l=b(a,e.type),c=s.property.specification.type,f=s.property.useIntegerZoom;"constant"===s.value.kind?(i.binders[a]=new y(s.value,l,c),o.push("/u_".concat(l))):"source"===s.value.kind?(i.binders[a]=new d(s.value,l,c),o.push("/a_".concat(l))):(i.binders[a]=new v(s.value,l,c,f,n),o.push("/z_".concat(l)))}}return i.cacheKey=o.sort().join(""),i}}]),t}(),g=function(){function t(e,n,i){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){return!0};r(this,t),this.programConfigurations={};var a=!0,s=!1,u=void 0;try{for(var l,c=n[Symbol.iterator]();!(a=(l=c.next()).done);a=!0){var f=l.value;this.programConfigurations[f.id]=m.createDynamic(f,i,o),this.programConfigurations[f.id].layoutAttributes=e}}catch(t){s=!0,u=t}finally{try{a||null==c.return||c.return()}finally{if(s)throw u}}}return o(t,[{key:"populatePaintArrays",value:function(t,e){for(var n in this.programConfigurations)this.programConfigurations[n].populatePaintArrays(t,e)}},{key:"get",value:function(t){return this.programConfigurations[t]}},{key:"upload",value:function(t){for(var e in this.programConfigurations)this.programConfigurations[e].upload(t)}},{key:"destroy",value:function(){for(var t in this.programConfigurations)this.programConfigurations[t].destroy()}}]),t}();function b(t,e){return{"text-opacity":"opacity","icon-opacity":"opacity","text-color":"fill_color","icon-color":"fill_color","text-halo-color":"halo_color","icon-halo-color":"halo_color","text-halo-blur":"halo_blur","icon-halo-blur":"halo_blur","text-halo-width":"halo_width","icon-halo-width":"halo_width","line-gap-width":"gapwidth"}[t]||t.replace("".concat(e,"-"),"").replace(/-/g,"_")}s("ConstantBinder",y),s("SourceExpressionBinder",d),s("CompositeExpressionBinder",v),s("ProgramConfiguration",m,{omit:["_buffers"]}),s("ProgramConfigurationSet",g),t.exports={ProgramConfiguration:m,ProgramConfigurationSet:g}},function(t,e,n){t.exports={LineIndexArray:n(10).LineIndexArray,TriangleIndexArray:n(10).TriangleIndexArray}},function(t,e,n){var r=n(2).isCounterClockwise;function i(t,e,n){if(t.length>1){if(o(t,e))return!0;for(var r=0;r<e.length;r++)if(s(e[r],t,n))return!0}for(var i=0;i<t.length;i++)if(s(t[i],e,n))return!0;return!1}function o(t,e){if(0===t.length||0===e.length)return!1;for(var n=0;n<t.length-1;n++)for(var r=t[n],i=t[n+1],o=0;o<e.length-1;o++){if(a(r,i,e[o],e[o+1]))return!0}return!1}function a(t,e,n,i){return r(t,n,i)!==r(e,n,i)&&r(t,e,n)!==r(t,e,i)}function s(t,e,n){var r=n*n;if(1===e.length)return t.distSqr(e[0])<r;for(var i=1;i<e.length;i++){if(u(t,e[i-1],e[i])<r)return!0}return!1}function u(t,e,n){var r=e.distSqr(n);if(0===r)return t.distSqr(e);var i=((t.x-e.x)*(n.x-e.x)+(t.y-e.y)*(n.y-e.y))/r;return i<0?t.distSqr(e):i>1?t.distSqr(n):t.distSqr(n.sub(e)._mult(i)._add(e))}function l(t,e){for(var n,r,i,o=!1,a=0;a<t.length;a++)for(var s=0,u=(n=t[a]).length-1;s<n.length;u=s++)r=n[s],i=n[u],r.y>e.y!=i.y>e.y&&e.x<(i.x-r.x)*(e.y-r.y)/(i.y-r.y)+r.x&&(o=!o);return o}function c(t,e){for(var n=!1,r=0,i=t.length-1;r<t.length;i=r++){var o=t[r],a=t[i];o.y>e.y!=a.y>e.y&&e.x<(a.x-o.x)*(e.y-o.y)/(a.y-o.y)+o.x&&(n=!n)}return n}t.exports={multiPolygonIntersectsBufferedMultiPoint:function(t,e,n){for(var r=0;r<t.length;r++)for(var i=t[r],o=0;o<e.length;o++)for(var a=e[o],u=0;u<a.length;u++){var l=a[u];if(c(i,l))return!0;if(s(l,i,n))return!0}return!1},multiPolygonIntersectsMultiPolygon:function(t,e){if(1===t.length&&1===t[0].length)return l(e,t[0][0]);for(var n=0;n<e.length;n++)for(var r=e[n],i=0;i<r.length;i++)if(l(t,r[i]))return!0;for(var a=0;a<t.length;a++){for(var s=t[a],u=0;u<s.length;u++)if(l(e,s[u]))return!0;for(var c=0;c<e.length;c++)if(o(s,e[c]))return!0}return!1},multiPolygonIntersectsBufferedMultiLine:function(t,e,n){for(var r=0;r<e.length;r++)for(var o=e[r],a=0;a<t.length;a++){var s=t[a];if(s.length>=3)for(var u=0;u<o.length;u++)if(c(s,o[u]))return!0;if(i(s,o,n))return!0}return!1},polygonIntersectsPolygon:function(t,e){for(var n=0;n<t.length;n++)if(c(e,t[n]))return!0;for(var r=0;r<e.length;r++)if(c(t,e[r]))return!0;return!!o(t,e)},distToSegmentSquared:u}},function(t,e,n){function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function o(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}var a=n(0),s=n(3).register;function u(t,e,n,r){var i=e.width,o=e.height;if(r){if(r.length!==i*o*n)throw new RangeError("mismatched image size")}else r=new Uint8Array(i*o*n);return t.width=i,t.height=o,t.data=r,t}function l(t,e,n){var r=e.width,i=e.height;if(r!==t.width||i!==t.height){var o=u({},{width:r,height:i},n);c(t,o,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,r),height:Math.min(t.height,i)},n),t.width=r,t.height=i,t.data=o.data}}function c(t,e,n,r,i,o){if(0===i.width||0===i.height)return e;if(i.width>t.width||i.height>t.height||n.x>t.width-i.width||n.y>t.height-i.height)throw new RangeError("out of range source coordinates for image copy");if(i.width>e.width||i.height>e.height||r.x>e.width-i.width||r.y>e.height-i.height)throw new RangeError("out of range destination coordinates for image copy");var s=t.data,u=e.data;a(s!==u);for(var l=0;l<i.height;l++)for(var c=((n.y+l)*t.width+n.x)*o,f=((r.y+l)*e.width+r.x)*o,h=0;h<i.width*o;h++)u[f+h]=s[c+h];return e}var f=function(){function t(e,n){r(this,t),u(this,e,1,n)}return o(t,[{key:"resize",value:function(t){l(this,t,1)}},{key:"clone",value:function(){return new t({width:this.width,height:this.height},new Uint8Array(this.data))}}],[{key:"copy",value:function(t,e,n,r,i){c(t,e,n,r,i,1)}}]),t}(),h=function(){function t(e,n){r(this,t),u(this,e,4,n)}return o(t,[{key:"resize",value:function(t){l(this,t,4)}},{key:"clone",value:function(){return new t({width:this.width,height:this.height},new Uint8Array(this.data))}}],[{key:"copy",value:function(t,e,n,r,i){c(t,e,n,r,i,4)}}]),t}();s("AlphaImage",f),s("RGBAImage",h),t.exports={AlphaImage:f,RGBAImage:h}},function(t,e,n){var r=n(6);t.exports={getMaximumPaintValue:function(t,e,n){var r=e.paint.get(t).value;return"constant"===r.kind?r.value:n.programConfigurations.get(e.id).binders[t].statistics.max},translateDistance:function(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])},translate:function(t,e,n,i,o){if(!e[0]&&!e[1])return t;var a=r.convert(e);"viewport"===n&&a._rotate(-i);for(var s=[],u=0;u<t.length;u++){for(var l=t[u],c=[],f=0;f<l.length;f++)c.push(l[f].sub(a._mult(o)));s.push(c)}return s}}},function(t,e,n){var r=n(136);t.exports.allowsIdeographicBreaking=function(t){var n=!0,r=!1,i=void 0;try{for(var o,a=t[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value;if(!e.charAllowsIdeographicBreaking(s.charCodeAt(0)))return!1}}catch(t){r=!0,i=t}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}return!0},t.exports.allowsVerticalWritingMode=function(t){var n=!0,r=!1,i=void 0;try{for(var o,a=t[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value;if(e.charHasUprightVerticalOrientation(s.charCodeAt(0)))return!0}}catch(t){r=!0,i=t}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}return!1},t.exports.allowsLetterSpacing=function(t){var n=!0,r=!1,i=void 0;try{for(var o,a=t[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value;if(!e.charAllowsLetterSpacing(s.charCodeAt(0)))return!1}}catch(t){r=!0,i=t}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}return!0},t.exports.charAllowsLetterSpacing=function(t){return!r.Arabic(t)&&(!r["Arabic Supplement"](t)&&(!r["Arabic Extended-A"](t)&&(!r["Arabic Presentation Forms-A"](t)&&!r["Arabic Presentation Forms-B"](t))))},t.exports.charAllowsIdeographicBreaking=function(t){return!(t<11904)&&(!!r["Bopomofo Extended"](t)||(!!r.Bopomofo(t)||(!!r["CJK Compatibility Forms"](t)||(!!r["CJK Compatibility Ideographs"](t)||(!!r["CJK Compatibility"](t)||(!!r["CJK Radicals Supplement"](t)||(!!r["CJK Strokes"](t)||(!!r["CJK Symbols and Punctuation"](t)||(!!r["CJK Unified Ideographs Extension A"](t)||(!!r["CJK Unified Ideographs"](t)||(!!r["Enclosed CJK Letters and Months"](t)||(!!r["Halfwidth and Fullwidth Forms"](t)||(!!r.Hiragana(t)||(!!r["Ideographic Description Characters"](t)||(!!r["Kangxi Radicals"](t)||(!!r["Katakana Phonetic Extensions"](t)||(!!r.Katakana(t)||(!!r["Vertical Forms"](t)||(!!r["Yi Radicals"](t)||!!r["Yi Syllables"](t))))))))))))))))))))},e.charHasUprightVerticalOrientation=function(t){return 746===t||747===t||!(t<4352)&&(!!r["Bopomofo Extended"](t)||(!!r.Bopomofo(t)||(!(!r["CJK Compatibility Forms"](t)||t>=65097&&t<=65103)||(!!r["CJK Compatibility Ideographs"](t)||(!!r["CJK Compatibility"](t)||(!!r["CJK Radicals Supplement"](t)||(!!r["CJK Strokes"](t)||(!(!r["CJK Symbols and Punctuation"](t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||(!!r["CJK Unified Ideographs Extension A"](t)||(!!r["CJK Unified Ideographs"](t)||(!!r["Enclosed CJK Letters and Months"](t)||(!!r["Hangul Compatibility Jamo"](t)||(!!r["Hangul Jamo Extended-A"](t)||(!!r["Hangul Jamo Extended-B"](t)||(!!r["Hangul Jamo"](t)||(!!r["Hangul Syllables"](t)||(!!r.Hiragana(t)||(!!r["Ideographic Description Characters"](t)||(!!r.Kanbun(t)||(!!r["Kangxi Radicals"](t)||(!!r["Katakana Phonetic Extensions"](t)||(!(!r.Katakana(t)||12540===t)||(!(!r["Halfwidth and Fullwidth Forms"](t)||65288===t||65289===t||65293===t||t>=65306&&t<=65310||65339===t||65341===t||65343===t||t>=65371&&t<=65503||65507===t||t>=65512&&t<=65519)||(!(!r["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||(!!r["Unified Canadian Aboriginal Syllabics"](t)||(!!r["Unified Canadian Aboriginal Syllabics Extended"](t)||(!!r["Vertical Forms"](t)||(!!r["Yijing Hexagram Symbols"](t)||(!!r["Yi Syllables"](t)||!!r["Yi Radicals"](t))))))))))))))))))))))))))))))},e.charHasNeutralVerticalOrientation=function(t){return!(!r["Latin-1 Supplement"](t)||167!==t&&169!==t&&174!==t&&177!==t&&188!==t&&189!==t&&190!==t&&215!==t&&247!==t)||(!(!r["General Punctuation"](t)||8214!==t&&8224!==t&&8225!==t&&8240!==t&&8241!==t&&8251!==t&&8252!==t&&8258!==t&&8263!==t&&8264!==t&&8265!==t&&8273!==t)||(!!r["Letterlike Symbols"](t)||(!!r["Number Forms"](t)||(!(!r["Miscellaneous Technical"](t)||!(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||9003===t||t>=9085&&t<=9114||t>=9150&&t<=9165||9167===t||t>=9169&&t<=9179||t>=9186&&t<=9215))||(!(!r["Control Pictures"](t)||9251===t)||(!!r["Optical Character Recognition"](t)||(!!r["Enclosed Alphanumerics"](t)||(!!r["Geometric Shapes"](t)||(!(!r["Miscellaneous Symbols"](t)||t>=9754&&t<=9759)||(!(!r["Miscellaneous Symbols and Arrows"](t)||!(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243))||(!!r["CJK Symbols and Punctuation"](t)||(!!r.Katakana(t)||(!!r["Private Use Area"](t)||(!!r["CJK Compatibility Forms"](t)||(!!r["Small Form Variants"](t)||(!!r["Halfwidth and Fullwidth Forms"](t)||(8734===t||8756===t||8757===t||t>=9984&&t<=10087||t>=10102&&t<=10131||65532===t||65533===t)))))))))))))))))},e.charHasRotatedVerticalOrientation=function(t){return!(e.charHasUprightVerticalOrientation(t)||e.charHasNeutralVerticalOrientation(t))}},function(t,e,n){"use strict";t.exports=i;var r=n(146);function i(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}i.Varint=0,i.Fixed64=1,i.Bytes=2,i.Fixed32=5;function o(t){return t.type===i.Bytes?t.readVarint()+t.pos:t.pos+1}function a(t,e,n){return n?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function s(t,e,n){var r=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));n.realloc(r);for(var i=n.pos-1;i>=t;i--)n.buf[i+r]=n.buf[i]}function u(t,e){for(var n=0;n<t.length;n++)e.writeVarint(t[n])}function l(t,e){for(var n=0;n<t.length;n++)e.writeSVarint(t[n])}function c(t,e){for(var n=0;n<t.length;n++)e.writeFloat(t[n])}function f(t,e){for(var n=0;n<t.length;n++)e.writeDouble(t[n])}function h(t,e){for(var n=0;n<t.length;n++)e.writeBoolean(t[n])}function p(t,e){for(var n=0;n<t.length;n++)e.writeFixed32(t[n])}function y(t,e){for(var n=0;n<t.length;n++)e.writeSFixed32(t[n])}function d(t,e){for(var n=0;n<t.length;n++)e.writeFixed64(t[n])}function v(t,e){for(var n=0;n<t.length;n++)e.writeSFixed64(t[n])}function m(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function g(t,e,n){t[n]=e,t[n+1]=e>>>8,t[n+2]=e>>>16,t[n+3]=e>>>24}function b(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}i.prototype={destroy:function(){this.buf=null},readFields:function(t,e,n){for(n=n||this.length;this.pos<n;){var r=this.readVarint(),i=r>>3,o=this.pos;this.type=7&r,t(i,e,this),this.pos===o&&this.skip(r)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=m(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=b(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=m(this.buf,this.pos)+4294967296*m(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=m(this.buf,this.pos)+4294967296*b(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=r.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=r.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,n,r=this.buf;return e=127&(n=r[this.pos++]),n<128?e:(e|=(127&(n=r[this.pos++]))<<7,n<128?e:(e|=(127&(n=r[this.pos++]))<<14,n<128?e:(e|=(127&(n=r[this.pos++]))<<21,n<128?e:function(t,e,n){var r,i,o=n.buf;if(i=o[n.pos++],r=(112&i)>>4,i<128)return a(t,r,e);if(i=o[n.pos++],r|=(127&i)<<3,i<128)return a(t,r,e);if(i=o[n.pos++],r|=(127&i)<<10,i<128)return a(t,r,e);if(i=o[n.pos++],r|=(127&i)<<17,i<128)return a(t,r,e);if(i=o[n.pos++],r|=(127&i)<<24,i<128)return a(t,r,e);if(i=o[n.pos++],r|=(1&i)<<31,i<128)return a(t,r,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(n=r[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=function(t,e,n){var r="",i=e;for(;i<n;){var o,a,s,u=t[i],l=null,c=u>239?4:u>223?3:u>191?2:1;if(i+c>n)break;1===c?u<128&&(l=u):2===c?128==(192&(o=t[i+1]))&&(l=(31&u)<<6|63&o)<=127&&(l=null):3===c?(o=t[i+1],a=t[i+2],128==(192&o)&&128==(192&a)&&((l=(15&u)<<12|(63&o)<<6|63&a)<=2047||l>=55296&&l<=57343)&&(l=null)):4===c&&(o=t[i+1],a=t[i+2],s=t[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&((l=(15&u)<<18|(63&o)<<12|(63&a)<<6|63&s)<=65535||l>=1114112)&&(l=null)),null===l?(l=65533,c=1):l>65535&&(l-=65536,r+=String.fromCharCode(l>>>10&1023|55296),l=56320|1023&l),r+=String.fromCharCode(l),i+=c}return r}(this.buf,this.pos,t);return this.pos=t,e},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==i.Bytes)return t.push(this.readVarint(e));var n=o(this);for(t=t||[];this.pos<n;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==i.Bytes)return t.push(this.readSVarint());var e=o(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==i.Bytes)return t.push(this.readBoolean());var e=o(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==i.Bytes)return t.push(this.readFloat());var e=o(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==i.Bytes)return t.push(this.readDouble());var e=o(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==i.Bytes)return t.push(this.readFixed32());var e=o(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==i.Bytes)return t.push(this.readSFixed32());var e=o(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==i.Bytes)return t.push(this.readFixed64());var e=o(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==i.Bytes)return t.push(this.readSFixed64());var e=o(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===i.Varint)for(;this.buf[this.pos++]>127;);else if(e===i.Bytes)this.pos=this.readVarint()+this.pos;else if(e===i.Fixed32)this.pos+=4;else{if(e!==i.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var n=new Uint8Array(e);n.set(this.buf),this.buf=n,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),g(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),g(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),g(this.buf,-1&t,this.pos),g(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),g(this.buf,-1&t,this.pos),g(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var n,r;t>=0?(n=t%4294967296|0,r=t/4294967296|0):(r=~(-t/4294967296),4294967295^(n=~(-t%4294967296))?n=n+1|0:(n=0,r=r+1|0));if(t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn\'t fit into 10 bytes");e.realloc(10),function(t,e,n){n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos]=127&t}(n,0,e),function(t,e){var n=(7&t)<<4;if(e.buf[e.pos++]|=n|((t>>>=3)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;e.buf[e.pos++]=127&t}(r,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,n){for(var r,i,o=0;o<e.length;o++){if((r=e.charCodeAt(o))>55295&&r<57344){if(!i){r>56319||o+1===e.length?(t[n++]=239,t[n++]=191,t[n++]=189):i=r;continue}if(r<56320){t[n++]=239,t[n++]=191,t[n++]=189,i=r;continue}r=i-55296<<10|r-56320|65536,i=null}else i&&(t[n++]=239,t[n++]=191,t[n++]=189,i=null);r<128?t[n++]=r:(r<2048?t[n++]=r>>6|192:(r<65536?t[n++]=r>>12|224:(t[n++]=r>>18|240,t[n++]=r>>12&63|128),t[n++]=r>>6&63|128),t[n++]=63&r|128)}return n}(this.buf,t,this.pos);var n=this.pos-e;n>=128&&s(e,n,this),this.pos=e-1,this.writeVarint(n),this.pos+=n},writeFloat:function(t){this.realloc(4),r.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),r.write(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var n=0;n<e;n++)this.buf[this.pos++]=t[n]},writeRawMessage:function(t,e){this.pos++;var n=this.pos;t(e,this);var r=this.pos-n;r>=128&&s(n,r,this),this.pos=n-1,this.writeVarint(r),this.pos+=r},writeMessage:function(t,e,n){this.writeTag(t,i.Bytes),this.writeRawMessage(e,n)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,u,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,l,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,h,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,c,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,f,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,p,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,y,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,d,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,v,e)},writeBytesField:function(t,e){this.writeTag(t,i.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,i.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,i.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,i.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,i.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,i.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,i.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,i.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,i.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,i.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}}},function(t,e,n){function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var i=n(0),o=n(52),a=n(11).Color,s=["Unknown","Point","LineString","Polygon"],u=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.scope=new o,this._parseColorCache={}}var e,n,u;return e=t,(n=[{key:"id",value:function(){return this.feature&&"id"in this.feature?this.feature.id:null}},{key:"geometryType",value:function(){return this.feature?"number"==typeof this.feature.type?s[this.feature.type]:this.feature.type:null}},{key:"properties",value:function(){return this.feature&&this.feature.properties||{}}},{key:"pushScope",value:function(t){this.scope=this.scope.concat(t)}},{key:"popScope",value:function(){i(this.scope.parent),this.scope=this.scope.parent}},{key:"parseColor",value:function(t){var e=this._parseColorCache[t];return e||(e=this._parseColorCache[t]=a.parse(t)),e}}])&&r(e.prototype,n),u&&r(e,u),t}();t.exports=u},function(t,e,n){function r(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||i(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function i(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}function o(t,e){return s(t)||function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}(t,e)||a()}function a(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function s(t){if(Array.isArray(t))return t}function u(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var l=n(46),c=n(19),f=n(4),h=f.toString,p=f.NumberType,y=n(60).findStopLessThanOrEqualTo,d=function(){function t(e,n,r,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.type=e,this.interpolation=n,this.input=r,this.labels=[],this.outputs=[];var a=!0,s=!1,u=void 0;try{for(var l,c=i[Symbol.iterator]();!(a=(l=c.next()).done);a=!0){var f=o(l.value,2),h=f[0],p=f[1];this.labels.push(h),this.outputs.push(p)}}catch(t){s=!0,u=t}finally{try{a||null==c.return||c.return()}finally{if(s)throw u}}}var e,n,f;return e=t,f=[{key:"interpolationFactor",value:function(t,e,n,r){var i=0;if("exponential"===t.name)i=v(e,t.base,n,r);else if("linear"===t.name)i=v(e,1,n,r);else if("cubic-bezier"===t.name){var o=t.controlPoints;i=new l(o[0],o[1],o[2],o[3]).solve(v(e,1,n,r))}return i}},{key:"parse",value:function(e,n){var r,o=s(r=e)||i(r)||a(),u=o[1],l=o[2],c=o.slice(3);if(!Array.isArray(u)||0===u.length)return n.error("Expected an interpolation type expression.",1);if("linear"===u[0])u={name:"linear"};else if("exponential"===u[0]){var f=u[1];if("number"!=typeof f)return n.error("Exponential interpolation requires a numeric base.",1,1);u={name:"exponential",base:f}}else{if("cubic-bezier"!==u[0])return n.error("Unknown interpolation type ".concat(String(u[0])),1,0);var y=u.slice(1);if(4!==y.length||y.some(function(t){return"number"!=typeof t||t<0||t>1}))return n.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);u={name:"cubic-bezier",controlPoints:y}}if(e.length-1<4)return n.error("Expected at least 4 arguments, but found only ".concat(e.length-1,"."));if((e.length-1)%2!=0)return n.error("Expected an even number of arguments.");if(!(l=n.parse(l,2,p)))return null;var d=[],v=null;n.expectedType&&"value"!==n.expectedType.kind&&(v=n.expectedType);for(var m=0;m<c.length;m+=2){var g=c[m],b=c[m+1],x=m+3,w=m+4;if("number"!=typeof g)return n.error(\'Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.\',x);if(d.length&&d[d.length-1][0]>=g)return n.error(\'Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.\',x);var k=n.parse(b,w,v);if(!k)return null;v=v||k.type,d.push([g,k])}return"number"===v.kind||"color"===v.kind||"array"===v.kind&&"number"===v.itemType.kind&&"number"==typeof v.N?new t(v,u,l,d):n.error("Type ".concat(h(v)," is not interpolatable."))}}],(n=[{key:"evaluate",value:function(e){var n=this.labels,r=this.outputs;if(1===n.length)return r[0].evaluate(e);var i=this.input.evaluate(e);if(i<=n[0])return r[0].evaluate(e);var o=n.length;if(i>=n[o-1])return r[o-1].evaluate(e);var a=y(n,i),s=n[a],u=n[a+1],l=t.interpolationFactor(this.interpolation,i,s,u),f=r[a].evaluate(e),h=r[a+1].evaluate(e);return c[this.type.kind.toLowerCase()](f,h,l)}},{key:"eachChild",value:function(t){t(this.input);var e=!0,n=!1,r=void 0;try{for(var i,o=this.outputs[Symbol.iterator]();!(e=(i=o.next()).done);e=!0){t(i.value)}}catch(t){n=!0,r=t}finally{try{e||null==o.return||o.return()}finally{if(n)throw r}}}},{key:"possibleOutputs",value:function(){var t;return(t=[]).concat.apply(t,r(this.outputs.map(function(t){return t.possibleOutputs()})))}}])&&u(e.prototype,n),f&&u(e,f),t}();function v(t,e,n,r){var i=r-n,o=t-n;return 0===i?0:1===e?o/i:(Math.pow(e,o)-1)/(Math.pow(e,i)-1)}t.exports=d},function(t,e,n){function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=n(100),o=n(13),a=n(22),s=n(7),u=n(19),l=n(34);function c(t){return t}function f(t,e,n){return void 0!==t?t:void 0!==e?e:void 0!==n?n:void 0}function h(t,e,n,i,o){return f(r(n)===o?i[n]:void 0,t.default,e.default)}function p(t,e,n){if("number"!==s(n))return f(t.default,e.default);var r=t.stops.length;if(1===r)return t.stops[0][1];if(n<=t.stops[0][0])return t.stops[0][1];if(n>=t.stops[r-1][0])return t.stops[r-1][1];var i=v(t.stops,n);return t.stops[i][1]}function y(t,e,n){var r=void 0!==t.base?t.base:1;if("number"!==s(n))return f(t.default,e.default);var o=t.stops.length;if(1===o)return t.stops[0][1];if(n<=t.stops[0][0])return t.stops[0][1];if(n>=t.stops[o-1][0])return t.stops[o-1][1];var a=v(t.stops,n),l=function(t,e,n,r){var i=r-n,o=t-n;return 0===i?0:1===e?o/i:(Math.pow(e,o)-1)/(Math.pow(e,i)-1)}(n,r,t.stops[a][0],t.stops[a+1][0]),h=t.stops[a][1],p=t.stops[a+1][1],y=u[e.type]||c;if(t.colorSpace&&"rgb"!==t.colorSpace){var d=i[t.colorSpace];y=function(t,e){return d.reverse(d.interpolate(d.forward(t),d.forward(e),l))}}return"function"==typeof h.evaluate?{evaluate:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=h.evaluate.apply(void 0,e),i=p.evaluate.apply(void 0,e);if(void 0!==r&&void 0!==i)return y(r,i,l)}}:y(h,p,l)}function d(t,e,n){return"color"===e.type?n=o.parse(n):s(n)===e.type||"enum"===e.type&&e.values[n]||(n=void 0),f(n,t.default,e.default)}function v(t,e){for(var n,r,i=0,o=t.length-1,a=0;i<=o;){if(n=t[a=Math.floor((i+o)/2)][0],r=t[a+1][0],e===n||e>n&&e<r)return a;n<e?i=a+1:n>e&&(o=a-1)}return Math.max(a-1,0)}t.exports={createFunction:function t(e,n){var s,u,c,v="color"===n.type,m=e.stops&&"object"===r(e.stops[0][0]),g=m||void 0!==e.property,b=m||!g,x=e.type||("interpolated"===n.function?"exponential":"interval");if(v&&((e=a({},e)).stops&&(e.stops=e.stops.map(function(t){return[t[0],o.parse(t[1])]})),e.default?e.default=o.parse(e.default):e.default=o.parse(n.default)),e.colorSpace&&"rgb"!==e.colorSpace&&!i[e.colorSpace])throw new Error("Unknown color space: ".concat(e.colorSpace));if("exponential"===x)s=y;else if("interval"===x)s=p;else if("categorical"===x){s=h,u=Object.create(null);var w=!0,k=!1,_=void 0;try{for(var S,A=e.stops[Symbol.iterator]();!(w=(S=A.next()).done);w=!0){var T=S.value;u[T[0]]=T[1]}}catch(t){k=!0,_=t}finally{try{w||null==A.return||A.return()}finally{if(k)throw _}}c=r(e.stops[0][0])}else{if("identity"!==x)throw new Error(\'Unknown function type "\'.concat(x,\'"\'));s=d}if(m){for(var j={},O=[],z=0;z<e.stops.length;z++){var P=e.stops[z],E=P[0].zoom;void 0===j[E]&&(j[E]={zoom:E,type:e.type,property:e.property,default:e.default,stops:[]},O.push(E)),j[E].stops.push([P[0].value,P[1]])}for(var C=[],M=0,I=O;M<I.length;M++){var B=I[M];C.push([j[B].zoom,t(j[B],n)])}return{kind:"composite",interpolationFactor:l.interpolationFactor.bind(void 0,{name:"linear"}),zoomStops:C.map(function(t){return t[0]}),evaluate:function(t,r){var i=t.zoom;return y({stops:C,base:e.base},n,i).evaluate(i,r)}}}return b?{kind:"camera",interpolationFactor:"exponential"===x?l.interpolationFactor.bind(void 0,{name:"exponential",base:void 0!==e.base?e.base:1}):function(){return 0},zoomStops:e.stops.map(function(t){return t[0]}),evaluate:function(t){var r=t.zoom;return s(e,n,r,u,c)}}:{kind:"source",evaluate:function(t,r){var i=r&&r.properties?r.properties[e.property]:void 0;return void 0===i?f(e.default,n.default):s(e,n,i,u,c)}}},isFunction:function(t){return"object"===r(t)&&null!==t&&!Array.isArray(t)}}},function(t,e){t.exports=self},function(t,e,n){var r=n(5),i=n(12);t.exports=function(t){var e=t.key,n=t.value,o=t.valueSpec,a=[];return Array.isArray(o.values)?-1===o.values.indexOf(i(n))&&a.push(new r(e,n,"expected one of [".concat(o.values.join(", "),"], ").concat(JSON.stringify(n)," found"))):-1===Object.keys(o.values).indexOf(i(n))&&a.push(new r(e,n,"expected one of [".concat(Object.keys(o.values).join(", "),"], ").concat(JSON.stringify(n)," found"))),a}},function(t,e,n){var r=n(5),i=n(68),o=n(37),a=n(7),s=n(12),u=n(22),l=n(39).isExpressionFilter;t.exports=function(t){return l(s.deep(t.value))?i(u({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function t(e){var n=e.value;var i=e.key;if("array"!==a(n))return[new r(i,n,"array expected, ".concat(a(n)," found"))];var u=e.styleSpec;var l;var c=[];if(n.length<1)return[new r(i,n,"filter array must have at least 1 element")];c=c.concat(o({key:"".concat(i,"[0]"),value:n[0],valueSpec:u.filter_operator,style:e.style,styleSpec:e.styleSpec}));switch(s(n[0])){case"<":case"<=":case">":case">=":n.length>=2&&"$type"===s(n[1])&&c.push(new r(i,n,\'"$type" cannot be use with operator "\'.concat(n[0],\'"\')));case"==":case"!=":3!==n.length&&c.push(new r(i,n,\'filter array for operator "\'.concat(n[0],\'" must have 3 elements\')));case"in":case"!in":n.length>=2&&"string"!==(l=a(n[1]))&&c.push(new r("".concat(i,"[1]"),n[1],"string expected, ".concat(l," found")));for(var f=2;f<n.length;f++)l=a(n[f]),"$type"===s(n[1])?c=c.concat(o({key:"".concat(i,"[").concat(f,"]"),value:n[f],valueSpec:u.geometry_type,style:e.style,styleSpec:e.styleSpec})):"string"!==l&&"number"!==l&&"boolean"!==l&&c.push(new r("".concat(i,"[").concat(f,"]"),n[f],"string, number, or boolean expected, ".concat(l," found")));break;case"any":case"all":case"none":for(var h=1;h<n.length;h++)c=c.concat(t({key:"".concat(i,"[").concat(h,"]"),value:n[h],style:e.style,styleSpec:e.styleSpec}));break;case"has":case"!has":l=a(n[1]),2!==n.length?c.push(new r(i,n,\'filter array for "\'.concat(n[0],\'" operator must have 2 elements\'))):"string"!==l&&c.push(new r("".concat(i,"[1]"),n[1],"string expected, ".concat(l," found")))}return c}(t)}},function(t,e,n){function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=n(14).createExpression;function o(t){if(!Array.isArray(t)||0===t.length)return!1;switch(t[0]){case"has":return t.length>=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3===t.length&&(Array.isArray(t[1])||Array.isArray(t[2]));case"any":case"all":var e=!0,n=!1,r=void 0;try{for(var i,a=t.slice(1)[Symbol.iterator]();!(e=(i=a.next()).done);e=!0){var s=i.value;if(!o(s)&&"boolean"!=typeof s)return!1}}catch(t){n=!0,r=t}finally{try{e||null==a.return||a.return()}finally{if(n)throw r}}return!0;default:return!0}}t.exports=function(t){if(!t)return function(){return!0};o(t)||(t=u(t));var e=i(t,a);if("error"===e.result)throw new Error(e.value.map(function(t){return"".concat(t.key,": ").concat(t.message)}).join(", "));return function(t,n){return e.value.evaluate(t,n)}},t.exports.isExpressionFilter=o;var a={type:"boolean",default:!1,function:!0,"property-function":!0,"zoom-function":!0};function s(t,e){return t<e?-1:t>e?1:0}function u(t){if(!t)return!0;var e,n=t[0];return t.length<=1?"any"!==n:"=="===n?l(t[1],t[2],"=="):"!="===n?h(l(t[1],t[2],"==")):"<"===n||">"===n||"<="===n||">="===n?l(t[1],t[2],n):"any"===n?(e=t.slice(1),["any"].concat(e.map(u))):"all"===n?["all"].concat(t.slice(1).map(u)):"none"===n?["all"].concat(t.slice(1).map(u).map(h)):"in"===n?c(t[1],t.slice(2)):"!in"===n?h(c(t[1],t.slice(2))):"has"===n?f(t[1]):"!has"!==n||h(f(t[1]))}function l(t,e,n){switch(t){case"$type":return["filter-type-".concat(n),e];case"$id":return["filter-id-".concat(n),e];default:return["filter-".concat(n),t,e]}}function c(t,e){if(0===e.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some(function(t){return r(t)!==r(e[0])})?["filter-in-large",t,["literal",e.sort(s)]]:["filter-in-small",t,["literal",e]]}}function f(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function h(t){return["!",t]}},function(t,e,n){var r=n(120),i=n(2).calculateSignedArea;function o(t,e){return e.area-t.area}t.exports=function(t,e){var n=t.length;if(n<=1)return[t];for(var a,s,u=[],l=0;l<n;l++){var c=i(t[l]);0!==c&&(t[l].area=Math.abs(c),void 0===s&&(s=c<0),s===c<0?(a&&u.push(a),a=[t[l]]):a.push(t[l]))}if(a&&u.push(a),e>1)for(var f=0;f<u.length;f++)u[f].length<=e||(r(u[f],e,1,u[f].length-1,o),u[f]=u[f].slice(0,e));return u}},function(t,e,n){function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var i=n(131),o=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.zoom=e,n?(this.now=n.now,this.fadeDuration=n.fadeDuration,this.zoomHistory=n.zoomHistory,this.transition=n.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new i,this.transition={})}var e,n,o;return e=t,(n=[{key:"crossFadingFactor",value:function(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}}])&&r(e.prototype,n),o&&r(e,o),t}();t.exports=o},function(t,e,n){function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function o(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}var a=n(133),s=a.symbolLayoutAttributes,u=a.collisionVertexAttributes,l=a.collisionBoxLayout,c=a.collisionCircleLayout,f=a.dynamicLayoutAttributes,h=n(10),p=h.SymbolLayoutArray,y=h.SymbolDynamicLayoutArray,d=h.SymbolOpacityArray,v=h.CollisionBoxLayoutArray,m=h.CollisionCircleLayoutArray,g=h.CollisionVertexArray,b=h.PlacedSymbolArray,x=h.GlyphOffsetArray,w=h.SymbolLineVertexArray,k=n(6),_=n(25).SegmentVector,S=n(26).ProgramConfigurationSet,A=n(27),T=A.TriangleIndexArray,j=A.LineIndexArray,O=n(134),z=n(135),P=n(31),E=n(20),C=n(21).VectorTileFeature.types,M=n(81),I=(n(45),n(137).getSizeData),B=n(3).register,V=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function L(t,e,n,r,i,o,a,s){t.emplaceBack(e,n,Math.round(64*r),Math.round(64*i),o,a,s?s[0]:0,s?s[1]:0)}function F(t,e,n){t.emplaceBack(e.x,e.y,n),t.emplaceBack(e.x,e.y,n),t.emplaceBack(e.x,e.y,n),t.emplaceBack(e.x,e.y,n)}var R=function(){function t(e){r(this,t),this.layoutVertexArray=new p,this.indexArray=new T,this.programConfigurations=e,this.segments=new _,this.dynamicLayoutVertexArray=new y,this.opacityVertexArray=new d,this.placedSymbolArray=new b}return o(t,[{key:"upload",value:function(t,e){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,s.members),this.indexBuffer=t.createIndexBuffer(this.indexArray,e),this.programConfigurations.upload(t),this.dynamicLayoutVertexBuffer=t.createVertexBuffer(this.dynamicLayoutVertexArray,f.members,!0),this.opacityVertexBuffer=t.createVertexBuffer(this.opacityVertexArray,V,!0),this.opacityVertexBuffer.itemSize=1}},{key:"destroy",value:function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())}}]),t}();B("SymbolBuffers",R);var D=function(){function t(e,n,i){r(this,t),this.layoutVertexArray=new e,this.layoutAttributes=n,this.indexArray=new i,this.segments=new _,this.collisionVertexArray=new g}return o(t,[{key:"upload",value:function(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=t.createVertexBuffer(this.collisionVertexArray,u.members,!0)}},{key:"destroy",value:function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}}]),t}();B("CollisionBuffers",D);var q=function(){function t(e){r(this,t),this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(function(t){return t.id}),this.index=e.index,this.pixelRatio=e.pixelRatio;var n=this.layers[0]._unevaluatedLayout._values;this.textSizeData=I(this.zoom,n["text-size"]),this.iconSizeData=I(this.zoom,n["icon-size"]);var i=this.layers[0].layout;this.sortFeaturesByY=i.get("text-allow-overlap")||i.get("icon-allow-overlap")||i.get("text-ignore-placement")||i.get("icon-ignore-placement")}return o(t,[{key:"createArrays",value:function(){this.text=new R(new S(s.members,this.layers,this.zoom,function(t){return/^text/.test(t)})),this.icon=new R(new S(s.members,this.layers,this.zoom,function(t){return/^icon/.test(t)})),this.collisionBox=new D(v,l.members,j),this.collisionCircle=new D(m,c.members,T),this.glyphOffsetArray=new x,this.lineVertexArray=new w}},{key:"populate",value:function(t,e){var n=this.layers[0],r=n.layout,i=r.get("text-font"),o=r.get("text-field"),a=r.get("icon-image"),s=("constant"!==o.value.kind||o.value.value.length>0)&&("constant"!==i.value.kind||i.value.value.length>0),u="constant"!==a.value.kind||a.value.value&&a.value.value.length>0;if(this.features=[],s||u){var l=e.iconDependencies,c=e.glyphDependencies,f={zoom:this.zoom},h=!0,p=!1,y=void 0;try{for(var d,v=t[Symbol.iterator]();!(h=(d=v.next()).done);h=!0){var m=d.value,g=m.feature,b=m.index,x=m.sourceLayerIndex;if(n._featureFilter(f,g)){var w=void 0;s&&(w=n.getValueAndResolveTokens("text-field",g),w=O(w,n,g));var k=void 0;if(u&&(k=n.getValueAndResolveTokens("icon-image",g)),w||k){var _={text:w,icon:k,index:b,sourceLayerIndex:x,geometry:E(g),properties:g.properties,type:C[g.type]};if(void 0!==g.id&&(_.id=g.id),this.features.push(_),k&&(l[k]=!0),w)for(var S=i.evaluate(g).join(","),A=c[S]=c[S]||{},T="map"===r.get("text-rotation-alignment")&&"line"===r.get("symbol-placement"),j=P.allowsVerticalWritingMode(w),I=0;I<w.length;I++)if(A[w.charCodeAt(I)]=!0,T&&j){var B=M.lookup[w.charAt(I)];B&&(A[B.charCodeAt(0)]=!0)}}}}}catch(t){p=!0,y=t}finally{try{h||null==v.return||v.return()}finally{if(p)throw y}}"line"===r.get("symbol-placement")&&(this.features=z(this.features))}}},{key:"isEmpty",value:function(){return 0===this.symbolInstances.length}},{key:"upload",value:function(t){this.text.upload(t,this.sortFeaturesByY),this.icon.upload(t,this.sortFeaturesByY),this.collisionBox.upload(t),this.collisionCircle.upload(t)}},{key:"destroy",value:function(){this.text.destroy(),this.icon.destroy(),this.collisionBox.destroy(),this.collisionCircle.destroy()}},{key:"addToLineVertexArray",value:function(t,e){var n=this.lineVertexArray.length;if(void 0!==t.segment){for(var r=t.dist(e[t.segment+1]),i=t.dist(e[t.segment]),o={},a=t.segment+1;a<e.length;a++)o[a]={x:e[a].x,y:e[a].y,tileUnitDistanceFromAnchor:r},a<e.length-1&&(r+=e[a+1].dist(e[a]));for(var s=t.segment||0;s>=0;s--)o[s]={x:e[s].x,y:e[s].y,tileUnitDistanceFromAnchor:i},s>0&&(i+=e[s-1].dist(e[s]));for(var u=0;u<e.length;u++){var l=o[u];this.lineVertexArray.emplaceBack(l.x,l.y,l.tileUnitDistanceFromAnchor)}}return{lineStartIndex:n,lineLength:this.lineVertexArray.length-n}}},{key:"addSymbols",value:function(t,e,n,r,i,o,a,s,u,l){var c=t.indexArray,f=t.layoutVertexArray,h=t.dynamicLayoutVertexArray,p=t.segments.prepareSegment(4*e.length,t.layoutVertexArray,t.indexArray),y=this.glyphOffsetArray.length,d=p.vertexLength,v=!0,m=!1,g=void 0;try{for(var b,x=e[Symbol.iterator]();!(v=(b=x.next()).done);v=!0){var w=b.value,k=w.tl,_=w.tr,S=w.bl,A=w.br,T=w.tex,j=p.vertexLength,O=w.glyphOffset[1];L(f,s.x,s.y,k.x,O+k.y,T.x,T.y,n),L(f,s.x,s.y,_.x,O+_.y,T.x+T.w,T.y,n),L(f,s.x,s.y,S.x,O+S.y,T.x,T.y+T.h,n),L(f,s.x,s.y,A.x,O+A.y,T.x+T.w,T.y+T.h,n),F(h,s,0),c.emplaceBack(j,j+1,j+2),c.emplaceBack(j+1,j+2,j+3),p.vertexLength+=4,p.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(w.glyphOffset[0])}}catch(t){m=!0,g=t}finally{try{v||null==x.return||x.return()}finally{if(m)throw g}}t.placedSymbolArray.emplaceBack(s.x,s.y,y,this.glyphOffsetArray.length-y,d,u,l,s.segment,n?n[0]:0,n?n[1]:0,r[0],r[1],a,!1),t.programConfigurations.populatePaintArrays(t.layoutVertexArray.length,o)}},{key:"_addCollisionDebugVertex",value:function(t,e,n,r,i){return e.emplaceBack(0,0),t.emplaceBack(n.x,n.y,r.x,r.y,Math.round(i.x),Math.round(i.y))}},{key:"addCollisionDebugVertices",value:function(t,e,n,r,i,o,a,s){var u=i.segments.prepareSegment(4,i.layoutVertexArray,i.indexArray),l=u.vertexLength,c=i.layoutVertexArray,f=i.collisionVertexArray;if(this._addCollisionDebugVertex(c,f,o,a.anchor,new k(t,e)),this._addCollisionDebugVertex(c,f,o,a.anchor,new k(n,e)),this._addCollisionDebugVertex(c,f,o,a.anchor,new k(n,r)),this._addCollisionDebugVertex(c,f,o,a.anchor,new k(t,r)),u.vertexLength+=4,s){var h=i.indexArray;h.emplaceBack(l,l+1,l+2),h.emplaceBack(l,l+2,l+3),u.primitiveLength+=2}else{var p=i.indexArray;p.emplaceBack(l,l+1),p.emplaceBack(l+1,l+2),p.emplaceBack(l+2,l+3),p.emplaceBack(l+3,l),u.primitiveLength+=4}}},{key:"generateCollisionDebugBuffers",value:function(){var t=!0,e=!1,n=void 0;try{for(var r,i=this.symbolInstances[Symbol.iterator]();!(t=(r=i.next()).done);t=!0){var o=r.value;o.textCollisionFeature={boxStartIndex:o.textBoxStartIndex,boxEndIndex:o.textBoxEndIndex},o.iconCollisionFeature={boxStartIndex:o.iconBoxStartIndex,boxEndIndex:o.iconBoxEndIndex};for(var a=0;a<2;a++){var s=o[0===a?"textCollisionFeature":"iconCollisionFeature"];if(s)for(var u=s.boxStartIndex;u<s.boxEndIndex;u++){var l=this.collisionBoxArray.get(u),c=l.x1,f=l.y1,h=l.x2,p=l.y2,y=l.radius>0;this.addCollisionDebugVertices(c,f,h,p,y?this.collisionCircle:this.collisionBox,l.anchorPoint,o,y)}}}}catch(t){e=!0,n=t}finally{try{t||null==i.return||i.return()}finally{if(e)throw n}}}},{key:"deserializeCollisionBoxes",value:function(t,e,n,r,i){for(var o={},a=e;a<n;a++){var s=t.get(a);if(0===s.radius){o.textBox={x1:s.x1,y1:s.y1,x2:s.x2,y2:s.y2,anchorPointX:s.anchorPointX,anchorPointY:s.anchorPointY};break}o.textCircles||(o.textCircles=[]);o.textCircles.push(s.anchorPointX,s.anchorPointY,s.radius,s.signedDistanceFromAnchor,1)}for(var u=r;u<i;u++){var l=t.get(u);if(0===l.radius){o.iconBox={x1:l.x1,y1:l.y1,x2:l.x2,y2:l.y2,anchorPointX:l.anchorPointX,anchorPointY:l.anchorPointY};break}}return o}},{key:"hasTextData",value:function(){return this.text.segments.get().length>0}},{key:"hasIconData",value:function(){return this.icon.segments.get().length>0}},{key:"hasCollisionBoxData",value:function(){return this.collisionBox.segments.get().length>0}},{key:"hasCollisionCircleData",value:function(){return this.collisionCircle.segments.get().length>0}},{key:"sortFeatures",value:function(t){var e=this;if(this.sortFeaturesByY&&this.sortedAngle!==t&&(this.sortedAngle=t,!(this.text.segments.get().length>1||this.icon.segments.get().length>1))){for(var n=[],r=0;r<this.symbolInstances.length;r++)n.push(r);var i=Math.sin(t),o=Math.cos(t);n.sort(function(t,n){var r=e.symbolInstances[t],a=e.symbolInstances[n];return(i*r.anchor.x+o*r.anchor.y|0)-(i*a.anchor.x+o*a.anchor.y|0)||a.featureIndex-r.featureIndex}),this.text.indexArray.clear(),this.icon.indexArray.clear();for(var a=0,s=n;a<s.length;a++){var u=s[a],l=this.symbolInstances[u],c=!0,f=!1,h=void 0;try{for(var p,y=l.placedTextSymbolIndices[Symbol.iterator]();!(c=(p=y.next()).done);c=!0)for(var d=p.value,v=this.text.placedSymbolArray.get(d),m=v.vertexStartIndex+4*v.numGlyphs,g=v.vertexStartIndex;g<m;g+=4)this.text.indexArray.emplaceBack(g,g+1,g+2),this.text.indexArray.emplaceBack(g+1,g+2,g+3)}catch(t){f=!0,h=t}finally{try{c||null==y.return||y.return()}finally{if(f)throw h}}var b=this.icon.placedSymbolArray.get(u);if(b.numGlyphs){var x=b.vertexStartIndex;this.icon.indexArray.emplaceBack(x,x+1,x+2),this.icon.indexArray.emplaceBack(x+1,x+2,x+3)}}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}]),t}();B("SymbolBucket",q,{omit:["layers","collisionBoxArray","features","compareText"],shallow:["symbolInstances"]}),q.MAX_GLYPHS=65535,q.addDynamicAttributes=F,t.exports=q},function(t,e,n){var r=n(44),i=n(76),o=n(36),a=!1,s=null;t.exports.evented=new i,t.exports.registerForPluginAvailability=function(e){return s?e({pluginBlobURL:s,errorCallback:t.exports.errorCallback}):t.exports.evented.once("pluginAvailable",e),e},t.exports.createBlobURL=function(t){return o.URL.createObjectURL(new o.Blob([t.data],{type:"text/javascript"}))},t.exports.clearRTLTextPlugin=function(){a=!1,s=null},t.exports.setRTLTextPlugin=function(e,n){if(a)throw new Error("setRTLTextPlugin cannot be called multiple times.");a=!0,t.exports.errorCallback=n,r.getArrayBuffer({url:e},function(e,r){e?n(e):r&&(s=t.exports.createBlobURL(r),t.exports.evented.fire("pluginAvailable",{pluginBlobURL:s,errorCallback:n}))})},t.exports.applyArabicShaping=null,t.exports.processBidirectionalText=null},function(t,e,n){function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){return!e||"object"!==r(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called");return t}(t):e}function o(t){var e="function"==typeof Map?new Map:void 0;return(o=function(t){if(null===t||(n=t,-1===Function.toString.call(n).indexOf("[native code]")))return t;var n;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return a(t,arguments,u(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),s(r,t)})(t)}function a(t,e,n){return(a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(t){return!1}}()?Reflect.construct:function(t,e,n){var r=[null];r.push.apply(r,e);var i=new(Function.bind.apply(t,r));return n&&s(i,n.prototype),i}).apply(null,arguments)}function s(t,e){return(s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function u(t){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var l=n(36),c={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};e.ResourceType=c,"function"==typeof Object.freeze&&Object.freeze(c);var f=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=i(this,u(e).call(this,t))).status=n,r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&s(t,e)}(e,o(Error)),e}();function h(t){var e=new l.XMLHttpRequest;for(var n in e.open("GET",t.url,!0),t.headers)e.setRequestHeader(n,t.headers[n]);return e.withCredentials="include"===t.credentials,e}e.getJSON=function(t,e){var n=h(t);return n.setRequestHeader("Accept","application/json"),n.onerror=function(){e(new Error(n.statusText))},n.onload=function(){if(n.status>=200&&n.status<300&&n.response){var t;try{t=JSON.parse(n.response)}catch(t){return e(t)}e(null,t)}else e(new f(n.statusText,n.status))},n.send(),n},e.getArrayBuffer=function(t,e){var n=h(t);return n.responseType="arraybuffer",n.onerror=function(){e(new Error(n.statusText))},n.onload=function(){var t=n.response;if(0===t.byteLength&&200===n.status)return e(new Error("http status 200 returned without content."));n.status>=200&&n.status<300&&n.response?e(null,{data:t,cacheControl:n.getResponseHeader("Cache-Control"),expires:n.getResponseHeader("Expires")}):e(new f(n.statusText,n.status))},n.send(),n};e.getImage=function(t,n){return e.getArrayBuffer(t,function(t,e){if(t)n(t);else if(e){var r=new l.Image,i=l.URL||l.webkitURL;r.onload=function(){n(null,r),i.revokeObjectURL(r.src)};var o=new l.Blob([new Uint8Array(e.data)],{type:"image/png"});r.cacheControl=e.cacheControl,r.expires=e.expires,r.src=e.data.byteLength?i.createObjectURL(o):"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII="}})},e.getVideo=function(t,e){var n,r,i=l.document.createElement("video");i.onloadstart=function(){e(null,i)};for(var o=0;o<t.length;o++){var a=l.document.createElement("source");n=t[o],r=void 0,(r=l.document.createElement("a")).href=n,(r.protocol!==l.document.location.protocol||r.host!==l.document.location.host)&&(i.crossOrigin="Anonymous"),a.src=t[o],i.appendChild(a)}return i}},function(t,e,n){function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function o(t,e){return!e||"object"!==r(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called");return t}(t):e}function a(t){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function s(t,e){return(s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var u=n(6),l=n(3).register,c=function(t){function e(t,n,r,i){var s;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(s=o(this,a(e).call(this,t,n))).angle=r,void 0!==i&&(s.segment=i),s}var n,r,l;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&s(t,e)}(e,u),n=e,(r=[{key:"clone",value:function(){return new e(this.x,this.y,this.angle,this.segment)}}])&&i(n.prototype,r),l&&i(n,l),e}();l("Anchor",c),t.exports=c},function(t,e){function n(t,e,n,r){this.cx=3*t,this.bx=3*(n-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(r-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=r,this.p2x=n,this.p2y=r}t.exports=n,n.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},n.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},n.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},n.prototype.solveCurveX=function(t,e){var n,r,i,o,a;for(void 0===e&&(e=1e-6),i=t,a=0;a<8;a++){if(o=this.sampleCurveX(i)-t,Math.abs(o)<e)return i;var s=this.sampleCurveDerivativeX(i);if(Math.abs(s)<1e-6)break;i-=o/s}if((i=t)<(n=0))return n;if(i>(r=1))return r;for(;n<r;){if(o=this.sampleCurveX(i),Math.abs(o-t)<e)return i;t>o?n=i:r=i,i=.5*(r-n)+n}return i},n.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))}},function(t,e){function n(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var r=function(){function t(e,n,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.column=e,this.row=n,this.zoom=r}var e,r,i;return e=t,(r=[{key:"clone",value:function(){return new t(this.column,this.row,this.zoom)}},{key:"zoomTo",value:function(t){return this.clone()._zoomTo(t)}},{key:"sub",value:function(t){return this.clone()._sub(t)}},{key:"_zoomTo",value:function(t){var e=Math.pow(2,t-this.zoom);return this.column*=e,this.row*=e,this.zoom=t,this}},{key:"_sub",value:function(t){return t=t.zoomTo(this.zoom),this.column-=t.column,this.row-=t.row,this}}])&&n(e.prototype,r),i&&n(e,i),t}();t.exports=r},function(t,e,n){"use strict";t.exports=i;var r=3;function i(t,e,n){var i=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;var o=new Int32Array(this.arrayBuffer);t=o[0],e=o[1],n=o[2],this.d=e+2*n;for(var a=0;a<this.d*this.d;a++){var s=o[r+a],u=o[r+a+1];i.push(s===u?null:o.subarray(s,u))}var l=o[r+i.length],c=o[r+i.length+1];this.keys=o.subarray(l,c),this.bboxes=o.subarray(c),this.insert=this._insertReadonly}else{this.d=e+2*n;for(var f=0;f<this.d*this.d;f++)i.push([]);this.keys=[],this.bboxes=[]}this.n=e,this.extent=t,this.padding=n,this.scale=e/t,this.uid=0;var h=n/e*t;this.min=-h,this.max=t+h}i.prototype.insert=function(t,e,n,r,i){this._forEachCell(e,n,r,i,this._insertCell,this.uid++),this.keys.push(t),this.bboxes.push(e),this.bboxes.push(n),this.bboxes.push(r),this.bboxes.push(i)},i.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},i.prototype._insertCell=function(t,e,n,r,i,o){this.cells[i].push(o)},i.prototype.query=function(t,e,n,r,i){var o=this.min,a=this.max;if(t<=o&&e<=o&&a<=n&&a<=r&&!i)return Array.prototype.slice.call(this.keys);var s=[];return this._forEachCell(t,e,n,r,this._queryCell,s,{},i),s},i.prototype._queryCell=function(t,e,n,r,i,o,a,s){var u=this.cells[i];if(null!==u)for(var l=this.keys,c=this.bboxes,f=0;f<u.length;f++){var h=u[f];if(void 0===a[h]){var p=4*h;(s?s(c[p+0],c[p+1],c[p+2],c[p+3]):t<=c[p+2]&&e<=c[p+3]&&n>=c[p+0]&&r>=c[p+1])?(a[h]=!0,o.push(l[h])):a[h]=!1}}},i.prototype._forEachCell=function(t,e,n,r,i,o,a,s){for(var u=this._convertToCellCoord(t),l=this._convertToCellCoord(e),c=this._convertToCellCoord(n),f=this._convertToCellCoord(r),h=u;h<=c;h++)for(var p=l;p<=f;p++){var y=this.d*p+h;if((!s||s(this._convertFromCellCoord(h),this._convertFromCellCoord(p),this._convertFromCellCoord(h+1),this._convertFromCellCoord(p+1)))&&i.call(this,t,e,n,r,y,o,a,s))return}},i.prototype._convertFromCellCoord=function(t){return(t-this.padding)/this.scale},i.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},i.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=r+this.cells.length+1+1,n=0,i=0;i<this.cells.length;i++)n+=this.cells[i].length;var o=new Int32Array(e+n+this.keys.length+this.bboxes.length);o[0]=this.extent,o[1]=this.n,o[2]=this.padding;for(var a=e,s=0;s<t.length;s++){var u=t[s];o[r+s]=a,o.set(u,a),a+=u.length}return o[r+t.length]=a,o.set(this.keys,a),a+=this.keys.length,o[r+t.length+1]=a,o.set(this.bboxes,a),a+=this.bboxes.length,o.buffer}},function(t,e){var n={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function r(t){return(t=Math.round(t))<0?0:t>255?255:t}function i(t){return t<0?0:t>1?1:t}function o(t){return"%"===t[t.length-1]?r(parseFloat(t)/100*255):r(parseInt(t))}function a(t){return"%"===t[t.length-1]?i(parseFloat(t)/100):i(parseFloat(t))}function s(t,e,n){return n<0?n+=1:n>1&&(n-=1),6*n<1?t+(e-t)*n*6:2*n<1?e:3*n<2?t+(e-t)*(2/3-n)*6:t}try{e.parseCSSColor=function(t){var e,i=t.replace(/ /g,"").toLowerCase();if(i in n)return n[i].slice();if("#"===i[0])return 4===i.length?(e=parseInt(i.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:7===i.length&&(e=parseInt(i.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var u=i.indexOf("("),l=i.indexOf(")");if(-1!==u&&l+1===i.length){var c=i.substr(0,u),f=i.substr(u+1,l-(u+1)).split(","),h=1;switch(c){case"rgba":if(4!==f.length)return null;h=a(f.pop());case"rgb":return 3!==f.length?null:[o(f[0]),o(f[1]),o(f[2]),h];case"hsla":if(4!==f.length)return null;h=a(f.pop());case"hsl":if(3!==f.length)return null;var p=(parseFloat(f[0])%360+360)%360/360,y=a(f[1]),d=a(f[2]),v=d<=.5?d*(y+1):d+y-d*y,m=2*d-v;return[r(255*s(m,v,p+1/3)),r(255*s(m,v,p)),r(255*s(m,v,p-1/3)),h];default:return null}}return null}}catch(t){}},function(t,e){function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r(t,e){return!e||"object"!==n(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called");return t}(t):e}function i(t){var e="function"==typeof Map?new Map:void 0;return(i=function(t){if(null===t||(n=t,-1===Function.toString.call(n).indexOf("[native code]")))return t;var n;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return o(t,arguments,s(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),a(r,t)})(t)}function o(t,e,n){return(o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(t){return!1}}()?Reflect.construct:function(t,e,n){var r=[null];r.push.apply(r,e);var i=new(Function.bind.apply(t,r));return n&&a(i,n.prototype),i}).apply(null,arguments)}function a(t,e){return(a=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function s(t){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var u=function(t){function e(t,n){var i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(i=r(this,s(e).call(this,n))).message=n,i.key=t,i}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&a(t,e)}(e,i(Error)),e}();t.exports=u},function(t,e,n){function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var o=n(52),a=n(4).checkSubtype,s=n(50),u=n(53),l=n(54),c=n(55),f=n(56),h=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new o,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.registry=e,this.path=n,this.key=n.map(function(t){return"[".concat(t,"]")}).join(""),this.scope=i,this.errors=a,this.expectedType=r}var e,h,p;return e=t,(h=[{key:"parse",value:function(t,e,i,o){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},s=this;if(e&&(s=s.concat(e,i,o)),null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return s.error(\'Expected an array with at least one element. If you wanted a literal array, use ["literal", []].\');var h=t[0];if("string"!=typeof h)return s.error("Expression name must be a string, but found ".concat(r(h),\' instead. If you wanted a literal array, use ["literal", [...]].\'),0),null;var p=s.registry[h];if(p){var y=p.parse(t,s);if(!y)return null;if(s.expectedType){var d=s.expectedType,v=y.type;if("string"!==d.kind&&"number"!==d.kind&&"boolean"!==d.kind||"value"!==v.kind)if("array"===d.kind&&"value"===v.kind)a.omitTypeAnnotations||(y=new c(d,y));else if("color"!==d.kind||"value"!==v.kind&&"string"!==v.kind){if(s.checkSubtype(s.expectedType,y.type))return null}else a.omitTypeAnnotations||(y=new f(d,[y]));else a.omitTypeAnnotations||(y=new l(d,[y]))}if(!(y instanceof u)&&function(t){var e=n(23).CompoundExpression,r=n(57),i=r.isGlobalPropertyConstant,o=r.isFeatureConstant,a=n(58);if(t instanceof a)return!1;if(t instanceof e&&"error"===t.name)return!1;var s=!0;if(t.eachChild(function(t){t instanceof u||(s=!1)}),!s)return!1;return o(t)&&i(t,["zoom","heatmap-density"])}(y)){var m=new(n(33));try{y=new u(y.type,y.evaluate(m))}catch(t){return s.error(t.message),null}}return y}return s.error(\'Unknown expression "\'.concat(h,\'". If you wanted a literal array, use ["literal", [...]].\'),0)}return void 0===t?s.error("\'undefined\' value invalid. Use null instead."):"object"===r(t)?s.error(\'Bare objects invalid. Use ["literal", {...}] instead.\'):s.error("Expected an array, but found ".concat(r(t)," instead."))}},{key:"concat",value:function(e,n,r){var i="number"==typeof e?this.path.concat(e):this.path,o=r?this.scope.concat(r):this.scope;return new t(this.registry,i,n||null,o,this.errors)}},{key:"error",value:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];var i="".concat(this.key).concat(n.map(function(t){return"[".concat(t,"]")}).join(""));this.errors.push(new s(i,t))}},{key:"checkSubtype",value:function(t,e){var n=a(t,e);return n&&this.error(n),n}}])&&i(e.prototype,h),p&&i(e,p),t}();t.exports=h},function(t,e){function n(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var i=function(){function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.parent=e,this.bindings={};var i=!0,o=!1,a=void 0;try{for(var s,u=r[Symbol.iterator]();!(i=(s=u.next()).done);i=!0){var l=n(s.value,2),c=l[0],f=l[1];this.bindings[c]=f}}catch(t){o=!0,a=t}finally{try{i||null==u.return||u.return()}finally{if(o)throw a}}}var e,i,o;return e=t,(i=[{key:"concat",value:function(e){return new t(this,e)}},{key:"get",value:function(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error("".concat(t," not found in scope."))}},{key:"has",value:function(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)}}])&&r(e.prototype,i),o&&r(e,o),t}();t.exports=i},function(t,e,n){function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var i=n(11),o=i.isValue,a=i.typeOf,s=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.type=e,this.value=n}var e,n,i;return e=t,i=[{key:"parse",value:function(e,n){if(2!==e.length)return n.error("\'literal\' expression requires exactly one argument, but found ".concat(e.length-1," instead."));if(!o(e[1]))return n.error("invalid value");var r=e[1],i=a(r),s=n.expectedType;return"array"!==i.kind||0!==i.N||!s||"array"!==s.kind||"number"==typeof s.N&&0!==s.N||(i=s),new t(i,r)}}],(n=[{key:"evaluate",value:function(){return this.value}},{key:"eachChild",value:function(){}},{key:"possibleOutputs",value:function(){return[this.value]}}])&&r(e.prototype,n),i&&r(e,i),t}();t.exports=s},function(t,e,n){function r(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var o=n(0),a=n(4),s=a.ObjectType,u=a.ValueType,l=a.StringType,c=a.NumberType,f=a.BooleanType,h=n(15),p=n(4),y=p.checkSubtype,d=p.toString,v=n(11).typeOf,m={string:l,number:c,boolean:f,object:s},g=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.type=e,this.args=n}var e,n,a;return e=t,a=[{key:"parse",value:function(e,n){if(e.length<2)return n.error("Expected at least one argument.");var r=e[0];o(m[r],r);for(var i=m[r],a=[],s=1;s<e.length;s++){var l=n.parse(e[s],s,u);if(!l)return null;a.push(l)}return new t(i,a)}}],(n=[{key:"evaluate",value:function(t){for(var e=0;e<this.args.length;e++){var n=this.args[e].evaluate(t);if(!y(this.type,v(n)))return n;if(e===this.args.length-1)throw new h("Expected value to be of type ".concat(d(this.type),", but found ").concat(d(v(n))," instead."))}return o(!1),null}},{key:"eachChild",value:function(t){this.args.forEach(t)}},{key:"possibleOutputs",value:function(){var t;return(t=[]).concat.apply(t,r(this.args.map(function(t){return t.possibleOutputs()})))}}])&&i(e.prototype,n),a&&i(e,a),t}();t.exports=g},function(t,e,n){function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var i=n(4),o=i.toString,a=i.array,s=i.ValueType,u=i.StringType,l=i.NumberType,c=i.BooleanType,f=i.checkSubtype,h=n(11).typeOf,p=n(15),y={string:u,number:l,boolean:c},d=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.type=e,this.input=n}var e,n,i;return e=t,i=[{key:"parse",value:function(e,n){if(e.length<2||e.length>4)return n.error("Expected 1, 2, or 3 arguments, but found ".concat(e.length-1," instead."));var r,i;if(e.length>2){var o=e[1];if("string"!=typeof o||!(o in y))return n.error(\'The item type argument of "array" must be one of string, number, boolean\',1);r=y[o]}else r=s;if(e.length>3){if("number"!=typeof e[2]||e[2]<0||e[2]!==Math.floor(e[2]))return n.error(\'The length argument to "array" must be a positive integer literal\',2);i=e[2]}var u=a(r,i),l=n.parse(e[e.length-1],e.length-1,s);return l?new t(u,l):null}}],(n=[{key:"evaluate",value:function(t){var e=this.input.evaluate(t);if(f(this.type,h(e)))throw new p("Expected value to be of type ".concat(o(this.type),", but found ").concat(o(h(e))," instead."));return e}},{key:"eachChild",value:function(t){t(this.input)}},{key:"possibleOutputs",value:function(){return this.input.possibleOutputs()}}])&&r(e.prototype,n),i&&r(e,i),t}();t.exports=d},function(t,e,n){function r(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var o=n(0),a=n(4),s=a.ColorType,u=a.ValueType,l=a.NumberType,c=n(11),f=c.Color,h=c.validateRGBA,p=n(15),y={"to-number":l,"to-color":s},d=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.type=e,this.args=n}var e,n,a;return e=t,a=[{key:"parse",value:function(e,n){if(e.length<2)return n.error("Expected at least one argument.");var r=e[0];o(y[r],r);for(var i=y[r],a=[],s=1;s<e.length;s++){var l=n.parse(e[s],s,u);if(!l)return null;a.push(l)}return new t(i,a)}}],(n=[{key:"evaluate",value:function(t){if("color"===this.type.kind){var e,n,r=!0,i=!1,o=void 0;try{for(var a,s=this.args[Symbol.iterator]();!(r=(a=s.next()).done);r=!0){if(e=a.value.evaluate(t),n=null,"string"==typeof e){var u=t.parseColor(e);if(u)return u}else if(Array.isArray(e)&&!(n=e.length<3||e.length>4?"Invalid rbga value ".concat(JSON.stringify(e),": expected an array containing either three or four numeric values."):h(e[0],e[1],e[2],e[3])))return new f(e[0]/255,e[1]/255,e[2]/255,e[3])}}catch(t){i=!0,o=t}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}throw new p(n||"Could not parse color from value \'".concat("string"==typeof e?e:JSON.stringify(e),"\'"))}var l=null,c=!0,y=!1,d=void 0;try{for(var v,m=this.args[Symbol.iterator]();!(c=(v=m.next()).done);c=!0){if(null!==(l=v.value.evaluate(t))){var g=Number(l);if(!isNaN(g))return g}}}catch(t){y=!0,d=t}finally{try{c||null==m.return||m.return()}finally{if(y)throw d}}throw new p("Could not convert ".concat(JSON.stringify(l)," to number."))}},{key:"eachChild",value:function(t){this.args.forEach(t)}},{key:"possibleOutputs",value:function(){var t;return(t=[]).concat.apply(t,r(this.args.map(function(t){return t.possibleOutputs()})))}}])&&i(e.prototype,n),a&&i(e,a),t}();t.exports=d},function(t,e,n){var r=n(23).CompoundExpression;t.exports={isFeatureConstant:function t(e){if(e instanceof r){if("get"===e.name&&1===e.args.length)return!1;if("has"===e.name&&1===e.args.length)return!1;if("properties"===e.name||"geometry-type"===e.name||"id"===e.name)return!1;if(e.name.startsWith("filter-"))return!1}var n=!0;return e.eachChild(function(e){n&&!t(e)&&(n=!1)}),n},isGlobalPropertyConstant:function t(e,n){if(e instanceof r&&n.indexOf(e.name)>=0)return!1;var i=!0;return e.eachChild(function(e){i&&!t(e,n)&&(i=!1)}),i}}},function(t,e){function n(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var r=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.type=n,this.name=e}var e,r,i;return e=t,i=[{key:"parse",value:function(e,n){if(2!==e.length||"string"!=typeof e[1])return n.error("\'var\' expression requires exactly one string literal argument.");var r=e[1];return n.scope.has(r)?new t(r,n.scope.get(r).type):n.error(\'Unknown variable "\'.concat(r,\'". Make sure "\').concat(r,\'" has been bound in an enclosing "let" expression before using it.\'),1)}}],(r=[{key:"evaluate",value:function(t){return t.scope.get(this.name).evaluate(t)}},{key:"eachChild",value:function(){}},{key:"possibleOutputs",value:function(){return[void 0]}}])&&n(e.prototype,r),i&&n(e,i),t}();t.exports=r},function(t,e,n){function r(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||i(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function i(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}function o(t,e){return s(t)||function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}(t,e)||a()}function a(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function s(t){if(Array.isArray(t))return t}function u(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var l=n(4).NumberType,c=n(60).findStopLessThanOrEqualTo,f=function(){function t(e,n,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.type=e,this.input=n,this.labels=[],this.outputs=[];var i=!0,a=!1,s=void 0;try{for(var u,l=r[Symbol.iterator]();!(i=(u=l.next()).done);i=!0){var c=o(u.value,2),f=c[0],h=c[1];this.labels.push(f),this.outputs.push(h)}}catch(t){a=!0,s=t}finally{try{i||null==l.return||l.return()}finally{if(a)throw s}}}var e,n,f;return e=t,f=[{key:"parse",value:function(e,n){var r,o=s(r=e)||i(r)||a(),u=o[1],c=o.slice(2);if(e.length-1<4)return n.error("Expected at least 4 arguments, but found only ".concat(e.length-1,"."));if((e.length-1)%2!=0)return n.error("Expected an even number of arguments.");if(!(u=n.parse(u,1,l)))return null;var f=[],h=null;n.expectedType&&"value"!==n.expectedType.kind&&(h=n.expectedType),c.unshift(-1/0);for(var p=0;p<c.length;p+=2){var y=c[p],d=c[p+1],v=p+1,m=p+2;if("number"!=typeof y)return n.error(\'Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.\',v);if(f.length&&f[f.length-1][0]>=y)return n.error(\'Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.\',v);var g=n.parse(d,m,h);if(!g)return null;h=h||g.type,f.push([y,g])}return new t(h,u,f)}}],(n=[{key:"evaluate",value:function(t){var e=this.labels,n=this.outputs;if(1===e.length)return n[0].evaluate(t);var r=this.input.evaluate(t);if(r<=e[0])return n[0].evaluate(t);var i=e.length;return r>=e[i-1]?n[i-1].evaluate(t):n[c(e,r)].evaluate(t)}},{key:"eachChild",value:function(t){t(this.input);var e=!0,n=!1,r=void 0;try{for(var i,o=this.outputs[Symbol.iterator]();!(e=(i=o.next()).done);e=!0){t(i.value)}}catch(t){n=!0,r=t}finally{try{e||null==o.return||o.return()}finally{if(n)throw r}}}},{key:"possibleOutputs",value:function(){var t;return(t=[]).concat.apply(t,r(this.outputs.map(function(t){return t.possibleOutputs()})))}}])&&u(e.prototype,n),f&&u(e,f),t}();t.exports=f},function(t,e,n){var r=n(15);t.exports={findStopLessThanOrEqualTo:function(t,e){for(var n,i,o=0,a=t.length-1,s=0;o<=a;){if(n=t[s=Math.floor((o+a)/2)],i=t[s+1],e===n||e>n&&e<i)return s;if(n<e)o=s+1;else{if(!(n>e))throw new r("Input is not a number.");a=s-1}}return Math.max(s-1,0)}}},function(t,e,n){function r(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var o=n(0),a=n(4),s=a.checkSubtype,u=a.ValueType,l=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.type=e,this.args=n}var e,n,a;return e=t,a=[{key:"parse",value:function(e,n){if(e.length<2)return n.error("Expectected at least one argument.");var r=null,i=n.expectedType;i&&"value"!==i.kind&&(r=i);var a=[],l=!0,c=!1,f=void 0;try{for(var h,p=e.slice(1)[Symbol.iterator]();!(l=(h=p.next()).done);l=!0){var y=h.value,d=n.parse(y,1+a.length,r,void 0,{omitTypeAnnotations:!0});if(!d)return null;r=r||d.type,a.push(d)}}catch(t){c=!0,f=t}finally{try{l||null==p.return||p.return()}finally{if(c)throw f}}return o(r),new t(i&&a.some(function(t){return s(i,t.type)})?u:r,a)}}],(n=[{key:"evaluate",value:function(t){var e=null,n=!0,r=!1,i=void 0;try{for(var o,a=this.args[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){if(null!==(e=o.value.evaluate(t)))break}}catch(t){r=!0,i=t}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}return e}},{key:"eachChild",value:function(t){this.args.forEach(t)}},{key:"possibleOutputs",value:function(){var t;return(t=[]).concat.apply(t,r(this.args.map(function(t){return t.possibleOutputs()})))}}])&&i(e.prototype,n),a&&i(e,a),t}();t.exports=l},function(t,e){function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var i=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.type=n.type,this.bindings=[].concat(e),this.result=n}var e,i,o;return e=t,o=[{key:"parse",value:function(e,r){if(e.length<4)return r.error("Expected at least 3 arguments, but found ".concat(e.length-1," instead."));for(var i=[],o=1;o<e.length-1;o+=2){var a=e[o];if("string"!=typeof a)return r.error("Expected string, but found ".concat(n(a)," instead."),o);if(/[^a-zA-Z0-9_]/.test(a))return r.error("Variable names must contain only alphanumeric characters or \'_\'.",o);var s=r.parse(e[o+1],o+1);if(!s)return null;i.push([a,s])}var u=r.parse(e[e.length-1],e.length-1,void 0,i);return u?new t(i,u):null}}],(i=[{key:"evaluate",value:function(t){t.pushScope(this.bindings);var e=this.result.evaluate(t);return t.popScope(),e}},{key:"eachChild",value:function(t){var e=!0,n=!1,r=void 0;try{for(var i,o=this.bindings[Symbol.iterator]();!(e=(i=o.next()).done);e=!0){t(i.value[1])}}catch(t){n=!0,r=t}finally{try{e||null==o.return||o.return()}finally{if(n)throw r}}t(this.result)}},{key:"possibleOutputs",value:function(){return this.result.possibleOutputs()}}])&&r(e.prototype,i),o&&r(e,o),t}();t.exports=i},function(t,e,n){function r(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var a=n(4),s=a.NumberType,u=a.StringType,l=a.BooleanType,c=a.ColorType,f=a.ObjectType,h=a.ValueType,p=a.ErrorType,y=a.array,d=a.toString,v=n(11),m=v.typeOf,g=v.Color,b=v.validateRGBA,x=n(23),w=x.CompoundExpression,k=x.varargs,_=n(15),S=n(62),A=n(58),T=n(53),j=n(54),O=n(55),z=n(56),P=n(95),E=n(96),C=n(97),M=n(59),I=n(34),B=n(61),V=n(98),L={"==":V.Equals,"!=":V.NotEquals,array:O,at:P,boolean:j,case:C,coalesce:B,interpolate:I,let:S,literal:T,match:E,number:j,object:j,step:M,string:j,"to-color":z,"to-number":z,var:A};function F(t,e){var n=o(e,4),r=n[0],i=n[1],a=n[2],s=n[3];r=r.evaluate(t),i=i.evaluate(t),a=a.evaluate(t);var u=s?s.evaluate(t):1,l=b(r,i,a,u);if(l)throw new _(l);return new g(r/255*u,i/255*u,a/255*u,u)}function R(t,e){return t in e}function D(t,e){var n=e[t];return void 0===n?null:n}function q(t,e){return o(e,1)[0].evaluate(t).length}function N(t,e){var n=o(e,2),r=n[0],i=n[1];return r.evaluate(t)<i.evaluate(t)}function U(t,e){var n=o(e,2),r=n[0],i=n[1];return r.evaluate(t)>i.evaluate(t)}function J(t,e){var n=o(e,2),r=n[0],i=n[1];return r.evaluate(t)<=i.evaluate(t)}function G(t,e){var n=o(e,2),r=n[0],i=n[1];return r.evaluate(t)>=i.evaluate(t)}w.register(L,{error:[p,[u],function(t,e){var n=o(e,1)[0];throw new _(n.evaluate(t))}],typeof:[u,[h],function(t,e){var n=o(e,1)[0];return d(m(n.evaluate(t)))}],"to-string":[u,[h],function(t,e){var n=o(e,1)[0],r=i(n=n.evaluate(t));return null===n||"string"===r||"number"===r||"boolean"===r?String(n):n instanceof g?n.toString():JSON.stringify(n)}],"to-boolean":[l,[h],function(t,e){var n=o(e,1)[0];return Boolean(n.evaluate(t))}],"to-rgba":[y(s,4),[c],function(t,e){var n=o(e,1)[0].evaluate(t),r=n.r,i=n.g,a=n.b,s=n.a;return[255*r/s,255*i/s,255*a/s,s]}],rgb:[c,[s,s,s],F],rgba:[c,[s,s,s,s],F],length:{type:s,overloads:[[[u],q],[[y(h)],q]]},has:{type:l,overloads:[[[u],function(t,e){return R(o(e,1)[0].evaluate(t),t.properties())}],[[u,f],function(t,e){var n=o(e,2),r=n[0],i=n[1];return R(r.evaluate(t),i.evaluate(t))}]]},get:{type:h,overloads:[[[u],function(t,e){return D(o(e,1)[0].evaluate(t),t.properties())}],[[u,f],function(t,e){var n=o(e,2),r=n[0],i=n[1];return D(r.evaluate(t),i.evaluate(t))}]]},properties:[f,[],function(t){return t.properties()}],"geometry-type":[u,[],function(t){return t.geometryType()}],id:[h,[],function(t){return t.id()}],zoom:[s,[],function(t){return t.globals.zoom}],"heatmap-density":[s,[],function(t){return t.globals.heatmapDensity||0}],"+":[s,k(s),function(t,e){var n=0,r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done);r=!0){n+=a.value.evaluate(t)}}catch(t){i=!0,o=t}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}],"*":[s,k(s),function(t,e){var n=1,r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done);r=!0){n*=a.value.evaluate(t)}}catch(t){i=!0,o=t}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}],"-":{type:s,overloads:[[[s,s],function(t,e){var n=o(e,2),r=n[0],i=n[1];return r.evaluate(t)-i.evaluate(t)}],[[s],function(t,e){return-o(e,1)[0].evaluate(t)}]]},"/":[s,[s,s],function(t,e){var n=o(e,2),r=n[0],i=n[1];return r.evaluate(t)/i.evaluate(t)}],"%":[s,[s,s],function(t,e){var n=o(e,2),r=n[0],i=n[1];return r.evaluate(t)%i.evaluate(t)}],ln2:[s,[],function(){return Math.LN2}],pi:[s,[],function(){return Math.PI}],e:[s,[],function(){return Math.E}],"^":[s,[s,s],function(t,e){var n=o(e,2),r=n[0],i=n[1];return Math.pow(r.evaluate(t),i.evaluate(t))}],sqrt:[s,[s],function(t,e){var n=o(e,1)[0];return Math.sqrt(n.evaluate(t))}],log10:[s,[s],function(t,e){var n=o(e,1)[0];return Math.log10(n.evaluate(t))}],ln:[s,[s],function(t,e){var n=o(e,1)[0];return Math.log(n.evaluate(t))}],log2:[s,[s],function(t,e){var n=o(e,1)[0];return Math.log2(n.evaluate(t))}],sin:[s,[s],function(t,e){var n=o(e,1)[0];return Math.sin(n.evaluate(t))}],cos:[s,[s],function(t,e){var n=o(e,1)[0];return Math.cos(n.evaluate(t))}],tan:[s,[s],function(t,e){var n=o(e,1)[0];return Math.tan(n.evaluate(t))}],asin:[s,[s],function(t,e){var n=o(e,1)[0];return Math.asin(n.evaluate(t))}],acos:[s,[s],function(t,e){var n=o(e,1)[0];return Math.acos(n.evaluate(t))}],atan:[s,[s],function(t,e){var n=o(e,1)[0];return Math.atan(n.evaluate(t))}],min:[s,k(s),function(t,e){return Math.min.apply(Math,r(e.map(function(e){return e.evaluate(t)})))}],max:[s,k(s),function(t,e){return Math.max.apply(Math,r(e.map(function(e){return e.evaluate(t)})))}],"filter-==":[l,[u,h],function(t,e){var n=o(e,2),r=n[0],i=n[1];return t.properties()[r.value]===i.value}],"filter-id-==":[l,[h],function(t,e){var n=o(e,1)[0];return t.id()===n.value}],"filter-type-==":[l,[u],function(t,e){var n=o(e,1)[0];return t.geometryType()===n.value}],"filter-<":[l,[u,h],function(t,e){var n=o(e,2),r=n[0],a=n[1],s=t.properties()[r.value],u=a.value;return i(s)===i(u)&&s<u}],"filter-id-<":[l,[h],function(t,e){var n=o(e,1)[0],r=t.id(),a=n.value;return i(r)===i(a)&&r<a}],"filter->":[l,[u,h],function(t,e){var n=o(e,2),r=n[0],a=n[1],s=t.properties()[r.value],u=a.value;return i(s)===i(u)&&s>u}],"filter-id->":[l,[h],function(t,e){var n=o(e,1)[0],r=t.id(),a=n.value;return i(r)===i(a)&&r>a}],"filter-<=":[l,[u,h],function(t,e){var n=o(e,2),r=n[0],a=n[1],s=t.properties()[r.value],u=a.value;return i(s)===i(u)&&s<=u}],"filter-id-<=":[l,[h],function(t,e){var n=o(e,1)[0],r=t.id(),a=n.value;return i(r)===i(a)&&r<=a}],"filter->=":[l,[u,h],function(t,e){var n=o(e,2),r=n[0],a=n[1],s=t.properties()[r.value],u=a.value;return i(s)===i(u)&&s>=u}],"filter-id->=":[l,[h],function(t,e){var n=o(e,1)[0],r=t.id(),a=n.value;return i(r)===i(a)&&r>=a}],"filter-has":[l,[h],function(t,e){return o(e,1)[0].value in t.properties()}],"filter-has-id":[l,[],function(t){return null!==t.id()}],"filter-type-in":[l,[y(u)],function(t,e){return o(e,1)[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[l,[y(h)],function(t,e){return o(e,1)[0].value.indexOf(t.id())>=0}],"filter-in-small":[l,[u,y(h)],function(t,e){var n=o(e,2),r=n[0];return n[1].value.indexOf(t.properties()[r.value])>=0}],"filter-in-large":[l,[u,y(h)],function(t,e){var n=o(e,2),r=n[0],i=n[1];return function(t,e,n,r){for(;n<=r;){var i=n+r>>1;if(e[i]===t)return!0;e[i]>t?r=i-1:n=i+1}return!1}(t.properties()[r.value],i.value,0,i.value.length-1)}],">":{type:l,overloads:[[[s,s],U],[[u,u],U]]},"<":{type:l,overloads:[[[s,s],N],[[u,u],N]]},">=":{type:l,overloads:[[[s,s],G],[[u,u],G]]},"<=":{type:l,overloads:[[[s,s],J],[[u,u],J]]},all:{type:l,overloads:[[[l,l],function(t,e){var n=o(e,2),r=n[0],i=n[1];return r.evaluate(t)&&i.evaluate(t)}],[k(l),function(t,e){var n=!0,r=!1,i=void 0;try{for(var o,a=e[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){if(!o.value.evaluate(t))return!1}}catch(t){r=!0,i=t}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}return!0}]]},any:{type:l,overloads:[[[l,l],function(t,e){var n=o(e,2),r=n[0],i=n[1];return r.evaluate(t)||i.evaluate(t)}],[k(l),function(t,e){var n=!0,r=!1,i=void 0;try{for(var o,a=e[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){if(o.value.evaluate(t))return!0}}catch(t){r=!0,i=t}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}return!1}]]},"!":[l,[l],function(t,e){return!o(e,1)[0].evaluate(t)}],upcase:[u,[u],function(t,e){return o(e,1)[0].evaluate(t).toUpperCase()}],downcase:[u,[u],function(t,e){return o(e,1)[0].evaluate(t).toLowerCase()}],concat:[u,k(u),function(t,e){return e.map(function(e){return e.evaluate(t)}).join("")}]}),t.exports=L},function(t,e,n){var r=n(5);t.exports=function(t){var e=t.key,n=t.value;return n?[new r(e,n,"constants have been deprecated as of v8")]:[]}},function(t,e,n){var r=n(5),i=n(7),o=n(16),a=n(24),s=n(66),u=n(67),l=n(12);t.exports=function(t){var e,n,c,f=t.valueSpec,h=l(t.value.type),p={},y="categorical"!==h&&void 0===t.value.property,d=!y,v="array"===i(t.value.stops)&&"array"===i(t.value.stops[0])&&"object"===i(t.value.stops[0][0]),m=a({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===h)return[new r(t.key,t.value,\'identity function may not have a "stops" property\')];var e=[],n=t.value;e=e.concat(s({key:t.key,value:n,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:g})),"array"===i(n)&&0===n.length&&e.push(new r(t.key,n,"array must have at least one stop"));return e},default:function(t){return o({key:t.key,value:t.value,valueSpec:f,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===h&&y&&m.push(new r(t.key,t.value,\'missing required property "property"\')),"identity"===h||t.value.stops||m.push(new r(t.key,t.value,\'missing required property "stops"\')),"exponential"===h&&"piecewise-constant"===t.valueSpec.function&&m.push(new r(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(d&&!t.valueSpec["property-function"]?m.push(new r(t.key,t.value,"property functions not supported")):y&&!t.valueSpec["zoom-function"]&&"heatmap-color"!==t.objectKey&&m.push(new r(t.key,t.value,"zoom functions not supported"))),"categorical"!==h&&!v||void 0!==t.value.property||m.push(new r(t.key,t.value,\'"property" property is required\')),m;function g(t){var e=[],s=t.value,h=t.key;if("array"!==i(s))return[new r(h,s,"array expected, ".concat(i(s)," found"))];if(2!==s.length)return[new r(h,s,"array length 2 expected, length ".concat(s.length," found"))];if(v){if("object"!==i(s[0]))return[new r(h,s,"object expected, ".concat(i(s[0])," found"))];if(void 0===s[0].zoom)return[new r(h,s,"object stop key must have zoom")];if(void 0===s[0].value)return[new r(h,s,"object stop key must have value")];if(c&&c>l(s[0].zoom))return[new r(h,s[0].zoom,"stop zoom values must appear in ascending order")];l(s[0].zoom)!==c&&(c=l(s[0].zoom),n=void 0,p={}),e=e.concat(a({key:"".concat(h,"[0]"),value:s[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:u,value:b}}))}else e=e.concat(b({key:"".concat(h,"[0]"),value:s[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},s));return e.concat(o({key:"".concat(h,"[1]"),value:s[1],valueSpec:f,style:t.style,styleSpec:t.styleSpec}))}function b(t,o){var a=i(t.value),s=l(t.value),u=null!==t.value?t.value:o;if(e){if(a!==e)return[new r(t.key,u,"".concat(a," stop domain type must match previous stop domain type ").concat(e))]}else e=a;if("number"!==a&&"string"!==a&&"boolean"!==a)return[new r(t.key,u,"stop domain value must be a number, string, or boolean")];if("number"!==a&&"categorical"!==h){var c="number expected, ".concat(a," found");return f["property-function"]&&void 0===h&&(c+=\'\\nIf you intended to use a categorical function, specify `"type": "categorical"`.\'),[new r(t.key,u,c)]}return"categorical"!==h||"number"!==a||isFinite(s)&&Math.floor(s)===s?"categorical"!==h&&"number"===a&&void 0!==n&&s<n?[new r(t.key,u,"stop domain values must appear in ascending order")]:(n=s,"categorical"===h&&s in p?[new r(t.key,u,"stop domain values must be unique")]:(p[s]=!0,[])):[new r(t.key,u,"integer expected, found ".concat(s))]}}},function(t,e,n){var r=n(7),i=n(16),o=n(5);t.exports=function(t){var e=t.value,n=t.valueSpec,a=t.style,s=t.styleSpec,u=t.key,l=t.arrayElementValidator||i;if("array"!==r(e))return[new o(u,e,"array expected, ".concat(r(e)," found"))];if(n.length&&e.length!==n.length)return[new o(u,e,"array length ".concat(n.length," expected, length ").concat(e.length," found"))];if(n["min-length"]&&e.length<n["min-length"])return[new o(u,e,"array length at least ".concat(n["min-length"]," expected, length ").concat(e.length," found"))];var c={type:n.value};s.$version<7&&(c.function=n.function),"object"===r(n.value)&&(c=n.value);for(var f=[],h=0;h<e.length;h++)f=f.concat(l({array:e,arrayIndex:h,value:e[h],valueSpec:c,style:a,styleSpec:s,key:"".concat(u,"[").concat(h,"]")}));return f}},function(t,e,n){var r=n(7),i=n(5);t.exports=function(t){var e=t.key,n=t.value,o=t.valueSpec,a=r(n);return"number"!==a?[new i(e,n,"number expected, ".concat(a," found"))]:"minimum"in o&&n<o.minimum?[new i(e,n,"".concat(n," is less than the minimum value ").concat(o.minimum))]:"maximum"in o&&n>o.maximum?[new i(e,n,"".concat(n," is greater than the maximum value ").concat(o.maximum))]:[]}},function(t,e,n){var r=n(5),i=n(14),o=i.createExpression,a=i.createPropertyExpression,s=n(12);t.exports=function(t){var e=("property"===t.expressionContext?a:o)(s.deep(t.value),t.valueSpec);return"error"===e.result?e.value.map(function(e){return new r("".concat(t.key).concat(e.key),t.value,e.message)}):"property"===t.expressionContext&&"text-font"===t.propertyKey&&-1!==e.value._styleExpression.expression.possibleOutputs().indexOf(void 0)?[new r(t.key,t.value,\'Invalid data expression for "text-font". Output values must be contained as literals within the expression.\')]:[]}},function(t,e,n){var r=n(5),i=n(12),o=n(24),a=n(38),s=n(70),u=n(72),l=n(16),c=n(22);t.exports=function(t){var e=[],n=t.value,f=t.key,h=t.style,p=t.styleSpec;n.type||n.ref||e.push(new r(f,n,\'either "type" or "ref" is required\'));var y,d=i(n.type),v=i(n.ref);if(n.id)for(var m=i(n.id),g=0;g<t.arrayIndex;g++){var b=h.layers[g];i(b.id)===m&&e.push(new r(f,n.id,\'duplicate layer id "\'.concat(n.id,\'", previously used at line \').concat(b.id.__line__)))}if("ref"in n)["type","source","source-layer","filter","layout"].forEach(function(t){t in n&&e.push(new r(f,n[t],\'"\'.concat(t,\'" is prohibited for ref layers\')))}),h.layers.forEach(function(t){i(t.id)===v&&(y=t)}),y?y.ref?e.push(new r(f,n.ref,"ref cannot reference another ref layer")):d=i(y.type):e.push(new r(f,n.ref,\'ref layer "\'.concat(v,\'" not found\')));else if("background"!==d)if(n.source){var x=h.sources&&h.sources[n.source],w=x&&i(x.type);x?"vector"===w&&"raster"===d?e.push(new r(f,n.source,\'layer "\'.concat(n.id,\'" requires a raster source\'))):"raster"===w&&"raster"!==d?e.push(new r(f,n.source,\'layer "\'.concat(n.id,\'" requires a vector source\'))):"vector"!==w||n["source-layer"]?"raster-dem"===w&&"hillshade"!==d&&e.push(new r(f,n.source,"raster-dem source can only be used with layer type \'hillshade\'.")):e.push(new r(f,n,\'layer "\'.concat(n.id,\'" must specify a "source-layer"\'))):e.push(new r(f,n.source,\'source "\'.concat(n.source,\'" not found\')))}else e.push(new r(f,n,\'missing required property "source"\'));return e=e.concat(o({key:f,value:n,valueSpec:p.layer,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(){return[]},type:function(){return l({key:"".concat(f,".type"),value:n.type,valueSpec:p.layer.type,style:t.style,styleSpec:t.styleSpec,object:n,objectKey:"type"})},filter:a,layout:function(t){return o({layer:n,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return u(c({layerType:d},t))}}})},paint:function(t){return o({layer:n,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return s(c({layerType:d},t))}}})}}}))}},function(t,e,n){var r=n(71);t.exports=function(t){return r(t,"paint")}},function(t,e,n){var r=n(16),i=n(5),o=n(7),a=n(35).isFunction,s=n(12);t.exports=function(t,e){var n=t.key,u=t.style,l=t.styleSpec,c=t.value,f=t.objectKey,h=l["".concat(e,"_").concat(t.layerType)];if(!h)return[];var p=f.match(/^(.*)-transition$/);if("paint"===e&&p&&h[p[1]]&&h[p[1]].transition)return r({key:n,value:c,valueSpec:l.transition,style:u,styleSpec:l});var y,d=t.valueSpec||h[f];if(!d)return[new i(n,c,\'unknown property "\'.concat(f,\'"\'))];if("string"===o(c)&&d["property-function"]&&!d.tokens&&(y=/^{([^}]+)}$/.exec(c)))return[new i(n,c,\'"\'.concat(f,\'" does not support interpolation syntax\\n\')+\'Use an identity property function instead: `{ "type": "identity", "property": \'.concat(JSON.stringify(y[1])," }`."))];var v=[];return"symbol"===t.layerType&&("text-field"===f&&u&&!u.glyphs&&v.push(new i(n,c,\'use of "text-field" requires a style "glyphs" property\')),"text-font"===f&&a(s.deep(c))&&"identity"===s(c.type)&&v.push(new i(n,c,\'"text-font" does not support identity functions\'))),v.concat(r({key:t.key,value:c,valueSpec:d,style:u,styleSpec:l,expressionContext:"property",propertyKey:f}))}},function(t,e,n){var r=n(71);t.exports=function(t){return r(t,"layout")}},function(t,e,n){var r=n(5),i=n(12),o=n(24),a=n(37);t.exports=function(t){var e=t.value,n=t.key,s=t.styleSpec,u=t.style;if(!e.type)return[new r(n,e,\'"type" is required\')];var l=i(e.type),c=[];switch(l){case"vector":case"raster":case"raster-dem":if(c=c.concat(o({key:n,value:e,valueSpec:s["source_".concat(l.replace("-","_"))],style:t.style,styleSpec:s})),"url"in e)for(var f in e)["type","url","tileSize"].indexOf(f)<0&&c.push(new r("".concat(n,".").concat(f),e[f],\'a source with a "url" property may not include a "\'.concat(f,\'" property\')));return c;case"geojson":return o({key:n,value:e,valueSpec:s.source_geojson,style:u,styleSpec:s});case"video":return o({key:n,value:e,valueSpec:s.source_video,style:u,styleSpec:s});case"image":return o({key:n,value:e,valueSpec:s.source_image,style:u,styleSpec:s});case"canvas":return o({key:n,value:e,valueSpec:s.source_canvas,style:u,styleSpec:s});default:return a({key:"".concat(n,".type"),value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image","canvas"]},style:u,styleSpec:s})}}},function(t,e,n){var r=n(5),i=n(7),o=n(16);t.exports=function(t){var e=t.value,n=t.styleSpec,a=n.light,s=t.style,u=[],l=i(e);if(void 0===e)return u;if("object"!==l)return u=u.concat([new r("light",e,"object expected, ".concat(l," found"))]);for(var c in e){var f=c.match(/^(.*)-transition$/);u=f&&a[f[1]]&&a[f[1]].transition?u.concat(o({key:c,value:e[c],valueSpec:n.transition,style:s,styleSpec:n})):a[c]?u.concat(o({key:c,value:e[c],valueSpec:a[c],style:s,styleSpec:n})):u.concat([new r(c,e[c],\'unknown property "\'.concat(c,\'"\'))])}return u}},function(t,e,n){var r=n(7),i=n(5);t.exports=function(t){var e=t.value,n=t.key,o=r(e);return"string"!==o?[new i(n,e,"string expected, ".concat(o," found"))]:[]}},function(t,e,n){function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var i=n(2);function o(t,e,n){n[t]=n[t]||[],n[t].push(e)}function a(t,e,n){if(n&&n[t]){var r=n[t].indexOf(e);-1!==r&&n[t].splice(r,1)}}var s=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,n,s;return e=t,(n=[{key:"on",value:function(t,e){return this._listeners=this._listeners||{},o(t,e,this._listeners),this}},{key:"off",value:function(t,e){return a(t,e,this._listeners),a(t,e,this._oneTimeListeners),this}},{key:"once",value:function(t,e){return this._oneTimeListeners=this._oneTimeListeners||{},o(t,e,this._oneTimeListeners),this}},{key:"fire",value:function(t,e){if(this.listens(t)){e=i.extend({},e,{type:t,target:this});var n=this._listeners&&this._listeners[t]?this._listeners[t].slice():[],r=!0,o=!1,s=void 0;try{for(var u,l=n[Symbol.iterator]();!(r=(u=l.next()).done);r=!0){u.value.call(this,e)}}catch(t){o=!0,s=t}finally{try{r||null==l.return||l.return()}finally{if(o)throw s}}var c=this._oneTimeListeners&&this._oneTimeListeners[t]?this._oneTimeListeners[t].slice():[],f=!0,h=!1,p=void 0;try{for(var y,d=c[Symbol.iterator]();!(f=(y=d.next()).done);f=!0){var v=y.value;a(t,v,this._oneTimeListeners),v.call(this,e)}}catch(t){h=!0,p=t}finally{try{f||null==d.return||d.return()}finally{if(h)throw p}}this._eventedParent&&this._eventedParent.fire(t,i.extend({},e,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData))}else i.endsWith(t,"error")&&console.error(e&&e.error||e||"Empty error event");return this}},{key:"listens",value:function(t){return this._listeners&&this._listeners[t]&&this._listeners[t].length>0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)}},{key:"setEventedParent",value:function(t,e){return this._eventedParent=t,this._eventedParentData=e,this}}])&&r(e.prototype,n),s&&r(e,s),t}();t.exports=s},function(t,e,n){function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var i=n(10).CircleLayoutArray,o=n(109).members,a=n(25).SegmentVector,s=n(26).ProgramConfigurationSet,u=n(27).TriangleIndexArray,l=n(20),c=n(18),f=n(3).register;function h(t,e,n,r,i){t.emplaceBack(2*e+(r+1)/2,2*n+(i+1)/2)}var p=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(function(t){return t.id}),this.index=e.index,this.layoutVertexArray=new i,this.indexArray=new u,this.segments=new a,this.programConfigurations=new s(o,e.layers,e.zoom)}var e,n,f;return e=t,(n=[{key:"populate",value:function(t,e){var n=!0,r=!1,i=void 0;try{for(var o,a=t[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value,u=s.feature,c=s.index,f=s.sourceLayerIndex;if(this.layers[0]._featureFilter({zoom:this.zoom},u)){var h=l(u);this.addFeature(u,h),e.featureIndex.insert(u,h,c,f,this.index)}}}catch(t){r=!0,i=t}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}}},{key:"isEmpty",value:function(){return 0===this.layoutVertexArray.length}},{key:"upload",value:function(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,o),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.programConfigurations.upload(t)}},{key:"destroy",value:function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}},{key:"addFeature",value:function(t,e){var n=!0,r=!1,i=void 0;try{for(var o,a=e[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value,u=!0,l=!1,f=void 0;try{for(var p,y=s[Symbol.iterator]();!(u=(p=y.next()).done);u=!0){var d=p.value,v=d.x,m=d.y;if(!(v<0||v>=c||m<0||m>=c)){var g=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray),b=g.vertexLength;h(this.layoutVertexArray,v,m,-1,-1),h(this.layoutVertexArray,v,m,1,-1),h(this.layoutVertexArray,v,m,1,1),h(this.layoutVertexArray,v,m,-1,1),this.indexArray.emplaceBack(b,b+1,b+2),this.indexArray.emplaceBack(b,b+3,b+2),g.vertexLength+=4,g.primitiveLength+=2}}}catch(t){l=!0,f=t}finally{try{u||null==y.return||y.return()}finally{if(l)throw f}}}}catch(t){r=!0,i=t}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t)}}])&&r(e.prototype,n),f&&r(e,f),t}();f("CircleBucket",p,{omit:["layers"]}),t.exports=p},function(t,e,n){"use strict";function r(t,e,n){n=n||2;var r,s,u,l,c,p,d,v=e&&e.length,m=v?e[0]*n:t.length,g=i(t,0,m,n,!0),b=[];if(!g||g.next===g.prev)return b;if(v&&(g=function(t,e,n,r){var a,s,u,l,c,p=[];for(a=0,s=e.length;a<s;a++)u=e[a]*r,l=a<s-1?e[a+1]*r:t.length,(c=i(t,u,l,r,!1))===c.next&&(c.steiner=!0),p.push(y(c));for(p.sort(f),a=0;a<p.length;a++)h(p[a],n),n=o(n,n.next);return n}(t,e,g,n)),t.length>80*n){r=u=t[0],s=l=t[1];for(var x=n;x<m;x+=n)(c=t[x])<r&&(r=c),(p=t[x+1])<s&&(s=p),c>u&&(u=c),p>l&&(l=p);d=0!==(d=Math.max(u-r,l-s))?1/d:0}return a(g,b,n,r,s,d),b}function i(t,e,n,r,i){var o,a;if(i===A(t,e,n,r)>0)for(o=e;o<n;o+=r)a=k(o,t[o],t[o+1],a);else for(o=n-r;o>=e;o-=r)a=k(o,t[o],t[o+1],a);return a&&g(a,a.next)&&(_(a),a=a.next),a}function o(t,e){if(!t)return t;e||(e=t);var n,r=t;do{if(n=!1,r.steiner||!g(r,r.next)&&0!==m(r.prev,r,r.next))r=r.next;else{if(_(r),(r=e=r.prev)===r.next)break;n=!0}}while(n||r!==e);return e}function a(t,e,n,r,i,f,h){if(t){!h&&f&&function(t,e,n,r){var i=t;do{null===i.z&&(i.z=p(i.x,i.y,e,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,n,r,i,o,a,s,u,l=1;do{for(n=t,t=null,o=null,a=0;n;){for(a++,r=n,s=0,e=0;e<l&&(s++,r=r.nextZ);e++);for(u=l;s>0||u>0&&r;)0!==s&&(0===u||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,u--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;n=r}o.nextZ=null,l*=2}while(a>1)}(i)}(t,r,i,f);for(var y,d,v=t;t.prev!==t.next;)if(y=t.prev,d=t.next,f?u(t,r,i,f):s(t))e.push(y.i/n),e.push(t.i/n),e.push(d.i/n),_(t),t=d.next,v=d.next;else if((t=d)===v){h?1===h?a(t=l(t,e,n),e,n,r,i,f,2):2===h&&c(t,e,n,r,i,f):a(o(t),e,n,r,i,f,1);break}}}function s(t){var e=t.prev,n=t,r=t.next;if(m(e,n,r)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(d(e.x,e.y,n.x,n.y,r.x,r.y,i.x,i.y)&&m(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function u(t,e,n,r){var i=t.prev,o=t,a=t.next;if(m(i,o,a)>=0)return!1;for(var s=i.x<o.x?i.x<a.x?i.x:a.x:o.x<a.x?o.x:a.x,u=i.y<o.y?i.y<a.y?i.y:a.y:o.y<a.y?o.y:a.y,l=i.x>o.x?i.x>a.x?i.x:a.x:o.x>a.x?o.x:a.x,c=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,f=p(s,u,e,n,r),h=p(l,c,e,n,r),y=t.prevZ,v=t.nextZ;y&&y.z>=f&&v&&v.z<=h;){if(y!==t.prev&&y!==t.next&&d(i.x,i.y,o.x,o.y,a.x,a.y,y.x,y.y)&&m(y.prev,y,y.next)>=0)return!1;if(y=y.prevZ,v!==t.prev&&v!==t.next&&d(i.x,i.y,o.x,o.y,a.x,a.y,v.x,v.y)&&m(v.prev,v,v.next)>=0)return!1;v=v.nextZ}for(;y&&y.z>=f;){if(y!==t.prev&&y!==t.next&&d(i.x,i.y,o.x,o.y,a.x,a.y,y.x,y.y)&&m(y.prev,y,y.next)>=0)return!1;y=y.prevZ}for(;v&&v.z<=h;){if(v!==t.prev&&v!==t.next&&d(i.x,i.y,o.x,o.y,a.x,a.y,v.x,v.y)&&m(v.prev,v,v.next)>=0)return!1;v=v.nextZ}return!0}function l(t,e,n){var r=t;do{var i=r.prev,o=r.next.next;!g(i,o)&&b(i,r,r.next,o)&&x(i,o)&&x(o,i)&&(e.push(i.i/n),e.push(r.i/n),e.push(o.i/n),_(r),_(r.next),r=t=o),r=r.next}while(r!==t);return r}function c(t,e,n,r,i,s){var u=t;do{for(var l=u.next.next;l!==u.prev;){if(u.i!==l.i&&v(u,l)){var c=w(u,l);return u=o(u,u.next),c=o(c,c.next),a(u,e,n,r,i,s),void a(c,e,n,r,i,s)}l=l.next}u=u.next}while(u!==t)}function f(t,e){return t.x-e.x}function h(t,e){if(e=function(t,e){var n,r=e,i=t.x,o=t.y,a=-1/0;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){var s=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=i&&s>a){if(a=s,s===i){if(o===r.y)return r;if(o===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==e);if(!n)return null;if(i===a)return n.prev;var u,l=n,c=n.x,f=n.y,h=1/0;r=n.next;for(;r!==l;)i>=r.x&&r.x>=c&&i!==r.x&&d(o<f?i:a,o,c,f,o<f?a:i,o,r.x,r.y)&&((u=Math.abs(o-r.y)/(i-r.x))<h||u===h&&r.x>n.x)&&x(r,t)&&(n=r,h=u),r=r.next;return n}(t,e)){var n=w(e,t);o(n,n.next)}}function p(t,e,n,r,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*i)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*i)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function y(t){var e=t,n=t;do{(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),e=e.next}while(e!==t);return n}function d(t,e,n,r,i,o,a,s){return(i-a)*(e-s)-(t-a)*(o-s)>=0&&(t-a)*(r-s)-(n-a)*(e-s)>=0&&(n-a)*(o-s)-(i-a)*(r-s)>=0}function v(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&b(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&x(t,e)&&x(e,t)&&function(t,e){var n=t,r=!1,i=(t.x+e.x)/2,o=(t.y+e.y)/2;do{n.y>o!=n.next.y>o&&n.next.y!==n.y&&i<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==t);return r}(t,e)}function m(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function g(t,e){return t.x===e.x&&t.y===e.y}function b(t,e,n,r){return!!(g(t,e)&&g(n,r)||g(t,r)&&g(n,e))||m(t,e,n)>0!=m(t,e,r)>0&&m(n,r,t)>0!=m(n,r,e)>0}function x(t,e){return m(t.prev,t,t.next)<0?m(t,e,t.next)>=0&&m(t,t.prev,e)>=0:m(t,e,t.prev)<0||m(t,t.next,e)<0}function w(t,e){var n=new S(t.i,t.x,t.y),r=new S(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,n.next=i,i.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function k(t,e,n,r){var i=new S(t,e,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function _(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function S(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function A(t,e,n,r){for(var i=0,o=e,a=n-r;o<n;o+=r)i+=(t[a]-t[o])*(t[o+1]+t[a+1]),a=o;return i}t.exports=r,t.exports.default=r,r.deviation=function(t,e,n,r){var i=e&&e.length,o=i?e[0]*n:t.length,a=Math.abs(A(t,0,o,n));if(i)for(var s=0,u=e.length;s<u;s++){var l=e[s]*n,c=s<u-1?e[s+1]*n:t.length;a-=Math.abs(A(t,l,c,n))}var f=0;for(s=0;s<r.length;s+=3){var h=r[s]*n,p=r[s+1]*n,y=r[s+2]*n;f+=Math.abs((t[h]-t[y])*(t[p+1]-t[h+1])-(t[h]-t[p])*(t[y+1]-t[h+1]))}return 0===a&&0===f?0:Math.abs((f-a)/a)},r.flatten=function(t){for(var e=t[0][0].length,n={vertices:[],holes:[],dimensions:e},r=0,i=0;i<t.length;i++){for(var o=0;o<t[i].length;o++)for(var a=0;a<e;a++)n.vertices.push(t[i][o][a]);i>0&&(r+=t[i-1].length,n.holes.push(r))}return n}},function(t,e,n){"use strict";var r=n(80);function i(t,e){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(o,this,e),this.length=this._features.length}function o(t,e,n){15===t?e.version=n.readVarint():1===t?e.name=n.readString():5===t?e.extent=n.readVarint():2===t?e._features.push(n.pos):3===t?e._keys.push(n.readString()):4===t&&e._values.push(function(t){var e=null,n=t.readVarint()+t.pos;for(;t.pos<n;){var r=t.readVarint()>>3;e=1===r?t.readString():2===r?t.readFloat():3===r?t.readDouble():4===r?t.readVarint64():5===r?t.readVarint():6===r?t.readSVarint():7===r?t.readBoolean():null}return e}(n))}t.exports=i,i.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new r(this._pbf,e,this.extent,this._keys,this._values)}},function(t,e,n){"use strict";var r=n(6);function i(t,e,n,r,i){this.properties={},this.extent=n,this.type=0,this._pbf=t,this._geometry=-1,this._keys=r,this._values=i,t.readFields(o,this,e)}function o(t,e,n){1==t?e.id=n.readVarint():2==t?function(t,e){var n=t.readVarint()+t.pos;for(;t.pos<n;){var r=e._keys[t.readVarint()],i=e._values[t.readVarint()];e.properties[r]=i}}(n,e):3==t?e.type=n.readVarint():4==t&&(e._geometry=n.pos)}function a(t){for(var e,n,r=0,i=0,o=t.length,a=o-1;i<o;a=i++)e=t[i],r+=((n=t[a]).x-e.x)*(e.y+n.y);return r}t.exports=i,i.types=["Unknown","Point","LineString","Polygon"],i.prototype.loadGeometry=function(){var t=this._pbf;t.pos=this._geometry;for(var e,n=t.readVarint()+t.pos,i=1,o=0,a=0,s=0,u=[];t.pos<n;){if(o<=0){var l=t.readVarint();i=7&l,o=l>>3}if(o--,1===i||2===i)a+=t.readSVarint(),s+=t.readSVarint(),1===i&&(e&&u.push(e),e=[]),e.push(new r(a,s));else{if(7!==i)throw new Error("unknown command "+i);e&&e.push(e[0].clone())}}return e&&u.push(e),u},i.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,n=1,r=0,i=0,o=0,a=1/0,s=-1/0,u=1/0,l=-1/0;t.pos<e;){if(r<=0){var c=t.readVarint();n=7&c,r=c>>3}if(r--,1===n||2===n)(i+=t.readSVarint())<a&&(a=i),i>s&&(s=i),(o+=t.readSVarint())<u&&(u=o),o>l&&(l=o);else if(7!==n)throw new Error("unknown command "+n)}return[a,u,s,l]},i.prototype.toGeoJSON=function(t,e,n){var r,o,s=this.extent*Math.pow(2,n),u=this.extent*t,l=this.extent*e,c=this.loadGeometry(),f=i.types[this.type];function h(t){for(var e=0;e<t.length;e++){var n=t[e],r=180-360*(n.y+l)/s;t[e]=[360*(n.x+u)/s-180,360/Math.PI*Math.atan(Math.exp(r*Math.PI/180))-90]}}switch(this.type){case 1:var p=[];for(r=0;r<c.length;r++)p[r]=c[r][0];h(c=p);break;case 2:for(r=0;r<c.length;r++)h(c[r]);break;case 3:for(c=function(t){var e=t.length;if(e<=1)return[t];for(var n,r,i=[],o=0;o<e;o++){var s=a(t[o]);0!==s&&(void 0===r&&(r=s<0),r===s<0?(n&&i.push(n),n=[t[o]]):n.push(t[o]))}n&&i.push(n);return i}(c),r=0;r<c.length;r++)for(o=0;o<c[r].length;o++)h(c[r][o])}1===c.length?c=c[0]:f="Multi"+f;var y={type:"Feature",geometry:{type:f,coordinates:c},properties:this.properties};return"id"in this&&(y.id=this.id),y}},function(t,e,n){var r=n(31);t.exports=function(e){for(var n="",i=0;i<e.length;i++){var o=e.charCodeAt(i+1)||null,a=e.charCodeAt(i-1)||null;(!o||!r.charHasRotatedVerticalOrientation(o)||t.exports.lookup[e[i+1]])&&(!a||!r.charHasRotatedVerticalOrientation(a)||t.exports.lookup[e[i-1]])&&t.exports.lookup[e[i]]?n+=t.exports.lookup[e[i]]:n+=e[i]}return n},t.exports.lookup={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"}},function(t,e,n){function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var i=n(44),o=n(21),a=n(32),s=n(147),u=n(2);function l(t,e){var n=i.getArrayBuffer(t.request,function(t,n){t?e(t):n&&e(null,{vectorTile:new o.VectorTile(new a(n.data)),rawData:n.data,cacheControl:n.cacheControl,expires:n.expires})});return function(){n.abort(),e()}}var c=function(){function t(e,n,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.actor=e,this.layerIndex=n,this.loadVectorData=r||l,this.loading={},this.loaded={}}var e,n,i;return e=t,(n=[{key:"loadTile",value:function(t,e){var n=this,r=t.source,i=t.uid;this.loading[r]||(this.loading[r]={});var o=this.loading[r][i]=new s(t);o.abort=this.loadVectorData(t,function(t,a){if(delete n.loading[r][i],t||!a)return e(t);var s=a.rawData,l={};a.expires&&(l.expires=a.expires),a.cacheControl&&(l.cacheControl=a.cacheControl),o.vectorTile=a.vectorTile,o.parse(a.vectorTile,n.layerIndex,n.actor,function(t,n){if(t||!n)return e(t);e(null,u.extend({rawTileData:s.slice(0)},n,l))}),n.loaded[r]=n.loaded[r]||{},n.loaded[r][i]=o})}},{key:"reloadTile",value:function(t,e){var n=this.loaded[t.source],r=t.uid,i=this;if(n&&n[r]){var o=n[r];o.showCollisionBoxes=t.showCollisionBoxes,"parsing"===o.status?o.reloadCallback=a.bind(o):"done"===o.status&&o.parse(o.vectorTile,this.layerIndex,this.actor,a.bind(o))}function a(t,n){if(this.reloadCallback){var r=this.reloadCallback;delete this.reloadCallback,this.parse(this.vectorTile,i.layerIndex,i.actor,r)}e(t,n)}}},{key:"abortTile",value:function(t,e){var n=this.loading[t.source],r=t.uid;n&&n[r]&&n[r].abort&&(n[r].abort(),delete n[r]),e()}},{key:"removeTile",value:function(t,e){var n=this.loaded[t.source],r=t.uid;n&&n[r]&&delete n[r],e()}}])&&r(e.prototype,n),i&&r(e,i),t}();t.exports=c},function(t,e,n){function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var i=n(0),o=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._stringToNumber={},this._numberToString=[];for(var n=0;n<e.length;n++){var r=e[n];this._stringToNumber[r]=n,this._numberToString[n]=r}}var e,n,o;return e=t,(n=[{key:"encode",value:function(t){return i(t in this._stringToNumber),this._stringToNumber[t]}},{key:"decode",value:function(t){return i(t<this._numberToString.length),this._numberToString[t]}}])&&r(e.prototype,n),o&&r(e,o),t}();t.exports=o},function(t,e,n){function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function o(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}var a=n(150),s=n(0),u=n(3).register,l=n(47),c=function(){function t(e,n,i){r(this,t),s(e>=0&&e<=25),s(n>=0&&n<Math.pow(2,e)),s(i>=0&&i<Math.pow(2,e)),this.z=e,this.x=n,this.y=i,this.key=p(0,e,n,i)}return o(t,[{key:"equals",value:function(t){return this.z===t.z&&this.x===t.x&&this.y===t.y}},{key:"url",value:function(t,e){var n=a.getTileBBox(this.x,this.y,this.z),r=function(t,e,n){for(var r,i="",o=t;o>0;o--)i+=(e&(r=1<<o-1)?1:0)+(n&r?2:0);return i}(this.z,this.x,this.y);return t[(this.x+this.y)%t.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace("{z}",String(this.z)).replace("{x}",String(this.x)).replace("{y}",String("tms"===e?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",r).replace("{bbox-epsg-3857}",n)}}]),t}(),f=function t(e,n,i){r(this,t),this.wrap=e,this.canonical=n,this.key=p(e,n.z,n.x,n.y),this.posMatrix=i},h=function(){function t(e,n,i,o,a){r(this,t),s(e>=i),this.overscaledZ=e,this.wrap=n,this.canonical=new c(i,+o,+a),this.key=p(n,e,o,a)}return o(t,[{key:"scaledTo",value:function(e){s(e<=this.overscaledZ);var n=this.canonical.z-e;return e>this.canonical.z?new t(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new t(e,this.wrap,e,this.canonical.x>>n,this.canonical.y>>n)}},{key:"isChildOf",value:function(t){var e=this.canonical.z-t.canonical.z;return 0===t.overscaledZ||t.overscaledZ<this.overscaledZ&&t.canonical.x===this.canonical.x>>e&&t.canonical.y===this.canonical.y>>e}},{key:"children",value:function(e){if(this.overscaledZ>=e)return[new t(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var n=this.canonical.z+1,r=2*this.canonical.x,i=2*this.canonical.y;return[new t(n,this.wrap,n,r,i),new t(n,this.wrap,n,r+1,i),new t(n,this.wrap,n,r,i+1),new t(n,this.wrap,n,r+1,i+1)]}},{key:"isLessThan",value:function(t){return this.wrap<t.wrap||!(this.wrap>t.wrap)&&(this.overscaledZ<t.overscaledZ||!(this.overscaledZ>t.overscaledZ)&&(this.canonical.x<t.canonical.x||!(this.canonical.x>t.canonical.x)&&this.canonical.y<t.canonical.y))}},{key:"wrapped",value:function(){return new t(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}},{key:"overscaleFactor",value:function(){return Math.pow(2,this.overscaledZ-this.canonical.z)}},{key:"toUnwrapped",value:function(){return new f(this.wrap,this.canonical,this.posMatrix)}},{key:"toString",value:function(){return"".concat(this.overscaledZ,"/").concat(this.canonical.x,"/").concat(this.canonical.y)}},{key:"toCoordinate",value:function(){return new l(this.canonical.x+Math.pow(2,this.wrap),this.canonical.y,this.canonical.z)}}]),t}();function p(t,e,n,r){(t*=2)<0&&(t=-1*t-1);var i=1<<e;return 32*(i*i*t+i*r+n)+e}u("CanonicalTileID",c),u("OverscaledTileID",h,{omit:["posMatrix"]}),t.exports={CanonicalTileID:c,OverscaledTileID:h,UnwrappedTileID:f}},function(t,e,n){t.exports=function(){function t(t,e,n){n=n||{},this.w=t||64,this.h=e||64,this.autoResize=!!n.autoResize,this.shelves=[],this.freebins=[],this.stats={},this.bins={},this.maxId=0}function e(t,e,n){this.x=0,this.y=t,this.w=this.free=e,this.h=n}function n(t,e,n,r,i,o,a){this.id=t,this.x=e,this.y=n,this.w=r,this.h=i,this.maxw=o||r,this.maxh=a||i,this.refcount=0}return t.prototype.pack=function(t,e){t=[].concat(t),e=e||{};for(var n,r,i,o,a=[],s=0;s<t.length;s++)if(n=t[s].w||t[s].width,r=t[s].h||t[s].height,i=t[s].id,n&&r){if(!(o=this.packOne(n,r,i)))continue;e.inPlace&&(t[s].x=o.x,t[s].y=o.y,t[s].id=o.id),a.push(o)}return this.shrink(),a},t.prototype.packOne=function(t,n,r){var i,o,a,s,u,l,c,f,h={freebin:-1,shelf:-1,waste:1/0},p=0;if("string"==typeof r||"number"==typeof r){if(i=this.getBin(r))return this.ref(i),i;"number"==typeof r&&(this.maxId=Math.max(r,this.maxId))}else r=++this.maxId;for(s=0;s<this.freebins.length;s++){if(n===(i=this.freebins[s]).maxh&&t===i.maxw)return this.allocFreebin(s,t,n,r);n>i.maxh||t>i.maxw||n<=i.maxh&&t<=i.maxw&&(a=i.maxw*i.maxh-t*n)<h.waste&&(h.waste=a,h.freebin=s)}for(s=0;s<this.shelves.length;s++)if(p+=(o=this.shelves[s]).h,!(t>o.free)){if(n===o.h)return this.allocShelf(s,t,n,r);n>o.h||n<o.h&&(a=(o.h-n)*t)<h.waste&&(h.freebin=-1,h.waste=a,h.shelf=s)}return-1!==h.freebin?this.allocFreebin(h.freebin,t,n,r):-1!==h.shelf?this.allocShelf(h.shelf,t,n,r):n<=this.h-p&&t<=this.w?(o=new e(p,this.w,n),this.allocShelf(this.shelves.push(o)-1,t,n,r)):this.autoResize?(u=l=this.h,((c=f=this.w)<=u||t>c)&&(f=2*Math.max(t,c)),(u<c||n>u)&&(l=2*Math.max(n,u)),this.resize(f,l),this.packOne(t,n,r)):null},t.prototype.allocFreebin=function(t,e,n,r){var i=this.freebins.splice(t,1)[0];return i.id=r,i.w=e,i.h=n,i.refcount=0,this.bins[r]=i,this.ref(i),i},t.prototype.allocShelf=function(t,e,n,r){var i=this.shelves[t].alloc(e,n,r);return this.bins[r]=i,this.ref(i),i},t.prototype.shrink=function(){if(this.shelves.length>0){for(var t=0,e=0,n=0;n<this.shelves.length;n++){var r=this.shelves[n];e+=r.h,t=Math.max(r.w-r.free,t)}this.resize(t,e)}},t.prototype.getBin=function(t){return this.bins[t]},t.prototype.ref=function(t){if(1==++t.refcount){var e=t.h;this.stats[e]=1+(0|this.stats[e])}return t.refcount},t.prototype.unref=function(t){return 0===t.refcount?0:(0==--t.refcount&&(this.stats[t.h]--,delete this.bins[t.id],this.freebins.push(t)),t.refcount)},t.prototype.clear=function(){this.shelves=[],this.freebins=[],this.stats={},this.bins={},this.maxId=0},t.prototype.resize=function(t,e){this.w=t,this.h=e;for(var n=0;n<this.shelves.length;n++)this.shelves[n].resize(t);return!0},e.prototype.alloc=function(t,e,r){if(t>this.free||e>this.h)return null;var i=this.x;return this.x+=t,this.free-=t,new n(r,i,this.y,t,e,t,this.h)},e.prototype.resize=function(t){return this.free+=t-this.w,this.w=t,!0},t}()},function(t,e,n){function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var i=n(87),o=n(101),a=n(82),s=n(164),u=n(166),l=n(0),c=n(43);new(function(){function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.self=e,this.actor=new i(e,this),this.layerIndexes={},this.workerSourceTypes={vector:a,geojson:u},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=function(t,e){if(n.workerSourceTypes[t])throw new Error(\'Worker source with name "\'.concat(t,\'" already registered.\'));n.workerSourceTypes[t]=e},this.self.registerRTLTextPlugin=function(t){if(c.applyArabicShaping||c.processBidirectionalText)throw new Error("RTL text plugin already registered.");c.applyArabicShaping=t.applyArabicShaping,c.processBidirectionalText=t.processBidirectionalText}}var e,n,f;return e=t,(n=[{key:"setLayers",value:function(t,e,n){this.getLayerIndex(t).replace(e),n()}},{key:"updateLayers",value:function(t,e,n){this.getLayerIndex(t).update(e.layers,e.removedIds),n()}},{key:"loadTile",value:function(t,e,n){l(e.type),this.getWorkerSource(t,e.type).loadTile(e,n)}},{key:"loadDEMTile",value:function(t,e,n){this.getDEMWorkerSource(t).loadTile(e,n)}},{key:"reloadTile",value:function(t,e,n){l(e.type),this.getWorkerSource(t,e.type).reloadTile(e,n)}},{key:"abortTile",value:function(t,e,n){l(e.type),this.getWorkerSource(t,e.type).abortTile(e,n)}},{key:"removeTile",value:function(t,e,n){l(e.type),this.getWorkerSource(t,e.type).removeTile(e,n)}},{key:"removeDEMTile",value:function(t,e){this.getDEMWorkerSource(t).removeTile(e)}},{key:"removeSource",value:function(t,e,n){l(e.type);var r=this.getWorkerSource(t,e.type);void 0!==r.removeSource?r.removeSource(e,n):n()}},{key:"loadWorkerSource",value:function(t,e,n){try{this.self.importScripts(e.url),n()}catch(t){n(t)}}},{key:"loadRTLTextPlugin",value:function(t,e,n){try{c.applyArabicShaping||c.processBidirectionalText||(this.self.importScripts(e),c.applyArabicShaping&&c.processBidirectionalText||n(new Error("RTL Text Plugin failed to import scripts from ".concat(e))))}catch(t){n(t)}}},{key:"getLayerIndex",value:function(t){var e=this.layerIndexes[t];return e||(e=this.layerIndexes[t]=new o),e}},{key:"getWorkerSource",value:function(t,e){var n=this;if(this.workerSources[t]||(this.workerSources[t]={}),!this.workerSources[t][e]){var r={send:function(e,r,i){n.actor.send(e,r,i,t)}};this.workerSources[t][e]=new this.workerSourceTypes[e](r,this.getLayerIndex(t))}return this.workerSources[t][e]}},{key:"getDEMWorkerSource",value:function(t){return this.demWorkerSources[t]||(this.demWorkerSources[t]=new s),this.demWorkerSources[t]}}])&&r(e.prototype,n),f&&r(e,f),t}())(self)},function(t,e,n){function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var i=n(2),o=n(3),a=o.serialize,s=o.deserialize,u=function(){function t(e,n,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.target=e,this.parent=n,this.mapId=r,this.callbacks={},this.callbackID=0,i.bindAll(["receive"],this),this.target.addEventListener("message",this.receive,!1)}var e,n,o;return e=t,(n=[{key:"send",value:function(t,e,n,r){var i=n?"".concat(this.mapId,":").concat(this.callbackID++):null;n&&(this.callbacks[i]=n);var o=[];this.target.postMessage({targetMapId:r,sourceMapId:this.mapId,type:t,id:String(i),data:a(e,o)},o)}},{key:"receive",value:function(t){var e,n=this,r=t.data,i=r.id;if(!r.targetMapId||this.mapId===r.targetMapId){var o=function(t,e){var r=[];n.target.postMessage({sourceMapId:n.mapId,type:"<response>",id:String(i),error:t?String(t):null,data:a(e,r)},r)};if("<response>"===r.type)e=this.callbacks[r.id],delete this.callbacks[r.id],e&&r.error?e(new Error(r.error)):e&&e(null,s(r.data));else if(void 0!==r.id&&this.parent[r.type])this.parent[r.type](r.sourceMapId,s(r.data),o);else if(void 0!==r.id&&this.parent.getWorkerSource){var u=r.type.split(".");this.parent.getWorkerSource(r.sourceMapId,u[0])[u[1]](s(r.data),o)}else this.parent[r.type](s(r.data))}}},{key:"remove",value:function(){this.target.removeEventListener("message",this.receive,!1)}}])&&r(e.prototype,n),o&&r(e,o),t}();t.exports=u},function(t,e){function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}t.exports=function t(e,r){if(Array.isArray(e)){if(!Array.isArray(r)||e.length!==r.length)return!1;for(var i=0;i<e.length;i++)if(!t(e[i],r[i]))return!1;return!0}if("object"===n(e)&&null!==e&&null!==r){if("object"!==n(r))return!1;if(Object.keys(e).length!==Object.keys(r).length)return!1;for(var o in e)if(!t(e[o],r[o]))return!1;return!0}return e===r}},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";\n/*\nobject-assign\n(c) Sindre Sorhus\n@license MIT\n*/var r=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;t.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},n=0;n<10;n++)e["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(e).map(function(t){return e[t]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(t){r[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var n,a,s=function(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}(t),u=1;u<arguments.length;u++){for(var l in n=Object(arguments[u]))i.call(n,l)&&(s[l]=n[l]);if(r){a=r(n);for(var c=0;c<a.length;c++)o.call(n,a[c])&&(s[a[c]]=n[a[c]])}}return s}},function(t,e,n){(function(t){var r=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),n={},r=0;r<e.length;r++)n[e[r]]=Object.getOwnPropertyDescriptor(t,e[r]);return n},i=/%[sdj%]/g;e.format=function(t){if(!m(t)){for(var e=[],n=0;n<arguments.length;n++)e.push(s(arguments[n]));return e.join(" ")}n=1;for(var r=arguments,o=r.length,a=String(t).replace(i,function(t){if("%%"===t)return"%";if(n>=o)return t;switch(t){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(t){return"[Circular]"}default:return t}}),u=r[n];n<o;u=r[++n])d(u)||!x(u)?a+=" "+u:a+=" "+s(u);return a},e.deprecate=function(n,r){if(void 0!==t&&!0===t.noDeprecation)return n;if(void 0===t)return function(){return e.deprecate(n,r).apply(this,arguments)};var i=!1;return function(){if(!i){if(t.throwDeprecation)throw new Error(r);t.traceDeprecation?console.trace(r):console.error(r),i=!0}return n.apply(this,arguments)}};var o,a={};function s(t,n){var r={seen:[],stylize:l};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),y(n)?r.showHidden=n:n&&e._extend(r,n),g(r.showHidden)&&(r.showHidden=!1),g(r.depth)&&(r.depth=2),g(r.colors)&&(r.colors=!1),g(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=u),c(r,t,r.depth)}function u(t,e){var n=s.styles[e];return n?"["+s.colors[n][0]+"m"+t+"["+s.colors[n][1]+"m":t}function l(t,e){return t}function c(t,n,r){if(t.customInspect&&n&&_(n.inspect)&&n.inspect!==e.inspect&&(!n.constructor||n.constructor.prototype!==n)){var i=n.inspect(r,t);return m(i)||(i=c(t,i,r)),i}var o=function(t,e){if(g(e))return t.stylize("undefined","undefined");if(m(e)){var n="\'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/\'/g,"\\\\\'").replace(/\\\\"/g,\'"\')+"\'";return t.stylize(n,"string")}if(v(e))return t.stylize(""+e,"number");if(y(e))return t.stylize(""+e,"boolean");if(d(e))return t.stylize("null","null")}(t,n);if(o)return o;var a=Object.keys(n),s=function(t){var e={};return t.forEach(function(t,n){e[t]=!0}),e}(a);if(t.showHidden&&(a=Object.getOwnPropertyNames(n)),k(n)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return f(n);if(0===a.length){if(_(n)){var u=n.name?": "+n.name:"";return t.stylize("[Function"+u+"]","special")}if(b(n))return t.stylize(RegExp.prototype.toString.call(n),"regexp");if(w(n))return t.stylize(Date.prototype.toString.call(n),"date");if(k(n))return f(n)}var l,x="",S=!1,A=["{","}"];(p(n)&&(S=!0,A=["[","]"]),_(n))&&(x=" [Function"+(n.name?": "+n.name:"")+"]");return b(n)&&(x=" "+RegExp.prototype.toString.call(n)),w(n)&&(x=" "+Date.prototype.toUTCString.call(n)),k(n)&&(x=" "+f(n)),0!==a.length||S&&0!=n.length?r<0?b(n)?t.stylize(RegExp.prototype.toString.call(n),"regexp"):t.stylize("[Object]","special"):(t.seen.push(n),l=S?function(t,e,n,r,i){for(var o=[],a=0,s=e.length;a<s;++a)j(e,String(a))?o.push(h(t,e,n,r,String(a),!0)):o.push("");return i.forEach(function(i){i.match(/^\\d+$/)||o.push(h(t,e,n,r,i,!0))}),o}(t,n,r,s,a):a.map(function(e){return h(t,n,r,s,e,S)}),t.seen.pop(),function(t,e,n){if(t.reduce(function(t,e){return 0,e.indexOf("\\n")>=0&&0,t+e.replace(/\\u001b\\[\\d\\d?m/g,"").length+1},0)>60)return n[0]+(""===e?"":e+"\\n ")+" "+t.join(",\\n ")+" "+n[1];return n[0]+e+" "+t.join(", ")+" "+n[1]}(l,x,A)):A[0]+x+A[1]}function f(t){return"["+Error.prototype.toString.call(t)+"]"}function h(t,e,n,r,i,o){var a,s,u;if((u=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?s=u.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):u.set&&(s=t.stylize("[Setter]","special")),j(r,i)||(a="["+i+"]"),s||(t.seen.indexOf(u.value)<0?(s=d(n)?c(t,u.value,null):c(t,u.value,n-1)).indexOf("\\n")>-1&&(s=o?s.split("\\n").map(function(t){return" "+t}).join("\\n").substr(2):"\\n"+s.split("\\n").map(function(t){return" "+t}).join("\\n")):s=t.stylize("[Circular]","special")),g(a)){if(o&&i.match(/^\\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=t.stylize(a,"name")):(a=a.replace(/\'/g,"\\\\\'").replace(/\\\\"/g,\'"\').replace(/(^"|"$)/g,"\'"),a=t.stylize(a,"string"))}return a+": "+s}function p(t){return Array.isArray(t)}function y(t){return"boolean"==typeof t}function d(t){return null===t}function v(t){return"number"==typeof t}function m(t){return"string"==typeof t}function g(t){return void 0===t}function b(t){return x(t)&&"[object RegExp]"===S(t)}function x(t){return"object"==typeof t&&null!==t}function w(t){return x(t)&&"[object Date]"===S(t)}function k(t){return x(t)&&("[object Error]"===S(t)||t instanceof Error)}function _(t){return"function"==typeof t}function S(t){return Object.prototype.toString.call(t)}function A(t){return t<10?"0"+t.toString(10):t.toString(10)}e.debuglog=function(n){if(g(o)&&(o=t.env.NODE_DEBUG||""),n=n.toUpperCase(),!a[n])if(new RegExp("\\\\b"+n+"\\\\b","i").test(o)){var r=t.pid;a[n]=function(){var t=e.format.apply(e,arguments);console.error("%s %d: %s",n,r,t)}}else a[n]=function(){};return a[n]},e.inspect=s,s.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.isArray=p,e.isBoolean=y,e.isNull=d,e.isNullOrUndefined=function(t){return null==t},e.isNumber=v,e.isString=m,e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=g,e.isRegExp=b,e.isObject=x,e.isDate=w,e.isError=k,e.isFunction=_,e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=n(93);var T=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function j(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.log=function(){var t,n;console.log("%s - %s",(t=new Date,n=[A(t.getHours()),A(t.getMinutes()),A(t.getSeconds())].join(":"),[t.getDate(),T[t.getMonth()],n].join(" ")),e.format.apply(e,arguments))},e.inherits=n(94),e._extend=function(t,e){if(!e||!x(e))return t;for(var n=Object.keys(e),r=n.length;r--;)t[n[r]]=e[n[r]];return t};var O="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function z(t,e){if(!t){var n=new Error("Promise was rejected with a falsy value");n.reason=t,t=n}return e(t)}e.promisify=function(t){if("function"!=typeof t)throw new TypeError(\'The "original" argument must be of type Function\');if(O&&t[O]){var e;if("function"!=typeof(e=t[O]))throw new TypeError(\'The "util.promisify.custom" argument must be of type Function\');return Object.defineProperty(e,O,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var e,n,r=new Promise(function(t,r){e=t,n=r}),i=[],o=0;o<arguments.length;o++)i.push(arguments[o]);i.push(function(t,r){t?n(t):e(r)});try{t.apply(this,i)}catch(t){n(t)}return r}return Object.setPrototypeOf(e,Object.getPrototypeOf(t)),O&&Object.defineProperty(e,O,{value:e,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(e,r(t))},e.promisify.custom=O,e.callbackify=function(e){if("function"!=typeof e)throw new TypeError(\'The "original" argument must be of type Function\');function n(){for(var n=[],r=0;r<arguments.length;r++)n.push(arguments[r]);var i=n.pop();if("function"!=typeof i)throw new TypeError("The last argument must be of type Function");var o=this,a=function(){return i.apply(o,arguments)};e.apply(this,n).then(function(e){t.nextTick(a,null,e)},function(e){t.nextTick(z,e,a)})}return Object.setPrototypeOf(n,Object.getPrototypeOf(e)),Object.defineProperties(n,r(e)),n}}).call(this,n(92))},function(t,e){var n,r,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(t){if(n===setTimeout)return setTimeout(t,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(t){n=o}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(t){r=a}}();var u,l=[],c=!1,f=-1;function h(){c&&u&&(c=!1,u.length?l=u.concat(l):f=-1,l.length&&p())}function p(){if(!c){var t=s(h);c=!0;for(var e=l.length;e;){for(u=l,l=[];++f<e;)u&&u[f].run();f=-1,e=l.length}u=null,c=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function y(t,e){this.fun=t,this.array=e}function d(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];l.push(new y(t,e)),1!==l.length||c||s(p)},y.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=d,i.addListener=d,i.once=d,i.off=d,i.removeListener=d,i.removeAllListeners=d,i.emit=d,i.prependListener=d,i.prependOnceListener=d,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(t,e){t.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},function(t,e){"function"==typeof Object.create?t.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}},function(t,e,n){function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var i=n(4),o=i.array,a=i.ValueType,s=i.NumberType,u=n(15),l=function(){function t(e,n,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.type=e,this.index=n,this.input=r}var e,n,i;return e=t,i=[{key:"parse",value:function(e,n){if(3!==e.length)return n.error("Expected 2 arguments, but found ".concat(e.length-1," instead."));var r=n.parse(e[1],1,s),i=n.parse(e[2],2,o(n.expectedType||a));return r&&i?new t(i.type.itemType,r,i):null}}],(n=[{key:"evaluate",value:function(t){var e=this.index.evaluate(t),n=this.input.evaluate(t);if(e<0||e>=n.length)throw new u("Array index out of bounds: ".concat(e," > ").concat(n.length,"."));if(e!==Math.floor(e))throw new u("Array index must be an integer, but found ".concat(e," instead."));return n[e]}},{key:"eachChild",value:function(t){t(this.index),t(this.input)}},{key:"possibleOutputs",value:function(){return[void 0]}}])&&r(e.prototype,n),i&&r(e,i),t}();t.exports=l},function(t,e,n){function r(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var o=n(0),a=n(11).typeOf,s=function(){function t(e,n,r,i,o,a){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.inputType=e,this.type=n,this.input=r,this.cases=i,this.outputs=o,this.otherwise=a}var e,n,s;return e=t,s=[{key:"parse",value:function(e,n){if(e.length<5)return n.error("Expected at least 4 arguments, but found only ".concat(e.length-1,"."));if(e.length%2!=1)return n.error("Expected an even number of arguments.");var r,i;n.expectedType&&"value"!==n.expectedType.kind&&(i=n.expectedType);for(var s={},u=[],l=2;l<e.length-1;l+=2){var c=e[l],f=e[l+1];Array.isArray(c)||(c=[c]);var h=n.concat(l);if(0===c.length)return h.error("Expected at least one branch label.");var p=!0,y=!1,d=void 0;try{for(var v,m=c[Symbol.iterator]();!(p=(v=m.next()).done);p=!0){var g=v.value;if("number"!=typeof g&&"string"!=typeof g)return h.error("Branch labels must be numbers or strings.");if("number"==typeof g&&Math.abs(g)>Number.MAX_SAFE_INTEGER)return h.error("Branch labels must be integers no larger than ".concat(Number.MAX_SAFE_INTEGER,"."));if("number"==typeof g&&Math.floor(g)!==g)return h.error("Numeric branch labels must be integer values.");if(r){if(h.checkSubtype(r,a(g)))return null}else r=a(g);if(void 0!==s[String(g)])return h.error("Branch labels must be unique.");s[String(g)]=u.length}}catch(t){y=!0,d=t}finally{try{p||null==m.return||m.return()}finally{if(y)throw d}}var b=n.parse(f,l,i);if(!b)return null;i=i||b.type,u.push(b)}var x=n.parse(e[1],1,r);if(!x)return null;var w=n.parse(e[e.length-1],e.length-1,i);return w?(o(r&&i),new t(r,i,x,s,u,w)):null}}],(n=[{key:"evaluate",value:function(t){var e=this.input.evaluate(t);return(this.outputs[this.cases[e]]||this.otherwise).evaluate(t)}},{key:"eachChild",value:function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)}},{key:"possibleOutputs",value:function(){var t;return(t=[]).concat.apply(t,r(this.outputs.map(function(t){return t.possibleOutputs()}))).concat(this.otherwise.possibleOutputs())}}])&&i(e.prototype,n),s&&i(e,s),t}();t.exports=s},function(t,e,n){function r(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function i(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function o(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var a=n(0),s=n(4).BooleanType,u=function(){function t(e,n,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.type=e,this.branches=n,this.otherwise=r}var e,n,u;return e=t,u=[{key:"parse",value:function(e,n){if(e.length<4)return n.error("Expected at least 3 arguments, but found only ".concat(e.length-1,"."));if(e.length%2!=0)return n.error("Expected an odd number of arguments.");var r;n.expectedType&&"value"!==n.expectedType.kind&&(r=n.expectedType);for(var i=[],o=1;o<e.length-1;o+=2){var u=n.parse(e[o],o,s);if(!u)return null;var l=n.parse(e[o+1],o+1,r);if(!l)return null;i.push([u,l]),r=r||l.type}var c=n.parse(e[e.length-1],e.length-1,r);return c?(a(r),new t(r,i,c)):null}}],(n=[{key:"evaluate",value:function(t){var e=!0,n=!1,r=void 0;try{for(var o,a=this.branches[Symbol.iterator]();!(e=(o=a.next()).done);e=!0){var s=i(o.value,2),u=s[0],l=s[1];if(u.evaluate(t))return l.evaluate(t)}}catch(t){n=!0,r=t}finally{try{e||null==a.return||a.return()}finally{if(n)throw r}}return this.otherwise.evaluate(t)}},{key:"eachChild",value:function(t){var e=!0,n=!1,r=void 0;try{for(var o,a=this.branches[Symbol.iterator]();!(e=(o=a.next()).done);e=!0){var s=i(o.value,2),u=s[0],l=s[1];t(u),t(l)}}catch(t){n=!0,r=t}finally{try{e||null==a.return||a.return()}finally{if(n)throw r}}t(this.otherwise)}},{key:"possibleOutputs",value:function(){var t;return(t=[]).concat.apply(t,r(this.branches.map(function(t){var e=i(t,2);e[0];return e[1].possibleOutputs()}))).concat(this.otherwise.possibleOutputs())}}])&&o(e.prototype,n),u&&o(e,u),t}();t.exports=u},function(t,e,n){function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var i=n(4),o=i.ValueType,a=i.BooleanType,s=n(4).toString;function u(t){return"string"===t.kind||"number"===t.kind||"boolean"===t.kind||"null"===t.kind}function l(t){return function(){function e(t,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),this.type=a,this.lhs=t,this.rhs=n}var n,i,l;return n=e,l=[{key:"parse",value:function(t,n){if(3!==t.length)return n.error("Expected two arguments.");var r=n.parse(t[1],1,o);if(!r)return null;var i=n.parse(t[2],2,o);return i?u(r.type)||u(i.type)?r.type.kind!==i.type.kind&&"value"!==r.type.kind&&"value"!==i.type.kind?n.error("Cannot compare ".concat(s(r.type)," and ").concat(s(i.type),".")):new e(r,i):n.error("Expected at least one argument to be a string, number, boolean, or null, but found (".concat(s(r.type),", ").concat(s(i.type),") instead.")):null}}],(i=[{key:"evaluate",value:function(e){return t(this.lhs.evaluate(e),this.rhs.evaluate(e))}},{key:"eachChild",value:function(t){t(this.lhs),t(this.rhs)}},{key:"possibleOutputs",value:function(){return[!0,!1]}}])&&r(n.prototype,i),l&&r(n,l),e}()}t.exports={Equals:l(function(t,e){return t===e}),NotEquals:l(function(t,e){return t!==e})}},function(t,e){t.exports={success:function(t){return{result:"success",value:t}},error:function(t){return{result:"error",value:t}}}},function(t,e,n){var r=n(13),i=n(19).number,o=.95047,a=1,s=1.08883,u=4/29,l=6/29,c=3*l*l,f=l*l*l,h=Math.PI/180,p=180/Math.PI;function y(t){return t>f?Math.pow(t,1/3):t/c+u}function d(t){return t>l?t*t*t:c*(t-u)}function v(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function m(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function g(t){var e=m(t.r),n=m(t.g),r=m(t.b),i=y((.4124564*e+.3575761*n+.1804375*r)/o),u=y((.2126729*e+.7151522*n+.072175*r)/a);return{l:116*u-16,a:500*(i-u),b:200*(u-y((.0193339*e+.119192*n+.9503041*r)/s)),alpha:t.a}}function b(t){var e=(t.l+16)/116,n=isNaN(t.a)?e:e+t.a/500,i=isNaN(t.b)?e:e-t.b/200;return e=a*d(e),n=o*d(n),i=s*d(i),new r(v(3.2404542*n-1.5371385*e-.4985314*i),v(-.969266*n+1.8760108*e+.041556*i),v(.0556434*n-.2040259*e+1.0572252*i),t.alpha)}function x(t,e,n){var r=e-t;return t+n*(r>180||r<-180?r-360*Math.round(r/360):r)}t.exports={lab:{forward:g,reverse:b,interpolate:function(t,e,n){return{l:i(t.l,e.l,n),a:i(t.a,e.a,n),b:i(t.b,e.b,n),alpha:i(t.alpha,e.alpha,n)}}},hcl:{forward:function(t){var e=g(t),n=e.l,r=e.a,i=e.b,o=Math.atan2(i,r)*p;return{h:o<0?o+360:o,c:Math.sqrt(r*r+i*i),l:n,alpha:t.a}},reverse:function(t){var e=t.h*h,n=t.c;return b({l:t.l,a:Math.cos(e)*n,b:Math.sin(e)*n,alpha:t.alpha})},interpolate:function(t,e,n){return{h:x(t.h,e.h,n),c:i(t.c,e.c,n),l:i(t.l,e.l,n),alpha:i(t.alpha,e.alpha,n)}}}}},function(t,e,n){function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var i=n(9),o=n(2),a=n(39),s=n(144),u=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e&&this.replace(e)}var e,n,u;return e=t,(n=[{key:"replace",value:function(t){this._layerConfigs={},this._layers={},this.update(t,[])}},{key:"update",value:function(t,e){var n=this,r=!0,u=!1,l=void 0;try{for(var c,f=t[Symbol.iterator]();!(r=(c=f.next()).done);r=!0){var h=c.value;this._layerConfigs[h.id]=h;var p=this._layers[h.id]=i.create(h);p._featureFilter=a(p.filter)}}catch(t){u=!0,l=t}finally{try{r||null==f.return||f.return()}finally{if(u)throw l}}var y=!0,d=!1,v=void 0;try{for(var m,g=e[Symbol.iterator]();!(y=(m=g.next()).done);y=!0){var b=m.value;delete this._layerConfigs[b],delete this._layers[b]}}catch(t){d=!0,v=t}finally{try{y||null==g.return||g.return()}finally{if(d)throw v}}this.familiesBySource={};var x=s(o.values(this._layerConfigs)),w=!0,k=!1,_=void 0;try{for(var S,A=x[Symbol.iterator]();!(w=(S=A.next()).done);w=!0){var T=S.value.map(function(t){return n._layers[t.id]}),j=T[0];if("none"!==j.visibility){var O=j.source||"",z=this.familiesBySource[O];z||(z=this.familiesBySource[O]={});var P=j.sourceLayer||"_geojsonTileLayer",E=z[P];E||(E=z[P]=[]),E.push(T)}}}catch(t){k=!0,_=t}finally{try{w||null==A.return||A.return()}finally{if(k)throw _}}}}])&&r(e.prototype,n),u&&r(e,u),t}();t.exports=u},function(t){t.exports={$version:8,$root:{version:{required:!0,type:"enum",values:[8],doc:"Style specification version number. Must be 8.",example:8},name:{type:"string",doc:"A human-readable name for the style.",example:"Bright"},metadata:{type:"*",doc:"Arbitrary properties useful to track with the stylesheet, but do not influence rendering. Properties should be prefixed to avoid collisions, like \'mapbox:\'."},center:{type:"array",value:"number",doc:"Default map center in longitude and latitude. The style center will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:[-73.9749,40.7736]},zoom:{type:"number",doc:"Default zoom level. The style zoom will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:12.5},bearing:{type:"number",default:0,period:360,units:"degrees",doc:\'Default bearing, in degrees. The bearing is the compass direction that is "up"; for example, a bearing of 90° orients the map so that east is up. This value will be used only if the map has not been positioned by other means (e.g. map options or user interaction).\',example:29},pitch:{type:"number",default:0,units:"degrees",doc:"Default pitch, in degrees. Zero is perpendicular to the surface, for a look straight down at the map, while a greater value like 60 looks ahead towards the horizon. The style pitch will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:50},light:{type:"light",doc:"The global light source.",example:{anchor:"viewport",color:"white",intensity:.4}},sources:{required:!0,type:"sources",doc:"Data source specifications.",example:{"mapbox-streets":{type:"vector",url:"mapbox://mapbox.mapbox-streets-v6"}}},sprite:{type:"string",doc:"A base URL for retrieving the sprite image and metadata. The extensions `.png`, `.json` and scale factor `@2x.png` will be automatically appended. This property is required if any layer uses the `background-pattern`, `fill-pattern`, `line-pattern`, `fill-extrusion-pattern`, or `icon-image` properties.",example:"mapbox://sprites/mapbox/bright-v8"},glyphs:{type:"string",doc:"A URL template for loading signed-distance-field glyph sets in PBF format. The URL must include `{fontstack}` and `{range}` tokens. This property is required if any layer uses the `text-field` layout property.",example:"mapbox://fonts/mapbox/{fontstack}/{range}.pbf"},transition:{type:"transition",doc:"A global transition definition to use as a default across properties.",example:{duration:300,delay:0}},layers:{required:!0,type:"array",value:"layer",doc:"Layers will be drawn in the order of this array.",example:[{id:"water",source:"mapbox-streets","source-layer":"water",type:"fill",paint:{"fill-color":"#00ffff"}}]}},sources:{"*":{type:"source",doc:"Specification of a data source. For vector and raster sources, either TileJSON or a URL to a TileJSON must be provided. For image and video sources, a URL must be provided. For GeoJSON sources, a URL or inline GeoJSON must be provided."}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image","source_canvas"],source_vector:{type:{required:!0,type:"enum",values:{vector:{doc:"A vector tile source."}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://<mapid>`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.0511,180,85.0511],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source\'s bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},"*":{type:"*",doc:"Other keys to configure the data source."}},source_raster:{type:{required:!0,type:"enum",values:{raster:{doc:"A raster tile source."}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://<mapid>`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.0511,180,85.0511],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source\'s bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},tileSize:{type:"number",default:512,units:"pixels",doc:"The minimum visual size to display tiles for this layer. Only configurable for raster layers."},scheme:{type:"enum",values:{xyz:{doc:"Slippy map tilenames scheme."},tms:{doc:"OSGeo spec scheme."}},default:"xyz",doc:"Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},"*":{type:"*",doc:"Other keys to configure the data source."}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{doc:"A raster DEM source using Mapbox Terrain RGB"}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://<mapid>`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.0511,180,85.0511],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source\'s bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},tileSize:{type:"number",default:512,units:"pixels",doc:"The minimum visual size to display tiles for this layer. Only configurable for raster layers."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},"*":{type:"*",doc:"Other keys to configure the data source."}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{doc:"A GeoJSON data source."}},doc:"The data type of the GeoJSON source."},data:{type:"*",doc:"A URL to a GeoJSON file, or inline GeoJSON."},maxzoom:{type:"number",default:18,doc:"Maximum zoom level at which to create vector tiles (higher means greater detail at high zoom levels)."},buffer:{type:"number",default:128,maximum:512,minimum:0,doc:"Size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance."},tolerance:{type:"number",default:.375,doc:"Douglas-Peucker simplification tolerance (higher means simpler geometries and faster performance)."},cluster:{type:"boolean",default:!1,doc:"If the data is a collection of point features, setting this to true clusters the points by radius into groups."},clusterRadius:{type:"number",default:50,minimum:0,doc:"Radius of each cluster if clustering is enabled. A value of 512 indicates a radius equal to the width of a tile."},clusterMaxZoom:{type:"number",doc:"Max zoom on which to cluster points if clustering is enabled. Defaults to one zoom less than maxzoom (so that last zoom features are not clustered)."}},source_video:{type:{required:!0,type:"enum",values:{video:{doc:"A video data source."}},doc:"The data type of the video source."},urls:{required:!0,type:"array",value:"string",doc:"URLs to video content in order of preferred format."},coordinates:{required:!0,doc:"Corners of video specified in longitude, latitude pairs.",type:"array",length:4,value:{type:"array",length:2,value:"number",doc:"A single longitude, latitude pair."}}},source_image:{type:{required:!0,type:"enum",values:{image:{doc:"An image data source."}},doc:"The data type of the image source."},url:{required:!0,type:"string",doc:"URL that points to an image."},coordinates:{required:!0,doc:"Corners of image specified in longitude, latitude pairs.",type:"array",length:4,value:{type:"array",length:2,value:"number",doc:"A single longitude, latitude pair."}}},source_canvas:{type:{required:!0,type:"enum",values:{canvas:{doc:"A canvas data source."}},doc:"The data type of the canvas source."},coordinates:{required:!0,doc:"Corners of canvas specified in longitude, latitude pairs.",type:"array",length:4,value:{type:"array",length:2,value:"number",doc:"A single longitude, latitude pair."}},animate:{type:"boolean",default:"true",doc:"Whether the canvas source is animated. If the canvas is static, `animate` should be set to `false` to improve performance."},canvas:{type:"string",required:!0,doc:"HTML ID of the canvas from which to read pixels."}},layer:{id:{type:"string",doc:"Unique layer name.",required:!0},type:{type:"enum",values:{fill:{doc:"A filled polygon with an optional stroked border.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},line:{doc:"A stroked line.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},symbol:{doc:"An icon or a text label.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},circle:{doc:"A filled circle.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},heatmap:{doc:"A heatmap.","sdk-support":{"basic functionality":{js:"0.41.0"}}},"fill-extrusion":{doc:"An extruded (3D) polygon.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},raster:{doc:"Raster map textures such as satellite imagery.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},hillshade:{doc:"Client-side hillshading visualization based on DEM data. Currently, the implementation only supports Mapbox Terrain RGB tiles","sdk-support":{"basic functionality":{js:"0.43.0"}}},background:{doc:"The background color or pattern of the map.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}}},doc:"Rendering type of this layer.",required:!0},metadata:{type:"*",doc:"Arbitrary properties useful to track with the layer, but do not influence rendering. Properties should be prefixed to avoid collisions, like \'mapbox:\'."},source:{type:"string",doc:"Name of a source description to be used for this layer. Required for all layer types except `background`."},"source-layer":{type:"string",doc:"Layer to use from a vector tile source. Required for vector tile sources; prohibited for all other source types, including GeoJSON sources."},minzoom:{type:"number",minimum:0,maximum:24,doc:"The minimum zoom level on which the layer gets parsed and appears on."},maxzoom:{type:"number",minimum:0,maximum:24,doc:"The maximum zoom level on which the layer gets parsed and appears on."},filter:{type:"filter",doc:"A expression specifying conditions on source features. Only features that match the filter are displayed."},layout:{type:"layout",doc:"Layout properties for the layer."},paint:{type:"paint",doc:"Default paint properties for this layer."}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}}},layout_fill:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}}},layout_circle:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}}},layout_heatmap:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.41.0"}}}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}}},layout_line:{"line-cap":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{butt:{doc:"A cap with a squared-off end which is drawn to the exact endpoint of the line."},round:{doc:"A cap with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line\'s width and centered on the endpoint of the line."},square:{doc:"A cap with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line\'s width."}},default:"butt",doc:"The display of line endings.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}},"line-join":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:{bevel:{doc:"A join with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line\'s width."},round:{doc:"A join with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line\'s width and centered on the endpoint of the line."},miter:{doc:"A join with a sharp, angled corner which is drawn with the outer sides beyond the endpoint of the path until they meet."}},default:"miter",doc:"The display of lines when joining.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}}},"line-miter-limit":{type:"number",default:2,function:"interpolated","zoom-function":!0,doc:"Used to automatically convert miter joins to bevel joins for sharp angles.",requires:[{"line-join":"miter"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}},"line-round-limit":{type:"number",default:1.05,function:"interpolated","zoom-function":!0,doc:"Used to automatically convert round joins to miter joins for shallow angles.",requires:[{"line-join":"round"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}}},layout_symbol:{"symbol-placement":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{point:{doc:"The label is placed at the point where the geometry is located."},line:{doc:"The label is placed along the line of the geometry. Can only be used on `LineString` and `Polygon` geometries."}},default:"point",doc:"Label placement relative to its geometry.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}},"symbol-spacing":{type:"number",default:250,minimum:1,function:"interpolated","zoom-function":!0,units:"pixels",doc:"Distance between two symbol anchors.",requires:[{"symbol-placement":"line"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}},"symbol-avoid-edges":{type:"boolean",function:"piecewise-constant","zoom-function":!0,default:!1,doc:"If true, the symbols will not cross tile edges to avoid mutual collisions. Recommended in layers that don\'t have enough padding in the vector tile to prevent collisions, or if it is a point symbol layer placed after a line symbol layer.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}},"icon-allow-overlap":{type:"boolean",function:"piecewise-constant","zoom-function":!0,default:!1,doc:"If true, the icon will be visible even if it collides with other previously drawn symbols.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}},"icon-ignore-placement":{type:"boolean",function:"piecewise-constant","zoom-function":!0,default:!1,doc:"If true, other symbols can be visible even if they collide with the icon.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}},"icon-optional":{type:"boolean",function:"piecewise-constant","zoom-function":!0,default:!1,doc:"If true, text will display without their corresponding icons when the icon collides with other symbols and the text does not.",requires:["icon-image","text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}},"icon-rotation-alignment":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{doc:"When `symbol-placement` is set to `point`, aligns icons east-west. When `symbol-placement` is set to `line`, aligns icon x-axes with the line."},viewport:{doc:"Produces icons whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`."},auto:{doc:"When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line`, this is equivalent to `map`."}},default:"auto",doc:"In combination with `symbol-placement`, determines the rotation behavior of icons.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"},"data-driven styling":{}}},"icon-size":{type:"number",default:1,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,units:"factor of the original icon size",doc:"Scales the original size of the icon by the provided factor. The new pixel size of the image will be the original pixel size multiplied by `icon-size`. 1 is the original size; 3 triples the size of the image.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},"icon-text-fit":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{none:{doc:"The icon is displayed at its intrinsic aspect ratio."},width:{doc:"The icon is scaled in the x-dimension to fit the width of the text."},height:{doc:"The icon is scaled in the y-dimension to fit the height of the text."},both:{doc:"The icon is scaled in both x- and y-dimensions."}},default:"none",doc:"Scales the icon to fit around the associated text.",requires:["icon-image","text-field"],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"},"data-driven styling":{}}},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",function:"interpolated","zoom-function":!0,doc:"Size of the additional area added to dimensions determined by `icon-text-fit`, in clockwise order: top, right, bottom, left.",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"},"data-driven styling":{}}},"icon-image":{type:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,doc:"Name of image in sprite to use for drawing an image background. Within literal values and zoom functions, property names enclosed in curly brackets (e.g. `{token}`) are replaced with the value of the named property. Expressions and property functions do not support this syntax; for equivalent functionality in expressions, use the [`concat`](#expressions-concat) and [`get`](#expressions-get) operators.",tokens:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},"icon-rotate":{type:"number",default:0,period:360,function:"interpolated","zoom-function":!0,"property-function":!0,units:"degrees",doc:"Rotates the icon clockwise.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.21.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}}},"icon-padding":{type:"number",default:2,minimum:0,function:"interpolated","zoom-function":!0,units:"pixels",doc:"Size of the additional area around the icon bounding box used for detecting symbol collisions.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}},"icon-keep-upright":{type:"boolean",function:"piecewise-constant","zoom-function":!0,default:!1,doc:"If true, the icon may be flipped to prevent it from being rendered upside-down.",requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":"line"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,doc:"Offset distance of icon from its anchor. Positive values indicate right and down, while negative values indicate left and up. Each component is multiplied by the value of `icon-size` to obtain the final offset in pixels. When combined with `icon-rotate` the offset will be as if the rotated direction was up.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}}},"icon-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:{center:{doc:"The center of the icon is placed closest to the anchor."},left:{doc:"The left side of the icon is placed closest to the anchor."},right:{doc:"The right side of the icon is placed closest to the anchor."},top:{doc:"The top of the icon is placed closest to the anchor."},bottom:{doc:"The bottom of the icon is placed closest to the anchor."},"top-left":{doc:"The top left corner of the icon is placed closest to the anchor."},"top-right":{doc:"The top right corner of the icon is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the icon is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the icon is placed closest to the anchor."}},default:"center",doc:"Part of the icon placed closest to the anchor.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}}},"icon-pitch-alignment":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{doc:"The icon is aligned to the plane of the map."},viewport:{doc:"The icon is aligned to the plane of the viewport."},auto:{doc:"Automatically matches the value of `icon-rotation-alignment`."}},default:"auto",doc:"Orientation of icon when map is pitched.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"},"data-driven styling":{}}},"text-pitch-alignment":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{doc:"The text is aligned to the plane of the map."},viewport:{doc:"The text is aligned to the plane of the viewport."},auto:{doc:"Automatically matches the value of `text-rotation-alignment`."}},default:"auto",doc:"Orientation of text when map is pitched.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"},"data-driven styling":{}}},"text-rotation-alignment":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{doc:"When `symbol-placement` is set to `point`, aligns text east-west. When `symbol-placement` is set to `line`, aligns text x-axes with the line."},viewport:{doc:"Produces glyphs whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`."},auto:{doc:"When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line`, this is equivalent to `map`."}},default:"auto",doc:"In combination with `symbol-placement`, determines the rotation behavior of the individual glyphs forming the text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"},"data-driven styling":{}}},"text-field":{type:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:"",tokens:!0,doc:"Value to use for a text label. Within literal values and zoom functions, property names enclosed in curly brackets (e.g. `{token}`) are replaced with the value of the named property. Expressions and property functions do not support this syntax; for equivalent functionality in expressions, use the [`concat`](#expressions-concat) and [`get`](#expressions-get) operators.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}}},"text-font":{type:"array",value:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:["Open Sans Regular","Arial Unicode MS Regular"],doc:"Font stack to use for displaying text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}},"text-size":{type:"number",default:16,minimum:0,units:"pixels",function:"interpolated","zoom-function":!0,"property-function":!0,doc:"Font size.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",function:"interpolated","zoom-function":!0,"property-function":!0,doc:"The maximum line width for text wrapping.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}}},"text-line-height":{type:"number",default:1.2,units:"ems",function:"interpolated","zoom-function":!0,doc:"Text leading value for multi-line text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}},"text-letter-spacing":{type:"number",default:0,units:"ems",function:"interpolated","zoom-function":!0,"property-function":!0,doc:"Text tracking amount.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}}},"text-justify":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:{left:{doc:"The text is aligned to the left."},center:{doc:"The text is centered."},right:{doc:"The text is aligned to the right."}},default:"center",doc:"Text justification options.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}}},"text-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:{center:{doc:"The center of the text is placed closest to the anchor."},left:{doc:"The left side of the text is placed closest to the anchor."},right:{doc:"The right side of the text is placed closest to the anchor."},top:{doc:"The top of the text is placed closest to the anchor."},bottom:{doc:"The bottom of the text is placed closest to the anchor."},"top-left":{doc:"The top left corner of the text is placed closest to the anchor."},"top-right":{doc:"The top right corner of the text is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the text is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the text is placed closest to the anchor."}},default:"center",doc:"Part of the text placed closest to the anchor.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}}},"text-max-angle":{type:"number",default:45,units:"degrees",function:"interpolated","zoom-function":!0,doc:"Maximum angle change between adjacent characters.",requires:["text-field",{"symbol-placement":"line"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}},"text-rotate":{type:"number",default:0,period:360,units:"degrees",function:"interpolated","zoom-function":!0,"property-function":!0,doc:"Rotates the text clockwise.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",function:"interpolated","zoom-function":!0,doc:"Size of the additional area around the text bounding box used for detecting symbol collisions.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}},"text-keep-upright":{type:"boolean",function:"piecewise-constant","zoom-function":!0,default:!0,doc:"If true, the text may be flipped vertically to prevent it from being rendered upside-down.",requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":"line"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}},"text-transform":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:{none:{doc:"The text is not altered."},uppercase:{doc:"Forces all letters to be displayed in uppercase."},lowercase:{doc:"Forces all letters to be displayed in lowercase."}},default:"none",doc:"Specifies how to capitalize text, similar to the CSS `text-transform` property.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}}},"text-offset":{type:"array",doc:"Offset distance of text from its anchor. Positive values indicate right and down, while negative values indicate left and up.",value:"number",units:"ems",function:"interpolated","zoom-function":!0,"property-function":!0,length:2,default:[0,0],requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},"text-allow-overlap":{type:"boolean",function:"piecewise-constant","zoom-function":!0,default:!1,doc:"If true, the text will be visible even if it collides with other previously drawn symbols.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}},"text-ignore-placement":{type:"boolean",function:"piecewise-constant","zoom-function":!0,default:!1,doc:"If true, other symbols can be visible even if they collide with the text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}},"text-optional":{type:"boolean",function:"piecewise-constant","zoom-function":!0,default:!1,doc:"If true, icons will display without their corresponding text when the text collides with other symbols and the icon does not.",requires:["text-field","icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}}},layout_raster:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}}},layout_hillshade:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.43.0"},"data-driven styling":{}}}},filter:{type:"array",value:"*",doc:"A filter selects specific features from a layer."},filter_operator:{type:"enum",values:{"==":{doc:\'`["==", key, value]` equality: `feature[key] = value`\'},"!=":{doc:\'`["!=", key, value]` inequality: `feature[key] ≠ value`\'},">":{doc:\'`[">", key, value]` greater than: `feature[key] > value`\'},">=":{doc:\'`[">=", key, value]` greater than or equal: `feature[key] ≥ value`\'},"<":{doc:\'`["<", key, value]` less than: `feature[key] < value`\'},"<=":{doc:\'`["<=", key, value]` less than or equal: `feature[key] ≤ value`\'},in:{doc:\'`["in", key, v0, ..., vn]` set inclusion: `feature[key] ∈ {v0, ..., vn}`\'},"!in":{doc:\'`["!in", key, v0, ..., vn]` set exclusion: `feature[key] ∉ {v0, ..., vn}`\'},all:{doc:\'`["all", f0, ..., fn]` logical `AND`: `f0 ∧ ... ∧ fn`\'},any:{doc:\'`["any", f0, ..., fn]` logical `OR`: `f0 ∨ ... ∨ fn`\'},none:{doc:\'`["none", f0, ..., fn]` logical `NOR`: `¬f0 ∧ ... ∧ ¬fn`\'},has:{doc:\'`["has", key]` `feature[key]` exists\'},"!has":{doc:\'`["!has", key]` `feature[key]` does not exist\'}},doc:"The filter operator."},geometry_type:{type:"enum",values:{Point:{doc:"Filter to point geometries."},LineString:{doc:"Filter to line geometries."},Polygon:{doc:"Filter to polygon geometries."}},doc:"The geometry type for the filter to select."},function:{expression:{type:"expression",doc:"An expression."},stops:{type:"array",doc:"An array of stops.",value:"function_stop"},base:{type:"number",default:1,minimum:0,doc:"The exponential base of the interpolation curve. It controls the rate at which the result increases. Higher values make the result increase more towards the high end of the range. With `1` the stops are interpolated linearly."},property:{type:"string",doc:"The name of a feature property to use as the function input.",default:"$zoom"},type:{type:"enum",values:{identity:{doc:"Return the input value as the output value."},exponential:{doc:"Generate an output by interpolating between stops just less than and just greater than the function input."},interval:{doc:"Return the output value of the stop just less than the function input."},categorical:{doc:"Return the output value of the stop equal to the function input."}},doc:"The interpolation strategy to use in function evaluation.",default:"exponential"},colorSpace:{type:"enum",values:{rgb:{doc:"Use the RGB color space to interpolate color values"},lab:{doc:"Use the LAB color space to interpolate color values."},hcl:{doc:"Use the HCL color space to interpolate color values, interpolating the Hue, Chroma, and Luminance channels individually."}},doc:"The color space in which colors interpolated. Interpolating colors in perceptual color spaces like LAB and HCL tend to produce color ramps that look more consistent and produce colors that can be differentiated more easily than those interpolated in RGB space.",default:"rgb"},default:{type:"*",required:!1,doc:"A value to serve as a fallback function result when a value isn\'t otherwise available. It is used in the following circumstances:\\n* In categorical functions, when the feature value does not match any of the stop domain values.\\n* In property and zoom-and-property functions, when a feature does not contain a value for the specified property.\\n* In identity functions, when the feature value is not valid for the style property (for example, if the function is being used for a `circle-color` property but the feature property value is not a string or not a valid color).\\n* In interval or exponential property and zoom-and-property functions, when the feature value is not numeric.\\nIf no default is provided, the style property\'s default is used in these circumstances."}},function_stop:{type:"array",minimum:0,maximum:22,value:["number","color"],length:2,doc:"Zoom level and value pair."},expression:{type:"array",value:"*",minimum:1,doc:"An expression defines a function that can be used for data-driven style properties or feature filters."},expression_name:{doc:"",type:"enum",values:{let:{doc:\'Binds expressions to named variables, which can then be referenced in the result expression using ["var", "variable_name"].\',group:"Variable binding"},var:{doc:\'References variable bound using "let".\',group:"Variable binding"},literal:{doc:"Provides a literal array or object value.",group:"Types"},array:{doc:"Asserts that the input is an array (optionally with a specific item type and length). If, when the input expression is evaluated, it is not of the asserted type, then this assertion will cause the whole expression to be aborted.",group:"Types"},at:{doc:"Retrieves an item from an array.",group:"Lookup"},case:{doc:"Selects the first output whose corresponding test condition evaluates to true.",group:"Decision"},match:{doc:\'Selects the output whose label value matches the input value, or the fallback value if no match is found. The `input` can be any string or number expression (e.g. `["get", "building_type"]`). Each label can either be a single literal value or an array of values.\',group:"Decision"},coalesce:{doc:"Evaluates each expression in turn until the first non-null value is obtained, and returns that value.",group:"Decision"},step:{doc:\'Produces discrete, stepped results by evaluating a piecewise-constant function defined by pairs of input and output values ("stops"). The `input` may be any numeric expression (e.g., `["get", "population"]`). Stop inputs must be numeric literals in strictly ascending order. Returns the output value of the stop just less than the input, or the first input if the input is less than the first stop.\',group:"Ramps, scales, curves"},interpolate:{doc:\'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). The `input` may be any numeric expression (e.g., `["get", "population"]`). Stop inputs must be numeric literals in strictly ascending order. The output type must be `number`, `array<number>`, or `color`.\\n\\nInterpolation types:\\n- `["linear"]`: interpolates linearly between the pair of stops just less than and just greater than the input.\\n- `["exponential", base]`: interpolates exponentially between the stops just less than and just greater than the input. `base` controls the rate at which the output increases: higher values make the output increase more towards the high end of the range. With values close to 1 the output increases linearly.\\n- `["cubic-bezier", x1, y1, x2, y2]`: interpolates using the cubic bezier curve defined by the given control points.\',group:"Ramps, scales, curves"},ln2:{doc:"Returns mathematical constant ln(2).",group:"Math"},pi:{doc:"Returns the mathematical constant pi.",group:"Math"},e:{doc:"Returns the mathematical constant e.",group:"Math"},typeof:{doc:"Returns a string describing the type of the given value.",group:"Types"},string:{doc:"Asserts that the input value is a string. If multiple values are provided, each one is evaluated in order until a string value is obtained. If none of the inputs are strings, the expression is an error.",group:"Types"},number:{doc:"Asserts that the input value is a number. If multiple values are provided, each one is evaluated in order until a number value is obtained. If none of the inputs are numbers, the expression is an error.",group:"Types"},boolean:{doc:"Asserts that the input value is a boolean. If multiple values are provided, each one is evaluated in order until a boolean value is obtained. If none of the inputs are booleans, the expression is an error.",group:"Types"},object:{doc:"Asserts that the input value is an object. If it is not, the expression is an error.",group:"Types"},"to-string":{doc:\'Converts the input value to a string. If the input is `null`, the result is `"null"`. If the input is a boolean, the result is `"true"` or `"false"`. If the input is a number, it is converted to a string as specified by the ["NumberToString" algorithm](https://tc39.github.io/ecma262/#sec-tostring-applied-to-the-number-type) of the ECMAScript Language Specification. If the input is a color, it is converted to a string of the form `"rgba(r,g,b,a)"`, where `r`, `g`, and `b` are numerals ranging from 0 to 255, and `a` ranges from 0 to 1. Otherwise, the input is converted to a string in the format specified by the [`JSON.stringify`](https://tc39.github.io/ecma262/#sec-json.stringify) function of the ECMAScript Language Specification.\',group:"Types"},"to-number":{doc:\'Converts the input value to a number, if possible. If the input is `null` or `false`, the result is 0. If the input is `true`, the result is 1. If the input is a string, it is converted to a number as specified by the ["ToNumber Applied to the String Type" algorithm](https://tc39.github.io/ecma262/#sec-tonumber-applied-to-the-string-type) of the ECMAScript Language Specification. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.\',group:"Types"},"to-boolean":{doc:"Converts the input value to a boolean. The result is `false` when then input is an empty string, 0, `false`, `null`, or `NaN`; otherwise it is `true`.",group:"Types"},"to-rgba":{doc:"Returns a four-element array containing the input color\'s red, green, blue, and alpha components, in that order.",group:"Color"},"to-color":{doc:"Converts the input value to a color. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.",group:"Types"},rgb:{doc:"Creates a color value from red, green, and blue components, which must range between 0 and 255, and an alpha component of 1. If any component is out of range, the expression is an error.",group:"Color"},rgba:{doc:"Creates a color value from red, green, blue components, which must range between 0 and 255, and an alpha component which must range between 0 and 1. If any component is out of range, the expression is an error.",group:"Color"},get:{doc:"Retrieves a property value from the current feature\'s properties, or from another object if a second argument is provided. Returns null if the requested property is missing.",group:"Lookup"},has:{doc:"Tests for the presence of an property value in the current feature\'s properties, or from another object if a second argument is provided.",group:"Lookup"},length:{doc:"Gets the length of an array or string.",group:"Lookup"},properties:{doc:\'Gets the feature properties object. Note that in some cases, it may be more efficient to use ["get", "property_name"] directly.\',group:"Feature data"},"geometry-type":{doc:"Gets the feature\'s geometry type: Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon.",group:"Feature data"},id:{doc:"Gets the feature\'s id, if it has one.",group:"Feature data"},zoom:{doc:\'Gets the current zoom level. Note that in style layout and paint properties, ["zoom"] may only appear as the input to a top-level "step" or "interpolate" expression.\',group:"Zoom"},"heatmap-density":{doc:"Gets the kernel density estimation of a pixel in a heatmap layer, which is a relative measure of how many data points are crowded around a particular pixel. Can only be used in the `heatmap-color` property.",group:"Heatmap"},"+":{doc:"Returns the sum of the inputs.",group:"Math"},"*":{doc:"Returns the product of the inputs.",group:"Math"},"-":{doc:"For two inputs, returns the result of subtracting the second input from the first. For a single input, returns the result of subtracting it from 0.",group:"Math"},"/":{doc:"Returns the result of floating point division of the first input by the second.",group:"Math"},"%":{doc:"Returns the remainder after integer division of the first input by the second.",group:"Math"},"^":{doc:"Returns the result of raising the first input to the power specified by the second.",group:"Math"},sqrt:{doc:"Returns the square root of the input.",group:"Math"},log10:{doc:"Returns the base-ten logarithm of the input.",group:"Math"},ln:{doc:"Returns the natural logarithm of the input.",group:"Math"},log2:{doc:"Returns the base-two logarithm of the input.",group:"Math"},sin:{doc:"Returns the sine of the input.",group:"Math"},cos:{doc:"Returns the cosine of the input.",group:"Math"},tan:{doc:"Returns the tangent of the input.",group:"Math"},asin:{doc:"Returns the arcsine of the input.",group:"Math"},acos:{doc:"Returns the arccosine of the input.",group:"Math"},atan:{doc:"Returns the arctangent of the input.",group:"Math"},min:{doc:"Returns the minimum value of the inputs.",group:"Math"},max:{doc:"Returns the maximum value of the inputs.",group:"Math"},"==":{doc:"Returns `true` if the input values are equal, `false` otherwise. The inputs must be numbers, strings, or booleans, and both of the same type.",group:"Decision"},"!=":{doc:"Returns `true` if the input values are not equal, `false` otherwise. The inputs must be numbers, strings, or booleans, and both of the same type.",group:"Decision"},">":{doc:"Returns `true` if the first input is strictly greater than the second, `false` otherwise. The inputs must be numbers or strings, and both of the same type.",group:"Decision"},"<":{doc:"Returns `true` if the first input is strictly less than the second, `false` otherwise. The inputs must be numbers or strings, and both of the same type.",group:"Decision"},">=":{doc:"Returns `true` if the first input is greater than or equal to the second, `false` otherwise. The inputs must be numbers or strings, and both of the same type.",group:"Decision"},"<=":{doc:"Returns `true` if the first input is less than or equal to the second, `false` otherwise. The inputs must be numbers or strings, and both of the same type.",group:"Decision"},all:{doc:"Returns `true` if all the inputs are `true`, `false` otherwise. The inputs are evaluated in order, and evaluation is short-circuiting: once an input expression evaluates to `false`, the result is `false` and no further input expressions are evaluated.",group:"Decision"},any:{doc:"Returns `true` if any of the inputs are `true`, `false` otherwise. The inputs are evaluated in order, and evaluation is short-circuiting: once an input expression evaluates to `true`, the result is `true` and no further input expressions are evaluated.",group:"Decision"},"!":{doc:"Logical negation. Returns `true` if the input is `false`, and `false` if the input is `true`.",group:"Decision"},upcase:{doc:"Returns the input string converted to uppercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database.",group:"String"},downcase:{doc:"Returns the input string converted to lowercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database.",group:"String"},concat:{doc:"Returns a string consisting of the concatenation of the inputs.",group:"String"}}},light:{anchor:{type:"enum",default:"viewport",values:{map:{doc:"The position of the light source is aligned to the rotation of the map."},viewport:{doc:"The position of the light source is aligned to the rotation of the viewport."}},transition:!1,"zoom-function":!0,"property-function":!1,function:"piecewise-constant",doc:"Whether extruded geometries are lit relative to the map or viewport.",example:"map","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},position:{type:"array",default:[1.15,210,30],length:3,value:"number",transition:!0,function:"interpolated","zoom-function":!0,"property-function":!1,doc:"Position of the light source relative to lit (extruded) geometries, in [r radial coordinate, a azimuthal angle, p polar angle] where r indicates the distance from the center of the base of an object to its light, a indicates the position of the light relative to 0° (0° when `light.anchor` is set to `viewport` corresponds to the top of the viewport, or 0° when `light.anchor` is set to `map` corresponds to due north, and degrees proceed clockwise), and p indicates the height of the light (from 0°, directly above, to 180°, directly below).",example:[1.5,90,80],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},color:{type:"color",default:"#ffffff",function:"interpolated","zoom-function":!0,"property-function":!1,transition:!0,doc:"Color tint for lighting extruded geometries.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},intensity:{type:"number",default:.5,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!1,transition:!0,doc:"Intensity of lighting (on a scale from 0 to 1). Higher numbers will present as more extreme contrast.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",function:"piecewise-constant","zoom-function":!0,default:!0,doc:"Whether or not the fill should be antialiased.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}},"fill-opacity":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!0,default:1,minimum:0,maximum:1,doc:"The opacity of the entire fill layer. In contrast to the `fill-color`, this value will also affect the 1px stroke around the fill, if the stroke is used.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.21.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}}},"fill-color":{type:"color",default:"#000000",doc:"The color of the filled part of this layer. This color can be specified as `rgba` with an alpha component and the color\'s opacity will not affect the opacity of the 1px stroke, if it is used.",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"fill-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.19.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}}},"fill-outline-color":{type:"color",doc:"The outline color of the fill. Matches the value of `fill-color` if unspecified.",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.19.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}}},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,transition:!0,units:"pixels",doc:"The geometry\'s offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}},"fill-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{doc:"The fill is translated relative to the map."},viewport:{doc:"The fill is translated relative to the viewport."}},doc:"Controls the frame of reference for `fill-translate`.",default:"map",requires:["fill-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}},"fill-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,transition:!0,doc:"Name of image in sprite to use for drawing image fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512).","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!1,default:1,minimum:0,maximum:1,doc:"The opacity of the entire fill extrusion layer. This is rendered on a per-layer, not per-feature, basis, and data-driven styling is not available.",transition:!0,"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},"fill-extrusion-color":{type:"color",default:"#000000",doc:"The base color of the extruded fill. The extrusion\'s surfaces will be shaded differently based on this color in combination with the root `light` settings. If this color is specified as `rgba` with an alpha component, the alpha component will be ignored; use `fill-extrusion-opacity` to set layer opacity.",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"fill-extrusion-pattern"}],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,transition:!0,units:"pixels",doc:"The geometry\'s offset. Values are [x, y] where negatives indicate left and up (on the flat plane), respectively.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{}}},"fill-extrusion-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{doc:"The fill extrusion is translated relative to the map."},viewport:{doc:"The fill extrusion is translated relative to the viewport."}},doc:"Controls the frame of reference for `fill-extrusion-translate`.",default:"map",requires:["fill-extrusion-translate"],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{}}},"fill-extrusion-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,transition:!0,doc:"Name of image in sprite to use for drawing images on extruded fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512).","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{}}},"fill-extrusion-height":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!0,default:0,minimum:0,units:"meters",doc:"The height with which to extrude this layer.",transition:!0,"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},"fill-extrusion-base":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!0,default:0,minimum:0,units:"meters",doc:"The height with which to extrude the base of this layer. Must be less than or equal to `fill-extrusion-height`.",transition:!0,requires:["fill-extrusion-height"],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}}},paint_line:{"line-opacity":{type:"number",doc:"The opacity at which the line will be drawn.",function:"interpolated","zoom-function":!0,"property-function":!0,default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}}},"line-color":{type:"color",doc:"The color with which the line will be drawn.",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"line-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.23.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}}},"line-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,transition:!0,units:"pixels",doc:"The geometry\'s offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}},"line-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{doc:"The line is translated relative to the map."},viewport:{doc:"The line is translated relative to the viewport."}},doc:"Controls the frame of reference for `line-translate`.",default:"map",requires:["line-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}},"line-width":{type:"number",default:1,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",doc:"Stroke thickness.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.39.0"}}},"line-gap-width":{type:"number",default:0,minimum:0,doc:"Draws a line casing outside of a line\'s actual path. Value indicates the width of the inner gap.",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}}},"line-offset":{type:"number",default:0,doc:"The line\'s offset. For linear features, a positive value offsets the line to the right, relative to the direction of the line, and a negative value to the left. For polygon features, a positive value results in an inset, and a negative value results in an outset.",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels","sdk-support":{"basic functionality":{js:"0.12.1",android:"3.0.0",ios:"3.1.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}}},"line-blur":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",doc:"Blur applied to the line, in pixels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}}},"line-dasharray":{type:"array",value:"number",function:"piecewise-constant","zoom-function":!0,doc:"Specifies the lengths of the alternating dashes and gaps that form the dash pattern. The lengths are later scaled by the line width. To convert a dash length to pixels, multiply the length by the current line width.",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}},"line-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,transition:!0,doc:"Name of image in sprite to use for drawing image lines. For seamless patterns, image width must be a factor of two (2, 4, 8, ..., 512).","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",doc:"Circle radius.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.18.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}}},"circle-color":{type:"color",default:"#000000",doc:"The fill color of the circle.",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.18.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}}},"circle-blur":{type:"number",default:0,doc:"Amount to blur the circle. 1 blurs the circle such that only the centerpoint is full opacity.",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.20.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}}},"circle-opacity":{type:"number",doc:"The opacity at which the circle will be drawn.",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.20.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}}},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,transition:!0,units:"pixels",doc:"The geometry\'s offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}},"circle-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{doc:"The circle is translated relative to the map."},viewport:{doc:"The circle is translated relative to the viewport."}},doc:"Controls the frame of reference for `circle-translate`.",default:"map",requires:["circle-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}},"circle-pitch-scale":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{doc:"Circles are scaled according to their apparent distance to the camera."},viewport:{doc:"Circles are not scaled."}},default:"map",doc:"Controls the scaling behavior of the circle when the map is pitched.","sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"},"data-driven styling":{}}},"circle-pitch-alignment":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{doc:"The circle is aligned to the plane of the map."},viewport:{doc:"The circle is aligned to the plane of the viewport."}},default:"viewport",doc:"Orientation of circle when map is pitched.","sdk-support":{"basic functionality":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"},"data-driven styling":{}}},"circle-stroke-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",doc:"The width of the circle\'s stroke. Strokes are placed outside of the `circle-radius`.","sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}}},"circle-stroke-color":{type:"color",default:"#000000",doc:"The stroke color of the circle.",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,"sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}}},"circle-stroke-opacity":{type:"number",doc:"The opacity of the circle\'s stroke.",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,"sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}}}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",doc:"Radius of influence of one heatmap point in pixels. Increasing the value makes the heatmap smoother, but less detailed.","sdk-support":{"basic functionality":{js:"0.41.0"},"data-driven styling":{}}},"heatmap-weight":{type:"number",default:1,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!1,doc:"A measure of how much an individual point contributes to the heatmap. A value of 10 would be equivalent to having 10 points of weight 1 in the same spot. Especially useful when combined with clustering.","sdk-support":{"basic functionality":{js:"0.41.0"},"data-driven styling":{js:"0.41.0"}}},"heatmap-intensity":{type:"number",default:1,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!1,transition:!0,doc:"Similar to `heatmap-weight` but controls the intensity of the heatmap globally. Primarily used for adjusting the heatmap based on zoom level.","sdk-support":{"basic functionality":{js:"0.41.0"},"data-driven styling":{}}},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],doc:\'Defines the color of each pixel based on its density value in a heatmap. Should be an expression that uses `["heatmap-density"]` as input.\',function:"interpolated","zoom-function":!1,"property-function":!1,transition:!1,"sdk-support":{"basic functionality":{js:"0.41.0"},"data-driven styling":{}}},"heatmap-opacity":{type:"number",doc:"The global opacity at which the heatmap layer will be drawn.",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!1,transition:!0,"sdk-support":{"basic functionality":{js:"0.41.0"},"data-driven styling":{}}}},paint_symbol:{"icon-opacity":{doc:"The opacity at which the icon will be drawn.",type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}}},"icon-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,doc:"The color of the icon. This can only be used with sdf icons.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}}},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,doc:"The color of the icon\'s halo. Icon halos can only be used with SDF icons.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}}},"icon-halo-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",doc:"Distance of halo to the icon outline.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}}},"icon-halo-blur":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",doc:"Fade out the halo towards the outside.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}}},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,transition:!0,units:"pixels",doc:"Distance that the icon\'s anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}},"icon-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{doc:"Icons are translated relative to the map."},viewport:{doc:"Icons are translated relative to the viewport."}},doc:"Controls the frame of reference for `icon-translate`.",default:"map",requires:["icon-image","icon-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}},"text-opacity":{type:"number",doc:"The opacity at which the text will be drawn.",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}}},"text-color":{type:"color",doc:"The color with which the text will be drawn.",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}}},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,doc:"The color of the text\'s halo, which helps it stand out from backgrounds.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}}},"text-halo-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",doc:"Distance of halo to the font outline. Max text halo width is 1/4 of the font-size.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}}},"text-halo-blur":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",doc:"The halo\'s fadeout distance towards the outside.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}}},"text-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,transition:!0,units:"pixels",doc:"Distance that the text\'s anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}},"text-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{doc:"The text is translated relative to the map."},viewport:{doc:"The text is translated relative to the viewport."}},doc:"Controls the frame of reference for `text-translate`.",default:"map",requires:["text-field","text-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}}},paint_raster:{"raster-opacity":{type:"number",doc:"The opacity at which the image will be drawn.",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}},"raster-hue-rotate":{type:"number",default:0,period:360,function:"interpolated","zoom-function":!0,transition:!0,units:"degrees",doc:"Rotates hues around the color wheel.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}},"raster-brightness-min":{type:"number",function:"interpolated","zoom-function":!0,doc:"Increase or reduce the brightness of the image. The value is the minimum brightness.",default:0,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}},"raster-brightness-max":{type:"number",function:"interpolated","zoom-function":!0,doc:"Increase or reduce the brightness of the image. The value is the maximum brightness.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}},"raster-saturation":{type:"number",doc:"Increase or reduce the saturation of the image.",default:0,minimum:-1,maximum:1,function:"interpolated","zoom-function":!0,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}},"raster-contrast":{type:"number",doc:"Increase or reduce the contrast of the image.",default:0,minimum:-1,maximum:1,function:"interpolated","zoom-function":!0,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}},"raster-fade-duration":{type:"number",default:300,minimum:0,function:"interpolated","zoom-function":!0,transition:!1,units:"milliseconds",doc:"Fade duration when a new tile is added.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}}}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,doc:"The direction of the light source used to generate the hillshading with 0 as the top of the viewport if `hillshade-illumination-anchor` is set to `viewport` and due north if `hillshade-illumination-anchor` is set to `map`.",function:"interpolated","zoom-function":!0,transition:!1},"hillshade-illumination-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,values:{map:{doc:"The hillshade illumination is relative to the north direction."},viewport:{doc:"The hillshade illumination is relative to the top of the viewport."}},default:"viewport",doc:"Direction of light source when map is rotated."},"hillshade-exaggeration":{type:"number",doc:"Intensity of the hillshade",default:.5,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,transition:!0},"hillshade-shadow-color":{type:"color",default:"#000000",doc:"The shading color of areas that face away from the light source.",function:"interpolated","zoom-function":!0,transition:!0},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",doc:"The shading color of areas that faces towards the light source.",function:"interpolated","zoom-function":!0,transition:!0},"hillshade-accent-color":{type:"color",default:"#000000",doc:"The shading color used to accentuate rugged terrain like sharp cliffs and gorges.",function:"interpolated","zoom-function":!0,transition:!0}},paint_background:{"background-color":{type:"color",default:"#000000",doc:"The color with which the background will be drawn.",function:"interpolated","zoom-function":!0,transition:!0,requires:[{"!":"background-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},"background-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,transition:!0,doc:"Name of image in sprite to use for drawing an image background. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512).","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity at which the background will be drawn.",function:"interpolated","zoom-function":!0,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds",doc:"Time allotted for transitions to complete."},delay:{type:"number",default:0,minimum:0,units:"milliseconds",doc:"Length of time before a transition begins."}}}},function(t,e,n){t.exports=n(104),t.exports.emitErrors=function(t,e){if(e&&e.length){var n=!0,r=!1,i=void 0;try{for(var o,a=e[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value.message;t.fire("error",{error:new Error(s)})}}catch(t){r=!0,i=t}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}return!0}return!1}},function(t,e,n){var r=n(64),i=n(16),o=n(8),a=n(107);function s(t,e){e=e||o;var n=[];return n=n.concat(i({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,objectElementValidators:{glyphs:a,"*":function(){return[]}}})),t.constants&&(n=n.concat(r({key:"constants",value:t.constants,style:t,styleSpec:e}))),u(n)}function u(t){return[].concat(t).sort(function(t,e){return t.line-e.line})}function l(t){return function(){return u(t.apply(this,arguments))}}s.source=l(n(73)),s.light=l(n(74)),s.layer=l(n(69)),s.filter=l(n(38)),s.paintProperty=l(n(70)),s.layoutProperty=l(n(72)),t.exports=s},function(t,e,n){var r=n(7),i=n(5);t.exports=function(t){var e=t.value,n=t.key,o=r(e);return"boolean"!==o?[new i(n,e,"boolean expected, ".concat(o," found"))]:[]}},function(t,e,n){var r=n(5),i=n(7),o=n(49).parseCSSColor;t.exports=function(t){var e=t.key,n=t.value,a=i(n);return"string"!==a?[new r(e,n,"color expected, ".concat(a," found"))]:null===o(n)?[new r(e,n,\'color expected, "\'.concat(n,\'" found\'))]:[]}},function(t,e,n){var r=n(5),i=n(75);t.exports=function(t){var e=t.value,n=t.key,o=i(t);return o.length?o:(-1===e.indexOf("{fontstack}")&&o.push(new r(n,e,\'"glyphs" url must include a "{fontstack}" token\')),-1===e.indexOf("{range}")&&o.push(new r(n,e,\'"glyphs" url must include a "{range}" token\')),o)}},function(t,e,n){function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function o(t,e){return!e||"object"!==r(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called");return t}(t):e}function a(t){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function s(t,e){return(s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var u=n(9),l=n(77),c=n(28).multiPolygonIntersectsBufferedMultiPoint,f=n(30),h=f.getMaximumPaintValue,p=f.translateDistance,y=f.translate,d=n(111),v=n(1),m=(v.Transitionable,v.Transitioning,v.PossiblyEvaluated,function(t){function e(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),o(this,a(e).call(this,t,d))}var n,r,f;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&s(t,e)}(e,u),n=e,(r=[{key:"createBucket",value:function(t){return new l(t)}},{key:"queryRadius",value:function(t){var e=t;return h("circle-radius",this,e)+h("circle-stroke-width",this,e)+p(this.paint.get("circle-translate"))}},{key:"queryIntersectsFeature",value:function(t,e,n,r,i,o){var a=y(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),i,o),s=this.paint.get("circle-radius").evaluate(e)*o,u=this.paint.get("circle-stroke-width").evaluate(e)*o;return c(a,n,s+u)}}])&&i(n.prototype,r),f&&i(n,f),e}());t.exports=m},function(t,e,n){var r=n(17).createLayout;t.exports=r([{name:"a_pos",components:2,type:"Int16"}],4)},function(t,e,n){var r=n(2);e.packUint8ToFloat=function(t,e){return 256*(t=r.clamp(Math.floor(t),0,255))+(e=r.clamp(Math.floor(e),0,255))}},function(t,e,n){var r=n(8),i=n(1),o=i.Properties,a=i.DataConstantProperty,s=i.DataDrivenProperty,u=(i.CrossFadedProperty,i.HeatmapColorProperty,new o({"circle-radius":new s(r.paint_circle["circle-radius"]),"circle-color":new s(r.paint_circle["circle-color"]),"circle-blur":new s(r.paint_circle["circle-blur"]),"circle-opacity":new s(r.paint_circle["circle-opacity"]),"circle-translate":new a(r.paint_circle["circle-translate"]),"circle-translate-anchor":new a(r.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new a(r.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new a(r.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new s(r.paint_circle["circle-stroke-width"]),"circle-stroke-color":new s(r.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new s(r.paint_circle["circle-stroke-opacity"])}));t.exports={paint:u}},function(t,e,n){function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){return!e||"object"!==r(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called");return t}(t):e}function o(t,e,n){return(o="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=a(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(n):i.value}})(t,e,n||t)}function a(t){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function s(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function u(t,e,n){return e&&s(t.prototype,e),n&&s(t,n),t}function l(t,e){return(l=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var c=n(9),f=n(113),h=n(29).RGBAImage,p=n(114),y=n(1),d=(y.Transitionable,y.Transitioning,y.PossiblyEvaluated,function(t){function e(t){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=i(this,a(e).call(this,t,p)))._updateColorRamp(),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&l(t,e)}(e,c),u(e,[{key:"createBucket",value:function(t){return new f(t)}}]),u(e,[{key:"setPaintProperty",value:function(t,n,r){o(a(e.prototype),"setPaintProperty",this).call(this,t,n,r),"heatmap-color"===t&&this._updateColorRamp()}},{key:"_updateColorRamp",value:function(){for(var t=this._transitionablePaint._values["heatmap-color"].value.expression,e=new Uint8Array(1024),n=e.length,r=4;r<n;r+=4){var i=t.evaluate({heatmapDensity:r/n});e[r+0]=Math.floor(255*i.r/i.a),e[r+1]=Math.floor(255*i.g/i.a),e[r+2]=Math.floor(255*i.b/i.a),e[r+3]=Math.floor(255*i.a)}this.colorRamp=new h({width:256,height:1},e),this.colorRampTexture=null}},{key:"resize",value:function(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)}},{key:"queryRadius",value:function(){return 0}},{key:"queryIntersectsFeature",value:function(){return!1}},{key:"hasOffscreenPass",value:function(){return 0!==this.paint.get("heatmap-opacity")&&"none"!==this.visibility}}]),e}());t.exports=d},function(t,e,n){function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){return!e||"object"!==r(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called");return t}(t):e}function o(t){return(o=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function a(t,e){return(a=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var s=n(77),u=n(3).register,l=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),i(this,o(e).apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&a(t,e)}(e,s),e}();u("HeatmapBucket",l,{omit:["layers"]}),t.exports=l},function(t,e,n){var r=n(8),i=n(1),o=i.Properties,a=i.DataConstantProperty,s=i.DataDrivenProperty,u=(i.CrossFadedProperty,i.HeatmapColorProperty),l=new o({"heatmap-radius":new s(r.paint_heatmap["heatmap-radius"]),"heatmap-weight":new s(r.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new a(r.paint_heatmap["heatmap-intensity"]),"heatmap-color":new u(r.paint_heatmap["heatmap-color"]),"heatmap-opacity":new a(r.paint_heatmap["heatmap-opacity"])});t.exports={paint:l}},function(t,e,n){function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function o(t,e){return!e||"object"!==r(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called");return t}(t):e}function a(t){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function s(t,e){return(s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var u=n(9),l=n(116),c=n(1),f=(c.Transitionable,c.Transitioning,c.PossiblyEvaluated,function(t){function e(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),o(this,a(e).call(this,t,l))}var n,r,c;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&s(t,e)}(e,u),n=e,(r=[{key:"hasOffscreenPass",value:function(){return 0!==this.paint.get("hillshade-exaggeration")&&"none"!==this.visibility}}])&&i(n.prototype,r),c&&i(n,c),e}());t.exports=f},function(t,e,n){var r=n(8),i=n(1),o=i.Properties,a=i.DataConstantProperty,s=(i.DataDrivenProperty,i.CrossFadedProperty,i.HeatmapColorProperty,new o({"hillshade-illumination-direction":new a(r.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new a(r.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new a(r.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new a(r.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new a(r.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new a(r.paint_hillshade["hillshade-accent-color"])}));t.exports={paint:s}},function(t,e,n){function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function o(t,e){return!e||"object"!==r(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called");return t}(t):e}function a(t){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function s(t,e){return(s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var u=n(9),l=n(118),c=n(28).multiPolygonIntersectsMultiPolygon,f=n(30),h=f.translateDistance,p=f.translate,y=n(121),d=n(1),v=(d.Transitionable,d.Transitioning,d.PossiblyEvaluated,function(t){function e(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),o(this,a(e).call(this,t,y))}var n,r,f;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&s(t,e)}(e,u),n=e,(r=[{key:"recalculate",value:function(t){this.paint=this._transitioningPaint.possiblyEvaluate(t),void 0===this._transitionablePaint.getValue("fill-outline-color")&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}},{key:"createBucket",value:function(t){return new l(t)}},{key:"queryRadius",value:function(){return h(this.paint.get("fill-translate"))}},{key:"queryIntersectsFeature",value:function(t,e,n,r,i,o){var a=p(t,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),i,o);return c(a,n)}}])&&i(n.prototype,r),f&&i(n,f),e}());t.exports=v},function(t,e,n){function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var i=n(10).FillLayoutArray,o=n(119).members,a=n(25).SegmentVector,s=n(26).ProgramConfigurationSet,u=n(27),l=u.LineIndexArray,c=u.TriangleIndexArray,f=n(20),h=n(78),p=n(40),y=n(0),d=n(3).register,v=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(function(t){return t.id}),this.index=e.index,this.layoutVertexArray=new i,this.indexArray=new c,this.indexArray2=new l,this.programConfigurations=new s(o,e.layers,e.zoom),this.segments=new a,this.segments2=new a}var e,n,u;return e=t,(n=[{key:"populate",value:function(t,e){var n=!0,r=!1,i=void 0;try{for(var o,a=t[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value,u=s.feature,l=s.index,c=s.sourceLayerIndex;if(this.layers[0]._featureFilter({zoom:this.zoom},u)){var h=f(u);this.addFeature(u,h),e.featureIndex.insert(u,h,l,c,this.index)}}}catch(t){r=!0,i=t}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}}},{key:"isEmpty",value:function(){return 0===this.layoutVertexArray.length}},{key:"upload",value:function(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,o),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.indexBuffer2=t.createIndexBuffer(this.indexArray2),this.programConfigurations.upload(t)}},{key:"destroy",value:function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}},{key:"addFeature",value:function(t,e){var n=!0,r=!1,i=void 0;try{for(var o,a=p(e,500)[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value,u=0,l=!0,c=!1,f=void 0;try{for(var d,v=s[Symbol.iterator]();!(l=(d=v.next()).done);l=!0){u+=d.value.length}}catch(t){c=!0,f=t}finally{try{l||null==v.return||v.return()}finally{if(c)throw f}}var m=this.segments.prepareSegment(u,this.layoutVertexArray,this.indexArray),g=m.vertexLength,b=[],x=[],w=!0,k=!1,_=void 0;try{for(var S,A=s[Symbol.iterator]();!(w=(S=A.next()).done);w=!0){var T=S.value;if(0!==T.length){T!==s[0]&&x.push(b.length/2);var j=this.segments2.prepareSegment(T.length,this.layoutVertexArray,this.indexArray2),O=j.vertexLength;this.layoutVertexArray.emplaceBack(T[0].x,T[0].y),this.indexArray2.emplaceBack(O+T.length-1,O),b.push(T[0].x),b.push(T[0].y);for(var z=1;z<T.length;z++)this.layoutVertexArray.emplaceBack(T[z].x,T[z].y),this.indexArray2.emplaceBack(O+z-1,O+z),b.push(T[z].x),b.push(T[z].y);j.vertexLength+=T.length,j.primitiveLength+=T.length}}}catch(t){k=!0,_=t}finally{try{w||null==A.return||A.return()}finally{if(k)throw _}}var P=h(b,x);y(P.length%3==0);for(var E=0;E<P.length;E+=3)this.indexArray.emplaceBack(g+P[E],g+P[E+1],g+P[E+2]);m.vertexLength+=u,m.primitiveLength+=P.length/3}}catch(t){r=!0,i=t}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t)}}])&&r(e.prototype,n),u&&r(e,u),t}();d("FillBucket",v,{omit:["layers"]}),t.exports=v},function(t,e,n){var r=n(17).createLayout;t.exports=r([{name:"a_pos",components:2,type:"Int16"}],4)},function(t,e,n){t.exports=function(){"use strict";function t(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function e(t,e){return t<e?-1:t>e?1:0}return function(n,r,i,o,a){!function e(n,r,i,o,a){for(;o>i;){if(o-i>600){var s=o-i+1,u=r-i+1,l=Math.log(s),c=.5*Math.exp(2*l/3),f=.5*Math.sqrt(l*c*(s-c)/s)*(u-s/2<0?-1:1),h=Math.max(i,Math.floor(r-u*c/s+f)),p=Math.min(o,Math.floor(r+(s-u)*c/s+f));e(n,r,h,p,a)}var y=n[r],d=i,v=o;for(t(n,i,r),a(n[o],y)>0&&t(n,i,o);d<v;){for(t(n,d,v),d++,v--;a(n[d],y)<0;)d++;for(;a(n[v],y)>0;)v--}0===a(n[i],y)?t(n,i,v):t(n,++v,o),v<=r&&(i=v+1),r<=v&&(o=v-1)}}(n,r,i||0,o||n.length-1,a||e)}}()},function(t,e,n){var r=n(8),i=n(1),o=i.Properties,a=i.DataConstantProperty,s=i.DataDrivenProperty,u=i.CrossFadedProperty,l=(i.HeatmapColorProperty,new o({"fill-antialias":new a(r.paint_fill["fill-antialias"]),"fill-opacity":new s(r.paint_fill["fill-opacity"]),"fill-color":new s(r.paint_fill["fill-color"]),"fill-outline-color":new s(r.paint_fill["fill-outline-color"]),"fill-translate":new a(r.paint_fill["fill-translate"]),"fill-translate-anchor":new a(r.paint_fill["fill-translate-anchor"]),"fill-pattern":new u(r.paint_fill["fill-pattern"])}));t.exports={paint:l}},function(t,e,n){function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function o(t,e){return!e||"object"!==r(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called");return t}(t):e}function a(t){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function s(t,e){return(s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var u=n(9),l=n(123),c=n(28).multiPolygonIntersectsMultiPolygon,f=n(30),h=f.translateDistance,p=f.translate,y=n(125),d=n(1),v=(d.Transitionable,d.Transitioning,d.PossiblyEvaluated,function(t){function e(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),o(this,a(e).call(this,t,y))}var n,r,f;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&s(t,e)}(e,u),n=e,(r=[{key:"createBucket",value:function(t){return new l(t)}},{key:"queryRadius",value:function(){return h(this.paint.get("fill-extrusion-translate"))}},{key:"queryIntersectsFeature",value:function(t,e,n,r,i,o){var a=p(t,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),i,o);return c(a,n)}},{key:"hasOffscreenPass",value:function(){return 0!==this.paint.get("fill-extrusion-opacity")&&"none"!==this.visibility}},{key:"resize",value:function(){this.viewportFrame&&(this.viewportFrame.destroy(),this.viewportFrame=null)}}])&&i(n.prototype,r),f&&i(n,f),e}());t.exports=v},function(t,e,n){function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var i=n(10).FillExtrusionLayoutArray,o=n(124).members,a=n(25),s=a.SegmentVector,u=a.MAX_VERTEX_ARRAY_LENGTH,l=n(26).ProgramConfigurationSet,c=n(27).TriangleIndexArray,f=n(20),h=n(18),p=n(78),y=n(40),d=n(0),v=n(3).register,m=Math.pow(2,13);function g(t,e,n,r,i,o,a,s){t.emplaceBack(e,n,2*Math.floor(r*m)+a,i*m*2,o*m*2,Math.round(s))}var b=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(function(t){return t.id}),this.index=e.index,this.layoutVertexArray=new i,this.indexArray=new c,this.programConfigurations=new l(o,e.layers,e.zoom),this.segments=new s}var e,n,a;return e=t,(n=[{key:"populate",value:function(t,e){var n=!0,r=!1,i=void 0;try{for(var o,a=t[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value,u=s.feature,l=s.index,c=s.sourceLayerIndex;if(this.layers[0]._featureFilter({zoom:this.zoom},u)){var h=f(u);this.addFeature(u,h),e.featureIndex.insert(u,h,l,c,this.index)}}}catch(t){r=!0,i=t}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}}},{key:"isEmpty",value:function(){return 0===this.layoutVertexArray.length}},{key:"upload",value:function(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,o),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.programConfigurations.upload(t)}},{key:"destroy",value:function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}},{key:"addFeature",value:function(t,e){var n=!0,r=!1,i=void 0;try{for(var o,a=y(e,500)[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value,l=0,c=!0,f=!1,h=void 0;try{for(var v,m=s[Symbol.iterator]();!(c=(v=m.next()).done);c=!0){l+=v.value.length}}catch(t){f=!0,h=t}finally{try{c||null==m.return||m.return()}finally{if(f)throw h}}var b=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray),k=!0,_=!1,S=void 0;try{for(var A,T=s[Symbol.iterator]();!(k=(A=T.next()).done);k=!0){var j=A.value;if(0!==j.length&&!w(j))for(var O=0,z=0;z<j.length;z++){var P=j[z];if(z>=1){var E=j[z-1];if(!x(P,E)){b.vertexLength+4>u&&(b=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var C=P.sub(E)._perp()._unit(),M=E.dist(P);O+M>32768&&(O=0),g(this.layoutVertexArray,P.x,P.y,C.x,C.y,0,0,O),g(this.layoutVertexArray,P.x,P.y,C.x,C.y,0,1,O),O+=M,g(this.layoutVertexArray,E.x,E.y,C.x,C.y,0,0,O),g(this.layoutVertexArray,E.x,E.y,C.x,C.y,0,1,O);var I=b.vertexLength;this.indexArray.emplaceBack(I,I+1,I+2),this.indexArray.emplaceBack(I+1,I+2,I+3),b.vertexLength+=4,b.primitiveLength+=2}}}}}catch(t){_=!0,S=t}finally{try{k||null==T.return||T.return()}finally{if(_)throw S}}b.vertexLength+l>u&&(b=this.segments.prepareSegment(l,this.layoutVertexArray,this.indexArray));var B=[],V=[],L=b.vertexLength,F=!0,R=!1,D=void 0;try{for(var q,N=s[Symbol.iterator]();!(F=(q=N.next()).done);F=!0){var U=q.value;if(0!==U.length){U!==s[0]&&V.push(B.length/2);for(var J=0;J<U.length;J++){var G=U[J];g(this.layoutVertexArray,G.x,G.y,0,0,1,1,0),B.push(G.x),B.push(G.y)}}}}catch(t){R=!0,D=t}finally{try{F||null==N.return||N.return()}finally{if(R)throw D}}var Z=p(B,V);d(Z.length%3==0);for(var H=0;H<Z.length;H+=3)this.indexArray.emplaceBack(L+Z[H],L+Z[H+1],L+Z[H+2]);b.primitiveLength+=Z.length/3,b.vertexLength+=l}}catch(t){r=!0,i=t}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t)}}])&&r(e.prototype,n),a&&r(e,a),t}();function x(t,e){return t.x===e.x&&(t.x<0||t.x>h)||t.y===e.y&&(t.y<0||t.y>h)}function w(t){return t.every(function(t){return t.x<0})||t.every(function(t){return t.x>h})||t.every(function(t){return t.y<0})||t.every(function(t){return t.y>h})}v("FillExtrusionBucket",b,{omit:["layers"]}),t.exports=b},function(t,e,n){var r=n(17).createLayout;t.exports=r([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4)},function(t,e,n){var r=n(8),i=n(1),o=i.Properties,a=i.DataConstantProperty,s=i.DataDrivenProperty,u=i.CrossFadedProperty,l=(i.HeatmapColorProperty,new o({"fill-extrusion-opacity":new a(r["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new s(r["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new a(r["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new a(r["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new u(r["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new s(r["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new s(r["paint_fill-extrusion"]["fill-extrusion-base"])}));t.exports={paint:l}},function(t,e,n){function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function a(t,e,n){return e&&o(t.prototype,e),n&&o(t,n),t}function s(t,e){return!e||"object"!==r(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called");return t}(t):e}function u(t,e,n){return(u="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=l(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(n):i.value}})(t,e,n||t)}function l(t){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function c(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&f(t,e)}function f(t,e){return(f=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var h=n(6),p=n(9),y=n(127),d=n(28).multiPolygonIntersectsBufferedMultiLine,v=n(30),m=v.getMaximumPaintValue,g=v.translateDistance,b=v.translate,x=n(130),w=n(2).extend,k=n(41),_=n(1),S=(_.Transitionable,_.Transitioning,_.Layout,_.PossiblyEvaluated,_.DataDrivenProperty),A=new(function(t){function e(){return i(this,e),s(this,l(e).apply(this,arguments))}return c(e,S),a(e,[{key:"possiblyEvaluate",value:function(t,n){return n=new k(Math.floor(n.zoom),{now:n.now,fadeDuration:n.fadeDuration,zoomHistory:n.zoomHistory,transition:n.transition}),u(l(e.prototype),"possiblyEvaluate",this).call(this,t,n)}},{key:"evaluate",value:function(t,n,r){return n=w({},n,{zoom:Math.floor(n.zoom)}),u(l(e.prototype),"evaluate",this).call(this,t,n,r)}}]),e}())(x.paint.properties["line-width"].specification);A.useIntegerZoom=!0;var T=function(t){function e(t){return i(this,e),s(this,l(e).call(this,t,x))}return c(e,p),a(e,[{key:"recalculate",value:function(t){u(l(e.prototype),"recalculate",this).call(this,t),this.paint._values["line-floorwidth"]=A.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,t)}},{key:"createBucket",value:function(t){return new y(t)}},{key:"queryRadius",value:function(t){var e=t,n=j(m("line-width",this,e),m("line-gap-width",this,e)),r=m("line-offset",this,e);return n/2+Math.abs(r)+g(this.paint.get("line-translate"))}},{key:"queryIntersectsFeature",value:function(t,e,n,r,i,o){var a=b(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),i,o),s=o/2*j(this.paint.get("line-width").evaluate(e),this.paint.get("line-gap-width").evaluate(e)),u=this.paint.get("line-offset").evaluate(e);return u&&(n=function(t,e){for(var n=[],r=new h(0,0),i=0;i<t.length;i++){for(var o=t[i],a=[],s=0;s<o.length;s++){var u=o[s-1],l=o[s],c=o[s+1],f=0===s?r:l.sub(u)._unit()._perp(),p=s===o.length-1?r:c.sub(l)._unit()._perp(),y=f._add(p)._unit(),d=y.x*p.x+y.y*p.y;y._mult(1/d),a.push(y._mult(e)._add(l))}n.push(a)}return n}(n,u*o)),d(a,n,s)}}]),e}();function j(t,e){return e>0?e+2*t:t}t.exports=T},function(t,e,n){function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var i=n(10).LineLayoutArray,o=n(128).members,a=n(25).SegmentVector,s=n(26).ProgramConfigurationSet,u=n(27).TriangleIndexArray,l=n(20),c=n(18),f=n(21).VectorTileFeature.types,h=n(3).register,p=63,y=Math.cos(Math.PI/180*37.5),d=.5,v=Math.pow(2,14)/d;function m(t,e,n,r,i,o,a){t.emplaceBack(e.x,e.y,r?1:0,i?1:-1,Math.round(p*n.x)+128,Math.round(p*n.y)+128,1+(0===o?0:o<0?-1:1)|(a*d&63)<<2,a*d>>6)}var g=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(function(t){return t.id}),this.index=e.index,this.layoutVertexArray=new i,this.indexArray=new u,this.programConfigurations=new s(o,e.layers,e.zoom),this.segments=new a}var e,n,h;return e=t,(n=[{key:"populate",value:function(t,e){var n=!0,r=!1,i=void 0;try{for(var o,a=t[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value,u=s.feature,c=s.index,f=s.sourceLayerIndex;if(this.layers[0]._featureFilter({zoom:this.zoom},u)){var h=l(u);this.addFeature(u,h),e.featureIndex.insert(u,h,c,f,this.index)}}}catch(t){r=!0,i=t}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}}},{key:"isEmpty",value:function(){return 0===this.layoutVertexArray.length}},{key:"upload",value:function(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,o),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.programConfigurations.upload(t)}},{key:"destroy",value:function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}},{key:"addFeature",value:function(t,e){var n=this.layers[0].layout,r=n.get("line-join").evaluate(t),i=n.get("line-cap"),o=n.get("line-miter-limit"),a=n.get("line-round-limit"),s=!0,u=!1,l=void 0;try{for(var c,f=e[Symbol.iterator]();!(s=(c=f.next()).done);s=!0){var h=c.value;this.addLine(h,t,r,i,o,a)}}catch(t){u=!0,l=t}finally{try{s||null==f.return||f.return()}finally{if(u)throw l}}}},{key:"addLine",value:function(t,e,n,r,i,o){for(var a="Polygon"===f[e.type],s=t.length;s>=2&&t[s-1].equals(t[s-2]);)s--;for(var u=0;u<s-1&&t[u].equals(t[u+1]);)u++;if(!(s<(a?3:2))){"bevel"===n&&(i=1.05);var l=c/(512*this.overscaling)*15,h=t[u],p=this.segments.prepareSegment(10*s,this.layoutVertexArray,this.indexArray);this.distance=0;var d,v,m,g=r,b=a?"butt":r,x=!0,w=void 0,k=void 0,_=void 0,S=void 0;this.e1=this.e2=this.e3=-1,a&&(d=t[s-2],S=h.sub(d)._unit()._perp());for(var A=u;A<s;A++)if(!(k=a&&A===s-1?t[u+1]:t[A+1])||!t[A].equals(k)){S&&(_=S),d&&(w=d),d=t[A],S=k?k.sub(d)._unit()._perp():_;var T=(_=_||S).add(S);0===T.x&&0===T.y||T._unit();var j=T.x*S.x+T.y*S.y,O=0!==j?1/j:1/0,z=j<y&&w&&k;if(z&&A>u){var P=d.dist(w);if(P>2*l){var E=d.sub(d.sub(w)._mult(l/P)._round());this.distance+=E.dist(w),this.addCurrentVertex(E,this.distance,_.mult(1),0,0,!1,p),w=E}}var C=w&&k,M=C?n:k?g:b;if(C&&"round"===M&&(O<o?M="miter":O<=2&&(M="fakeround")),"miter"===M&&O>i&&(M="bevel"),"bevel"===M&&(O>2&&(M="flipbevel"),O<i&&(M="miter")),w&&(this.distance+=d.dist(w)),"miter"===M)T._mult(O),this.addCurrentVertex(d,this.distance,T,0,0,!1,p);else if("flipbevel"===M){if(O>100)T=S.clone().mult(-1);else{var I=_.x*S.y-_.y*S.x>0?-1:1,B=O*_.add(S).mag()/_.sub(S).mag();T._perp()._mult(B*I)}this.addCurrentVertex(d,this.distance,T,0,0,!1,p),this.addCurrentVertex(d,this.distance,T.mult(-1),0,0,!1,p)}else if("bevel"===M||"fakeround"===M){var V=_.x*S.y-_.y*S.x>0,L=-Math.sqrt(O*O-1);if(V?(m=0,v=L):(v=0,m=L),x||this.addCurrentVertex(d,this.distance,_,v,m,!1,p),"fakeround"===M){for(var F=Math.floor(8*(.5-(j-.5))),R=void 0,D=0;D<F;D++)R=S.mult((D+1)/(F+1))._add(_)._unit(),this.addPieSliceVertex(d,this.distance,R,V,p);this.addPieSliceVertex(d,this.distance,T,V,p);for(var q=F-1;q>=0;q--)R=_.mult((q+1)/(F+1))._add(S)._unit(),this.addPieSliceVertex(d,this.distance,R,V,p)}k&&this.addCurrentVertex(d,this.distance,S,-v,-m,!1,p)}else"butt"===M?(x||this.addCurrentVertex(d,this.distance,_,0,0,!1,p),k&&this.addCurrentVertex(d,this.distance,S,0,0,!1,p)):"square"===M?(x||(this.addCurrentVertex(d,this.distance,_,1,1,!1,p),this.e1=this.e2=-1),k&&this.addCurrentVertex(d,this.distance,S,-1,-1,!1,p)):"round"===M&&(x||(this.addCurrentVertex(d,this.distance,_,0,0,!1,p),this.addCurrentVertex(d,this.distance,_,1,1,!0,p),this.e1=this.e2=-1),k&&(this.addCurrentVertex(d,this.distance,S,-1,-1,!0,p),this.addCurrentVertex(d,this.distance,S,0,0,!1,p)));if(z&&A<s-1){var N=d.dist(k);if(N>2*l){var U=d.add(k.sub(d)._mult(l/N)._round());this.distance+=U.dist(d),this.addCurrentVertex(U,this.distance,S.mult(1),0,0,!1,p),d=U}}x=!1}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e)}}},{key:"addCurrentVertex",value:function(t,e,n,r,i,o,a){var s,u=this.layoutVertexArray,l=this.indexArray;s=n.clone(),r&&s._sub(n.perp()._mult(r)),m(u,t,s,o,!1,r,e),this.e3=a.vertexLength++,this.e1>=0&&this.e2>=0&&(l.emplaceBack(this.e1,this.e2,this.e3),a.primitiveLength++),this.e1=this.e2,this.e2=this.e3,s=n.mult(-1),i&&s._sub(n.perp()._mult(i)),m(u,t,s,o,!0,-i,e),this.e3=a.vertexLength++,this.e1>=0&&this.e2>=0&&(l.emplaceBack(this.e1,this.e2,this.e3),a.primitiveLength++),this.e1=this.e2,this.e2=this.e3,e>v/2&&(this.distance=0,this.addCurrentVertex(t,this.distance,n,r,i,o,a))}},{key:"addPieSliceVertex",value:function(t,e,n,r,i){n=n.mult(r?-1:1);var o=this.layoutVertexArray,a=this.indexArray;m(o,t,n,!1,r,0,e),this.e3=i.vertexLength++,this.e1>=0&&this.e2>=0&&(a.emplaceBack(this.e1,this.e2,this.e3),i.primitiveLength++),r?this.e2=this.e3:this.e1=this.e3}}])&&r(e.prototype,n),h&&r(e,h),t}();h("LineBucket",g,{omit:["layers"]}),t.exports=g},function(t,e,n){var r=n(17).createLayout;t.exports=r([{name:"a_pos_normal",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4)},function(t,e,n){"use strict";var r=n(79);function i(t,e,n){if(3===t){var i=new r(n,n.readVarint()+n.pos);i.length&&(e[i.name]=i)}}t.exports=function(t,e){this.layers=t.readFields(i,{},e)}},function(t,e,n){var r=n(8),i=n(1),o=i.Properties,a=i.DataConstantProperty,s=i.DataDrivenProperty,u=i.CrossFadedProperty,l=(i.HeatmapColorProperty,new o({"line-cap":new a(r.layout_line["line-cap"]),"line-join":new s(r.layout_line["line-join"]),"line-miter-limit":new a(r.layout_line["line-miter-limit"]),"line-round-limit":new a(r.layout_line["line-round-limit"])})),c=new o({"line-opacity":new s(r.paint_line["line-opacity"]),"line-color":new s(r.paint_line["line-color"]),"line-translate":new a(r.paint_line["line-translate"]),"line-translate-anchor":new a(r.paint_line["line-translate-anchor"]),"line-width":new s(r.paint_line["line-width"]),"line-gap-width":new s(r.paint_line["line-gap-width"]),"line-offset":new s(r.paint_line["line-offset"]),"line-blur":new s(r.paint_line["line-blur"]),"line-dasharray":new u(r.paint_line["line-dasharray"]),"line-pattern":new u(r.paint_line["line-pattern"])});t.exports={paint:c,layout:l}},function(t,e){function n(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var r=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.first=!0}var e,r,i;return e=t,(r=[{key:"update",value:function(t,e){var n=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=n,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=n,!0):(this.lastFloorZoom>n?(this.lastIntegerZoom=n+1,this.lastIntegerZoomTime=e):this.lastFloorZoom<n&&(this.lastIntegerZoom=n,this.lastIntegerZoomTime=e),t!==this.lastZoom&&(this.lastZoom=t,this.lastFloorZoom=n,!0))}}])&&n(e.prototype,r),i&&n(e,i),t}();t.exports=r},function(t,e,n){function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function o(t,e){return!e||"object"!==r(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called");return t}(t):e}function a(t,e,n){return(a="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=s(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(n):i.value}})(t,e,n||t)}function s(t){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function u(t,e){return(u=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var l=n(9),c=n(42),f=n(138),h=n(14).isExpression,p=n(0),y=n(139),d=n(1),v=(d.Transitionable,d.Transitioning,d.Layout,d.PossiblyEvaluated,function(t){function e(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),o(this,s(e).call(this,t,y))}var n,r,d;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&u(t,e)}(e,l),n=e,(r=[{key:"recalculate",value:function(t){a(s(e.prototype),"recalculate",this).call(this,t),"auto"===this.layout.get("icon-rotation-alignment")&&("line"===this.layout.get("symbol-placement")?this.layout._values["icon-rotation-alignment"]="map":this.layout._values["icon-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-rotation-alignment")&&("line"===this.layout.get("symbol-placement")?this.layout._values["text-rotation-alignment"]="map":this.layout._values["text-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment"))}},{key:"getValueAndResolveTokens",value:function(t,e){var n=this.layout.get(t).evaluate(e),r=this._unevaluatedLayout._values[t];return r.isDataDriven()||h(r.value)?n:f(e.properties,n)}},{key:"createBucket",value:function(t){return new c(t)}},{key:"queryRadius",value:function(){return 0}},{key:"queryIntersectsFeature",value:function(){return p(!1),!1}}])&&i(n.prototype,r),d&&i(n,d),e}());t.exports=v},function(t,e,n){var r=n(17).createLayout,i={symbolLayoutAttributes:r([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"}]),dynamicLayoutAttributes:r([{name:"a_projected_pos",components:3,type:"Float32"}],4),placementOpacityAttributes:r([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),collisionVertexAttributes:r([{name:"a_placed",components:2,type:"Uint8"}],4),collisionBox:r([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"},{type:"Int16",name:"radius"},{type:"Int16",name:"signedDistanceFromAnchor"}]),collisionBoxLayout:r([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),collisionCircleLayout:r([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),placement:r([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"hidden"}]),glyphOffset:r([{type:"Float32",name:"offsetX"}]),lineVertex:r([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}])};t.exports=i},function(t,e,n){var r=n(43);t.exports=function(t,e,n){var i=e.layout.get("text-transform").evaluate(n);return"uppercase"===i?t=t.toLocaleUpperCase():"lowercase"===i&&(t=t.toLocaleLowerCase()),r.applyArabicShaping&&(t=r.applyArabicShaping(t)),t}},function(t,e){t.exports=function(t){var e={},n={},r=[],i=0;function o(e){r.push(t[e]),i++}function a(t,e,i){var o=n[t];return delete n[t],n[e]=o,r[o].geometry[0].pop(),r[o].geometry[0]=r[o].geometry[0].concat(i[0]),o}function s(t,n,i){var o=e[n];return delete e[n],e[t]=o,r[o].geometry[0].shift(),r[o].geometry[0]=i[0].concat(r[o].geometry[0]),o}function u(t,e,n){var r=n?e[0][e[0].length-1]:e[0][0];return"".concat(t,":").concat(r.x,":").concat(r.y)}for(var l=0;l<t.length;l++){var c=t[l],f=c.geometry,h=c.text;if(h){var p=u(h,f),y=u(h,f,!0);if(p in n&&y in e&&n[p]!==e[y]){var d=s(p,y,f),v=a(p,y,r[d].geometry);delete e[p],delete n[y],n[u(h,r[v].geometry,!0)]=v,r[d].geometry=null}else p in n?a(p,y,f):y in e?s(p,y,f):(o(l),e[p]=i-1,n[y]=i-1)}else o(l)}return r.filter(function(t){return t.geometry})}},function(t,e){t.exports={"Latin-1 Supplement":function(t){return t>=128&&t<=255},Arabic:function(t){return t>=1536&&t<=1791},"Arabic Supplement":function(t){return t>=1872&&t<=1919},"Arabic Extended-A":function(t){return t>=2208&&t<=2303},"Hangul Jamo":function(t){return t>=4352&&t<=4607},"Unified Canadian Aboriginal Syllabics":function(t){return t>=5120&&t<=5759},"Unified Canadian Aboriginal Syllabics Extended":function(t){return t>=6320&&t<=6399},"General Punctuation":function(t){return t>=8192&&t<=8303},"Letterlike Symbols":function(t){return t>=8448&&t<=8527},"Number Forms":function(t){return t>=8528&&t<=8591},"Miscellaneous Technical":function(t){return t>=8960&&t<=9215},"Control Pictures":function(t){return t>=9216&&t<=9279},"Optical Character Recognition":function(t){return t>=9280&&t<=9311},"Enclosed Alphanumerics":function(t){return t>=9312&&t<=9471},"Geometric Shapes":function(t){return t>=9632&&t<=9727},"Miscellaneous Symbols":function(t){return t>=9728&&t<=9983},"Miscellaneous Symbols and Arrows":function(t){return t>=11008&&t<=11263},"CJK Radicals Supplement":function(t){return t>=11904&&t<=12031},"Kangxi Radicals":function(t){return t>=12032&&t<=12255},"Ideographic Description Characters":function(t){return t>=12272&&t<=12287},"CJK Symbols and Punctuation":function(t){return t>=12288&&t<=12351},Hiragana:function(t){return t>=12352&&t<=12447},Katakana:function(t){return t>=12448&&t<=12543},Bopomofo:function(t){return t>=12544&&t<=12591},"Hangul Compatibility Jamo":function(t){return t>=12592&&t<=12687},Kanbun:function(t){return t>=12688&&t<=12703},"Bopomofo Extended":function(t){return t>=12704&&t<=12735},"CJK Strokes":function(t){return t>=12736&&t<=12783},"Katakana Phonetic Extensions":function(t){return t>=12784&&t<=12799},"Enclosed CJK Letters and Months":function(t){return t>=12800&&t<=13055},"CJK Compatibility":function(t){return t>=13056&&t<=13311},"CJK Unified Ideographs Extension A":function(t){return t>=13312&&t<=19903},"Yijing Hexagram Symbols":function(t){return t>=19904&&t<=19967},"CJK Unified Ideographs":function(t){return t>=19968&&t<=40959},"Yi Syllables":function(t){return t>=40960&&t<=42127},"Yi Radicals":function(t){return t>=42128&&t<=42191},"Hangul Jamo Extended-A":function(t){return t>=43360&&t<=43391},"Hangul Syllables":function(t){return t>=44032&&t<=55215},"Hangul Jamo Extended-B":function(t){return t>=55216&&t<=55295},"Private Use Area":function(t){return t>=57344&&t<=63743},"CJK Compatibility Ideographs":function(t){return t>=63744&&t<=64255},"Arabic Presentation Forms-A":function(t){return t>=64336&&t<=65023},"Vertical Forms":function(t){return t>=65040&&t<=65055},"CJK Compatibility Forms":function(t){return t>=65072&&t<=65103},"Small Form Variants":function(t){return t>=65104&&t<=65135},"Arabic Presentation Forms-B":function(t){return t>=65136&&t<=65279},"Halfwidth and Fullwidth Forms":function(t){return t>=65280&&t<=65519}}},function(t,e,n){var r=n(14).normalizePropertyExpression,i=n(19),o=n(2);t.exports={getSizeData:function(t,e){var n=e.expression;if("constant"===n.kind)return{functionType:"constant",layoutSize:n.evaluate({zoom:t+1})};if("source"===n.kind)return{functionType:"source"};for(var r=n.zoomStops,i=0;i<r.length&&r[i]<=t;)i++;for(var o=i=Math.max(0,i-1);o<r.length&&r[o]<t+1;)o++;o=Math.min(r.length-1,o);var a={min:r[i],max:r[o]};return"composite"===n.kind?{functionType:"composite",zoomRange:a,propertyValue:e.value}:{functionType:"camera",layoutSize:n.evaluate({zoom:t+1}),zoomRange:a,sizeRange:{min:n.evaluate({zoom:a.min}),max:n.evaluate({zoom:a.max})},propertyValue:e.value}},evaluateSizeForFeature:function(t,e,n){var r=e;return"source"===t.functionType?n.lowerSize/10:"composite"===t.functionType?i.number(n.lowerSize/10,n.upperSize/10,r.uSizeT):r.uSize},evaluateSizeForZoom:function(t,e,n){if("constant"===t.functionType)return{uSizeT:0,uSize:t.layoutSize};if("source"===t.functionType)return{uSizeT:0,uSize:0};if("camera"===t.functionType){var i=t.propertyValue,a=t.zoomRange,s=t.sizeRange,u=r(i,n.specification),l=o.clamp(u.interpolationFactor(e,a.min,a.max),0,1);return{uSizeT:0,uSize:s.min+l*(s.max-s.min)}}var c=t.propertyValue,f=t.zoomRange,h=r(c,n.specification);return{uSizeT:o.clamp(h.interpolationFactor(e,f.min,f.max),0,1),uSize:0}}}},function(t,e){t.exports=function(t,e){return e.replace(/{([^{}]+)}/g,function(e,n){return n in t?String(t[n]):""}).replace(/FORMAT_NUMBER\\(([^\\)]+)\\)/g,function(t,e){return function(t){t=t.split(",");var e=parseFloat(t[0]);t[2]&&(e*=parseFloat(t[2]));return e<1e3?Math.round(e):e<1e5?(e/1e3).toFixed(1)+"K":e<1e6?Math.round(e/1e3)+"K":e<1e9?(e/1e6).toFixed(2)+"M":e<1e12?(e=Math.round(e/1e6).toFixed(0)).slice(0,-3)+","+e.slice(-4,-1)+"M":"HUGE_NUM"}(e)})}},function(t,e,n){var r=n(8),i=n(1),o=i.Properties,a=i.DataConstantProperty,s=i.DataDrivenProperty,u=(i.CrossFadedProperty,i.HeatmapColorProperty,new o({"symbol-placement":new a(r.layout_symbol["symbol-placement"]),"symbol-spacing":new a(r.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new a(r.layout_symbol["symbol-avoid-edges"]),"icon-allow-overlap":new a(r.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new a(r.layout_symbol["icon-ignore-placement"]),"icon-optional":new a(r.layout_symbol["icon-optional"]),"icon-rotation-alignment":new a(r.layout_symbol["icon-rotation-alignment"]),"icon-size":new s(r.layout_symbol["icon-size"]),"icon-text-fit":new a(r.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new a(r.layout_symbol["icon-text-fit-padding"]),"icon-image":new s(r.layout_symbol["icon-image"]),"icon-rotate":new s(r.layout_symbol["icon-rotate"]),"icon-padding":new a(r.layout_symbol["icon-padding"]),"icon-keep-upright":new a(r.layout_symbol["icon-keep-upright"]),"icon-offset":new s(r.layout_symbol["icon-offset"]),"icon-anchor":new s(r.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new a(r.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new a(r.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new a(r.layout_symbol["text-rotation-alignment"]),"text-field":new s(r.layout_symbol["text-field"]),"text-font":new s(r.layout_symbol["text-font"]),"text-size":new s(r.layout_symbol["text-size"]),"text-max-width":new s(r.layout_symbol["text-max-width"]),"text-line-height":new a(r.layout_symbol["text-line-height"]),"text-letter-spacing":new s(r.layout_symbol["text-letter-spacing"]),"text-justify":new s(r.layout_symbol["text-justify"]),"text-anchor":new s(r.layout_symbol["text-anchor"]),"text-max-angle":new a(r.layout_symbol["text-max-angle"]),"text-rotate":new s(r.layout_symbol["text-rotate"]),"text-padding":new a(r.layout_symbol["text-padding"]),"text-keep-upright":new a(r.layout_symbol["text-keep-upright"]),"text-transform":new s(r.layout_symbol["text-transform"]),"text-offset":new s(r.layout_symbol["text-offset"]),"text-allow-overlap":new a(r.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new a(r.layout_symbol["text-ignore-placement"]),"text-optional":new a(r.layout_symbol["text-optional"])})),l=new o({"icon-opacity":new s(r.paint_symbol["icon-opacity"]),"icon-color":new s(r.paint_symbol["icon-color"]),"icon-halo-color":new s(r.paint_symbol["icon-halo-color"]),"icon-halo-width":new s(r.paint_symbol["icon-halo-width"]),"icon-halo-blur":new s(r.paint_symbol["icon-halo-blur"]),"icon-translate":new a(r.paint_symbol["icon-translate"]),"icon-translate-anchor":new a(r.paint_symbol["icon-translate-anchor"]),"text-opacity":new s(r.paint_symbol["text-opacity"]),"text-color":new s(r.paint_symbol["text-color"]),"text-halo-color":new s(r.paint_symbol["text-halo-color"]),"text-halo-width":new s(r.paint_symbol["text-halo-width"]),"text-halo-blur":new s(r.paint_symbol["text-halo-blur"]),"text-translate":new a(r.paint_symbol["text-translate"]),"text-translate-anchor":new a(r.paint_symbol["text-translate-anchor"])});t.exports={paint:l,layout:u}},function(t,e,n){function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){return!e||"object"!==r(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called");return t}(t):e}function o(t){return(o=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function a(t,e){return(a=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var s=n(9),u=n(141),l=n(1),c=(l.Transitionable,l.Transitioning,l.PossiblyEvaluated,function(t){function e(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),i(this,o(e).call(this,t,u))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&a(t,e)}(e,s),e}());t.exports=c},function(t,e,n){var r=n(8),i=n(1),o=i.Properties,a=i.DataConstantProperty,s=(i.DataDrivenProperty,i.CrossFadedProperty),u=(i.HeatmapColorProperty,new o({"background-color":new a(r.paint_background["background-color"]),"background-pattern":new s(r.paint_background["background-pattern"]),"background-opacity":new a(r.paint_background["background-opacity"])}));t.exports={paint:u}},function(t,e,n){function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){return!e||"object"!==r(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called");return t}(t):e}function o(t){return(o=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function a(t,e){return(a=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var s=n(9),u=n(143),l=n(1),c=(l.Transitionable,l.Transitioning,l.PossiblyEvaluated,function(t){function e(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),i(this,o(e).call(this,t,u))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&a(t,e)}(e,s),e}());t.exports=c},function(t,e,n){var r=n(8),i=n(1),o=i.Properties,a=i.DataConstantProperty,s=(i.DataDrivenProperty,i.CrossFadedProperty,i.HeatmapColorProperty,new o({"raster-opacity":new a(r.paint_raster["raster-opacity"]),"raster-hue-rotate":new a(r.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new a(r.paint_raster["raster-brightness-min"]),"raster-brightness-max":new a(r.paint_raster["raster-brightness-max"]),"raster-saturation":new a(r.paint_raster["raster-saturation"]),"raster-contrast":new a(r.paint_raster["raster-contrast"]),"raster-fade-duration":new a(r.paint_raster["raster-fade-duration"])}));t.exports={paint:s}},function(t,e,n){function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=n(145);function o(t){var e=r(t);if("number"===e||"boolean"===e||"string"===e||null==t)return JSON.stringify(t);if(Array.isArray(t)){var n="[",i=!0,a=!1,s=void 0;try{for(var u,l=t[Symbol.iterator]();!(i=(u=l.next()).done);i=!0){var c=u.value;n+="".concat(o(c),",")}}catch(t){a=!0,s=t}finally{try{i||null==l.return||l.return()}finally{if(a)throw s}}return"".concat(n,"]")}for(var f=Object.keys(t).sort(),h="{",p=0;p<f.length;p++)h+="".concat(JSON.stringify(f[p]),":").concat(o(t[f[p]]),",");return"".concat(h,"}")}function a(t){var e="",n=!0,r=!1,a=void 0;try{for(var s,u=i[Symbol.iterator]();!(n=(s=u.next()).done);n=!0){var l=s.value;e+="/".concat(o(t[l]))}}catch(t){r=!0,a=t}finally{try{n||null==u.return||u.return()}finally{if(r)throw a}}return e}t.exports=function(t){for(var e={},n=0;n<t.length;n++){var r=a(t[n]),i=e[r];i||(i=e[r]=[]),i.push(t[n])}var o=[];for(var s in e)o.push(e[s]);return o}},function(t,e){t.exports=["type","source","source-layer","minzoom","maxzoom","filter","layout"]},function(t,e){e.read=function(t,e,n,r,i){var o,a,s=8*i-r-1,u=(1<<s)-1,l=u>>1,c=-7,f=n?i-1:0,h=n?-1:1,p=t[e+f];for(f+=h,o=p&(1<<-c)-1,p>>=-c,c+=s;c>0;o=256*o+t[e+f],f+=h,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=r;c>0;a=256*a+t[e+f],f+=h,c-=8);if(0===o)o=1-l;else{if(o===u)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,r),o-=l}return(p?-1:1)*a*Math.pow(2,o-r)},e.write=function(t,e,n,r,i,o){var a,s,u,l=8*o-i-1,c=(1<<l)-1,f=c>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:o-1,y=r?1:-1,d=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=c):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),(e+=a+f>=1?h/u:h*Math.pow(2,1-f))*u>=2&&(a++,u/=2),a+f>=c?(s=0,a=c):a+f>=1?(s=(e*u-1)*Math.pow(2,i),a+=f):(s=e*Math.pow(2,f-1)*Math.pow(2,i),a=0));i>=8;t[n+p]=255&s,p+=y,s/=256,i-=8);for(a=a<<i|s,l+=i;l>0;t[n+p]=255&a,p+=y,a/=256,l-=8);t[n+p-y]|=128*d}},function(t,e,n){function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var i=n(148),o=n(151).performSymbolLayout,a=n(10).CollisionBoxArray,s=n(83),u=n(42),l=n(2),c=n(0),f=n(162).makeImageAtlas,h=n(163).makeGlyphAtlas,p=n(41),y=n(84).OverscaledTileID,d=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.tileID=new y(e.tileID.overscaledZ,e.tileID.wrap,e.tileID.canonical.z,e.tileID.canonical.x,e.tileID.canonical.y),this.uid=e.uid,this.zoom=e.zoom,this.pixelRatio=e.pixelRatio,this.tileSize=e.tileSize,this.source=e.source,this.overscaling=e.overscaling,this.showCollisionBoxes=e.showCollisionBoxes}var e,n,p;return e=t,(n=[{key:"parse",value:function(t,e,n,r){var p=this;this.status="parsing",this.data=t,this.collisionBoxArray=new a;var y=new s(Object.keys(t.layers).sort()),d=new i(this.tileID,this.overscaling);d.bucketLayerIDs=[];var m,g,b,x={},w={featureIndex:d,iconDependencies:{},glyphDependencies:{}},k=e.familiesBySource[this.source];for(var _ in k){var S=t.layers[_];if(S){1===S.version&&l.warnOnce(\'Vector tile source "\'.concat(this.source,\'" layer "\').concat(_,\'" \')+"does not use vector tile spec v2 and therefore may have some rendering errors.");for(var A=y.encode(_),T=[],j=0;j<S.length;j++){var O=S.feature(j);T.push({feature:O,index:j,sourceLayerIndex:A})}var z=!0,P=!1,E=void 0;try{for(var C,M=k[_][Symbol.iterator]();!(z=(C=M.next()).done);z=!0){var I=C.value,B=I[0];if(c(B.source===this.source),!(B.minzoom&&this.zoom<Math.floor(B.minzoom)))if(!(B.maxzoom&&this.zoom>=B.maxzoom))if("none"!==B.visibility)v(I,this.zoom),(x[B.id]=B.createBucket({index:d.bucketLayerIDs.length,layers:I,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray})).populate(T,w),d.bucketLayerIDs.push(I.map(function(t){return t.id}))}}catch(t){P=!0,E=t}finally{try{z||null==M.return||M.return()}finally{if(P)throw E}}}}var V=l.mapObject(w.glyphDependencies,function(t){return Object.keys(t).map(Number)});Object.keys(V).length?n.send("getGlyphs",{uid:this.uid,stacks:V},function(t,e){m||(m=t,g=e,F.call(p))}):g={};var L=Object.keys(w.iconDependencies);function F(){if(m)return r(m);if(g&&b){var t=h(g),e=f(b);for(var n in x){var i=x[n];i instanceof u&&(v(i.layers,this.zoom),o(i,g,t.positions,b,e.positions,this.showCollisionBoxes))}this.status="done",r(null,{buckets:l.values(x).filter(function(t){return!t.isEmpty()}),featureIndex:d,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:t.image,iconAtlasImage:e.image})}}L.length?n.send("getImages",{icons:L},function(t,e){m||(m=t,b=e,F.call(p))}):b={},F.call(this)}}])&&r(e.prototype,n),p&&r(e,p),t}();function v(t,e){var n=new p(e),r=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done);r=!0){a.value.recalculate(n)}}catch(t){i=!0,o=t}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}}t.exports=d},function(t,e,n){function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}n(6);var i=n(20),o=n(18),a=n(39),s=n(48),u=n(83),l=n(21),c=n(32),f=n(149),h=n(2).arraysIntersect,p=(n(84).OverscaledTileID,n(3).register),y=n(10).FeatureIndexArray,d=function(){function t(e,n,r,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.tileID=e,this.overscaling=n,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=r||new s(o,16,0),this.featureIndexArray=i||new y}var e,n,p;return e=t,(n=[{key:"insert",value:function(t,e,n,r,i){var o=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(n,r,i);for(var a=0;a<e.length;a++){for(var s=e[a],u=[1/0,1/0,-1/0,-1/0],l=0;l<s.length;l++){var c=s[l];u[0]=Math.min(u[0],c.x),u[1]=Math.min(u[1],c.y),u[2]=Math.max(u[2],c.x),u[3]=Math.max(u[3],c.y)}this.grid.insert(o,u[0],u[1],u[2],u[3])}}},{key:"query",value:function(t,e){this.vtLayers||(this.vtLayers=new l.VectorTile(new c(this.rawTileData)).layers,this.sourceLayerCoder=new u(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"]));for(var n={},r=t.params||{},i=o/t.tileSize/t.scale,s=a(r.filter),f=t.queryGeometry,h=t.additionalRadius*i,p=1/0,y=1/0,d=-1/0,m=-1/0,g=0;g<f.length;g++)for(var b=f[g],x=0;x<b.length;x++){var w=b[x];p=Math.min(p,w.x),y=Math.min(y,w.y),d=Math.max(d,w.x),m=Math.max(m,w.y)}var k=this.grid.query(p-h,y-h,d+h,m+h);k.sort(v),this.filterMatching(n,k,this.featureIndexArray,f,s,r.layers,e,t.bearing,i);var _=t.collisionIndex?t.collisionIndex.queryRenderedSymbols(f,this.tileID,o/t.tileSize,t.collisionBoxArray,t.sourceID,t.bucketInstanceIds):[];return _.sort(),this.filterMatching(n,_,t.collisionBoxArray,f,s,r.layers,e,t.bearing,i),n}},{key:"filterMatching",value:function(t,e,n,r,o,a,s,u,l){for(var c,p=0;p<e.length;p++){var y=e[p];if(y!==c){c=y;var d=n.get(y),v=this.bucketLayerIDs[d.bucketIndex];if(!a||h(a,v)){var m=this.sourceLayerCoder.decode(d.sourceLayerIndex),g=this.vtLayers[m].feature(d.featureIndex);if(o({zoom:this.tileID.overscaledZ},g))for(var b=null,x=0;x<v.length;x++){var w=v[x];if(!(a&&a.indexOf(w)<0)){var k=s[w];if(k&&("symbol"===k.type||(b||(b=i(g)),k.queryIntersectsFeature(r,g,b,this.z,u,l)))){var _=new f(g,this.z,this.x,this.y);_.layer=k.serialize();var S=t[w];void 0===S&&(S=t[w]=[]),S.push({featureIndex:y,feature:_})}}}}}}}},{key:"hasLayer",value:function(t){var e=!0,n=!1,r=void 0;try{for(var i,o=this.bucketLayerIDs[Symbol.iterator]();!(e=(i=o.next()).done);e=!0){var a=i.value,s=!0,u=!1,l=void 0;try{for(var c,f=a[Symbol.iterator]();!(s=(c=f.next()).done);s=!0){if(t===c.value)return!0}}catch(t){u=!0,l=t}finally{try{s||null==f.return||f.return()}finally{if(u)throw l}}}}catch(t){n=!0,r=t}finally{try{e||null==o.return||o.return()}finally{if(n)throw r}}return!1}}])&&r(e.prototype,n),p&&r(e,p),t}();function v(t,e){return e-t}p("FeatureIndex",d,{omit:["rawTileData","sourceLayerCoder","collisionIndex"]}),t.exports=d},function(t,e){function n(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var r=function(){function t(e,n,r,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.type="Feature",this._vectorTileFeature=e,e._z=n,e._x=r,e._y=i,this.properties=e.properties,null!=e.id&&(this.id=e.id)}var e,r,i;return e=t,(r=[{key:"toJSON",value:function(){var t={geometry:this.geometry};for(var e in this)"_geometry"!==e&&"_vectorTileFeature"!==e&&(t[e]=this[e]);return t}},{key:"geometry",get:function(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry},set:function(t){this._geometry=t}}])&&n(e.prototype,r),i&&n(e,i),t}();t.exports=r},function(t,e,n){"use strict";function r(t,e,n,r,o,a){return a=a||{},t+"?"+["bbox="+i(n,r,o),"format="+(a.format||"image/png"),"service="+(a.service||"WMS"),"version="+(a.version||"1.1.1"),"request="+(a.request||"GetMap"),"srs="+(a.srs||"EPSG:3857"),"width="+(a.width||256),"height="+(a.height||256),"layers="+e].join("&")}function i(t,e,n){var r=o(256*t,256*(e=Math.pow(2,n)-e-1),n),i=o(256*(t+1),256*(e+1),n);return r[0]+","+r[1]+","+i[0]+","+i[1]}function o(t,e,n){var r=2*Math.PI*6378137/256/Math.pow(2,n);return[t*r-2*Math.PI*6378137/2,e*r-2*Math.PI*6378137/2]}n.r(e),n.d(e,"getURL",function(){return r}),n.d(e,"getTileBBox",function(){return i}),n.d(e,"getMercCoords",function(){return o})},function(t,e,n){var r=n(45),i=n(152),o=n(154),a=n(155),s=n(156),u=s.shapeText,l=s.shapeIcon,c=s.WritingMode,f=n(157),h=f.getGlyphQuads,p=f.getIconQuads,y=n(159),d=n(2),v=n(31),m=n(160),g=n(40),b=n(18),x=n(42),w=n(41);n(6);function k(t,e,n,s,u,l){var f=l.layoutTextSize.evaluate(e),h=l.layoutIconSize.evaluate(e),v=l.textMaxSize.evaluate(e);void 0===v&&(v=f);var w=t.layers[0].layout,k=w.get("text-offset").evaluate(e),A=w.get("icon-offset").evaluate(e),T=f/24,j=t.tilePixelRatio*T,O=t.tilePixelRatio*v/24,z=t.tilePixelRatio*h,P=t.tilePixelRatio*w.get("symbol-spacing"),E=w.get("text-padding")*t.tilePixelRatio,C=w.get("icon-padding")*t.tilePixelRatio,M=w.get("text-max-angle")/180*Math.PI,I="map"===w.get("text-rotation-alignment")&&"line"===w.get("symbol-placement"),B="map"===w.get("icon-rotation-alignment")&&"line"===w.get("symbol-placement"),V=P/2,L=function(r,i){i.x<0||i.x>=b||i.y<0||i.y>=b||t.symbolInstances.push(function(t,e,n,r,i,o,s,u,l,f,h,v,m,g,b,w,k,S,A,T,j,O){var z,P,E=t.addToLineVertexArray(e,n),C=0,M=0,I=0,B=r.horizontal?r.horizontal.text:"",V=[];r.horizontal&&(z=new y(s,n,e,u,l,f,r.horizontal,h,v,m,t.overscaling),M+=_(t,e,r.horizontal,o,m,A,T,g,E,r.vertical?c.horizontal:c.horizontalOnly,V,j,O),r.vertical&&(I+=_(t,e,r.vertical,o,m,A,T,g,E,c.vertical,V,j,O)));var L=z?z.boxStartIndex:t.collisionBoxArray.length,F=z?z.boxEndIndex:t.collisionBoxArray.length;if(i){var R=p(e,i,o,k,r.horizontal,A,T);P=new y(s,n,e,u,l,f,i,b,w,!1,t.overscaling),C=4*R.length;var D=t.iconSizeData,q=null;"source"===D.functionType?q=[10*o.layout.get("icon-size").evaluate(T)]:"composite"===D.functionType&&(q=[10*O.compositeIconSizes[0].evaluate(T),10*O.compositeIconSizes[1].evaluate(T)]),t.addSymbols(t.icon,R,q,S,k,T,!1,e,E.lineStartIndex,E.lineLength)}var N=P?P.boxStartIndex:t.collisionBoxArray.length,U=P?P.boxEndIndex:t.collisionBoxArray.length;t.glyphOffsetArray.length>=x.MAX_GLYPHS&&d.warnOnce("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907");var J=new a,G=new a;return{key:B,textBoxStartIndex:L,textBoxEndIndex:F,iconBoxStartIndex:N,iconBoxEndIndex:U,textOffset:g,iconOffset:S,anchor:e,line:n,featureIndex:u,feature:T,numGlyphVertices:M,numVerticalGlyphVertices:I,numIconVertices:C,textOpacityState:J,iconOpacityState:G,isDuplicate:!1,placedTextSymbolIndices:V,crossTileID:0}}(t,i,r,n,s,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,j,E,I,k,z,C,B,A,{zoom:t.zoom},e,u,l))};if("line"===w.get("symbol-placement")){var F=!0,R=!1,D=void 0;try{for(var q,N=o(e.geometry,0,0,b,b)[Symbol.iterator]();!(F=(q=N.next()).done);F=!0){var U=q.value,J=i(U,P,M,n.vertical||n.horizontal,s,24,O,t.overscaling,b),G=!0,Z=!1,H=void 0;try{for(var W,Y=J[Symbol.iterator]();!(G=(W=Y.next()).done);G=!0){var K=W.value,X=n.horizontal;X&&S(t,X.text,V,K)||L(U,K)}}catch(t){Z=!0,H=t}finally{try{G||null==Y.return||Y.return()}finally{if(Z)throw H}}}}catch(t){R=!0,D=t}finally{try{F||null==N.return||N.return()}finally{if(R)throw D}}}else if("Polygon"===e.type){var $=!0,Q=!1,tt=void 0;try{for(var et,nt=g(e.geometry,0)[Symbol.iterator]();!($=(et=nt.next()).done);$=!0){var rt=et.value,it=m(rt,16);L(rt[0],new r(it.x,it.y,0))}}catch(t){Q=!0,tt=t}finally{try{$||null==nt.return||nt.return()}finally{if(Q)throw tt}}}else if("LineString"===e.type){var ot=!0,at=!1,st=void 0;try{for(var ut,lt=e.geometry[Symbol.iterator]();!(ot=(ut=lt.next()).done);ot=!0){var ct=ut.value;L(ct,new r(ct[0].x,ct[0].y,0))}}catch(t){at=!0,st=t}finally{try{ot||null==lt.return||lt.return()}finally{if(at)throw st}}}else if("Point"===e.type){var ft=!0,ht=!1,pt=void 0;try{for(var yt,dt=e.geometry[Symbol.iterator]();!(ft=(yt=dt.next()).done);ft=!0){var vt=yt.value,mt=!0,gt=!1,bt=void 0;try{for(var xt,wt=vt[Symbol.iterator]();!(mt=(xt=wt.next()).done);mt=!0){var kt=xt.value;L([kt],new r(kt.x,kt.y,0))}}catch(t){gt=!0,bt=t}finally{try{mt||null==wt.return||wt.return()}finally{if(gt)throw bt}}}}catch(t){ht=!0,pt=t}finally{try{ft||null==dt.return||dt.return()}finally{if(ht)throw pt}}}}function _(t,e,n,r,i,o,a,s,u,l,c,f,p){var y=h(e,n,r,i,o,a,f),d=t.textSizeData,v=null;return"source"===d.functionType?v=[10*r.layout.get("text-size").evaluate(a)]:"composite"===d.functionType&&(v=[10*p.compositeTextSizes[0].evaluate(a),10*p.compositeTextSizes[1].evaluate(a)]),t.addSymbols(t.text,y,v,s,i,a,l,e,u.lineStartIndex,u.lineLength),c.push(t.text.placedSymbolArray.length-1),4*y.length}function S(t,e,n,r){var i=t.compareText;if(e in i){for(var o=i[e],a=o.length-1;a>=0;a--)if(r.dist(o[a])<n)return!0}else i[e]=[];return i[e].push(r),!1}t.exports={performSymbolLayout:function(t,e,n,r,i,o){t.createArrays(),t.symbolInstances=[];var a=512*t.overscaling;t.tilePixelRatio=b/a,t.compareText={},t.iconsNeedLinear=!1;var s=t.layers[0].layout,f=t.layers[0]._unevaluatedLayout._values,h={};if("composite"===t.textSizeData.functionType){var p=t.textSizeData.zoomRange,y=p.min,m=p.max;h.compositeTextSizes=[f["text-size"].possiblyEvaluate(new w(y)),f["text-size"].possiblyEvaluate(new w(m))]}if("composite"===t.iconSizeData.functionType){var g=t.iconSizeData.zoomRange,x=g.min,_=g.max;h.compositeIconSizes=[f["icon-size"].possiblyEvaluate(new w(x)),f["icon-size"].possiblyEvaluate(new w(_))]}h.layoutTextSize=f["text-size"].possiblyEvaluate(new w(t.zoom+1)),h.layoutIconSize=f["icon-size"].possiblyEvaluate(new w(t.zoom+1)),h.textMaxSize=f["text-size"].possiblyEvaluate(new w(18));var S=24*s.get("text-line-height"),A="map"===s.get("text-rotation-alignment")&&"line"===s.get("symbol-placement"),T=s.get("text-keep-upright"),j=!0,O=!1,z=void 0;try{for(var P,E=t.features[Symbol.iterator]();!(j=(P=E.next()).done);j=!0){var C=P.value,M=s.get("text-font").evaluate(C).join(","),I=e[M]||{},B=n[M]||{},V={},L=C.text;if(L){var F=v.allowsVerticalWritingMode(L),R=s.get("text-offset").evaluate(C).map(function(t){return 24*t}),D=24*s.get("text-letter-spacing").evaluate(C),q=v.allowsLetterSpacing(L)?D:0,N=s.get("text-anchor").evaluate(C),U=s.get("text-justify").evaluate(C),J="line"!==s.get("symbol-placement")?24*s.get("text-max-width").evaluate(C):0;V.horizontal=u(L,I,J,S,N,U,q,R,24,c.horizontal),F&&A&&T&&(V.vertical=u(L,I,J,S,N,U,q,R,24,c.vertical))}var G=void 0;if(C.icon){var Z=r[C.icon];Z&&(G=l(i[C.icon],s.get("icon-offset").evaluate(C),s.get("icon-anchor").evaluate(C)),void 0===t.sdfIcons?t.sdfIcons=Z.sdf:t.sdfIcons!==Z.sdf&&d.warnOnce("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),Z.pixelRatio!==t.pixelRatio?t.iconsNeedLinear=!0:0!==s.get("icon-rotate").constantOr(1)&&(t.iconsNeedLinear=!0))}(V.horizontal||G)&&k(t,C,V,G,B,h)}}catch(t){O=!0,z=t}finally{try{j||null==E.return||E.return()}finally{if(O)throw z}}o&&t.generateCollisionDebugBuffers()}}},function(t,e,n){var r=n(19).number,i=n(45),o=n(153);t.exports=function(t,e,n,a,s,u,l,c,f){var h=a?.6*u*l:0,p=Math.max(a?a.right-a.left:0,s?s.right-s.left:0),y=0===t[0].x||t[0].x===f||0===t[0].y||t[0].y===f;e-p*l<e/4&&(e=p*l+e/4);var d=2*u;return function t(e,n,a,s,u,l,c,f,h){var p=l/2;var y=0;for(var d=0;d<e.length-1;d++)y+=e[d].dist(e[d+1]);var v=0,m=n-a;var g=[];for(var b=0;b<e.length-1;b++){for(var x=e[b],w=e[b+1],k=x.dist(w),_=w.angleTo(x);m+a<v+k;){var S=((m+=a)-v)/k,A=r(x.x,w.x,S),T=r(x.y,w.y,S);if(A>=0&&A<h&&T>=0&&T<h&&m-p>=0&&m+p<=y){var j=new i(A,T,_,b);j._round(),s&&!o(e,j,l,s,u)||g.push(j)}}v+=k}f||g.length||c||(g=t(e,v/2,a,s,u,l,c,!0,h));return g}(t,y?e/2*c%e:(p/2+d)*l*c%e,e,h,n,p*l,y,!1,f)}},function(t,e){t.exports=function(t,e,n,r,i){if(void 0===e.segment)return!0;var o=e,a=e.segment+1,s=0;for(;s>-n/2;){if(--a<0)return!1;s-=t[a].dist(o),o=t[a]}s+=t[a].dist(t[a+1]),a++;var u=[],l=0;for(;s<n/2;){var c=t[a-1],f=t[a],h=t[a+1];if(!h)return!1;var p=c.angleTo(f)-f.angleTo(h);for(p=Math.abs((p+3*Math.PI)%(2*Math.PI)-Math.PI),u.push({distance:s,angleDelta:p}),l+=p;s-u[0].distance>r;)l-=u.shift().angleDelta;if(l>i)return!1;a++,s+=f.dist(h)}return!0}},function(t,e,n){var r=n(6);t.exports=function(t,e,n,i,o){for(var a=[],s=0;s<t.length;s++)for(var u=t[s],l=void 0,c=0;c<u.length-1;c++){var f=u[c],h=u[c+1];f.x<e&&h.x<e||(f.x<e?f=new r(e,f.y+(h.y-f.y)*((e-f.x)/(h.x-f.x)))._round():h.x<e&&(h=new r(e,f.y+(h.y-f.y)*((e-f.x)/(h.x-f.x)))._round()),f.y<n&&h.y<n||(f.y<n?f=new r(f.x+(h.x-f.x)*((n-f.y)/(h.y-f.y)),n)._round():h.y<n&&(h=new r(f.x+(h.x-f.x)*((n-f.y)/(h.y-f.y)),n)._round()),f.x>=i&&h.x>=i||(f.x>=i?f=new r(i,f.y+(h.y-f.y)*((i-f.x)/(h.x-f.x)))._round():h.x>=i&&(h=new r(i,f.y+(h.y-f.y)*((i-f.x)/(h.x-f.x)))._round()),f.y>=o&&h.y>=o||(f.y>=o?f=new r(f.x+(h.x-f.x)*((o-f.y)/(h.y-f.y)),o)._round():h.y>=o&&(h=new r(f.x+(h.x-f.x)*((o-f.y)/(h.y-f.y)),o)._round()),l&&f.equals(l[l.length-1])||(l=[f],a.push(l)),l.push(h)))))}return a}},function(t,e,n){function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var i=n(3).register,o=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.opacity=0,this.targetOpacity=0,this.time=0}var e,n,i;return e=t,(n=[{key:"clone",value:function(){var e=new t;return e.opacity=this.opacity,e.targetOpacity=this.targetOpacity,e.time=this.time,e}}])&&r(e.prototype,n),i&&r(e,i),t}();i("OpacityState",o),t.exports=o},function(t,e,n){var r,i;function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var a=n(31),s=n(81),u=n(43),l={horizontal:1,vertical:2,horizontalOnly:3};t.exports={shapeText:function(t,e,n,r,i,o,c,f,h,p){var y=t.trim();p===l.vertical&&(y=s(y));var g,b=[],x={positionedGlyphs:b,text:y,top:f[1],bottom:f[1],left:f[0],right:f[0],writingMode:p},w=u.processBidirectionalText;g=w?w(y,d(y,c,n,e)):function(t,e){var n=[],r=0,i=!0,o=!1,a=void 0;try{for(var s,u=e[Symbol.iterator]();!(i=(s=u.next()).done);i=!0){var l=s.value;n.push(t.substring(r,l)),r=l}}catch(t){o=!0,a=t}finally{try{i||null==u.return||u.return()}finally{if(o)throw a}}r<t.length&&n.push(t.substring(r,t.length));return n}(y,d(y,c,n,e));return function(t,e,n,r,i,o,s,u,c){var f=0,h=-17,p=0,y=t.positionedGlyphs,d="right"===o?1:"left"===o?0:.5,g=!0,b=!1,x=void 0;try{for(var w,k=n[Symbol.iterator]();!(g=(w=k.next()).done);g=!0){var _=w.value;if((_=_.trim()).length){for(var S=y.length,A=0;A<_.length;A++){var T=_.charCodeAt(A),j=e[T];j&&(a.charHasUprightVerticalOrientation(T)&&s!==l.horizontal?(y.push({glyph:T,x:f,y:0,vertical:!0}),f+=c+u):(y.push({glyph:T,x:f,y:h,vertical:!1}),f+=j.metrics.advance+u))}if(y.length!==S){var O=f-u;p=Math.max(O,p),m(y,e,S,y.length-1,d)}f=0,h+=r}else h+=r}}catch(t){b=!0,x=t}finally{try{g||null==k.return||k.return()}finally{if(b)throw x}}var z=v(i),P=z.horizontalAlign,E=z.verticalAlign;!function(t,e,n,r,i,o,a){for(var s=(e-n)*i,u=(-r*a+.5)*o,l=0;l<t.length;l++)t[l].x+=s,t[l].y+=u}(y,d,P,E,p,r,n.length);var C=n.length*r;t.top+=-E*C,t.bottom=t.top+C,t.left+=-P*p,t.right=t.left+p}(x,e,g,r,i,o,p,c,h),!!b.length&&x},shapeIcon:function(t,e,n){var r=v(n),i=r.horizontalAlign,o=r.verticalAlign,a=e[0],s=e[1],u=a-t.displaySize[0]*i,l=u+t.displaySize[0],c=s-t.displaySize[1]*o,f=c+t.displaySize[1];return{image:t,top:c,bottom:f,left:u,right:l}},WritingMode:l};var c=(o(r={},9,!0),o(r,10,!0),o(r,11,!0),o(r,12,!0),o(r,13,!0),o(r,32,!0),r),f=(o(i={},10,!0),o(i,32,!0),o(i,38,!0),o(i,40,!0),o(i,41,!0),o(i,43,!0),o(i,45,!0),o(i,47,!0),o(i,173,!0),o(i,183,!0),o(i,8203,!0),o(i,8208,!0),o(i,8211,!0),o(i,8231,!0),i);function h(t,e,n,r){var i=Math.pow(t-e,2);return r?t<e?i/2:2*i:i+Math.abs(n)*n}function p(t,e){var n=0;return 10===t&&(n-=1e4),40!==t&&65288!==t||(n+=50),41!==e&&65289!==e||(n+=50),n}function y(t,e,n,r,i,o){var a=null,s=h(e,n,i,o),u=!0,l=!1,c=void 0;try{for(var f,p=r[Symbol.iterator]();!(u=(f=p.next()).done);u=!0){var y=f.value,d=h(e-y.x,n,i,o)+y.badness;d<=s&&(a=y,s=d)}}catch(t){l=!0,c=t}finally{try{u||null==p.return||p.return()}finally{if(l)throw c}}return{index:t,x:e,priorBreak:a,badness:s}}function d(t,e,n,r){if(!n)return[];if(!t)return[];for(var i=[],o=function(t,e,n,r){for(var i=0,o=0;o<t.length;o++){var a=r[t.charCodeAt(o)];a&&(i+=a.metrics.advance+e)}return i/Math.max(1,Math.ceil(i/n))}(t,e,n,r),s=0,u=0;u<t.length;u++){var l=t.charCodeAt(u),h=r[l];h&&!c[l]&&(s+=h.metrics.advance+e),u<t.length-1&&(f[l]||a.charAllowsIdeographicBreaking(l))&&i.push(y(u+1,s,o,i,p(l,t.charCodeAt(u+1)),!1))}return function t(e){return e?t(e.priorBreak).concat(e.index):[]}(y(t.length,s,o,i,0,!0))}function v(t){var e=.5,n=.5;switch(t){case"right":case"top-right":case"bottom-right":e=1;break;case"left":case"top-left":case"bottom-left":e=0}switch(t){case"bottom":case"bottom-right":case"bottom-left":n=1;break;case"top":case"top-right":case"top-left":n=0}return{horizontalAlign:e,verticalAlign:n}}function m(t,e,n,r,i){if(i){var o=e[t[r].glyph];if(o)for(var a=o.metrics.advance,s=(t[r].x+a)*i,u=n;u<=r;u++)t[u].x-=s}}},function(t,e,n){var r=n(6),i=n(158).GLYPH_PBF_BORDER;t.exports={getIconQuads:function(t,e,n,i,o,a,s){var u,l,c,f,h=e.image,p=n.layout,y=e.top-1/h.pixelRatio,d=e.left-1/h.pixelRatio,v=e.bottom+1/h.pixelRatio,m=e.right+1/h.pixelRatio;if("none"!==p.get("icon-text-fit")&&o){var g=m-d,b=v-y,x=p.get("text-size").evaluate(s)/24,w=o.left*x,k=o.right*x,_=o.top*x,S=o.bottom*x,A=k-w,T=S-_,j=p.get("icon-text-fit-padding")[0],O=p.get("icon-text-fit-padding")[1],z=p.get("icon-text-fit-padding")[2],P=p.get("icon-text-fit-padding")[3],E="width"===p.get("icon-text-fit")?.5*(T-b):0,C="height"===p.get("icon-text-fit")?.5*(A-g):0,M="width"===p.get("icon-text-fit")||"both"===p.get("icon-text-fit")?A:g,I="height"===p.get("icon-text-fit")||"both"===p.get("icon-text-fit")?T:b;u=new r(w+C-P,_+E-j),l=new r(w+C+O+M,_+E-j),c=new r(w+C+O+M,_+E+z+I),f=new r(w+C-P,_+E+z+I)}else u=new r(d,y),l=new r(m,y),c=new r(m,v),f=new r(d,v);var B=n.layout.get("icon-rotate").evaluate(s)*Math.PI/180;if(B){var V=Math.sin(B),L=Math.cos(B),F=[L,-V,V,L];u._matMult(F),l._matMult(F),f._matMult(F),c._matMult(F)}var R={x:h.textureRect.x-1,y:h.textureRect.y-1,w:h.textureRect.w+2,h:h.textureRect.h+2};return[{tl:u,tr:l,bl:f,br:c,tex:R,writingMode:void 0,glyphOffset:[0,0]}]},getGlyphQuads:function(t,e,n,o,a,s,u){for(var l=n.layout.get("text-rotate").evaluate(s)*Math.PI/180,c=n.layout.get("text-offset").evaluate(s).map(function(t){return 24*t}),f=e.positionedGlyphs,h=[],p=0;p<f.length;p++){var y=f[p],d=u[y.glyph];if(d){var v=d.rect;if(v){var m=i+1,g=d.metrics.advance/2,b=o?[y.x+g,y.y]:[0,0],x=o?[0,0]:[y.x+g+c[0],y.y+c[1]],w=d.metrics.left-m-g+x[0],k=-d.metrics.top-m+x[1],_=w+v.w,S=k+v.h,A=new r(w,k),T=new r(_,k),j=new r(w,S),O=new r(_,S);if(o&&y.vertical){var z=new r(-g,g),P=-Math.PI/2,E=new r(5,0);A._rotateAround(P,z)._add(E),T._rotateAround(P,z)._add(E),j._rotateAround(P,z)._add(E),O._rotateAround(P,z)._add(E)}if(l){var C=Math.sin(l),M=Math.cos(l),I=[M,-C,C,M];A._matMult(I),T._matMult(I),j._matMult(I),O._matMult(I)}h.push({tl:A,tr:T,bl:j,br:O,tex:v,writingMode:e.writingMode,glyphOffset:b})}}}return h}}},function(t,e,n){var r=n(29).AlphaImage,i=n(32),o=3;function a(t,e,n){1===t&&n.readMessage(s,e)}function s(t,e,n){if(3===t){var i=n.readMessage(u,{}),a=i.id,s=i.bitmap,l=i.width,c=i.height,f=i.left,h=i.top,p=i.advance;e.push({id:a,bitmap:new r({width:l+2*o,height:c+2*o},s),metrics:{width:l,height:c,left:f,top:h,advance:p}})}}function u(t,e,n){1===t?e.id=n.readVarint():2===t?e.bitmap=n.readBytes():3===t?e.width=n.readVarint():4===t?e.height=n.readVarint():5===t?e.left=n.readSVarint():6===t?e.top=n.readSVarint():7===t&&(e.advance=n.readVarint())}t.exports=function(t){return new i(t).readFields(a,[])},t.exports.GLYPH_PBF_BORDER=o},function(t,e){function n(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var r=function(){function t(e,n,r,i,o,a,s,u,l,c,f){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var h=s.top*u-l,p=s.bottom*u+l,y=s.left*u-l,d=s.right*u+l;if(this.boxStartIndex=e.length,c){var v=p-h,m=d-y;v>0&&(v=Math.max(10*u,v),this._addLineCollisionCircles(e,n,r,r.segment,m,v,i,o,a,f))}else e.emplaceBack(r.x,r.y,y,h,d,p,i,o,a,0,0);this.boxEndIndex=e.length}var e,r,i;return e=t,(r=[{key:"_addLineCollisionCircles",value:function(t,e,n,r,i,o,a,s,u,l){var c=o/2,f=Math.floor(i/c),h=1+.4*Math.log(l)/Math.LN2,p=Math.floor(f*h/2),y=-o/2,d=n,v=r+1,m=y,g=-i/2,b=g-i/4;do{if(--v<0){if(m>g)return;v=0;break}m-=e[v].dist(d),d=e[v]}while(m>b);for(var x=e[v].dist(e[v+1]),w=-p;w<f+p;w++){var k=w*c,_=g+k;if(k<0&&(_+=k),k>i&&(_+=k-i),!(_<m)){for(;m+x<_;){if(m+=x,++v+1>=e.length)return;x=e[v].dist(e[v+1])}var S=_-m,A=e[v],T=e[v+1].sub(A)._unit()._mult(S)._add(A)._round(),j=Math.abs(_-y)<c?0:.8*(_-y);t.emplaceBack(T.x,T.y,-o/2,-o/2,o/2,o/2,a,s,u,o/2,j)}}}}])&&n(e.prototype,r),i&&n(e,i),t}();t.exports=r},function(t,e,n){var r=n(161),i=n(6),o=n(28).distToSegmentSquared;function a(t,e){return e.max-t.max}function s(t,e,n,r){this.p=new i(t,e),this.h=n,this.d=function(t,e){for(var n=!1,r=1/0,i=0;i<e.length;i++)for(var a=e[i],s=0,u=a.length,l=u-1;s<u;l=s++){var c=a[s],f=a[l];c.y>t.y!=f.y>t.y&&t.x<(f.x-c.x)*(t.y-c.y)/(f.y-c.y)+c.x&&(n=!n),r=Math.min(r,o(t,c,f))}return(n?1:-1)*Math.sqrt(r)}(this.p,r),this.max=this.d+this.h*Math.SQRT2}t.exports=function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=1/0,u=1/0,l=-1/0,c=-1/0,f=t[0],h=0;h<f.length;h++){var p=f[h];(!h||p.x<o)&&(o=p.x),(!h||p.y<u)&&(u=p.y),(!h||p.x>l)&&(l=p.x),(!h||p.y>c)&&(c=p.y)}var y=l-o,d=c-u,v=Math.min(y,d),m=v/2,g=new r(null,a);if(0===v)return new i(o,u);for(var b=o;b<l;b+=v)for(var x=u;x<c;x+=v)g.push(new s(b+m,x+m,m,t));for(var w=function(t){for(var e=0,n=0,r=0,i=t[0],o=0,a=i.length,u=a-1;o<a;u=o++){var l=i[o],c=i[u],f=l.x*c.y-c.x*l.y;n+=(l.x+c.x)*f,r+=(l.y+c.y)*f,e+=3*f}return new s(n/e,r/e,0,t)}(t),k=g.length;g.length;){var _=g.pop();(_.d>w.d||!w.d)&&(w=_,n&&console.log("found best %d after %d probes",Math.round(1e4*_.d)/1e4,k)),_.max-w.d<=e||(m=_.h/2,g.push(new s(_.p.x-m,_.p.y-m,m,t)),g.push(new s(_.p.x+m,_.p.y-m,m,t)),g.push(new s(_.p.x-m,_.p.y+m,m,t)),g.push(new s(_.p.x+m,_.p.y+m,m,t)),k+=4)}return n&&(console.log("num probes: ".concat(k)),console.log("best distance: ".concat(w.d))),w.p}},function(t,e,n){"use strict";function r(t,e){if(!(this instanceof r))return new r(t,e);if(this.data=t||[],this.length=this.data.length,this.compare=e||i,this.length>0)for(var n=(this.length>>1)-1;n>=0;n--)this._down(n)}function i(t,e){return t<e?-1:t>e?1:0}t.exports=r,t.exports.default=r,r.prototype={push:function(t){this.data.push(t),this.length++,this._up(this.length-1)},pop:function(){if(0!==this.length){var t=this.data[0];return this.length--,this.length>0&&(this.data[0]=this.data[this.length],this._down(0)),this.data.pop(),t}},peek:function(){return this.data[0]},_up:function(t){for(var e=this.data,n=this.compare,r=e[t];t>0;){var i=t-1>>1,o=e[i];if(n(r,o)>=0)break;e[t]=o,t=i}e[t]=r},_down:function(t){for(var e=this.data,n=this.compare,r=this.length>>1,i=e[t];t<r;){var o=1+(t<<1),a=o+1,s=e[o];if(a<this.length&&n(e[a],s)<0&&(o=a,s=e[a]),n(s,i)>=0)break;e[t]=s,t=o}e[t]=i}}},function(t,e,n){var r=n(85),i=n(29).RGBAImage,o=1;function a(t,e){var n=e.pixelRatio,r={x:t.x+o,y:t.y+o,w:t.w-2*o,h:t.h-2*o};return{pixelRatio:n,textureRect:r,tl:[r.x,r.y],br:[r.x+r.w,r.y+r.h],displaySize:[r.w/n,r.h/n]}}t.exports={imagePosition:a,makeImageAtlas:function(t){var e=new i({width:0,height:0}),n={},s=new r(0,0,{autoResize:!0});for(var u in t){var l=t[u],c=s.packOne(l.data.width+2*o,l.data.height+2*o);e.resize({width:s.w,height:s.h}),i.copy(l.data,e,{x:0,y:0},{x:c.x+o,y:c.y+o},l.data),n[u]=a(c,l)}return s.shrink(),e.resize({width:s.w,height:s.h}),{image:e,positions:n}}}},function(t,e,n){var r=n(85),i=n(29).AlphaImage,o=1;t.exports={makeGlyphAtlas:function(t){var e=new i({width:0,height:0}),n={},a=new r(0,0,{autoResize:!0});for(var s in t){var u=t[s],l=n[s]={};for(var c in u){var f=u[+c];if(f&&0!==f.bitmap.width&&0!==f.bitmap.height){var h=a.packOne(f.bitmap.width+2*o,f.bitmap.height+2*o);e.resize({width:a.w,height:a.h}),i.copy(f.bitmap,e,{x:0,y:0},{x:h.x+o,y:h.y+o},f.bitmap),l[c]={rect:h,metrics:f.metrics}}}}return a.shrink(),e.resize({width:a.w,height:a.h}),{image:e,positions:n}}}},function(t,e,n){function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var i=n(165).DEMData,o=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.loading={},this.loaded={}}var e,n,o;return e=t,(n=[{key:"loadTile",value:function(t,e){var n=t.source,r=t.uid;this.loading[n]||(this.loading[n]={});var o=new i(r);this.loading[n][r]=o,o.loadFromImage(t.rawImageData),delete this.loading[n][r],this.loaded[n]=this.loaded[n]||{},this.loaded[n][r]=o,e(null,o)}},{key:"removeTile",value:function(t){var e=this.loaded[t.source],n=t.uid;e&&e[n]&&delete e[n]}}])&&r(e.prototype,n),o&&r(e,o),t}();t.exports=o},function(t,e,n){function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function o(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}var a=n(29).RGBAImage,s=n(2),u=n(3).register,l=function(){function t(e,n,i){if(r(this,t),e<=0)throw new RangeError("Level must have positive dimension");this.dim=e,this.border=n,this.stride=this.dim+2*this.border,this.data=i||new Int32Array((this.dim+2*this.border)*(this.dim+2*this.border))}return o(t,[{key:"set",value:function(t,e,n){this.data[this._idx(t,e)]=n+65536}},{key:"get",value:function(t,e){return this.data[this._idx(t,e)]-65536}},{key:"_idx",value:function(t,e){if(t<-this.border||t>=this.dim+this.border||e<-this.border||e>=this.dim+this.border)throw new RangeError("out of range source coordinates for DEM data");return(e+this.border)*this.stride+(t+this.border)}}]),t}();u("Level",l);var c=function(){function t(e,n,i){r(this,t),this.uid=e,this.scale=n||1,this.level=i||new l(256,512),this.loaded=!!i}return o(t,[{key:"loadFromImage",value:function(t){if(t.height!==t.width)throw new RangeError("DEM tiles must be square");for(var e=this.level=new l(t.width,t.width/2),n=t.data,r=0;r<e.dim;r++)for(var i=0;i<e.dim;i++){var o=4*(r*e.dim+i);e.set(i,r,this.scale*((256*n[o]*256+256*n[o+1]+n[o+2])/10-1e4))}for(var a=0;a<e.dim;a++)e.set(-1,a,e.get(0,a)),e.set(e.dim,a,e.get(e.dim-1,a)),e.set(a,-1,e.get(a,0)),e.set(a,e.dim,e.get(a,e.dim-1));e.set(-1,-1,e.get(0,0)),e.set(e.dim,-1,e.get(e.dim-1,0)),e.set(-1,e.dim,e.get(0,e.dim-1)),e.set(e.dim,e.dim,e.get(e.dim-1,e.dim-1)),this.loaded=!0}},{key:"getPixels",value:function(){return new a({width:this.level.dim+2*this.level.border,height:this.level.dim+2*this.level.border},new Uint8Array(this.level.data.buffer))}},{key:"backfillBorder",value:function(t,e,n){var r=this.level,i=t.level;if(r.dim!==i.dim)throw new Error("level mismatch (dem dimension)");var o=e*r.dim,a=e*r.dim+r.dim,u=n*r.dim,l=n*r.dim+r.dim;switch(e){case-1:o=a-1;break;case 1:a=o+1}switch(n){case-1:u=l-1;break;case 1:l=u+1}for(var c=s.clamp(o,-r.border,r.dim+r.border),f=s.clamp(a,-r.border,r.dim+r.border),h=s.clamp(u,-r.border,r.dim+r.border),p=s.clamp(l,-r.border,r.dim+r.border),y=-e*r.dim,d=-n*r.dim,v=h;v<p;v++)for(var m=c;m<f;m++)r.set(m,v,i.get(m+y,v+d))}}]),t}();u("DEMData",c),t.exports={DEMData:c,Level:l}},function(t,e,n){function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function o(t,e){return!e||"object"!==r(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called");return t}(t):e}function a(t,e,n){return(a="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=s(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(n):i.value}})(t,e,n||t)}function s(t){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function u(t,e){return(u=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var l=n(44),c=n(167),f=n(170),h=n(171),p=n(173),y=n(178),d=n(82);function v(t,e){var n=t.source,r=t.tileID.canonical;if(!this._geoJSONIndexes[n])return e(null,null);var i=this._geoJSONIndexes[n].getTile(r.z,r.x,r.y);if(!i)return e(null,null);var o=new f(i.features),a=h(o);0===a.byteOffset&&a.byteLength===a.buffer.byteLength||(a=new Uint8Array(a)),e(null,{vectorTile:o,rawData:a.buffer})}var m=function(t){function e(t,n,r){var i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),i=o(this,s(e).call(this,t,n,v)),r&&(i.loadGeoJSON=r),i._geoJSONIndexes={},i}var n,f,h;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&u(t,e)}(e,d),n=e,(f=[{key:"loadData",value:function(t,e){var n=this;this.loadGeoJSON(t,function(i,o){if(i||!o)return e(i);if("object"!==r(o))return e(new Error("Input data is not a valid GeoJSON object."));c(o,!0);try{n._geoJSONIndexes[t.source]=t.cluster?p(t.superclusterOptions).load(o.features):y(o,t.geojsonVtOptions)}catch(i){return e(i)}n.loaded[t.source]={},e(null)})}},{key:"reloadTile",value:function(t,n){var r=this.loaded[t.source],i=t.uid;return r&&r[i]?a(s(e.prototype),"reloadTile",this).call(this,t,n):this.loadTile(t,n)}},{key:"loadGeoJSON",value:function(t,e){if(t.request)l.getJSON(t.request,e);else{if("string"!=typeof t.data)return e(new Error("Input data is not a valid GeoJSON object."));try{return e(null,JSON.parse(t.data))}catch(t){return e(new Error("Input data is not a valid GeoJSON object."))}}}},{key:"removeSource",value:function(t,e){this._geoJSONIndexes[t.source]&&delete this._geoJSONIndexes[t.source],e()}}])&&i(n.prototype,f),h&&i(n,h),e}();t.exports=m},function(t,e,n){var r=n(168);function i(t,e){return function(n){return t(n,e)}}function o(t,e){e=!!e,t[0]=a(t[0],e);for(var n=1;n<t.length;n++)t[n]=a(t[n],!e);return t}function a(t,e){return function(t){return r.ring(t)>=0}(t)===e?t:t.reverse()}t.exports=function t(e,n){switch(e&&e.type||null){case"FeatureCollection":return e.features=e.features.map(i(t,n)),e;case"Feature":return e.geometry=t(e.geometry,n),e;case"Polygon":case"MultiPolygon":return function(t,e){"Polygon"===t.type?t.coordinates=o(t.coordinates,e):"MultiPolygon"===t.type&&(t.coordinates=t.coordinates.map(i(o,e)));return t}(e,n);default:return e}}},function(t,e,n){var r=n(169);function i(t){var e=0;if(t&&t.length>0){e+=Math.abs(o(t[0]));for(var n=1;n<t.length;n++)e-=Math.abs(o(t[n]))}return e}function o(t){var e,n,i,o,s,u,l=0,c=t.length;if(c>2){for(u=0;u<c;u++)u===c-2?(i=c-2,o=c-1,s=0):u===c-1?(i=c-1,o=0,s=1):(i=u,o=u+1,s=u+2),e=t[i],n=t[o],l+=(a(t[s][0])-a(e[0]))*Math.sin(a(n[1]));l=l*r.RADIUS*r.RADIUS/2}return l}function a(t){return t*Math.PI/180}t.exports.geometry=function t(e){var n,r=0;switch(e.type){case"Polygon":return i(e.coordinates);case"MultiPolygon":for(n=0;n<e.coordinates.length;n++)r+=i(e.coordinates[n]);return r;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0;case"GeometryCollection":for(n=0;n<e.geometries.length;n++)r+=t(e.geometries[n]);return r}},t.exports.ring=o},function(t,e){t.exports.RADIUS=6378137,t.exports.FLATTENING=1/298.257223563,t.exports.POLAR_RADIUS=6356752.3142},function(t,e,n){function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function o(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}var a=n(6),s=n(21).VectorTileFeature.prototype.toGeoJSON,u=n(18),l=function(){function t(e){r(this,t),this._feature=e,this.extent=u,this.type=e.type,this.properties=e.tags,"id"in e&&!isNaN(e.id)&&(this.id=parseInt(e.id,10))}return o(t,[{key:"loadGeometry",value:function(){if(1===this._feature.type){var t=[],e=!0,n=!1,r=void 0;try{for(var i,o=this._feature.geometry[Symbol.iterator]();!(e=(i=o.next()).done);e=!0){var s=i.value;t.push([new a(s[0],s[1])])}}catch(t){n=!0,r=t}finally{try{e||null==o.return||o.return()}finally{if(n)throw r}}return t}var u=[],l=!0,c=!1,f=void 0;try{for(var h,p=this._feature.geometry[Symbol.iterator]();!(l=(h=p.next()).done);l=!0){var y=h.value,d=[],v=!0,m=!1,g=void 0;try{for(var b,x=y[Symbol.iterator]();!(v=(b=x.next()).done);v=!0){var w=b.value;d.push(new a(w[0],w[1]))}}catch(t){m=!0,g=t}finally{try{v||null==x.return||x.return()}finally{if(m)throw g}}u.push(d)}}catch(t){c=!0,f=t}finally{try{l||null==p.return||p.return()}finally{if(c)throw f}}return u}},{key:"toGeoJSON",value:function(t,e,n){return s.call(this,t,e,n)}}]),t}(),c=function(){function t(e){r(this,t),this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=u,this.length=e.length,this._features=e}return o(t,[{key:"feature",value:function(t){return new l(this._features[t])}}]),t}();t.exports=c},function(t,e,n){var r=n(32),i=n(172);function o(t){var e=new r;return function(t,e){for(var n in t.layers)e.writeMessage(3,a,t.layers[n])}(t,e),e.finish()}function a(t,e){var n;e.writeVarintField(15,t.version||1),e.writeStringField(1,t.name||""),e.writeVarintField(5,t.extent||4096);var r={keys:[],values:[],keycache:{},valuecache:{}};for(n=0;n<t.length;n++)r.feature=t.feature(n),e.writeMessage(2,s,r);var i=r.keys;for(n=0;n<i.length;n++)e.writeStringField(3,i[n]);var o=r.values;for(n=0;n<o.length;n++)e.writeMessage(4,h,o[n])}function s(t,e){var n=t.feature;void 0!==n.id&&e.writeVarintField(1,n.id),e.writeMessage(2,u,t),e.writeVarintField(3,n.type),e.writeMessage(4,f,n)}function u(t,e){var n=t.feature,r=t.keys,i=t.values,o=t.keycache,a=t.valuecache;for(var s in n.properties){var u=o[s];void 0===u&&(r.push(s),u=r.length-1,o[s]=u),e.writeVarint(u);var l=n.properties[s],c=typeof l;"string"!==c&&"boolean"!==c&&"number"!==c&&(l=JSON.stringify(l));var f=c+":"+l,h=a[f];void 0===h&&(i.push(l),h=i.length-1,a[f]=h),e.writeVarint(h)}}function l(t,e){return(e<<3)+(7&t)}function c(t){return t<<1^t>>31}function f(t,e){for(var n=t.loadGeometry(),r=t.type,i=0,o=0,a=n.length,s=0;s<a;s++){var u=n[s],f=1;1===r&&(f=u.length),e.writeVarint(l(1,f));for(var h=3===r?u.length-1:u.length,p=0;p<h;p++){1===p&&1!==r&&e.writeVarint(l(2,h-1));var y=u[p].x-i,d=u[p].y-o;e.writeVarint(c(y)),e.writeVarint(c(d)),i+=y,o+=d}3===r&&e.writeVarint(l(7,1))}}function h(t,e){var n=typeof t;"string"===n?e.writeStringField(1,t):"boolean"===n?e.writeBooleanField(7,t):"number"===n&&(t%1!=0?e.writeDoubleField(3,t):t<0?e.writeSVarintField(6,t):e.writeVarintField(5,t))}t.exports=o,t.exports.fromVectorTileJs=o,t.exports.fromGeojsonVt=function(t,e){e=e||{};var n={};for(var r in t)n[r]=new i(t[r].features,e),n[r].name=r,n[r].version=e.version,n[r].extent=e.extent;return o({layers:n})},t.exports.GeoJSONWrapper=i},function(t,e,n){"use strict";var r=n(6),i=n(21).VectorTileFeature;function o(t,e){this.options=e||{},this.features=t,this.length=t.length}function a(t,e){this.id="number"==typeof t.id?t.id:void 0,this.type=t.type,this.rawGeometry=1===t.type?[t.geometry]:t.geometry,this.properties=t.tags,this.extent=e||4096}t.exports=o,o.prototype.feature=function(t){return new a(this.features[t],this.options.extent)},a.prototype.loadGeometry=function(){var t=this.rawGeometry;this.geometry=[];for(var e=0;e<t.length;e++){for(var n=t[e],i=[],o=0;o<n.length;o++)i.push(new r(n[o][0],n[o][1]));this.geometry.push(i)}return this.geometry},a.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var t=this.geometry,e=1/0,n=-1/0,r=1/0,i=-1/0,o=0;o<t.length;o++)for(var a=t[o],s=0;s<a.length;s++){var u=a[s];e=Math.min(e,u.x),n=Math.max(n,u.x),r=Math.min(r,u.y),i=Math.max(i,u.y)}return[e,r,n,i]},a.prototype.toGeoJSON=i.prototype.toGeoJSON},function(t,e,n){"use strict";var r=n(174);function i(t){this.options=f(Object.create(this.options),t),this.trees=new Array(this.options.maxZoom+1)}function o(t,e,n,r,i){return{x:t,y:e,zoom:1/0,id:r,properties:i,parentId:-1,numPoints:n}}function a(t,e){var n=t.geometry.coordinates;return{x:l(n[0]),y:c(n[1]),zoom:1/0,id:e,parentId:-1}}function s(t){return{type:"Feature",properties:u(t),geometry:{type:"Point",coordinates:[(r=t.x,360*(r-.5)),(e=t.y,n=(180-360*e)*Math.PI/180,360*Math.atan(Math.exp(n))/Math.PI-90)]}};var e,n,r}function u(t){var e=t.numPoints,n=e>=1e4?Math.round(e/1e3)+"k":e>=1e3?Math.round(e/100)/10+"k":e;return f(f({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:n})}function l(t){return t/360+.5}function c(t){var e=Math.sin(t*Math.PI/180),n=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return n<0?0:n>1?1:n}function f(t,e){for(var n in e)t[n]=e[n];return t}function h(t){return t.x}function p(t){return t.y}t.exports=function(t){return new i(t)},i.prototype={options:{minZoom:0,maxZoom:16,radius:40,extent:512,nodeSize:64,log:!1,reduce:null,initial:function(){return{}},map:function(t){return t}},load:function(t){var e=this.options.log;e&&console.time("total time");var n="prepare "+t.length+" points";e&&console.time(n),this.points=t;var i=t.map(a);e&&console.timeEnd(n);for(var o=this.options.maxZoom;o>=this.options.minZoom;o--){var s=+Date.now();this.trees[o+1]=r(i,h,p,this.options.nodeSize,Float32Array),i=this._cluster(i,o),e&&console.log("z%d: %d clusters in %dms",o,i.length,+Date.now()-s)}return this.trees[this.options.minZoom]=r(i,h,p,this.options.nodeSize,Float32Array),e&&console.timeEnd("total time"),this},getClusters:function(t,e){for(var n=this.trees[this._limitZoom(e)],r=n.range(l(t[0]),c(t[3]),l(t[2]),c(t[1])),i=[],o=0;o<r.length;o++){var a=n.points[r[o]];i.push(a.numPoints?s(a):this.points[a.id])}return i},getChildren:function(t,e){for(var n=this.trees[e+1].points[t],r=this.options.radius/(this.options.extent*Math.pow(2,e)),i=this.trees[e+1].within(n.x,n.y,r),o=[],a=0;a<i.length;a++){var u=this.trees[e+1].points[i[a]];u.parentId===t&&o.push(u.numPoints?s(u):this.points[u.id])}return o},getLeaves:function(t,e,n,r){n=n||10,r=r||0;var i=[];return this._appendLeaves(i,t,e,n,r,0),i},getTile:function(t,e,n){var r=this.trees[this._limitZoom(t)],i=Math.pow(2,t),o=this.options.extent,a=this.options.radius/o,s=(n-a)/i,u=(n+1+a)/i,l={features:[]};return this._addTileFeatures(r.range((e-a)/i,s,(e+1+a)/i,u),r.points,e,n,i,l),0===e&&this._addTileFeatures(r.range(1-a/i,s,1,u),r.points,i,n,i,l),e===i-1&&this._addTileFeatures(r.range(0,s,a/i,u),r.points,-1,n,i,l),l.features.length?l:null},getClusterExpansionZoom:function(t,e){for(;e<this.options.maxZoom;){var n=this.getChildren(t,e);if(e++,1!==n.length)break;t=n[0].properties.cluster_id}return e},_appendLeaves:function(t,e,n,r,i,o){for(var a=this.getChildren(e,n),s=0;s<a.length;s++){var u=a[s].properties;if(u.cluster?o+u.point_count<=i?o+=u.point_count:o=this._appendLeaves(t,u.cluster_id,n+1,r,i,o):o<i?o++:t.push(a[s]),t.length===r)break}return o},_addTileFeatures:function(t,e,n,r,i,o){for(var a=0;a<t.length;a++){var s=e[t[a]];o.features.push({type:1,geometry:[[Math.round(this.options.extent*(s.x*i-n)),Math.round(this.options.extent*(s.y*i-r))]],tags:s.numPoints?u(s):this.points[s.id].properties})}},_limitZoom:function(t){return Math.max(this.options.minZoom,Math.min(t,this.options.maxZoom+1))},_cluster:function(t,e){for(var n=[],r=this.options.radius/(this.options.extent*Math.pow(2,e)),i=0;i<t.length;i++){var a=t[i];if(!(a.zoom<=e)){a.zoom=e;var s=this.trees[e+1],u=s.within(a.x,a.y,r),l=a.numPoints||1,c=a.x*l,f=a.y*l,h=null;this.options.reduce&&(h=this.options.initial(),this._accumulate(h,a));for(var p=0;p<u.length;p++){var y=s.points[u[p]];if(e<y.zoom){var d=y.numPoints||1;y.zoom=e,c+=y.x*d,f+=y.y*d,l+=d,y.parentId=i,this.options.reduce&&this._accumulate(h,y)}}1===l?n.push(a):(a.parentId=i,n.push(o(c/l,f/l,l,i,h)))}}return n},_accumulate:function(t,e){var n=e.numPoints?e.properties:this.options.map(this.points[e.id].properties);this.options.reduce(t,n)}}},function(t,e,n){"use strict";var r=n(175),i=n(176),o=n(177);function a(t,e,n,i,o){e=e||s,n=n||u,o=o||Array,this.nodeSize=i||64,this.points=t,this.ids=new o(t.length),this.coords=new o(2*t.length);for(var a=0;a<t.length;a++)this.ids[a]=a,this.coords[2*a]=e(t[a]),this.coords[2*a+1]=n(t[a]);r(this.ids,this.coords,this.nodeSize,0,this.ids.length-1,0)}function s(t){return t[0]}function u(t){return t[1]}t.exports=function(t,e,n,r,i){return new a(t,e,n,r,i)},a.prototype={range:function(t,e,n,r){return i(this.ids,this.coords,t,e,n,r,this.nodeSize)},within:function(t,e,n){return o(this.ids,this.coords,t,e,n,this.nodeSize)}}},function(t,e,n){"use strict";function r(t,e,n,r){i(t,n,r),i(e,2*n,2*r),i(e,2*n+1,2*r+1)}function i(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}t.exports=function t(e,n,i,o,a,s){if(a-o<=i)return;var u=Math.floor((o+a)/2);!function t(e,n,i,o,a,s){for(;a>o;){if(a-o>600){var u=a-o+1,l=i-o+1,c=Math.log(u),f=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*f*(u-f)/u)*(l-u/2<0?-1:1),p=Math.max(o,Math.floor(i-l*f/u+h)),y=Math.min(a,Math.floor(i+(u-l)*f/u+h));t(e,n,i,p,y,s)}var d=n[2*i+s],v=o,m=a;for(r(e,n,o,i),n[2*a+s]>d&&r(e,n,o,a);v<m;){for(r(e,n,v,m),v++,m--;n[2*v+s]<d;)v++;for(;n[2*m+s]>d;)m--}n[2*o+s]===d?r(e,n,o,m):r(e,n,++m,a),m<=i&&(o=m+1),i<=m&&(a=m-1)}}(e,n,u,o,a,s%2);t(e,n,i,o,u-1,s+1);t(e,n,i,u+1,a,s+1)}},function(t,e,n){"use strict";t.exports=function(t,e,n,r,i,o,a){var s,u,l=[0,t.length-1,0],c=[];for(;l.length;){var f=l.pop(),h=l.pop(),p=l.pop();if(h-p<=a)for(var y=p;y<=h;y++)s=e[2*y],u=e[2*y+1],s>=n&&s<=i&&u>=r&&u<=o&&c.push(t[y]);else{var d=Math.floor((p+h)/2);s=e[2*d],u=e[2*d+1],s>=n&&s<=i&&u>=r&&u<=o&&c.push(t[d]);var v=(f+1)%2;(0===f?n<=s:r<=u)&&(l.push(p),l.push(d-1),l.push(v)),(0===f?i>=s:o>=u)&&(l.push(d+1),l.push(h),l.push(v))}}return c}},function(t,e,n){"use strict";function r(t,e,n,r){var i=t-n,o=e-r;return i*i+o*o}t.exports=function(t,e,n,i,o,a){var s=[0,t.length-1,0],u=[],l=o*o;for(;s.length;){var c=s.pop(),f=s.pop(),h=s.pop();if(f-h<=a)for(var p=h;p<=f;p++)r(e[2*p],e[2*p+1],n,i)<=l&&u.push(t[p]);else{var y=Math.floor((h+f)/2),d=e[2*y],v=e[2*y+1];r(d,v,n,i)<=l&&u.push(t[y]);var m=(c+1)%2;(0===c?n-o<=d:i-o<=v)&&(s.push(h),s.push(y-1),s.push(m)),(0===c?n+o>=d:i+o>=v)&&(s.push(y+1),s.push(f),s.push(m))}}return u}},function(t,e,n){"use strict";function r(t,e,n,r,i,o){var a=i-n,s=o-r;if(0!==a||0!==s){var u=((t-n)*a+(e-r)*s)/(a*a+s*s);u>1?(n=i,r=o):u>0&&(n+=a*u,r+=s*u)}return(a=t-n)*a+(s=e-r)*s}function i(t,e,n,r){var i={id:void 0===t?null:t,type:e,geometry:n,tags:r,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(t){var e=t.geometry,n=t.type;if("Point"===n||"MultiPoint"===n||"LineString"===n)o(t,e);else if("Polygon"===n||"MultiLineString"===n)for(var r=0;r<e.length;r++)o(t,e[r]);else if("MultiPolygon"===n)for(r=0;r<e.length;r++)for(var i=0;i<e[r].length;i++)o(t,e[r][i])}(i),i}function o(t,e){for(var n=0;n<e.length;n+=3)t.minX=Math.min(t.minX,e[n]),t.minY=Math.min(t.minY,e[n+1]),t.maxX=Math.max(t.maxX,e[n]),t.maxY=Math.max(t.maxY,e[n+1])}function a(t,e,n,r){if(e.geometry){var o=e.geometry.coordinates,c=e.geometry.type,f=Math.pow(n.tolerance/((1<<n.maxZoom)*n.extent),2),h=[],p=e.id;if(n.promoteId?p=e.properties[n.promoteId]:n.generateId&&(p=r||0),"Point"===c)s(o,h);else if("MultiPoint"===c)for(var y=0;y<o.length;y++)s(o[y],h);else if("LineString"===c)u(o,h,f,!1);else if("MultiLineString"===c){if(n.lineMetrics){for(y=0;y<o.length;y++)h=[],u(o[y],h,f,!1),t.push(i(p,"LineString",h,e.properties));return}l(o,h,f,!1)}else if("Polygon"===c)l(o,h,f,!0);else{if("MultiPolygon"!==c){if("GeometryCollection"===c){for(y=0;y<e.geometry.geometries.length;y++)a(t,{id:p,geometry:e.geometry.geometries[y],properties:e.properties},n,r);return}throw new Error("Input data is not a valid GeoJSON object.")}for(y=0;y<o.length;y++){var d=[];l(o[y],d,f,!0),h.push(d)}}t.push(i(p,c,h,e.properties))}}function s(t,e){e.push(c(t[0])),e.push(f(t[1])),e.push(0)}function u(t,e,n,i){for(var o,a,s=0,u=0;u<t.length;u++){var l=c(t[u][0]),h=f(t[u][1]);e.push(l),e.push(h),e.push(0),u>0&&(s+=i?(o*h-l*a)/2:Math.sqrt(Math.pow(l-o,2)+Math.pow(h-a,2))),o=l,a=h}var p=e.length-3;e[2]=1,function t(e,n,i,o){for(var a,s=o,u=i-n>>1,l=i-n,c=e[n],f=e[n+1],h=e[i],p=e[i+1],y=n+3;y<i;y+=3){var d=r(e[y],e[y+1],c,f,h,p);if(d>s)a=y,s=d;else if(d===s){var v=Math.abs(y-u);v<l&&(a=y,l=v)}}s>o&&(a-n>3&&t(e,n,a,o),e[a+2]=s,i-a>3&&t(e,a,i,o))}(e,0,p,n),e[p+2]=1,e.size=Math.abs(s),e.start=0,e.end=e.size}function l(t,e,n,r){for(var i=0;i<t.length;i++){var o=[];u(t[i],o,n,r),e.push(o)}}function c(t){return t/360+.5}function f(t){var e=Math.sin(t*Math.PI/180),n=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return n<0?0:n>1?1:n}function h(t,e,n,r,o,a,s,u){if(r/=e,a>=(n/=e)&&s<r)return t;if(s<n||a>=r)return null;for(var l=[],c=0;c<t.length;c++){var f=t[c],h=f.geometry,d=f.type,m=0===o?f.minX:f.minY,g=0===o?f.maxX:f.maxY;if(m>=n&&g<r)l.push(f);else if(!(g<n||m>=r)){var b=[];if("Point"===d||"MultiPoint"===d)p(h,b,n,r,o);else if("LineString"===d)y(h,b,n,r,o,!1,u.lineMetrics);else if("MultiLineString"===d)v(h,b,n,r,o,!1);else if("Polygon"===d)v(h,b,n,r,o,!0);else if("MultiPolygon"===d)for(var x=0;x<h.length;x++){var w=[];v(h[x],w,n,r,o,!0),w.length&&b.push(w)}if(b.length){if(u.lineMetrics&&"LineString"===d){for(x=0;x<b.length;x++)l.push(i(f.id,d,b[x],f.tags));continue}"LineString"!==d&&"MultiLineString"!==d||(1===b.length?(d="LineString",b=b[0]):d="MultiLineString"),"Point"!==d&&"MultiPoint"!==d||(d=3===b.length?"Point":"MultiPoint"),l.push(i(f.id,d,b,f.tags))}}}return l.length?l:null}function p(t,e,n,r,i){for(var o=0;o<t.length;o+=3){var a=t[o+i];a>=n&&a<=r&&(e.push(t[o]),e.push(t[o+1]),e.push(t[o+2]))}}function y(t,e,n,r,i,o,a){for(var s,u,l=d(t),c=0===i?g:b,f=t.start,h=0;h<t.length-3;h+=3){var p=t[h],y=t[h+1],v=t[h+2],x=t[h+3],w=t[h+4],k=0===i?p:y,_=0===i?x:w,S=!1;a&&(s=Math.sqrt(Math.pow(p-x,2)+Math.pow(y-w,2))),k<n?_>n&&(u=c(l,p,y,x,w,n),a&&(l.start=f+s*u)):k>r?_<r&&(u=c(l,p,y,x,w,r),a&&(l.start=f+s*u)):m(l,p,y,v),_<n&&k>=n&&(u=c(l,p,y,x,w,n),S=!0),_>r&&k<=r&&(u=c(l,p,y,x,w,r),S=!0),!o&&S&&(a&&(l.end=f+s*u),e.push(l),l=d(t)),a&&(f+=s)}var A=t.length-3;p=t[A],y=t[A+1],v=t[A+2],(k=0===i?p:y)>=n&&k<=r&&m(l,p,y,v),A=l.length-3,o&&A>=3&&(l[A]!==l[0]||l[A+1]!==l[1])&&m(l,l[0],l[1],l[2]),l.length&&e.push(l)}function d(t){var e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function v(t,e,n,r,i,o){for(var a=0;a<t.length;a++)y(t[a],e,n,r,i,o,!1)}function m(t,e,n,r){t.push(e),t.push(n),t.push(r)}function g(t,e,n,r,i,o){var a=(o-e)/(r-e);return t.push(o),t.push(n+(i-n)*a),t.push(1),a}function b(t,e,n,r,i,o){var a=(o-n)/(i-n);return t.push(e+(r-e)*a),t.push(o),t.push(1),a}function x(t,e){for(var n=[],r=0;r<t.length;r++){var o,a=t[r],s=a.type;if("Point"===s||"MultiPoint"===s||"LineString"===s)o=w(a.geometry,e);else if("MultiLineString"===s||"Polygon"===s){o=[];for(var u=0;u<a.geometry.length;u++)o.push(w(a.geometry[u],e))}else if("MultiPolygon"===s)for(o=[],u=0;u<a.geometry.length;u++){for(var l=[],c=0;c<a.geometry[u].length;c++)l.push(w(a.geometry[u][c],e));o.push(l)}n.push(i(a.id,s,o,a.tags))}return n}function w(t,e){var n=[];n.size=t.size,void 0!==t.start&&(n.start=t.start,n.end=t.end);for(var r=0;r<t.length;r+=3)n.push(t[r]+e,t[r+1],t[r+2]);return n}function k(t,e){if(t.transformed)return t;var n,r,i,o=1<<t.z,a=t.x,s=t.y;for(n=0;n<t.features.length;n++){var u=t.features[n],l=u.geometry,c=u.type;if(u.geometry=[],1===c)for(r=0;r<l.length;r+=2)u.geometry.push(_(l[r],l[r+1],e,o,a,s));else for(r=0;r<l.length;r++){var f=[];for(i=0;i<l[r].length;i+=2)f.push(_(l[r][i],l[r][i+1],e,o,a,s));u.geometry.push(f)}}return t.transformed=!0,t}function _(t,e,n,r,i,o){return[Math.round(n*(t*r-i)),Math.round(n*(e*r-o))]}function S(t,e,n,r,i){for(var o=e===i.maxZoom?0:i.tolerance/((1<<e)*i.extent),a={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:n,y:r,z:e,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},s=0;s<t.length;s++){a.numFeatures++,A(a,t[s],o,i);var u=t[s].minX,l=t[s].minY,c=t[s].maxX,f=t[s].maxY;u<a.minX&&(a.minX=u),l<a.minY&&(a.minY=l),c>a.maxX&&(a.maxX=c),f>a.maxY&&(a.maxY=f)}return a}function A(t,e,n,r){var i=e.geometry,o=e.type,a=[];if("Point"===o||"MultiPoint"===o)for(var s=0;s<i.length;s+=3)a.push(i[s]),a.push(i[s+1]),t.numPoints++,t.numSimplified++;else if("LineString"===o)T(a,i,t,n,!1,!1);else if("MultiLineString"===o||"Polygon"===o)for(s=0;s<i.length;s++)T(a,i[s],t,n,"Polygon"===o,0===s);else if("MultiPolygon"===o)for(var u=0;u<i.length;u++){var l=i[u];for(s=0;s<l.length;s++)T(a,l[s],t,n,!0,0===s)}if(a.length){var c=e.tags||null;if("LineString"===o&&r.lineMetrics){for(var f in c={},e.tags)c[f]=e.tags[f];c.mapbox_clip_start=i.start/i.size,c.mapbox_clip_end=i.end/i.size}var h={geometry:a,type:"Polygon"===o||"MultiPolygon"===o?3:"LineString"===o||"MultiLineString"===o?2:1,tags:c};null!==e.id&&(h.id=e.id),t.features.push(h)}}function T(t,e,n,r,i,o){var a=r*r;if(r>0&&e.size<(i?a:r))n.numPoints+=e.length/3;else{for(var s=[],u=0;u<e.length;u+=3)(0===r||e[u+2]>a)&&(n.numSimplified++,s.push(e[u]),s.push(e[u+1])),n.numPoints++;i&&function(t,e){for(var n=0,r=0,i=t.length,o=i-2;r<i;o=r,r+=2)n+=(t[r]-t[o])*(t[r+1]+t[o+1]);if(n>0===e)for(r=0,i=t.length;r<i/2;r+=2){var a=t[r],s=t[r+1];t[r]=t[i-2-r],t[r+1]=t[i-1-r],t[i-2-r]=a,t[i-1-r]=s}}(s,o),t.push(s)}}function j(t,e){return new O(t,e)}function O(t,e){var n=(e=this.options=function(t,e){for(var n in e)t[n]=e[n];return t}(Object.create(this.options),e)).debug;if(n&&console.time("preprocess data"),e.maxZoom<0||e.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(e.promoteId&&e.generateId)throw new Error("promoteId and generateId cannot be used together.");var r=function(t,e){var n=[];if("FeatureCollection"===t.type)for(var r=0;r<t.features.length;r++)a(n,t.features[r],e,r);else"Feature"===t.type?a(n,t,e):a(n,{geometry:t},e);return n}(t,e);this.tiles={},this.tileCoords=[],n&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",e.indexMaxZoom,e.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),(r=function(t,e){var n=e.buffer/e.extent,r=t,i=h(t,1,-1-n,n,0,-1,2,e),o=h(t,1,1-n,2+n,0,-1,2,e);return(i||o)&&(r=h(t,1,-n,1+n,0,-1,2,e)||[],i&&(r=x(i,1).concat(r)),o&&(r=r.concat(x(o,-1)))),r}(r,e)).length&&this.splitTile(r,0,0,0),n&&(r.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}function z(t,e,n){return 32*((1<<t)*n+e)+t}n.r(e),n.d(e,"default",function(){return j}),O.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},O.prototype.splitTile=function(t,e,n,r,i,o,a){for(var s=[t,e,n,r],u=this.options,l=u.debug;s.length;){r=s.pop(),n=s.pop(),e=s.pop(),t=s.pop();var c=1<<e,f=z(e,n,r),p=this.tiles[f];if(!p&&(l>1&&console.time("creation"),p=this.tiles[f]=S(t,e,n,r,u),this.tileCoords.push({z:e,x:n,y:r}),l)){l>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,n,r,p.numFeatures,p.numPoints,p.numSimplified),console.timeEnd("creation"));var y="z"+e;this.stats[y]=(this.stats[y]||0)+1,this.total++}if(p.source=t,i){if(e===u.maxZoom||e===i)continue;var d=1<<i-e;if(n!==Math.floor(o/d)||r!==Math.floor(a/d))continue}else if(e===u.indexMaxZoom||p.numPoints<=u.indexMaxPoints)continue;if(p.source=null,0!==t.length){l>1&&console.time("clipping");var v,m,g,b,x,w,k=.5*u.buffer/u.extent,_=.5-k,A=.5+k,T=1+k;v=m=g=b=null,x=h(t,c,n-k,n+A,0,p.minX,p.maxX,u),w=h(t,c,n+_,n+T,0,p.minX,p.maxX,u),t=null,x&&(v=h(x,c,r-k,r+A,1,p.minY,p.maxY,u),m=h(x,c,r+_,r+T,1,p.minY,p.maxY,u),x=null),w&&(g=h(w,c,r-k,r+A,1,p.minY,p.maxY,u),b=h(w,c,r+_,r+T,1,p.minY,p.maxY,u),w=null),l>1&&console.timeEnd("clipping"),s.push(v||[],e+1,2*n,2*r),s.push(m||[],e+1,2*n,2*r+1),s.push(g||[],e+1,2*n+1,2*r),s.push(b||[],e+1,2*n+1,2*r+1)}}},O.prototype.getTile=function(t,e,n){var r=this.options,i=r.extent,o=r.debug;if(t<0||t>24)return null;var a=1<<t,s=z(t,e=(e%a+a)%a,n);if(this.tiles[s])return k(this.tiles[s],i);o>1&&console.log("drilling down to z%d-%d-%d",t,e,n);for(var u,l=t,c=e,f=n;!u&&l>0;)l--,c=Math.floor(c/2),f=Math.floor(f/2),u=this.tiles[z(l,c,f)];return u&&u.source?(o>1&&console.log("found parent tile z%d-%d-%d",l,c,f),o>1&&console.time("drilling down"),this.splitTile(u.source,l,c,f,t,e,n),o>1&&console.timeEnd("drilling down"),this.tiles[s]?k(this.tiles[s],i):null):null}}]);\n//# sourceMappingURL=eab846b0e6e207bc59f3.worker.js.map',null)}},function(e,t,i){var r=window.URL||window.webkitURL;e.exports=function(e,t){try{try{var i;try{(i=new(window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder)).append(e),i=i.getBlob()}catch(t){i=new Blob([e])}return new Worker(r.createObjectURL(i))}catch(t){return new Worker("data:application/javascript,"+encodeURIComponent(e))}}catch(e){if(!t)throw Error("Inline worker is not supported");return new Worker(t)}}},function(e,t,i){var n=i(215);function a(e,t){var i={};for(var r in e)"ref"!==r&&(i[r]=e[r]);return n.forEach(function(e){e in t&&(i[e]=t[e])}),i}e.exports=function(e){e=e.slice();for(var t=Object.create(null),i=0;i<e.length;i++)t[e[i].id]=e[i];for(var r=0;r<e.length;r++)"ref"in e[r]&&(e[r]=a(e[r],t[e[r].ref]));return e}},function(e,t){e.exports=["type","source","source-layer","minzoom","maxzoom","filter","layout"]},function(e,t,i){var g=i(74),y={setStyle:"setStyle",addLayer:"addLayer",removeLayer:"removeLayer",setPaintProperty:"setPaintProperty",setLayoutProperty:"setLayoutProperty",setFilter:"setFilter",addSource:"addSource",removeSource:"removeSource",setGeoJSONSourceData:"setGeoJSONSourceData",setLayerZoomRange:"setLayerZoomRange",setLayerProperty:"setLayerProperty",setCenter:"setCenter",setZoom:"setZoom",setBearing:"setBearing",setPitch:"setPitch",setSprite:"setSprite",setGlyphs:"setGlyphs",setTransition:"setTransition",setLight:"setLight"};function l(e,t,i){i.push({command:y.addSource,args:[e,t[e]]})}function u(e,t,i){t.push({command:y.removeSource,args:[e]}),i[e]=!0}function c(e,t,i){var r;for(r in e[i])if(e[i].hasOwnProperty(r)&&"data"!==r&&!g(e[i][r],t[i][r]))return!1;for(r in t[i])if(t[i].hasOwnProperty(r)&&"data"!==r&&!g(e[i][r],t[i][r]))return!1;return!0}function v(e,t,i,r,n,a){var o;for(o in t=t||{},e=e||{})e.hasOwnProperty(o)&&(g(e[o],t[o])||i.push({command:a,args:[r,o,t[o],n]}));for(o in t)t.hasOwnProperty(o)&&!e.hasOwnProperty(o)&&(g(e[o],t[o])||i.push({command:a,args:[r,o,t[o],n]}))}function _(e){return e.id}function C(e,t){return e[t.id]=t,e}e.exports=function(e,t){if(!e)return[{command:y.setStyle,args:[t]}];var i=[];try{if(!g(e.version,t.version))return[{command:y.setStyle,args:[t]}];g(e.center,t.center)||i.push({command:y.setCenter,args:[t.center]}),g(e.zoom,t.zoom)||i.push({command:y.setZoom,args:[t.zoom]}),g(e.bearing,t.bearing)||i.push({command:y.setBearing,args:[t.bearing]}),g(e.pitch,t.pitch)||i.push({command:y.setPitch,args:[t.pitch]}),g(e.sprite,t.sprite)||i.push({command:y.setSprite,args:[t.sprite]}),g(e.glyphs,t.glyphs)||i.push({command:y.setGlyphs,args:[t.glyphs]}),g(e.transition,t.transition)||i.push({command:y.setTransition,args:[t.transition]}),g(e.light,t.light)||i.push({command:y.setLight,args:[t.light]});var r={},n=[];!function(e,t,i,r){var n,a,o,s;for(n in t=t||{},e=e||{})e.hasOwnProperty(n)&&(t.hasOwnProperty(n)||u(n,i,r));for(n in t)t.hasOwnProperty(n)&&(e.hasOwnProperty(n)?g(e[n],t[n])||("geojson"===e[n].type&&"geojson"===t[n].type&&c(e,t,n)?i.push({command:y.setGeoJSONSourceData,args:[n,t[n].data]}):(o=t,u(a=n,s=i,r),l(a,o,s))):l(n,t,i))}(e.sources,t.sources,n,r);var a=[];e.layers&&e.layers.forEach(function(e){r[e.source]?i.push({command:y.removeLayer,args:[e.id]}):a.push(e)}),i=i.concat(n),function(e,t,i){t=t||[];var r,n,a,o,s,l,u,c=(e=e||[]).map(_),d=t.map(_),h=e.reduce(C,{}),p=t.reduce(C,{}),f=c.slice(),m=Object.create(null);for(n=r=0;r<c.length;r++)a=c[r],p.hasOwnProperty(a)?n++:(i.push({command:y.removeLayer,args:[a]}),f.splice(f.indexOf(a,n),1));for(n=r=0;r<d.length;r++)a=d[d.length-1-r],f[f.length-1-r]!==a&&(h.hasOwnProperty(a)?(i.push({command:y.removeLayer,args:[a]}),f.splice(f.lastIndexOf(a,f.length-n),1)):n++,l=f[f.length-r],i.push({command:y.addLayer,args:[p[a],l]}),f.splice(f.length-r,0,a),m[a]=!0);for(r=0;r<d.length;r++)if(o=h[a=d[r]],s=p[a],!m[a]&&!g(o,s))if(g(o.source,s.source)&&g(o["source-layer"],s["source-layer"])&&g(o.type,s.type)){for(u in v(o.layout,s.layout,i,a,null,y.setLayoutProperty),v(o.paint,s.paint,i,a,null,y.setPaintProperty),g(o.filter,s.filter)||i.push({command:y.setFilter,args:[a,s.filter]}),g(o.minzoom,s.minzoom)&&g(o.maxzoom,s.maxzoom)||i.push({command:y.setLayerZoomRange,args:[a,s.minzoom,s.maxzoom]}),o)o.hasOwnProperty(u)&&"layout"!==u&&"paint"!==u&&"filter"!==u&&"metadata"!==u&&"minzoom"!==u&&"maxzoom"!==u&&(0===u.indexOf("paint.")?v(o[u],s[u],i,a,u.slice(6),y.setPaintProperty):g(o[u],s[u])||i.push({command:y.setLayerProperty,args:[a,u,s[u]]}));for(u in s)s.hasOwnProperty(u)&&!o.hasOwnProperty(u)&&"layout"!==u&&"paint"!==u&&"filter"!==u&&"metadata"!==u&&"minzoom"!==u&&"maxzoom"!==u&&(0===u.indexOf("paint.")?v(o[u],s[u],i,a,u.slice(6),y.setPaintProperty):g(o[u],s[u])||i.push({command:y.setLayerProperty,args:[a,u,s[u]]}))}else i.push({command:y.removeLayer,args:[a]}),l=f[f.lastIndexOf(a)+1],i.push({command:y.addLayer,args:[s,l]})}(a,t.layers,i)}catch(e){console.warn("Unable to compute style diff:",e),i=[{command:y.setStyle,args:[t]}]}return i},e.exports.operations=y},function(e,t,i){function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function n(e,t,i){return t&&r(e.prototype,t),i&&r(e,i),e}var l=i(2),o=i(69),u=(n(d,[{key:"continuePlacement",value:function(e,t,i,r,n){for(;this._currentTileIndex<e.length;){var a=e[this._currentTileIndex];if(t.placeLayerTile(r,a,i,this._seenCrossTileIDs),this._currentTileIndex++,n())return!0}}}]),d),s=(n(c,[{key:"isDone",value:function(){return this._done}},{key:"continuePlacement",value:function(e,t,i){for(var r=this,n=l.now(),a=function(){var e=l.now()-n;return!r._forceFullPlacement&&2<e};0<=this._currentPlacementIndex;){var o=t[e[this._currentPlacementIndex]],s=this.placement.collisionIndex.transform.zoom;if("symbol"===o.type&&(!o.minzoom||o.minzoom<=s)&&(!o.maxzoom||o.maxzoom>s)){if(this._inProgressLayer||(this._inProgressLayer=new u),this._inProgressLayer.continuePlacement(i[o.source],this.placement,this._showCollisionBoxes,o,a))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}}]),c);function c(e,t,i,r,n){a(this,c),this.placement=new o(e,n),this._currentPlacementIndex=t.length-1,this._forceFullPlacement=i,this._showCollisionBoxes=r,this._done=!1}function d(){a(this,d),this._currentTileIndex=0,this._seenCrossTileIDs={}}e.exports=s},function(e,t){e.exports="#ifdef GL_ES\nprecision mediump float;\n#else\n\n#if !defined(lowp)\n#define lowp\n#endif\n\n#if !defined(mediump)\n#define mediump\n#endif\n\n#if !defined(highp)\n#define highp\n#endif\n\n#endif\n"},function(e,t){e.exports="#ifdef GL_ES\nprecision highp float;\n#else\n\n#if !defined(lowp)\n#define lowp\n#endif\n\n#if !defined(mediump)\n#define mediump\n#endif\n\n#if !defined(highp)\n#define highp\n#endif\n\n#endif\n\n// Unpack a pair of values that have been packed into a single float.\n// The packed values are assumed to be 8-bit unsigned integers, and are\n// packed like so:\n// packedValue = floor(input[0]) * 256 + input[1],\nvec2 unpack_float(const float packedValue) {\n int packedIntValue = int(packedValue);\n int v0 = packedIntValue / 256;\n return vec2(v0, packedIntValue - v0 * 256);\n}\n\nvec2 unpack_opacity(const float packedOpacity) {\n int intOpacity = int(packedOpacity) / 2;\n return vec2(float(intOpacity) / 127.0, mod(packedOpacity, 2.0));\n}\n\n// To minimize the number of attributes needed, we encode a 4-component\n// color into a pair of floats (i.e. a vec2) as follows:\n// [ floor(color.r * 255) * 256 + color.g * 255,\n// floor(color.b * 255) * 256 + color.g * 255 ]\nvec4 decode_color(const vec2 encodedColor) {\n return vec4(\n unpack_float(encodedColor[0]) / 255.0,\n unpack_float(encodedColor[1]) / 255.0\n );\n}\n\n// Unpack a pair of paint values and interpolate between them.\nfloat unpack_mix_vec2(const vec2 packedValue, const float t) {\n return mix(packedValue[0], packedValue[1], t);\n}\n\n// Unpack a pair of paint values and interpolate between them.\nvec4 unpack_mix_vec4(const vec4 packedColors, const float t) {\n vec4 minColor = decode_color(vec2(packedColors[0], packedColors[1]));\n vec4 maxColor = decode_color(vec2(packedColors[2], packedColors[3]));\n return mix(minColor, maxColor, t);\n}\n\n// The offset depends on how many pixels are between the world origin and the edge of the tile:\n// vec2 offset = mod(pixel_coord, size)\n//\n// At high zoom levels there are a ton of pixels between the world origin and the edge of the tile.\n// The glsl spec only guarantees 16 bits of precision for highp floats. We need more than that.\n//\n// The pixel_coord is passed in as two 16 bit values:\n// pixel_coord_upper = floor(pixel_coord / 2^16)\n// pixel_coord_lower = mod(pixel_coord, 2^16)\n//\n// The offset is calculated in a series of steps that should preserve this precision:\nvec2 get_pattern_pos(const vec2 pixel_coord_upper, const vec2 pixel_coord_lower,\n const vec2 pattern_size, const float tile_units_to_pixels, const vec2 pos) {\n\n vec2 offset = mod(mod(mod(pixel_coord_upper, pattern_size) * 256.0, pattern_size) * 256.0 + pixel_coord_lower, pattern_size);\n return (tile_units_to_pixels * pos + offset) / pattern_size;\n}\n"},function(e,t){e.exports="uniform vec4 u_color;\nuniform float u_opacity;\n\nvoid main() {\n gl_FragColor = u_color * u_opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n"},function(e,t){e.exports="attribute vec2 a_pos;\n\nuniform mat4 u_matrix;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n}\n"},function(e,t){e.exports="uniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform vec2 u_texsize;\nuniform float u_mix;\nuniform float u_opacity;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\n\nvoid main() {\n vec2 imagecoord = mod(v_pos_a, 1.0);\n vec2 pos = mix(u_pattern_tl_a / u_texsize, u_pattern_br_a / u_texsize, imagecoord);\n vec4 color1 = texture2D(u_image, pos);\n\n vec2 imagecoord_b = mod(v_pos_b, 1.0);\n vec2 pos2 = mix(u_pattern_tl_b / u_texsize, u_pattern_br_b / u_texsize, imagecoord_b);\n vec4 color2 = texture2D(u_image, pos2);\n\n gl_FragColor = mix(color1, color2, u_mix) * u_opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n"},function(e,t){e.exports="uniform mat4 u_matrix;\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pixel_coord_upper;\nuniform vec2 u_pixel_coord_lower;\nuniform float u_scale_a;\nuniform float u_scale_b;\nuniform float u_tile_units_to_pixels;\n\nattribute vec2 a_pos;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n\n v_pos_a = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_a * u_pattern_size_a, u_tile_units_to_pixels, a_pos);\n v_pos_b = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_b * u_pattern_size_b, u_tile_units_to_pixels, a_pos);\n}\n"},function(e,t){e.exports="#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\n\nvarying vec3 v_data;\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 color\n #pragma mapbox: initialize mediump float radius\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize highp vec4 stroke_color\n #pragma mapbox: initialize mediump float stroke_width\n #pragma mapbox: initialize lowp float stroke_opacity\n\n vec2 extrude = v_data.xy;\n float extrude_length = length(extrude);\n\n lowp float antialiasblur = v_data.z;\n float antialiased_blur = -max(blur, antialiasblur);\n\n float opacity_t = smoothstep(0.0, antialiased_blur, extrude_length - 1.0);\n\n float color_t = stroke_width < 0.01 ? 0.0 : smoothstep(\n antialiased_blur,\n 0.0,\n extrude_length - radius / (radius + stroke_width)\n );\n\n gl_FragColor = opacity_t * mix(color * opacity, stroke_color * stroke_opacity, color_t);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n"},function(e,t){e.exports="uniform mat4 u_matrix;\nuniform bool u_scale_with_map;\nuniform bool u_pitch_with_map;\nuniform vec2 u_extrude_scale;\nuniform highp float u_camera_to_center_distance;\n\nattribute vec2 a_pos;\n\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\n\nvarying vec3 v_data;\n\nvoid main(void) {\n #pragma mapbox: initialize highp vec4 color\n #pragma mapbox: initialize mediump float radius\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize highp vec4 stroke_color\n #pragma mapbox: initialize mediump float stroke_width\n #pragma mapbox: initialize lowp float stroke_opacity\n\n // unencode the extrusion vector that we snuck into the a_pos vector\n vec2 extrude = vec2(mod(a_pos, 2.0) * 2.0 - 1.0);\n\n // multiply a_pos by 0.5, since we had it * 2 in order to sneak\n // in extrusion data\n vec2 circle_center = floor(a_pos * 0.5);\n if (u_pitch_with_map) {\n vec2 corner_position = circle_center;\n if (u_scale_with_map) {\n corner_position += extrude * (radius + stroke_width) * u_extrude_scale;\n } else {\n // Pitching the circle with the map effectively scales it with the map\n // To counteract the effect for pitch-scale: viewport, we rescale the\n // whole circle based on the pitch scaling effect at its central point\n vec4 projected_center = u_matrix * vec4(circle_center, 0, 1);\n corner_position += extrude * (radius + stroke_width) * u_extrude_scale * (projected_center.w / u_camera_to_center_distance);\n }\n\n gl_Position = u_matrix * vec4(corner_position, 0, 1);\n } else {\n gl_Position = u_matrix * vec4(circle_center, 0, 1);\n\n if (u_scale_with_map) {\n gl_Position.xy += extrude * (radius + stroke_width) * u_extrude_scale * u_camera_to_center_distance;\n } else {\n gl_Position.xy += extrude * (radius + stroke_width) * u_extrude_scale * gl_Position.w;\n }\n }\n\n // This is a minimum blur distance that serves as a faux-antialiasing for\n // the circle. since blur is a ratio of the circle's size and the intent is\n // to keep the blur at roughly 1px, the two are inversely related.\n lowp float antialiasblur = 1.0 / DEVICE_PIXEL_RATIO / (radius + stroke_width);\n\n v_data = vec3(extrude.x, extrude.y, antialiasblur);\n}\n"},function(e,t){e.exports="void main() {\n gl_FragColor = vec4(1.0);\n}\n"},function(e,t){e.exports="attribute vec2 a_pos;\n\nuniform mat4 u_matrix;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n}\n"},function(e,t){e.exports="#pragma mapbox: define highp float weight\n\nuniform highp float u_intensity;\nvarying vec2 v_extrude;\n\n// Gaussian kernel coefficient: 1 / sqrt(2 * PI)\n#define GAUSS_COEF 0.3989422804014327\n\nvoid main() {\n #pragma mapbox: initialize highp float weight\n\n // Kernel density estimation with a Gaussian kernel of size 5x5\n float d = -0.5 * 3.0 * 3.0 * dot(v_extrude, v_extrude);\n float val = weight * u_intensity * GAUSS_COEF * exp(d);\n\n gl_FragColor = vec4(val, 1.0, 1.0, 1.0);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n"},function(e,t){e.exports="#pragma mapbox: define highp float weight\n#pragma mapbox: define mediump float radius\n\nuniform mat4 u_matrix;\nuniform float u_extrude_scale;\nuniform float u_opacity;\nuniform float u_intensity;\n\nattribute vec2 a_pos;\n\nvarying vec2 v_extrude;\n\n// Effective \"0\" in the kernel density texture to adjust the kernel size to;\n// this empirically chosen number minimizes artifacts on overlapping kernels\n// for typical heatmap cases (assuming clustered source)\nconst highp float ZERO = 1.0 / 255.0 / 16.0;\n\n// Gaussian kernel coefficient: 1 / sqrt(2 * PI)\n#define GAUSS_COEF 0.3989422804014327\n\nvoid main(void) {\n #pragma mapbox: initialize highp float weight\n #pragma mapbox: initialize mediump float radius\n\n // unencode the extrusion vector that we snuck into the a_pos vector\n vec2 unscaled_extrude = vec2(mod(a_pos, 2.0) * 2.0 - 1.0);\n\n // This 'extrude' comes in ranging from [-1, -1], to [1, 1]. We'll use\n // it to produce the vertices of a square mesh framing the point feature\n // we're adding to the kernel density texture. We'll also pass it as\n // a varying, so that the fragment shader can determine the distance of\n // each fragment from the point feature.\n // Before we do so, we need to scale it up sufficiently so that the\n // kernel falls effectively to zero at the edge of the mesh.\n // That is, we want to know S such that\n // weight * u_intensity * GAUSS_COEF * exp(-0.5 * 3.0^2 * S^2) == ZERO\n // Which solves to:\n // S = sqrt(-2.0 * log(ZERO / (weight * u_intensity * GAUSS_COEF))) / 3.0\n float S = sqrt(-2.0 * log(ZERO / weight / u_intensity / GAUSS_COEF)) / 3.0;\n\n // Pass the varying in units of radius\n v_extrude = S * unscaled_extrude;\n\n // Scale by radius and the zoom-based scale factor to produce actual\n // mesh position\n vec2 extrude = v_extrude * radius * u_extrude_scale;\n\n // multiply a_pos by 0.5, since we had it * 2 in order to sneak\n // in extrusion data\n vec4 pos = vec4(floor(a_pos * 0.5) + extrude, 0, 1);\n\n gl_Position = u_matrix * pos;\n}\n"},function(e,t){e.exports="uniform sampler2D u_image;\nuniform sampler2D u_color_ramp;\nuniform float u_opacity;\nvarying vec2 v_pos;\n\nvoid main() {\n float t = texture2D(u_image, v_pos).r;\n vec4 color = texture2D(u_color_ramp, vec2(t, 0.5));\n gl_FragColor = color * u_opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(0.0);\n#endif\n}\n"},function(e,t){e.exports="uniform mat4 u_matrix;\nuniform vec2 u_world;\nattribute vec2 a_pos;\nvarying vec2 v_pos;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos * u_world, 0, 1);\n\n v_pos.x = a_pos.x;\n v_pos.y = 1.0 - a_pos.y;\n}\n"},function(e,t){e.exports="\nvarying float v_placed;\nvarying float v_notUsed;\n\nvoid main() {\n\n float alpha = 0.5;\n\n // Red = collision, hide label\n gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0) * alpha;\n\n // Blue = no collision, label is showing\n if (v_placed > 0.5) {\n gl_FragColor = vec4(0.0, 0.0, 1.0, 0.5) * alpha;\n }\n\n if (v_notUsed > 0.5) {\n // This box not used, fade it out\n gl_FragColor *= .1;\n }\n}"},function(e,t){e.exports="attribute vec2 a_pos;\nattribute vec2 a_anchor_pos;\nattribute vec2 a_extrude;\nattribute vec2 a_placed;\n\nuniform mat4 u_matrix;\nuniform vec2 u_extrude_scale;\nuniform float u_camera_to_center_distance;\n\nvarying float v_placed;\nvarying float v_notUsed;\n\nvoid main() {\n vec4 projectedPoint = u_matrix * vec4(a_anchor_pos, 0, 1);\n highp float camera_to_anchor_distance = projectedPoint.w;\n highp float collision_perspective_ratio = 0.5 + 0.5 * (u_camera_to_center_distance / camera_to_anchor_distance);\n\n gl_Position = u_matrix * vec4(a_pos, 0.0, 1.0);\n gl_Position.xy += a_extrude * u_extrude_scale * gl_Position.w * collision_perspective_ratio;\n\n v_placed = a_placed.x;\n v_notUsed = a_placed.y;\n}\n"},function(e,t){e.exports="\nvarying float v_placed;\nvarying float v_notUsed;\nvarying float v_radius;\nvarying vec2 v_extrude;\nvarying vec2 v_extrude_scale;\n\nvoid main() {\n float alpha = 0.5;\n\n // Red = collision, hide label\n vec4 color = vec4(1.0, 0.0, 0.0, 1.0) * alpha;\n\n // Blue = no collision, label is showing\n if (v_placed > 0.5) {\n color = vec4(0.0, 0.0, 1.0, 0.5) * alpha;\n }\n\n if (v_notUsed > 0.5) {\n // This box not used, fade it out\n color *= .2;\n }\n\n float extrude_scale_length = length(v_extrude_scale);\n float extrude_length = length(v_extrude) * extrude_scale_length;\n float stroke_width = 15.0 * extrude_scale_length;\n float radius = v_radius * extrude_scale_length;\n\n float distance_to_edge = abs(extrude_length - radius);\n float opacity_t = smoothstep(-stroke_width, 0.0, -distance_to_edge);\n\n gl_FragColor = opacity_t * color;\n}\n"},function(e,t){e.exports="attribute vec2 a_pos;\nattribute vec2 a_anchor_pos;\nattribute vec2 a_extrude;\nattribute vec2 a_placed;\n\nuniform mat4 u_matrix;\nuniform vec2 u_extrude_scale;\nuniform float u_camera_to_center_distance;\n\nvarying float v_placed;\nvarying float v_notUsed;\nvarying float v_radius;\n\nvarying vec2 v_extrude;\nvarying vec2 v_extrude_scale;\n\nvoid main() {\n vec4 projectedPoint = u_matrix * vec4(a_anchor_pos, 0, 1);\n highp float camera_to_anchor_distance = projectedPoint.w;\n highp float collision_perspective_ratio = 0.5 + 0.5 * (u_camera_to_center_distance / camera_to_anchor_distance);\n\n gl_Position = u_matrix * vec4(a_pos, 0.0, 1.0);\n\n highp float padding_factor = 1.2; // Pad the vertices slightly to make room for anti-alias blur\n gl_Position.xy += a_extrude * u_extrude_scale * padding_factor * gl_Position.w * collision_perspective_ratio;\n\n v_placed = a_placed.x;\n v_notUsed = a_placed.y;\n v_radius = abs(a_extrude.y); // We don't pitch the circles, so both units of the extrusion vector are equal in magnitude to the radius\n\n v_extrude = a_extrude * padding_factor;\n v_extrude_scale = u_extrude_scale * u_camera_to_center_distance * collision_perspective_ratio;\n}\n"},function(e,t){e.exports="uniform highp vec4 u_color;\n\nvoid main() {\n gl_FragColor = u_color;\n}\n"},function(e,t){e.exports="attribute vec2 a_pos;\n\nuniform mat4 u_matrix;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n}\n"},function(e,t){e.exports="#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 color\n #pragma mapbox: initialize lowp float opacity\n\n gl_FragColor = color * opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n"},function(e,t){e.exports="attribute vec2 a_pos;\n\nuniform mat4 u_matrix;\n\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 color\n #pragma mapbox: initialize lowp float opacity\n\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n}\n"},function(e,t){e.exports="#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\n\nvarying vec2 v_pos;\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 outline_color\n #pragma mapbox: initialize lowp float opacity\n\n float dist = length(v_pos - gl_FragCoord.xy);\n float alpha = 1.0 - smoothstep(0.0, 1.0, dist);\n gl_FragColor = outline_color * (alpha * opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n"},function(e,t){e.exports="attribute vec2 a_pos;\n\nuniform mat4 u_matrix;\nuniform vec2 u_world;\n\nvarying vec2 v_pos;\n\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 outline_color\n #pragma mapbox: initialize lowp float opacity\n\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n v_pos = (gl_Position.xy / gl_Position.w + 1.0) / 2.0 * u_world;\n}\n"},function(e,t){e.exports="uniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform vec2 u_texsize;\nuniform float u_mix;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec2 v_pos;\n\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\n\n vec2 imagecoord = mod(v_pos_a, 1.0);\n vec2 pos = mix(u_pattern_tl_a / u_texsize, u_pattern_br_a / u_texsize, imagecoord);\n vec4 color1 = texture2D(u_image, pos);\n\n vec2 imagecoord_b = mod(v_pos_b, 1.0);\n vec2 pos2 = mix(u_pattern_tl_b / u_texsize, u_pattern_br_b / u_texsize, imagecoord_b);\n vec4 color2 = texture2D(u_image, pos2);\n\n // find distance to outline for alpha interpolation\n\n float dist = length(v_pos - gl_FragCoord.xy);\n float alpha = 1.0 - smoothstep(0.0, 1.0, dist);\n\n\n gl_FragColor = mix(color1, color2, u_mix) * alpha * opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n"},function(e,t){e.exports="uniform mat4 u_matrix;\nuniform vec2 u_world;\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pixel_coord_upper;\nuniform vec2 u_pixel_coord_lower;\nuniform float u_scale_a;\nuniform float u_scale_b;\nuniform float u_tile_units_to_pixels;\n\nattribute vec2 a_pos;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec2 v_pos;\n\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\n\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n\n v_pos_a = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_a * u_pattern_size_a, u_tile_units_to_pixels, a_pos);\n v_pos_b = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_b * u_pattern_size_b, u_tile_units_to_pixels, a_pos);\n\n v_pos = (gl_Position.xy / gl_Position.w + 1.0) / 2.0 * u_world;\n}\n"},function(e,t){e.exports="uniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform vec2 u_texsize;\nuniform float u_mix;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\n\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\n\n vec2 imagecoord = mod(v_pos_a, 1.0);\n vec2 pos = mix(u_pattern_tl_a / u_texsize, u_pattern_br_a / u_texsize, imagecoord);\n vec4 color1 = texture2D(u_image, pos);\n\n vec2 imagecoord_b = mod(v_pos_b, 1.0);\n vec2 pos2 = mix(u_pattern_tl_b / u_texsize, u_pattern_br_b / u_texsize, imagecoord_b);\n vec4 color2 = texture2D(u_image, pos2);\n\n gl_FragColor = mix(color1, color2, u_mix) * opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n"},function(e,t){e.exports="uniform mat4 u_matrix;\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pixel_coord_upper;\nuniform vec2 u_pixel_coord_lower;\nuniform float u_scale_a;\nuniform float u_scale_b;\nuniform float u_tile_units_to_pixels;\n\nattribute vec2 a_pos;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\n\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\n\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n\n v_pos_a = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_a * u_pattern_size_a, u_tile_units_to_pixels, a_pos);\n v_pos_b = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_b * u_pattern_size_b, u_tile_units_to_pixels, a_pos);\n}\n"},function(e,t){e.exports="varying vec4 v_color;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define highp vec4 color\n\nvoid main() {\n #pragma mapbox: initialize lowp float base\n #pragma mapbox: initialize lowp float height\n #pragma mapbox: initialize highp vec4 color\n\n gl_FragColor = v_color;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n"},function(e,t){e.exports="uniform mat4 u_matrix;\nuniform vec3 u_lightcolor;\nuniform lowp vec3 u_lightpos;\nuniform lowp float u_lightintensity;\n\nattribute vec2 a_pos;\nattribute vec4 a_normal_ed;\n\nvarying vec4 v_color;\n\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n\n#pragma mapbox: define highp vec4 color\n\nvoid main() {\n #pragma mapbox: initialize lowp float base\n #pragma mapbox: initialize lowp float height\n #pragma mapbox: initialize highp vec4 color\n\n vec3 normal = a_normal_ed.xyz;\n\n base = max(0.0, base);\n height = max(0.0, height);\n\n float t = mod(normal.x, 2.0);\n\n gl_Position = u_matrix * vec4(a_pos, t > 0.0 ? height : base, 1);\n\n // Relative luminance (how dark/bright is the surface color?)\n float colorvalue = color.r * 0.2126 + color.g * 0.7152 + color.b * 0.0722;\n\n v_color = vec4(0.0, 0.0, 0.0, 1.0);\n\n // Add slight ambient lighting so no extrusions are totally black\n vec4 ambientlight = vec4(0.03, 0.03, 0.03, 1.0);\n color += ambientlight;\n\n // Calculate cos(theta), where theta is the angle between surface normal and diffuse light ray\n float directional = clamp(dot(normal / 16384.0, u_lightpos), 0.0, 1.0);\n\n // Adjust directional so that\n // the range of values for highlight/shading is narrower\n // with lower light intensity\n // and with lighter/brighter surface colors\n directional = mix((1.0 - u_lightintensity), max((1.0 - colorvalue + u_lightintensity), 1.0), directional);\n\n // Add gradient along z axis of side surfaces\n if (normal.y != 0.0) {\n directional *= clamp((t + base) * pow(height / 150.0, 0.5), mix(0.7, 0.98, 1.0 - u_lightintensity), 1.0);\n }\n\n // Assign final color based on surface + ambient light color, diffuse light directional, and light color\n // with lower bounds adjusted to hue of light\n // so that shading is tinted with the complementary (opposite) color to the light color\n v_color.r += clamp(color.r * directional * u_lightcolor.r, mix(0.0, 0.3, 1.0 - u_lightcolor.r), 1.0);\n v_color.g += clamp(color.g * directional * u_lightcolor.g, mix(0.0, 0.3, 1.0 - u_lightcolor.g), 1.0);\n v_color.b += clamp(color.b * directional * u_lightcolor.b, mix(0.0, 0.3, 1.0 - u_lightcolor.b), 1.0);\n}\n"},function(e,t){e.exports="uniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform vec2 u_texsize;\nuniform float u_mix;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec4 v_lighting;\n\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n\nvoid main() {\n #pragma mapbox: initialize lowp float base\n #pragma mapbox: initialize lowp float height\n\n vec2 imagecoord = mod(v_pos_a, 1.0);\n vec2 pos = mix(u_pattern_tl_a / u_texsize, u_pattern_br_a / u_texsize, imagecoord);\n vec4 color1 = texture2D(u_image, pos);\n\n vec2 imagecoord_b = mod(v_pos_b, 1.0);\n vec2 pos2 = mix(u_pattern_tl_b / u_texsize, u_pattern_br_b / u_texsize, imagecoord_b);\n vec4 color2 = texture2D(u_image, pos2);\n\n vec4 mixedColor = mix(color1, color2, u_mix);\n\n gl_FragColor = mixedColor * v_lighting;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n"},function(e,t){e.exports="uniform mat4 u_matrix;\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pixel_coord_upper;\nuniform vec2 u_pixel_coord_lower;\nuniform float u_scale_a;\nuniform float u_scale_b;\nuniform float u_tile_units_to_pixels;\nuniform float u_height_factor;\n\nuniform vec3 u_lightcolor;\nuniform lowp vec3 u_lightpos;\nuniform lowp float u_lightintensity;\n\nattribute vec2 a_pos;\nattribute vec4 a_normal_ed;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec4 v_lighting;\nvarying float v_directional;\n\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n\nvoid main() {\n #pragma mapbox: initialize lowp float base\n #pragma mapbox: initialize lowp float height\n\n vec3 normal = a_normal_ed.xyz;\n float edgedistance = a_normal_ed.w;\n\n base = max(0.0, base);\n height = max(0.0, height);\n\n float t = mod(normal.x, 2.0);\n float z = t > 0.0 ? height : base;\n\n gl_Position = u_matrix * vec4(a_pos, z, 1);\n\n vec2 pos = normal.x == 1.0 && normal.y == 0.0 && normal.z == 16384.0\n ? a_pos // extrusion top\n : vec2(edgedistance, z * u_height_factor); // extrusion side\n\n v_pos_a = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_a * u_pattern_size_a, u_tile_units_to_pixels, pos);\n v_pos_b = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_b * u_pattern_size_b, u_tile_units_to_pixels, pos);\n\n v_lighting = vec4(0.0, 0.0, 0.0, 1.0);\n float directional = clamp(dot(normal / 16383.0, u_lightpos), 0.0, 1.0);\n directional = mix((1.0 - u_lightintensity), max((0.5 + u_lightintensity), 1.0), directional);\n\n if (normal.y != 0.0) {\n directional *= clamp((t + base) * pow(height / 150.0, 0.5), mix(0.7, 0.98, 1.0 - u_lightintensity), 1.0);\n }\n\n v_lighting.rgb += clamp(directional * u_lightcolor, mix(vec3(0.0), vec3(0.3), 1.0 - u_lightcolor), vec3(1.0));\n}\n"},function(e,t){e.exports="uniform sampler2D u_image;\nuniform float u_opacity;\nvarying vec2 v_pos;\n\nvoid main() {\n gl_FragColor = texture2D(u_image, v_pos) * u_opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(0.0);\n#endif\n}\n"},function(e,t){e.exports="uniform mat4 u_matrix;\nuniform vec2 u_world;\nattribute vec2 a_pos;\nvarying vec2 v_pos;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos * u_world, 0, 1);\n\n v_pos.x = a_pos.x;\n v_pos.y = 1.0 - a_pos.y;\n}\n"},function(e,t){e.exports="#ifdef GL_ES\nprecision highp float;\n#endif\n\nuniform sampler2D u_image;\nvarying vec2 v_pos;\nuniform vec2 u_dimension;\nuniform float u_zoom;\n\nfloat getElevation(vec2 coord, float bias) {\n // Convert encoded elevation value to meters\n vec4 data = texture2D(u_image, coord) * 255.0;\n return (data.r + data.g * 256.0 + data.b * 256.0 * 256.0) / 4.0;\n}\n\nvoid main() {\n vec2 epsilon = 1.0 / u_dimension;\n\n // queried pixels:\n // +-----------+\n // | | | |\n // | a | b | c |\n // | | | |\n // +-----------+\n // | | | |\n // | d | e | f |\n // | | | |\n // +-----------+\n // | | | |\n // | g | h | i |\n // | | | |\n // +-----------+\n\n float a = getElevation(v_pos + vec2(-epsilon.x, -epsilon.y), 0.0);\n float b = getElevation(v_pos + vec2(0, -epsilon.y), 0.0);\n float c = getElevation(v_pos + vec2(epsilon.x, -epsilon.y), 0.0);\n float d = getElevation(v_pos + vec2(-epsilon.x, 0), 0.0);\n float e = getElevation(v_pos, 0.0);\n float f = getElevation(v_pos + vec2(epsilon.x, 0), 0.0);\n float g = getElevation(v_pos + vec2(-epsilon.x, epsilon.y), 0.0);\n float h = getElevation(v_pos + vec2(0, epsilon.y), 0.0);\n float i = getElevation(v_pos + vec2(epsilon.x, epsilon.y), 0.0);\n\n // here we divide the x and y slopes by 8 * pixel size\n // where pixel size (aka meters/pixel) is:\n // circumference of the world / (pixels per tile * number of tiles)\n // which is equivalent to: 8 * 40075016.6855785 / (512 * pow(2, u_zoom))\n // which can be reduced to: pow(2, 19.25619978527 - u_zoom)\n // we want to vertically exaggerate the hillshading though, because otherwise\n // it is barely noticeable at low zooms. to do this, we multiply this by some\n // scale factor pow(2, (u_zoom - 14) * a) where a is an arbitrary value and 14 is the\n // maxzoom of the tile source. here we use a=0.3 which works out to the\n // expression below. see nickidlugash's awesome breakdown for more info\n // https://github.com/mapbox/mapbox-gl-js/pull/5286#discussion_r148419556\n float exaggeration = u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;\n\n vec2 deriv = vec2(\n (c + f + f + i) - (a + d + d + g),\n (g + h + h + i) - (a + b + b + c)\n ) / pow(2.0, (u_zoom - 14.0) * exaggeration + 19.2562 - u_zoom);\n\n gl_FragColor = clamp(vec4(\n deriv.x / 2.0 + 0.5,\n deriv.y / 2.0 + 0.5,\n 1.0,\n 1.0), 0.0, 1.0);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n"},function(e,t){e.exports="uniform mat4 u_matrix;\n\nattribute vec2 a_pos;\nattribute vec2 a_texture_pos;\n\nvarying vec2 v_pos;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n v_pos = (a_texture_pos / 8192.0) / 2.0 + 0.25;\n}\n"},function(e,t){e.exports="uniform sampler2D u_image;\nvarying vec2 v_pos;\n\nuniform vec2 u_latrange;\nuniform vec2 u_light;\nuniform vec4 u_shadow;\nuniform vec4 u_highlight;\nuniform vec4 u_accent;\n\n#define PI 3.141592653589793\n\nvoid main() {\n vec4 pixel = texture2D(u_image, v_pos);\n\n vec2 deriv = ((pixel.rg * 2.0) - 1.0);\n\n // We divide the slope by a scale factor based on the cosin of the pixel's approximate latitude\n // to account for mercator projection distortion. see #4807 for details\n float scaleFactor = cos(radians((u_latrange[0] - u_latrange[1]) * (1.0 - v_pos.y) + u_latrange[1]));\n // We also multiply the slope by an arbitrary z-factor of 1.25\n float slope = atan(1.25 * length(deriv) / scaleFactor);\n float aspect = deriv.x != 0.0 ? atan(deriv.y, -deriv.x) : PI / 2.0 * (deriv.y > 0.0 ? 1.0 : -1.0);\n\n float intensity = u_light.x;\n // We add PI to make this property match the global light object, which adds PI/2 to the light's azimuthal\n // position property to account for 0deg corresponding to north/the top of the viewport in the style spec\n // and the original shader was written to accept (-illuminationDirection - 90) as the azimuthal.\n float azimuth = u_light.y + PI;\n\n // We scale the slope exponentially based on intensity, using a calculation similar to\n // the exponential interpolation function in the style spec:\n // https://github.com/mapbox/mapbox-gl-js/blob/master/src/style-spec/expression/definitions/interpolate.js#L217-L228\n // so that higher intensity values create more opaque hillshading.\n float base = 1.875 - intensity * 1.75;\n float maxValue = 0.5 * PI;\n float scaledSlope = intensity != 0.5 ? ((pow(base, slope) - 1.0) / (pow(base, maxValue) - 1.0)) * maxValue : slope;\n\n // The accent color is calculated with the cosine of the slope while the shade color is calculated with the sine\n // so that the accent color's rate of change eases in while the shade color's eases out.\n float accent = cos(scaledSlope);\n // We multiply both the accent and shade color by a clamped intensity value\n // so that intensities >= 0.5 do not additionally affect the color values\n // while intensity values < 0.5 make the overall color more transparent.\n vec4 accent_color = (1.0 - accent) * u_accent * clamp(intensity * 2.0, 0.0, 1.0);\n float shade = abs(mod((aspect + azimuth) / PI + 0.5, 2.0) - 1.0);\n vec4 shade_color = mix(u_shadow, u_highlight, shade) * sin(scaledSlope) * clamp(intensity * 2.0, 0.0, 1.0);\n gl_FragColor = accent_color * (1.0 - shade_color.a) + shade_color;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n"},function(e,t){e.exports="uniform mat4 u_matrix;\n\nattribute vec2 a_pos;\nattribute vec2 a_texture_pos;\n\nvarying vec2 v_pos;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n v_pos = a_texture_pos / 8192.0;\n}\n"},function(e,t){e.exports="#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n\nvarying vec2 v_width2;\nvarying vec2 v_normal;\nvarying float v_gamma_scale;\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 color\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * v_width2.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_width2.t) or when fading out\n // (v_width2.s)\n float blur2 = (blur + 1.0 / DEVICE_PIXEL_RATIO) * v_gamma_scale;\n float alpha = clamp(min(dist - (v_width2.t - blur2), v_width2.s - dist) / blur2, 0.0, 1.0);\n\n gl_FragColor = color * (alpha * opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n"},function(e,t){e.exports="\n\n// the distance over which the line edge fades out.\n// Retina devices need a smaller distance to avoid aliasing.\n#define ANTIALIASING 1.0 / DEVICE_PIXEL_RATIO / 2.0\n\n// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\nattribute vec4 a_pos_normal;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform vec2 u_gl_units_to_pixels;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying float v_gamma_scale;\n\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 color\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize mediump float gapwidth\n #pragma mapbox: initialize lowp float offset\n #pragma mapbox: initialize mediump float width\n\n vec2 a_extrude = a_data.xy - 128.0;\n float a_direction = mod(a_data.z, 4.0) - 1.0;\n\n vec2 pos = a_pos_normal.xy;\n\n // x is 1 if it's a round cap, 0 otherwise\n // y is 1 if the normal points up, and -1 if it points down\n mediump vec2 normal = a_pos_normal.zw;\n v_normal = normal;\n\n // these transformations used to be applied in the JS and native code bases.\n // moved them into the shader for clarity and simplicity.\n gapwidth = gapwidth / 2.0;\n float halfwidth = width / 2.0;\n offset = -1.0 * offset;\n\n float inset = gapwidth + (gapwidth > 0.0 ? ANTIALIASING : 0.0);\n float outset = gapwidth + halfwidth * (gapwidth > 0.0 ? 2.0 : 1.0) + ANTIALIASING;\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist = outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset2 = offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n vec4 projected_extrude = u_matrix * vec4(dist / u_ratio, 0.0, 0.0);\n gl_Position = u_matrix * vec4(pos + offset2 / u_ratio, 0.0, 1.0) + projected_extrude;\n\n // calculate how much the perspective view squishes or stretches the extrude\n float extrude_length_without_perspective = length(dist);\n float extrude_length_with_perspective = length(projected_extrude.xy / gl_Position.w * u_gl_units_to_pixels);\n v_gamma_scale = extrude_length_without_perspective / extrude_length_with_perspective;\n\n v_width2 = vec2(outset, inset);\n}\n"},function(e,t){e.exports="uniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform vec2 u_texsize;\nuniform float u_fade;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying float v_linesofar;\nvarying float v_gamma_scale;\n\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * v_width2.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_width2.t) or when fading out\n // (v_width2.s)\n float blur2 = (blur + 1.0 / DEVICE_PIXEL_RATIO) * v_gamma_scale;\n float alpha = clamp(min(dist - (v_width2.t - blur2), v_width2.s - dist) / blur2, 0.0, 1.0);\n\n float x_a = mod(v_linesofar / u_pattern_size_a.x, 1.0);\n float x_b = mod(v_linesofar / u_pattern_size_b.x, 1.0);\n float y_a = 0.5 + (v_normal.y * v_width2.s / u_pattern_size_a.y);\n float y_b = 0.5 + (v_normal.y * v_width2.s / u_pattern_size_b.y);\n vec2 pos_a = mix(u_pattern_tl_a / u_texsize, u_pattern_br_a / u_texsize, vec2(x_a, y_a));\n vec2 pos_b = mix(u_pattern_tl_b / u_texsize, u_pattern_br_b / u_texsize, vec2(x_b, y_b));\n\n vec4 color = mix(texture2D(u_image, pos_a), texture2D(u_image, pos_b), u_fade);\n\n gl_FragColor = color * alpha * opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n"},function(e,t){e.exports="// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\n// We scale the distance before adding it to the buffers so that we can store\n// long distances for long segments. Use this value to unscale the distance.\n#define LINE_DISTANCE_SCALE 2.0\n\n// the distance over which the line edge fades out.\n// Retina devices need a smaller distance to avoid aliasing.\n#define ANTIALIASING 1.0 / DEVICE_PIXEL_RATIO / 2.0\n\nattribute vec4 a_pos_normal;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform vec2 u_gl_units_to_pixels;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying float v_linesofar;\nvarying float v_gamma_scale;\n\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n\nvoid main() {\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize lowp float offset\n #pragma mapbox: initialize mediump float gapwidth\n #pragma mapbox: initialize mediump float width\n\n vec2 a_extrude = a_data.xy - 128.0;\n float a_direction = mod(a_data.z, 4.0) - 1.0;\n float a_linesofar = (floor(a_data.z / 4.0) + a_data.w * 64.0) * LINE_DISTANCE_SCALE;\n\n vec2 pos = a_pos_normal.xy;\n\n // x is 1 if it's a round cap, 0 otherwise\n // y is 1 if the normal points up, and -1 if it points down\n mediump vec2 normal = a_pos_normal.zw;\n v_normal = normal;\n\n // these transformations used to be applied in the JS and native code bases.\n // moved them into the shader for clarity and simplicity.\n gapwidth = gapwidth / 2.0;\n float halfwidth = width / 2.0;\n offset = -1.0 * offset;\n\n float inset = gapwidth + (gapwidth > 0.0 ? ANTIALIASING : 0.0);\n float outset = gapwidth + halfwidth * (gapwidth > 0.0 ? 2.0 : 1.0) + ANTIALIASING;\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist = outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset2 = offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n vec4 projected_extrude = u_matrix * vec4(dist / u_ratio, 0.0, 0.0);\n gl_Position = u_matrix * vec4(pos + offset2 / u_ratio, 0.0, 1.0) + projected_extrude;\n\n // calculate how much the perspective view squishes or stretches the extrude\n float extrude_length_without_perspective = length(dist);\n float extrude_length_with_perspective = length(projected_extrude.xy / gl_Position.w * u_gl_units_to_pixels);\n v_gamma_scale = extrude_length_without_perspective / extrude_length_with_perspective;\n\n v_linesofar = a_linesofar;\n v_width2 = vec2(outset, inset);\n}\n"},function(e,t){e.exports="\nuniform sampler2D u_image;\nuniform float u_sdfgamma;\nuniform float u_mix;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying vec2 v_tex_a;\nvarying vec2 v_tex_b;\nvarying float v_gamma_scale;\n\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 color\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize mediump float width\n #pragma mapbox: initialize lowp float floorwidth\n\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * v_width2.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_width2.t) or when fading out\n // (v_width2.s)\n float blur2 = (blur + 1.0 / DEVICE_PIXEL_RATIO) * v_gamma_scale;\n float alpha = clamp(min(dist - (v_width2.t - blur2), v_width2.s - dist) / blur2, 0.0, 1.0);\n\n float sdfdist_a = texture2D(u_image, v_tex_a).a;\n float sdfdist_b = texture2D(u_image, v_tex_b).a;\n float sdfdist = mix(sdfdist_a, sdfdist_b, u_mix);\n alpha *= smoothstep(0.5 - u_sdfgamma / floorwidth, 0.5 + u_sdfgamma / floorwidth, sdfdist);\n\n gl_FragColor = color * (alpha * opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n"},function(e,t){e.exports="// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\n// We scale the distance before adding it to the buffers so that we can store\n// long distances for long segments. Use this value to unscale the distance.\n#define LINE_DISTANCE_SCALE 2.0\n\n// the distance over which the line edge fades out.\n// Retina devices need a smaller distance to avoid aliasing.\n#define ANTIALIASING 1.0 / DEVICE_PIXEL_RATIO / 2.0\n\nattribute vec4 a_pos_normal;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform vec2 u_patternscale_a;\nuniform float u_tex_y_a;\nuniform vec2 u_patternscale_b;\nuniform float u_tex_y_b;\nuniform vec2 u_gl_units_to_pixels;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying vec2 v_tex_a;\nvarying vec2 v_tex_b;\nvarying float v_gamma_scale;\n\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 color\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize mediump float gapwidth\n #pragma mapbox: initialize lowp float offset\n #pragma mapbox: initialize mediump float width\n #pragma mapbox: initialize lowp float floorwidth\n\n vec2 a_extrude = a_data.xy - 128.0;\n float a_direction = mod(a_data.z, 4.0) - 1.0;\n float a_linesofar = (floor(a_data.z / 4.0) + a_data.w * 64.0) * LINE_DISTANCE_SCALE;\n\n vec2 pos = a_pos_normal.xy;\n\n // x is 1 if it's a round cap, 0 otherwise\n // y is 1 if the normal points up, and -1 if it points down\n mediump vec2 normal = a_pos_normal.zw;\n v_normal = normal;\n\n // these transformations used to be applied in the JS and native code bases.\n // moved them into the shader for clarity and simplicity.\n gapwidth = gapwidth / 2.0;\n float halfwidth = width / 2.0;\n offset = -1.0 * offset;\n\n float inset = gapwidth + (gapwidth > 0.0 ? ANTIALIASING : 0.0);\n float outset = gapwidth + halfwidth * (gapwidth > 0.0 ? 2.0 : 1.0) + ANTIALIASING;\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist =outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset2 = offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n vec4 projected_extrude = u_matrix * vec4(dist / u_ratio, 0.0, 0.0);\n gl_Position = u_matrix * vec4(pos + offset2 / u_ratio, 0.0, 1.0) + projected_extrude;\n\n // calculate how much the perspective view squishes or stretches the extrude\n float extrude_length_without_perspective = length(dist);\n float extrude_length_with_perspective = length(projected_extrude.xy / gl_Position.w * u_gl_units_to_pixels);\n v_gamma_scale = extrude_length_without_perspective / extrude_length_with_perspective;\n\n v_tex_a = vec2(a_linesofar * u_patternscale_a.x / floorwidth, normal.y * u_patternscale_a.y + u_tex_y_a);\n v_tex_b = vec2(a_linesofar * u_patternscale_b.x / floorwidth, normal.y * u_patternscale_b.y + u_tex_y_b);\n\n v_width2 = vec2(outset, inset);\n}\n"},function(e,t){e.exports="uniform float u_fade_t;\nuniform float u_opacity;\nuniform sampler2D u_image0;\nuniform sampler2D u_image1;\nvarying vec2 v_pos0;\nvarying vec2 v_pos1;\n\nuniform float u_brightness_low;\nuniform float u_brightness_high;\n\nuniform float u_saturation_factor;\nuniform float u_contrast_factor;\nuniform vec3 u_spin_weights;\n\nvoid main() {\n\n // read and cross-fade colors from the main and parent tiles\n vec4 color0 = texture2D(u_image0, v_pos0);\n vec4 color1 = texture2D(u_image1, v_pos1);\n if (color0.a > 0.0) {\n color0.rgb = color0.rgb / color0.a;\n }\n if (color1.a > 0.0) {\n color1.rgb = color1.rgb / color1.a;\n }\n vec4 color = mix(color0, color1, u_fade_t);\n color.a *= u_opacity;\n vec3 rgb = color.rgb;\n\n // spin\n rgb = vec3(\n dot(rgb, u_spin_weights.xyz),\n dot(rgb, u_spin_weights.zxy),\n dot(rgb, u_spin_weights.yzx));\n\n // saturation\n float average = (color.r + color.g + color.b) / 3.0;\n rgb += (average - rgb) * u_saturation_factor;\n\n // contrast\n rgb = (rgb - 0.5) * u_contrast_factor + 0.5;\n\n // brightness\n vec3 u_high_vec = vec3(u_brightness_low, u_brightness_low, u_brightness_low);\n vec3 u_low_vec = vec3(u_brightness_high, u_brightness_high, u_brightness_high);\n\n gl_FragColor = vec4(mix(u_high_vec, u_low_vec, rgb) * color.a, color.a);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n"},function(e,t){e.exports="uniform mat4 u_matrix;\nuniform vec2 u_tl_parent;\nuniform float u_scale_parent;\nuniform float u_buffer_scale;\n\nattribute vec2 a_pos;\nattribute vec2 a_texture_pos;\n\nvarying vec2 v_pos0;\nvarying vec2 v_pos1;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n // We are using Int16 for texture position coordinates to give us enough precision for\n // fractional coordinates. We use 8192 to scale the texture coordinates in the buffer\n // as an arbitrarily high number to preserve adequate precision when rendering.\n // This is also the same value as the EXTENT we are using for our tile buffer pos coordinates,\n // so math for modifying either is consistent.\n v_pos0 = (((a_texture_pos / 8192.0) - 0.5) / u_buffer_scale ) + 0.5;\n v_pos1 = (v_pos0 * u_scale_parent) + u_tl_parent;\n}\n"},function(e,t){e.exports="uniform sampler2D u_texture;\n\n#pragma mapbox: define lowp float opacity\n\nvarying vec2 v_tex;\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\n\n lowp float alpha = opacity;\n gl_FragColor = texture2D(u_texture, v_tex) * alpha;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n"},function(e,t){e.exports="const float PI = 3.141592653589793;\n\nattribute vec4 a_pos_offset;\nattribute vec4 a_data;\nattribute vec3 a_projected_pos;\n\nuniform bool u_is_size_zoom_constant;\nuniform bool u_is_size_feature_constant;\nuniform highp float u_size_t; // used to interpolate between zoom stops when size is a composite function\nuniform highp float u_size; // used when size is both zoom and feature constant\nuniform highp float u_camera_to_center_distance;\nuniform highp float u_pitch;\nuniform bool u_rotate_symbol;\nuniform highp float u_aspect_ratio;\nuniform float u_fade_change;\n\n#pragma mapbox: define lowp float opacity\n\nuniform mat4 u_matrix;\nuniform mat4 u_label_plane_matrix;\nuniform mat4 u_gl_coord_matrix;\n\nuniform bool u_is_text;\nuniform bool u_pitch_with_map;\n\nuniform vec2 u_texsize;\n\nvarying vec2 v_tex;\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\n\n vec2 a_pos = a_pos_offset.xy;\n vec2 a_offset = a_pos_offset.zw;\n\n vec2 a_tex = a_data.xy;\n vec2 a_size = a_data.zw;\n\n highp float segment_angle = -a_projected_pos[2];\n\n float size;\n if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {\n size = mix(a_size[0], a_size[1], u_size_t) / 10.0;\n } else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {\n size = a_size[0] / 10.0;\n } else if (!u_is_size_zoom_constant && u_is_size_feature_constant) {\n size = u_size;\n } else {\n size = u_size;\n }\n\n vec4 projectedPoint = u_matrix * vec4(a_pos, 0, 1);\n highp float camera_to_anchor_distance = projectedPoint.w;\n // See comments in symbol_sdf.vertex\n highp float distance_ratio = u_pitch_with_map ?\n camera_to_anchor_distance / u_camera_to_center_distance :\n u_camera_to_center_distance / camera_to_anchor_distance;\n highp float perspective_ratio = 0.5 + 0.5 * distance_ratio;\n\n size *= perspective_ratio;\n\n float fontScale = u_is_text ? size / 24.0 : size;\n\n highp float symbol_rotation = 0.0;\n if (u_rotate_symbol) {\n // See comments in symbol_sdf.vertex\n vec4 offsetProjectedPoint = u_matrix * vec4(a_pos + vec2(1, 0), 0, 1);\n\n vec2 a = projectedPoint.xy / projectedPoint.w;\n vec2 b = offsetProjectedPoint.xy / offsetProjectedPoint.w;\n\n symbol_rotation = atan((b.y - a.y) / u_aspect_ratio, b.x - a.x);\n }\n\n highp float angle_sin = sin(segment_angle + symbol_rotation);\n highp float angle_cos = cos(segment_angle + symbol_rotation);\n mat2 rotation_matrix = mat2(angle_cos, -1.0 * angle_sin, angle_sin, angle_cos);\n\n vec4 projected_pos = u_label_plane_matrix * vec4(a_projected_pos.xy, 0.0, 1.0);\n gl_Position = u_gl_coord_matrix * vec4(projected_pos.xy / projected_pos.w + rotation_matrix * (a_offset / 64.0 * fontScale), 0.0, 1.0);\n\n v_tex = a_tex / u_texsize;\n}\n"},function(e,t){e.exports="#define SDF_PX 8.0\n#define EDGE_GAMMA 0.105/DEVICE_PIXEL_RATIO\n\nuniform bool u_has_halo;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\n\nuniform sampler2D u_texture;\nuniform highp float u_gamma_scale;\nuniform bool u_is_text;\n\nvarying vec2 v_data0;\nvarying vec3 v_data1;\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 fill_color\n #pragma mapbox: initialize highp vec4 halo_color\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize lowp float halo_width\n #pragma mapbox: initialize lowp float halo_blur\n\n vec2 tex = v_data0.xy;\n float gamma_scale = v_data1.x;\n float size = v_data1.y;\n\n lowp float dist = texture2D(u_texture, tex).a;\n float fontScale = u_is_text ? size / 24.0 : size;\n\n lowp vec4 color = fill_color;\n highp float gamma = EDGE_GAMMA / (fontScale * u_gamma_scale);\n lowp float buff = (256.0 - 64.0) / 256.0;\n\n highp float gamma_scaled = gamma * u_gamma_scale;\n highp float alpha = smoothstep(buff - gamma_scaled, buff + gamma_scaled, dist);\n if (u_has_halo) {\n gamma = (halo_blur * 1.19 / SDF_PX + EDGE_GAMMA) / (fontScale * u_gamma_scale);\n highp float gamma_scaled_halo = gamma * u_gamma_scale;\n lowp float buff_halo = (6.0 - halo_width / fontScale) / SDF_PX;\n highp float alpha_halo = smoothstep(buff_halo - gamma_scaled, buff_halo + gamma_scaled, dist);\n color = mix(halo_color, color, alpha);\n alpha = alpha_halo;\n }\n gl_FragColor = color * (alpha * opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n"},function(e,t){e.exports="const float PI = 3.141592653589793;\n\nattribute vec4 a_pos_offset;\nattribute vec4 a_data;\nattribute vec3 a_projected_pos;\n\n// contents of a_size vary based on the type of property value\n// used for {text,icon}-size.\n// For constants, a_size is disabled.\n// For source functions, we bind only one value per vertex: the value of {text,icon}-size evaluated for the current feature.\n// For composite functions:\n// [ text-size(lowerZoomStop, feature),\n// text-size(upperZoomStop, feature) ]\nuniform bool u_is_size_zoom_constant;\nuniform bool u_is_size_feature_constant;\nuniform highp float u_size_t; // used to interpolate between zoom stops when size is a composite function\nuniform highp float u_size; // used when size is both zoom and feature constant\n\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\n\nuniform mat4 u_matrix;\nuniform mat4 u_label_plane_matrix;\nuniform mat4 u_gl_coord_matrix;\n\nuniform bool u_is_text;\nuniform bool u_pitch_with_map;\nuniform highp float u_pitch;\nuniform bool u_rotate_symbol;\nuniform highp float u_aspect_ratio;\nuniform highp float u_camera_to_center_distance;\nuniform float u_fade_change;\n\nuniform vec2 u_texsize;\n\nvarying vec2 v_data0;\nvarying vec3 v_data1;\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 fill_color\n #pragma mapbox: initialize highp vec4 halo_color\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize lowp float halo_width\n #pragma mapbox: initialize lowp float halo_blur\n\n vec2 a_pos = a_pos_offset.xy;\n vec2 a_offset = a_pos_offset.zw;\n\n vec2 a_tex = a_data.xy;\n vec2 a_size = a_data.zw;\n\n highp float segment_angle = -a_projected_pos[2];\n float size;\n\n if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {\n size = mix(a_size[0], a_size[1], u_size_t) / 10.0;\n } else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {\n size = a_size[0] / 10.0;\n } else if (!u_is_size_zoom_constant && u_is_size_feature_constant) {\n size = u_size;\n } else {\n size = u_size;\n }\n\n vec4 projectedPoint = u_matrix * vec4(a_pos, 0, 1);\n highp float camera_to_anchor_distance = projectedPoint.w;\n // If the label is pitched with the map, layout is done in pitched space,\n // which makes labels in the distance smaller relative to viewport space.\n // We counteract part of that effect by multiplying by the perspective ratio.\n // If the label isn't pitched with the map, we do layout in viewport space,\n // which makes labels in the distance larger relative to the features around\n // them. We counteract part of that effect by dividing by the perspective ratio.\n highp float distance_ratio = u_pitch_with_map ?\n camera_to_anchor_distance / u_camera_to_center_distance :\n u_camera_to_center_distance / camera_to_anchor_distance;\n highp float perspective_ratio = 0.5 + 0.5 * distance_ratio;\n\n size *= perspective_ratio;\n\n float fontScale = u_is_text ? size / 24.0 : size;\n\n highp float symbol_rotation = 0.0;\n if (u_rotate_symbol) {\n // Point labels with 'rotation-alignment: map' are horizontal with respect to tile units\n // To figure out that angle in projected space, we draw a short horizontal line in tile\n // space, project it, and measure its angle in projected space.\n vec4 offsetProjectedPoint = u_matrix * vec4(a_pos + vec2(1, 0), 0, 1);\n\n vec2 a = projectedPoint.xy / projectedPoint.w;\n vec2 b = offsetProjectedPoint.xy / offsetProjectedPoint.w;\n\n symbol_rotation = atan((b.y - a.y) / u_aspect_ratio, b.x - a.x);\n }\n\n highp float angle_sin = sin(segment_angle + symbol_rotation);\n highp float angle_cos = cos(segment_angle + symbol_rotation);\n mat2 rotation_matrix = mat2(angle_cos, -1.0 * angle_sin, angle_sin, angle_cos);\n\n vec4 projected_pos = u_label_plane_matrix * vec4(a_projected_pos.xy, 0.0, 1.0);\n gl_Position = u_gl_coord_matrix * vec4(projected_pos.xy / projected_pos.w + rotation_matrix * (a_offset / 64.0 * fontScale), 0.0, 1.0);\n float gamma_scale = gl_Position.w;\n\n vec2 tex = a_tex / u_texsize;\n\n v_data0 = vec2(tex.x, tex.y);\n v_data1 = vec3(gamma_scale, size, 1.0);\n}\n"},function(e,t,i){function _(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var y=i(2),v=i(126),C=i(1),x=(i(32).ProgramConfiguration,i(40)),r=(i(67),function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(b.prototype,[{key:"draw",value:function(e,t,i,r,n,a,o,s,l){var u,c=e.gl,d=(_(u={},c.LINES,2),_(u,c.TRIANGLES,3),u)[t],h=!0,p=!1,f=void 0;try{for(var m,g=a.get()[Symbol.iterator]();!(h=(m=g.next()).done);h=!0){var y=m.value,v=y.vaos||(y.vaos={});(v[i]||(v[i]=new x)).bind(e,this,r,o?o.getPaintVertexBuffers():[],n,y.vertexOffset,s,l),c.drawElements(t,y.primitiveLength*d,c.UNSIGNED_SHORT,y.primitiveOffset*d*2)}}catch(e){p=!0,f=e}finally{try{h||null==g.return||g.return()}finally{if(p)throw f}}}}]),b);function b(e,t,i,r){!function(e){if(!(e instanceof b))throw new TypeError("Cannot call a class as a function")}(this);var n=e.gl;this.program=n.createProgram();var a=i.defines().concat("#define DEVICE_PIXEL_RATIO ".concat(y.devicePixelRatio.toFixed(1)));r&&a.push("#define OVERDRAW_INSPECTOR;");var o=a.concat(v.prelude.fragmentSource,t.fragmentSource).join("\n"),s=a.concat(v.prelude.vertexSource,t.vertexSource).join("\n"),l=n.createShader(n.FRAGMENT_SHADER);n.shaderSource(l,o),n.compileShader(l),C(n.getShaderParameter(l,n.COMPILE_STATUS),n.getShaderInfoLog(l)),n.attachShader(this.program,l);var u=n.createShader(n.VERTEX_SHADER);n.shaderSource(u,s),n.compileShader(u),C(n.getShaderParameter(u,n.COMPILE_STATUS),n.getShaderInfoLog(u)),n.attachShader(this.program,u);for(var c=i.layoutAttributes||[],d=0;d<c.length;d++)n.bindAttribLocation(this.program,d,c[d].name);n.linkProgram(this.program),C(n.getProgramParameter(this.program,n.LINK_STATUS),n.getProgramInfoLog(this.program)),this.numAttributes=n.getProgramParameter(this.program,n.ACTIVE_ATTRIBUTES),this.attributes={},this.uniforms={};for(var h=0;h<this.numAttributes;h++){var p=n.getActiveAttrib(this.program,h);p&&(this.attributes[p.name]=n.getAttribLocation(this.program,p.name))}for(var f=n.getProgramParameter(this.program,n.ACTIVE_UNIFORMS),m=0;m<f;m++){var g=n.getActiveUniform(this.program,m);g&&(this.uniforms[g.name]=n.getUniformLocation(this.program,g.name))}}e.exports=r},function(e,t,i){var r=i(27),s=r.OverscaledTileID,d=r.CanonicalTileID;function h(e,t,i,r,n){for(var a=0;a<i.length;a++){var o=i[a];if(r.isLessThan(o.tileID))break;if(t.key===o.tileID.key)return;if(o.tileID.isChildOf(t)){for(var s=t.children(1/0),l=0;l<s.length;l++)h(e,s[l],i.slice(a),r,n);return}}var u=t.overscaledZ-e.overscaledZ,c=new d(u,t.canonical.x-(e.canonical.x<<u),t.canonical.y-(e.canonical.y<<u));n[c.key]=n[c.key]||c}e.exports=function(e,t){for(var i=e.sort(function(e,t){return e.tileID.isLessThan(t.tileID)?-1:t.tileID.isLessThan(e.tileID)?1:0}),r=0;r<i.length;r++){var n={},a=i[r],o=i.slice(r+1);h(a.tileID.wrapped(),a.tileID,o,new s(0,a.tileID.wrap+1,0,0,0),n),a.setMask(n,t)}}},function(e,t,i){var a=i(271),k=i(28),B=i(66),h=i(50),F=i(22).mat4.identity(new Float32Array(16)),p=i(51).layout,o=i(18),V=i(15);function s(e,t,i,r,n,a,o,s,l,u){var c,d=e.context,h=d.gl,p=e.transform,f="map"===s,m="map"===l,g=f&&"line"===i.layout.get("symbol-placement"),y=f&&!m&&!g,v=m;d.setDepthMode(v?e.depthModeForSublayer(0,V.ReadOnly):V.disabled);var _=!0,C=!1,x=void 0;try{for(var b,A=r[Symbol.iterator]();!(_=(b=A.next()).done);_=!0){var S=b.value,w=t.getTile(S),E=w.getBucket(i);if(E){var T=n?E.text:E.icon;if(T&&T.segments.get().length){var P=T.programConfigurations.get(i.id),M=n||E.sdfIcons,D=n?E.textSizeData:E.iconSizeData;if(c||(c=e.useProgram(M?"symbolSDF":"symbolIcon",P),P.setUniforms(e.context,c,i.paint,{zoom:e.transform.zoom}),z(c,e,i,n,y,m,D)),d.activeTexture.set(h.TEXTURE0),h.uniform1i(c.uniforms.u_texture,0),n)w.glyphAtlasTexture.bind(h.LINEAR,h.CLAMP_TO_EDGE),h.uniform2fv(c.uniforms.u_texsize,w.glyphAtlasTexture.size);else{var I=1!==i.layout.get("icon-size").constantOr(0)||E.iconsNeedLinear,O=m||0!==p.pitch;w.iconAtlasTexture.bind(M||e.options.rotating||e.options.zooming||I||O?h.LINEAR:h.NEAREST,h.CLAMP_TO_EDGE),h.uniform2fv(c.uniforms.u_texsize,w.iconAtlasTexture.size)}h.uniformMatrix4fv(c.uniforms.u_matrix,!1,e.translatePosMatrix(S.posMatrix,w,a,o));var R=k(w,1,e.transform.zoom),L=B.getLabelPlaneMatrix(S.posMatrix,m,f,e.transform,R),N=B.getGlCoordMatrix(S.posMatrix,m,f,e.transform,R);h.uniformMatrix4fv(c.uniforms.u_gl_coord_matrix,!1,e.translatePosMatrix(N,w,a,o,!0)),g?(h.uniformMatrix4fv(c.uniforms.u_label_plane_matrix,!1,F),B.updateLineLabels(E,S.posMatrix,e,n,L,N,m,u)):h.uniformMatrix4fv(c.uniforms.u_label_plane_matrix,!1,L),h.uniform1f(c.uniforms.u_fade_change,e.options.fadeDuration?e.symbolFadeChange:1),U(c,P,e,i,w,T,n,M,m)}}}}catch(e){C=!0,x=e}finally{try{_||null==A.return||A.return()}finally{if(C)throw x}}}function z(e,t,i,r,n,a,o){var s=t.context.gl,l=t.transform;s.uniform1i(e.uniforms.u_pitch_with_map,a?1:0),s.uniform1f(e.uniforms.u_is_text,r?1:0),s.uniform1f(e.uniforms.u_pitch,l.pitch/360*2*Math.PI);var u="constant"===o.functionType||"source"===o.functionType,c="constant"===o.functionType||"camera"===o.functionType;s.uniform1i(e.uniforms.u_is_size_zoom_constant,u?1:0),s.uniform1i(e.uniforms.u_is_size_feature_constant,c?1:0),s.uniform1f(e.uniforms.u_camera_to_center_distance,l.cameraToCenterDistance);var d=h.evaluateSizeForZoom(o,l.zoom,p.properties[r?"text-size":"icon-size"]);void 0!==d.uSizeT&&s.uniform1f(e.uniforms.u_size_t,d.uSizeT),void 0!==d.uSize&&s.uniform1f(e.uniforms.u_size,d.uSize),s.uniform1f(e.uniforms.u_aspect_ratio,l.width/l.height),s.uniform1i(e.uniforms.u_rotate_symbol,n?1:0)}function U(e,t,i,r,n,a,o,s,l){var u,c,d,h=i.context,p=h.gl,f=i.transform;if(s){var m=0!==r.paint.get(o?"text-halo-width":"icon-halo-width").constantOr(1),g=l?Math.cos(f._pitch)*f.cameraToCenterDistance:1;p.uniform1f(e.uniforms.u_gamma_scale,g),p.uniform1f(e.uniforms.u_has_halo,m?1:0)}u=a,c=r,d=h,e.draw(d,d.gl.TRIANGLES,c.id,u.layoutVertexBuffer,u.indexBuffer,u.segments,u.programConfigurations.get(c.id),u.dynamicLayoutVertexBuffer,u.opacityVertexBuffer)}e.exports=function(e,t,i,r){if("translucent"===e.renderPass){var n=e.context;n.setStencilMode(o.disabled),n.setColorMode(e.colorModeForRenderPass()),0!==i.paint.get("icon-opacity").constantOr(1)&&s(e,t,i,r,!1,i.paint.get("icon-translate"),i.paint.get("icon-translate-anchor"),i.layout.get("icon-rotation-alignment"),i.layout.get("icon-pitch-alignment"),i.layout.get("icon-keep-upright")),0!==i.paint.get("text-opacity").constantOr(1)&&s(e,t,i,r,!0,i.paint.get("text-translate"),i.paint.get("text-translate-anchor"),i.layout.get("text-rotation-alignment"),i.layout.get("text-pitch-alignment"),i.layout.get("text-keep-upright")),t.map.showCollisionBoxes&&a(e,t,i,r)}}},function(e,t,i){var m=i(28),g=i(15),y=i(18);function n(e,t,i,r,n){var a=e.context,o=a.gl,s=n?e.useProgram("collisionCircle"):e.useProgram("collisionBox");a.setDepthMode(g.disabled),a.setStencilMode(y.disabled),a.setColorMode(e.colorModeForRenderPass());for(var l=0;l<r.length;l++){var u=r[l],c=t.getTile(u),d=c.getBucket(i);if(d){var h=n?d.collisionCircle:d.collisionBox;if(h){o.uniformMatrix4fv(s.uniforms.u_matrix,!1,u.posMatrix),n||a.lineWidth.set(1),o.uniform1f(s.uniforms.u_camera_to_center_distance,e.transform.cameraToCenterDistance);var p=m(c,1,e.transform.zoom),f=Math.pow(2,e.transform.zoom-c.tileID.overscaledZ);o.uniform1f(s.uniforms.u_pixels_to_tile_units,p),o.uniform2f(s.uniforms.u_extrude_scale,e.transform.pixelsToGLUnits[0]/(p*f),e.transform.pixelsToGLUnits[1]/(p*f)),s.draw(a,n?o.TRIANGLES:o.LINES,i.id,h.layoutVertexBuffer,h.indexBuffer,h.segments,null,h.collisionVertexBuffer,null)}}}}e.exports=function(e,t,i,r){n(e,t,i,r,!1),n(e,t,i,r,!0)}},function(e,t,i){var v=i(28),_=i(18),C=i(15);e.exports=function(e,t,i,r){if("translucent"===e.renderPass){var n=i.paint.get("circle-opacity"),a=i.paint.get("circle-stroke-width"),o=i.paint.get("circle-stroke-opacity");if(0!==n.constantOr(1)||0!==a.constantOr(1)&&0!==o.constantOr(1)){var s=e.context,l=s.gl;s.setDepthMode(e.depthModeForSublayer(0,C.ReadOnly)),s.setStencilMode(_.disabled),s.setColorMode(e.colorModeForRenderPass());for(var u=!0,c=0;c<r.length;c++){var d=r[c],h=t.getTile(d),p=h.getBucket(i);if(p){var f=e.context.program.get(),m=p.programConfigurations.get(i.id),g=e.useProgram("circle",m);if(!u&&g.program===f||(m.setUniforms(s,g,i.paint,{zoom:e.transform.zoom}),u=!1),l.uniform1f(g.uniforms.u_camera_to_center_distance,e.transform.cameraToCenterDistance),l.uniform1i(g.uniforms.u_scale_with_map,"map"===i.paint.get("circle-pitch-scale")?1:0),"map"===i.paint.get("circle-pitch-alignment")){l.uniform1i(g.uniforms.u_pitch_with_map,1);var y=v(h,1,e.transform.zoom);l.uniform2f(g.uniforms.u_extrude_scale,y,y)}else l.uniform1i(g.uniforms.u_pitch_with_map,0),l.uniform2fv(g.uniforms.u_extrude_scale,e.transform.pixelsToGLUnits);l.uniformMatrix4fv(g.uniforms.u_matrix,!1,e.translatePosMatrix(d.posMatrix,h,i.paint.get("circle-translate"),i.paint.get("circle-translate-anchor"))),g.draw(s,l.TRIANGLES,i.id,p.layoutVertexBuffer,p.indexBuffer,p.segments,m)}}}}}},function(e,t,i){var m=i(22).mat4,g=i(20),y=i(28),v=i(12),_=i(15),C=i(18),x=i(68);e.exports=function(e,t,i,r){if(0!==i.paint.get("heatmap-opacity"))if("offscreen"===e.renderPass){var n=e.context,a=n.gl;n.setDepthMode(e.depthModeForSublayer(0,_.ReadOnly)),n.setStencilMode(C.disabled),function(e,t,i){var r=e.gl;e.activeTexture.set(r.TEXTURE1),e.viewport.set([0,0,t.width/4,t.height/4]);var n=i.heatmapFbo;if(n)r.bindTexture(r.TEXTURE_2D,n.colorAttachment.get()),e.bindFramebuffer.set(n.framebuffer);else{var a=r.createTexture();r.bindTexture(r.TEXTURE_2D,a),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.LINEAR),n=i.heatmapFbo=e.createFramebuffer(t.width/4,t.height/4),function e(t,i,r,n){var a=t.gl;a.texImage2D(a.TEXTURE_2D,0,a.RGBA,i.width/4,i.height/4,0,a.RGBA,t.extTextureHalfFloat?t.extTextureHalfFloat.HALF_FLOAT_OES:a.UNSIGNED_BYTE,null),n.colorAttachment.set(r),t.extTextureHalfFloat&&a.checkFramebufferStatus(a.FRAMEBUFFER)!==a.FRAMEBUFFER_COMPLETE&&(t.extTextureHalfFloat=null,n.colorAttachment.setDirty(),e(t,i,r,n))}(e,t,a,n)}}(n,e,i),n.clear({color:v.transparent}),n.setColorMode(new x([a.ONE,a.ONE],v.transparent,[!0,!0,!0,!0]));for(var o=!0,s=0;s<r.length;s++){var l=r[s];if(!t.hasRenderableParent(l)){var u=t.getTile(l),c=u.getBucket(i);if(c){var d=e.context.program.get(),h=c.programConfigurations.get(i.id),p=e.useProgram("heatmap",h),f=e.transform.zoom;!o&&p.program===d||(h.setUniforms(e.context,p,i.paint,{zoom:f}),o=!1),a.uniform1f(p.uniforms.u_extrude_scale,y(u,1,f)),a.uniform1f(p.uniforms.u_intensity,i.paint.get("heatmap-intensity")),a.uniformMatrix4fv(p.uniforms.u_matrix,!1,l.posMatrix),p.draw(n,a.TRIANGLES,i.id,c.layoutVertexBuffer,c.indexBuffer,c.segments,h)}}}n.viewport.set([0,0,e.width,e.height])}else"translucent"===e.renderPass&&(e.context.setColorMode(e.colorModeForRenderPass()),function(e,t){var i=e.context,r=i.gl,n=t.heatmapFbo;if(n){i.activeTexture.set(r.TEXTURE0),r.bindTexture(r.TEXTURE_2D,n.colorAttachment.get()),i.activeTexture.set(r.TEXTURE1);var a=t.colorRampTexture;(a=a||(t.colorRampTexture=new g(i,t.colorRamp,r.RGBA))).bind(r.LINEAR,r.CLAMP_TO_EDGE),i.setDepthMode(_.disabled);var o=e.useProgram("heatmapTexture"),s=t.paint.get("heatmap-opacity");r.uniform1f(o.uniforms.u_opacity,s),r.uniform1i(o.uniforms.u_image,0),r.uniform1i(o.uniforms.u_color_ramp,1);var l=m.create();m.ortho(l,0,e.width,e.height,0,0,1),r.uniformMatrix4fv(o.uniforms.u_matrix,!1,l),r.uniform2f(o.uniforms.u_world,r.drawingBufferWidth,r.drawingBufferHeight),e.viewportVAO.bind(e.context,o,e.viewportBuffer,[]),r.drawArrays(r.TRIANGLE_STRIP,0,4)}}(e,i))}},function(e,t,i){var S=i(2),w=i(28),x=i(15);function b(e,t,i,r,n,a,o,s,l){var u,c,d,h,p=t.context,f=p.gl,m=n.paint.get("line-dasharray"),g=n.paint.get("line-pattern");if(s||l){var y=1/w(i,1,t.transform.tileZoom(i));if(m){u=t.lineAtlas.getDash(m.from,"round"===n.layout.get("line-cap")),c=t.lineAtlas.getDash(m.to,"round"===n.layout.get("line-cap"));var v=u.width*m.fromScale,_=c.width*m.toScale;f.uniform2f(e.uniforms.u_patternscale_a,y/v,-u.height/2),f.uniform2f(e.uniforms.u_patternscale_b,y/_,-c.height/2),f.uniform1f(e.uniforms.u_sdfgamma,t.lineAtlas.width/(256*Math.min(v,_)*S.devicePixelRatio)/2)}else if(g){if(d=t.imageManager.getPattern(g.from),h=t.imageManager.getPattern(g.to),!d||!h)return;f.uniform2f(e.uniforms.u_pattern_size_a,d.displaySize[0]*g.fromScale/y,h.displaySize[1]),f.uniform2f(e.uniforms.u_pattern_size_b,h.displaySize[0]*g.toScale/y,h.displaySize[1]);var C=t.imageManager.getPixelSize(),x=C.width,b=C.height;f.uniform2fv(e.uniforms.u_texsize,[x,b])}f.uniform2f(e.uniforms.u_gl_units_to_pixels,1/t.transform.pixelsToGLUnits[0],1/t.transform.pixelsToGLUnits[1])}s&&(m?(f.uniform1i(e.uniforms.u_image,0),p.activeTexture.set(f.TEXTURE0),t.lineAtlas.bind(p),f.uniform1f(e.uniforms.u_tex_y_a,u.y),f.uniform1f(e.uniforms.u_tex_y_b,c.y),f.uniform1f(e.uniforms.u_mix,m.t)):g&&(f.uniform1i(e.uniforms.u_image,0),p.activeTexture.set(f.TEXTURE0),t.imageManager.bind(p),f.uniform2fv(e.uniforms.u_pattern_tl_a,d.tl),f.uniform2fv(e.uniforms.u_pattern_br_a,d.br),f.uniform2fv(e.uniforms.u_pattern_tl_b,h.tl),f.uniform2fv(e.uniforms.u_pattern_br_b,h.br),f.uniform1f(e.uniforms.u_fade,g.t))),p.setStencilMode(t.stencilModeForClipping(a));var A=t.translatePosMatrix(a.posMatrix,i,n.paint.get("line-translate"),n.paint.get("line-translate-anchor"));f.uniformMatrix4fv(e.uniforms.u_matrix,!1,A),f.uniform1f(e.uniforms.u_ratio,1/w(i,1,t.transform.zoom)),e.draw(p,f.TRIANGLES,n.id,r.layoutVertexBuffer,r.indexBuffer,r.segments,o)}e.exports=function(e,t,i,r){if("translucent"===e.renderPass&&0!==i.paint.get("line-opacity").constantOr(1)){var n=e.context;n.setDepthMode(e.depthModeForSublayer(0,x.ReadOnly)),n.setColorMode(e.colorModeForRenderPass());var a,o=i.paint.get("line-dasharray")?"lineSDF":i.paint.get("line-pattern")?"linePattern":"line",s=!0,l=!0,u=!1,c=void 0;try{for(var d,h=r[Symbol.iterator]();!(l=(d=h.next()).done);l=!0){var p=d.value,f=t.getTile(p),m=f.getBucket(i);if(m){var g=m.programConfigurations.get(i.id),y=e.context.program.get(),v=e.useProgram(o,g),_=s||v.program!==y,C=a!==f.tileID.overscaledZ;_&&g.setUniforms(e.context,v,i.paint,{zoom:e.transform.zoom}),b(v,e,f,m,i,p,g,_,C),a=f.tileID.overscaledZ,s=!1}}}catch(e){u=!0,c=e}finally{try{l||null==h.return||h.return()}finally{if(u)throw c}}}}},function(e,t,i){var f=i(70),l=i(12),u=i(15);function c(e,t,i,r,n){if(!f.isPatternMissing(i.paint.get("fill-pattern"),e)){var a=!0,o=!0,s=!1,l=void 0;try{for(var u,c=r[Symbol.iterator]();!(o=(u=c.next()).done);o=!0){var d=u.value,h=t.getTile(d),p=h.getBucket(i);p&&(e.context.setStencilMode(e.stencilModeForClipping(d)),n(e,t,i,h,d,p,a),a=!1)}}catch(e){s=!0,l=e}finally{try{o||null==c.return||c.return()}finally{if(s)throw l}}}}function d(e,t,i,r,n,a,o){var s=e.context.gl,l=a.programConfigurations.get(i.id);p("fill",i.paint.get("fill-pattern"),e,l,i,r,n,o).draw(e.context,s.TRIANGLES,i.id,a.layoutVertexBuffer,a.indexBuffer,a.segments,l)}function h(e,t,i,r,n,a,o){var s=e.context.gl,l=a.programConfigurations.get(i.id),u=p("fillOutline",i.getPaintProperty("fill-outline-color")?null:i.paint.get("fill-pattern"),e,l,i,r,n,o);s.uniform2f(u.uniforms.u_world,s.drawingBufferWidth,s.drawingBufferHeight),u.draw(e.context,s.LINES,i.id,a.layoutVertexBuffer,a.indexBuffer2,a.segments2,l)}function p(e,t,i,r,n,a,o,s){var l,u=i.context.program.get();return t?(l=i.useProgram("".concat(e,"Pattern"),r),!s&&l.program===u||(r.setUniforms(i.context,l,n.paint,{zoom:i.transform.zoom}),f.prepare(t,i,l)),f.setTile(a,i,l)):(l=i.useProgram(e,r),!s&&l.program===u||r.setUniforms(i.context,l,n.paint,{zoom:i.transform.zoom})),i.context.gl.uniformMatrix4fv(l.uniforms.u_matrix,!1,i.translatePosMatrix(o.posMatrix,a,n.paint.get("fill-translate"),n.paint.get("fill-translate-anchor"))),l}e.exports=function(e,t,i,r){var n=i.paint.get("fill-color"),a=i.paint.get("fill-opacity");if(0!==a.constantOr(1)){var o=e.context;o.setColorMode(e.colorModeForRenderPass());var s=i.paint.get("fill-pattern")||1!==n.constantOr(l.transparent).a||1!==a.constantOr(0)?"translucent":"opaque";e.renderPass===s&&(o.setDepthMode(e.depthModeForSublayer(1,"opaque"===e.renderPass?u.ReadWrite:u.ReadOnly)),c(e,t,i,r,d)),"translucent"===e.renderPass&&i.paint.get("fill-antialias")&&(o.lineWidth.set(2),o.setDepthMode(e.depthModeForSublayer(i.getPaintProperty("fill-outline-color")?2:0,u.ReadOnly)),c(e,t,i,r,h))}}},function(e,t,i){var r=i(22),p=i(70),f=i(20),m=i(12),g=i(15),y=r.mat3,v=r.mat4,_=r.vec3,C=i(18);function x(e,t,i,r,n,a,o){var s=e.context,l=s.gl,u=i.paint.get("fill-extrusion-pattern"),c=e.context.program.get(),d=a.programConfigurations.get(i.id),h=e.useProgram(u?"fillExtrusionPattern":"fillExtrusion",d);if(!o&&h.program===c||d.setUniforms(s,h,i.paint,{zoom:e.transform.zoom}),u){if(p.isPatternMissing(u,e))return;p.prepare(u,e,h),p.setTile(r,e,h),l.uniform1f(h.uniforms.u_height_factor,-Math.pow(2,n.overscaledZ)/r.tileSize/8)}e.context.gl.uniformMatrix4fv(h.uniforms.u_matrix,!1,e.translatePosMatrix(n.posMatrix,r,i.paint.get("fill-extrusion-translate"),i.paint.get("fill-extrusion-translate-anchor"))),function(e,t){var i=t.context.gl,r=t.style.light,n=r.properties.get("position"),a=[n.x,n.y,n.z],o=y.create();"viewport"===r.properties.get("anchor")&&y.fromRotation(o,-t.transform.angle),_.transformMat3(a,a,o);var s=r.properties.get("color");i.uniform3fv(e.uniforms.u_lightpos,a),i.uniform1f(e.uniforms.u_lightintensity,r.properties.get("intensity")),i.uniform3f(e.uniforms.u_lightcolor,s.r,s.g,s.b)}(h,e),h.draw(s,l.TRIANGLES,i.id,a.layoutVertexBuffer,a.indexBuffer,a.segments,d)}e.exports=function(e,t,i,r){if(0!==i.paint.get("fill-extrusion-opacity"))if("offscreen"===e.renderPass){!function(e,t){var i=e.context,r=i.gl,n=t.viewportFrame;if(e.depthRboNeedsClear&&e.setupOffscreenDepthRenderbuffer(),!n){var a=new f(i,{width:e.width,height:e.height,data:null},r.RGBA);a.bind(r.LINEAR,r.CLAMP_TO_EDGE),(n=t.viewportFrame=i.createFramebuffer(e.width,e.height)).colorAttachment.set(a.texture)}i.bindFramebuffer.set(n.framebuffer),n.depthAttachment.set(e.depthRbo),e.depthRboNeedsClear&&(i.clear({depth:1}),e.depthRboNeedsClear=!1),i.clear({color:m.transparent}),i.setStencilMode(C.disabled),i.setDepthMode(new g(r.LEQUAL,g.ReadWrite,[0,1])),i.setColorMode(e.colorModeForRenderPass())}(e,i);var n=!0,a=!0,o=!1,s=void 0;try{for(var l,u=r[Symbol.iterator]();!(a=(l=u.next()).done);a=!0){var c=l.value,d=t.getTile(c),h=d.getBucket(i);h&&(x(e,0,i,d,c,h,n),n=!1)}}catch(e){o=!0,s=e}finally{try{a||null==u.return||u.return()}finally{if(o)throw s}}}else"translucent"===e.renderPass&&function(e,t){var i=t.viewportFrame;if(i){var r=e.context,n=r.gl,a=e.useProgram("extrusionTexture");r.setStencilMode(C.disabled),r.setDepthMode(g.disabled),r.setColorMode(e.colorModeForRenderPass()),r.activeTexture.set(n.TEXTURE0),n.bindTexture(n.TEXTURE_2D,i.colorAttachment.get()),n.uniform1f(a.uniforms.u_opacity,t.paint.get("fill-extrusion-opacity")),n.uniform1i(a.uniforms.u_image,0);var o=v.create();v.ortho(o,0,e.width,e.height,0,0,1),n.uniformMatrix4fv(a.uniforms.u_matrix,!1,o),n.uniform2f(a.uniforms.u_world,n.drawingBufferWidth,n.drawingBufferHeight),e.viewportVAO.bind(r,a,e.viewportBuffer,[]),n.drawArrays(n.TRIANGLE_STRIP,0,4)}}(e,i)}},function(e,t,i){var C=i(35),h=i(20),p=i(6),f=i(22).mat4,m=i(18),g=i(15);function y(e,t,i){var r,n,a,o,s,l,u,c=e.context,d=c.gl,h=t.fbo;if(h){var p=e.useProgram("hillshade"),f=e.transform.calculatePosMatrix(t.tileID.toUnwrapped());o=p,s=e,u=(l=i).paint.get("hillshade-illumination-direction")*(Math.PI/180),"viewport"===l.paint.get("hillshade-illumination-anchor")&&(u-=s.transform.angle),s.context.gl.uniform2f(o.uniforms.u_light,l.paint.get("hillshade-exaggeration"),u);var m=(r=e,n=t.tileID.toCoordinate(),a=new C(n.column,n.row+1,n.zoom),[r.transform.coordinateLocation(n).lat,r.transform.coordinateLocation(a).lat]);c.activeTexture.set(d.TEXTURE0),d.bindTexture(d.TEXTURE_2D,h.colorAttachment.get()),d.uniformMatrix4fv(p.uniforms.u_matrix,!1,f),d.uniform2fv(p.uniforms.u_latrange,m),d.uniform1i(p.uniforms.u_image,0);var g=i.paint.get("hillshade-shadow-color");d.uniform4f(p.uniforms.u_shadow,g.r,g.g,g.b,g.a);var y=i.paint.get("hillshade-highlight-color");d.uniform4f(p.uniforms.u_highlight,y.r,y.g,y.b,y.a);var v=i.paint.get("hillshade-accent-color");if(d.uniform4f(p.uniforms.u_accent,v.r,v.g,v.b,v.a),t.maskedBoundsBuffer&&t.maskedIndexBuffer&&t.segments)p.draw(c,d.TRIANGLES,i.id,t.maskedBoundsBuffer,t.maskedIndexBuffer,t.segments);else{var _=e.rasterBoundsBuffer;e.rasterBoundsVAO.bind(c,p,_,[]),d.drawArrays(d.TRIANGLE_STRIP,0,_.length)}}}function v(e,t){var i=e.context,r=i.gl;if(t.dem&&t.dem.level){var n=t.dem.level.dim,a=t.dem.getPixels();if(i.activeTexture.set(r.TEXTURE1),i.pixelStoreUnpackPremultiplyAlpha.set(!1),t.demTexture=t.demTexture||e.getTileTexture(t.tileSize),t.demTexture){var o=t.demTexture;o.update(a,!1),o.bind(r.NEAREST,r.CLAMP_TO_EDGE)}else t.demTexture=new h(i,a,r.RGBA,!1),t.demTexture.bind(r.NEAREST,r.CLAMP_TO_EDGE);i.activeTexture.set(r.TEXTURE0);var s=t.fbo;if(!s){var l=new h(i,{width:n,height:n,data:null},r.RGBA);l.bind(r.LINEAR,r.CLAMP_TO_EDGE),(s=t.fbo=i.createFramebuffer(n,n)).colorAttachment.set(l.texture)}i.bindFramebuffer.set(s.framebuffer),i.viewport.set([0,0,n,n]);var u=f.create();f.ortho(u,0,p,-p,0,0,1),f.translate(u,u,[0,-p,0]);var c=e.useProgram("hillshadePrepare");r.uniformMatrix4fv(c.uniforms.u_matrix,!1,u),r.uniform1f(c.uniforms.u_zoom,t.tileID.overscaledZ),r.uniform2fv(c.uniforms.u_dimension,[2*n,2*n]),r.uniform1i(c.uniforms.u_image,1);var d=e.rasterBoundsBuffer;e.rasterBoundsVAO.bind(i,c,d,[]),r.drawArrays(r.TRIANGLE_STRIP,0,d.length),t.needsHillshadePrepare=!1}}e.exports=function(e,t,i,r){if("offscreen"===e.renderPass||"translucent"===e.renderPass){var n=e.context;n.setDepthMode(e.depthModeForSublayer(0,g.ReadOnly)),n.setStencilMode(m.disabled),n.setColorMode(e.colorModeForRenderPass());var a=!0,o=!1,s=void 0;try{for(var l,u=r[Symbol.iterator]();!(a=(l=u.next()).done);a=!0){var c=l.value,d=t.getTile(c);d.needsHillshadePrepare&&"offscreen"===e.renderPass?v(e,d):"translucent"===e.renderPass&&y(e,d,i)}}catch(e){o=!0,s=e}finally{try{a||null==u.return||u.return()}finally{if(o)throw s}}n.viewport.set([0,0,e.width,e.height])}}},function(e,t,i){var p=i(0),w=i(52),f=i(2),E=i(18),T=i(15);function P(e,t,i,r,n){var a=r.paint.get("raster-fade-duration");if(0<a){var o=f.now(),s=(o-e.timeAdded)/a,l=t?(o-t.timeAdded)/a:-1,u=i.getSource(),c=n.coveringZoomLevel({tileSize:u.tileSize,roundZoom:u.roundZoom}),d=!t||Math.abs(t.tileID.overscaledZ-c)>Math.abs(e.tileID.overscaledZ-c),h=d&&e.refreshedUponExpiration?1:p.clamp(d?s:1-l,0,1);return e.refreshedUponExpiration&&1<=s&&(e.refreshedUponExpiration=!1),t?{opacity:1,mix:1-h}:{opacity:h,mix:0}}return{opacity:1,mix:0}}e.exports=function(e,t,i,r){if("translucent"===e.renderPass&&0!==i.paint.get("raster-opacity")){var n,a,o=e.context,s=o.gl,l=t.getSource(),u=e.useProgram("raster");o.setStencilMode(E.disabled),o.setColorMode(e.colorModeForRenderPass()),s.uniform1f(u.uniforms.u_brightness_low,i.paint.get("raster-brightness-min")),s.uniform1f(u.uniforms.u_brightness_high,i.paint.get("raster-brightness-max")),s.uniform1f(u.uniforms.u_saturation_factor,0<(a=i.paint.get("raster-saturation"))?1-1/(1.001-a):-a),s.uniform1f(u.uniforms.u_contrast_factor,0<(n=i.paint.get("raster-contrast"))?1/(1-n):1+n),s.uniform3fv(u.uniforms.u_spin_weights,function(e){e*=Math.PI/180;var t=Math.sin(e),i=Math.cos(e);return[(2*i+1)/3,(-Math.sqrt(3)*t-i+1)/3,(Math.sqrt(3)*t-i+1)/3]}(i.paint.get("raster-hue-rotate"))),s.uniform1f(u.uniforms.u_buffer_scale,1),s.uniform1i(u.uniforms.u_image0,0),s.uniform1i(u.uniforms.u_image1,1);var c=r.length&&r[0].overscaledZ,d=!0,h=!1,p=void 0;try{for(var f,m=r[Symbol.iterator]();!(d=(f=m.next()).done);d=!0){var g=f.value;o.setDepthMode(e.depthModeForSublayer(g.overscaledZ-c,1===i.paint.get("raster-opacity")?T.ReadWrite:T.ReadOnly,s.LESS));var y=t.getTile(g),v=e.transform.calculatePosMatrix(g.toUnwrapped());y.registerFadeDuration(i.paint.get("raster-fade-duration")),s.uniformMatrix4fv(u.uniforms.u_matrix,!1,v);var _=t.findLoadedParent(g,0,{}),C=P(y,_,t,i,e.transform),x=void 0,b=void 0;if(o.activeTexture.set(s.TEXTURE0),y.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE,s.LINEAR_MIPMAP_NEAREST),o.activeTexture.set(s.TEXTURE1),_?(_.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE,s.LINEAR_MIPMAP_NEAREST),x=Math.pow(2,_.tileID.overscaledZ-y.tileID.overscaledZ),b=[y.tileID.canonical.x*x%1,y.tileID.canonical.y*x%1]):y.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE,s.LINEAR_MIPMAP_NEAREST),s.uniform2fv(u.uniforms.u_tl_parent,b||[0,0]),s.uniform1f(u.uniforms.u_scale_parent,x||1),s.uniform1f(u.uniforms.u_fade_t,C.mix),s.uniform1f(u.uniforms.u_opacity,C.opacity*i.paint.get("raster-opacity")),l instanceof w){var A=l.boundsBuffer;l.boundsVAO.bind(o,u,A,[]),s.drawArrays(s.TRIANGLE_STRIP,0,A.length)}else if(y.maskedBoundsBuffer&&y.maskedIndexBuffer&&y.segments)u.draw(o,s.TRIANGLES,i.id,y.maskedBoundsBuffer,y.maskedIndexBuffer,y.segments);else{var S=e.rasterBoundsBuffer;e.rasterBoundsVAO.bind(o,u,S,[]),s.drawArrays(s.TRIANGLE_STRIP,0,S.length)}}}catch(e){h=!0,p=e}finally{try{d||null==m.return||m.return()}finally{if(h)throw p}}}}},function(e,t,i){var _=i(70),C=i(18),x=i(15);e.exports=function(e,t,i){var r=i.paint.get("background-color"),n=i.paint.get("background-opacity");if(0!==n){var a,o=e.context,s=o.gl,l=e.transform,u=l.tileSize,c=i.paint.get("background-pattern"),d=c||1!==r.a||1!==n?"translucent":"opaque";if(e.renderPass===d){if(o.setStencilMode(C.disabled),o.setDepthMode(e.depthModeForSublayer(0,"opaque"==d?x.ReadWrite:x.ReadOnly)),o.setColorMode(e.colorModeForRenderPass()),c){if(_.isPatternMissing(c,e))return;a=e.useProgram("backgroundPattern"),_.prepare(c,e,a),e.tileExtentPatternVAO.bind(o,a,e.tileExtentBuffer,[])}else a=e.useProgram("background"),s.uniform4fv(a.uniforms.u_color,[r.r,r.g,r.b,r.a]),e.tileExtentVAO.bind(o,a,e.tileExtentBuffer,[]);s.uniform1f(a.uniforms.u_opacity,n);var h=l.coveringTiles({tileSize:u}),p=!0,f=!1,m=void 0;try{for(var g,y=h[Symbol.iterator]();!(p=(g=y.next()).done);p=!0){var v=g.value;c&&_.setTile({tileID:v,tileSize:u},e,a),s.uniformMatrix4fv(a.uniforms.u_matrix,!1,e.transform.calculatePosMatrix(v.toUnwrapped())),s.drawArrays(s.TRIANGLE_STRIP,0,e.tileExtentBuffer.length)}}catch(e){f=!0,m=e}finally{try{p||null==y.return||y.return()}finally{if(f)throw m}}}}}},function(e,t,i){var g=i(2),y=i(22).mat4,v=i(6),_=i(40),C=i(14).PosArray,x=i(125),b=i(15),A=i(18);function n(e,t,i){var r=e.context,n=r.gl;r.lineWidth.set(1*g.devicePixelRatio);var a=i.posMatrix,o=e.useProgram("debug");r.setDepthMode(b.disabled),r.setStencilMode(A.disabled),r.setColorMode(e.colorModeForRenderPass()),n.uniformMatrix4fv(o.uniforms.u_matrix,!1,a),n.uniform4f(o.uniforms.u_color,1,0,0,1),e.debugVAO.bind(r,o,e.debugBuffer,[]),n.drawArrays(n.LINE_STRIP,0,e.debugBuffer.length);for(var s=function(e,t,i,r){r=r||1;var n,a,o,s,l,u,c,d,h=[];for(n=0,a=e.length;n<a;n++)if(l=S[e[n]]){for(d=null,o=0,s=l[1].length;o<s;o+=2)d=-1===l[1][o]&&-1===l[1][o+1]?null:(u=t+l[1][o]*r,c=200-l[1][o+1]*r,d&&h.push(d.x,d.y,u,c),{x:u,y:c});t+=l[0]*r}return h}(i.toString(),50,0,5),l=new C,u=0;u<s.length;u+=2)l.emplaceBack(s[u],s[u+1]);var c=r.createVertexBuffer(l,x.members);(new _).bind(r,o,c,[]),n.uniform4f(o.uniforms.u_color,1,1,1,1);for(var d=t.getTile(i).tileSize,h=v/(Math.pow(2,e.transform.zoom-i.overscaledZ)*d),p=[[-1,-1],[-1,1],[1,-1],[1,1]],f=0;f<p.length;f++){var m=p[f];n.uniformMatrix4fv(o.uniforms.u_matrix,!1,y.translate([],a,[h*m[0],h*m[1],0])),n.drawArrays(n.LINES,0,c.length)}n.uniform4f(o.uniforms.u_color,0,0,0,1),n.uniformMatrix4fv(o.uniforms.u_matrix,!1,a),n.drawArrays(n.LINES,0,c.length)}e.exports=function(e,t,i){for(var r=0;r<i.length;r++)n(e,t,i[r])};var S={" ":[16,[]],"!":[10,[5,21,5,7,-1,-1,5,2,4,1,5,0,6,1,5,2]],'"':[16,[4,21,4,14,-1,-1,12,21,12,14]],"#":[21,[11,25,4,-7,-1,-1,17,25,10,-7,-1,-1,4,12,18,12,-1,-1,3,6,17,6]],$:[20,[8,25,8,-4,-1,-1,12,25,12,-4,-1,-1,17,18,15,20,12,21,8,21,5,20,3,18,3,16,4,14,5,13,7,12,13,10,15,9,16,8,17,6,17,3,15,1,12,0,8,0,5,1,3,3]],"%":[24,[21,21,3,0,-1,-1,8,21,10,19,10,17,9,15,7,14,5,14,3,16,3,18,4,20,6,21,8,21,10,20,13,19,16,19,19,20,21,21,-1,-1,17,7,15,6,14,4,14,2,16,0,18,0,20,1,21,3,21,5,19,7,17,7]],"&":[26,[23,12,23,13,22,14,21,14,20,13,19,11,17,6,15,3,13,1,11,0,7,0,5,1,4,2,3,4,3,6,4,8,5,9,12,13,13,14,14,16,14,18,13,20,11,21,9,20,8,18,8,16,9,13,11,10,16,3,18,1,20,0,22,0,23,1,23,2]],"'":[10,[5,19,4,20,5,21,6,20,6,18,5,16,4,15]],"(":[14,[11,25,9,23,7,20,5,16,4,11,4,7,5,2,7,-2,9,-5,11,-7]],")":[14,[3,25,5,23,7,20,9,16,10,11,10,7,9,2,7,-2,5,-5,3,-7]],"*":[16,[8,21,8,9,-1,-1,3,18,13,12,-1,-1,13,18,3,12]],"+":[26,[13,18,13,0,-1,-1,4,9,22,9]],",":[10,[6,1,5,0,4,1,5,2,6,1,6,-1,5,-3,4,-4]],"-":[26,[4,9,22,9]],".":[10,[5,2,4,1,5,0,6,1,5,2]],"/":[22,[20,25,2,-7]],0:[20,[9,21,6,20,4,17,3,12,3,9,4,4,6,1,9,0,11,0,14,1,16,4,17,9,17,12,16,17,14,20,11,21,9,21]],1:[20,[6,17,8,18,11,21,11,0]],2:[20,[4,16,4,17,5,19,6,20,8,21,12,21,14,20,15,19,16,17,16,15,15,13,13,10,3,0,17,0]],3:[20,[5,21,16,21,10,13,13,13,15,12,16,11,17,8,17,6,16,3,14,1,11,0,8,0,5,1,4,2,3,4]],4:[20,[13,21,3,7,18,7,-1,-1,13,21,13,0]],5:[20,[15,21,5,21,4,12,5,13,8,14,11,14,14,13,16,11,17,8,17,6,16,3,14,1,11,0,8,0,5,1,4,2,3,4]],6:[20,[16,18,15,20,12,21,10,21,7,20,5,17,4,12,4,7,5,3,7,1,10,0,11,0,14,1,16,3,17,6,17,7,16,10,14,12,11,13,10,13,7,12,5,10,4,7]],7:[20,[17,21,7,0,-1,-1,3,21,17,21]],8:[20,[8,21,5,20,4,18,4,16,5,14,7,13,11,12,14,11,16,9,17,7,17,4,16,2,15,1,12,0,8,0,5,1,4,2,3,4,3,7,4,9,6,11,9,12,13,13,15,14,16,16,16,18,15,20,12,21,8,21]],9:[20,[16,14,15,11,13,9,10,8,9,8,6,9,4,11,3,14,3,15,4,18,6,20,9,21,10,21,13,20,15,18,16,14,16,9,15,4,13,1,10,0,8,0,5,1,4,3]],":":[10,[5,14,4,13,5,12,6,13,5,14,-1,-1,5,2,4,1,5,0,6,1,5,2]],";":[10,[5,14,4,13,5,12,6,13,5,14,-1,-1,6,1,5,0,4,1,5,2,6,1,6,-1,5,-3,4,-4]],"<":[24,[20,18,4,9,20,0]],"=":[26,[4,12,22,12,-1,-1,4,6,22,6]],">":[24,[4,18,20,9,4,0]],"?":[18,[3,16,3,17,4,19,5,20,7,21,11,21,13,20,14,19,15,17,15,15,14,13,13,12,9,10,9,7,-1,-1,9,2,8,1,9,0,10,1,9,2]],"@":[27,[18,13,17,15,15,16,12,16,10,15,9,14,8,11,8,8,9,6,11,5,14,5,16,6,17,8,-1,-1,12,16,10,14,9,11,9,8,10,6,11,5,-1,-1,18,16,17,8,17,6,19,5,21,5,23,7,24,10,24,12,23,15,22,17,20,19,18,20,15,21,12,21,9,20,7,19,5,17,4,15,3,12,3,9,4,6,5,4,7,2,9,1,12,0,15,0,18,1,20,2,21,3,-1,-1,19,16,18,8,18,6,19,5]],A:[18,[9,21,1,0,-1,-1,9,21,17,0,-1,-1,4,7,14,7]],B:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,15,17,13,16,12,13,11,-1,-1,4,11,13,11,16,10,17,9,18,7,18,4,17,2,16,1,13,0,4,0]],C:[21,[18,16,17,18,15,20,13,21,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5]],D:[21,[4,21,4,0,-1,-1,4,21,11,21,14,20,16,18,17,16,18,13,18,8,17,5,16,3,14,1,11,0,4,0]],E:[19,[4,21,4,0,-1,-1,4,21,17,21,-1,-1,4,11,12,11,-1,-1,4,0,17,0]],F:[18,[4,21,4,0,-1,-1,4,21,17,21,-1,-1,4,11,12,11]],G:[21,[18,16,17,18,15,20,13,21,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,18,8,-1,-1,13,8,18,8]],H:[22,[4,21,4,0,-1,-1,18,21,18,0,-1,-1,4,11,18,11]],I:[8,[4,21,4,0]],J:[16,[12,21,12,5,11,2,10,1,8,0,6,0,4,1,3,2,2,5,2,7]],K:[21,[4,21,4,0,-1,-1,18,21,4,7,-1,-1,9,12,18,0]],L:[17,[4,21,4,0,-1,-1,4,0,16,0]],M:[24,[4,21,4,0,-1,-1,4,21,12,0,-1,-1,20,21,12,0,-1,-1,20,21,20,0]],N:[22,[4,21,4,0,-1,-1,4,21,18,0,-1,-1,18,21,18,0]],O:[22,[9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,19,8,19,13,18,16,17,18,15,20,13,21,9,21]],P:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,14,17,12,16,11,13,10,4,10]],Q:[22,[9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,19,8,19,13,18,16,17,18,15,20,13,21,9,21,-1,-1,12,4,18,-2]],R:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,15,17,13,16,12,13,11,4,11,-1,-1,11,11,18,0]],S:[20,[17,18,15,20,12,21,8,21,5,20,3,18,3,16,4,14,5,13,7,12,13,10,15,9,16,8,17,6,17,3,15,1,12,0,8,0,5,1,3,3]],T:[16,[8,21,8,0,-1,-1,1,21,15,21]],U:[22,[4,21,4,6,5,3,7,1,10,0,12,0,15,1,17,3,18,6,18,21]],V:[18,[1,21,9,0,-1,-1,17,21,9,0]],W:[24,[2,21,7,0,-1,-1,12,21,7,0,-1,-1,12,21,17,0,-1,-1,22,21,17,0]],X:[20,[3,21,17,0,-1,-1,17,21,3,0]],Y:[18,[1,21,9,11,9,0,-1,-1,17,21,9,11]],Z:[20,[17,21,3,0,-1,-1,3,21,17,21,-1,-1,3,0,17,0]],"[":[14,[4,25,4,-7,-1,-1,5,25,5,-7,-1,-1,4,25,11,25,-1,-1,4,-7,11,-7]],"\\":[14,[0,21,14,-3]],"]":[14,[9,25,9,-7,-1,-1,10,25,10,-7,-1,-1,3,25,10,25,-1,-1,3,-7,10,-7]],"^":[16,[6,15,8,18,10,15,-1,-1,3,12,8,17,13,12,-1,-1,8,17,8,0]],_:[16,[0,-2,16,-2]],"`":[10,[6,21,5,20,4,18,4,16,5,15,6,16,5,17]],a:[19,[15,14,15,0,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],b:[19,[4,21,4,0,-1,-1,4,11,6,13,8,14,11,14,13,13,15,11,16,8,16,6,15,3,13,1,11,0,8,0,6,1,4,3]],c:[18,[15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],d:[19,[15,21,15,0,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],e:[18,[3,8,15,8,15,10,14,12,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],f:[12,[10,21,8,21,6,20,5,17,5,0,-1,-1,2,14,9,14]],g:[19,[15,14,15,-2,14,-5,13,-6,11,-7,8,-7,6,-6,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],h:[19,[4,21,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0]],i:[8,[3,21,4,20,5,21,4,22,3,21,-1,-1,4,14,4,0]],j:[10,[5,21,6,20,7,21,6,22,5,21,-1,-1,6,14,6,-3,5,-6,3,-7,1,-7]],k:[17,[4,21,4,0,-1,-1,14,14,4,4,-1,-1,8,8,15,0]],l:[8,[4,21,4,0]],m:[30,[4,14,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0,-1,-1,15,10,18,13,20,14,23,14,25,13,26,10,26,0]],n:[19,[4,14,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0]],o:[19,[8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3,16,6,16,8,15,11,13,13,11,14,8,14]],p:[19,[4,14,4,-7,-1,-1,4,11,6,13,8,14,11,14,13,13,15,11,16,8,16,6,15,3,13,1,11,0,8,0,6,1,4,3]],q:[19,[15,14,15,-7,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],r:[13,[4,14,4,0,-1,-1,4,8,5,11,7,13,9,14,12,14]],s:[17,[14,11,13,13,10,14,7,14,4,13,3,11,4,9,6,8,11,7,13,6,14,4,14,3,13,1,10,0,7,0,4,1,3,3]],t:[12,[5,21,5,4,6,1,8,0,10,0,-1,-1,2,14,9,14]],u:[19,[4,14,4,4,5,1,7,0,10,0,12,1,15,4,-1,-1,15,14,15,0]],v:[16,[2,14,8,0,-1,-1,14,14,8,0]],w:[22,[3,14,7,0,-1,-1,11,14,7,0,-1,-1,11,14,15,0,-1,-1,19,14,15,0]],x:[17,[3,14,14,0,-1,-1,14,14,3,0]],y:[16,[2,14,8,0,-1,-1,14,14,8,0,6,-4,4,-6,2,-7,1,-7]],z:[17,[14,14,3,0,-1,-1,3,14,14,14,-1,-1,3,0,14,0]],"{":[14,[9,25,7,24,6,23,5,21,5,19,6,17,7,16,8,14,8,12,6,10,-1,-1,7,24,6,22,6,20,7,18,8,17,9,15,9,13,8,11,4,9,8,7,9,5,9,3,8,1,7,0,6,-2,6,-4,7,-6,-1,-1,6,8,8,6,8,4,7,2,6,1,5,-1,5,-3,6,-5,7,-6,9,-7]],"|":[8,[4,25,4,-7]],"}":[14,[5,25,7,24,8,23,9,21,9,19,8,17,7,16,6,14,6,12,8,10,-1,-1,7,24,8,22,8,20,7,18,6,17,5,15,5,13,6,11,10,9,6,7,5,5,5,3,6,1,7,0,8,-2,8,-4,7,-6,-1,-1,8,8,6,6,6,4,7,2,8,1,9,-1,9,-3,8,-5,7,-6,5,-7]],"~":[24,[3,6,3,8,4,11,6,12,8,12,10,11,14,8,16,7,18,7,20,8,21,10,-1,-1,3,8,4,10,6,11,8,11,10,10,14,7,16,6,18,6,20,7,21,10,21,12]]}},function(e,t,i){var r=i(21),y=i(3),d=i(35),n=i(0),h=i(26).number,o=i(282),a=i(27),s=(a.CanonicalTileID,a.UnwrappedTileID),l=i(6),u=i(22),p=u.vec4,c=u.mat4,f=u.mat2,m=(function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(g.prototype,[{key:"clone",value:function(){var e=new g(this._minZoom,this._maxZoom,this._renderWorldCopies);return e.tileSize=this.tileSize,e.latRange=this.latRange,e.width=this.width,e.height=this.height,e._center=this._center,e.zoom=this.zoom,e.angle=this.angle,e._fov=this._fov,e._pitch=this._pitch,e._unmodified=this._unmodified,e._calcMatrices(),e}},{key:"coveringZoomLevel",value:function(e){return(e.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/e.tileSize))}},{key:"getVisibleUnwrappedCoordinates",value:function(e){var t=this.pointCoordinate(new y(0,0),0),i=this.pointCoordinate(new y(this.width,0),0),r=Math.floor(t.column),n=Math.floor(i.column),a=[new s(0,e)];if(this._renderWorldCopies)for(var o=r;o<=n;o++)0!==o&&a.push(new s(o,e));return a}},{key:"coveringTiles",value:function(e){var t=this.coveringZoomLevel(e),i=t;if(void 0!==e.minzoom&&t<e.minzoom)return[];void 0!==e.maxzoom&&t>e.maxzoom&&(t=e.maxzoom);var r=this.pointCoordinate(this.centerPoint,t),n=new y(r.column-.5,r.row-.5),a=[this.pointCoordinate(new y(0,0),t),this.pointCoordinate(new y(this.width,0),t),this.pointCoordinate(new y(this.width,this.height),t),this.pointCoordinate(new y(0,this.height),t)];return o(t,a,e.reparseOverscaled?i:t,this._renderWorldCopies).sort(function(e,t){return n.dist(e.canonical)-n.dist(t.canonical)})}},{key:"resize",value:function(e,t){this.width=e,this.height=t,this.pixelsToGLUnits=[2/e,-2/t],this._constrain(),this._calcMatrices()}},{key:"zoomScale",value:function(e){return Math.pow(2,e)}},{key:"scaleZoom",value:function(e){return Math.log(e)/Math.LN2}},{key:"project",value:function(e){return new y(this.lngX(e.lng),this.latY(e.lat))}},{key:"unproject",value:function(e){return new r(this.xLng(e.x),this.yLat(e.y))}},{key:"lngX",value:function(e){return(180+e)*this.worldSize/360}},{key:"latY",value:function(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))*this.worldSize/360}},{key:"xLng",value:function(e){return 360*e/this.worldSize-180}},{key:"yLat",value:function(e){var t=180-360*e/this.worldSize;return 360/Math.PI*Math.atan(Math.exp(t*Math.PI/180))-90}},{key:"setLocationAtPoint",value:function(e,t){var i=this.pointCoordinate(t)._sub(this.pointCoordinate(this.centerPoint));this.center=this.coordinateLocation(this.locationCoordinate(e)._sub(i)),this._renderWorldCopies&&(this.center=this.center.wrap())}},{key:"locationPoint",value:function(e){return this.coordinatePoint(this.locationCoordinate(e))}},{key:"pointLocation",value:function(e){return this.coordinateLocation(this.pointCoordinate(e))}},{key:"locationCoordinate",value:function(e){return new d(this.lngX(e.lng)/this.tileSize,this.latY(e.lat)/this.tileSize,this.zoom).zoomTo(this.tileZoom)}},{key:"coordinateLocation",value:function(e){var t=e.zoomTo(this.zoom);return new r(this.xLng(t.column*this.tileSize),this.yLat(t.row*this.tileSize))}},{key:"pointCoordinate",value:function(e,t){void 0===t&&(t=this.tileZoom);var i=[e.x,e.y,0,1],r=[e.x,e.y,1,1];p.transformMat4(i,i,this.pixelMatrixInverse),p.transformMat4(r,r,this.pixelMatrixInverse);var n=i[3],a=r[3],o=i[1]/n,s=r[1]/a,l=i[2]/n,u=r[2]/a,c=l==u?0:(0-l)/(u-l);return new d(h(i[0]/n,r[0]/a,c)/this.tileSize,h(o,s,c)/this.tileSize,this.zoom)._zoomTo(t)}},{key:"coordinatePoint",value:function(e){var t=e.zoomTo(this.zoom),i=[t.column*this.tileSize,t.row*this.tileSize,0,1];return p.transformMat4(i,i,this.pixelMatrix),new y(i[0]/i[3],i[1]/i[3])}},{key:"calculatePosMatrix",value:function(e){var t=e.key;if(this._posMatrixCache[t])return this._posMatrixCache[t];var i=e.canonical,r=this.worldSize/this.zoomScale(i.z),n=i.x+Math.pow(2,i.z)*e.wrap,a=c.identity(new Float64Array(16));return c.translate(a,a,[n*r,i.y*r,0]),c.scale(a,a,[r/l,r/l,1]),c.multiply(a,this.projMatrix,a),this._posMatrixCache[t]=new Float32Array(a),this._posMatrixCache[t]}},{key:"_constrain",value:function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var e,t,i,r,n=-90,a=90,o=-180,s=180,l=this.size,u=this._unmodified;if(this.latRange){var c=this.latRange;n=this.latY(c[1]),e=(a=this.latY(c[0]))-n<l.y?l.y/(a-n):0}if(this.lngRange){var d=this.lngRange;o=this.lngX(d[0]),t=(s=this.lngX(d[1]))-o<l.x?l.x/(s-o):0}var h=Math.max(t||0,e||0);if(h)return this.center=this.unproject(new y(t?(s+o)/2:this.x,e?(a+n)/2:this.y)),this.zoom+=this.scaleZoom(h),this._unmodified=u,void(this._constraining=!1);if(this.latRange){var p=this.y,f=l.y/2;p-f<n&&(r=n+f),a<p+f&&(r=a-f)}if(this.lngRange){var m=this.x,g=l.x/2;m-g<o&&(i=o+g),s<m+g&&(i=s-g)}void 0===i&&void 0===r||(this.center=this.unproject(new y(void 0!==i?i:this.x,void 0!==r?r:this.y))),this._unmodified=u,this._constraining=!1}}},{key:"_calcMatrices",value:function(){if(this.height){this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;var e=this._fov/2,t=Math.PI/2+this._pitch,i=Math.sin(e)*this.cameraToCenterDistance/Math.sin(Math.PI-t-e),r=1.01*(Math.cos(Math.PI/2-this._pitch)*i+this.cameraToCenterDistance),n=new Float64Array(16);c.perspective(n,this._fov,this.width/this.height,1,r),c.scale(n,n,[1,-1,1]),c.translate(n,n,[0,0,-this.cameraToCenterDistance]),c.rotateX(n,n,this._pitch),c.rotateZ(n,n,this.angle),c.translate(n,n,[-this.x,-this.y,0]);var a=this.worldSize/(2*Math.PI*6378137*Math.abs(Math.cos(this.center.lat*(Math.PI/180))));if(c.scale(n,n,[1,1,a,1]),this.projMatrix=n,n=c.create(),c.scale(n,n,[this.width/2,-this.height/2,1]),c.translate(n,n,[1,-1,0]),this.pixelMatrix=c.multiply(new Float64Array(16),n,this.projMatrix),!(n=c.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=n,this._posMatrixCache={}}}},{key:"minZoom",get:function(){return this._minZoom},set:function(e){this._minZoom!==e&&(this._minZoom=e,this.zoom=Math.max(this.zoom,e))}},{key:"maxZoom",get:function(){return this._maxZoom},set:function(e){this._maxZoom!==e&&(this._maxZoom=e,this.zoom=Math.min(this.zoom,e))}},{key:"renderWorldCopies",get:function(){return this._renderWorldCopies}},{key:"worldSize",get:function(){return this.tileSize*this.scale}},{key:"centerPoint",get:function(){return this.size._div(2)}},{key:"size",get:function(){return new y(this.width,this.height)}},{key:"bearing",get:function(){return-this.angle/Math.PI*180},set:function(e){var t=-n.wrap(e,-180,180)*Math.PI/180;this.angle!==t&&(this._unmodified=!1,this.angle=t,this._calcMatrices(),this.rotationMatrix=f.create(),f.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))}},{key:"pitch",get:function(){return this._pitch/Math.PI*180},set:function(e){var t=n.clamp(e,0,60)/180*Math.PI;this._pitch!==t&&(this._unmodified=!1,this._pitch=t,this._calcMatrices())}},{key:"fov",get:function(){return this._fov/Math.PI*180},set:function(e){e=Math.max(.01,Math.min(60,e)),this._fov!==e&&(this._unmodified=!1,this._fov=e/180*Math.PI,this._calcMatrices())}},{key:"zoom",get:function(){return this._zoom},set:function(e){var t=Math.min(Math.max(e,this.minZoom),this.maxZoom);this._zoom!==t&&(this._unmodified=!1,this._zoom=t,this.scale=this.zoomScale(t),this.tileZoom=Math.floor(t),this.zoomFraction=t-this.tileZoom,this._constrain(),this._calcMatrices())}},{key:"center",get:function(){return this._center},set:function(e){e.lat===this._center.lat&&e.lng===this._center.lng||(this._unmodified=!1,this._center=e,this._constrain(),this._calcMatrices())}},{key:"unmodified",get:function(){return this._unmodified}},{key:"x",get:function(){return this.lngX(this.center.lng)}},{key:"y",get:function(){return this.latY(this.center.lat)}},{key:"point",get:function(){return new y(this.x,this.y)}}]),g);function g(e,t,i){!function(e){if(!(e instanceof g))throw new TypeError("Cannot call a class as a function")}(this),this.tileSize=512,this._renderWorldCopies=void 0===i||i,this._minZoom=e||0,this._maxZoom=t||22,this.latRange=[-85.05113,85.05113],this.width=0,this.height=0,this._center=new r(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._posMatrixCache={}}e.exports=m},function(e,t,i){i(35);var d=i(27).OverscaledTileID;function c(e,t){if(e.row>t.row){var i=e;e=t,t=i}return{x0:e.column,y0:e.row,x1:t.column,y1:t.row,dx:t.column-e.column,dy:t.row-e.row}}function h(e,t,i,r,n){var a=Math.max(i,Math.floor(t.y0)),o=Math.min(r,Math.ceil(t.y1));if(e.x0===t.x0&&e.y0===t.y0?e.x0+t.dy/e.dy*e.dx<t.x1:e.x1-t.dy/e.dy*e.dx<t.x0){var s=e;e=t,t=s}for(var l=e.dx/e.dy,u=t.dx/t.dy,c=0<e.dx,d=t.dx<0,h=a;h<o;h++){var p=l*Math.max(0,Math.min(e.dy,h+c-e.y0))+e.x0,f=u*Math.max(0,Math.min(t.dy,h+d-t.y0))+t.x0;n(Math.floor(f),Math.ceil(p),h)}}function r(e,t,i,r,n,a){var o,s=c(e,t),l=c(t,i),u=c(i,e);s.dy>l.dy&&(o=s,s=l,l=o),s.dy>u.dy&&(o=s,s=u,u=o),l.dy>u.dy&&(o=l,l=u,u=o),s.dy&&h(u,s,r,n,a),l.dy&&h(u,l,r,n,a)}e.exports=function(o,e,s,l){void 0===l&&(l=!0);var u=1<<o,c={};function t(e,t,i){var r,n,a;if(0<=i&&i<=u)for(r=e;r<t;r++)0!==(n=Math.floor(r/u))&&!0!==l||(a=new d(s,n,o,(r%u+u)%u,i),c[a.key]=a)}return r(e[0],e[1],e[2],0,u,t),r(e[2],e[3],e[0],0,u,t),Object.keys(c).map(function(e){return c[e]})}},function(e,t,i){var r=i(0),n=i(5),a=i(284),o=(function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(s.prototype,[{key:"addTo",value:function(e){return this._map=e,n.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}},{key:"remove",value:function(){return n.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),delete this._map,this}},{key:"getHashString",value:function(e){var t=this._map.getCenter(),i=Math.round(100*this._map.getZoom())/100,r=Math.ceil((i*Math.LN2+Math.log(512/360/.5))/Math.LN10),n=Math.pow(10,r),a=Math.round(t.lng*n)/n,o=Math.round(t.lat*n)/n,s=this._map.getBearing(),l=this._map.getPitch(),u="";return u+=e?"#/".concat(a,"/").concat(o,"/").concat(i):"#".concat(i,"/").concat(o,"/").concat(a),(s||l)&&(u+="/".concat(Math.round(10*s)/10)),l&&(u+="/".concat(Math.round(l))),u}},{key:"_onHashChange",value:function(){var e=n.location.hash.replace("#","").split("/");return 3<=e.length&&(this._map.jumpTo({center:[+e[2],+e[1]],zoom:+e[0],bearing:+(e[3]||0),pitch:+(e[4]||0)}),!0)}},{key:"_updateHashUnthrottled",value:function(){var e=this.getHashString();n.history.replaceState("","",e)}}]),s);function s(){!function(e){if(!(e instanceof s))throw new TypeError("Cannot call a class as a function")}(this),r.bindAll(["_onHashChange","_updateHash"],this),this._updateHash=a(this._updateHashUnthrottled.bind(this),300)}e.exports=o},function(e,t){e.exports=function(t,i){var r=!1,n=0;return function(){return r=!0,n||function e(){n=0,r&&(t(),n=setTimeout(e,i),r=!1)}(),n}}},function(e,t,i){var d=i(9),h=i(3),p={scrollZoom:i(286),boxZoom:i(287),dragRotate:i(127),dragPan:i(288),keyboard:i(289),doubleClickZoom:i(290),touchZoomRotate:i(291)};e.exports=function(n,e){var a=n.getCanvasContainer(),i=null,r=!1,t=null,o=null;for(var s in p)n[s]=new p[s](n,e),e.interactive&&e[s]&&n[s].enable(e[s]);function l(){o=null}function u(e,t){var i=d.mousePos(a,t);return n.fire(e,{lngLat:n.unproject(i),point:i,originalEvent:t})}function c(e,t){var i=d.touchPos(a,t),r=i.reduce(function(e,t,i,r){return e.add(t.div(r.length))},new h(0,0));return n.fire(e,{lngLat:n.unproject(r),point:r,lngLats:i.map(function(e){return n.unproject(e)},this),points:i,originalEvent:t})}a.addEventListener("mouseout",function(e){u("mouseout",e)},!1),a.addEventListener("mousedown",function(e){n.doubleClickZoom.isActive()||n.stop(),t=d.mousePos(a,e),u("mousedown",e),r=!0},!1),a.addEventListener("mouseup",function(e){var t=n.dragRotate&&n.dragRotate.isActive();i&&!t&&u("contextmenu",i),i=null,r=!1,u("mouseup",e)},!1),a.addEventListener("mousemove",function(e){if(!(n.dragPan&&n.dragPan.isActive()||n.dragRotate&&n.dragRotate.isActive())){for(var t=e.toElement||e.target;t&&t!==a;)t=t.parentNode;t===a&&u("mousemove",e)}},!1),a.addEventListener("touchstart",function(e){n.stop(),c("touchstart",e),!e.touches||1<e.touches.length||(o?(clearTimeout(o),o=null,u("dblclick",e)):o=setTimeout(l,300))},!1),a.addEventListener("touchend",function(e){c("touchend",e)},!1),a.addEventListener("touchmove",function(e){c("touchmove",e)},!1),a.addEventListener("touchcancel",function(e){c("touchcancel",e)},!1),a.addEventListener("click",function(e){d.mousePos(a,e).equals(t)&&u("click",e)},!1),a.addEventListener("dblclick",function(e){u("dblclick",e),e.preventDefault()},!1),a.addEventListener("contextmenu",function(e){var t=n.dragRotate&&n.dragRotate.isActive();r||t?r&&(i=e):u("contextmenu",e),e.preventDefault()},!1)}},function(e,t,i){var n=i(9),r=i(0),a=i(2),o=i(5),s=o.navigator.userAgent.toLowerCase(),l=-1!==s.indexOf("firefox"),u=-1!==s.indexOf("safari")&&-1===s.indexOf("chrom"),c=(function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(d.prototype,[{key:"isEnabled",value:function(){return!!this._enabled}},{key:"enable",value:function(e){this.isEnabled()||(this._el.addEventListener("wheel",this._onWheel,!1),this._el.addEventListener("mousewheel",this._onWheel,!1),this._enabled=!0,this._aroundCenter=e&&"center"===e.around)}},{key:"disable",value:function(){this.isEnabled()&&(this._el.removeEventListener("wheel",this._onWheel),this._el.removeEventListener("mousewheel",this._onWheel),this._enabled=!1)}},{key:"_onWheel",value:function(e){var t=0;"wheel"===e.type?(t=e.deltaY,l&&e.deltaMode===o.WheelEvent.DOM_DELTA_PIXEL&&(t/=a.devicePixelRatio),e.deltaMode===o.WheelEvent.DOM_DELTA_LINE&&(t*=40)):"mousewheel"===e.type&&(t=-e.wheelDeltaY,u&&(t/=3));var i=a.now(),r=i-(this._time||0);this._pos=n.mousePos(this._el,e),this._time=i,0!==t&&t%4.000244140625==0?this._type="wheel":0!==t&&Math.abs(t)<4?this._type="trackpad":400<r?(this._type=null,this._lastValue=t,this._timeout=setTimeout(this._onTimeout,40)):this._type||(this._type=Math.abs(r*t)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,t+=this._lastValue)),e.shiftKey&&t&&(t/=4),this._type&&this._zoom(-t,e),e.preventDefault()}},{key:"_onTimeout",value:function(){this._type="wheel",this._zoom(-this._lastValue)}},{key:"_zoom",value:function(e,t){if(0!==e){var i=this._map,r=2/(1+Math.exp(-Math.abs(e/100)));e<0&&0!==r&&(r=1/r);var n=i.ease?i.ease.to:i.transform.scale,a=i.transform.scaleZoom(n*r);i.zoomTo(a,{duration:"wheel"===this._type?200:0,around:this._aroundCenter?i.getCenter():i.unproject(this._pos),delayEndEvents:200,smoothEasing:!0},{originalEvent:t})}}}]),d);function d(e){!function(e){if(!(e instanceof d))throw new TypeError("Cannot call a class as a function")}(this),this._map=e,this._el=e.getCanvasContainer(),r.bindAll(["_onWheel","_onTimeout"],this)}e.exports=c},function(e,t,i){var s=i(9),n=i(39),r=i(0),a=i(5),o=(function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(l.prototype,[{key:"isEnabled",value:function(){return!!this._enabled}},{key:"isActive",value:function(){return!!this._active}},{key:"enable",value:function(){this.isEnabled()||(this._map.dragPan&&this._map.dragPan.disable(),this._el.addEventListener("mousedown",this._onMouseDown,!1),this._map.dragPan&&this._map.dragPan.enable(),this._enabled=!0)}},{key:"disable",value:function(){this.isEnabled()&&(this._el.removeEventListener("mousedown",this._onMouseDown),this._enabled=!1)}},{key:"_onMouseDown",value:function(e){e.shiftKey&&0===e.button&&(a.document.addEventListener("mousemove",this._onMouseMove,!1),a.document.addEventListener("keydown",this._onKeyDown,!1),a.document.addEventListener("mouseup",this._onMouseUp,!1),s.disableDrag(),this._startPos=s.mousePos(this._el,e),this._active=!0)}},{key:"_onMouseMove",value:function(e){var t=this._startPos,i=s.mousePos(this._el,e);this._box||(this._box=s.create("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",e));var r=Math.min(t.x,i.x),n=Math.max(t.x,i.x),a=Math.min(t.y,i.y),o=Math.max(t.y,i.y);s.setTransform(this._box,"translate(".concat(r,"px,").concat(a,"px)")),this._box.style.width="".concat(n-r,"px"),this._box.style.height="".concat(o-a,"px")}},{key:"_onMouseUp",value:function(e){if(0===e.button){var t=this._startPos,i=s.mousePos(this._el,e),r=(new n).extend(this._map.unproject(t)).extend(this._map.unproject(i));this._finish(),t.x===i.x&&t.y===i.y?this._fireEvent("boxzoomcancel",e):this._map.fitBounds(r,{linear:!0}).fire("boxzoomend",{originalEvent:e,boxZoomBounds:r})}}},{key:"_onKeyDown",value:function(e){27===e.keyCode&&(this._finish(),this._fireEvent("boxzoomcancel",e))}},{key:"_finish",value:function(){this._active=!1,a.document.removeEventListener("mousemove",this._onMouseMove,!1),a.document.removeEventListener("keydown",this._onKeyDown,!1),a.document.removeEventListener("mouseup",this._onMouseUp,!1),this._container.classList.remove("mapboxgl-crosshair"),this._box&&(s.remove(this._box),this._box=null),s.enableDrag()}},{key:"_fireEvent",value:function(e,t){return this._map.fire(e,{originalEvent:t})}}]),l);function l(e){!function(e){if(!(e instanceof l))throw new TypeError("Cannot call a class as a function")}(this),this._map=e,this._el=e.getCanvasContainer(),this._container=e.getContainer(),r.bindAll(["_onMouseDown","_onMouseMove","_onMouseUp","_onKeyDown"],this)}e.exports=o},function(e,t,i){var r=i(9),n=i(0),a=i(5),o=i(2),h=n.bezier(0,0,.3,1),s=(function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(l.prototype,[{key:"isEnabled",value:function(){return!!this._enabled}},{key:"isActive",value:function(){return!!this._active}},{key:"enable",value:function(){this.isEnabled()||(this._el.classList.add("mapboxgl-touch-drag-pan"),this._el.addEventListener("mousedown",this._onDown),this._el.addEventListener("touchstart",this._onDown),this._enabled=!0)}},{key:"disable",value:function(){this.isEnabled()&&(this._el.classList.remove("mapboxgl-touch-drag-pan"),this._el.removeEventListener("mousedown",this._onDown),this._el.removeEventListener("touchstart",this._onDown),this._enabled=!1)}},{key:"_onDown",value:function(e){this._ignoreEvent(e)||this.isActive()||(e.touches?(a.document.addEventListener("touchmove",this._onMove),a.document.addEventListener("touchend",this._onTouchEnd)):(a.document.addEventListener("mousemove",this._onMove),a.document.addEventListener("mouseup",this._onMouseUp)),a.addEventListener("blur",this._onMouseUp),this._active=!1,this._startPos=this._pos=r.mousePos(this._el,e),this._inertia=[[o.now(),this._pos]])}},{key:"_onMove",value:function(e){if(!this._ignoreEvent(e)){this.isActive()||(this._active=!0,this._map.moving=!0,this._fireEvent("dragstart",e),this._fireEvent("movestart",e));var t=r.mousePos(this._el,e),i=this._map;i.stop(),this._drainInertiaBuffer(),this._inertia.push([o.now(),t]),i.transform.setLocationAtPoint(i.transform.pointLocation(this._pos),t),this._fireEvent("drag",e),this._fireEvent("move",e),this._pos=t,e.preventDefault()}}},{key:"_onUp",value:function(e){var t=this;if(this.isActive()){this._active=!1,this._fireEvent("dragend",e),this._drainInertiaBuffer();var i=function(){t._map.moving=!1,t._fireEvent("moveend",e)},r=this._inertia;if(r.length<2)i();else{var n=r[r.length-1],a=r[0],o=n[1].sub(a[1]),s=(n[0]-a[0])/1e3;if(0==s||n[1].equals(a[1]))i();else{var l=o.mult(.3/s),u=l.mag();1400<u&&(u=1400,l._unit()._mult(u));var c=u/750,d=l.mult(-c/2);this._map.panBy(d,{duration:1e3*c,easing:h,noMoveStart:!0},{originalEvent:e})}}}}},{key:"_onMouseUp",value:function(e){this._ignoreEvent(e)||(this._onUp(e),a.document.removeEventListener("mousemove",this._onMove),a.document.removeEventListener("mouseup",this._onMouseUp),a.removeEventListener("blur",this._onMouseUp))}},{key:"_onTouchEnd",value:function(e){this._ignoreEvent(e)||(this._onUp(e),a.document.removeEventListener("touchmove",this._onMove),a.document.removeEventListener("touchend",this._onTouchEnd))}},{key:"_fireEvent",value:function(e,t){return this._map.fire(e,{originalEvent:t})}},{key:"_ignoreEvent",value:function(e){var t=this._map;return!(!t.boxZoom||!t.boxZoom.isActive())||!(!t.dragRotate||!t.dragRotate.isActive())||(e.touches?1<e.touches.length:!!e.ctrlKey||"mousemove"!==e.type&&e.button&&0!==e.button)}},{key:"_drainInertiaBuffer",value:function(){for(var e=this._inertia,t=o.now();0<e.length&&160<t-e[0][0];)e.shift()}}]),l);function l(e){!function(e){if(!(e instanceof l))throw new TypeError("Cannot call a class as a function")}(this),this._map=e,this._el=e.getCanvasContainer(),n.bindAll(["_onDown","_onMove","_onUp","_onTouchEnd","_onMouseUp"],this)}e.exports=s},function(e,t,i){var r=i(0),n=(function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(a.prototype,[{key:"isEnabled",value:function(){return!!this._enabled}},{key:"enable",value:function(){this.isEnabled()||(this._el.addEventListener("keydown",this._onKeyDown,!1),this._enabled=!0)}},{key:"disable",value:function(){this.isEnabled()&&(this._el.removeEventListener("keydown",this._onKeyDown),this._enabled=!1)}},{key:"_onKeyDown",value:function(e){if(!(e.altKey||e.ctrlKey||e.metaKey)){var t=0,i=0,r=0,n=0,a=0;switch(e.keyCode){case 61:case 107:case 171:case 187:t=1;break;case 189:case 109:case 173:t=-1;break;case 37:e.shiftKey?i=-1:(e.preventDefault(),n=-1);break;case 39:e.shiftKey?i=1:(e.preventDefault(),n=1);break;case 38:e.shiftKey?r=1:(e.preventDefault(),a=-1);break;case 40:e.shiftKey?r=-1:(a=1,e.preventDefault());break;default:return}var o=this._map,s=o.getZoom(),l={duration:300,delayEndEvents:500,easing:u,zoom:t?Math.round(s)+t*(e.shiftKey?2:1):s,bearing:o.getBearing()+15*i,pitch:o.getPitch()+10*r,offset:[100*-n,100*-a],center:o.getCenter()};o.easeTo(l,{originalEvent:e})}}}]),a);function a(e){!function(e){if(!(e instanceof a))throw new TypeError("Cannot call a class as a function")}(this),this._map=e,this._el=e.getCanvasContainer(),r.bindAll(["_onKeyDown"],this)}function u(e){return e*(2-e)}e.exports=n},function(e,t,i){var r=i(0),n=(function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(a.prototype,[{key:"isEnabled",value:function(){return!!this._enabled}},{key:"isActive",value:function(){return!!this._active}},{key:"enable",value:function(){this.isEnabled()||(this._map.on("dblclick",this._onDblClick),this._enabled=!0)}},{key:"disable",value:function(){this.isEnabled()&&(this._map.off("dblclick",this._onDblClick),this._enabled=!1)}},{key:"_onDblClick",value:function(e){this._active=!0,this._map.on("zoomend",this._onZoomEnd),this._map.zoomTo(this._map.getZoom()+(e.originalEvent.shiftKey?-1:1),{around:e.lngLat},e)}},{key:"_onZoomEnd",value:function(){this._active=!1,this._map.off("zoomend",this._onZoomEnd)}}]),a);function a(e){!function(e){if(!(e instanceof a))throw new TypeError("Cannot call a class as a function")}(this),this._map=e,r.bindAll(["_onDblClick","_onZoomEnd"],this)}e.exports=n},function(e,t,i){var c=i(9),r=i(0),p=i(5),d=i(2),f=r.bezier(0,0,.15,1),n=(function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(a.prototype,[{key:"isEnabled",value:function(){return!!this._enabled}},{key:"enable",value:function(e){this.isEnabled()||(this._el.classList.add("mapboxgl-touch-zoom-rotate"),this._el.addEventListener("touchstart",this._onStart,!1),this._enabled=!0,this._aroundCenter=e&&"center"===e.around)}},{key:"disable",value:function(){this.isEnabled()&&(this._el.classList.remove("mapboxgl-touch-zoom-rotate"),this._el.removeEventListener("touchstart",this._onStart),this._enabled=!1)}},{key:"disableRotation",value:function(){this._rotationDisabled=!0}},{key:"enableRotation",value:function(){this._rotationDisabled=!1}},{key:"_onStart",value:function(e){if(2===e.touches.length){var t=c.mousePos(this._el,e.touches[0]),i=c.mousePos(this._el,e.touches[1]);this._startVec=t.sub(i),this._startScale=this._map.transform.scale,this._startBearing=this._map.transform.bearing,this._gestureIntent=void 0,this._inertia=[],p.document.addEventListener("touchmove",this._onMove,!1),p.document.addEventListener("touchend",this._onEnd,!1)}}},{key:"_onMove",value:function(e){if(2===e.touches.length){var t=c.mousePos(this._el,e.touches[0]),i=c.mousePos(this._el,e.touches[1]),r=t.add(i).div(2),n=t.sub(i),a=n.mag()/this._startVec.mag(),o=this._rotationDisabled?0:180*n.angleWith(this._startVec)/Math.PI,s=this._map;if(this._gestureIntent){var l={duration:0,around:s.unproject(r)};"rotate"===this._gestureIntent&&(l.bearing=this._startBearing+o),"zoom"!==this._gestureIntent&&"rotate"!==this._gestureIntent||(l.zoom=s.transform.scaleZoom(this._startScale*a)),s.stop(),this._drainInertiaBuffer(),this._inertia.push([d.now(),a,r]),s.easeTo(l,{originalEvent:e})}else{var u=.15<Math.abs(1-a);10<Math.abs(o)?this._gestureIntent="rotate":u&&(this._gestureIntent="zoom"),this._gestureIntent&&(this._startVec=n,this._startScale=s.transform.scale,this._startBearing=s.transform.bearing)}e.preventDefault()}}},{key:"_onEnd",value:function(e){p.document.removeEventListener("touchmove",this._onMove),p.document.removeEventListener("touchend",this._onEnd),this._drainInertiaBuffer();var t=this._inertia,i=this._map;if(t.length<2)i.snapToNorth({},{originalEvent:e});else{var r=t[t.length-1],n=t[0],a=i.transform.scaleZoom(this._startScale*r[1]),o=i.transform.scaleZoom(this._startScale*n[1]),s=a-o,l=(r[0]-n[0])/1e3,u=r[2];if(0!=l&&a!==o){var c=.15*s/l;2.5<Math.abs(c)&&(c=0<c?2.5:-2.5);var d=1e3*Math.abs(c/(12*.15)),h=a+c*d/2e3;h<0&&(h=0),i.easeTo({zoom:h,duration:d,easing:f,around:this._aroundCenter?i.getCenter():i.unproject(u)},{originalEvent:e})}else i.snapToNorth({},{originalEvent:e})}}},{key:"_drainInertiaBuffer",value:function(){for(var e=this._inertia,t=d.now();2<e.length&&160<t-e[0][0];)e.shift()}}]),a);function a(e){!function(e){if(!(e instanceof a))throw new TypeError("Cannot call a class as a function")}(this),this._map=e,this._el=e.getCanvasContainer(),r.bindAll(["_onStart","_onMove","_onEnd"],this)}e.exports=n},function(e,t,i){function r(e){return(r="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})(e)}function n(e){return(n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function a(e,t){return(a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var O=i(0),R=i(26).number,s=i(2),L=i(21),f=i(39),N=i(3),o=(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(l,i(10)),function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(l.prototype,[{key:"getCenter",value:function(){return this.transform.center}},{key:"setCenter",value:function(e,t){return this.jumpTo({center:e},t)}},{key:"panBy",value:function(e,t,i){return e=N.convert(e).mult(-1),this.panTo(this.transform.center,O.extend({offset:e},t),i)}},{key:"panTo",value:function(e,t,i){return this.easeTo(O.extend({center:e},t),i)}},{key:"getZoom",value:function(){return this.transform.zoom}},{key:"setZoom",value:function(e,t){return this.jumpTo({zoom:e},t),this}},{key:"zoomTo",value:function(e,t,i){return this.easeTo(O.extend({zoom:e},t),i)}},{key:"zoomIn",value:function(e,t){return this.zoomTo(this.getZoom()+1,e,t),this}},{key:"zoomOut",value:function(e,t){return this.zoomTo(this.getZoom()-1,e,t),this}},{key:"getBearing",value:function(){return this.transform.bearing}},{key:"setBearing",value:function(e,t){return this.jumpTo({bearing:e},t),this}},{key:"rotateTo",value:function(e,t,i){return this.easeTo(O.extend({bearing:e},t),i)}},{key:"resetNorth",value:function(e,t){return this.rotateTo(0,O.extend({duration:1e3},e),t),this}},{key:"snapToNorth",value:function(e,t){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(e,t):this}},{key:"getPitch",value:function(){return this.transform.pitch}},{key:"setPitch",value:function(e,t){return this.jumpTo({pitch:e},t),this}},{key:"fitBounds",value:function(e,t,i){if("number"==typeof(t=O.extend({padding:{top:0,bottom:0,right:0,left:0},offset:[0,0],maxZoom:this.transform.maxZoom},t)).padding){var r=t.padding;t.padding={top:r,bottom:r,right:r,left:r}}if(!O.deepEqual(Object.keys(t.padding).sort(function(e,t){return e<t?-1:t<e?1:0}),["bottom","left","right","top"]))return O.warnOnce("options.padding must be a positive number, or an Object with keys 'bottom', 'left', 'right', 'top'"),this;e=f.convert(e);var n=[(t.padding.left-t.padding.right)/2,(t.padding.top-t.padding.bottom)/2],a=Math.min(t.padding.right,t.padding.left),o=Math.min(t.padding.top,t.padding.bottom);t.offset=[t.offset[0]+n[0],t.offset[1]+n[1]];var s=N.convert(t.offset),l=this.transform,u=l.project(e.getNorthWest()),c=l.project(e.getSouthEast()),d=c.sub(u),h=(l.width-2*a-2*Math.abs(s.x))/d.x,p=(l.height-2*o-2*Math.abs(s.y))/d.y;return p<0||h<0?(O.warnOnce("Map cannot fit within canvas with the given bounds, padding, and/or offset."),this):(t.center=l.unproject(u.add(c).div(2)),t.zoom=Math.min(l.scaleZoom(l.scale*Math.min(h,p)),t.maxZoom),t.bearing=0,t.linear?this.easeTo(t,i):this.flyTo(t,i))}},{key:"jumpTo",value:function(e,t){this.stop();var i=this.transform,r=!1,n=!1,a=!1;return"zoom"in e&&i.zoom!==+e.zoom&&(r=!0,i.zoom=+e.zoom),void 0!==e.center&&(i.center=L.convert(e.center)),"bearing"in e&&i.bearing!==+e.bearing&&(n=!0,i.bearing=+e.bearing),"pitch"in e&&i.pitch!==+e.pitch&&(a=!0,i.pitch=+e.pitch),this.fire("movestart",t).fire("move",t),r&&this.fire("zoomstart",t).fire("zoom",t).fire("zoomend",t),n&&this.fire("rotate",t),a&&this.fire("pitchstart",t).fire("pitch",t).fire("pitchend",t),this.fire("moveend",t)}},{key:"easeTo",value:function(e,a){var o=this;this.stop(),!1===(e=O.extend({offset:[0,0],duration:500,easing:O.ease},e)).animate&&(e.duration=0),e.smoothEasing&&0!==e.duration&&(e.easing=this._smoothOutEasing(e.duration));var s=this.transform,l=this.getZoom(),u=this.getBearing(),c=this.getPitch(),d="zoom"in e?+e.zoom:l,h="bearing"in e?this._normalizeBearing(e.bearing,u):u,p="pitch"in e?+e.pitch:c,f=s.centerPoint.add(N.convert(e.offset)),t=s.pointLocation(f),i=L.convert(e.center||t);this._normalizeCenter(i);var m,g,y=s.project(t),v=s.project(i).sub(y),_=s.zoomScale(d-l);return e.around&&(m=L.convert(e.around),g=s.locationPoint(m)),this.zooming=d!==l,this.rotating=u!==h,this.pitching=p!==c,this._prepareEase(a,e.noMoveStart),clearTimeout(this._onEaseEnd),this._ease(function(e){if(o.zooming&&(s.zoom=R(l,d,e)),o.rotating&&(s.bearing=R(u,h,e)),o.pitching&&(s.pitch=R(c,p,e)),m)s.setLocationAtPoint(m,g);else{var t=s.zoomScale(s.zoom-l),i=l<d?Math.min(2,_):Math.max(.5,_),r=Math.pow(i,1-e),n=s.unproject(y.add(v.mult(e*r)).mult(t));s.setLocationAtPoint(s.renderWorldCopies?n.wrap():n,f)}o._fireMoveEvents(a)},function(){e.delayEndEvents?o._onEaseEnd=setTimeout(function(){return o._easeToEnd(a)},e.delayEndEvents):o._easeToEnd(a)},e),this}},{key:"_prepareEase",value:function(e,t){this.moving=!0,t||this.fire("movestart",e),this.zooming&&this.fire("zoomstart",e),this.pitching&&this.fire("pitchstart",e)}},{key:"_fireMoveEvents",value:function(e){this.fire("move",e),this.zooming&&this.fire("zoom",e),this.rotating&&this.fire("rotate",e),this.pitching&&this.fire("pitch",e)}},{key:"_easeToEnd",value:function(e){var t=this.zooming,i=this.pitching;this.moving=!1,this.zooming=!1,this.rotating=!1,this.pitching=!1,t&&this.fire("zoomend",e),i&&this.fire("pitchend",e),this.fire("moveend",e)}},{key:"flyTo",value:function(e,n){var a=this;this.stop(),e=O.extend({offset:[0,0],speed:1.2,curve:1.42,easing:O.ease},e);var o=this.transform,s=this.getZoom(),l=this.getBearing(),u=this.getPitch(),t="zoom"in e?O.clamp(+e.zoom,o.minZoom,o.maxZoom):s,c="bearing"in e?this._normalizeBearing(e.bearing,l):l,d="pitch"in e?+e.pitch:u,i=o.zoomScale(t-s),h=o.centerPoint.add(N.convert(e.offset)),r=o.pointLocation(h),p=L.convert(e.center||r);this._normalizeCenter(p);var f=o.project(r),m=o.project(p).sub(f),g=e.curve,y=Math.max(o.width,o.height),v=y/i,_=m.mag();if("minZoom"in e){var C=O.clamp(Math.min(e.minZoom,s,t),o.minZoom,o.maxZoom),x=y/o.zoomScale(C-s);g=Math.sqrt(x/_*2)}var b=g*g;function A(e){var t=(v*v-y*y+(e?-1:1)*b*b*_*_)/(2*(e?v:y)*b*_);return Math.log(Math.sqrt(t*t+1)-t)}function S(e){return(Math.exp(e)-Math.exp(-e))/2}function w(e){return(Math.exp(e)+Math.exp(-e))/2}var E=A(0),T=function(e){return w(E)/w(E+g*e)},P=function(e){return y*((w(E)*(S(t=E+g*e)/w(t))-S(E))/b)/_;var t},M=(A(1)-E)/g;if(Math.abs(_)<1e-6||!isFinite(M)){if(Math.abs(y-v)<1e-6)return this.easeTo(e,n);var D=v<y?-1:1;M=Math.abs(Math.log(v/y))/g,P=function(){return 0},T=function(e){return Math.exp(D*g*e)}}if("duration"in e)e.duration=+e.duration;else{var I="screenSpeed"in e?+e.screenSpeed/g:+e.speed;e.duration=1e3*M/I}return e.maxDuration&&e.duration>e.maxDuration&&(e.duration=0),this.zooming=!0,this.rotating=l!==c,this.pitching=d!==u,this._prepareEase(n,!1),this._ease(function(e){var t=e*M,i=1/T(t);o.zoom=s+o.scaleZoom(i),a.rotating&&(o.bearing=R(l,c,e)),a.pitching&&(o.pitch=R(u,d,e));var r=o.unproject(f.add(m.mult(P(t))).mult(i));o.setLocationAtPoint(o.renderWorldCopies?r.wrap():r,h),a._fireMoveEvents(n)},function(){return a._easeToEnd(n)},e),this}},{key:"isEasing",value:function(){return!!this._easeFn}},{key:"isMoving",value:function(){return this.moving}},{key:"stop",value:function(){return this._easeFn&&this._finishEase(),this}},{key:"_ease",value:function(e,t,i){!1===i.animate||0===i.duration?(e(1),t()):(this._easeStart=s.now(),this._easeFn=e,this._finishFn=t,this._easeOptions=i,this._update())}},{key:"_updateEase",value:function(){var e=Math.min((s.now()-this._easeStart)/this._easeOptions.duration,1);this._easeFn(this._easeOptions.easing(e)),1===e&&this._finishEase()}},{key:"_finishEase",value:function(){delete this._easeFn;var e=this._finishFn;delete this._finishFn,e.call(this)}},{key:"_normalizeBearing",value:function(e,t){e=O.wrap(e,-180,180);var i=Math.abs(e-t);return Math.abs(e-360-t)<i&&(e-=360),Math.abs(e+360-t)<i&&(e+=360),e}},{key:"_normalizeCenter",value:function(e){var t=this.transform;if(t.renderWorldCopies&&!t.lngRange){var i=e.lng-t.center.lng;e.lng+=180<i?-360:i<-180?360:0}}},{key:"_smoothOutEasing",value:function(e){var t=O.ease;if(this._prevEase){var i=this._prevEase,r=(s.now()-i.start)/i.duration,n=i.easing(.01+r)-i.easing(r),a=.27/Math.sqrt(n*n+1e-4)*.01,o=Math.sqrt(.0729-a*a);t=O.bezier(a,o,.25,1)}return this._prevEase={start:s.now(),duration:e,easing:t},t}}]),l);function l(e,t){var i;return function(e){if(!(e instanceof l))throw new TypeError("Cannot call a class as a function")}(this),(i=function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,n(l).call(this))).moving=!1,i.transform=e,i._bearingSnap=t.bearingSnap,i}e.exports=o},function(e,t,i){var r=i(9),n=i(0),a=(function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(o.prototype,[{key:"onAdd",value:function(e){this._map=e,this._container=r.create("div","mapboxgl-ctrl");var t=r.create("a","mapboxgl-ctrl-logo");return t.target="_blank",t.href="https://www.mapbox.com/",t.setAttribute("aria-label","Mapbox logo"),this._container.appendChild(t),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._container}},{key:"onRemove",value:function(){r.remove(this._container),this._map.off("sourcedata",this._updateLogo)}},{key:"getDefaultPosition",value:function(){return"bottom-left"}},{key:"_updateLogo",value:function(e){e&&"metadata"!==e.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")}},{key:"_logoRequired",value:function(){if(this._map.style){var e=this._map.style.sourceCaches;for(var t in e)if(e[t].getSource().mapbox_logo)return!0;return!1}}}]),o);function o(){!function(e){if(!(e instanceof o))throw new TypeError("Cannot call a class as a function")}(this),n.bindAll(["_updateLogo"],this)}e.exports=a},function(e,t){},function(e,t,i){var n=i(9),r=i(0),a=i(127),o={showCompass:!0,showZoom:!0},s=(function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(l.prototype,[{key:"_rotateCompassArrow",value:function(){var e="rotate(".concat(this._map.transform.angle*(180/Math.PI),"deg)");this._compassArrow.style.transform=e}},{key:"onAdd",value:function(e){return this._map=e,this.options.showCompass&&(this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new a(e,{button:"left",element:this._compass}),this._handler.enable()),this._container}},{key:"onRemove",value:function(){n.remove(this._container),this.options.showCompass&&(this._map.off("rotate",this._rotateCompassArrow),this._handler.disable(),delete this._handler),delete this._map}},{key:"_createButton",value:function(e,t,i){var r=n.create("button",e,this._container);return r.type="button",r.setAttribute("aria-label",t),r.addEventListener("click",i),r}}]),l);function l(e){var t=this;!function(e){if(!(e instanceof l))throw new TypeError("Cannot call a class as a function")}(this),this.options=r.extend({},o,e),this._container=n.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",function(e){return e.preventDefault()}),this.options.showZoom&&(this._zoomInButton=this._createButton("mapboxgl-ctrl-icon mapboxgl-ctrl-zoom-in","Zoom In",function(){return t._map.zoomIn()}),this._zoomOutButton=this._createButton("mapboxgl-ctrl-icon mapboxgl-ctrl-zoom-out","Zoom Out",function(){return t._map.zoomOut()})),this.options.showCompass&&(r.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-icon mapboxgl-ctrl-compass","Reset North",function(){return t._map.resetNorth()}),this._compassArrow=n.create("span","mapboxgl-ctrl-compass-arrow",this._compass))}e.exports=s},function(e,t,i){function n(e){return(n="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})(e)}function a(e){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function o(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var s,l=i(10),u=i(9),c=i(5),d=i(0),h=i(1),p=i(21),f=i(129),m={positionOptions:{enableHighAccuracy:!1,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showUserLocation:!0},g=(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)}(y,l),function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(y.prototype,[{key:"onAdd",value:function(e){var t;return this._map=e,this._container=u.create("div","".concat("mapboxgl-ctrl"," ").concat("mapboxgl-ctrl","-group")),t=this._setupUI,void 0!==s?t(s):void 0!==c.navigator.permissions?c.navigator.permissions.query({name:"geolocation"}).then(function(e){s="denied"!==e.state,t(s)}):(s=!!c.navigator.geolocation,t(s)),this._container}},{key:"onRemove",value:function(){void 0!==this._geolocationWatchID&&(c.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker.remove(),u.remove(this._container),this._map=void 0}},{key:"_onSuccess",value:function(e){if(this.options.trackUserLocation)switch(this._lastKnownPosition=e,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;default:h(!1,"Unexpected watchState ".concat(this._watchState))}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(e),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(e),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire("geolocate",e),this._finish()}},{key:"_updateCamera",value:function(e){var t=new p(e.coords.longitude,e.coords.latitude),i=e.coords.accuracy;this._map.fitBounds(t.toBounds(i),this.options.fitBoundsOptions,{geolocateSource:!0})}},{key:"_updateMarker",value:function(e){e?this._userLocationDotMarker.setLngLat([e.coords.longitude,e.coords.latitude]).addTo(this._map):this._userLocationDotMarker.remove()}},{key:"_onError",value:function(e){if(this.options.trackUserLocation)if(1===e.code)this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),void 0!==this._geolocationWatchID&&this._clearWatch();else switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":break;default:h(!1,"Unexpected watchState ".concat(this._watchState))}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire("error",e),this._finish()}},{key:"_finish",value:function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}},{key:"_setupUI",value:function(e){var t=this;!1!==e&&(this._container.addEventListener("contextmenu",function(e){return e.preventDefault()}),this._geolocateButton=u.create("button","".concat("mapboxgl-ctrl","-icon ").concat("mapboxgl-ctrl","-geolocate"),this._container),this._geolocateButton.type="button",this._geolocateButton.setAttribute("aria-label","Geolocate"),this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=u.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new f(this._dotElement),this.options.trackUserLocation&&(this._watchState="OFF")),this._geolocateButton.addEventListener("click",this._onClickGeolocate.bind(this)),this.options.trackUserLocation&&this._map.on("movestart",function(e){e.geolocateSource||"ACTIVE_LOCK"!==t._watchState||(t._watchState="BACKGROUND",t._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),t._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),t.fire("trackuserlocationend"))}))}},{key:"_onClickGeolocate",value:function(){if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire("trackuserlocationstart");break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire("trackuserlocationend");break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire("trackuserlocationstart");break;default:h(!1,"Unexpected watchState ".concat(this._watchState))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error");break;case"OFF":break;default:h(!1,"Unexpected watchState ".concat(this._watchState))}"OFF"===this._watchState&&void 0!==this._geolocationWatchID?this._clearWatch():void 0===this._geolocationWatchID&&(this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),this._geolocationWatchID=c.navigator.geolocation.watchPosition(this._onSuccess,this._onError,this.options.positionOptions))}else c.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4)}},{key:"_clearWatch",value:function(){c.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}}]),y);function y(e){var t,i,r;return function(e){if(!(e instanceof y))throw new TypeError("Cannot call a class as a function")}(this),(i=this,t=!(r=a(y).call(this))||"object"!==n(r)&&"function"!=typeof r?o(i):r).options=d.extend({},m,e),d.bindAll(["_onSuccess","_onError","_finish","_setupUI","_updateCamera","_updateMarker","_onClickGeolocate"],o(t)),t}e.exports=g},function(e,t,i){var r=i(9),n=i(0),a=(function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(o.prototype,[{key:"getDefaultPosition",value:function(){return"bottom-left"}},{key:"_onMove",value:function(){!function(e,t,i){var r,n,a,o,s,l,u=i&&i.maxWidth||100,c=e._container.clientHeight/2,d=(r=e.unproject([0,c]),n=e.unproject([u,c]),a=Math.PI/180,o=r.lat*a,s=n.lat*a,l=Math.sin(o)*Math.sin(s)+Math.cos(o)*Math.cos(s)*Math.cos((n.lng-r.lng)*a),6371e3*Math.acos(Math.min(l,1)));if(i&&"imperial"===i.unit){var h=3.2808*d;5280<h?p(t,u,h/5280,"mi"):p(t,u,h,"ft")}else i&&"nautical"===i.unit?p(t,u,d/1852,"nm"):p(t,u,d,"m")}(this._map,this._container,this.options)}},{key:"onAdd",value:function(e){return this._map=e,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",e.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}},{key:"onRemove",value:function(){r.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}}]),o);function o(e){!function(e){if(!(e instanceof o))throw new TypeError("Cannot call a class as a function")}(this),this.options=e,n.bindAll(["_onMove"],this)}function p(e,t,i,r){var n,a,o,s=(n=i,(a=Math.pow(10,"".concat(Math.floor(n)).length-1))*(o=10<=(o=n/a)?10:5<=o?5:3<=o?3:2<=o?2:1)),l=s/i;"m"===r&&1e3<=s&&(s/=1e3,r="km"),e.style.width="".concat(t*l,"px"),e.innerHTML=s+r}e.exports=a},function(e,t,i){var r=i(9),n=i(0),a=i(5),o=(function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(s.prototype,[{key:"onAdd",value:function(e){return this._map=e,this._mapContainer=this._map.getContainer(),this._container=r.create("div","".concat(this._className," mapboxgl-ctrl-group")),this._checkFullscreenSupport()?this._setupUI():(this._container.style.display="none",n.warnOnce("This device does not support fullscreen mode.")),this._container}},{key:"onRemove",value:function(){r.remove(this._container),this._map=null,a.document.removeEventListener(this._fullscreenchange,this._changeIcon)}},{key:"_checkFullscreenSupport",value:function(){return!!(a.document.fullscreenEnabled||a.document.mozFullScreenEnabled||a.document.msFullscreenEnabled||a.document.webkitFullscreenEnabled)}},{key:"_setupUI",value:function(){var e=this._fullscreenButton=r.create("button","".concat(this._className,"-icon ").concat(this._className,"-fullscreen"),this._container);e.setAttribute("aria-label","Toggle fullscreen"),e.type="button",this._fullscreenButton.addEventListener("click",this._onClickFullscreen),a.document.addEventListener(this._fullscreenchange,this._changeIcon)}},{key:"_isFullscreen",value:function(){return this._fullscreen}},{key:"_changeIcon",value:function(){(a.document.fullscreenElement||a.document.mozFullScreenElement||a.document.webkitFullscreenElement||a.document.msFullscreenElement)===this._mapContainer!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("".concat(this._className,"-shrink")),this._fullscreenButton.classList.toggle("".concat(this._className,"-fullscreen")))}},{key:"_onClickFullscreen",value:function(){this._isFullscreen()?a.document.exitFullscreen?a.document.exitFullscreen():a.document.mozCancelFullScreen?a.document.mozCancelFullScreen():a.document.msExitFullscreen?a.document.msExitFullscreen():a.document.webkitCancelFullScreen&&a.document.webkitCancelFullScreen():this._mapContainer.requestFullscreen?this._mapContainer.requestFullscreen():this._mapContainer.mozRequestFullScreen?this._mapContainer.mozRequestFullScreen():this._mapContainer.msRequestFullscreen?this._mapContainer.msRequestFullscreen():this._mapContainer.webkitRequestFullscreen&&this._mapContainer.webkitRequestFullscreen()}}]),s);function s(){!function(e){if(!(e instanceof s))throw new TypeError("Cannot call a class as a function")}(this),this._fullscreen=!1,n.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in a.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in a.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in a.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in a.document&&(this._fullscreenchange="MSFullscreenChange"),this._className="mapboxgl-ctrl"}e.exports=o},function(e,t,i){function n(e){return(n="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})(e)}function a(e){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function o(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var s=i(0),l=i(10),u=i(9),c=i(21),d=i(3),h=i(5),p=i(130),f={closeButton:!0,closeOnClick:!0},m=(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)}(g,l),function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(g.prototype,[{key:"addTo",value:function(e){return this._map=e,this._map.on("move",this._update),this.options.closeOnClick&&this._map.on("click",this._onClickClose),this._update(),this}},{key:"isOpen",value:function(){return!!this._map}},{key:"remove",value:function(){return this._content&&u.remove(this._content),this._container&&(u.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("click",this._onClickClose),delete this._map),this.fire("close"),this}},{key:"getLngLat",value:function(){return this._lngLat}},{key:"setLngLat",value:function(e){return this._lngLat=c.convert(e),this._pos=null,this._update(),this}},{key:"setText",value:function(e){return this.setDOMContent(h.document.createTextNode(e))}},{key:"setHTML",value:function(e){var t,i=h.document.createDocumentFragment(),r=h.document.createElement("body");for(r.innerHTML=e;t=r.firstChild;)i.appendChild(t);return this.setDOMContent(i)}},{key:"setDOMContent",value:function(e){return this._createContent(),this._content.appendChild(e),this._update(),this}},{key:"_createContent",value:function(){this._content&&u.remove(this._content),this._content=u.create("div","mapboxgl-popup-content",this._container),this.options.closeButton&&(this._closeButton=u.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClickClose))}},{key:"_update",value:function(){if(this._map&&this._lngLat&&this._content){this._container||(this._container=u.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=u.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content)),this._map.transform.renderWorldCopies&&(this._lngLat=p(this._lngLat,this._pos,this._map.transform));var e=this._pos=this._map.project(this._lngLat),t=this.options.anchor,i=function e(t){if(t){if("number"==typeof t){var i=Math.round(Math.sqrt(.5*Math.pow(t,2)));return{top:new d(0,t),"top-left":new d(i,i),"top-right":new d(-i,i),bottom:new d(0,-t),"bottom-left":new d(i,-i),"bottom-right":new d(-i,-i),left:new d(t,0),right:new d(-t,0)}}if(t instanceof d||Array.isArray(t)){var r=d.convert(t);return{top:r,"top-left":r,"top-right":r,bottom:r,"bottom-left":r,"bottom-right":r,left:r,right:r}}return{top:d.convert(t.top||[0,0]),"top-left":d.convert(t["top-left"]||[0,0]),"top-right":d.convert(t["top-right"]||[0,0]),bottom:d.convert(t.bottom||[0,0]),"bottom-left":d.convert(t["bottom-left"]||[0,0]),"bottom-right":d.convert(t["bottom-right"]||[0,0]),left:d.convert(t.left||[0,0]),right:d.convert(t.right||[0,0])}}return e(new d(0,0))}(this.options.offset);if(!t){var r=this._container.offsetWidth,n=this._container.offsetHeight;t=e.y+i.bottom.y<n?["top"]:e.y>this._map.transform.height-n?["bottom"]:[],e.x<r/2?t.push("left"):e.x>this._map.transform.width-r/2&&t.push("right"),t=0===t.length?"bottom":t.join("-")}var a=e.add(i[t]).round(),o={top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"},s=this._container.classList;for(var l in o)s.remove("mapboxgl-popup-anchor-".concat(l));s.add("mapboxgl-popup-anchor-".concat(t)),u.setTransform(this._container,"".concat(o[t]," translate(").concat(a.x,"px,").concat(a.y,"px)"))}}},{key:"_onClickClose",value:function(){this.remove()}}]),g);function g(e){var t,i,r;return function(e){if(!(e instanceof g))throw new TypeError("Cannot call a class as a function")}(this),(i=this,t=!(r=a(g).call(this))||"object"!==n(r)&&"function"!=typeof r?o(i):r).options=s.extend(Object.create(f),e),s.bindAll(["_update","_onClickClose"],o(t)),t}e.exports=m},function(e,t,i){function n(e){return(n="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})(e)}function a(e){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function o(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var s=i(301),l=i(302),u=i(6),c=i(10),f=i(27).OverscaledTileID,d=i(22).mat4,h=(i(45),i(116)),p=i(61),m=(i(69),i(1)),g=i(306),y=1024,v=(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)}(_,c),function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(_.prototype,[{key:"_onReady",value:function(){this._style.update(new p(16))}},{key:"_transformRequest",value:function(e,t){return{url:e,headers:{},credentials:""}}},{key:"_calculatePosMatrix",value:function(e,t,i){var r=this;this._tmpMat4f64=this._tmpMat4f64||new Float64Array(16),this._tmpMat4f32=new Float32Array(16),d.identity(this._tmpMat4f64);var n,a,o,s,l=i/y;return n=this._tmpMat4f64,a=[2/u*l,-2/u*l,1],r._tmpMat4f64b=r._tmpMat4f64b||new Float32Array(16),d.identity(r._tmpMat4f64b),d.scale(r._tmpMat4f64b,r._tmpMat4f64b,a),d.multiply(n,r._tmpMat4f64b,n),o=this._tmpMat4f64,s=[2*e/y-1,1-2*t/y,0],r._tmpMat4f64b=r._tmpMat4f64b||new Float32Array(16),d.identity(r._tmpMat4f64b),d.translate(r._tmpMat4f64b,r._tmpMat4f64b,s),d.multiply(o,r._tmpMat4f64b,o),this._tmpMat4f32.set(this._tmpMat4f64),this._tmpMat4f32}},{key:"_createGlContext",value:function(){var e=Object.assign({failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1},i(307).webGLContextAttributes);if(this._gl=this._canvas.getContext("webgl",e)||this._canvas.getContext("experimental-webgl",e),!this._gl)throw new Error("Failed to initialize WebGL");this.painter=new s(this._gl,this.transform),this.painter.style=this._style}},{key:"setPaintProperty",value:function(e,t,i){var r=this,n=!(3<arguments.length&&void 0!==arguments[3])||arguments[3];return this._queuedConfigChanges.push(function(){return r._style.setPaintProperty(e,t,i)}),n?this._processConfigQueue(++this._configId):function(){return r._processConfigQueue(++r._configId)}}},{key:"setLayoutProperty",value:function(e,t,i){var r=this,n=!(3<arguments.length&&void 0!==arguments[3])||arguments[3];return this._queuedConfigChanges.push(function(){return r._style.setLayoutProperty(e,t,i)}),n?this._processConfigQueue(++this._configId):function(){return r._processConfigQueue(++r._configId)}}},{key:"setFilter",value:function(e,t){var i=this,r=!(2<arguments.length&&void 0!==arguments[2])||arguments[2];return this._queuedConfigChanges.push(function(){return i._style.setFilter(e,t)}),r?this._processConfigQueue(++this._configId):function(){return i._processConfigQueue(++i._configId)}}},{key:"_processConfigQueue",value:function(e){var t=this;return this._style.loadedPromise.then(function(){if(t._configId!==e)return!1;for(t._cancelAllPendingRenders();t._queuedConfigChanges.length;)t._queuedConfigChanges.shift()();return t._style.update(new p(16)),t.fire("configChanged"),!0})}},{key:"getLayersVisible",value:function(r,n){var a=this;return Object.keys(this._style._layers).filter(function(e){return"visible"===a._style.getLayoutProperty(e,"visibility")}).filter(function(e){var t,i=(t=a._style._layers[e])&&t._eventedParent.stylesheet.layers.find(function(e){return e.id===t.id});return(!r||i&&(void 0===i.minzoom_||r>=i.minzoom_)&&(void 0===i.maxzoom_||r<=i.maxzoom_))&&(!n||i&&i.source===n)})}},{key:"getLayerOriginalFilter",value:function(t){var e=this._initStyle.layers.find(function(e){return e.id===t});return e&&e.filter}},{key:"getLayerOriginalPaint",value:function(t){var e=this._initStyle.layers.find(function(e){return e.id===t});return e&&e.paint}},{key:"getLayerOriginalLayout",value:function(t){var e=this._initStyle.layers.find(function(e){return e.id===t});return e&&e.layout}},{key:"getVisibleSources",value:function(e){var t=this;return Object.keys(this._style.sourceCaches).filter(function(e){return 0<t.getLayersVisible(t.painter._filterForZoom,e).length})}},{key:"filterForZoom",value:function(e){e!==this.painter._filterForZoom&&(this.painter._filterForZoom=e)}},{key:"_cancelAllPendingRenders",value:function(){var t=this;this._pendingRenders.forEach(function(e){return t._finishRender(e.tileSetID,e.renderId,"canceled")}),this._pendingRenders.clear(),Object.values(this._style.sourceCaches).forEach(function(e){return e.invalidateAllLoadedTiles()})}},{key:"_finishRender",value:function(e,t,i){var r=this._pendingRenders.get(e);if(r&&r.renderId===t){for(;r.consumers.length;)r.consumers.shift().next(i);this._pendingRenders.delete(e)}}},{key:"_canonicalizeSpec",value:function(e,t){var i=e.map(function(e){return e.left}).reduce(function(e,t){return Math.min(e,t)},1/0),r=e.map(function(e){return e.top}).reduce(function(e,t){return Math.min(e,t)},1/0);return{tilesSpec:e.map(function(e){return{source:e.source,z:e.z,x:e.x,y:e.y,top:e.top-r,left:e.left-i,size:e.size}}),drawSpec:{srcLeft:t.srcLeft-i,srcTop:t.srcTop-r,width:t.width,height:t.height,destLeft:t.destLeft,destTop:t.destTop}}}},{key:"_tileSpecToString",value:function(e){return e.map(function(e){return"".concat(e.source," ").concat(e.z," ").concat(e.x," ").concat(e.y," ").concat(e.left," ").concat(e.top," ").concat(e.size)}).sort().join(" ")}},{key:"releaseRender",value:function(e){var t=this._pendingRenders.get(e.tileSetID);if(e.tiles.forEach(function(e){return e.cache.releaseTile(e)}),t&&t.renderId===e.renderId){e.consumer.next("canceled");var i=t.consumers.indexOf(e.consumer);-1!==i&&t.consumers.splice(i,1),0===t.consumers.length&&this._finishRender(t.tileSetID,e.renderId,"fully-canceled")}}},{key:"renderTiles",value:function(e,s,l,t){var d=this,i=this._canonicalizeSpec(l,s);s=i.drawSpec,l=i.tilesSpec;var u=this._tileSpecToString(l),r={ctx:e,drawSpec:s,tilesSpec:l,next:t},h=this._pendingRenders.get(u);if(h)return h.tiles.forEach(function(e){return e.uses++}),h.consumers.push(r),{renderId:h.renderId,consumer:r,tiles:h.tiles,tileSetID:u};var c=++this._nextRenderId;h={tileSetID:u,renderId:c,tiles:l.map(function(e){var t=new f(e.z,0,e.z,e.x,e.y,0);return d._style.sourceCaches[e.source].acquireTile(t,e.size)}),consumers:[r]},this._pendingRenders.set(u,h);var p=[];return Promise.all(h.tiles.map(function(e,t){return e.loadedPromise.catch(function(e){return p.push(t)})})).catch(function(e){return d._finishRender(u,c,e)}).then(function(){if((h=d._pendingRenders.get(u))&&h.renderId===c){var e=p.length?"".concat(p.length," of ").concat(l.length," tiles not available"):null;if(l.length-p.length==0)return h.consumers.forEach(function(e){return e.ctx.clearRect(s.destLeft,s.destTop,s.width,s.height)}),void d._finishRender(u,c,e);Object.values(d._style.sourceCaches).forEach(function(e){return e.currentlyRenderingTiles=[]}),l.forEach(function(e,t){if(!p.includes(t)){var i=h.tiles[t];i.tileSize=e.size,i.left=e.left,i.top=e.top,d._style.sourceCaches[e.source].currentlyRenderingTiles.push(i)}});for(var t=h.consumers.map(function(e){return e.drawSpec.srcLeft}).reduce(function(e,t){return Math.min(e,t)},1/0),i=h.consumers.map(function(e){return e.drawSpec.srcTop}).reduce(function(e,t){return Math.min(e,t)},1/0),r=h.consumers.map(function(e){return e.drawSpec.srcLeft+e.drawSpec.width}).reduce(function(e,t){return Math.max(e,t)},-1/0),n=h.consumers.map(function(e){return e.drawSpec.srcTop+e.drawSpec.height}).reduce(function(e,t){return Math.max(e,t)},-1/0),a=function(c){for(var e=function(u){var e=h.consumers.filter(function(e){return e.drawSpec.srcLeft+e.drawSpec.width>c&&e.drawSpec.srcLeft<c+y&&e.drawSpec.srcTop+e.drawSpec.height>u&&e.drawSpec.srcTop<u+y});if(0===e.length)return"continue";h.tiles.forEach(function(e){return e.tileID.posMatrix=d._calculatePosMatrix(e.left-c,e.top-u,e.tileSize)}),d.painter.render(d._style,{showTileBoundaries:!1,showOverdrawInspector:!1}),e.forEach(function(e){var t=0|Math.max(0,e.drawSpec.srcLeft-c),i=0|Math.min(y,e.drawSpec.srcLeft+e.drawSpec.width-c),r=0|Math.max(0,e.drawSpec.srcTop-u),n=0|Math.min(y,e.drawSpec.srcTop+e.drawSpec.height-u),a=e.drawSpec.destLeft+(e.drawSpec.srcLeft<c?c-e.drawSpec.srcLeft:0),o=e.drawSpec.destTop+(e.drawSpec.srcTop<u?u-e.drawSpec.srcTop:0),s=i-t,l=n-r;e.ctx.drawImage(d._canvas,t,r,s,l,a,o,s,l)})},t=i;t<n;t+=y)e(t)},o=t;o<r;o+=y)a(o);for(;h.consumers.length;)h.consumers.shift().next(e);d._pendingRenders.delete(u),Object.values(d._style.sourceCaches).forEach(function(e){return e.currentlyRenderingTiles=[]})}}),{renderId:h.renderId,consumer:r,tiles:h.tiles,tileSetID:u}}},{key:"queryRenderedFeatures",value:function(e){var t=this;m(e.source);var i={};this.getLayersVisible(e.renderedZoom,e.source).forEach(function(e){return i[e]=t._style._layers[e]});var r=h.rendered(this._style.sourceCaches[e.source],i,e,{},e.tileZ,0),n={};return Object.keys(r).forEach(function(e){return r[e].map(function(e){(n[e.layer["source-layer"]]=n[e.layer["source-layer"]]||[]).push(e._vectorTileFeature.properties)})}),n}},{key:"showCanvasForDebug",value:function(){document.body.appendChild(this._canvas),this._canvas.style.position="fixed",this._canvas.style.bottom="0px",this._canvas.style.right="0px",this._canvas.style.background="#ccc",this._canvas.style.opacity="0.7",this._canvas.style.transform="scale(0.5) translate(502px,502px)"}},{key:"destroyDebugCanvas",value:function(){renderer._canvas.parentElement&&document.body.removeChild(this._canvas)}}]),_);function _(e){var t,i,r;return function(e){if(!(e instanceof _))throw new TypeError("Cannot call a class as a function")}(this),(i=this,r=a(_).call(this),t=!r||"object"!==n(r)&&"function"!=typeof r?o(i):r)._canvas=document.createElement("canvas"),t._canvas.style.imageRendering="pixelated",t._canvas.addEventListener("webglcontextlost",function(){return console.log("webglcontextlost")},!1),t._canvas.addEventListener("webglcontextrestored",function(){return t._createGlContext()},!1),t._canvas.width=y,t._canvas.height=y,t.transform={zoom:0,angle:0,pitch:0,_pitch:0,scaleZoom:function(){return 0},cameraToCenterDistance:1,cameraToTileDistance:function(){return 1},clone:function(){return t.transform},width:y,height:y,pixelsToGLUnits:[2/y,-2/y],tileZoom:function(e){return e.tileID.canonical.z},calculatePosMatrix:function(e){return e.posMatrix}},g(e.style),t._initStyle=e.style,t._style=new l(Object.assign({},e.style,{transition:{duration:0}}),o(t)),t._style.setEventedParent(o(t),{style:t._style}),t._style.on("data",function(e){return"style"===e.dataType&&t._onReady()}),t._createGlContext(),t.painter.resize(y,y),t._pendingRenders=new Map,t._nextRenderId=0,t._configId=0,t._queuedConfigChanges=[],t}e.exports=v},function(e,t,i){function r(e){return(r="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})(e)}function o(e,t,i){return(o="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,i){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=s(e)););return e}(e,t);if(r){var n=Object.getOwnPropertyDescriptor(r,t);return n.get?n.get.call(i):n.value}})(e,t,i||e)}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function n(e,t){return(n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var a=(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&n(e,t)}(l,i(124)),function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(l.prototype,[{key:"resize",value:function(e,t){var i=this.context.gl;this.width=e,this.height=t,i.viewport(0,0,this.width,this.height)}},{key:"renderLayer",value:function(e,t,i,r){var n,a=(n=i)&&n._eventedParent.stylesheet.layers.find(function(e){return e.id===n.id});a&&a.minzoom_&&r[0].overscaledZ<a.minzoom_||a&&a.maxzoom_&&r[0].overscaledZ>=a.maxzoom_||o(s(l.prototype),"renderLayer",this).call(this,e,t,i,r)}}]),l);function l(e,t){var i;return function(e){if(!(e instanceof l))throw new TypeError("Cannot call a class as a function")}(this),(i=function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,s(l).call(this,e,t)))._filterForZoom=15,i}e.exports=a},function(e,t,i){function n(e){return(n="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})(e)}function a(e){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var o=i(53),s=i(45),l=i(69),u=i(303),c=(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)}(d,o),function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(d.prototype,[{key:"addSource",value:function(e,t,i){var r=s.create(e,t,this.dispatcher,this);r.setEventedParent(this,{source:r}),r.map=this.map,r.tiles=t.tiles,r.load(),this.loadedPromise.then(function(){return new Promise(function(t){return r.on("data",function(e){return"source"===e.dataType&&t()})})}),this.sourceCaches[e]=new u(r)}},{key:"setLayers",value:function(t){var i=this;return Object.keys(this._layers).map(function(e){return i.setLayoutProperty(e,"visibility",t.includes(e)?"visible":"none")})}}]),d);function d(e,t,i){var r;return function(e){if(!(e instanceof d))throw new TypeError("Cannot call a class as a function")}(this),(r=function(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,a(d).call(this,t,i))).loadedPromise=new Promise(function(t){return r.on("data",function(e){return"style"===e.dataType&&t()})}),r.loadedPromise.then(function(){return r.placement=new l(t.transform,0)}),r.loadJSON(e),r}e.exports=c},function(e,t,i){function r(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var n=i(121),a=i(1),o=i(118),s=i(304),l=i(6),u=new(i(305)),c=(function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(d.prototype,[{key:"getSource",value:function(){return this._source}},{key:"getVisibleCoordinates",value:function(){return this.currentlyRenderingTiles.map(function(e){return e.tileID})}},{key:"getRenderableIds",value:function(){return this.getVisibleCoordinates()}},{key:"acquireTile",value:function(e,t){var n=this,a=this._tilesInUse[e.key]||this._tileCache.getAndRemove(e.key)||new o(e.wrapped(),t,e.canonical.z);return a.uses++,(this._tilesInUse[e.key]=a).cache=this,a.loadedPromise||(a.loadedPromise=new Promise(function(t,i){var r=setTimeout(function(){n._source.abortTile(a),a.loadedPromise=null,i("timeout")},6e4);n._source.loadTile(a,function(e){clearTimeout(r),e?(a._isDud=!0,i(e)):t()})})),a}},{key:"getTileByID",value:function(e){return this.getTile(e)}},{key:"getTile",value:function(e){return this._tilesInUse[e.key]}},{key:"serialize",value:function(){return this._source.serialize()}},{key:"prepare",value:function(t){this.currentlyRenderingTiles.forEach(function(e){return e.upload(t)})}},{key:"releaseTile",value:function(e){a(0<e.uses),0<--e.uses||(delete this._tilesInUse[e.tileID.key],e.hasData()||this._isDud?this._tileCache.add(e.tileID.key,e):(this._source.abortTile(e),this._source.unloadTile(e)))}},{key:"invalidateAllLoadedTiles",value:function(){var i=this;Object.values(this._tilesInUse).forEach(function(e){return!e._isDud&&(e.loadedPromise=null)}),this._tileCache.keys().forEach(function(e){var t=i._tileCache.get(e);t._isDud||(t.loadedPromise=null)})}},{key:"tilesIn",value:function(e){var t=u.px([e.lng,e.lat],e.tileZ,!1).map(function(e){return e/256}),i=0|t[0],r=0|t[1],n=t.map(function(e){return(e-(0|e))*l}),a=n[0],o=n[1];return Object.values(this._tilesInUse).filter(function(e){return e.hasData()}).map(function(e){return{tile:e,tileID:e.tileID,queryGeometry:[[s.convert([a+l*(i-e.tileID.canonical.x),o+l*(r-e.tileID.canonical.y)])]],scale:1}})}},{key:"reload",value:function(){}},{key:"pause",value:function(){}},{key:"resume",value:function(){}}]),d);function d(e){var t=this;!function(e){if(!(e instanceof d))throw new TypeError("Cannot call a class as a function")}(this),r(this,"_tilesInUse",{}),r(this,"map",{}),this._source=e,this._tileCache=new n(20,function(e){return t._source.unloadTile(e)})}e.exports=c},function(e,t,i){function r(e,t){this.x=e,this.y=t}(e.exports=r).prototype={clone:function(){return new r(this.x,this.y)},add:function(e){return this.clone()._add(e)},sub:function(e){return this.clone()._sub(e)},mult:function(e){return this.clone()._mult(e)},div:function(e){return this.clone()._div(e)},rotate:function(e){return this.clone()._rotate(e)},matMult:function(e){return this.clone()._matMult(e)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(e){return this.x===e.x&&this.y===e.y},dist:function(e){return Math.sqrt(this.distSqr(e))},distSqr:function(e){var t=e.x-this.x,i=e.y-this.y;return t*t+i*i},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith:function(e){return this.angleWithSep(e.x,e.y)},angleWithSep:function(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult:function(e){var t=e[0]*this.x+e[1]*this.y,i=e[2]*this.x+e[3]*this.y;return this.x=t,this.y=i,this},_add:function(e){return this.x+=e.x,this.y+=e.y,this},_sub:function(e){return this.x-=e.x,this.y-=e.y,this},_mult:function(e){return this.x*=e,this.y*=e,this},_div:function(e){return this.x/=e,this.y/=e,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var e=this.y;return this.y=this.x,this.x=-e,this},_rotate:function(e){var t=Math.cos(e),i=Math.sin(e),r=t*this.x-i*this.y,n=i*this.x+t*this.y;return this.x=r,this.y=n,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},r.convert=function(e){return e instanceof r?e:Array.isArray(e)?new r(e[0],e[1]):e}},function(e,t,i){var n,s,r,a,o,l=(n={},s=Math.PI/180,r=180/Math.PI,a=6378137,o=20037508.342789244,u.prototype.px=function(e,t,i){void 0===i&&(i=!0);var r=this.zc[t],n=Math.min(Math.max(Math.sin(s*e[1]),-.9999),.9999),a=r+e[0]*this.Bc[t],o=r+.5*Math.log((1+n)/(1-n))*-this.Cc[t];return i&&(a=Math.round(a),o=Math.round(o)),a>this.Ac[t]&&(a=this.Ac[t]),o>this.Ac[t]&&(o=this.Ac[t]),[a,o]},u.prototype.ll=function(e,t){var i=(e[1]-this.zc[t])/-this.Cc[t];return[(e[0]-this.zc[t])/this.Bc[t],r*(2*Math.atan(Math.exp(i))-.5*Math.PI)]},u.prototype.bbox=function(e,t,i,r,n){r&&(t=Math.pow(2,i)-1-t);var a=[e*this.size,(+t+1)*this.size],o=[(+e+1)*this.size,t*this.size],s=this.ll(a,i).concat(this.ll(o,i));return"900913"===n?this.convert(s,"900913"):s},u.prototype.xyz=function(e,t,i,r){"900913"===r&&(e=this.convert(e,"WGS84"));var n=[e[0],e[1]],a=[e[2],e[3]],o=this.px(n,t),s=this.px(a,t),l=[Math.floor(o[0]/this.size),Math.floor((s[0]-1)/this.size)],u=[Math.floor(s[1]/this.size),Math.floor((o[1]-1)/this.size)],c={minX:Math.min.apply(Math,l)<0?0:Math.min.apply(Math,l),minY:Math.min.apply(Math,u)<0?0:Math.min.apply(Math,u),maxX:Math.max.apply(Math,l),maxY:Math.max.apply(Math,u)};if(i){var d={minY:Math.pow(2,t)-1-c.maxY,maxY:Math.pow(2,t)-1-c.minY};c.minY=d.minY,c.maxY=d.maxY}return c},u.prototype.convert=function(e,t){return"900913"===t?this.forward(e.slice(0,2)).concat(this.forward(e.slice(2,4))):this.inverse(e.slice(0,2)).concat(this.inverse(e.slice(2,4)))},u.prototype.forward=function(e){var t=[a*e[0]*s,a*Math.log(Math.tan(.25*Math.PI+.5*e[1]*s))];return t[0]>o&&(t[0]=o),t[0]<-o&&(t[0]=-o),t[1]>o&&(t[1]=o),t[1]<-o&&(t[1]=-o),t},u.prototype.inverse=function(e){return[e[0]*r/a,(.5*Math.PI-2*Math.atan(Math.exp(-e[1]/a)))*r]},u);function u(e){if(e=e||{},this.size=e.size||256,!n[this.size]){var t=this.size,i=n[this.size]={};i.Bc=[],i.Cc=[],i.zc=[],i.Ac=[];for(var r=0;r<30;r++)i.Bc.push(t/360),i.Cc.push(t/(2*Math.PI)),i.zc.push(t/2),i.Ac.push(t),t*=2}this.Bc=n[this.size].Bc,this.Cc=n[this.size].Cc,this.zc=n[this.size].zc,this.Ac=n[this.size].Ac}e.exports=l},function(e,t){function i(e){return(i="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})(e)}e.exports=function(e){"object"===i(e)&&Array.isArray(e.layers)&&(e.layers.forEach(function(e){"number"==typeof e.minzoom&&(e.minzoom_=e.minzoom,delete e.minzoom),"number"==typeof e.maxzoom&&(e.maxzoom_=e.maxzoom,delete e.maxzoom)}),e.layers=e.layers.filter(function(e){return"raster"!==e.type&&"background"!==e.type}))}},function(e,t,i){function a(e){return!!("undefined"!=typeof window&&"undefined"!=typeof document&&Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray&&Function.prototype&&Function.prototype.bind&&Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions&&"JSON"in window&&"parse"in JSON&&"stringify"in JSON&&"Worker"in window&&"Uint8ClampedArray"in window&&(t=e&&e.failIfMajorPerformanceCaveat,void 0===o[t]&&(o[t]=(i=t,r=document.createElement("canvas"),(n=Object.create(a.webGLContextAttributes)).failIfMajorPerformanceCaveat=i,r.probablySupportsContext?r.probablySupportsContext("webgl",n)||r.probablySupportsContext("experimental-webgl",n):r.supportsContext?r.supportsContext("webgl",n)||r.supportsContext("experimental-webgl",n):r.getContext("webgl",n)||r.getContext("experimental-webgl",n))),o[t]));var t,i,r,n}e.exports?e.exports=a:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=a);var o={};a.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}}],m5m={},n5m.m=l5m,n5m.c=m5m,n5m.d=function(e,t,i){n5m.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n5m.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n5m.t=function(t,e){if(1&e&&(t=n5m(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n5m.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n5m.d(i,r,function(e){return t[e]}.bind(null,r));return i},n5m.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n5m.d(t,"a",t),t},n5m.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n5m.p="",n5m(n5m.s=131)),l5m,m5m;function n5m(e){if(m5m[e])return m5m[e].exports;var t=m5m[e]={i:e,l:!1,exports:{}};return l5m[e].call(t.exports,t,t.exports,n5m),t.l=!0,t.exports}var KeyboardEventModifier={SHIFT:0,CTRL:1,ALT:2},KeyboardEventModifier$1=Object.freeze(KeyboardEventModifier),ScreenSpaceEventType={LEFT_DOWN:0,LEFT_UP:1,LEFT_CLICK:2,LEFT_DOUBLE_CLICK:3,RIGHT_DOWN:5,RIGHT_UP:6,RIGHT_CLICK:7,MIDDLE_DOWN:10,MIDDLE_UP:11,MIDDLE_CLICK:12,MOUSE_MOVE:15,WHEEL:16,PINCH_START:17,PINCH_END:18,PINCH_MOVE:19},ScreenSpaceEventType$1=Object.freeze(ScreenSpaceEventType);function getPosition$1(e,t,i){var r=e._element;if(r===document)return i.x=t.clientX,i.y=t.clientY,i;var n=r.getBoundingClientRect();return i.x=t.clientX-n.left,i.y=t.clientY-n.top,i}function getInputEventKey(e,t){var i=e;return defined(t)&&(i+="+"+t),i}function getModifier(e){return e.shiftKey?KeyboardEventModifier$1.SHIFT:e.ctrlKey?KeyboardEventModifier$1.CTRL:e.altKey?KeyboardEventModifier$1.ALT:void 0}var MouseButton={LEFT:0,MIDDLE:1,RIGHT:2};function registerListener(t,e,i,r){function n(e){r(t,e)}FeatureDetection$1.isInternetExplorer()?i.addEventListener(e,n,!1):i.addEventListener(e,n,{capture:!1,passive:!1}),t._removalFunctions.push(function(){i.removeEventListener(e,n,!1)})}function registerListeners(e){var t=e._element,i=defined(t.disableRootEvents)?t:document;FeatureDetection$1.supportsPointerEvents()?(registerListener(e,"pointerdown",t,handlePointerDown),registerListener(e,"pointerup",t,handlePointerUp),registerListener(e,"pointermove",t,handlePointerMove),registerListener(e,"pointercancel",t,handlePointerUp)):(registerListener(e,"mousedown",t,handleMouseDown),registerListener(e,"mouseup",i,handleMouseUp),registerListener(e,"mousemove",i,handleMouseMove),registerListener(e,"touchstart",t,handleTouchStart),registerListener(e,"touchend",i,handleTouchEnd),registerListener(e,"touchmove",i,handleTouchMove),registerListener(e,"touchcancel",i,handleTouchEnd)),registerListener(e,"dblclick",t,handleDblClick),registerListener(e,"onwheel"in t?"wheel":void 0!==document.onmousewheel?"mousewheel":"DOMMouseScroll",t,handleWheel)}function unregisterListeners(e){for(var t=e._removalFunctions,i=0;i<t.length;++i)t[i]()}var mouseDownEvent={position:new Cartesian2};function gotTouchEvent(e){e._lastSeenTouchEvent=getTimestamp$1()}function canProcessMouseEvent(e){return getTimestamp$1()-e._lastSeenTouchEvent>ScreenSpaceEventHandler.mouseEmulationIgnoreMilliseconds}function checkPixelTolerance(e,t,i){var r=e.x-t.x,n=e.y-t.y;return Math.sqrt(r*r+n*n)<i}function handleMouseDown(e,t){if(canProcessMouseEvent(e)){var i,r=t.button;if(e._buttonDown[r]=!0,r===MouseButton.LEFT)i=ScreenSpaceEventType$1.LEFT_DOWN;else if(r===MouseButton.MIDDLE)i=ScreenSpaceEventType$1.MIDDLE_DOWN;else{if(r!==MouseButton.RIGHT)return;i=ScreenSpaceEventType$1.RIGHT_DOWN}var n=getPosition$1(e,t,e._primaryPosition);Cartesian2.clone(n,e._primaryStartPosition),Cartesian2.clone(n,e._primaryPreviousPosition);var a=getModifier(t),o=e.getInputAction(i,a);defined(o)&&(Cartesian2.clone(n,mouseDownEvent.position),o(mouseDownEvent),t.preventDefault())}}var mouseUpEvent={position:new Cartesian2},mouseClickEvent={position:new Cartesian2};function cancelMouseEvent(e,t,i,r){var n=getModifier(r),a=e.getInputAction(t,n),o=e.getInputAction(i,n);if(defined(a)||defined(o)){var s=getPosition$1(e,r,e._primaryPosition);if(defined(a)&&(Cartesian2.clone(s,mouseUpEvent.position),a(mouseUpEvent)),defined(o))checkPixelTolerance(e._primaryStartPosition,s,e._clickPixelTolerance)&&(Cartesian2.clone(s,mouseClickEvent.position),o(mouseClickEvent))}}function handleMouseUp(e,t){if(canProcessMouseEvent(e)){var i=t.button;i!==MouseButton.LEFT&&i!==MouseButton.MIDDLE&&i!==MouseButton.RIGHT||(e._buttonDown[MouseButton.LEFT]&&(cancelMouseEvent(e,ScreenSpaceEventType$1.LEFT_UP,ScreenSpaceEventType$1.LEFT_CLICK,t),e._buttonDown[MouseButton.LEFT]=!1),e._buttonDown[MouseButton.MIDDLE]&&(cancelMouseEvent(e,ScreenSpaceEventType$1.MIDDLE_UP,ScreenSpaceEventType$1.MIDDLE_CLICK,t),e._buttonDown[MouseButton.MIDDLE]=!1),e._buttonDown[MouseButton.RIGHT]&&(cancelMouseEvent(e,ScreenSpaceEventType$1.RIGHT_UP,ScreenSpaceEventType$1.RIGHT_CLICK,t),e._buttonDown[MouseButton.RIGHT]=!1))}}var mouseMoveEvent={startPosition:new Cartesian2,endPosition:new Cartesian2};function handleMouseMove(e,t){if(canProcessMouseEvent(e)){var i=getModifier(t),r=getPosition$1(e,t,e._primaryPosition),n=e._primaryPreviousPosition,a=e.getInputAction(ScreenSpaceEventType$1.MOUSE_MOVE,i);defined(a)&&(Cartesian2.clone(n,mouseMoveEvent.startPosition),Cartesian2.clone(r,mouseMoveEvent.endPosition),a(mouseMoveEvent)),Cartesian2.clone(r,n),(e._buttonDown[MouseButton.LEFT]||e._buttonDown[MouseButton.MIDDLE]||e._buttonDown[MouseButton.RIGHT])&&t.preventDefault()}}var mouseDblClickEvent={position:new Cartesian2};function handleDblClick(e,t){var i;if(t.button===MouseButton.LEFT){i=ScreenSpaceEventType$1.LEFT_DOUBLE_CLICK;var r=getModifier(t),n=e.getInputAction(i,r);defined(n)&&(getPosition$1(e,t,mouseDblClickEvent.position),n(mouseDblClickEvent))}}function handleWheel(e,t){var i;if(defined(t.deltaY)){var r=t.deltaMode;i=r===t.DOM_DELTA_PIXEL?-t.deltaY:r===t.DOM_DELTA_LINE?40*-t.deltaY:120*-t.deltaY}else i=0<t.detail?-120*t.detail:t.wheelDelta;if(defined(i)){var n=getModifier(t),a=e.getInputAction(ScreenSpaceEventType$1.WHEEL,n);defined(a)&&(a(i),t.preventDefault())}}function handleTouchStart(e,t){gotTouchEvent(e);var i,r,n,a=t.changedTouches,o=a.length,s=e._positions;for(i=0;i<o;++i)n=(r=a[i]).identifier,s.set(n,getPosition$1(e,r,new Cartesian2));fireTouchEvents(e,t);var l=e._previousPositions;for(i=0;i<o;++i)n=(r=a[i]).identifier,l.set(n,Cartesian2.clone(s.get(n)))}function handleTouchEnd(e,t){gotTouchEvent(e);var i,r,n=t.changedTouches,a=n.length,o=e._positions;for(i=0;i<a;++i)r=n[i].identifier,o.remove(r);fireTouchEvents(e,t);var s=e._previousPositions;for(i=0;i<a;++i)r=n[i].identifier,s.remove(r)}var touchStartEvent={position:new Cartesian2},touch2StartEvent={position1:new Cartesian2,position2:new Cartesian2},touchEndEvent={position:new Cartesian2},touchClickEvent={position:new Cartesian2},touchHoldEvent={position:new Cartesian2};function fireTouchEvents(e,t){var i,r,n=getModifier(t),a=e._positions,o=a.length,s=e._isPinching;if(1!==o&&e._buttonDown[MouseButton.LEFT]){if(e._buttonDown[MouseButton.LEFT]=!1,defined(e._touchHoldTimer)&&(clearTimeout(e._touchHoldTimer),e._touchHoldTimer=void 0),defined(i=e.getInputAction(ScreenSpaceEventType$1.LEFT_UP,n))&&(Cartesian2.clone(e._primaryPosition,touchEndEvent.position),i(touchEndEvent)),0===o&&!e._isTouchHolding)if(defined(r=e.getInputAction(ScreenSpaceEventType$1.LEFT_CLICK,n)))checkPixelTolerance(e._primaryStartPosition,e._previousPositions.values[0],e._clickPixelTolerance)&&(Cartesian2.clone(e._primaryPosition,touchClickEvent.position),r(touchClickEvent));e._isTouchHolding=!1}if(0===o&&s&&(e._isPinching=!1,defined(i=e.getInputAction(ScreenSpaceEventType$1.PINCH_END,n))&&i()),1===o&&!s){var l=a.values[0];Cartesian2.clone(l,e._primaryPosition),Cartesian2.clone(l,e._primaryStartPosition),Cartesian2.clone(l,e._primaryPreviousPosition),e._buttonDown[MouseButton.LEFT]=!0,defined(i=e.getInputAction(ScreenSpaceEventType$1.LEFT_DOWN,n))&&(Cartesian2.clone(l,touchStartEvent.position),i(touchStartEvent)),e._touchHoldTimer=setTimeout(function(){e.isDestroyed()||(e._touchHoldTimer=void 0,e._isTouchHolding=!0,!defined(r=e.getInputAction(ScreenSpaceEventType$1.RIGHT_CLICK,n))||checkPixelTolerance(e._primaryStartPosition,e._previousPositions.values[0],e._holdPixelTolerance)&&(Cartesian2.clone(e._primaryPosition,touchHoldEvent.position),r(touchHoldEvent)))},ScreenSpaceEventHandler.touchHoldDelayMilliseconds),t.preventDefault()}2!==o||s||(e._isPinching=!0,defined(i=e.getInputAction(ScreenSpaceEventType$1.PINCH_START,n))&&(Cartesian2.clone(a.values[0],touch2StartEvent.position1),Cartesian2.clone(a.values[1],touch2StartEvent.position2),i(touch2StartEvent),t.preventDefault()))}function handleTouchMove(e,t){gotTouchEvent(e);var i,r,n,a=t.changedTouches,o=a.length,s=e._positions;for(i=0;i<o;++i){n=(r=a[i]).identifier;var l=s.get(n);defined(l)&&getPosition$1(e,r,l)}fireTouchMoveEvents(e,t);var u=e._previousPositions;for(i=0;i<o;++i)n=(r=a[i]).identifier,Cartesian2.clone(s.get(n),u.get(n))}var touchMoveEvent={startPosition:new Cartesian2,endPosition:new Cartesian2},touchPinchMovementEvent={distance:{startPosition:new Cartesian2,endPosition:new Cartesian2},angleAndHeight:{startPosition:new Cartesian2,endPosition:new Cartesian2}};function fireTouchMoveEvents(e,t){var i,r=getModifier(t),n=e._positions,a=e._previousPositions,o=n.length;if(1===o&&e._buttonDown[MouseButton.LEFT]){var s=n.values[0];Cartesian2.clone(s,e._primaryPosition);var l=e._primaryPreviousPosition;defined(i=e.getInputAction(ScreenSpaceEventType$1.MOUSE_MOVE,r))&&(Cartesian2.clone(l,touchMoveEvent.startPosition),Cartesian2.clone(s,touchMoveEvent.endPosition),i(touchMoveEvent)),Cartesian2.clone(s,l),t.preventDefault()}else if(2===o&&e._isPinching&&defined(i=e.getInputAction(ScreenSpaceEventType$1.PINCH_MOVE,r))){var u=n.values[0],c=n.values[1],d=a.values[0],h=a.values[1],p=c.x-u.x,f=c.y-u.y,m=.25*Math.sqrt(p*p+f*f),g=h.x-d.x,y=h.y-d.y,v=.25*Math.sqrt(g*g+y*y),_=.125*(c.y+u.y),C=.125*(h.y+d.y),x=Math.atan2(f,p),b=Math.atan2(y,g);Cartesian2.fromElements(0,v,touchPinchMovementEvent.distance.startPosition),Cartesian2.fromElements(0,m,touchPinchMovementEvent.distance.endPosition),Cartesian2.fromElements(b,C,touchPinchMovementEvent.angleAndHeight.startPosition),Cartesian2.fromElements(x,_,touchPinchMovementEvent.angleAndHeight.endPosition),i(touchPinchMovementEvent)}}function handlePointerDown(e,t){if(t.target.setPointerCapture(t.pointerId),"touch"===t.pointerType){var i=e._positions,r=t.pointerId;i.set(r,getPosition$1(e,t,new Cartesian2)),fireTouchEvents(e,t),e._previousPositions.set(r,Cartesian2.clone(i.get(r)))}else handleMouseDown(e,t)}function handlePointerUp(e,t){if("touch"===t.pointerType){var i=e._positions,r=t.pointerId;i.remove(r),fireTouchEvents(e,t),e._previousPositions.remove(r)}else handleMouseUp(e,t)}function handlePointerMove(e,t){if("touch"===t.pointerType){var i=e._positions,r=t.pointerId,n=i.get(r);if(!defined(n))return;getPosition$1(e,t,n),fireTouchMoveEvents(e,t);var a=e._previousPositions;Cartesian2.clone(i.get(r),a.get(r))}else handleMouseMove(e,t)}function ScreenSpaceEventHandler(e){this._inputEvents={},this._buttonDown={LEFT:!1,MIDDLE:!1,RIGHT:!1},this._isPinching=!1,this._isTouchHolding=!1,this._lastSeenTouchEvent=-ScreenSpaceEventHandler.mouseEmulationIgnoreMilliseconds,this._primaryStartPosition=new Cartesian2,this._primaryPosition=new Cartesian2,this._primaryPreviousPosition=new Cartesian2,this._positions=new AssociativeArray,this._previousPositions=new AssociativeArray,this._removalFunctions=[],this._touchHoldTimer=void 0,this._clickPixelTolerance=5,this._holdPixelTolerance=25,this._element=defaultValue(e,document),registerListeners(this)}function MVTImageryProvider(e){this.mapboxRenderer=new tmp$6.BasicRenderer({style:e.style}),this.ready=!1;var t=this;this.readyPromise=this.mapboxRenderer._style.loadedPromise.then(function(){t.ready=!0}),this.tilingScheme=new WebMercatorTilingScheme,this.rectangle=this.tilingScheme.rectangle,this.tileSize=this.tileWidth=this.tileHeight=e.tileSize||512,this.maximumLevel=e.maximumLevel||Number.MAX_SAFE_INTEGER,this.minimumLevel=e.minimumLevel||0,this.tileDiscardPolicy=void 0,this.errorEvent=new Event,this.credit=new Credit(e.credit||"",!1),this.proxy=new DefaultProxy(""),this.hasAlphaChannel=void 0===e.hasAlphaChannel||e.hasAlphaChannel,this.coreMap=e.coreMap,this.sourceFilter=e.sourceFilter,this._pickEvent=new Event,this.pickedLayerCache=new Map,this.clickImagery()}function PerspectiveProjectionMapShader(){}function PerspectiveProjectionMap(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).context;this._enabled=defaultValue(e.enabled,!0),this._softShadows=defaultValue(e.softShadows,!1),this._normalOffset=defaultValue(e.normalOffset,!0),this.dirty=!0,this._name=e.name||"",this._matchMaterials=e.matchMaterials||[],this._type="perspective",this.fromLightSource=defaultValue(e.fromLightSource,!0),this.darkness=defaultValue(e.darkness,0),this._darkness=this.darkness,this.maximumDistance=defaultValue(e.maximumDistance,5e3),this._outOfView=!1,this._outOfViewPrevious=!1,this._needsUpdate=!0,this._outOfAngle=!1,this._outOfAnglePrevious=!1;var i,r=!(this._angleDiff=0);(FeatureDetection$1.isInternetExplorer()||FeatureDetection$1.isEdge()||(FeatureDetection$1.isChrome()||FeatureDetection$1.isFirefox())&&FeatureDetection$1.isWindows()&&!t.depthTexture)&&(r=!0),this._polygonOffsetSupported=r,this._terrainBias={polygonOffset:r,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.5,normalShading:!0,normalShadingSmooth:.3,depthBias:1e-4},this._primitiveBias={polygonOffset:r,polygonOffsetFactor:-1.1,polygonOffsetUnits:-4,normalOffset:this._normalOffset,normalOffsetScale:.1,normalShading:!0,normalShadingSmooth:.05,depthBias:e.depthBias||-2e-5},this._pointBias={polygonOffset:!1,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:0,normalShading:!0,normalShadingSmooth:.1,depthBias:5e-4},this._depthAttachment=void 0,this._colorAttachment=void 0,this._shadowMapMatrix=new Matrix4,this._shadowMapTexture=void 0,this._shadowMapProjectionTexture=void 0,this._castImage=void 0,this._lightDirectionEC=new Cartesian3,this._lightPositionEC=new Cartesian4,this._distance=0,this._lightCamera=e.lightCamera,this._shadowMapCamera=new ShadowMapCamera$1,this._shadowMapCullingVolume=void 0,this._sceneCamera=void 0,this._boundingSphere=new BoundingSphere,this._isPointLight=defaultValue(e.isPointLight,!1),this._pointLightRadius=defaultValue(e.pointLightRadius,100),this._cascadesEnabled=!this._isPointLight&&defaultValue(e.cascadesEnabled,!0),this._numberOfCascades=this._cascadesEnabled?defaultValue(e.numberOfCascades,4):0,this._fitNearFar=!0,this._maximumCascadeDistances=[25,150,700,Number.MAX_VALUE],this._textureSize=new Cartesian2,this._isSpotLight=!1,this._cascadesEnabled?this._shadowMapCamera.frustum=new OrthographicOffCenterFrustum:defined(this._lightCamera.frustum.fov)&&(this._isSpotLight=!0),this._cascadeSplits=[new Cartesian4,new Cartesian4],this._cascadeMatrices=[new Matrix4,new Matrix4,new Matrix4,new Matrix4],this._cascadeDistances=new Cartesian4,i=this._isPointLight?6:this._cascadesEnabled?this._numberOfCascades:1,this._passes=new Array(i);for(var n=0;n<i;++n)this._passes[n]=new ShadowPass$1(t);this.debugShow=!1,this.debugFreezeFrame=!1,this._debugFreezeFrame=!1,this._debugCascadeColors=!1,this._debugLightFrustum=void 0,this._debugCameraFrustum=void 0,this._debugCascadeFrustums=new Array(this._numberOfCascades),this._debugShadowViewCommand=void 0,this._usesDepthTexture=t.depthTexture,this._isPointLight&&(this._usesDepthTexture=!1),this._usesDepthTexture=!1,this._primitiveRenderState=void 0,this._terrainRenderState=void 0,this._pointRenderState=void 0,createRenderStates$3(this),this._clearCommand=new ClearCommand({depth:1,color:new Color}),this._clearPassState=new PassState(t),this._size=defaultValue(e.size,2048),this.size=this._size,this._opacity=defaultValue(e.opacity,1),this._maxDiffAngle=defaultValue(e.maxDiffAngle,Math.PI),this._shadowMapProjectionTexture=t.defaultTexture,this._shadowMapBlendTexture=t.defaultTexture,this._isCastTextureDirty=!1,this._isPlayVideo=defaultValue(e.playVideo,!1),this._videoFrameInterval=defaultValue(e.videoFrameInterval,500),this._linearSampler=LinearSampler.make(0,1,0,60),void 0!==e.calibrateParam?this._calibrateParam=Matrix4.fromColumnMajorArray(e.calibrateParam):this._calibrateParam=new Matrix4,fetchBlendTexture(t,this,GEOWORLD_BASE_URL+"./Assets/Images/blend.png")}function fetchBlendTexture(t,i,e){Resource.fetchImage({url:e}).then(function(e){i._shadowMapBlendTexture=new Texture({context:t,source:e}),i._shadowMapBlendTexture.generateMipmap()})}function onVisible(e,t){LinearSampler.assign(e,e[4],1,t,t+30)}function onDisable(e,t){LinearSampler.assign(e,e[4],0,t,t+15)}function ShadowPass$1(e){this.camera=new ShadowMapCamera$1,this.passState=new PassState(e),this.framebuffer=void 0,this.textureOffsets=void 0,this.commandList=[],this.cullingVolume=void 0}function createRenderState$1(e,t){return RenderState.fromCache({cull:{enabled:!0,face:CullFace$1.BACK},depthTest:{enabled:!0,func:DepthFunction$1.LESS},colorMask:{red:e,green:e,blue:e,alpha:e},depthMask:!0,polygonOffset:{enabled:t.polygonOffset,factor:t.polygonOffsetFactor,units:t.polygonOffsetUnits}})}function createRenderStates$3(e){var t=!e._usesDepthTexture;e._primitiveRenderState=createRenderState$1(t,e._primitiveBias),e._terrainRenderState=createRenderState$1(t,e._terrainBias),e._pointRenderState=createRenderState$1(t,e._pointBias)}function destroyFramebuffer$2(e){for(var t=e._passes.length,i=0;i<t;++i){var r=e._passes[i],n=r.framebuffer;defined(n)&&!n.isDestroyed()&&n.destroy(),r.framebuffer=void 0}e._depthAttachment=e._depthAttachment&&e._depthAttachment.destroy(),e._colorAttachment=e._colorAttachment&&e._colorAttachment.destroy()}function clearFramebuffer$1(e,t,i){i=defaultValue(i,0),!e._isPointLight&&0!==i||(e._clearCommand.framebuffer=e._passes[i].framebuffer,e._clearCommand.execute(t,e._clearPassState))}function resize$1(e,t){e._size=t;var i=e._passes,r=i.length,n=e._textureSize;if(e._isPointLight){t=ContextLimits.maximumCubeMapSize>=t?t:ContextLimits.maximumCubeMapSize,n.x=t;var a=new BoundingRectangle(0,0,n.y=t,t);i[0].passState.viewport=a,i[1].passState.viewport=a,i[2].passState.viewport=a,i[3].passState.viewport=a,i[4].passState.viewport=a,i[5].passState.viewport=a}else 1===r?(t=ContextLimits.maximumTextureSize>=t?t:ContextLimits.maximumTextureSize,n.x=t,n.y=t,i[0].passState.viewport=new BoundingRectangle(0,0,t,t)):4===r&&(t=ContextLimits.maximumTextureSize>=2*t?t:ContextLimits.maximumTextureSize/2,n.x=2*t,n.y=2*t,i[0].passState.viewport=new BoundingRectangle(0,0,t,t),i[1].passState.viewport=new BoundingRectangle(t,0,t,t),i[2].passState.viewport=new BoundingRectangle(0,t,t,t),i[3].passState.viewport=new BoundingRectangle(t,t,t,t));e._clearPassState.viewport=new BoundingRectangle(0,0,n.x,n.y);for(var o=0;o<r;++o){var s=i[o],l=s.passState.viewport,u=l.x/n.x,c=l.y/n.y,d=l.width/n.x,h=l.height/n.y;s.textureOffsets=new Matrix4(d,0,0,u,0,h,0,c,0,0,1,0,0,0,0,1)}}ScreenSpaceEventHandler.prototype.setInputAction=function(e,t,i){var r=getInputEventKey(t,i);this._inputEvents[r]=e},ScreenSpaceEventHandler.prototype.getInputAction=function(e,t){var i=getInputEventKey(e,t);return this._inputEvents[i]},ScreenSpaceEventHandler.prototype.removeInputAction=function(e,t){var i=getInputEventKey(e,t);delete this._inputEvents[i]},ScreenSpaceEventHandler.prototype.isDestroyed=function(){return!1},ScreenSpaceEventHandler.prototype.destroy=function(){return unregisterListeners(this),destroyObject(this)},ScreenSpaceEventHandler.mouseEmulationIgnoreMilliseconds=800,ScreenSpaceEventHandler.touchHoldDelayMilliseconds=1500,Object.defineProperties(MVTImageryProvider.prototype,{pickEvent:{get:function(){return this._pickEvent}}}),MVTImageryProvider.prototype.clickImagery=function(){var r=this;new ScreenSpaceEventHandler(r.coreMap.scene.canvas).setInputAction(function(e){var t=r.coreMap.camera.getPickRay(e.position),i=r.coreMap.imageryLayers.pickImageryLayerFeatures(t,r.coreMap.scene);defined(i)?when(i,function(e){if(0<e.length){var t=e[0].data;for(var i in t)if(t.hasOwnProperty(i)){r._pickEvent.raiseEvent(i,t[i]);break}}}):console.log(" No features picked ! ")},ScreenSpaceEventType$1.LEFT_CLICK)},MVTImageryProvider.prototype.getTileCredits=function(e,t,i){return[]},MVTImageryProvider.prototype.createTile=function(){var e=document.createElement("canvas");return e.width=this.tileSize,e.height=this.tileSize,e.style.imageRendering="pixelated",e.getContext("2d").globalCompositeOperation="copy",e},MVTImageryProvider.prototype.requestImage=function(t,i,r,a){if(null==a&&(a=!0),r>this.maximumLevel||r<this.minimumLevel)return Promise.reject(void 0);this.mapboxRenderer.filterForZoom(r);var o=[],s=this;return this.mapboxRenderer.getVisibleSources().forEach(function(e){o.push({source:e,z:r,x:t,y:i,left:0,top:0,size:s.tileSize})}),new Promise(function(t,i){var r=s.createTile(),n=s.mapboxRenderer.renderTiles(r.getContext("2d"),{srcLeft:0,srcTop:0,width:s.tileSize,height:s.tileSize,destLeft:0,destTop:0},o,function(e){if(e)switch(e){case"canceled":case"fully-canceled":i(void 0);break;default:i(void 0)}else a?(n.consumer.ctx=void 0,t(r),s.mapboxRenderer.releaseRender(n)):t(n)})})},MVTImageryProvider.prototype.pickFeatures=function(e,t,r,n,a){var o=this;return this.requestImage(e,t,r,!1).then(function(e){var t=o.mapboxRenderer.getVisibleSources();t=o.sourceFilter?o.sourceFilter(t):t;var i=[];return n=CesiumMath.toDegrees(n),a=CesiumMath.toDegrees(a),t.forEach(function(e){i.push({data:o.mapboxRenderer.queryRenderedFeatures({source:e,renderedZoom:r,lng:n,lat:a,tileZ:r})})}),e.consumer.ctx=void 0,o.mapboxRenderer.releaseRender(e),i})},MVTImageryProvider.prototype.setFilter=function(n){var a=this,o=[];return a.pickedLayerCache.forEach(function(e,t,i){if(!n.has(t)){var r=a.mapboxRenderer.setFilter(t,e,!0);o.push(r)}}),n.forEach(function(e,t,i){var r=a.mapboxRenderer.setFilter(t,e,!0);o.push(r),a.pickedLayerCache.set(t,e.slice(0,2))}),when.all(o).then(a._reload())},MVTImageryProvider.prototype.addSource=function(e,t){var i=this.mapboxRenderer._style;console.info(i),i.loadedPromise.then(function(){i.addSource(e,t)})},MVTImageryProvider.prototype.addLayer=function(e){var t=this.mapboxRenderer._style;t.loadedPromise.then(function(){t.addLayer(e)})},PerspectiveProjectionMapShader.getShadowCastShaderKeyword=function(e,t,i,r){return"castShadow "+e+" "+t+" "+i+" "+r},PerspectiveProjectionMapShader.createShadowCastVertexShader=function(e,t,i){var r=e.defines.slice(0),n=e.sources.slice(0);i&&r.push("GENERATE_POSITION");var a=defined(ShaderSource.findPositionVarying(e));if(t&&!a){for(var o=n.length,s=0;s<o;++s)n[s]=ShaderSource.replaceMain(n[s],"czm_shadow_cast_main");n.push("varying vec3 v_positionEC; \nvoid main() \n{ \n czm_shadow_cast_main(); \n v_positionEC = (czm_inverseProjection * gl_Position).xyz; \n}")}return new ShaderSource({defines:r,sources:n})},PerspectiveProjectionMapShader.createShadowCastFragmentShader=function(e,t,i,r){var n=e.defines.slice(0),a=e.sources.slice(0),o=ShaderSource.findPositionVarying(e),s=defined(o);s||(o="v_positionEC");for(var l=a.length,u=0;u<l;++u)a[u]=ShaderSource.replaceMain(a[u],"czm_shadow_cast_main");var c="";return t&&(s||(c+="varying vec3 v_positionEC; \n"),c+="uniform vec4 shadowMap_lightPositionEC; \n"),c+=r?"void main() \n{ \n":"void main() \n{ \n czm_shadow_cast_main(); \n if (gl_FragColor.a == 0.0) \n { \n discard; \n } \n",c+=t?" float distance = length("+o+"); \n if (distance >= shadowMap_lightPositionEC.w) \n { \n discard; \n } \n distance /= shadowMap_lightPositionEC.w; // radius \n gl_FragColor = czm_packDepth(distance); \n":i?" gl_FragColor = vec4(1.0); \n":" gl_FragColor = czm_packDepth(gl_FragCoord.z); \n",c+="} \n",a.push(c),new ShaderSource({defines:n,sources:a})},PerspectiveProjectionMapShader.getReceiveShaderKeyword=function(e,t,i,r){return"receivePerspectiveProjection "+e._usesDepthTexture+e._polygonOffsetSupported+e._isPointLight+e._isSpotLight+(1<e._numberOfCascades)+e.debugCascadeColors+e.softShadows+t+i+r},PerspectiveProjectionMapShader.createReceiveVertexShader=function(e,t,i){var r=e.defines.slice(0),n=e.sources.slice(0);return t&&(i?r.push("GENERATE_POSITION_AND_NORMAL"):r.push("GENERATE_POSITION")),new ShaderSource({defines:r,sources:n})},PerspectiveProjectionMapShader.createReceiveFragmentShader=function(e,t,i,r,n){for(var a=ShaderSource.findNormalVarying(e),o=!r&&defined(a)||r&&n,s=ShaderSource.findPositionVarying(e),l=defined(s),u=t._usesDepthTexture,c=(t._polygonOffsetSupported,t._isPointLight),d=t._isSpotLight,h=1<t._numberOfCascades,p=(t.debugCascadeColors,t.softShadows),f=c?t._pointBias:r?t._terrainBias:t._primitiveBias,m=e.defines.slice(0),g=e.sources.slice(0),y=g.length,v=0;v<y;++v)g[v]=ShaderSource.replaceMain(g[v],"czm_shadow_receive_main");c?m.push("USE_CUBE_MAP_SHADOW"):u&&m.push("USE_SHADOW_DEPTH_TEXTURE"),p&&!c&&m.push("USE_SOFT_SHADOWS"),h&&i&&r&&(o?m.push("ENABLE_VERTEX_LIGHTING"):m.push("ENABLE_DAYNIGHT_SHADING")),i&&f.normalShading&&o&&(m.push("USE_NORMAL_SHADING"),0<f.normalShadingSmooth&&m.push("USE_NORMAL_SHADING_SMOOTH"));var _="";return _+=c?"uniform samplerCube shadowMap_textureCube; \n":"uniform sampler2D shadowMap_texture; \n",_+="uniform sampler2D shadowMap_projectionTexture; \n",_+="uniform sampler2D shadowMap_blendTexture;",_+="uniform sampler2D shadowMap_projectionTextureArr[4]; \n",_+="uniform vec4 shadowMap_lightPositionECArr[4]; \n",_+="uniform mat4 shadowMap_matrixArr[4]; \n",_+="uniform mat4 shadowMap_calibrateParamArr[4]; \n",_+="uniform vec4 shadowMapCount; \n",_+="uniform mat4 shadowMap_matrix; \nuniform vec3 shadowMap_lightDirectionEC; \nuniform vec4 shadowMap_lightPositionEC; \nuniform vec4 shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness; \nuniform vec4 shadowMap_texelSizeDepthBiasAndNormalShadingSmooth; \nuniform vec4 shadowMap_opacityArr; \n#ifdef LOG_DEPTH \nvarying vec3 v_logPositionEC; \n#endif \nvec4 getPositionEC() \n{ \n"+(l?" return vec4("+s+", 1.0); \n":"#ifndef LOG_DEPTH \n return czm_windowToEyeCoordinates(gl_FragCoord); \n#else \n return vec4(v_logPositionEC, 1.0); \n#endif \n")+"} \nvec3 getNormalEC() \n{ \n"+(o?" return normalize("+a+"); \n":" return vec3(1.0); \n")+"} \nvoid applyNormalOffset(inout vec4 positionEC, vec3 normalEC, float nDotL) \n{ \n"+(f.normalOffset&&o?" float normalOffset = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.x; \n float normalOffsetScale = 1.0 - nDotL; \n vec3 offset = normalOffset * normalOffsetScale * normalEC; \n positionEC.xyz += offset; \n":"")+"} \nvec2 cameraDistortion(inout vec2 UV, mat4 calibParam) //imageSize, vec2 focalLength, vec2 opticalCenter, vec4 distortionCoeffs, vec2 tangentCoeffs) \n{ \n vec2 imageSize = vec2(calibParam[0][0],calibParam[0][1]); \n vec2 focalLength = vec2(calibParam[0][2],calibParam[0][3]); \n vec2 opticalCenter = vec2(calibParam[1][0],calibParam[1][1]); \n vec2 tangentCoeffs = vec2(calibParam[1][2],calibParam[1][3]); \n vec4 distortionCoeffs = vec4(calibParam[2][0], calibParam[2][1],calibParam[2][2],calibParam[2][3]); \n vec2 opticalCenterUV = opticalCenter / imageSize; \n vec2 xy = (UV - opticalCenterUV ) * imageSize / focalLength; \n float x2 = xy.x * xy.x; \n float y2 = xy.y * xy.y; \n float r2 = x2 + y2; \n float _2xy = 2.0 * xy.x * xy.y; \n highp float kr = (1.0 + ((distortionCoeffs.z*r2 + distortionCoeffs.y)*r2 + distortionCoeffs.x)*r2); \n highp float dx = (xy.x*kr + tangentCoeffs.x*_2xy + tangentCoeffs.y*(r2 + 2.0*x2)); \n highp float dy = (xy.y*kr + tangentCoeffs.x*(r2 + 2.0*y2) + tangentCoeffs.y*_2xy); \n UV = vec2(dx,dy) * focalLength / imageSize + opticalCenterUV; \n return UV; \n} \n",_+="void main() \n{ \n czm_shadow_receive_main(); \n vec4 positionEC = getPositionEC(); \n vec3 normalEC = getNormalEC(); \n float depth = -positionEC.z; \n",d&&(_+=" for(int i = 0; i < 4; i++){ \n if(i < int(shadowMapCount.x)){ \n"),_+=" vec3 directionEC = normalize(positionEC.xyz - shadowMap_lightPositionECArr[i].xyz); \n float nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0); \n applyNormalOffset(positionEC, normalEC, nDotL); \n vec4 shadowPosition = shadowMap_matrixArr[i] * positionEC; \n // Spot light uses a perspective projection, so perform the perspective divide \n shadowPosition /= shadowPosition.w; \n vec2 oldUV = shadowPosition.xy; \n if(shadowMap_calibrateParamArr[i][0].y > 0.0){ \n shadowPosition.xy = cameraDistortion(shadowPosition.xy, shadowMap_calibrateParamArr[i] ); //imageSize, focalLength, opticalCenter, distortionCoefficients, tangentCoeffs); \n } \n // Stop early if the fragment is not in the shadow bounds \n if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0)))) \n { \n continue; \n } \n vec4 tempColor = texture2D(shadowMap_blendTexture, oldUV.xy); \n if(tempColor.a < 0.14 ) continue; \n if(i == 0){ \n tempColor = texture2D(shadowMap_projectionTextureArr[0], shadowPosition.xy) * tempColor; \n gl_FragColor = mix(gl_FragColor,tempColor, shadowMap_opacityArr.x * tempColor.a); \n }else if(i == 1){ \n tempColor = texture2D(shadowMap_projectionTextureArr[1], shadowPosition.xy) * tempColor; \n gl_FragColor = mix(gl_FragColor,tempColor, shadowMap_opacityArr.y * tempColor.a); \n }else if(i == 2){ \n tempColor = texture2D(shadowMap_projectionTextureArr[2], shadowPosition.xy) * tempColor; \n gl_FragColor = mix(gl_FragColor,tempColor, shadowMap_opacityArr.z * tempColor.a); \n }else { \n tempColor = texture2D(shadowMap_projectionTextureArr[3], shadowPosition.xy) * tempColor; \n gl_FragColor = mix(gl_FragColor,tempColor, shadowMap_opacityArr.w * tempColor.a); \n } \n }else{ \n break; \n } \n } \n \n",_+="} \n",g.push(_),new ShaderSource({defines:m,sources:g})},PerspectiveProjectionMap.MAXIMUM_DISTANCE=2e4,PerspectiveProjectionMap.prototype.debugCreateRenderStates=function(){createRenderStates$3(this)},Object.defineProperties(PerspectiveProjectionMap.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this.dirty=this._enabled!==e,this._enabled=e}},normalOffset:{get:function(){return this._normalOffset},set:function(e){this.dirty=this._normalOffset!==e,this._normalOffset=e,this._terrainBias.normalOffset=e,this._primitiveBias.normalOffset=e,this._pointBias.normalOffset=e}},softShadows:{get:function(){return this._softShadows},set:function(e){this.dirty=this._softShadows!==e,this._softShadows=e}},size:{get:function(){return this._size},set:function(e){resize$1(this,e)}},outOfView:{get:function(){return this._outOfView}},shadowMapCullingVolume:{get:function(){return this._shadowMapCullingVolume}},passes:{get:function(){return this._passes}},isPointLight:{get:function(){return this._isPointLight}},castTexture:{set:function(e){var t=this;(t._castImage=e)instanceof HTMLVideoElement&&(t._isPlayVideo&&t._castImage.play(),t._castImage.addEventListener("play",function(){t.playVideo=!0},!0),t._castImage.addEventListener("pause",function(){t.playVideo=!1},!0),t._castImage.timeupdate=function(e){t.timeupdate=!0}),t._isCastTextureDirty=!0}},playVideo:{set:function(e){this._isPlayVideo=e,this._isCastTextureDirty=e}},debugCascadeColors:{get:function(){return this._debugCascadeColors},set:function(e){this.dirty=this._debugCascadeColors!==e,this._debugCascadeColors=e}}});var scratchViewport$3=new BoundingRectangle;function createDebugShadowViewCommand$1(e,t){var i;i=e._isPointLight?"uniform samplerCube shadowMap_textureCube; \nvarying vec2 v_textureCoordinates; \nvoid main() \n{ \n vec2 uv = v_textureCoordinates; \n vec3 dir; \n \n if (uv.y < 0.5) \n { \n if (uv.x < 0.333) \n { \n dir.x = -1.0; \n dir.y = uv.x * 6.0 - 1.0; \n dir.z = uv.y * 4.0 - 1.0; \n } \n else if (uv.x < 0.666) \n { \n dir.y = -1.0; \n dir.x = uv.x * 6.0 - 3.0; \n dir.z = uv.y * 4.0 - 1.0; \n } \n else \n { \n dir.z = -1.0; \n dir.x = uv.x * 6.0 - 5.0; \n dir.y = uv.y * 4.0 - 1.0; \n } \n } \n else \n { \n if (uv.x < 0.333) \n { \n dir.x = 1.0; \n dir.y = uv.x * 6.0 - 1.0; \n dir.z = uv.y * 4.0 - 3.0; \n } \n else if (uv.x < 0.666) \n { \n dir.y = 1.0; \n dir.x = uv.x * 6.0 - 3.0; \n dir.z = uv.y * 4.0 - 3.0; \n } \n else \n { \n dir.z = 1.0; \n dir.x = uv.x * 6.0 - 5.0; \n dir.y = uv.y * 4.0 - 3.0; \n } \n } \n \n float shadow = czm_unpackDepth(textureCube(shadowMap_textureCube, dir)); \n gl_FragColor = vec4(vec3(shadow), 1.0); \n} \n":"uniform sampler2D shadowMap_texture; \nvarying vec2 v_textureCoordinates; \nvoid main() \n{ \n"+(e._usesDepthTexture?" float shadow = texture2D(shadowMap_texture, v_textureCoordinates).r; \n":" float shadow = czm_unpackDepth(texture2D(shadowMap_texture, v_textureCoordinates)); \n")+" gl_FragColor = vec4(vec3(shadow), 1.0); \n} \n";var r=t.createViewportQuadCommand(i,{uniformMap:{shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture}}});return r.pass=Pass$1.OVERLAY,r}function updateDebugShadowViewCommand$1(e,t){var i=t.context,r=t.context.drawingBufferWidth,n=t.context.drawingBufferHeight,a=.3*Math.min(r,n),o=scratchViewport$3;o.x=r-a,o.y=0,o.width=a,o.height=a;var s=e._debugShadowViewCommand;defined(s)||(s=createDebugShadowViewCommand$1(e,i),e._debugShadowViewCommand=s),defined(s.renderState)&&BoundingRectangle.equals(s.renderState.viewport,o)||(s.renderState=RenderState.fromCache({viewport:BoundingRectangle.clone(o)})),t.commandList.push(e._debugShadowViewCommand)}var frustumCornersNDC$2=new Array(8);frustumCornersNDC$2[0]=new Cartesian4(-1,-1,-1,1),frustumCornersNDC$2[1]=new Cartesian4(1,-1,-1,1),frustumCornersNDC$2[2]=new Cartesian4(1,1,-1,1),frustumCornersNDC$2[3]=new Cartesian4(-1,1,-1,1),frustumCornersNDC$2[4]=new Cartesian4(-1,-1,1,1),frustumCornersNDC$2[5]=new Cartesian4(1,-1,1,1),frustumCornersNDC$2[6]=new Cartesian4(1,1,1,1),frustumCornersNDC$2[7]=new Cartesian4(-1,1,1,1);for(var scratchMatrix$1=new Matrix4,scratchFrustumCorners$2=new Array(8),i$3=0;i$3<8;++i$3)scratchFrustumCorners$2[i$3]=new Cartesian4;function createDebugPointLight$1(e,t){return new Primitive({geometryInstances:[new GeometryInstance({geometry:new BoxOutlineGeometry({minimum:new Cartesian3(-.5,-.5,-.5),maximum:new Cartesian3(.5,.5,.5)}),attributes:{color:ColorGeometryInstanceAttribute.fromColor(t)}}),new GeometryInstance({geometry:new SphereOutlineGeometry({radius:.5}),attributes:{color:ColorGeometryInstanceAttribute.fromColor(t)}})],appearance:new PerInstanceColorAppearance({translucent:!1,flat:!0}),asynchronous:!1,modelMatrix:e})}var debugOutlineColors$1=[Color.RED,Color.GREEN,Color.BLUE,Color.MAGENTA],scratchScale$6=new Cartesian3;function applyDebugSettings$1(e,t){updateDebugShadowViewCommand$1(e,t);var i=e.debugFreezeFrame&&!e._debugFreezeFrame;if(e._debugFreezeFrame=e.debugFreezeFrame,e.debugFreezeFrame&&(i&&(e._debugCameraFrustum=e._debugCameraFrustum&&e._debugCameraFrustum.destroy(),e._debugCameraFrustum=new DebugCameraPrimitive({camera:e._sceneCamera,color:Color.CYAN,updateOnChange:!1})),e._debugCameraFrustum.update(t)),e._cascadesEnabled){if(e.debugFreezeFrame){i&&(e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=new DebugCameraPrimitive({camera:e._shadowMapCamera,color:Color.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t);for(var r=0;r<e._numberOfCascades;++r)i&&(e._debugCascadeFrustums[r]=e._debugCascadeFrustums[r]&&e._debugCascadeFrustums[r].destroy(),e._debugCascadeFrustums[r]=new DebugCameraPrimitive({camera:e._passes[r].camera,color:debugOutlineColors$1[r],updateOnChange:!1})),e._debugCascadeFrustums[r].update(t)}}else if(e._isPointLight){if(!defined(e._debugLightFrustum)||e._needsUpdate){var n=e._shadowMapCamera.positionWC,a=Quaternion.IDENTITY,o=2*e._pointLightRadius,s=Cartesian3.fromElements(o,o,o,scratchScale$6),l=Matrix4.fromTranslationQuaternionRotationScale(n,a,s,scratchMatrix$1);e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=createDebugPointLight$1(l,Color.YELLOW)}e._debugLightFrustum.update(t)}else defined(e._debugLightFrustum)&&!e._needsUpdate||(e._debugLightFrustum=new DebugCameraPrimitive({camera:e._shadowMapCamera,color:Color.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t)}function ShadowMapCamera$1(){this.viewMatrix=new Matrix4,this.inverseViewMatrix=new Matrix4,this.frustum=void 0,this.positionCartographic=new Cartographic,this.positionWC=new Cartesian3,this.directionWC=Cartesian3.clone(Cartesian3.UNIT_Z),this.upWC=Cartesian3.clone(Cartesian3.UNIT_Y),this.rightWC=Cartesian3.clone(Cartesian3.UNIT_X),this.viewProjectionMatrix=new Matrix4}ShadowMapCamera$1.prototype.clone=function(e){Matrix4.clone(e.viewMatrix,this.viewMatrix),Matrix4.clone(e.inverseViewMatrix,this.inverseViewMatrix),this.frustum=e.frustum.clone(this.frustum),Cartographic.clone(e.positionCartographic,this.positionCartographic),Cartesian3.clone(e.positionWC,this.positionWC),Cartesian3.clone(e.directionWC,this.directionWC),Cartesian3.clone(e.upWC,this.upWC),Cartesian3.clone(e.rightWC,this.rightWC)};var scaleBiasMatrix$1=new Matrix4(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);ShadowMapCamera$1.prototype.getViewProjection=function(){var e=this.viewMatrix,t=this.frustum.projectionMatrix;return Matrix4.multiply(t,e,this.viewProjectionMatrix),Matrix4.multiply(scaleBiasMatrix$1,this.viewProjectionMatrix,this.viewProjectionMatrix),this.viewProjectionMatrix};var scratchSplits$2=new Array(5),scratchFrustum$1=new PerspectiveFrustum,scratchCascadeDistances$1=new Array(4),scratchMin$2=new Cartesian3,scratchMax$2=new Cartesian3;function computeCascades$1(e,t){var i,r=e._shadowMapCamera,n=e._sceneCamera,a=n.frustum.near,o=n.frustum.far,s=e._numberOfCascades,l=o-a,u=o/a,c=.9,d=!1;t.shadowState.closestObjectSize<200&&(d=!0,c=.9);var h=scratchCascadeDistances$1,p=scratchSplits$2;for(p[0]=a,p[s]=o,i=0;i<s;++i){var f=(i+1)/s,m=a*Math.pow(u,f),g=a+l*f,y=CesiumMath.lerp(g,m,c);p[i+1]=y,h[i]=y-p[i]}if(d){for(i=0;i<s;++i)h[i]=Math.min(h[i],e._maximumCascadeDistances[i]);var v=p[0];for(i=0;i<s-1;++i)v+=h[i],p[i+1]=v}Cartesian4.unpack(p,0,e._cascadeSplits[0]),Cartesian4.unpack(p,1,e._cascadeSplits[1]),Cartesian4.unpack(h,0,e._cascadeDistances);var _=r.frustum,C=_.left,x=_.right,b=_.bottom,A=_.top,S=_.near,w=_.far,E=r.positionWC,T=r.directionWC,P=r.upWC,M=n.frustum.clone(scratchFrustum$1),D=r.getViewProjection();for(i=0;i<s;++i){M.near=p[i],M.far=p[i+1];for(var I=Matrix4.multiply(M.projectionMatrix,n.viewMatrix,scratchMatrix$1),O=Matrix4.inverse(I,scratchMatrix$1),R=Matrix4.multiply(D,O,scratchMatrix$1),L=Cartesian3.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,scratchMin$2),N=Cartesian3.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,scratchMax$2),k=0;k<8;++k){var B=Cartesian4.clone(frustumCornersNDC$2[k],scratchFrustumCorners$2[k]);Matrix4.multiplyByVector(R,B,B),Cartesian3.divideByScalar(B,B.w,B),Cartesian3.minimumByComponent(B,L,L),Cartesian3.maximumByComponent(B,N,N)}L.x=Math.max(L.x,0),L.y=Math.max(L.y,0),L.z=0,N.x=Math.min(N.x,1),N.y=Math.min(N.y,1),N.z=Math.min(N.z,1);var F=e._passes[i],V=F.camera;V.clone(r);var z=V.frustum;z.left=C+L.x*(x-C),z.right=C+N.x*(x-C),z.bottom=b+L.y*(A-b),z.top=b+N.y*(A-b),z.near=S+L.z*(w-S),z.far=S+N.z*(w-S),F.cullingVolume=V.frustum.computeCullingVolume(E,T,P);var U=e._cascadeMatrices[i];Matrix4.multiply(V.getViewProjection(),n.inverseViewMatrix,U),Matrix4.multiply(F.textureOffsets,U,U)}}var scratchLightView$1=new Matrix4,scratchRight$2=new Cartesian3,scratchUp$1=new Cartesian3,scratchTranslation$1=new Cartesian3;function fitShadowMapToScene$1(e,t){var i=e._shadowMapCamera,r=e._sceneCamera,n=Matrix4.multiply(r.frustum.projectionMatrix,r.viewMatrix,scratchMatrix$1),a=Matrix4.inverse(n,scratchMatrix$1),o=i.directionWC,s=r.directionWC,l=Cartesian3.cross(o,s,scratchRight$2);s=Cartesian3.cross(l,o,scratchUp$1),Cartesian3.normalize(s,s),Cartesian3.normalize(l,l);for(var u=Cartesian3.fromElements(0,0,0,scratchTranslation$1),c=Matrix4.computeView(u,o,s,l,scratchLightView$1),d=Matrix4.multiply(c,a,scratchMatrix$1),h=Cartesian3.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,scratchMin$2),p=Cartesian3.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,scratchMax$2),f=0;f<8;++f){var m=Cartesian4.clone(frustumCornersNDC$2[f],scratchFrustumCorners$2[f]);Matrix4.multiplyByVector(d,m,m),Cartesian3.divideByScalar(m,m.w,m),Cartesian3.minimumByComponent(m,h,h),Cartesian3.maximumByComponent(m,p,p)}p.z+=1e3,h.z-=10;var g=scratchTranslation$1;g.x=-.5*(h.x+p.x),g.y=-.5*(h.y+p.y),g.z=-p.z;var y=Matrix4.fromTranslation(g,scratchMatrix$1);c=Matrix4.multiply(y,c,c);var v=.5*(p.x-h.x),_=.5*(p.y-h.y),C=p.z-h.z,x=i.frustum;x.left=-v,x.right=v,x.bottom=-_,x.top=_,x.near=.01,x.far=C,Matrix4.clone(c,i.viewMatrix),Matrix4.inverse(c,i.inverseViewMatrix),Matrix4.getTranslation(i.inverseViewMatrix,i.positionWC),t.mapProjection.ellipsoid.cartesianToCartographic(i.positionWC,i.positionCartographic),Cartesian3.clone(o,i.directionWC),Cartesian3.clone(s,i.upWC),Cartesian3.clone(l,i.rightWC)}var directions$1=[new Cartesian3(-1,0,0),new Cartesian3(0,-1,0),new Cartesian3(0,0,-1),new Cartesian3(1,0,0),new Cartesian3(0,1,0),new Cartesian3(0,0,1)],ups$1=[new Cartesian3(0,-1,0),new Cartesian3(0,0,-1),new Cartesian3(0,-1,0),new Cartesian3(0,-1,0),new Cartesian3(0,0,1),new Cartesian3(0,-1,0)],rights$1=[new Cartesian3(0,0,1),new Cartesian3(1,0,0),new Cartesian3(-1,0,0),new Cartesian3(0,0,-1),new Cartesian3(1,0,0),new Cartesian3(1,0,0)];function computeOmnidirectional$1(e,t){var i=new PerspectiveFrustum;i.fov=CesiumMath.PI_OVER_TWO,i.near=1,i.far=e._pointLightRadius,i.aspectRatio=1;for(var r=0;r<6;++r){var n=e._passes[r].camera;n.positionWC=e._shadowMapCamera.positionWC,n.positionCartographic=t.mapProjection.ellipsoid.cartesianToCartographic(n.positionWC,n.positionCartographic),n.directionWC=directions$1[r],n.upWC=ups$1[r],n.rightWC=rights$1[r],Matrix4.computeView(n.positionWC,n.directionWC,n.upWC,n.rightWC,n.viewMatrix),Matrix4.inverse(n.viewMatrix,n.inverseViewMatrix),n.frustum=i}}var scratchCartesian1$3=new Cartesian3,scratchCartesian2$6=new Cartesian3,scratchBoundingSphere$4=new BoundingSphere,scratchCenter$2=scratchBoundingSphere$4.center;function checkVisibility$1(e,t){var i=e._sceneCamera,r=e._shadowMapCamera,n=scratchBoundingSphere$4;if(e._cascadesEnabled){if(i.frustum.near>=e.maximumDistance)return e._outOfView=!0,void(e._needsUpdate=!1);var a=t.mapProjection.ellipsoid.geodeticSurfaceNormal(i.positionWC,scratchCartesian1$3),o=Cartesian3.negate(r.directionWC,scratchCartesian2$6),s=Cartesian3.dot(a,o);CesiumMath.clamp(s/.1,0,1);if(s<(e._darkness=0))return e._outOfView=!0,void(e._needsUpdate=!1);e._needsUpdate=!0,e._outOfView=!1}else if(e._isPointLight)n.center=r.positionWC,n.radius=e._pointLightRadius,e._outOfView=t.cullingVolume.computeVisibility(n)===Intersect$1.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(n),BoundingSphere.clone(n,e._boundingSphere);else{var l=r.frustum.far/2,u=Cartesian3.add(r.positionWC,Cartesian3.multiplyByScalar(r.directionWC,l,scratchCenter$2),scratchCenter$2);n.center=u,n.radius=l,e._outOfView=t.cullingVolume.computeVisibility(n)===Intersect$1.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(n),BoundingSphere.clone(n,e._boundingSphere);var c=Math.acos(Cartesian3.dot(r.directionWC,i.direction));(e._angleDiff=c)>e._maxDiffAngle?e._outOfAngle=!0:e._outOfAngle=!1}}function updateCameras$1(e,t){var i=t.camera,r=e._lightCamera,n=e._sceneCamera,a=e._shadowMapCamera;e._cascadesEnabled?Cartesian3.clone(r.directionWC,a.directionWC):e._isPointLight?Cartesian3.clone(r.positionWC,a.positionWC):a.clone(r);var o,s,l=e._lightDirectionEC;Matrix4.multiplyByPointAsVector(i.viewMatrix,a.directionWC,l),Cartesian3.normalize(l,l),Cartesian3.negate(l,l),Matrix4.multiplyByPoint(i.viewMatrix,a.positionWC,e._lightPositionEC),e._lightPositionEC.w=e._pointLightRadius,s=e._fitNearFar?(o=Math.min(t.shadowState.nearPlane,e.maximumDistance),Math.min(t.shadowState.farPlane,e.maximumDistance+1)):(o=i.frustum.near,e.maximumDistance),e._sceneCamera=Camera.clone(i,n),i.frustum.clone(e._sceneCamera.frustum),e._sceneCamera.frustum.near=o,e._sceneCamera.frustum.far=s,e._distance=s-o,checkVisibility$1(e,t);var u=t.frameNumber;!e._outOfViewPrevious&&e._outOfView&&(e._needsUpdate=!0),!e._outOfAnglePrevious&&e._outOfAngle?(onDisable(e._linearSampler,u),e._outOfAnglePrevious=e._outOfAngle):e._outOfAnglePrevious&&!e._outOfAngle?(onVisible(e._linearSampler,u),e._outOfAnglePrevious=e._outOfAngle):e._outOfAngle,LinearSampler.getValueExp(e._linearSampler,u),e._outOfViewPrevious=e._outOfView}function updateCastTextures$1(e,t){if(!(e._outOfView||e._linearSampler[4]<.01)&&!1!==e._isCastTextureDirty&&defined(e._castImage)){var i=t.context,r=e._shadowMapProjectionTexture,n=e._castImage;if(n instanceof HTMLVideoElement)if(2<=n.readyState){if(defined(r)){var a=(new Date).getTime();if(void 0===r._lastCreateTextureTime&&(r._lastCreateTextureTime=0),a-r._lastCreateTextureTime<e._videoFrameInterval)return;if(!n.timeupdate)return;r!==i.defaultTexture&&r.destroy(),r=void 0}if(!defined(r)||r===i.defaultTexture)return(r=new Texture({context:i,source:n}))._lastCreateTextureTime=(new Date).getTime(),e._shadowMapProjectionTexture=r,void(e._isPlayVideo||(e._isCastTextureDirty=!1))}else defined(r)||(e._shadowMapProjectionTexture=i.defaultTexture);else e._shadowMapProjectionTexture=new Texture({context:t.context,source:e._castImage}),e._isCastTextureDirty=!1}}PerspectiveProjectionMap.prototype.update=function(e){if(updateCameras$1(this,e),updateCastTextures$1(this,e),this._needsUpdate)if(this._isPointLight&&computeOmnidirectional$1(this,e),this._cascadesEnabled&&(fitShadowMapToScene$1(this,e),1<this._numberOfCascades&&computeCascades$1(this,e)),this._isPointLight)this._shadowMapCullingVolume=CullingVolume.fromBoundingSphere(this._boundingSphere);else{var t=this._shadowMapCamera,i=t.positionWC,r=t.directionWC,n=t.upWC;this._shadowMapCullingVolume=t.frustum.computeCullingVolume(i,r,n),1===this._passes.length&&this._passes[0].camera.clone(t)}if(1===this._passes.length){var a=this._sceneCamera.inverseViewMatrix;Matrix4.multiply(this._shadowMapCamera.getViewProjection(),a,this._shadowMapMatrix)}this.debugShow&&applyDebugSettings$1(this,e)},PerspectiveProjectionMap.prototype.updatePass=function(e,t){clearFramebuffer$1(this,e,t)};var scratchTexelStepSize$1=new Cartesian2;function combineUniforms$1(t,e,i,r){var n=t._isPointLight?t._pointBias:i?t._terrainBias:t._primitiveBias;return combine(e,{shadowMap_texture:function(){return t._shadowMapTexture},shadowMap_blendTexture:function(){return t._shadowMapBlendTexture},shadowMap_projectionTexture:function(){return t._shadowMapProjectionTexture},shadowMap_textureCube:function(){return t._shadowMapTexture},shadowMap_matrix:function(){return t._shadowMapMatrix},shadowMap_cascadeSplits:function(){return t._cascadeSplits},shadowMap_cascadeMatrices:function(){return t._cascadeMatrices},shadowMap_lightDirectionEC:function(){return t._lightDirectionEC},shadowMap_lightPositionEC:function(){return t._lightPositionEC},shadowMap_cascadeDistances:function(){return t._cascadeDistances},shadowMap_projectionTextureArr:function(){for(var e=[],t=0;t<4;t++)e[t]=r._shadowMapProjectionTextureArr[t]._shadowMapProjectionTexture;return e},shadowMap_lightPositionECArr:function(){return r._lightPositionECArr},shadowMap_opacityArr:function(){return Cartesian4.fromElements(r._opacityArr[0],r._opacityArr[1],r._opacityArr[2],r._opacityArr[3])},shadowMapCount:function(){return Cartesian4.fromElements(r._shadowMapCount,0,0,0)},shadowMap_matrixArr:function(){return r._shadowMapMatrixArr},shadowMap_calibrateParamArr:function(){return r._calibrateParamArr},shadowMap_texelSizeDepthBiasAndNormalShadingSmooth:function(){var e=scratchTexelStepSize$1;return e.x=1/t._textureSize.x,e.y=1/t._textureSize.y,n.depthBias,Cartesian4.fromElements(e.x,e.y,n.depthBias,n.normalShadingSmooth,this.combinedUniforms1)},shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness:function(){return Cartesian4.fromElements(n.normalOffsetScale,t._distance,t.maximumDistance,t._darkness,this.combinedUniforms2)},combinedUniforms1:new Cartesian4,combinedUniforms2:new Cartesian4},!1)}var createTextureProjectionParam=function(){var e={};e._shadowMapProjectionTextureArr=new Array(4),e._shadowMapMatrixArr=new Array(4),e._lightPositionECArr=new Array(4),e._lightDirectionECArr=new Array(4),e._calibrateParamArr=new Array(4),e._opacityArr=[1,1,1,1];for(var t=0;t<4;t++)e._shadowMapMatrixArr[t]=new Matrix4,e._calibrateParamArr[t]=new Matrix4,e._lightPositionECArr[t]=new Cartesian4,e._lightDirectionECArr[t]=new Cartesian3;return e};function matchTextureProjection$1(e,t,i){for(var r=!1,n=0;n<t.length;n++){var a=t[n];for(var o in i){var s=i[o];if("perspective"===s._type&&!1===s._outOfView){var l=!1;if(s._linearSampler[4]<.01)continue;for(var u in s._matchMaterials)if(0<=a.indexOf(s._matchMaterials[u])){l=!0;break}l&&(e.push(s),r=!0)}}}return e.sort(function(e,t){return e._angleDiff-t._angleDiff}),r}function PerspectiveProjectionMapWithDepthShader(){}function PerspectiveProjectionMapWithDepth(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).context;this._enabled=defaultValue(e.enabled,!0),this._softShadows=defaultValue(e.softShadows,!1),this._normalOffset=defaultValue(e.normalOffset,!0),this.dirty=!0,this._name=e.name||"",this._matchMaterials=e.matchMaterials||[],this._type="perspective",this._useDepth=e.useDepth,this.fromLightSource=defaultValue(e.fromLightSource,!0),this.darkness=defaultValue(e.darkness,0),this._darkness=this.darkness,this.maximumDistance=defaultValue(e.maximumDistance,5e3),this._outOfView=!1,this._outOfViewPrevious=!1,this._needsUpdate=!0,this._outOfAngle=!1,this._outOfAnglePrevious=!1;var i,r=!(this._angleDiff=0);(FeatureDetection$1.isInternetExplorer()||FeatureDetection$1.isEdge()||(FeatureDetection$1.isChrome()||FeatureDetection$1.isFirefox())&&FeatureDetection$1.isWindows()&&!t.depthTexture)&&(r=!0),this._polygonOffsetSupported=r,this._terrainBias={polygonOffset:r,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.5,normalShading:!0,normalShadingSmooth:.3,depthBias:1e-4},this._primitiveBias={polygonOffset:r,polygonOffsetFactor:-1.1,polygonOffsetUnits:-4,normalOffset:this._normalOffset,normalOffsetScale:.1,normalShading:!0,normalShadingSmooth:.05,depthBias:4e-4},this._pointBias={polygonOffset:!1,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:0,normalShading:!0,normalShadingSmooth:.1,depthBias:5e-4},this._depthAttachment=void 0,this._colorAttachment=void 0,this._shadowMapMatrix=new Matrix4,this._shadowMapTexture=void 0,this._shadowMapProjectionTexture=void 0,this._castImage=void 0,this._lightDirectionEC=new Cartesian3,this._lightPositionEC=new Cartesian4,this._distance=0,this._lightCamera=e.lightCamera,this._shadowMapCamera=new ShadowMapCamera$2,this._shadowMapCullingVolume=void 0,this._sceneCamera=void 0,this._boundingSphere=new BoundingSphere,this._isPointLight=defaultValue(e.isPointLight,!1),this._pointLightRadius=defaultValue(e.pointLightRadius,100),this._cascadesEnabled=!this._isPointLight&&defaultValue(e.cascadesEnabled,!0),this._numberOfCascades=this._cascadesEnabled?defaultValue(e.numberOfCascades,4):0,this._fitNearFar=!0,this._maximumCascadeDistances=[25,150,700,Number.MAX_VALUE],this._textureSize=new Cartesian2,this._isSpotLight=!1,this._cascadesEnabled?this._shadowMapCamera.frustum=new OrthographicOffCenterFrustum:defined(this._lightCamera.frustum.fov)&&(this._isSpotLight=!0),this._cascadeSplits=[new Cartesian4,new Cartesian4],this._cascadeMatrices=[new Matrix4,new Matrix4,new Matrix4,new Matrix4],this._cascadeDistances=new Cartesian4,i=this._isPointLight?6:this._cascadesEnabled?this._numberOfCascades:1,this._passes=new Array(i);for(var n=0;n<i;++n)this._passes[n]=new ShadowPass$2(t);this.debugShow=!1,this.debugFreezeFrame=!1,this._debugFreezeFrame=!1,this._debugCascadeColors=!1,this._debugLightFrustum=void 0,this._debugCameraFrustum=void 0,this._debugCascadeFrustums=new Array(this._numberOfCascades),this._debugShadowViewCommand=void 0,this._usesDepthTexture=t.depthTexture,this._isPointLight&&(this._usesDepthTexture=!1),this._usesDepthTexture=!1,this._primitiveRenderState=void 0,this._terrainRenderState=void 0,this._pointRenderState=void 0,createRenderStates$4(this),this._clearCommand=new ClearCommand({depth:1,color:new Color}),this._clearPassState=new PassState(t),this._size=defaultValue(e.size,2048),this.size=this._size,this._opacity=defaultValue(e.opacity,1),this._maxDiffAngle=defaultValue(e.maxDiffAngle,Math.PI),this._shadowMapProjectionTexture=t.defaultTexture,this._shadowMapBlendTexture=t.defaultTexture,this._isCastTextureDirty=!1,this._isPlayVideo=defaultValue(e.playVideo,!1),this._videoFrameInterval=defaultValue(e.videoFrameInterval,500),this._linearSampler=LinearSampler.make(0,1,0,60),void 0!==e.calibrateParam?this._calibrateParam=Matrix4.fromColumnMajorArray(e.calibrateParam):this._calibrateParam=new Matrix4,fetchBlendTexture$1(t,this,GEOWORLD_BASE_URL+"./Assets/Images/blend.png")}PerspectiveProjectionMap.createDerivedCommands=function(e,t,i,r,n,a,o){defined(o)||(o={});var s=0<e.length,l=i.shaderProgram,u=l.vertexShaderSource,c=l.fragmentShaderSource,d=i.pass===Pass$1.GLOBE;if(s&&defined(i.receiveTextureProjectionList)&&0<i.receiveTextureProjectionList.length){var h=i.tpp;defined(h)||(h=createTextureProjectionParam(),i.tpp=h);var p=[];matchTextureProjection$1(p,i.receiveTextureProjectionList,e);var f,m,g=Math.min(p.length,4);if(0===g)return;h.textureProjectionArray=p,h._shadowMapCount=g,defined(o.receiveCommand)&&(f=o.receiveCommand.shaderProgram,m=o.receiveCommand.uniformMap);var y=DrawCommand.shallowClone(i,o.receiveCommand);o.castShadows=!1,o.receiveShadows=!0;for(var v=0;v<g;++v){var _=o.receiveShaderCastShadows!==i.castShadows,C=o.receiveShaderProgramId!==i.shaderProgram.id;if(!defined(f)||C||r||_){var x=PerspectiveProjectionMapShader.getReceiveShaderKeyword(p[v],i.castShadows,d,!1);if(!defined(f=n.shaderCache.getDerivedShaderProgram(l,x))){var b=PerspectiveProjectionMapShader.createReceiveVertexShader(u,d,!1),A=PerspectiveProjectionMapShader.createReceiveFragmentShader(c,p[v],i.castShadows,d,!1);f=n.shaderCache.createDerivedShaderProgram(l,x,{vertexShaderSource:b,fragmentShaderSource:A,attributeLocations:l._attributeLocations})}}h._shadowMapProjectionTextureArr[v]=p[v],h._shadowMapMatrixArr[v]=p[v]._shadowMapMatrix,h._lightPositionECArr[v]=p[v]._lightPositionEC,h._lightDirectionECArr[v]=p[v]._lightDirectionEC,h._calibrateParamArr[v]=p[v]._calibrateParam,h._opacityArr[v]=p[v]._linearSampler[4]}for(var S=g;S<4;S++)h._shadowMapProjectionTextureArr[S]=p[g-1];m=combineUniforms$1(p[0],i.uniformMap,d,h),y.shaderProgram=f,y.renderState=p[0]._primitiveRenderState,y.uniformMap=m,o.receiveShaderProgramId=i.shaderProgram.id,o.receiveShaderCastShadows=i.castShadows,o.receiveCommand=y}return o},PerspectiveProjectionMap.prototype.isDestroyed=function(){return!1},PerspectiveProjectionMap.prototype.destroy=function(){destroyFramebuffer$2(this),this._debugLightFrustum=this._debugLightFrustum&&this._debugLightFrustum.destroy(),this._debugCameraFrustum=this._debugCameraFrustum&&this._debugCameraFrustum.destroy(),this._debugShadowViewCommand=this._debugShadowViewCommand&&this._debugShadowViewCommand.shaderProgram&&this._debugShadowViewCommand.shaderProgram.destroy();for(var e=0;e<this._numberOfCascades;++e)this._debugCascadeFrustums[e]=this._debugCascadeFrustums[e]&&this._debugCascadeFrustums[e].destroy();return destroyObject(this)},PerspectiveProjectionMapWithDepthShader.getShadowCastShaderKeyword=function(e,t,i,r){return"castShadow "+e+" "+t+" "+i+" "+r},PerspectiveProjectionMapWithDepthShader.createShadowCastVertexShader=function(e,t,i){var r=e.defines.slice(0),n=e.sources.slice(0);i&&r.push("GENERATE_POSITION");var a=defined(ShaderSource.findPositionVarying(e));if(t&&!a){for(var o=n.length,s=0;s<o;++s)n[s]=ShaderSource.replaceMain(n[s],"czm_shadow_cast_main");n.push("varying vec3 v_positionEC; \nvoid main() \n{ \n czm_shadow_cast_main(); \n v_positionEC = (czm_inverseProjection * gl_Position).xyz; \n}")}return new ShaderSource({defines:r,sources:n})},PerspectiveProjectionMapWithDepthShader.createShadowCastFragmentShader=function(e,t,i,r){var n=e.defines.slice(0),a=e.sources.slice(0),o=ShaderSource.findPositionVarying(e),s=defined(o);s||(o="v_positionEC");for(var l=a.length,u=0;u<l;++u)a[u]=ShaderSource.replaceMain(a[u],"czm_shadow_cast_main");var c="";return t&&(s||(c+="varying vec3 v_positionEC; \n"),c+="uniform vec4 shadowMap_lightPositionEC; \n"),c+=r?"void main() \n{ \n":"void main() \n{ \n czm_shadow_cast_main(); \n if (gl_FragColor.a == 0.0) \n { \n discard; \n } \n",c+=t?" float distance = length("+o+"); \n if (distance >= shadowMap_lightPositionEC.w) \n { \n discard; \n } \n distance /= shadowMap_lightPositionEC.w; // radius \n gl_FragColor = czm_packDepth(distance); \n":i?" gl_FragColor = vec4(1.0); \n":" gl_FragColor = czm_packDepth(gl_FragCoord.z); \n",c+="} \n",a.push(c),new ShaderSource({defines:n,sources:a})},PerspectiveProjectionMapWithDepthShader.getReceiveShaderKeyword=function(e,t,i,r){return"receivePerspectiveProjectionWithDepth "+e._usesDepthTexture+e._polygonOffsetSupported+e._isPointLight+e._isSpotLight+(1<e._numberOfCascades)+e.debugCascadeColors+e.softShadows+t+i+r},PerspectiveProjectionMapWithDepthShader.createReceiveVertexShader=function(e,t,i){var r=e.defines.slice(0),n=e.sources.slice(0);return t&&(i?r.push("GENERATE_POSITION_AND_NORMAL"):r.push("GENERATE_POSITION")),new ShaderSource({defines:r,sources:n})},PerspectiveProjectionMapWithDepthShader.createReceiveFragmentShader=function(e,t,i,r,n){for(var a=ShaderSource.findNormalVarying(e),o=!r&&defined(a)||r&&n,s=ShaderSource.findPositionVarying(e),l=defined(s),u=t._usesDepthTexture,c=(t._polygonOffsetSupported,t._isPointLight),d=t._isSpotLight,h=1<t._numberOfCascades,p=(t.debugCascadeColors,t.softShadows),f=c?t._pointBias:r?t._terrainBias:t._primitiveBias,m=e.defines.slice(0),g=e.sources.slice(0),y=g.length,v=0;v<y;++v)g[v]=ShaderSource.replaceMain(g[v],"czm_shadow_receive_main");c?m.push("USE_CUBE_MAP_SHADOW"):u&&m.push("USE_SHADOW_DEPTH_TEXTURE"),p&&!c&&m.push("USE_SOFT_SHADOWS"),h&&i&&r&&(o?m.push("ENABLE_VERTEX_LIGHTING"):m.push("ENABLE_DAYNIGHT_SHADING")),i&&f.normalShading&&o&&(m.push("USE_NORMAL_SHADING"),0<f.normalShadingSmooth&&m.push("USE_NORMAL_SHADING_SMOOTH"));var _="";return _+="uniform sampler2D shadowMap_blendTexture; \n",_+="uniform sampler2D shadowMap_shadowMapTextureArray[4]; \n",_+="uniform sampler2D shadowMap_projectionTextureArray[4]; \n",_+="uniform vec4 shadowMap_lightPositionECArr[4]; \n",_+="uniform mat4 shadowMap_matrixArr[4]; \n",_+="uniform mat4 shadowMap_calibrateParamArr[4]; \n",_+="uniform vec4 shadowMapCount; \n",_+="uniform mat4 shadowMap_matrix; \nuniform vec3 shadowMap_lightDirectionEC; \nuniform vec4 shadowMap_lightPositionEC; \nuniform vec4 shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness; \nuniform vec4 shadowMap_texelSizeDepthBiasAndNormalShadingSmooth; \nuniform vec4 shadowMap_opacityArr; \n#ifdef LOG_DEPTH \nvarying vec3 v_logPositionEC; \n#endif \nvec4 getPositionEC() \n{ \n"+(l?" return vec4("+s+", 1.0); \n":"#ifndef LOG_DEPTH \n return czm_windowToEyeCoordinates(gl_FragCoord); \n#else \n return vec4(v_logPositionEC, 1.0); \n#endif \n")+"} \nvec3 getNormalEC() \n{ \n"+(o?" return normalize("+a+"); \n":" return vec3(1.0); \n")+"} \nvoid applyNormalOffset(inout vec4 positionEC, vec3 normalEC, float nDotL) \n{ \n"+(f.normalOffset&&o?" float normalOffset = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.x; \n float normalOffsetScale = 1.0 - nDotL; \n vec3 offset = normalOffset * normalOffsetScale * normalEC; \n positionEC.xyz += offset; \n":"")+"} \nvec2 cameraDistortion(inout vec2 UV, mat4 calibParam) //imageSize, vec2 focalLength, vec2 opticalCenter, vec4 distortionCoeffs, vec2 tangentCoeffs) \n{ \n vec2 imageSize = vec2(calibParam[0][0],calibParam[0][1]); \n vec2 focalLength = vec2(calibParam[0][2],calibParam[0][3]); \n vec2 opticalCenter = vec2(calibParam[1][0],calibParam[1][1]); \n vec2 tangentCoeffs = vec2(calibParam[1][2],calibParam[1][3]); \n vec4 distortionCoeffs = vec4(calibParam[2][0], calibParam[2][1],calibParam[2][2],calibParam[2][3]); \n vec2 opticalCenterUV = opticalCenter / imageSize; \n vec2 xy = (UV - opticalCenterUV ) * imageSize / focalLength; \n float x2 = xy.x * xy.x; \n float y2 = xy.y * xy.y; \n float r2 = x2 + y2; \n float _2xy = 2.0 * xy.x * xy.y; \n highp float kr = (1.0 + ((distortionCoeffs.z*r2 + distortionCoeffs.y)*r2 + distortionCoeffs.x)*r2); \n highp float dx = (xy.x*kr + tangentCoeffs.x*_2xy + tangentCoeffs.y*(r2 + 2.0*x2)); \n highp float dy = (xy.y*kr + tangentCoeffs.x*(r2 + 2.0*y2) + tangentCoeffs.y*_2xy); \n UV = vec2(dx,dy) * focalLength / imageSize + opticalCenterUV; \n return UV; \n} \n",_+="void main() \n{ \n vec4 diffuseColor = gl_FragColor; \n czm_shadow_receive_main(); \n vec4 positionEC = getPositionEC(); \n vec3 normalEC = getNormalEC(); \n float depth = -positionEC.z; \n",d&&(_+=" for(int i = 0; i < 4; i++){ \n if(i < int(shadowMapCount.x)){ \n"),_+=" czm_shadowParameters shadowParameters; \n shadowParameters.texelStepSize = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.xy; \n shadowParameters.depthBias = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.z; \n shadowParameters.normalShadingSmooth = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.w; \n shadowParameters.darkness = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.w; \n",_+=" vec3 directionEC = normalize(positionEC.xyz - shadowMap_lightPositionECArr[i].xyz); \n float nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0); \n applyNormalOffset(positionEC, normalEC, nDotL); \n vec4 shadowPosition = shadowMap_matrixArr[i] * positionEC; \n shadowPosition /= shadowPosition.w; \n shadowParameters.texCoords = shadowPosition.xy; \n shadowParameters.depth = shadowPosition.z; \n shadowParameters.nDotL = nDotL; \n // Spot light uses a perspective projection, so perform the perspective divide \n vec2 oldUV = shadowPosition.xy; \n if(shadowMap_calibrateParamArr[i][0].y > 0.0){ \n shadowPosition.xy = cameraDistortion(shadowPosition.xy, shadowMap_calibrateParamArr[i] ); //imageSize, focalLength, opticalCenter, distortionCoefficients, tangentCoeffs); \n } \n // Stop early if the fragment is not in the shadow bounds \n if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0)))) \n { \n continue; \n } \n vec4 tempColor = texture2D(shadowMap_blendTexture, oldUV.xy); \n if(tempColor.a < 0.14 ) continue; \n if(i == 0){ \n float visibility = czm_shadowVisibility(shadowMap_shadowMapTextureArray[0], shadowParameters); \n tempColor = texture2D(shadowMap_projectionTextureArray[0], shadowPosition.xy) * tempColor * visibility; \n gl_FragColor = mix(gl_FragColor,tempColor, shadowMap_opacityArr.y * tempColor.a); \n }else if(i == 1){ \n float visibility = czm_shadowVisibility(shadowMap_shadowMapTextureArray[1], shadowParameters); \n tempColor = texture2D(shadowMap_projectionTextureArray[1], shadowPosition.xy) * tempColor * visibility; \n gl_FragColor = mix(gl_FragColor,tempColor, shadowMap_opacityArr.y * tempColor.a); \n }else if(i == 2){ \n float visibility = czm_shadowVisibility(shadowMap_shadowMapTextureArray[2], shadowParameters); \n tempColor = texture2D(shadowMap_projectionTextureArray[2], shadowPosition.xy) * tempColor * visibility; \n gl_FragColor = mix(gl_FragColor,tempColor, shadowMap_opacityArr.z * tempColor.a); \n }else { \n float visibility = czm_shadowVisibility(shadowMap_shadowMapTextureArray[3], shadowParameters); \n tempColor = texture2D(shadowMap_projectionTextureArray[3], shadowPosition.xy) * tempColor * visibility; \n gl_FragColor = mix(gl_FragColor,tempColor, shadowMap_opacityArr.w * tempColor.a); \n } \n }else{ \n break; \n } \n } \n \n",_+="} \n",g.push(_),new ShaderSource({defines:m,sources:g})};var PROJECTION_LIMIT=4;function fetchBlendTexture$1(t,i,e){Resource.fetchImage({url:e}).then(function(e){i._shadowMapBlendTexture=new Texture({context:t,source:e}),i._shadowMapBlendTexture.generateMipmap()})}function onVisible$1(e,t){LinearSampler.assign(e,e[4],1,t,t+30)}function onDisable$1(e,t){LinearSampler.assign(e,e[4],0,t,t+15)}function ShadowPass$2(e){this.camera=new ShadowMapCamera$2,this.passState=new PassState(e),this.framebuffer=void 0,this.textureOffsets=void 0,this.commandList=[],this.cullingVolume=void 0}function createRenderState$2(e,t){return RenderState.fromCache({cull:{enabled:!0,face:CullFace$1.BACK},depthTest:{enabled:!0,func:DepthFunction$1.LESS},colorMask:{red:e,green:e,blue:e,alpha:e},blending:{enabled:!1,equationRgb:BlendEquation$1.ADD,equationAlpha:BlendEquation$1.ADD,functionSourceRgb:BlendFunction$1.ONE,functionDestinationRgb:BlendFunction$1.ONE_MINUS_SOURCE_ALPHA,functionSourceAlpha:BlendFunction$1.ONE,functionDestinationAlpha:BlendFunction$1.ONE_MINUS_SOURCE_ALPHA},depthMask:!0,polygonOffset:{enabled:t.polygonOffset,factor:t.polygonOffsetFactor,units:t.polygonOffsetUnits}})}function createRenderStates$4(e){var t=!e._usesDepthTexture;e._primitiveRenderState=createRenderState$2(t,e._primitiveBias),e._terrainRenderState=createRenderState$2(t,e._terrainBias),e._pointRenderState=createRenderState$2(t,e._pointBias)}function destroyFramebuffer$3(e){for(var t=e._passes.length,i=0;i<t;++i){var r=e._passes[i],n=r.framebuffer;defined(n)&&!n.isDestroyed()&&n.destroy(),r.framebuffer=void 0}e._depthAttachment=e._depthAttachment&&e._depthAttachment.destroy(),e._colorAttachment=e._colorAttachment&&e._colorAttachment.destroy()}function createSampler(){return new Sampler({wrapS:TextureWrap$1.CLAMP_TO_EDGE,wrapT:TextureWrap$1.CLAMP_TO_EDGE,minificationFilter:TextureMinificationFilter$1.NEAREST,magnificationFilter:TextureMagnificationFilter$1.NEAREST})}function createFramebufferColor(e,t){for(var i=new Renderbuffer({context:t,width:e._textureSize.x,height:e._textureSize.y,format:RenderbufferFormat$1.DEPTH_COMPONENT16}),r=new Texture({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:PixelDatatype$1.UNSIGNED_BYTE,sampler:createSampler()}),n=new Framebuffer({context:t,depthRenderbuffer:i,colorTextures:[r],destroyAttachments:!1}),a=e._passes.length,o=0;o<a;++o){var s=e._passes[o];s.framebuffer=n,s.passState.framebuffer=n}e._shadowMapTexture=r,e._depthAttachment=i,e._colorAttachment=r}function createFramebufferDepth(e,t){for(var i=new Texture({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:PixelFormat$1.DEPTH_STENCIL,pixelDatatype:PixelDatatype$1.UNSIGNED_INT_24_8,sampler:createSampler()}),r=new Framebuffer({context:t,depthStencilTexture:i,destroyAttachments:!1}),n=e._passes.length,a=0;a<n;++a){var o=e._passes[a];o.framebuffer=r,o.passState.framebuffer=r}e._shadowMapTexture=i,e._depthAttachment=i}function createFramebufferCube(e,t){for(var i=new Renderbuffer({context:t,width:e._textureSize.x,height:e._textureSize.y,format:RenderbufferFormat$1.DEPTH_COMPONENT16}),r=new CubeMap({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:PixelDatatype$1.UNSIGNED_BYTE,sampler:createSampler()}),n=[r.negativeX,r.negativeY,r.negativeZ,r.positiveX,r.positiveY,r.positiveZ],a=0;a<6;++a){var o=new Framebuffer({context:t,depthRenderbuffer:i,colorTextures:[n[a]],destroyAttachments:!1}),s=e._passes[a];s.framebuffer=o,s.passState.framebuffer=o}e._shadowMapTexture=r,e._depthAttachment=i,e._colorAttachment=r}function createFramebuffer$1(e,t){e._isPointLight?createFramebufferCube(e,t):e._usesDepthTexture?createFramebufferDepth(e,t):createFramebufferColor(e,t)}function checkFramebuffer(e,t){e._usesDepthTexture&&e._passes[0].framebuffer.status!==WebGLConstants$1.FRAMEBUFFER_COMPLETE&&(e._usesDepthTexture=!1,createRenderStates$4(e),destroyFramebuffer$3(e),createFramebuffer$1(e,t))}function updateFramebuffer(e,t){defined(e._passes[0].framebuffer)&&e._shadowMapTexture.width===e._textureSize.x||(destroyFramebuffer$3(e),createFramebuffer$1(e,t),checkFramebuffer(e,t),clearFramebuffer$2(e,t))}function clearFramebuffer$2(e,t,i){i=defaultValue(i,0),!e._isPointLight&&0!==i||(e._clearCommand.framebuffer=e._passes[i].framebuffer,e._clearCommand.execute(t,e._clearPassState))}function resize$2(e,t){e._size=t;var i=e._passes,r=i.length,n=e._textureSize;if(e._isPointLight){t=ContextLimits.maximumCubeMapSize>=t?t:ContextLimits.maximumCubeMapSize,n.x=t;var a=new BoundingRectangle(0,0,n.y=t,t);i[0].passState.viewport=a,i[1].passState.viewport=a,i[2].passState.viewport=a,i[3].passState.viewport=a,i[4].passState.viewport=a,i[5].passState.viewport=a}else 1===r?(t=ContextLimits.maximumTextureSize>=t?t:ContextLimits.maximumTextureSize,n.x=t,n.y=t,i[0].passState.viewport=new BoundingRectangle(0,0,t,t)):4===r&&(t=ContextLimits.maximumTextureSize>=2*t?t:ContextLimits.maximumTextureSize/2,n.x=2*t,n.y=2*t,i[0].passState.viewport=new BoundingRectangle(0,0,t,t),i[1].passState.viewport=new BoundingRectangle(t,0,t,t),i[2].passState.viewport=new BoundingRectangle(0,t,t,t),i[3].passState.viewport=new BoundingRectangle(t,t,t,t));e._clearPassState.viewport=new BoundingRectangle(0,0,n.x,n.y);for(var o=0;o<r;++o){var s=i[o],l=s.passState.viewport,u=l.x/n.x,c=l.y/n.y,d=l.width/n.x,h=l.height/n.y;s.textureOffsets=new Matrix4(d,0,0,u,0,h,0,c,0,0,1,0,0,0,0,1)}}PerspectiveProjectionMapWithDepth.MAXIMUM_DISTANCE=2e4,PerspectiveProjectionMapWithDepth.prototype.debugCreateRenderStates=function(){createRenderStates$4(this)},Object.defineProperties(PerspectiveProjectionMapWithDepth.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this.dirty=this._enabled!==e,this._enabled=e}},normalOffset:{get:function(){return this._normalOffset},set:function(e){this.dirty=this._normalOffset!==e,this._normalOffset=e,this._terrainBias.normalOffset=e,this._primitiveBias.normalOffset=e,this._pointBias.normalOffset=e}},softShadows:{get:function(){return this._softShadows},set:function(e){this.dirty=this._softShadows!==e,this._softShadows=e}},size:{get:function(){return this._size},set:function(e){resize$2(this,e)}},outOfView:{get:function(){return this._outOfView}},shadowMapCullingVolume:{get:function(){return this._shadowMapCullingVolume}},passes:{get:function(){return this._passes}},isPointLight:{get:function(){return this._isPointLight}},castTexture:{set:function(e){var t=this;(t._castImage=e)instanceof HTMLVideoElement&&(t._isPlayVideo&&t._castImage.play(),t._castImage.addEventListener("play",function(){t.playVideo=!0},!0),t._castImage.addEventListener("pause",function(){t.playVideo=!1},!0),t._castImage.timeupdate=function(e){t.timeupdate=!0}),t._isCastTextureDirty=!0}},playVideo:{set:function(e){this._isPlayVideo=e,this._isCastTextureDirty=e}},debugCascadeColors:{get:function(){return this._debugCascadeColors},set:function(e){this.dirty=this._debugCascadeColors!==e,this._debugCascadeColors=e}}});var scratchViewport$4=new BoundingRectangle;function createDebugShadowViewCommand$2(e,t){var i;i=e._isPointLight?"uniform samplerCube shadowMap_textureCube; \nvarying vec2 v_textureCoordinates; \nvoid main() \n{ \n vec2 uv = v_textureCoordinates; \n vec3 dir; \n \n if (uv.y < 0.5) \n { \n if (uv.x < 0.333) \n { \n dir.x = -1.0; \n dir.y = uv.x * 6.0 - 1.0; \n dir.z = uv.y * 4.0 - 1.0; \n } \n else if (uv.x < 0.666) \n { \n dir.y = -1.0; \n dir.x = uv.x * 6.0 - 3.0; \n dir.z = uv.y * 4.0 - 1.0; \n } \n else \n { \n dir.z = -1.0; \n dir.x = uv.x * 6.0 - 5.0; \n dir.y = uv.y * 4.0 - 1.0; \n } \n } \n else \n { \n if (uv.x < 0.333) \n { \n dir.x = 1.0; \n dir.y = uv.x * 6.0 - 1.0; \n dir.z = uv.y * 4.0 - 3.0; \n } \n else if (uv.x < 0.666) \n { \n dir.y = 1.0; \n dir.x = uv.x * 6.0 - 3.0; \n dir.z = uv.y * 4.0 - 3.0; \n } \n else \n { \n dir.z = 1.0; \n dir.x = uv.x * 6.0 - 5.0; \n dir.y = uv.y * 4.0 - 3.0; \n } \n } \n \n float shadow = czm_unpackDepth(textureCube(shadowMap_textureCube, dir)); \n gl_FragColor = vec4(vec3(shadow), 1.0); \n} \n":"uniform sampler2D shadowMap_texture; \nvarying vec2 v_textureCoordinates; \nvoid main() \n{ \n"+(e._usesDepthTexture?" float shadow = texture2D(shadowMap_texture, v_textureCoordinates).r; \n":" float shadow = czm_unpackDepth(texture2D(shadowMap_texture, v_textureCoordinates)); \n")+" gl_FragColor = vec4(vec3(shadow), 1.0); \n} \n";var r=t.createViewportQuadCommand(i,{uniformMap:{shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture}}});return r.pass=Pass$1.OVERLAY,r}function updateDebugShadowViewCommand$2(e,t){var i=t.context,r=t.context.drawingBufferWidth,n=t.context.drawingBufferHeight,a=.3*Math.min(r,n),o=scratchViewport$4;o.x=r-a,o.y=0,o.width=a,o.height=a;var s=e._debugShadowViewCommand;defined(s)||(s=createDebugShadowViewCommand$2(e,i),e._debugShadowViewCommand=s),defined(s.renderState)&&BoundingRectangle.equals(s.renderState.viewport,o)||(s.renderState=RenderState.fromCache({viewport:BoundingRectangle.clone(o)})),t.commandList.push(e._debugShadowViewCommand)}var frustumCornersNDC$3=new Array(8);frustumCornersNDC$3[0]=new Cartesian4(-1,-1,-1,1),frustumCornersNDC$3[1]=new Cartesian4(1,-1,-1,1),frustumCornersNDC$3[2]=new Cartesian4(1,1,-1,1),frustumCornersNDC$3[3]=new Cartesian4(-1,1,-1,1),frustumCornersNDC$3[4]=new Cartesian4(-1,-1,1,1),frustumCornersNDC$3[5]=new Cartesian4(1,-1,1,1),frustumCornersNDC$3[6]=new Cartesian4(1,1,1,1),frustumCornersNDC$3[7]=new Cartesian4(-1,1,1,1);for(var scratchMatrix$2=new Matrix4,scratchFrustumCorners$3=new Array(8),i$4=0;i$4<8;++i$4)scratchFrustumCorners$3[i$4]=new Cartesian4;function createDebugPointLight$2(e,t){return new Primitive({geometryInstances:[new GeometryInstance({geometry:new BoxOutlineGeometry({minimum:new Cartesian3(-.5,-.5,-.5),maximum:new Cartesian3(.5,.5,.5)}),attributes:{color:ColorGeometryInstanceAttribute.fromColor(t)}}),new GeometryInstance({geometry:new SphereOutlineGeometry({radius:.5}),attributes:{color:ColorGeometryInstanceAttribute.fromColor(t)}})],appearance:new PerInstanceColorAppearance({translucent:!1,flat:!0}),asynchronous:!1,modelMatrix:e})}var debugOutlineColors$2=[Color.RED,Color.GREEN,Color.BLUE,Color.MAGENTA],scratchScale$7=new Cartesian3;function applyDebugSettings$2(e,t){updateDebugShadowViewCommand$2(e,t);var i=e.debugFreezeFrame&&!e._debugFreezeFrame;if(e._debugFreezeFrame=e.debugFreezeFrame,e.debugFreezeFrame&&(i&&(e._debugCameraFrustum=e._debugCameraFrustum&&e._debugCameraFrustum.destroy(),e._debugCameraFrustum=new DebugCameraPrimitive({camera:e._sceneCamera,color:Color.CYAN,updateOnChange:!1})),e._debugCameraFrustum.update(t)),e._cascadesEnabled){if(e.debugFreezeFrame){i&&(e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=new DebugCameraPrimitive({camera:e._shadowMapCamera,color:Color.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t);for(var r=0;r<e._numberOfCascades;++r)i&&(e._debugCascadeFrustums[r]=e._debugCascadeFrustums[r]&&e._debugCascadeFrustums[r].destroy(),e._debugCascadeFrustums[r]=new DebugCameraPrimitive({camera:e._passes[r].camera,color:debugOutlineColors$2[r],updateOnChange:!1})),e._debugCascadeFrustums[r].update(t)}}else if(e._isPointLight){if(!defined(e._debugLightFrustum)||e._needsUpdate){var n=e._shadowMapCamera.positionWC,a=Quaternion.IDENTITY,o=2*e._pointLightRadius,s=Cartesian3.fromElements(o,o,o,scratchScale$7),l=Matrix4.fromTranslationQuaternionRotationScale(n,a,s,scratchMatrix$2);e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=createDebugPointLight$2(l,Color.YELLOW)}e._debugLightFrustum.update(t)}else defined(e._debugLightFrustum)&&!e._needsUpdate||(e._debugLightFrustum=new DebugCameraPrimitive({camera:e._shadowMapCamera,color:Color.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t)}function ShadowMapCamera$2(){this.viewMatrix=new Matrix4,this.inverseViewMatrix=new Matrix4,this.frustum=void 0,this.positionCartographic=new Cartographic,this.positionWC=new Cartesian3,this.directionWC=Cartesian3.clone(Cartesian3.UNIT_Z),this.upWC=Cartesian3.clone(Cartesian3.UNIT_Y),this.rightWC=Cartesian3.clone(Cartesian3.UNIT_X),this.viewProjectionMatrix=new Matrix4}ShadowMapCamera$2.prototype.clone=function(e){Matrix4.clone(e.viewMatrix,this.viewMatrix),Matrix4.clone(e.inverseViewMatrix,this.inverseViewMatrix),this.frustum=e.frustum.clone(this.frustum),Cartographic.clone(e.positionCartographic,this.positionCartographic),Cartesian3.clone(e.positionWC,this.positionWC),Cartesian3.clone(e.directionWC,this.directionWC),Cartesian3.clone(e.upWC,this.upWC),Cartesian3.clone(e.rightWC,this.rightWC)};var scaleBiasMatrix$2=new Matrix4(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);ShadowMapCamera$2.prototype.getViewProjection=function(){var e=this.viewMatrix,t=this.frustum.projectionMatrix;return Matrix4.multiply(t,e,this.viewProjectionMatrix),Matrix4.multiply(scaleBiasMatrix$2,this.viewProjectionMatrix,this.viewProjectionMatrix),this.viewProjectionMatrix};var scratchSplits$3=new Array(5),scratchFrustum$2=new PerspectiveFrustum,scratchCascadeDistances$2=new Array(4),scratchMin$3=new Cartesian3,scratchMax$3=new Cartesian3;function computeCascades$2(e,t){var i,r=e._shadowMapCamera,n=e._sceneCamera,a=n.frustum.near,o=n.frustum.far,s=e._numberOfCascades,l=o-a,u=o/a,c=.9,d=!1;t.shadowState.closestObjectSize<200&&(d=!0,c=.9);var h=scratchCascadeDistances$2,p=scratchSplits$3;for(p[0]=a,p[s]=o,i=0;i<s;++i){var f=(i+1)/s,m=a*Math.pow(u,f),g=a+l*f,y=CesiumMath.lerp(g,m,c);p[i+1]=y,h[i]=y-p[i]}if(d){for(i=0;i<s;++i)h[i]=Math.min(h[i],e._maximumCascadeDistances[i]);var v=p[0];for(i=0;i<s-1;++i)v+=h[i],p[i+1]=v}Cartesian4.unpack(p,0,e._cascadeSplits[0]),Cartesian4.unpack(p,1,e._cascadeSplits[1]),Cartesian4.unpack(h,0,e._cascadeDistances);var _=r.frustum,C=_.left,x=_.right,b=_.bottom,A=_.top,S=_.near,w=_.far,E=r.positionWC,T=r.directionWC,P=r.upWC,M=n.frustum.clone(scratchFrustum$2),D=r.getViewProjection();for(i=0;i<s;++i){M.near=p[i],M.far=p[i+1];for(var I=Matrix4.multiply(M.projectionMatrix,n.viewMatrix,scratchMatrix$2),O=Matrix4.inverse(I,scratchMatrix$2),R=Matrix4.multiply(D,O,scratchMatrix$2),L=Cartesian3.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,scratchMin$3),N=Cartesian3.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,scratchMax$3),k=0;k<8;++k){var B=Cartesian4.clone(frustumCornersNDC$3[k],scratchFrustumCorners$3[k]);Matrix4.multiplyByVector(R,B,B),Cartesian3.divideByScalar(B,B.w,B),Cartesian3.minimumByComponent(B,L,L),Cartesian3.maximumByComponent(B,N,N)}L.x=Math.max(L.x,0),L.y=Math.max(L.y,0),L.z=0,N.x=Math.min(N.x,1),N.y=Math.min(N.y,1),N.z=Math.min(N.z,1);var F=e._passes[i],V=F.camera;V.clone(r);var z=V.frustum;z.left=C+L.x*(x-C),z.right=C+N.x*(x-C),z.bottom=b+L.y*(A-b),z.top=b+N.y*(A-b),z.near=S+L.z*(w-S),z.far=S+N.z*(w-S),F.cullingVolume=V.frustum.computeCullingVolume(E,T,P);var U=e._cascadeMatrices[i];Matrix4.multiply(V.getViewProjection(),n.inverseViewMatrix,U),Matrix4.multiply(F.textureOffsets,U,U)}}var scratchLightView$2=new Matrix4,scratchRight$3=new Cartesian3,scratchUp$2=new Cartesian3,scratchTranslation$2=new Cartesian3;function fitShadowMapToScene$2(e,t){var i=e._shadowMapCamera,r=e._sceneCamera,n=Matrix4.multiply(r.frustum.projectionMatrix,r.viewMatrix,scratchMatrix$2),a=Matrix4.inverse(n,scratchMatrix$2),o=i.directionWC,s=r.directionWC,l=Cartesian3.cross(o,s,scratchRight$3);s=Cartesian3.cross(l,o,scratchUp$2),Cartesian3.normalize(s,s),Cartesian3.normalize(l,l);for(var u=Cartesian3.fromElements(0,0,0,scratchTranslation$2),c=Matrix4.computeView(u,o,s,l,scratchLightView$2),d=Matrix4.multiply(c,a,scratchMatrix$2),h=Cartesian3.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,scratchMin$3),p=Cartesian3.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,scratchMax$3),f=0;f<8;++f){var m=Cartesian4.clone(frustumCornersNDC$3[f],scratchFrustumCorners$3[f]);Matrix4.multiplyByVector(d,m,m),Cartesian3.divideByScalar(m,m.w,m),Cartesian3.minimumByComponent(m,h,h),Cartesian3.maximumByComponent(m,p,p)}p.z+=1e3,h.z-=10;var g=scratchTranslation$2;g.x=-.5*(h.x+p.x),g.y=-.5*(h.y+p.y),g.z=-p.z;var y=Matrix4.fromTranslation(g,scratchMatrix$2);c=Matrix4.multiply(y,c,c);var v=.5*(p.x-h.x),_=.5*(p.y-h.y),C=p.z-h.z,x=i.frustum;x.left=-v,x.right=v,x.bottom=-_,x.top=_,x.near=.01,x.far=C,Matrix4.clone(c,i.viewMatrix),Matrix4.inverse(c,i.inverseViewMatrix),Matrix4.getTranslation(i.inverseViewMatrix,i.positionWC),t.mapProjection.ellipsoid.cartesianToCartographic(i.positionWC,i.positionCartographic),Cartesian3.clone(o,i.directionWC),Cartesian3.clone(s,i.upWC),Cartesian3.clone(l,i.rightWC)}var directions$2=[new Cartesian3(-1,0,0),new Cartesian3(0,-1,0),new Cartesian3(0,0,-1),new Cartesian3(1,0,0),new Cartesian3(0,1,0),new Cartesian3(0,0,1)],ups$2=[new Cartesian3(0,-1,0),new Cartesian3(0,0,-1),new Cartesian3(0,-1,0),new Cartesian3(0,-1,0),new Cartesian3(0,0,1),new Cartesian3(0,-1,0)],rights$2=[new Cartesian3(0,0,1),new Cartesian3(1,0,0),new Cartesian3(-1,0,0),new Cartesian3(0,0,-1),new Cartesian3(1,0,0),new Cartesian3(1,0,0)];function computeOmnidirectional$2(e,t){var i=new PerspectiveFrustum;i.fov=CesiumMath.PI_OVER_TWO,i.near=1,i.far=e._pointLightRadius,i.aspectRatio=1;for(var r=0;r<6;++r){var n=e._passes[r].camera;n.positionWC=e._shadowMapCamera.positionWC,n.positionCartographic=t.mapProjection.ellipsoid.cartesianToCartographic(n.positionWC,n.positionCartographic),n.directionWC=directions$2[r],n.upWC=ups$2[r],n.rightWC=rights$2[r],Matrix4.computeView(n.positionWC,n.directionWC,n.upWC,n.rightWC,n.viewMatrix),Matrix4.inverse(n.viewMatrix,n.inverseViewMatrix),n.frustum=i}}var scratchCartesian1$4=new Cartesian3,scratchCartesian2$7=new Cartesian3,scratchBoundingSphere$5=new BoundingSphere,scratchCenter$3=scratchBoundingSphere$5.center;function checkVisibility$2(e,t){var i=e._sceneCamera,r=e._shadowMapCamera,n=scratchBoundingSphere$5;if(e._cascadesEnabled){if(i.frustum.near>=e.maximumDistance)return e._outOfView=!0,void(e._needsUpdate=!1);var a=t.mapProjection.ellipsoid.geodeticSurfaceNormal(i.positionWC,scratchCartesian1$4),o=Cartesian3.negate(r.directionWC,scratchCartesian2$7),s=Cartesian3.dot(a,o);CesiumMath.clamp(s/.1,0,1);if(s<(e._darkness=0))return e._outOfView=!0,void(e._needsUpdate=!1);e._needsUpdate=!0,e._outOfView=!1}else if(e._isPointLight)n.center=r.positionWC,n.radius=e._pointLightRadius,e._outOfView=t.cullingVolume.computeVisibility(n)===Intersect$1.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(n),BoundingSphere.clone(n,e._boundingSphere);else{var l=r.frustum.far/2,u=Cartesian3.add(r.positionWC,Cartesian3.multiplyByScalar(r.directionWC,l,scratchCenter$3),scratchCenter$3);n.center=u,n.radius=l,e._outOfView=t.cullingVolume.computeVisibility(n)===Intersect$1.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(n),BoundingSphere.clone(n,e._boundingSphere);var c=Math.acos(Cartesian3.dot(r.directionWC,i.direction));(e._angleDiff=c)>e._maxDiffAngle?e._outOfAngle=!0:e._outOfAngle=!1}}function updateCameras$2(e,t){var i=t.camera,r=e._lightCamera,n=e._sceneCamera,a=e._shadowMapCamera;e._cascadesEnabled?Cartesian3.clone(r.directionWC,a.directionWC):e._isPointLight?Cartesian3.clone(r.positionWC,a.positionWC):a.clone(r);var o,s,l=e._lightDirectionEC;Matrix4.multiplyByPointAsVector(i.viewMatrix,a.directionWC,l),Cartesian3.normalize(l,l),Cartesian3.negate(l,l),Matrix4.multiplyByPoint(i.viewMatrix,a.positionWC,e._lightPositionEC),e._lightPositionEC.w=e._pointLightRadius,s=e._fitNearFar?(o=Math.min(t.shadowState.nearPlane,e.maximumDistance),Math.min(t.shadowState.farPlane,e.maximumDistance+1)):(o=i.frustum.near,e.maximumDistance),e._sceneCamera=Camera.clone(i,n),i.frustum.clone(e._sceneCamera.frustum),e._sceneCamera.frustum.near=o,e._sceneCamera.frustum.far=s,e._distance=s-o,checkVisibility$2(e,t);var u=t.frameNumber;!e._outOfViewPrevious&&e._outOfView&&(e._needsUpdate=!0),!e._outOfAnglePrevious&&e._outOfAngle?(onDisable$1(e._linearSampler,u),e._outOfAnglePrevious=e._outOfAngle):e._outOfAnglePrevious&&!e._outOfAngle?(onVisible$1(e._linearSampler,u),e._outOfAnglePrevious=e._outOfAngle):e._outOfAngle,LinearSampler.getValueExp(e._linearSampler,u),e._outOfViewPrevious=e._outOfView}function updateCastTextures$2(e,t){if(!(e._outOfView||e._linearSampler[4]<.01)&&!1!==e._isCastTextureDirty&&defined(e._castImage)){var i=t.context,r=e._shadowMapProjectionTexture,n=e._castImage;if(n instanceof HTMLVideoElement)if(2<=n.readyState){if(defined(r)){var a=(new Date).getTime();if(void 0===r._lastCreateTextureTime&&(r._lastCreateTextureTime=0),a-r._lastCreateTextureTime<e._videoFrameInterval)return;if(!n.timeupdate)return;r!==i.defaultTexture&&r.destroy(),r=void 0}if(!defined(r)||r===i.defaultTexture)return(r=new Texture({context:i,source:n}))._lastCreateTextureTime=(new Date).getTime(),e._shadowMapProjectionTexture=r,void(e._isPlayVideo||(e._isCastTextureDirty=!1))}else defined(r)||(e._shadowMapProjectionTexture=i.defaultTexture);else e._shadowMapProjectionTexture=new Texture({context:t.context,source:e._castImage}),e._isCastTextureDirty=!1}}PerspectiveProjectionMapWithDepth.prototype.update=function(e){if(updateCameras$2(this,e),updateCastTextures$2(this,e),this._needsUpdate)if(updateFramebuffer(this,e.context),this._isPointLight&&computeOmnidirectional$2(this,e),this._cascadesEnabled&&(fitShadowMapToScene$2(this,e),1<this._numberOfCascades&&computeCascades$2(this,e)),this._isPointLight)this._shadowMapCullingVolume=CullingVolume.fromBoundingSphere(this._boundingSphere);else{var t=this._shadowMapCamera,i=t.positionWC,r=t.directionWC,n=t.upWC;this._shadowMapCullingVolume=t.frustum.computeCullingVolume(i,r,n),1===this._passes.length&&this._passes[0].camera.clone(t)}if(1===this._passes.length){var a=this._sceneCamera.inverseViewMatrix;Matrix4.multiply(this._shadowMapCamera.getViewProjection(),a,this._shadowMapMatrix)}this.debugShow&&applyDebugSettings$2(this,e)},PerspectiveProjectionMapWithDepth.prototype.updatePass=function(e,t){clearFramebuffer$2(this,e,t)};var scratchTexelStepSize$2=new Cartesian2;function combineUniforms$2(t,e,i,r){var n=t._isPointLight?t._pointBias:i?t._terrainBias:t._primitiveBias;return combine(e,{shadowMap_texture:function(){return t._shadowMapTexture},shadowMap_shadowMapTextureArray:function(){for(var e=[],t=0;t<4;t++)e[t]=r._shadowMapTextureArray[t];return e},shadowMap_blendTexture:function(){return t._shadowMapBlendTexture},shadowMap_textureCube:function(){return t._shadowMapTexture},shadowMap_matrix:function(){return t._shadowMapMatrix},shadowMap_cascadeSplits:function(){return t._cascadeSplits},shadowMap_cascadeMatrices:function(){return t._cascadeMatrices},shadowMap_lightDirectionEC:function(){return t._lightDirectionEC},shadowMap_lightPositionEC:function(){return t._lightPositionEC},shadowMap_cascadeDistances:function(){return t._cascadeDistances},shadowMap_projectionTextureArray:function(){for(var e=[],t=0;t<4;t++)e[t]=r._projectionTextureArray[t]._shadowMapProjectionTexture;return e},shadowMap_lightPositionECArr:function(){return r._lightPositionECArr},shadowMap_opacityArr:function(){return Cartesian4.fromElements(r._opacityArr[0],r._opacityArr[1],r._opacityArr[2],r._opacityArr[3])},shadowMapCount:function(){return Cartesian4.fromElements(r._shadowMapCount,0,0,0)},shadowMap_matrixArr:function(){return r._cameraViewProjectionMatrixArray},shadowMap_calibrateParamArr:function(){return r._calibrateParamArr},shadowMap_texelSizeDepthBiasAndNormalShadingSmooth:function(){var e=scratchTexelStepSize$2;return e.x=1/t._textureSize.x,e.y=1/t._textureSize.y,n.depthBias,Cartesian4.fromElements(e.x,e.y,n.depthBias,n.normalShadingSmooth,this.combinedUniforms1)},shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness:function(){return Cartesian4.fromElements(n.normalOffsetScale,t._distance,t.maximumDistance,t._darkness,this.combinedUniforms2)},combinedUniforms1:new Cartesian4,combinedUniforms2:new Cartesian4},!1)}function createCastDerivedCommand(e,t,i,r,n,a){var o,s,l;if(defined(a)&&(o=a.shaderProgram,s=a.renderState,l=a.uniformMap),(a=DrawCommand.shallowClone(i,a)).castShadows=!0,a.receiveShadows=!1,!defined(o)||n!==i.shaderProgram.id||t){var u=i.shaderProgram,c=i.pass===Pass$1.GLOBE,d=i.pass!==Pass$1.TRANSLUCENT,h=e._isPointLight,p=e._usesDepthTexture,f=PerspectiveProjectionMapWithDepthShader.getShadowCastShaderKeyword(h,c,p,d);if(!defined(o=r.shaderCache.getDerivedShaderProgram(u,f))){var m=u.vertexShaderSource,g=u.fragmentShaderSource,y=PerspectiveProjectionMapWithDepthShader.createShadowCastVertexShader(m,h,c),v=PerspectiveProjectionMapWithDepthShader.createShadowCastFragmentShader(g,h,p,d);o=r.shaderCache.createDerivedShaderProgram(u,f,{vertexShaderSource:y,fragmentShaderSource:v,attributeLocations:u._attributeLocations})}s=e._primitiveRenderState,h?s=e._pointRenderState:c&&(s=e._terrainRenderState),i.renderState.cull.enabled||((s=clone(s,!1)).cull=clone(s.cull,!1),s.cull.enabled=!1,s=RenderState.fromCache(s)),l=combineUniforms$2(e,i.uniformMap,c)}return a.shaderProgram=o,a.renderState=s,a.uniformMap=l,a}var crateTextureProjectionParamWithDepth=function(){var e={};e._projectionTextureArray=new Array(PROJECTION_LIMIT),e._shadowMapTextureArray=new Array(PROJECTION_LIMIT),e._cameraViewProjectionMatrixArray=new Array(PROJECTION_LIMIT),e._lightPositionECArr=new Array(PROJECTION_LIMIT),e._lightDirectionECArr=new Array(PROJECTION_LIMIT),e._calibrateParamArr=new Array(PROJECTION_LIMIT),e._opacityArr=[1,1,1,1];for(var t=0;t<PROJECTION_LIMIT;t++)e._cameraViewProjectionMatrixArray[t]=new Matrix4,e._calibrateParamArr[t]=new Matrix4,e._lightPositionECArr[t]=new Cartesian4,e._lightDirectionECArr[t]=new Cartesian3;return e};function matchTextureProjection$2(e,t,i){for(var r=!1,n=0;n<t.length;n++){var a=t[n];for(var o in i)if(i.hasOwnProperty(o)){var s=i[o];if("perspective"===s._type&&!1===s._outOfView){var l=!1;if(s._linearSampler[4]<.01)continue;for(var u in s._matchMaterials)if(0<=a.indexOf(s._matchMaterials[u])){l=!0;break}l&&(e.push(s),r=!0)}}}return e.sort(function(e,t){return e._angleDiff-t._angleDiff}),r}PerspectiveProjectionMapWithDepth.createDerivedCommands=function(e,t,i,r,n,a,o,s){defined(s)||(s={});var l=0<e.length,u=r.shaderProgram,c=u.vertexShaderSource,d=u.fragmentShaderSource,h=r.pass===Pass$1.GLOBE;if(r.castShadows){var p=s.castCommands;defined(p)||(p=s.castCommands=[]);var f=s.castShaderProgramId,m=e.length;p.length=m;for(var g=0;g<m;++g)p[g]=createCastDerivedCommand(e[g],n,r,a,f,p[g]);s.castShaderProgramId=r.shaderProgram.id}if(l){var y=[];if(!1===t&&defined(r.receiveTextureProjectionList)&&0<r.receiveTextureProjectionList.length)matchTextureProjection$2(y,r.receiveTextureProjectionList,e);else for(var v in e)if(e.hasOwnProperty(v)){var _=e[v];"perspective"===_._type&&!1===_._outOfView&&y.push(_)}var C=r.tppd;defined(C)||(C=crateTextureProjectionParamWithDepth(),r.tppd=C);var x,b,A=Math.min(y.length,PROJECTION_LIMIT);if(0===A)return;C.textureProjectionArray=y,C._shadowMapCount=A,defined(s.receiveCommand)&&(x=s.receiveCommand.shaderProgram,b=s.receiveCommand.uniformMap);var S=DrawCommand.shallowClone(r,s.receiveCommand);s.castShadows=!1,s.receiveShadows=!0;for(g=0;g<A;++g){var w=s.receiveShaderCastShadows!==r.castShadows,E=s.receiveShaderProgramId!==r.shaderProgram.id;if(!defined(x)||E||n||w){var T=PerspectiveProjectionMapWithDepthShader.getReceiveShaderKeyword(y[g],r.castShadows,h,!1);if(!defined(x=a.shaderCache.getDerivedShaderProgram(u,T))){var P=PerspectiveProjectionMapWithDepthShader.createReceiveVertexShader(c,h,!1),M=PerspectiveProjectionMapWithDepthShader.createReceiveFragmentShader(d,y[g],r.castShadows,h,!1);x=a.shaderCache.createDerivedShaderProgram(u,T,{vertexShaderSource:P,fragmentShaderSource:M,attributeLocations:u._attributeLocations})}}C._projectionTextureArray[g]=y[g],C._shadowMapTextureArray[g]=y[g]._shadowMapTexture,C._cameraViewProjectionMatrixArray[g]=y[g]._shadowMapMatrix,C._lightPositionECArr[g]=y[g]._lightPositionEC,C._lightDirectionECArr[g]=y[g]._lightDirectionEC,C._calibrateParamArr[g]=y[g]._calibrateParam,C._opacityArr[g]=y[g]._linearSampler[4]}for(var D=A;D<PROJECTION_LIMIT;D++)C._projectionTextureArray[D]=y[A-1],C._shadowMapTextureArray[D]=i[A-1]._shadowMapTexture;b=combineUniforms$2(y[0],r.uniformMap,h,C),S.shaderProgram=x,S.renderState=y[0]._primitiveRenderState,S.uniformMap=b,s.receiveShaderProgramId=r.shaderProgram.id,s.receiveShaderCastShadows=r.castShadows,s.receiveCommand=S}return s},PerspectiveProjectionMapWithDepth.prototype.isDestroyed=function(){return!1},PerspectiveProjectionMapWithDepth.prototype.destroy=function(){destroyFramebuffer$3(this),this._debugLightFrustum=this._debugLightFrustum&&this._debugLightFrustum.destroy(),this._debugCameraFrustum=this._debugCameraFrustum&&this._debugCameraFrustum.destroy(),this._debugShadowViewCommand=this._debugShadowViewCommand&&this._debugShadowViewCommand.shaderProgram&&this._debugShadowViewCommand.shaderProgram.destroy();for(var e=0;e<this._numberOfCascades;++e)this._debugCascadeFrustums[e]=this._debugCascadeFrustums[e]&&this._debugCascadeFrustums[e].destroy();return destroyObject(this)};var defaultRamp=[{value:0,color:"#ffffff"},{value:1,color:"#ffa500"}];function PolylineTrailLinkMaterialProperty(e){this._definitionChanged=new Event,this._color=void 0,this._colorSubscription=void 0,this.color=defaultValue(e.color,Color.RED),this.duration=defaultValue(e.duration,3e3),this.image=defaultValue(e.image,void 0),this.ramp=defaultValue(e.ramp,defaultRamp),this._translucnet=defaultValue(e.translucent,!0),this._repeat=defaultValue(e.repeat,1),this._time=(new Date).getTime()}Object.defineProperties(PolylineTrailLinkMaterialProperty.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},color:createPropertyDescriptor("color")}),PolylineTrailLinkMaterialProperty.prototype.getType=function(e){return Material.PolylineTrailLinkType},PolylineTrailLinkMaterialProperty.prototype.getValue=function(e,t){return defined(t)||(t={}),t.color=Property.getValueOrClonedDefault(this.color,e,Color.WHITE,t.color),t.image=this.getColorRamp(),t.repeat=this._repeat,t.time=((new Date).getTime()-this._time)%this.duration/this.duration,t},PolylineTrailLinkMaterialProperty.prototype.update=function(){var e=JulianDate.now();return this.getValue(e)},PolylineTrailLinkMaterialProperty.prototype.isTranslucent=function(){return this._translucnet},PolylineTrailLinkMaterialProperty.prototype.getColorRamp=function(){if(defined(this.image))return this.image;var e=document.createElement("canvas");e.width=100,e.height=1;for(var t=e.getContext("2d"),i=t.createLinearGradient(0,0,100,0),r=0;r<this.ramp.length;r++){var n=this.ramp[r].value,a=this.ramp[r].color;i.addColorStop(n,a)}return t.fillStyle=i,t.fillRect(0,0,100,1),e},PolylineTrailLinkMaterialProperty.prototype.equals=function(e){return this===e||e instanceof PolylineTrailLinkMaterialProperty&&Property.equals(this._color,e._color)};var tmp$7={};tmp$7.rasterizeHTML=function a(o,s,l){function u(i,e){if(!s[i]){if(!o[i]){var t="function"==typeof require&&require;if(!e&&t)return t(i,!0);if(c)return c(i,!0);var r=new Error("Cannot find module '"+i+"'");throw r.code="MODULE_NOT_FOUND",r}var n=s[i]={exports:{}};o[i][0].call(n.exports,function(e){var t=o[i][1][e];return u(t||e)},n,n.exports,a,o,s,l)}return s[i].exports}for(var c="function"==typeof require&&require,e=0;e<l.length;e++)u(l[e]);return u}({1:[function(e,t,i){var r,n;n=function(e,t,i,r){var n=function(i){var n={},t=[];return n.joinUrl=function(e,t){return e?i.resolve(e,t):t},n.getConstantUniqueIdFor=function(e){return t.indexOf(e)<0&&t.push(e),t.indexOf(e)},n.clone=function(e){var t,i={};for(t in e)e.hasOwnProperty(t)&&(i[t]=e[t]);return i},n.parseOptionalParameters=function(e){var t,i,r={canvas:null,options:{}};return null==e[0]||(t=e[0],"object"==typeof(i=t)&&null!==i&&Object.prototype.toString.apply(t).match(/\[object (Canvas|HTMLCanvasElement)\]/i))?(r.canvas=e[0]||null,r.options=n.clone(e[1])):r.options=n.clone(e[0]),r},n}(e),a=function(o){var e={},s=function(e,t,i){var r=e[t];return e[t]=function(){var e=Array.prototype.slice.call(arguments);return i.apply(this,[e,r])},r};return e.baseUrlRespectingXhr=function(t,a){return function(){var e=new t;return s(e,"open",function(e,t){var i=e.shift(),r=e.shift(),n=o.joinUrl(a,r);return t.apply(this,[i,n].concat(e))}),e}},e.finishNotifyingXhr=function(t){var i,r=0,n=0,a=!1,e=new Promise(function(e){i=function(){r-n<=0&&a&&e({totalCount:r})}}),o=function(){var e=new t;return s(e,"send",function(e,t){return r+=1,t.apply(this,arguments)}),e.addEventListener("load",function(){n+=1,i()}),e};return o.waitForRequestsToFinish=function(){return a=!0,i(),e},o},e}(n),o=function(o){var e={},n=function(e){return Array.prototype.slice.call(e)},s={active:!0,hover:!0,focus:!1,target:!1};return e.fakeUserAction=function(e,t,i){var r=e.querySelector(t),n=":"+i,a="rasterizehtml"+i;r&&(s[i]?o.addClassNameRecursively(r,a):o.addClassName(r,a),o.rewriteCssSelectorWith(e,n,"."+a))},e.persistInputValues=function(e){var t=e.querySelectorAll("input"),i=e.querySelectorAll("textarea"),r=function(e){return"checkbox"===e.type||"radio"===e.type};n(t).filter(r).forEach(function(e){e.checked?e.setAttribute("checked",""):e.removeAttribute("checked")}),n(t).filter(function(e){return!r(e)}).forEach(function(e){e.setAttribute("value",e.value)}),n(i).forEach(function(e){e.textContent=e.value})},e.rewriteTagNameSelectorsToLowerCase=function(e){o.lowercaseCssTypeSelectors(e,o.findHtmlOnlyNodeNames(e))},e}(function(){var i={},s=function(e){return Array.prototype.slice.call(e)};i.addClassName=function(e,t){e.className+=" "+t},i.addClassNameRecursively=function(e,t){i.addClassName(e,t),e.parentNode!==e.ownerDocument&&i.addClassNameRecursively(e.parentNode,t)};var r=function(e,t,a){var o="((?:^|[^.#:\\w])|(?=\\W))("+t.join("|")+")(?=\\W|$)";s(e.querySelectorAll("style")).forEach(function(e){var t,i,r;void 0===e.sheet&&(t=e,i=document.implementation.createHTMLDocument(""),(r=document.createElement("style")).textContent=t.textContent,i.body.appendChild(r),t.sheet=r.sheet);var n=s(e.sheet.cssRules).filter(function(e){return e.selectorText&&new RegExp(o,"i").test(e.selectorText)});n.length&&(n.forEach(function(e){var t=e.selectorText.replace(new RegExp(o,"gi"),function(e,t,i){return t+a(i)});t!==e.selectorText&&function(e,t){var i,r,n,a,o=e.cssText.replace(/^[^\{]+/,"");r=t+" "+o,n=(i=e).parentStyleSheet,a=s(n.cssRules).indexOf(i),n.insertRule(r,a+1),n.deleteRule(a)}(e,t)}),function(e){var t;e.textContent=(t=e.sheet.cssRules,s(t).reduce(function(e,t){return e+t.cssText},""))}(e))})};return i.rewriteCssSelectorWith=function(e,t,i){r(e,[t],function(){return i})},i.lowercaseCssTypeSelectors=function(e,t){r(e,t,function(e){return e.toLowerCase()})},i.findHtmlOnlyNodeNames=function(e){for(var t,i=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT),r={},n={};t=i.currentNode.tagName.toLowerCase(),"http://www.w3.org/1999/xhtml"===i.currentNode.namespaceURI?r[t]=!0:n[t]=!0,i.nextNode(););return Object.keys(r).filter(function(e){return!n[e]})},i}()),s=function(c,m,t,v){var e={executeJavascript:function(p,f){return new Promise(function(t){var e,i,r,n,a=(e=v.document,i=f.width,r=f.height,(n=e.createElement("iframe")).style.visibility="hidden",n.style.width=i+"px",n.style.height=r+"px",n.style.position="absolute",n.style.top=-1e4-r+"px",n.style.left=-1e4-i+"px",e.getElementsByTagName("body")[0].appendChild(n),n),o=p.outerHTML,s=[],l=f.executeJsTimeout||0,u=function(){var e=a.contentDocument;v.document.getElementsByTagName("body")[0].removeChild(a),t({document:e,errors:s})},c=a.contentWindow.XMLHttpRequest,d=m.finishNotifyingXhr(c),h=m.baseUrlRespectingXhr(d,f.baseUrl);a.onload=function(){var t;(0<(t=l)?new Promise(function(e){setTimeout(e,t)}):Promise.resolve()).then(d.waitForRequestsToFinish).then(u)},a.contentDocument.open(),a.contentWindow.XMLHttpRequest=h,a.contentWindow.onerror=function(e){s.push({resourceType:"scriptExecution",msg:e})},a.contentDocument.write("<!DOCTYPE html>"),a.contentDocument.write(o),a.contentDocument.close()})},calculateDocumentContentSize:function(m,g){return new Promise(function(n,a){var o,e,t,i,r,s,l,u,c,d,h,p,f=g.zoom||1;e=g.width,t=g.height,i=f,c=Math.floor(e/i),d=Math.floor(t/i),r=v.document,s=c,l=d,(u=r.createElement("iframe")).style.width=s+"px",u.style.height=l+"px",u.style.visibility="hidden",u.style.position="absolute",u.style.top=-1e4-l+"px",u.style.left=-1e4-s+"px",u.style.borderWidth=0,u.sandbox="allow-same-origin",u.scrolling="no",o=u,v.document.getElementsByTagName("body")[0].appendChild(o),o.onload=function(){var e,t,i,r=o.contentDocument;try{e=function(e,t,i,r,n){var a,o,s,l,u,c,d,h,p,f,m,g=Math.max(e.scrollWidth,e.clientWidth),y=Math.max(e.scrollHeight,e.clientHeight);return l=t?(a=(c=function(e,t){var i=e.querySelector(t);if(i)return i;if(e.ownerDocument.querySelector(t)===e)return e;throw{message:"Clipping selector not found"}}(e,t).getBoundingClientRect()).top,o=c.left,s=c.width,c.height):(o=a=0,s=g,y),h={width:s,height:l},p=i,f=r,m=n,d={width:Math.max(h.width*m,p),height:Math.max(h.height*m,f)},u=v.getComputedStyle(e.ownerDocument.documentElement).fontSize,{left:o,top:a,width:d.width,height:d.height,viewportWidth:g,viewportHeight:y,rootFontSize:u}}((t=r,i=m.tagName,t.querySelector(i)),g.clip,g.width,g.height,f),n(e)}catch(e){a(e)}finally{v.document.getElementsByTagName("body")[0].removeChild(o)}},o.contentDocument.open(),o.contentDocument.write("<!DOCTYPE html>"),o.contentDocument.write("html"===(p=(h=m).tagName.toLowerCase())||"body"===p?h.outerHTML:'<body style="margin: 0;">'+h.outerHTML+"</body>"),o.contentDocument.close()})},parseHtmlFragment:function(e){var t=v.document.implementation.createHTMLDocument("");t.documentElement.innerHTML=e;var i=t.querySelector("body").firstChild;if(!i)throw"Invalid source";return i},parseHTML:function(e){var t=v.document.implementation.createHTMLDocument("");return t.documentElement.innerHTML=e,function(e,t){var i,r,n,a,o=/<html((?:\s+[^>]*)?)>/im.exec(t),s=v.document.implementation.createHTMLDocument("");if(o)for(i="<div"+o[1]+"></div>",s.documentElement.innerHTML=i,n=s.querySelector("div"),r=0;r<n.attributes.length;r++)a=n.attributes[r],e.documentElement.setAttribute(a.name,a.value)}(t,e),t}},i=function(e){try{return t.failOnParseError(e)}catch(e){throw{message:"Invalid source",originalError:e}}};e.validateXHTML=function(e){var t=(new DOMParser).parseFromString(e,"application/xml");i(t)};var d=null;return e.loadDocument=function(e,t){return function(l,u){return new Promise(function(e,t){var i,r,n=new window.XMLHttpRequest,a=c.joinUrl(u.baseUrl,l),o=(i=a,"none"===(r=u.cache)||"repeated"===r?(null!==d&&"repeated"===r||(d=Date.now()),i+"?_="+d):i),s=function(e){t({message:"Unable to load page",originalError:e})};n.addEventListener("load",function(){200===n.status||0===n.status?e(n.responseXML):s(n.statusText)},!1),n.addEventListener("error",function(e){s(e)},!1);try{n.open("GET",o,!0),n.responseType="document",n.send(null)}catch(e){s(e)}})}(e,t).then(function(e){return i(e)})},e}(n,a,i,window),l=function(r){var e,t={},n=function(e,t){return t?URL.createObjectURL(new Blob([e],{type:"image/svg+xml"})):"data:image/svg+xml;charset=utf-8,"+encodeURIComponent(e)},o=function(e){e instanceof Blob&&URL.revokeObjectURL(e)},a='<svg xmlns="http://www.w3.org/2000/svg" width="1" height="1"><foreignObject></foreignObject></svg>',s=function(n){return new Promise(function(t,e){var i=document.createElement("canvas"),r=new Image;r.onload=function(){var e=i.getContext("2d");try{e.drawImage(r,0,0),i.toDataURL("image/png"),t(!0)}catch(e){t(!1)}},r.onerror=e,r.src=n})},l=function(t){return(void 0===e&&(e=new Promise(function(t,e){var i;(function(){if(r.Blob)try{return new Blob(["<b></b>"],{type:"text/xml"}),!0}catch(e){}return!1})()&&r.URL?(i=n(a,!0),s(i).then(function(e){return o(i),!e&&s(n(a,!1)).then(function(e){return e})},function(){return!1})).then(function(e){t(!e)},function(){e()}):t(!1)})),e).then(function(e){return n(t,e)})};return t.renderSvg=function(a){return new Promise(function(e,t){var i,r,n=function(){i&&o(i)};(r=new Image).onload=function(){r.onload=null,r.onerror=null,n(),e(r)},r.onerror=function(){n(),t()},l(a).then(function(e){i=e,r.src=i},t)})},t}(window);return function(d,s,h){var l={drawDocument:function(){var e,t,i,r,n,a,o,s=arguments[0],l=Array.prototype.slice.call(arguments,1),u=d.parseOptionalParameters(l),c=s.documentElement?s.documentElement:s;return h.rasterize(c,u.canvas,(i=(e=u).canvas,r=e.options,n=i?i.width:300,a=i?i.height:200,o={width:void 0!==r.width?r.width:n,height:void 0!==r.height?r.height:a},(t=d.clone(e.options)).width=o.width,t.height=o.height,t))},drawHTML:function(){var e,t,i,r,n=arguments[0],a=Array.prototype.slice.call(arguments,1),o=d.parseOptionalParameters(a);return e=n,t=o.canvas,i=o.options,r=s.parseHTML(e),l.drawDocument(r,t,i)},drawURL:function(){var e=arguments[0],t=Array.prototype.slice.call(arguments,1),i=d.parseOptionalParameters(t);return function(i,r,n){return s.loadDocument(i,n).then(function(e){var t=function(e,t,i){var r=document.implementation.createHTMLDocument("");r.replaceChild(e.documentElement,r.documentElement);var n=i?d.clone(i):{};return i.baseUrl||(n.baseUrl=t),{document:r,options:n}}(e,i,n);return l.drawDocument(t.document,r,t.options)})}(e,i.canvas,i.options)}};return l}(n,s,function(i,a,o,s,e,l){var t={},u=function(e){return{message:"Error rendering page",originalError:e}},c=function(t){return e.renderSvg(t).then(function(e){return{image:e,svg:t}},function(e){throw u(e)})};return t.rasterize=function(r,e,n){var t;return(t=i.clone(n)).inlineScripts=!0===n.executeJs,l.inlineReferences(r,t).then(function(t){return n.executeJs?(e=r,i=n,a.executeJavascript(e,i).then(function(e){var t=e.document;return o.persistInputValues(t),{document:t,errors:e.errors}})).then(function(e){return{element:e.document.documentElement,errors:t.concat(e.errors)}}):{element:r,errors:t};var e,i}).then(function(t){return function(e,t,i){return s.drawDocumentAsSvg(e,i).then(c).then(function(e){return t&&function(e,t){try{t.getContext("2d").drawImage(e,0,0)}catch(e){throw u(e)}}(e.image,t),e})}(t.element,e,n).then(function(e){return{image:e.image,svg:e.svg,errors:t.errors}})})},t}(n,s,o,function(e,p,r,f){var n={},m=function(t){var e=Object.keys(t);return e.length?" "+e.map(function(e){return e+'="'+t[e]+'"'}).join(" "):""};return n.getSvgForDocument=function(e,t,i){return r.rewriteTagNameSelectorsToLowerCase(e),function(e,t,i){var r=f.serializeToString(e);p.validateXHTML(r);var n,a,o,s,l,u,c,d,h=(n=t,a=Math.round(n.viewportWidth),o=Math.round(n.viewportHeight),{x:-n.left,y:-n.top,width:a,height:o});return l=(s=h).style||"",s.style=l+"float: left;",h.externalResourcesRequired=!0,'<svg xmlns="http://www.w3.org/2000/svg"'+m((c=i||1,d={width:(u=t).width,height:u.height,"font-size":u.rootFontSize},1!==c&&(d.style="transform:scale("+c+"); transform-origin: 0 0;"),d))+'><style scoped="">html::-webkit-scrollbar { display: none; }</style><foreignObject'+m(h)+">"+r+"</foreignObject></svg>"}(e,t,i)},n.drawDocumentAsSvg=function(t,i){return["hover","active","focus","target"].forEach(function(e){i[e]&&r.fakeUserAction(t,i[e],e)}),p.calculateDocumentContentSize(t,i).then(function(e){return n.getSvgForDocument(t,e,i.zoom)})},n}(0,s,o,t),l,r))},void 0===(r=this)&&void 0!==window&&(r=window),"object"==typeof t&&t.exports?t.exports=n(e("url"),e("xmlserializer"),e("sane-domparser-error"),e("inlineresources")):r.rasterizeHTML=n(r.url,r.xmlserializer,r.sanedomparsererror,r.inlineresources)},{inlineresources:5,"sane-domparser-error":14,url:15,xmlserializer:17}],2:[function(d,i,r){(function(t){!function(e){"object"==typeof r&&void 0!==i?i.exports=e():("undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:this).cssFontFaceSrc=e()}(function(){return function a(o,s,l){function u(i,e){if(!s[i]){if(!o[i]){var t="function"==typeof d&&d;if(!e&&t)return t(i,!0);if(c)return c(i,!0);var r=new Error("Cannot find module '"+i+"'");throw r.code="MODULE_NOT_FOUND",r}var n=s[i]={exports:{}};o[i][0].call(n.exports,function(e){var t=o[i][1][e];return u(t||e)},n,n.exports,a,o,s,l)}return s[i].exports}for(var c="function"==typeof d&&d,e=0;e<l.length;e++)u(l[e]);return u}({1:[function(H,e,t){function W(e,t,i,r){this.message=e,this.expected=t,this.found=i,this.location=r,this.name="SyntaxError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,W)}!function(e,t){function i(){this.constructor=e}i.prototype=t.prototype,e.prototype=new i}(W,Error),W.buildMessage=function(e,t){var i,a={literal:function(e){return'"'+n(e.text)+'"'},class:function(e){var t,i="";for(t=0;t<e.parts.length;t++)i+=e.parts[t]instanceof Array?o(e.parts[t][0])+"-"+o(e.parts[t][1]):o(e.parts[t]);return"["+(e.inverted?"^":"")+i+"]"},any:function(e){return"any character"},end:function(e){return"end of input"},other:function(e){return e.description}};function r(e){return e.charCodeAt(0).toString(16).toUpperCase()}function n(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(e){return"\\x0"+r(e)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(e){return"\\x"+r(e)})}function o(e){return e.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(e){return"\\x0"+r(e)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(e){return"\\x"+r(e)})}return"Expected "+function(e){var t,i,r,n=new Array(e.length);for(t=0;t<e.length;t++)n[t]=(r=e[t],a[r.type](r));if(n.sort(),0<n.length){for(i=t=1;t<n.length;t++)n[t-1]!==n[t]&&(n[i]=n[t],i++);n.length=i}switch(n.length){case 1:return n[0];case 2:return n[0]+" or "+n[1];default:return n.slice(0,-1).join(", ")+", or "+n[n.length-1]}}(e)+" but "+((i=t)?'"'+n(i)+'"':"end of input")+" found."},e.exports={SyntaxError:W,parse:function(l,e){e=void 0!==e?e:{};var t,u={},i={start:F},r=F,n="",a=function(){return[]},s=",",c=R(",",!1),d=function(e,t){return[e].concat(t)},h=function(e){return[e]},p=function(e,t){return{url:e,format:t}},f=function(e){return{url:e}},o="url(",m=R("url(",!1),g=")",y=R(")",!1),v=function(e){return e},_="format(",C=R("format(",!1),x="local(",b=R("local(",!1),A=function(e){return{local:e}},S=/^[^)]/,w=L([")"],!0,!1),E=function(e){return $.extractValue(e.join(""))},T=/^[ \t\r\n\f]/,P=L([" ","\t","\r","\n","\f"],!1,!1),M=0,D=[{line:1,column:1}],I=0,O=[];if("startRule"in e){if(!(e.startRule in i))throw new Error("Can't start parsing from rule \""+e.startRule+'".');r=i[e.startRule]}function R(e,t){return{type:"literal",text:e,ignoreCase:t}}function L(e,t,i){return{type:"class",parts:e,inverted:t,ignoreCase:i}}function N(e){var t,i=D[e];if(i)return i;for(t=e-1;!D[t];)t--;for(i={line:(i=D[t]).line,column:i.column};t<e;)10===l.charCodeAt(t)?(i.line++,i.column=1):i.column++,t++;return D[e]=i}function k(e,t){var i=N(e),r=N(t);return{start:{offset:e,line:i.line,column:i.column},end:{offset:t,line:r.line,column:r.column}}}function B(e){M<I||(I<M&&(I=M,O=[]),O.push(e))}function F(){var e,t;return(e=function e(){var t,i,r,n,a,o;if(t=M,(i=V())!==u){for(r=[],n=G();n!==u;)r.push(n),n=G();if(r!==u)if(44===l.charCodeAt(M)?(n=s,M++):(n=u,B(c)),n!==u){for(a=[],o=G();o!==u;)a.push(o),o=G();t=a!==u&&(o=e())!==u?i=d(i,o):(M=t,u)}else M=t,t=u;else M=t,t=u}else M=t,t=u;return t===u&&(t=M,(i=V())!==u&&(i=h(i)),t=i),t}())===u&&(e=M,(t=n)!==u&&(t=a()),e=t),e}function V(){var e,t,i,r,n;return(e=function(){var e,t,i,r,n,a,o,s;if(e=M,(t=z())!==u){if(i=[],(r=G())!==u)for(;r!==u;)i.push(r),r=G();else i=u;e=i!==u&&(n=M,l.substr(M,7)===_?(a=_,M+=7):(a=u,B(C)),n=a!==u&&(o=U())!==u?(41===l.charCodeAt(M)?(s=g,M++):(s=u,B(y)),s!==u?a=v(o):(M=n,u)):(M=n,u),(r=n)!==u)?t=p(t,r):(M=e,u)}else M=e,e=u;return e===u&&(e=M,(t=z())!==u&&(t=f(t)),e=t),e}())===u&&(t=M,l.substr(M,6)===x?(i=x,M+=6):(i=u,B(b)),t=i!==u&&(r=U())!==u?(41===l.charCodeAt(M)?(n=g,M++):(n=u,B(y)),n!==u?i=A(r):(M=t,u)):(M=t,u),e=t),e}function z(){var e,t,i,r;return e=M,l.substr(M,4)===o?(t=o,M+=4):(t=u,B(m)),e=t!==u&&(i=U())!==u?(41===l.charCodeAt(M)?(r=g,M++):(r=u,B(y)),r!==u?t=v(i):(M=e,u)):(M=e,u)}function U(){var e,t;if(e=[],S.test(l.charAt(M))?(t=l.charAt(M),M++):(t=u,B(w)),t!==u)for(;t!==u;)e.push(t),S.test(l.charAt(M))?(t=l.charAt(M),M++):(t=u,B(w));else e=u;return e!==u&&(e=E(e)),e}function G(){var e;return T.test(l.charAt(M))?(e=l.charAt(M),M++):(e=u,B(P)),e}var $=H("../util");if((t=r())!==u&&M===l.length)return t;throw t!==u&&M<l.length&&B({type:"end"}),function(e,t,i){return new W(W.buildMessage(e,t),e,t,i)}(O,I<l.length?l.charAt(I):null,I<l.length?k(I,I+1):k(I,I))}}},{"../util":3}],2:[function(e,t,i){var r=e("./grammar");i.SyntaxError=function(e,t){this.message=e,this.offset=t},i.parse=function(e){try{return r.parse(e)}catch(e){throw new i.SyntaxError(e.message,e.offset)}},i.serialize=function(e){return e.map(function(e){var t;return e.url?(t='url("'+e.url+'")',e.format&&(t+=' format("'+e.format+'")')):t='local("'+e.local+'")',t}).join(", ")}},{"./grammar":1}],3:[function(e,t,i){i.extractValue=function(e){return t=e.replace(/^[\t\r\f\n ]*(.+?)[\t\r\f\n ]*$/,"$1"),r=/^'(.*)'$/,(i=/^"(.*)"$/).test(t)?t.replace(i,"$1"):r.test(t)?t.replace(r,"$1"):t;var t,i,r}},{}]},{},[2])(2)})}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],3:[function(e,t,i){var r=e("./cssSupport");i.extractCssUrl=function(e){var t,i=/^url\(("[^"]+"|'[^']+'|[^\)]+)\)/;if(!i.test(e))throw new Error("Invalid url");return t=i.exec(e)[1],r.unquoteString(t.replace(/^[\t\r\f\n ]*(.+?)[\t\r\f\n ]*$/,"$1"))},i.parse=function(e){return function(e){var t,n="(url\\(\\s*(?:\"[^\"]*\"|'[^']*'|[^\\(]+)\\s*\\)|[^,\\s]+)",i=new RegExp("(?:\\s*(url\\(\\s*(?:\"[^\"]*\"|'[^']*'|[^\\(]+)\\s*\\)|[^,\\s]+))+","g"),r=[],a=function(e){var t,i=new RegExp(n,"g"),r=[];for(t=i.exec(e);t;)r.push(t[1]),t=i.exec(e);return r};if(e.match(new RegExp("^\\s*((?:\\s*(url\\(\\s*(?:\"[^\"]*\"|'[^']*'|[^\\(]+)\\s*\\)|[^,\\s]+))+)(?:\\s*,\\s*((?:\\s*(url\\(\\s*(?:\"[^\"]*\"|'[^']*'|[^\\(]+)\\s*\\)|[^,\\s]+))+))*\\s*$"))){for(t=i.exec(e);t;)r.push(a(t[0])),t=i.exec(e);return r}return[]}(e).map(function(e){var t=function(e){var t;for(t=0;t<e.length;t++)try{return{url:i.extractCssUrl(e[t]),idx:t}}catch(e){}}(e);return t?{preUrl:e.slice(0,t.idx),url:t.url,postUrl:e.slice(t.idx+1)}:{preUrl:e}})},i.serialize=function(e){return e.map(function(e){var t=[].concat(e.preUrl);return e.url&&t.push('url("'+e.url+'")'),e.postUrl&&(t=t.concat(e.postUrl)),t.join(" ")}).join(", ")}},{"./cssSupport":4}],4:[function(e,t,n){n.unquoteString=function(e){var t=/^"(.*)"$/,i=/^'(.*)'$/;return t.test(e)?e.replace(t,"$1"):i.test(e)?e.replace(i,"$1"):e},n.rulesForCssText=function(e){var t,i=document.implementation.createHTMLDocument(""),r=document.createElement("style");return r.textContent=e,i.body.appendChild(r),t=r.sheet.cssRules,Array.prototype.slice.call(t)},n.cssRulesToText=function(e){return e.reduce(function(e,t){return e+t.cssText},"")},n.exchangeRule=function(e,t,i){e[e.indexOf(t)]=n.rulesForCssText(i)[0]},n.changeFontFaceRuleSrc=function(e,t,i){var r="@font-face { font-family: "+t.style.getPropertyValue("font-family")+"; ";t.style.getPropertyValue("font-style")&&(r+="font-style: "+t.style.getPropertyValue("font-style")+"; "),t.style.getPropertyValue("font-weight")&&(r+="font-weight: "+t.style.getPropertyValue("font-weight")+"; "),r+="src: "+i+"}",n.exchangeRule(e,t,r)}},{}],5:[function(e,t,n){var l=e("./util"),i=e("./inlineImage"),r=e("./inlineScript"),o=e("./inlineCss"),s=e("./cssSupport"),a=function(r){return r.map(function(e,t){var i;return t===r.length-1&&(e={baseUrl:(i=e.baseUrl,l.joinUrl(i,"."))}),JSON.stringify(e)})},u=function(e,t){return!1!==t.cache&&"none"!==t.cache&&t.cacheBucket?l.memoize(e,a,t.cacheBucket):e},c=function(n,e,t){var a=s.rulesForCssText(n);return o.loadCSSImportsForRules(a,e,t).then(function(r){return o.loadAndInlineCSSResourcesForRules(a,t).then(function(e){var t=r.errors.concat(e.errors),i=r.hasChanges||e.hasChanges;return i&&(n=s.cssRulesToText(a)),{hasChanges:i,content:n,errors:t}})})};n.loadAndInlineStyles=function(e,t){var a,i,r=(i=e.getElementsByTagName("style"),Array.prototype.filter.call(i,function(e){return!e.attributes.type||"text/css"===e.attributes.type.value})),o=[],s=[];return(a=l.clone(t)).baseUrl=a.baseUrl||l.getDocumentBaseUrl(e),Promise.all(r.map(function(e){return(i=a,r=s,n=(t=e).textContent,u(c,i)(n,r,i).then(function(e){return e.hasChanges&&(t.childNodes[0].nodeValue=e.content),l.cloneArray(e.errors)})).then(function(e){o=o.concat(e)});var t,i,r,n})).then(function(){return o})};var d=function(i,e){return l.ajax(i,e).then(function(e){return{content:e,cssRules:s.rulesForCssText(e)}}).then(function(e){var t=o.adjustPathsOfCssResources(i,e.cssRules);return{content:e.content,cssRules:e.cssRules,hasChanges:t}}).then(function(t){return o.loadCSSImportsForRules(t.cssRules,[],e).then(function(e){return{content:t.content,cssRules:t.cssRules,hasChanges:t.hasChanges||e.hasChanges,errors:e.errors}})}).then(function(t){return o.loadAndInlineCSSResourcesForRules(t.cssRules,e).then(function(e){return{content:t.content,cssRules:t.cssRules,hasChanges:t.hasChanges||e.hasChanges,errors:t.errors.concat(e.errors)}})}).then(function(e){var t=e.content;return e.hasChanges&&(t=s.cssRulesToText(e.cssRules)),{content:t,errors:e.errors}})};n.loadAndInlineCssLinks=function(e,o){var t,i=(t=e.getElementsByTagName("link"),Array.prototype.filter.call(t,function(e){return e.attributes.rel&&"stylesheet"===e.attributes.rel.value&&(!e.attributes.type||"text/css"===e.attributes.type.value)})),s=[];return Promise.all(i.map(function(a){return(t=o,i=(e=a).attributes.href.value,r=l.getDocumentBaseUrl(e.ownerDocument),!(n=l.clone(t)).baseUrl&&r&&(n.baseUrl=r),u(d,t)(i,n).then(function(e){return{content:e.content,errors:l.cloneArray(e.errors)}})).then(function(e){var t,i,r,n;t=a,i=e.content+"\n",n=t.parentNode,(i=i.trim())&&((r=t.ownerDocument.createElement("style")).type="text/css",r.appendChild(t.ownerDocument.createTextNode(i)),n.insertBefore(r,t)),n.removeChild(t),s=s.concat(e.errors)},function(e){s.push({resourceType:"stylesheet",url:e.url,msg:"Unable to load stylesheet "+e.url})});var e,t,i,r,n})).then(function(){return s})},n.loadAndInlineImages=i.inline,n.loadAndInlineScript=r.inline,n.inlineReferences=function(t,i){var r=[],e=[n.loadAndInlineImages,n.loadAndInlineStyles,n.loadAndInlineCssLinks];return!1!==i.inlineScripts&&e.push(n.loadAndInlineScript),Promise.all(e.map(function(e){return e(t,i).then(function(e){r=r.concat(e)})})).then(function(){return r})}},{"./cssSupport":4,"./inlineCss":6,"./inlineImage":7,"./inlineScript":8,"./util":9}],6:[function(e,t,h){var p=e("./util"),f=e("./cssSupport"),u=e("./backgroundValueParser"),s=e("css-font-face-src"),c=function(e,t,i){e.style.setProperty(t,i,e.style.getPropertyPriority(t))},d=function(e){return e.filter(function(e){return e.type===window.CSSRule.STYLE_RULE&&(e.style.getPropertyValue("background-image")||e.style.getPropertyValue("background"))})},m=function(e){var t=[];return e.forEach(function(e){e.style.getPropertyValue("background-image")?t.push({property:"background-image",value:e.style.getPropertyValue("background-image"),rule:e}):e.style.getPropertyValue("background")&&t.push({property:"background",value:e.style.getPropertyValue("background"),rule:e})}),t},l=function(e){return e.filter(function(e){return e.type===window.CSSRule.FONT_FACE_RULE&&e.style.getPropertyValue("src")})},i=function(e){return e.filter(function(e){return e.type===window.CSSRule.IMPORT_RULE&&e.href})},g=function(e){var i=[];return e.forEach(function(e,t){e.url&&!p.isDataUri(e.url)&&i.push(t)}),i},y=function(e){var i=[];return e.forEach(function(e,t){e.url&&!p.isDataUri(e.url)&&i.push(t)}),i};h.adjustPathsOfCssResources=function(n,a){var e=d(a),t=m(e),o=!1;return t.forEach(function(e){var t,r=u.parse(e.value),i=g(r);0<i.length&&(i.forEach(function(e){var t=r[e].url,i=p.joinUrl(n,t);r[e].url=i}),t=u.serialize(r),c(e.rule,e.property,t),o=!0)}),l(a).forEach(function(e){var r,t,i=e.style.getPropertyValue("src");try{r=s.parse(i)}catch(e){return}0<(t=y(r)).length&&(t.forEach(function(e){var t=r[e].url,i=p.joinUrl(n,t);r[e].url=i}),f.changeFontFaceRuleSrc(a,e,s.serialize(r)),o=!0)}),i(a).forEach(function(e){var t=e.href,i=p.joinUrl(n,t);f.exchangeRule(a,e,"@import url("+i+");"),o=!0}),o};var v=function(i,e,t){var r=i.indexOf(e);i.splice(r,1),t.forEach(function(e,t){i.splice(r+t,0,e)})};h.loadCSSImportsForRules=function(s,l,u){var e=i(s),c=[],d=!1;return Promise.all(e.map(function(e){return(i=s,n=l,a=u,o=(r=e).href,o=f.unquoteString(o),t=p.joinUrl(a.baseUrl,o),0<=n.indexOf(t)?(v(i,r,[]),Promise.resolve([])):(n.push(t),p.ajax(o,a).then(function(e){var t=f.rulesForCssText(e);return h.loadCSSImportsForRules(t,n,a).then(function(e){return h.adjustPathsOfCssResources(o,t),v(i,r,t),e.errors})},function(e){throw{resourceType:"stylesheet",url:e.url,msg:"Unable to load stylesheet "+e.url}}))).then(function(e){c=c.concat(e),d=!0},function(e){c.push(e)});var i,r,n,a,t,o})).then(function(){return{hasChanges:d,errors:c}})},h.loadAndInlineCSSResourcesForRules=function(t,i){var r=!1,n=[];return Promise.all([function(e,o){var t=d(e),i=m(t),s=[],l=!1;return Promise.all(i.map(function(t){return(e=t.value,i=o,r=u.parse(e),n=g(r),a=!1,p.collectAndReportErrors(n.map(function(t){var e=r[t].url;return p.getDataURIForImageURL(e,i).then(function(e){r[t].url=e,a=!0},function(e){throw{resourceType:"backgroundImage",url:e.url,msg:"Unable to load background-image "+e.url}})})).then(function(e){return{backgroundValue:u.serialize(r),hasChanges:a,errors:e}})).then(function(e){e.hasChanges&&(c(t.rule,t.property,e.backgroundValue),l=!0),s=s.concat(e.errors)});var e,i,r,n,a})).then(function(){return{hasChanges:l,errors:s}})},function(i,e){var t=l(i),r=[],n=!1;return Promise.all(t.map(function(t){return function(e,t){var n,i,a=!1;try{n=s.parse(e)}catch(e){n=[]}return i=y(n),p.collectAndReportErrors(i.map(function(e){var i=n[e],r=i.format||"woff";return p.binaryAjax(i.url,t).then(function(e){var t=btoa(e);i.url="data:font/"+r+";base64,"+t,a=!0},function(e){throw{resourceType:"fontFace",url:e.url,msg:"Unable to load font-face "+e.url}})})).then(function(e){return{srcDeclarationValue:s.serialize(n),hasChanges:a,errors:e}})}(t.style.getPropertyValue("src"),e).then(function(e){e.hasChanges&&(f.changeFontFaceRuleSrc(i,t,e.srcDeclarationValue),n=!0),r=r.concat(e.errors)})})).then(function(){return{hasChanges:n,errors:r}})}].map(function(e){return e(t,i).then(function(e){r=r||e.hasChanges,n=n.concat(e.errors)})})).then(function(){return{hasChanges:r,errors:n}})}},{"./backgroundValueParser":3,"./cssSupport":4,"./util":9,"css-font-face-src":2}],7:[function(e,t,i){var s=e("./util"),l=function(e){return Array.prototype.slice.call(e)};i.inline=function(e,i){var t,r=l(e.getElementsByTagName("img")),n=l(e.getElementsByTagName("image")),a=(t=e.getElementsByTagName("input"),Array.prototype.filter.call(t,function(e){return"image"===e.type})),o=(r=(r=r.concat(n)).concat(a)).filter(function(e){var t=null;return e.hasAttribute("src")?t=e.getAttribute("src"):e.hasAttributeNS("http://www.w3.org/1999/xlink","href")?t=e.getAttributeNS("http://www.w3.org/1999/xlink","href"):e.hasAttribute("href")&&(t=e.getAttribute("href")),null!==t&&!s.isDataUri(t)});return s.collectAndReportErrors(o.map(function(t){return function(e,t){var i=null;e.hasAttribute("src")?i=e.getAttribute("src"):e.hasAttributeNS("http://www.w3.org/1999/xlink","href")?i=e.getAttributeNS("http://www.w3.org/1999/xlink","href"):e.hasAttribute("href")&&(i=e.getAttribute("href"));var r=s.getDocumentBaseUrl(e.ownerDocument),n=s.clone(t);return!n.baseUrl&&r&&(n.baseUrl=r),s.getDataURIForImageURL(i,n).then(function(e){return e},function(e){throw{resourceType:"image",url:e.url,msg:"Unable to load image "+e.url}})}(t,i).then(function(e){t.attributes.src?t.attributes.src.value=e:t.attributes["xlink:href"]?t.attributes["xlink:href"].value=e:t.attributes.href&&(t.attributes.href.value=e)})}))}},{"./util":9}],8:[function(e,t,i){var s=e("./util");i.inline=function(e,o){var t,i=(t=e.getElementsByTagName("script"),Array.prototype.filter.call(t,function(e){return!!e.attributes.src}));return s.collectAndReportErrors(i.map(function(r){return(t=o,i=(e=r).attributes.src.value,n=s.getDocumentBaseUrl(e.ownerDocument),!(a=s.clone(t)).baseUrl&&n&&(a.baseUrl=n),s.ajax(i,a).catch(function(e){throw{resourceType:"script",url:e.url,msg:"Unable to load script "+e.url}})).then(function(e){var t,i;i=e,(t=r).attributes.removeNamedItem("src"),t.textContent=i.replace(/<\//g,"<\\/")});var e,t,i,n,a}))}},{"./util":9}],9:[function(e,t,c){var i=e("url");c.getDocumentBaseUrl=function(e){return"about:blank"!==e.baseURI?e.baseURI:null},c.clone=function(e){var t,i={};for(t in e)e.hasOwnProperty(t)&&(i[t]=e[t]);return i},c.cloneArray=function(e){return Array.prototype.slice.apply(e,[0])},c.joinUrl=function(e,t){return e?i.resolve(e,t):t},c.isDataUri=function(e){return/^data:/.test(e)},c.collectAndReportErrors=function(e){var t=[];return Promise.all(e.map(function(e){return e.catch(function(e){t.push(e)})})).then(function(){return t})};var d=null;c.ajax=function(l,u){return new Promise(function(e,t){var i,r,n,a=new window.XMLHttpRequest,o=c.joinUrl(u.baseUrl,l),s=function(){t({msg:"Unable to load url",url:o})};r=o,i=!1===(n=u.cache)||"none"===n||"repeated"===n?(null!==d&&"repeated"===n||(d=Date.now()),r+"?_="+d):r,a.addEventListener("load",function(){200===a.status||0===a.status?e(a.response):s()},!1),a.addEventListener("error",s,!1);try{a.open("GET",i,!0),a.overrideMimeType(u.mimeType),a.send(null)}catch(e){s()}})},c.binaryAjax=function(e,t){var i=c.clone(t);return i.mimeType="text/plain; charset=x-user-defined",c.ajax(e,i).then(function(e){for(var t="",i=0;i<e.length;i++)t+=String.fromCharCode(255&e.charCodeAt(i));return t})},c.getDataURIForImageURL=function(e,t){return c.binaryAjax(e,t).then(function(e){var t,i,r=btoa(e);return"data:"+((i=function(e,t){return e.substring(0,t.length)===t})(t=e,"<?xml")||i(t,"<svg")?"image/svg+xml":"image/png")+";base64,"+r})};var l=[];c.memoize=function(a,o,s){if("object"!=typeof s)throw new Error("cacheBucket is not an object");return function(){var e,t,i=Array.prototype.slice.call(arguments),r=o(i),n=(t=a,l.indexOf(t)<0&&l.push(t),l.indexOf(t));return s[n]&&s[n][r]?s[n][r]:(e=a.apply(null,i),s[n]=s[n]||{},s[n][r]=e)}}},{url:15}],10:[function(e,P,M){(function(T){!function(e){var t="object"==typeof M&&M&&!M.nodeType&&M,i="object"==typeof P&&P&&!P.nodeType&&P,r="object"==typeof T&&T;r.global!==r&&r.window!==r&&r.self!==r||(e=r);var n,a,y=2147483647,v=36,_=26,o=38,s=700,l=/^xn--/,u=/[^\x20-\x7E]/,c=/[\x2E\u3002\uFF0E\uFF61]/g,d={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},h=v-1,C=Math.floor,x=String.fromCharCode;function b(e){throw RangeError(d[e])}function p(e,t){for(var i=e.length,r=[];i--;)r[i]=t(e[i]);return r}function f(e,t){var i=e.split("@"),r="";return 1<i.length&&(r=i[0]+"@",e=i[1]),r+p((e=e.replace(c,".")).split("."),t).join(".")}function A(e){for(var t,i,r=[],n=0,a=e.length;n<a;)55296<=(t=e.charCodeAt(n++))&&t<=56319&&n<a?56320==(64512&(i=e.charCodeAt(n++)))?r.push(((1023&t)<<10)+(1023&i)+65536):(r.push(t),n--):r.push(t);return r}function S(e){return p(e,function(e){var t="";return 65535<e&&(t+=x((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=x(e)}).join("")}function w(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function E(e,t,i){var r=0;for(e=i?C(e/s):e>>1,e+=C(e/t);h*_>>1<e;r+=v)e=C(e/h);return C(r+(h+1)*e/(e+o))}function m(e){var t,i,r,n,a,o,s,l,u,c,d,h=[],p=e.length,f=0,m=128,g=72;for((i=e.lastIndexOf("-"))<0&&(i=0),r=0;r<i;++r)128<=e.charCodeAt(r)&&b("not-basic"),h.push(e.charCodeAt(r));for(n=0<i?i+1:0;n<p;){for(a=f,o=1,s=v;p<=n&&b("invalid-input"),d=e.charCodeAt(n++),(v<=(l=d-48<10?d-22:d-65<26?d-65:d-97<26?d-97:v)||l>C((y-f)/o))&&b("overflow"),f+=l*o,!(l<(u=s<=g?1:g+_<=s?_:s-g));s+=v)o>C(y/(c=v-u))&&b("overflow"),o*=c;g=E(f-a,t=h.length+1,0==a),C(f/t)>y-m&&b("overflow"),m+=C(f/t),f%=t,h.splice(f++,0,m)}return S(h)}function g(e){var t,i,r,n,a,o,s,l,u,c,d,h,p,f,m,g=[];for(h=(e=A(e)).length,t=128,a=72,o=i=0;o<h;++o)(d=e[o])<128&&g.push(x(d));for(r=n=g.length,n&&g.push("-");r<h;){for(s=y,o=0;o<h;++o)t<=(d=e[o])&&d<s&&(s=d);for(s-t>C((y-i)/(p=r+1))&&b("overflow"),i+=(s-t)*p,t=s,o=0;o<h;++o)if((d=e[o])<t&&++i>y&&b("overflow"),d==t){for(l=i,u=v;!(l<(c=u<=a?1:a+_<=u?_:u-a));u+=v)m=l-c,f=v-c,g.push(x(w(c+m%f,0))),l=C(m/f);g.push(x(w(l,0))),a=E(i,p,r==n),i=0,++r}++i,++t}return g.join("")}if(n={version:"1.3.2",ucs2:{decode:A,encode:S},decode:m,encode:g,toASCII:function(e){return f(e,function(e){return u.test(e)?"xn--"+g(e):e})},toUnicode:function(e){return f(e,function(e){return l.test(e)?m(e.slice(4).toLowerCase()):e})}},t&&i)if(P.exports==t)i.exports=n;else for(a in n)n.hasOwnProperty(a)&&(t[a]=n[a]);else e.punycode=n}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],11:[function(e,t,i){t.exports=function(e,t,i,r){t=t||"&",i=i||"=";var n={};if("string"!=typeof e||0===e.length)return n;var a=/\+/g;e=e.split(t);var o=1e3;r&&"number"==typeof r.maxKeys&&(o=r.maxKeys);var s,l,u=e.length;0<o&&o<u&&(u=o);for(var c=0;c<u;++c){var d,h,p,f,m=e[c].replace(a,"%20"),g=m.indexOf(i);h=0<=g?(d=m.substr(0,g),m.substr(g+1)):(d=m,""),p=decodeURIComponent(d),f=decodeURIComponent(h),s=n,l=p,Object.prototype.hasOwnProperty.call(s,l)?y(n[p])?n[p].push(f):n[p]=[n[p],f]:n[p]=f}return n};var y=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},{}],12:[function(e,t,i){var a=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};t.exports=function(i,r,n,e){return r=r||"&",n=n||"=",null===i&&(i=void 0),"object"==typeof i?s(l(i),function(e){var t=encodeURIComponent(a(e))+n;return o(i[e])?s(i[e],function(e){return t+encodeURIComponent(a(e))}).join(r):t+encodeURIComponent(a(i[e]))}).join(r):e?encodeURIComponent(a(e))+n+encodeURIComponent(a(i)):""};var o=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function s(e,t){if(e.map)return e.map(t);for(var i=[],r=0;r<e.length;r++)i.push(t(e[r],r));return i}var l=Object.keys||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.push(i);return t}},{}],13:[function(e,t,i){i.decode=i.parse=e("./decode"),i.encode=i.stringify=e("./encode")},{"./decode":11,"./encode":12}],14:[function(e,t,i){var o=[new RegExp("^<h3[^>]*>This page contains the following errors:</h3><div[^>]*>(.+?)\n?</div>"),new RegExp("^(.+)\n")];i.failOnParseError=function(e){return function(e){var t;if(null===e)throw new Error("Parse error");var i,r="parsererror"===(i=e).documentElement.tagName&&"http://www.mozilla.org/newlayout/xml/parsererror.xml"===i.documentElement.namespaceURI?i.documentElement:("xml"===i.documentElement.tagName||"html"===i.documentElement.tagName)&&i.documentElement.childNodes&&0<i.documentElement.childNodes.length&&"parsererror"===i.documentElement.childNodes[0].nodeName?i.documentElement.childNodes[0]:"html"===i.documentElement.tagName&&i.documentElement.childNodes&&0<i.documentElement.childNodes.length&&"body"===i.documentElement.childNodes[0].nodeName&&i.documentElement.childNodes[0].childNodes&&i.documentElement.childNodes[0].childNodes.length&&"parsererror"===i.documentElement.childNodes[0].childNodes[0].nodeName?i.documentElement.childNodes[0].childNodes[0]:void 0;if(void 0!==r)throw t=function(e){var t,i,r,n,a=(t=e,i=new XMLSerializer,Array.prototype.map.call(t.childNodes,function(e){return i.serializeToString(e)}).join(""));for(r=0;r<o.length;r++)if(n=o[r].exec(a))return n[1]}(r)||"Parse error",new Error(t)}(e),e}},{}],15:[function(e,t,i){var R=e("punycode"),L=e("./util");function T(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}i.parse=a,i.resolve=function(e,t){return a(e,!1,!0).resolve(t)},i.resolveObject=function(e,t){return e?a(e,!1,!0).resolveObject(t):t},i.format=function(e){return L.isString(e)&&(e=a(e)),e instanceof T?e.format():T.prototype.format.call(e)},i.Url=T;var N=/^([a-z0-9.+-]+:)/i,r=/:[0-9]*$/,k=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,n=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),B=["'"].concat(n),F=["%","/","?",";","#"].concat(B),V=["/","?","#"],z=/^[+a-z0-9A-Z_-]{0,63}$/,U=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,G={javascript:!0,"javascript:":!0},$={javascript:!0,"javascript:":!0},H={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},W=e("querystring");function a(e,t,i){if(e&&L.isObject(e)&&e instanceof T)return e;var r=new T;return r.parse(e,t,i),r}T.prototype.parse=function(e,t,i){if(!L.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var r=e.indexOf("?"),n=-1!==r&&r<e.indexOf("#")?"?":"#",a=e.split(n);a[0]=a[0].replace(/\\/g,"/");var o=e=a.join(n);if(o=o.trim(),!i&&1===e.split("#").length){var s=k.exec(o);if(s)return this.path=o,this.href=o,this.pathname=s[1],s[2]?(this.search=s[2],this.query=t?W.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var l=N.exec(o);if(l){var u=(l=l[0]).toLowerCase();this.protocol=u,o=o.substr(l.length)}if(i||l||o.match(/^\/\/[^@\/]+@[^@\/]+/)){var c="//"===o.substr(0,2);!c||l&&$[l]||(o=o.substr(2),this.slashes=!0)}if(!$[l]&&(c||l&&!H[l])){for(var d,h,p=-1,f=0;f<V.length;f++)-1!==(m=o.indexOf(V[f]))&&(-1===p||m<p)&&(p=m);for(-1!==(h=-1===p?o.lastIndexOf("@"):o.lastIndexOf("@",p))&&(d=o.slice(0,h),o=o.slice(h+1),this.auth=decodeURIComponent(d)),p=-1,f=0;f<F.length;f++){var m;-1!==(m=o.indexOf(F[f]))&&(-1===p||m<p)&&(p=m)}-1===p&&(p=o.length),this.host=o.slice(0,p),o=o.slice(p),this.parseHost(),this.hostname=this.hostname||"";var g="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!g)for(var y=this.hostname.split(/\./),v=(f=0,y.length);f<v;f++){var _=y[f];if(_&&!_.match(z)){for(var C="",x=0,b=_.length;x<b;x++)127<_.charCodeAt(x)?C+="x":C+=_[x];if(!C.match(z)){var A=y.slice(0,f),S=y.slice(f+1),w=_.match(U);w&&(A.push(w[1]),S.unshift(w[2])),S.length&&(o="/"+S.join(".")+o),this.hostname=A.join(".");break}}}255<this.hostname.length?this.hostname="":this.hostname=this.hostname.toLowerCase(),g||(this.hostname=R.toASCII(this.hostname));var E=this.port?":"+this.port:"",T=this.hostname||"";this.host=T+E,this.href+=this.host,g&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==o[0]&&(o="/"+o))}if(!G[u])for(f=0,v=B.length;f<v;f++){var P=B[f];if(-1!==o.indexOf(P)){var M=encodeURIComponent(P);M===P&&(M=escape(P)),o=o.split(P).join(M)}}var D=o.indexOf("#");-1!==D&&(this.hash=o.substr(D),o=o.slice(0,D));var I=o.indexOf("?");if(-1!==I?(this.search=o.substr(I),this.query=o.substr(I+1),t&&(this.query=W.parse(this.query)),o=o.slice(0,I)):t&&(this.search="",this.query={}),o&&(this.pathname=o),H[u]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){E=this.pathname||"";var O=this.search||"";this.path=E+O}return this.href=this.format(),this},T.prototype.format=function(){var e=this.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var t=this.protocol||"",i=this.pathname||"",r=this.hash||"",n=!1,a="";this.host?n=e+this.host:this.hostname&&(n=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(n+=":"+this.port)),this.query&&L.isObject(this.query)&&Object.keys(this.query).length&&(a=W.stringify(this.query));var o=this.search||a&&"?"+a||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||H[t])&&!1!==n?(n="//"+(n||""),i&&"/"!==i.charAt(0)&&(i="/"+i)):n=n||"",r&&"#"!==r.charAt(0)&&(r="#"+r),o&&"?"!==o.charAt(0)&&(o="?"+o),t+n+(i=i.replace(/[?#]/g,function(e){return encodeURIComponent(e)}))+(o=o.replace("#","%23"))+r},T.prototype.resolve=function(e){return this.resolveObject(a(e,!1,!0)).format()},T.prototype.resolveObject=function(e){if(L.isString(e)){var t=new T;t.parse(e,!1,!0),e=t}for(var i=new T,r=Object.keys(this),n=0;n<r.length;n++){var a=r[n];i[a]=this[a]}if(i.hash=e.hash,""===e.href)return i.href=i.format(),i;if(e.slashes&&!e.protocol){for(var o=Object.keys(e),s=0;s<o.length;s++){var l=o[s];"protocol"!==l&&(i[l]=e[l])}return H[i.protocol]&&i.hostname&&!i.pathname&&(i.path=i.pathname="/"),i.href=i.format(),i}if(e.protocol&&e.protocol!==i.protocol){if(!H[e.protocol]){for(var u=Object.keys(e),c=0;c<u.length;c++){var d=u[c];i[d]=e[d]}return i.href=i.format(),i}if(i.protocol=e.protocol,e.host||$[e.protocol])i.pathname=e.pathname;else{for(var h=(e.pathname||"").split("/");h.length&&!(e.host=h.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==h[0]&&h.unshift(""),h.length<2&&h.unshift(""),i.pathname=h.join("/")}if(i.search=e.search,i.query=e.query,i.host=e.host||"",i.auth=e.auth,i.hostname=e.hostname||e.host,i.port=e.port,i.pathname||i.search){var p=i.pathname||"",f=i.search||"";i.path=p+f}return i.slashes=i.slashes||e.slashes,i.href=i.format(),i}var m=i.pathname&&"/"===i.pathname.charAt(0),g=e.host||e.pathname&&"/"===e.pathname.charAt(0),y=g||m||i.host&&e.pathname,v=y,_=i.pathname&&i.pathname.split("/")||[],C=(h=e.pathname&&e.pathname.split("/")||[],i.protocol&&!H[i.protocol]);if(C&&(i.hostname="",i.port=null,i.host&&(""===_[0]?_[0]=i.host:_.unshift(i.host)),i.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===h[0]?h[0]=e.host:h.unshift(e.host)),e.host=null),y=y&&(""===h[0]||""===_[0])),g)i.host=e.host||""===e.host?e.host:i.host,i.hostname=e.hostname||""===e.hostname?e.hostname:i.hostname,i.search=e.search,i.query=e.query,_=h;else if(h.length)(_=_||[]).pop(),_=_.concat(h),i.search=e.search,i.query=e.query;else if(!L.isNullOrUndefined(e.search))return C&&(i.hostname=i.host=_.shift(),(w=!!(i.host&&0<i.host.indexOf("@"))&&i.host.split("@"))&&(i.auth=w.shift(),i.host=i.hostname=w.shift())),i.search=e.search,i.query=e.query,L.isNull(i.pathname)&&L.isNull(i.search)||(i.path=(i.pathname?i.pathname:"")+(i.search?i.search:"")),i.href=i.format(),i;if(!_.length)return i.pathname=null,i.search?i.path="/"+i.search:i.path=null,i.href=i.format(),i;for(var x=_.slice(-1)[0],b=(i.host||e.host||1<_.length)&&("."===x||".."===x)||""===x,A=0,S=_.length;0<=S;S--)"."===(x=_[S])?_.splice(S,1):".."===x?(_.splice(S,1),A++):A&&(_.splice(S,1),A--);if(!y&&!v)for(;A--;)_.unshift("..");!y||""===_[0]||_[0]&&"/"===_[0].charAt(0)||_.unshift(""),b&&"/"!==_.join("/").substr(-1)&&_.push("");var w,E=""===_[0]||_[0]&&"/"===_[0].charAt(0);return C&&(i.hostname=i.host=E?"":_.length?_.shift():"",(w=!!(i.host&&0<i.host.indexOf("@"))&&i.host.split("@"))&&(i.auth=w.shift(),i.host=i.hostname=w.shift())),(y=y||i.host&&_.length)&&!E&&_.unshift(""),_.length?i.pathname=_.join("/"):(i.pathname=null,i.path=null),L.isNull(i.pathname)&&L.isNull(i.search)||(i.path=(i.pathname?i.pathname:"")+(i.search?i.search:"")),i.auth=e.auth||i.auth,i.slashes=i.slashes||e.slashes,i.href=i.format(),i},T.prototype.parseHost=function(){var e=this.host,t=r.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},{"./util":16,punycode:10,querystring:13}],16:[function(e,t,i){t.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},{}],17:[function(e,t,i){var r;r=function(){var a=function(e){var t=e.tagName;return"http://www.w3.org/1999/xhtml"===e.namespaceURI&&(t=t.toLowerCase()),t},o=function(e){return Array.prototype.map.call(e.childNodes,function(e){return t(e)}).join("")},t=function(e,t){var i,r=t&&t.rootNode;return"#document"===e.nodeName||"#document-fragment"===e.nodeName?o(e):e.tagName?function(e,t){var i,r,n="<"+a(e);return n+=(i=e,r=t,0<=Array.prototype.map.call(i.attributes||i.attrs,function(e){return e.name}).indexOf("xmlns")||!r&&i.namespaceURI===i.parentNode.namespaceURI?"":' xmlns="'+i.namespaceURI+'"'),Array.prototype.forEach.call(e.attributes||e.attrs,function(e){var t,i;n+=(i=(t=e).value," "+t.name+'="'+i.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")+'"')}),0<e.childNodes.length?(n+=">",n+=o(e),n+="</"+a(e)+">"):n+="/>",n}(e,r):"#text"===e.nodeName?((i=e).nodeValue||i.value||"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"):"#comment"===e.nodeName?"\x3c!--"+e.data.replace(/-/g,"-")+"--\x3e":"#cdata-section"===e.nodeName?"<![CDATA["+e.nodeValue+"]]>":void 0};return{serializeToString:function(e){return t(e,{rootNode:!0}).replace(/[\x00-\x08\x0B\x0C\x0E-\x1F]/g,"")}}},"object"==typeof t&&t.exports?t.exports=r():this.xmlserializer=r()},{}]},{},[1])(1);var RasterizeHTML=tmp$7.rasterizeHTML,defaultColor$2=Color.WHITE,defaultOutlineColor=Color.BLACK,defaultOutlineWidth=1;function PolylineOutlineMaterialProperty(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this._definitionChanged=new Event,this._color=void 0,this._colorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this.color=e.color,this.outlineColor=e.outlineColor,this.outlineWidth=e.outlineWidth}Object.defineProperties(PolylineOutlineMaterialProperty.prototype,{isConstant:{get:function(){return Property.isConstant(this._color)&&Property.isConstant(this._outlineColor)&&Property.isConstant(this._outlineWidth)}},definitionChanged:{get:function(){return this._definitionChanged}},color:createPropertyDescriptor("color"),outlineColor:createPropertyDescriptor("outlineColor"),outlineWidth:createPropertyDescriptor("outlineWidth")}),PolylineOutlineMaterialProperty.prototype.getType=function(e){return"PolylineOutline"},PolylineOutlineMaterialProperty.prototype.getValue=function(e,t){return defined(t)||(t={}),t.color=Property.getValueOrClonedDefault(this._color,e,defaultColor$2,t.color),t.outlineColor=Property.getValueOrClonedDefault(this._outlineColor,e,defaultOutlineColor,t.outlineColor),t.outlineWidth=Property.getValueOrDefault(this._outlineWidth,e,defaultOutlineWidth),t},PolylineOutlineMaterialProperty.prototype.equals=function(e){return this===e||e instanceof PolylineOutlineMaterialProperty&&Property.equals(this._color,e._color)&&Property.equals(this._outlineColor,e._outlineColor)&&Property.equals(this._outlineWidth,e._outlineWidth)};var LabelPrimitive=(Acr.prototype._init=function(){this.entity=this.earthCtrl.entities.add(this.options)},Acr.prototype.destory=function(){defined(this.entity)&&this.earthCtrl.entities.remove(this.entity)},Object.defineProperties(Acr.prototype,{text:{get:function(){return this.entity.label.text},set:function(e){this.entity.label.text=e}},position:{get:function(){return this.entity.position},set:function(e){this.entity.position=e}}}),Acr);function Acr(e,t){this.options={position:t.position,label:{text:t.labelText,font:"12pt monospace",style:LabelStyle$1.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:VerticalOrigin$1.BOTTOM,pixelOffset:new Cartesian2(0,-9),disableDepthTestDistance:Number.POSITIVE_INFINITY}},this.positions=t.positions,this.earthCtrl=e,this._init()}var PointsPrimitive=(Fcr.prototype._init=function(){this.earthCtrl.coreMap.scene.primitives.add(this.primitive)},Fcr.prototype.destory=function(){this.earthCtrl.coreMap.scene.primitives.remove(this.primitive)},Fcr.prototype.add=function(e){this.primitive.add({show:!0,position:e,color:this.options.color,pixelSize:this.options.pixelSize,disableDepthTestDistance:Number.POSITIVE_INFINITY})},Fcr.prototype.count=function(e){return this.primitive.length},Fcr.prototype.get=function(e){return this.primitive.get(e)},Fcr.prototype.set=function(e,t){this.primitive.get(e).position=t},Fcr);function Fcr(e,t){for(var i in this.primitive=new PointPrimitiveCollection,t.positions)t.positions.hasOwnProperty(i)&&this.primitive.add({show:!0,position:i,color:t.color,pixelSize:t.pixelSize,allowPicking:!1,disableDepthTestDistance:Number.POSITIVE_INFINITY,outlineColor:Geoworld.defaultValue(t.outlineColor,Geoworld.Color.WHITE),outlineWidth:Geoworld.defaultValue(t.outlineWidth,2)});this.earthCtrl=e,this.options=t,this._init()}var PolylinePrimitive=(Ocr.prototype._init=function(){var e=this;this.options.polyline.positions=new CallbackProperty(function(){return e.positions},!1),this.entity=this.earthCtrl.entities.add(this.options)},Ocr.prototype.destory=function(){defined(this.entity)&&this.earthCtrl.entities.remove(this.entity)},Ocr);function Ocr(e,t){this.options={polyline:{positions:[],arcType:ArcType$1.NONE,material:t.color,width:t.width}},this.positions=t.positions,this.earthCtrl=e,this._init()}var PolygonPrimitive=(Tcr.prototype._init=function(){var e=this;this.options.polygon.hierarchy=new CallbackProperty(function(){return{positions:e.positions}},!1),this.entity=this.earthCtrl.entities.add(this.options)},Tcr.prototype.destory=function(){null!==this.entity&&this.earthCtrl.entities.remove(this.entity)},Tcr);function Tcr(e,t){this.options={polygon:{show:!0,hierarchy:{positions:t.positions},material:t.color,width:t.width,outline:!0,outlineColor:t.outlineColor,disableDepthTestDistance:1e4}},this.positions=t.positions,this.earthCtrl=e,this._init()}var RenderObjectFactory=function(){};RenderObjectFactory.createPointPrimitive=function(e,t){return e.entities.add(t)},RenderObjectFactory.createLabelPrimitive=function(e,t){return new LabelPrimitive(e,t)},RenderObjectFactory.createPointsPrimitive=function(e,t){return new PointsPrimitive(e,t)},RenderObjectFactory.createPolylinePrimitive=function(e,t){return new PolylinePrimitive(e,t)},RenderObjectFactory.createPolygonPrimitive=function(e,t){return new PolygonPrimitive(e,t)};var SceneMode$2={MORPHING:0,COLUMBUS_VIEW:1,SCENE2D:2,SCENE3D:3,getMorphTime:function(e){return e===SceneMode$2.SCENE3D?1:e!==SceneMode$2.MORPHING?0:void 0}},SceneMode$3=Object.freeze(SceneMode$2),CameraFlightPath$1={};function getAltitude$1(e,t,i){var r,n,a;if(e instanceof PerspectiveFrustum){var o=Math.tan(.5*e.fovy);return r=e.near,n=e.near*o,a=e.aspectRatio*n,Math.max(t*r/a,i*r/n)}return e instanceof PerspectiveOffCenterFrustum?(r=e.near,n=e.top,a=e.right,Math.max(t*r/a,i*r/n)):Math.max(t,i)}var scratchCart$1=new Cartesian3,scratchCart2$3=new Cartesian3;function createPitchFunction$1(n,a,o,e){if(defined(e)&&o(.5)>e){var s=o(0),l=o(1),t=o(.5),u=t-s,c=t-l;return function(e){var t=o(e);if(e<=.5){var i=(t-s)/u;return CesiumMath.lerp(n,-CesiumMath.PI_OVER_TWO,i)}var r=(t-l)/c;return CesiumMath.lerp(-CesiumMath.PI_OVER_TWO,a,1-r)}}return function(e){return CesiumMath.lerp(n,a,e)}}function createHeightFunction$1(e,t,i,r,n){var a=n,o=Math.max(i,r);if(!defined(a)){var s=e.position,l=t,u=e.up,c=e.right,d=e.frustum,h=Cartesian3.subtract(s,l,scratchCart$1),p=Cartesian3.magnitude(Cartesian3.multiplyByScalar(u,Cartesian3.dot(h,u),scratchCart2$3)),f=Cartesian3.magnitude(Cartesian3.multiplyByScalar(c,Cartesian3.dot(h,c),scratchCart2$3));a=Math.min(.2*getAltitude$1(d,p,f),1e9)}if(o<a){var m=-Math.pow(1e6*(a-i),1/8),g=Math.pow(1e6*(a-r),1/8);return function(e){var t=e*(g-m)+m;return-Math.pow(t,8)/1e6+a}}return function(e){return CesiumMath.lerp(i,r,e)}}function adjustAngleForLERP$1(e,t){return CesiumMath.equalsEpsilon(e,CesiumMath.TWO_PI,CesiumMath.EPSILON11)&&(e=0),t>e+Math.PI?e+=CesiumMath.TWO_PI:t<e-Math.PI&&(e-=CesiumMath.TWO_PI),e}var scratchStart$1=new Cartesian3;function createUpdateCV$1(e,i,r,n,a,o,t){var s=e.camera,l=Cartesian3.clone(s.position,scratchStart$1),u=s.pitch,c=adjustAngleForLERP$1(s.heading,n),d=adjustAngleForLERP$1(s.roll,o),h=createHeightFunction$1(s,r,l.z,r.z,t);return function(e){var t=e.time/i;s.setView({orientation:{heading:CesiumMath.lerp(c,n,t),pitch:CesiumMath.lerp(u,a,t),roll:CesiumMath.lerp(d,o,t)}}),Cartesian2.lerp(l,r,t,s.position),s.position.z=h(t)}}function useLongestFlight$1(e,t){e.longitude<t.longitude?e.longitude+=CesiumMath.TWO_PI:t.longitude+=CesiumMath.TWO_PI}function useShortestFlight$1(e,t){var i=e.longitude-t.longitude;i<-CesiumMath.PI?e.longitude+=CesiumMath.TWO_PI:i>CesiumMath.PI&&(t.longitude+=CesiumMath.TWO_PI)}var scratchStartCart$1=new Cartographic,scratchEndCart$1=new Cartographic;function createUpdate3D$1(e,r,t,n,i,a,o,s,l,u){var c=e.camera,d=e.mapProjection.ellipsoid,h=Cartographic.clone(c.positionCartographic,scratchStartCart$1),p=c.pitch,f=adjustAngleForLERP$1(c.heading,n),m=adjustAngleForLERP$1(c.roll,a),g=d.cartesianToCartographic(t,scratchEndCart$1);h.longitude=CesiumMath.zeroToTwoPi(h.longitude),g.longitude=CesiumMath.zeroToTwoPi(g.longitude);var y=!1;if(defined(s)){var v=CesiumMath.zeroToTwoPi(s),_=Math.min(h.longitude,g.longitude),C=Math.max(h.longitude,g.longitude),x=_<=v&&v<=C;if(defined(l)){var b=Math.abs(h.longitude-g.longitude),A=CesiumMath.TWO_PI-b;(x?b:A)<(x?A:b)*l&&!x&&(y=!0)}else x||(y=!0)}y?useLongestFlight$1(h,g):useShortestFlight$1(h,g);var S,w,E,T,P=createHeightFunction$1(c,t,h.height,g.height,o),M=createPitchFunction$1(p,i,P,u);return S=h.longitude,w=g.longitude,E=h.latitude,T=g.latitude,function(e){var t=e.time/r,i=Cartesian3.fromRadians(CesiumMath.lerp(S,w,t),CesiumMath.lerp(E,T,t),P(t));c.setView({destination:i,orientation:{heading:CesiumMath.lerp(f,n,t),pitch:M(t),roll:CesiumMath.lerp(m,a,t)}})}}function createUpdate2D$1(e,o,s,l,t,i,r){var u=e.camera,c=Cartesian3.clone(u.position,scratchStart$1),d=adjustAngleForLERP$1(u.heading,l),n=u.frustum.right-u.frustum.left,h=createHeightFunction$1(u,s,n,s.z,r);return function(e){var t=e.time/o;u.setView({orientation:{heading:CesiumMath.lerp(d,l,t)}}),Cartesian2.lerp(c,s,t,u.position);var i=h(t),r=u.frustum,n=r.top/r.right,a=.5*(i-(r.right-r.left));r.right+=a,r.left-=a,r.top=n*r.right,r.bottom=-r.top}}var scratchCartographic$6=new Cartographic,scratchDestination$1=new Cartesian3;function emptyFlight$1(e,t){return{startObject:{},stopObject:{},duration:0,complete:e,cancel:t}}function wrapCallback$1(e,t){return function(){"function"==typeof t&&t(),e.enableInputs=!0}}CameraFlightPath$1.createTween=function(e,t){var i=(t=defaultValue(t,defaultValue.EMPTY_OBJECT)).destination,r=e.mode;if(r===SceneMode$3.MORPHING)return emptyFlight$1();var n=defaultValue(t.convert,!0),a=e.mapProjection,o=a.ellipsoid,s=t.maximumHeight,l=t.flyOverLongitude,u=t.flyOverLongitudeWeight,c=t.pitchAdjustHeight,d=t.easingFunction;n&&r!==SceneMode$3.SCENE3D&&(o.cartesianToCartographic(i,scratchCartographic$6),i=a.project(scratchCartographic$6,scratchDestination$1));var h=e.camera,p=t.endTransform;defined(p)&&h._setTransform(p);var f=t.duration;defined(f)||(f=Math.ceil(Cartesian3.distance(h.position,i)/1e6)+2,f=Math.min(f,3));var m=defaultValue(t.heading,0),g=defaultValue(t.pitch,-CesiumMath.PI_OVER_TWO),y=defaultValue(t.roll,0),v=e.screenSpaceCameraController;v.enableInputs=!1;var _=wrapCallback$1(v,t.complete),C=wrapCallback$1(v,t.cancel),x=h.frustum,b=e.mode===SceneMode$3.SCENE2D;if(b=(b=(b=(b=b&&Cartesian2.equalsEpsilon(h.position,i,CesiumMath.EPSILON6))&&CesiumMath.equalsEpsilon(Math.max(x.right-x.left,x.top-x.bottom),i.z,CesiumMath.EPSILON6))||e.mode!==SceneMode$3.SCENE2D&&Cartesian3.equalsEpsilon(i,h.position,CesiumMath.EPSILON10))&&CesiumMath.equalsEpsilon(CesiumMath.negativePiToPi(m),CesiumMath.negativePiToPi(h.heading),CesiumMath.EPSILON10)&&CesiumMath.equalsEpsilon(CesiumMath.negativePiToPi(g),CesiumMath.negativePiToPi(h.pitch),CesiumMath.EPSILON10)&&CesiumMath.equalsEpsilon(CesiumMath.negativePiToPi(y),CesiumMath.negativePiToPi(h.roll),CesiumMath.EPSILON10))return emptyFlight$1(_,C);var A=new Array(4);if(A[SceneMode$3.SCENE2D]=createUpdate2D$1,A[SceneMode$3.SCENE3D]=createUpdate3D$1,A[SceneMode$3.COLUMBUS_VIEW]=createUpdateCV$1,f<=0){return emptyFlight$1(function(){A[r](e,1,i,m,g,y,s,l,u,c)({time:1}),"function"==typeof _&&_()},C)}var S=A[r](e,f,i,m,g,y,s,l,u,c);if(!defined(d)){var w=h.positionCartographic.height;d=(r===SceneMode$3.SCENE3D?o.cartesianToCartographic(i).height:i.z)<w&&11500<w?EasingFunction$1.CUBIC_OUT:EasingFunction$1.QUINTIC_IN_OUT}return{duration:f,easingFunction:d,startObject:{time:0},stopObject:{time:f},update:S,complete:_,cancel:C}};var MapMode2D$2={ROTATE:0,INFINITE_SCROLL:1},MapMode2D$3=Object.freeze(MapMode2D$2);function Camera$1(e){this._scene=e,this._transform=Matrix4.clone(Matrix4.IDENTITY),this._invTransform=Matrix4.clone(Matrix4.IDENTITY),this._actualTransform=Matrix4.clone(Matrix4.IDENTITY),this._actualInvTransform=Matrix4.clone(Matrix4.IDENTITY),this._transformChanged=!1,this.position=new Cartesian3,this._position=new Cartesian3,this._positionWC=new Cartesian3,this._positionCartographic=new Cartographic,this._oldPositionWC=void 0,this.positionWCDeltaMagnitude=0,this.positionWCDeltaMagnitudeLastFrame=0,this.timeSinceMoved=0,this._lastMovedTimestamp=0,this.direction=new Cartesian3,this._direction=new Cartesian3,this._directionWC=new Cartesian3,this.up=new Cartesian3,this._up=new Cartesian3,this._upWC=new Cartesian3,this.right=new Cartesian3,this._right=new Cartesian3,this._rightWC=new Cartesian3,this.frustum=new PerspectiveFrustum,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=CesiumMath.toRadians(60),this.defaultMoveAmount=1e5,this.defaultLookAmount=Math.PI/60,this.defaultRotateAmount=Math.PI/3600,this.defaultZoomAmount=1e5,this.constrainedAxis=void 0,this.maximumZoomFactor=1.5,this._moveStart=new Event,this._moveEnd=new Event,this._changed=new Event,this._changedPosition=void 0,this._changedDirection=void 0,this._changedFrustum=void 0,this.percentageChanged=.5,this._viewMatrix=new Matrix4,this._invViewMatrix=new Matrix4,updateViewMatrix$1(this),this._mode=SceneMode$3.SCENE3D,this._modeChanged=!0;var t=e.mapProjection;this._projection=t,this._maxCoord=t.project(new Cartographic(Math.PI,CesiumMath.PI_OVER_TWO)),this._max2Dfrustum=void 0,rectangleCameraPosition3D$1(this,Camera$1.DEFAULT_VIEW_RECTANGLE,this.position,!0);var i=Cartesian3.magnitude(this.position);i+=i*Camera$1.DEFAULT_VIEW_FACTOR,Cartesian3.normalize(this.position,this.position),Cartesian3.multiplyByScalar(this.position,i,this.position)}function updateViewMatrix$1(e){Matrix4.computeView(e._position,e._direction,e._up,e._right,e._viewMatrix),Matrix4.multiply(e._viewMatrix,e._actualInvTransform,e._viewMatrix),Matrix4.inverseTransformation(e._viewMatrix,e._invViewMatrix)}function updateCameraDeltas$1(e){if(defined(e._oldPositionWC)){e.positionWCDeltaMagnitudeLastFrame=e.positionWCDeltaMagnitude;var t=Cartesian3.subtract(e.positionWC,e._oldPositionWC,e._oldPositionWC);e.positionWCDeltaMagnitude=Cartesian3.magnitude(t),e._oldPositionWC=Cartesian3.clone(e.positionWC,e._oldPositionWC),0<e.positionWCDeltaMagnitude?(e.timeSinceMoved=0,e._lastMovedTimestamp=getTimestamp$1()):e.timeSinceMoved=Math.max(getTimestamp$1()-e._lastMovedTimestamp,0)/1e3}else e._oldPositionWC=Cartesian3.clone(e.positionWC,e._oldPositionWC)}function convertTransformForColumbusView$1(e){Transforms.basisTo2D(e._projection,e._transform,e._actualTransform)}Camera$1.TRANSFORM_2D=new Matrix4(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),Camera$1.TRANSFORM_2D_INVERSE=Matrix4.inverseTransformation(Camera$1.TRANSFORM_2D,new Matrix4),Camera$1.DEFAULT_VIEW_RECTANGLE=Rectangle.fromDegrees(-95,-20,-70,90),Camera$1.DEFAULT_VIEW_FACTOR=.5,Camera$1.DEFAULT_OFFSET=new HeadingPitchRange(0,-CesiumMath.PI_OVER_FOUR,0),Camera$1.prototype.canPreloadFlight=function(){return defined(this._currentFlight)&&this._mode!==SceneMode$3.SCENE2D},Camera$1.prototype._updateCameraChanged=function(){var e=this;if(updateCameraDeltas$1(e),0!==e._changed.numberOfListeners){var t=e.percentageChanged;if(e._mode!==SceneMode$3.SCENE2D){if(!defined(e._changedDirection))return e._changedPosition=Cartesian3.clone(e.positionWC,e._changedPosition),void(e._changedDirection=Cartesian3.clone(e.directionWC,e._changedDirection));var i,r=CesiumMath.acosClamped(Cartesian3.dot(e.directionWC,e._changedDirection));i=defined(e.frustum.fovy)?r/(.5*e.frustum.fovy):r;var n=Cartesian3.distance(e.positionWC,e._changedPosition)/e.positionCartographic.height;(t<i||t<n)&&(e._changed.raiseEvent(Math.max(i,n)),e._changedPosition=Cartesian3.clone(e.positionWC,e._changedPosition),e._changedDirection=Cartesian3.clone(e.directionWC,e._changedDirection))}else{if(!defined(e._changedFrustum))return e._changedPosition=Cartesian3.clone(e.position,e._changedPosition),void(e._changedFrustum=e.frustum.clone());var a,o=e.position,s=e._changedPosition,l=e.frustum,u=e._changedFrustum,c=o.x+l.left,d=o.x+l.right,h=s.x+u.left,p=s.x+u.right,f=o.y+l.bottom,m=o.y+l.top,g=s.y+u.bottom,y=s.y+u.top,v=Math.max(c,h),_=Math.min(d,p),C=Math.max(f,g),x=Math.min(m,y);if(_<=v||m<=C)a=1;else{var b=u;c<h&&p<d&&f<g&&y<m&&(b=l),a=1-(_-v)*(x-C)/((b.right-b.left)*(b.top-b.bottom))}t<a&&(e._changed.raiseEvent(a),e._changedPosition=Cartesian3.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone(e._changedFrustum))}}};var scratchCartographic$7=new Cartographic,scratchCartesian3Projection$2=new Cartesian3,scratchCartesian3$8=new Cartesian3,scratchCartesian4Origin$1=new Cartesian4,scratchCartesian4NewOrigin$1=new Cartesian4,scratchCartesian4NewXAxis$1=new Cartesian4,scratchCartesian4NewYAxis$1=new Cartesian4,scratchCartesian4NewZAxis$1=new Cartesian4;function convertTransformFor2D$1(e){var t=e._projection,i=t.ellipsoid,r=Matrix4.getColumn(e._transform,3,scratchCartesian4Origin$1),n=i.cartesianToCartographic(r,scratchCartographic$7),a=t.project(n,scratchCartesian3Projection$2),o=scratchCartesian4NewOrigin$1;o.x=a.z,o.y=a.x,o.z=a.y,o.w=1;var s=Cartesian4.clone(Cartesian4.UNIT_X,scratchCartesian4NewZAxis$1),l=Cartesian4.add(Matrix4.getColumn(e._transform,0,scratchCartesian3$8),r,scratchCartesian3$8);i.cartesianToCartographic(l,n),t.project(n,a);var u=scratchCartesian4NewXAxis$1;u.x=a.z,u.y=a.x,u.z=a.y,u.w=0,Cartesian3.subtract(u,o,u),u.x=0;var c=scratchCartesian4NewYAxis$1;if(Cartesian3.magnitudeSquared(u)>CesiumMath.EPSILON10)Cartesian3.cross(s,u,c);else{var d=Cartesian4.add(Matrix4.getColumn(e._transform,1,scratchCartesian3$8),r,scratchCartesian3$8);i.cartesianToCartographic(d,n),t.project(n,a),c.x=a.z,c.y=a.x,c.z=a.y,c.w=0,Cartesian3.subtract(c,o,c),c.x=0,Cartesian3.magnitudeSquared(c)<CesiumMath.EPSILON10&&(Cartesian4.clone(Cartesian4.UNIT_Y,u),Cartesian4.clone(Cartesian4.UNIT_Z,c))}Cartesian3.cross(c,s,u),Cartesian3.normalize(u,u),Cartesian3.cross(s,u,c),Cartesian3.normalize(c,c),Matrix4.setColumn(e._actualTransform,0,u,e._actualTransform),Matrix4.setColumn(e._actualTransform,1,c,e._actualTransform),Matrix4.setColumn(e._actualTransform,2,s,e._actualTransform),Matrix4.setColumn(e._actualTransform,3,o,e._actualTransform)}var scratchCartesian$3=new Cartesian3;function updateMembers$1(e){var t=e._mode,i=!1,r=0;t===SceneMode$3.SCENE2D&&(i=(r=e.frustum.right-e.frustum.left)!==e._positionCartographic.height);var n=e._position,a=!Cartesian3.equals(n,e.position)||i;a&&(n=Cartesian3.clone(e.position,e._position));var o=e._direction,s=!Cartesian3.equals(o,e.direction);s&&(Cartesian3.normalize(e.direction,e.direction),o=Cartesian3.clone(e.direction,e._direction));var l=e._up,u=!Cartesian3.equals(l,e.up);u&&(Cartesian3.normalize(e.up,e.up),l=Cartesian3.clone(e.up,e._up));var c=e._right,d=!Cartesian3.equals(c,e.right);d&&(Cartesian3.normalize(e.right,e.right),c=Cartesian3.clone(e.right,e._right));var h=e._transformChanged||e._modeChanged;e._transformChanged=!1,h&&(Matrix4.inverseTransformation(e._transform,e._invTransform),e._mode===SceneMode$3.COLUMBUS_VIEW||e._mode===SceneMode$3.SCENE2D?Matrix4.equals(Matrix4.IDENTITY,e._transform)?Matrix4.clone(Camera$1.TRANSFORM_2D,e._actualTransform):e._mode===SceneMode$3.COLUMBUS_VIEW?convertTransformForColumbusView$1(e):convertTransformFor2D$1(e):Matrix4.clone(e._transform,e._actualTransform),Matrix4.inverseTransformation(e._actualTransform,e._actualInvTransform),e._modeChanged=!1);var p=e._actualTransform;if(a||h)if(e._positionWC=Matrix4.multiplyByPoint(p,n,e._positionWC),t===SceneMode$3.SCENE3D||t===SceneMode$3.MORPHING)e._positionCartographic=e._projection.ellipsoid.cartesianToCartographic(e._positionWC,e._positionCartographic);else{var f=scratchCartesian$3;f.x=e._positionWC.y,f.y=e._positionWC.z,f.z=e._positionWC.x,t===SceneMode$3.SCENE2D&&(f.z=r),e._projection.unproject(f,e._positionCartographic)}if(s||u||d){var m=Cartesian3.dot(o,Cartesian3.cross(l,c,scratchCartesian$3));if(Math.abs(1-m)>CesiumMath.EPSILON2){var g=1/Cartesian3.magnitudeSquared(l),y=Cartesian3.dot(l,o)*g,v=Cartesian3.multiplyByScalar(o,y,scratchCartesian$3);l=Cartesian3.normalize(Cartesian3.subtract(l,v,e._up),e._up),Cartesian3.clone(l,e.up),c=Cartesian3.cross(o,l,e._right),Cartesian3.clone(c,e.right)}}(s||h)&&(e._directionWC=Matrix4.multiplyByPointAsVector(p,o,e._directionWC),Cartesian3.normalize(e._directionWC,e._directionWC)),(u||h)&&(e._upWC=Matrix4.multiplyByPointAsVector(p,l,e._upWC),Cartesian3.normalize(e._upWC,e._upWC)),(d||h)&&(e._rightWC=Matrix4.multiplyByPointAsVector(p,c,e._rightWC),Cartesian3.normalize(e._rightWC,e._rightWC)),(a||s||u||d||h)&&updateViewMatrix$1(e)}function getHeading$1(e,t){var i;return i=CesiumMath.equalsEpsilon(Math.abs(e.z),1,CesiumMath.EPSILON3)?Math.atan2(t.y,t.x)-CesiumMath.PI_OVER_TWO:Math.atan2(e.y,e.x)-CesiumMath.PI_OVER_TWO,CesiumMath.TWO_PI-CesiumMath.zeroToTwoPi(i)}function getPitch$1(e){return CesiumMath.PI_OVER_TWO-CesiumMath.acosClamped(e.z)}function getRoll$1(e,t,i){var r=0;return CesiumMath.equalsEpsilon(Math.abs(e.z),1,CesiumMath.EPSILON3)||(r=Math.atan2(-i.z,t.z),r=CesiumMath.zeroToTwoPi(r+CesiumMath.TWO_PI)),r}var scratchHPRMatrix1$1=new Matrix4,scratchHPRMatrix2$1=new Matrix4;Object.defineProperties(Camera$1.prototype,{transform:{get:function(){return this._transform}},inverseTransform:{get:function(){return updateMembers$1(this),this._invTransform}},viewMatrix:{get:function(){return updateMembers$1(this),this._viewMatrix}},inverseViewMatrix:{get:function(){return updateMembers$1(this),this._invViewMatrix}},positionCartographic:{get:function(){return updateMembers$1(this),this._positionCartographic}},positionWC:{get:function(){return updateMembers$1(this),this._positionWC}},directionWC:{get:function(){return updateMembers$1(this),this._directionWC}},upWC:{get:function(){return updateMembers$1(this),this._upWC}},rightWC:{get:function(){return updateMembers$1(this),this._rightWC}},heading:{get:function(){if(this._mode!==SceneMode$3.MORPHING){var e=this._projection.ellipsoid,t=Matrix4.clone(this._transform,scratchHPRMatrix1$1),i=Transforms.eastNorthUpToFixedFrame(this.positionWC,e,scratchHPRMatrix2$1);this._setTransform(i);var r=getHeading$1(this.direction,this.up);return this._setTransform(t),r}}},pitch:{get:function(){if(this._mode!==SceneMode$3.MORPHING){var e=this._projection.ellipsoid,t=Matrix4.clone(this._transform,scratchHPRMatrix1$1),i=Transforms.eastNorthUpToFixedFrame(this.positionWC,e,scratchHPRMatrix2$1);this._setTransform(i);var r=getPitch$1(this.direction);return this._setTransform(t),r}}},roll:{get:function(){if(this._mode!==SceneMode$3.MORPHING){var e=this._projection.ellipsoid,t=Matrix4.clone(this._transform,scratchHPRMatrix1$1),i=Transforms.eastNorthUpToFixedFrame(this.positionWC,e,scratchHPRMatrix2$1);this._setTransform(i);var r=getRoll$1(this.direction,this.up,this.right);return this._setTransform(t),r}}},moveStart:{get:function(){return this._moveStart}},moveEnd:{get:function(){return this._moveEnd}},changed:{get:function(){return this._changed}}}),Camera$1.prototype.update=function(e){var t=!1;if(e!==this._mode&&(this._mode=e,this._modeChanged=e!==SceneMode$3.MORPHING,t=this._mode===SceneMode$3.SCENE2D),t){var i=this._max2Dfrustum=this.frustum.clone(),r=i.top/i.right;i.right=2*this._maxCoord.x,i.left=-i.right,i.top=r*i.right,i.bottom=-i.top}this._mode===SceneMode$3.SCENE2D&&clampMove2D$1(this,this.position)};var setTransformPosition$1=new Cartesian3,setTransformUp$1=new Cartesian3,setTransformDirection$1=new Cartesian3;Camera$1.prototype._setTransform=function(e){var t=Cartesian3.clone(this.positionWC,setTransformPosition$1),i=Cartesian3.clone(this.upWC,setTransformUp$1),r=Cartesian3.clone(this.directionWC,setTransformDirection$1);Matrix4.clone(e,this._transform),this._transformChanged=!0,updateMembers$1(this);var n=this._actualInvTransform;Matrix4.multiplyByPoint(n,t,this.position),Matrix4.multiplyByPointAsVector(n,r,this.direction),Matrix4.multiplyByPointAsVector(n,i,this.up),Cartesian3.cross(this.direction,this.up,this.right),updateMembers$1(this)};var scratchAdjustOrtghographicFrustumMousePosition$1=new Cartesian2,pickGlobeScratchRay$1=new Ray,scratchRayIntersection$1=new Cartesian3,scratchDepthIntersection$1=new Cartesian3;Camera$1.prototype._adjustOrthographicFrustum=function(e){if(this.frustum instanceof OrthographicFrustum&&(e||!(this._positionCartographic.height<15e4)))if(Matrix4.equals(Matrix4.IDENTITY,this.transform)){var t,i,r=this._scene,n=r.globe;if(defined(n)){var a=scratchAdjustOrtghographicFrustumMousePosition$1;a.x=r.drawingBufferWidth/2,a.y=r.drawingBufferHeight/2;var o=this.getPickRay(a,pickGlobeScratchRay$1);if(t=n.pickWorldCoordinates(o,r,scratchRayIntersection$1),r.pickPositionSupported&&(i=r.pickPositionWorldCoordinates(a,scratchDepthIntersection$1)),defined(t)&&defined(i)){var s=defined(i)?Cartesian3.distance(i,this.positionWC):Number.POSITIVE_INFINITY,l=defined(t)?Cartesian3.distance(t,this.positionWC):Number.POSITIVE_INFINITY;this.frustum.width=Math.min(s,l)}else defined(i)?this.frustum.width=Cartesian3.distance(i,this.positionWC):defined(t)&&(this.frustum.width=Cartesian3.distance(t,this.positionWC))}if(!defined(n)||!defined(t)&&!defined(i)){var u=Math.max(this.positionCartographic.height,0);this.frustum.width=u}}else this.frustum.width=Cartesian3.magnitude(this.position)};var scratchSetViewCartesian$1=new Cartesian3,scratchSetViewTransform1$1=new Matrix4,scratchSetViewTransform2$1=new Matrix4,scratchSetViewQuaternion$1=new Quaternion,scratchSetViewMatrix3$1=new Matrix3,scratchSetViewCartographic$1=new Cartographic;function setView3D$1(e,t,i){var r=Matrix4.clone(e.transform,scratchSetViewTransform1$1),n=Transforms.eastNorthUpToFixedFrame(t,e._projection.ellipsoid,scratchSetViewTransform2$1);e._setTransform(n),Cartesian3.clone(Cartesian3.ZERO,e.position),i.heading=i.heading-CesiumMath.PI_OVER_TWO;var a=Quaternion.fromHeadingPitchRoll(i,scratchSetViewQuaternion$1),o=Matrix3.fromQuaternion(a,scratchSetViewMatrix3$1);Matrix3.getColumn(o,0,e.direction),Matrix3.getColumn(o,2,e.up),Cartesian3.cross(e.direction,e.up,e.right),e._setTransform(r),e._adjustOrthographicFrustum(!0)}function setViewCV$1(e,t,i,r){var n=Matrix4.clone(e.transform,scratchSetViewTransform1$1);if(e._setTransform(Matrix4.IDENTITY),!Cartesian3.equals(t,e.positionWC)){if(r){var a=e._projection,o=a.ellipsoid.cartesianToCartographic(t,scratchSetViewCartographic$1);t=a.project(o,scratchSetViewCartesian$1)}Cartesian3.clone(t,e.position)}i.heading=i.heading-CesiumMath.PI_OVER_TWO;var s=Quaternion.fromHeadingPitchRoll(i,scratchSetViewQuaternion$1),l=Matrix3.fromQuaternion(s,scratchSetViewMatrix3$1);Matrix3.getColumn(l,0,e.direction),Matrix3.getColumn(l,2,e.up),Cartesian3.cross(e.direction,e.up,e.right),e._setTransform(n),e._adjustOrthographicFrustum(!0)}function setView2D$1(e,t,i,r){var n=Matrix4.clone(e.transform,scratchSetViewTransform1$1);if(e._setTransform(Matrix4.IDENTITY),!Cartesian3.equals(t,e.positionWC)){if(r){var a=e._projection,o=a.ellipsoid.cartesianToCartographic(t,scratchSetViewCartographic$1);t=a.project(o,scratchSetViewCartesian$1)}Cartesian2.clone(t,e.position);var s=.5*-t.z,l=-s,u=e.frustum;if(s<l){var c=u.top/u.right;u.right=l,u.left=s,u.top=u.right*c,u.bottom=-u.top}}if(e._scene.mapMode2D===MapMode2D$3.ROTATE){i.heading=i.heading-CesiumMath.PI_OVER_TWO,i.pitch=-CesiumMath.PI_OVER_TWO,i.roll=0;var d=Quaternion.fromHeadingPitchRoll(i,scratchSetViewQuaternion$1),h=Matrix3.fromQuaternion(d,scratchSetViewMatrix3$1);Matrix3.getColumn(h,2,e.up),Cartesian3.cross(e.direction,e.up,e.right)}e._setTransform(n)}var scratchToHPRDirection$1=new Cartesian3,scratchToHPRUp$1=new Cartesian3,scratchToHPRRight$1=new Cartesian3;function directionUpToHeadingPitchRoll$1(e,t,i,r){var n=Cartesian3.clone(i.direction,scratchToHPRDirection$1),a=Cartesian3.clone(i.up,scratchToHPRUp$1);if(e._scene.mode===SceneMode$3.SCENE3D){var o=e._projection.ellipsoid,s=Transforms.eastNorthUpToFixedFrame(t,o,scratchHPRMatrix1$1),l=Matrix4.inverseTransformation(s,scratchHPRMatrix2$1);Matrix4.multiplyByPointAsVector(l,n,n),Matrix4.multiplyByPointAsVector(l,a,a)}var u=Cartesian3.cross(n,a,scratchToHPRRight$1);return r.heading=getHeading$1(n,a),r.pitch=getPitch$1(n),r.roll=getRoll$1(n,a,u),r}var scratchSetViewOptions$1={destination:void 0,orientation:{direction:void 0,up:void 0,heading:void 0,pitch:void 0,roll:void 0},convert:void 0,endTransform:void 0},scratchHpr$1=new HeadingPitchRoll;Camera$1.prototype.setView=function(e){var t=defaultValue((e=defaultValue(e,defaultValue.EMPTY_OBJECT)).orientation,defaultValue.EMPTY_OBJECT),i=this._mode;if(i!==SceneMode$3.MORPHING){defined(e.endTransform)&&this._setTransform(e.endTransform);var r=defaultValue(e.convert,!0),n=defaultValue(e.destination,Cartesian3.clone(this.positionWC,scratchSetViewCartesian$1));defined(n)&&defined(n.west)&&(n=this.getRectangleCameraCoordinates(n,scratchSetViewCartesian$1),r=!1),defined(t.direction)&&(t=directionUpToHeadingPitchRoll$1(this,n,t,scratchSetViewOptions$1.orientation)),scratchHpr$1.heading=defaultValue(t.heading,0),scratchHpr$1.pitch=defaultValue(t.pitch,-CesiumMath.PI_OVER_TWO),scratchHpr$1.roll=defaultValue(t.roll,0),i===SceneMode$3.SCENE3D?setView3D$1(this,n,scratchHpr$1):i===SceneMode$3.SCENE2D?setView2D$1(this,n,scratchHpr$1,r):setViewCV$1(this,n,scratchHpr$1,r)}};var pitchScratch$1=new Cartesian3;function clampMove2D$1(e,t){var i,r,n=e._scene.mapMode2D===MapMode2D$3.ROTATE,a=e._maxCoord.x,o=e._maxCoord.y;i=n?-(r=a):(r=t.x-2*a,t.x+2*a),t.x>a&&(t.x=r),t.x<-a&&(t.x=i),t.y>o&&(t.y=o),t.y<-o&&(t.y=-o)}Camera$1.prototype.flyHome=function(e){var t=this._mode;if(t===SceneMode$3.MORPHING&&this._scene.completeMorph(),t===SceneMode$3.SCENE2D)this.flyTo({destination:Camera$1.DEFAULT_VIEW_RECTANGLE,duration:e,endTransform:Matrix4.IDENTITY});else if(t===SceneMode$3.SCENE3D){var i=this.getRectangleCameraCoordinates(Camera$1.DEFAULT_VIEW_RECTANGLE),r=Cartesian3.magnitude(i);r+=r*Camera$1.DEFAULT_VIEW_FACTOR,Cartesian3.normalize(i,i),Cartesian3.multiplyByScalar(i,r,i),this.flyTo({destination:i,duration:e,endTransform:Matrix4.IDENTITY})}else if(t===SceneMode$3.COLUMBUS_VIEW){var n=this._projection.ellipsoid.maximumRadius,a=new Cartesian3(0,-1,1);a=Cartesian3.multiplyByScalar(Cartesian3.normalize(a,a),5*n,a),this.flyTo({destination:a,duration:e,orientation:{heading:0,pitch:-Math.acos(Cartesian3.normalize(a,pitchScratch$1).z),roll:0},endTransform:Matrix4.IDENTITY,convert:!1})}},Camera$1.prototype.worldToCameraCoordinates=function(e,t){return defined(t)||(t=new Cartesian4),updateMembers$1(this),Matrix4.multiplyByVector(this._actualInvTransform,e,t)},Camera$1.prototype.worldToCameraCoordinatesPoint=function(e,t){return defined(t)||(t=new Cartesian3),updateMembers$1(this),Matrix4.multiplyByPoint(this._actualInvTransform,e,t)},Camera$1.prototype.worldToCameraCoordinatesVector=function(e,t){return defined(t)||(t=new Cartesian3),updateMembers$1(this),Matrix4.multiplyByPointAsVector(this._actualInvTransform,e,t)},Camera$1.prototype.cameraToWorldCoordinates=function(e,t){return defined(t)||(t=new Cartesian4),updateMembers$1(this),Matrix4.multiplyByVector(this._actualTransform,e,t)},Camera$1.prototype.cameraToWorldCoordinatesPoint=function(e,t){return defined(t)||(t=new Cartesian3),updateMembers$1(this),Matrix4.multiplyByPoint(this._actualTransform,e,t)},Camera$1.prototype.cameraToWorldCoordinatesVector=function(e,t){return defined(t)||(t=new Cartesian3),updateMembers$1(this),Matrix4.multiplyByPointAsVector(this._actualTransform,e,t)};var moveScratch$1=new Cartesian3,cameraGroundPosition$1;Camera$1.prototype.move=function(e,t){var i=this.position;Cartesian3.multiplyByScalar(e,t,moveScratch$1);var r=this._scene.screenSpaceCameraController.defaultCollisionRayWidth,n=new Cartesian3;Cartesian3.clone(i,n),Cartesian3.add(n,moveScratch$1,n),this.modelColliDetection(n,void 0,r)||(this.groundRoaming(n)||Cartesian3.add(i,moveScratch$1,i),this._mode===SceneMode$3.SCENE2D&&clampMove2D$1(this,i),this._adjustOrthographicFrustum(!0))},Camera$1.prototype.moveForward=function(e){e=defaultValue(e,this.defaultMoveAmount),this._mode===SceneMode$3.SCENE2D?zoom2D$1(this,e):this.move(this.direction,e)},Camera$1.prototype.moveBackward=function(e){e=defaultValue(e,this.defaultMoveAmount),this._mode===SceneMode$3.SCENE2D?zoom2D$1(this,-e):this.move(this.direction,-e)},Camera$1.prototype.moveUp=function(e){e=defaultValue(e,this.defaultMoveAmount),this.move(this.up,e)},Camera$1.prototype.moveDown=function(e){e=defaultValue(e,this.defaultMoveAmount),this.move(this.up,-e)},Camera$1.prototype.moveRight=function(e){e=defaultValue(e,this.defaultMoveAmount),this.move(this.right,e)},Camera$1.prototype.moveLeft=function(e){e=defaultValue(e,this.defaultMoveAmount),this.move(this.right,-e)},Camera$1.prototype.lookLeft=function(e){e=defaultValue(e,this.defaultLookAmount),this._mode!==SceneMode$3.SCENE2D&&this.look(this.up,-e)},Camera$1.prototype.lookRight=function(e){e=defaultValue(e,this.defaultLookAmount),this._mode!==SceneMode$3.SCENE2D&&this.look(this.up,e)},Camera$1.prototype.lookUp=function(e){e=defaultValue(e,this.defaultLookAmount),this._mode!==SceneMode$3.SCENE2D&&this.look(this.right,-e)},Camera$1.prototype.lookDown=function(e){e=defaultValue(e,this.defaultLookAmount),this._mode!==SceneMode$3.SCENE2D&&this.look(this.right,e)};var lookScratchQuaternion$1=new Quaternion,lookScratchMatrix$1=new Matrix3;Camera$1.prototype.look=function(e,t){var i=defaultValue(t,this.defaultLookAmount),r=Quaternion.fromAxisAngle(e,-i,lookScratchQuaternion$1),n=Matrix3.fromQuaternion(r,lookScratchMatrix$1),a=this.direction,o=this.up,s=this.right;Matrix3.multiplyByVector(n,a,a),Matrix3.multiplyByVector(n,o,o),Matrix3.multiplyByVector(n,s,s)},Camera$1.prototype.twistLeft=function(e){e=defaultValue(e,this.defaultLookAmount),this.look(this.direction,e)},Camera$1.prototype.twistRight=function(e){e=defaultValue(e,this.defaultLookAmount),this.look(this.direction,-e)};var rotateScratchQuaternion$1=new Quaternion,rotateScratchMatrix$1=new Matrix3;Camera$1.prototype.rotate=function(e,t){var i=defaultValue(t,this.defaultRotateAmount),r=Quaternion.fromAxisAngle(e,-i,rotateScratchQuaternion$1),n=Matrix3.fromQuaternion(r,rotateScratchMatrix$1);Matrix3.multiplyByVector(n,this.position,this.position),Matrix3.multiplyByVector(n,this.direction,this.direction),Matrix3.multiplyByVector(n,this.up,this.up),Cartesian3.cross(this.direction,this.up,this.right),Cartesian3.cross(this.right,this.direction,this.up),this._adjustOrthographicFrustum(!1)},Camera$1.prototype.rotateDown=function(e){rotateVertical$1(this,e=defaultValue(e,this.defaultRotateAmount))},Camera$1.prototype.rotateUp=function(e){rotateVertical$1(this,-(e=defaultValue(e,this.defaultRotateAmount)))};var rotateVertScratchP$1=new Cartesian3,rotateVertScratchA$1=new Cartesian3,rotateVertScratchTan$1=new Cartesian3,rotateVertScratchNegate$1=new Cartesian3;function rotateVertical$1(e,t){var i=e.position;if(defined(e.constrainedAxis)&&!Cartesian3.equalsEpsilon(e.position,Cartesian3.ZERO,CesiumMath.EPSILON2)){var r=Cartesian3.normalize(i,rotateVertScratchP$1),n=Cartesian3.equalsEpsilon(r,e.constrainedAxis,CesiumMath.EPSILON2),a=Cartesian3.equalsEpsilon(r,Cartesian3.negate(e.constrainedAxis,rotateVertScratchNegate$1),CesiumMath.EPSILON2);if(n||a)(n&&t<0||a&&0<t)&&e.rotate(e.right,t);else{var o=Cartesian3.normalize(e.constrainedAxis,rotateVertScratchA$1),s=Cartesian3.dot(r,o),l=CesiumMath.acosClamped(s);0<t&&l<t&&(t=l-CesiumMath.EPSILON4),s=Cartesian3.dot(r,Cartesian3.negate(o,rotateVertScratchNegate$1)),l=CesiumMath.acosClamped(s),t<0&&l<-t&&(t=-l+CesiumMath.EPSILON4);var u=Cartesian3.cross(o,r,rotateVertScratchTan$1);e.rotate(u,t)}}else e.rotate(e.right,t)}function rotateHorizontal$1(e,t){defined(e.constrainedAxis)?e.rotate(e.constrainedAxis,t):e.rotate(e.up,t)}function zoom2D$1(e,t){var i,r=e.frustum;if(t*=.5,Math.abs(r.top)+Math.abs(r.bottom)>Math.abs(r.left)+Math.abs(r.right)){var n=r.top-t,a=r.bottom+t,o=e._maxCoord.y;e._scene.mapMode2D===MapMode2D$3.ROTATE&&(o*=e.maximumZoomFactor),o<a&&(n=-(a=o)),n<=a&&(a=-(n=1)),i=r.right/r.top,r.top=n,r.bottom=a,r.right=r.top*i,r.left=-r.right}else{var s=r.right-t,l=r.left+t,u=e._maxCoord.x;e._scene.mapMode2D===MapMode2D$3.ROTATE&&(u*=e.maximumZoomFactor),u<s&&(l=-(s=u)),s<=l&&(l=-(s=1)),i=r.top/r.right,r.right=s,r.left=l,r.top=r.right*i,r.bottom=-r.top}}function zoom3D$1(e,t){e.move(e.direction,t)}Camera$1.prototype.rotateRight=function(e){rotateHorizontal$1(this,-(e=defaultValue(e,this.defaultRotateAmount)))},Camera$1.prototype.rotateLeft=function(e){rotateHorizontal$1(this,e=defaultValue(e,this.defaultRotateAmount))},Camera$1.prototype.zoomIn=function(e){e=defaultValue(e,this.defaultZoomAmount),this._mode===SceneMode$3.SCENE2D?zoom2D$1(this,e):zoom3D$1(this,e)},Camera$1.prototype.zoomOut=function(e){e=defaultValue(e,this.defaultZoomAmount),this._mode===SceneMode$3.SCENE2D?zoom2D$1(this,-e):zoom3D$1(this,-e)},Camera$1.prototype.getMagnitude=function(){return this._mode===SceneMode$3.SCENE3D?Cartesian3.magnitude(this.position):this._mode===SceneMode$3.COLUMBUS_VIEW?Math.abs(this.position.z):this._mode===SceneMode$3.SCENE2D?Math.max(this.frustum.right-this.frustum.left,this.frustum.top-this.frustum.bottom):void 0};var scratchLookAtMatrix4$1=new Matrix4;Camera$1.prototype.lookAt=function(e,t){var i=Transforms.eastNorthUpToFixedFrame(e,Ellipsoid.WGS84,scratchLookAtMatrix4$1);this.lookAtTransform(i,t)};var scratchLookAtHeadingPitchRangeOffset$1=new Cartesian3,scratchLookAtHeadingPitchRangeQuaternion1$1=new Quaternion,scratchLookAtHeadingPitchRangeQuaternion2$1=new Quaternion,scratchHeadingPitchRangeMatrix3$1=new Matrix3;function offsetFromHeadingPitchRange$1(e,t,i){t=CesiumMath.clamp(t,-CesiumMath.PI_OVER_TWO,CesiumMath.PI_OVER_TWO),e=CesiumMath.zeroToTwoPi(e)-CesiumMath.PI_OVER_TWO;var r=Quaternion.fromAxisAngle(Cartesian3.UNIT_Y,-t,scratchLookAtHeadingPitchRangeQuaternion1$1),n=Quaternion.fromAxisAngle(Cartesian3.UNIT_Z,-e,scratchLookAtHeadingPitchRangeQuaternion2$1),a=Quaternion.multiply(n,r,n),o=Matrix3.fromQuaternion(a,scratchHeadingPitchRangeMatrix3$1),s=Cartesian3.clone(Cartesian3.UNIT_X,scratchLookAtHeadingPitchRangeOffset$1);return Matrix3.multiplyByVector(o,s,s),Cartesian3.negate(s,s),Cartesian3.multiplyByScalar(s,i,s),s}Camera$1.prototype.lookAtTransform=function(e,t){if(this._setTransform(e),defined(t)){var i;if(i=defined(t.heading)?offsetFromHeadingPitchRange$1(t.heading,t.pitch,t.range):t,this._mode===SceneMode$3.SCENE2D){Cartesian2.clone(Cartesian2.ZERO,this.position),Cartesian3.negate(i,this.up),this.up.z=0,Cartesian3.magnitudeSquared(this.up)<CesiumMath.EPSILON10&&Cartesian3.clone(Cartesian3.UNIT_Y,this.up),Cartesian3.normalize(this.up,this.up),this._setTransform(Matrix4.IDENTITY),Cartesian3.negate(Cartesian3.UNIT_Z,this.direction),Cartesian3.cross(this.direction,this.up,this.right),Cartesian3.normalize(this.right,this.right);var r=this.frustum,n=r.top/r.right;return r.right=.5*Cartesian3.magnitude(i),r.left=-r.right,r.top=n*r.right,r.bottom=-r.top,void this._setTransform(e)}Cartesian3.clone(i,this.position),Cartesian3.negate(this.position,this.direction),Cartesian3.normalize(this.direction,this.direction),Cartesian3.cross(this.direction,Cartesian3.UNIT_Z,this.right),Cartesian3.magnitudeSquared(this.right)<CesiumMath.EPSILON10&&Cartesian3.clone(Cartesian3.UNIT_X,this.right),Cartesian3.normalize(this.right,this.right),Cartesian3.cross(this.right,this.direction,this.up),Cartesian3.normalize(this.up,this.up),this._adjustOrthographicFrustum(!0)}};var viewRectangle3DCartographic1$1=new Cartographic,viewRectangle3DCartographic2$1=new Cartographic,viewRectangle3DNorthEast$1=new Cartesian3,viewRectangle3DSouthWest$1=new Cartesian3,viewRectangle3DNorthWest$1=new Cartesian3,viewRectangle3DSouthEast$1=new Cartesian3,viewRectangle3DNorthCenter$1=new Cartesian3,viewRectangle3DSouthCenter$1=new Cartesian3,viewRectangle3DCenter$1=new Cartesian3,viewRectangle3DEquator$1=new Cartesian3,defaultRF$1={direction:new Cartesian3,right:new Cartesian3,up:new Cartesian3},viewRectangle3DEllipsoidGeodesic$1;function computeD$1(e,t,i,r){return Math.abs(Cartesian3.dot(t,i))/r-Cartesian3.dot(e,i)}function rectangleCameraPosition3D$1(e,t,i,r){var n=e._projection.ellipsoid,a=r?e:defaultRF$1,o=t.north,s=t.south,l=t.east,u=t.west;l<u&&(l+=CesiumMath.TWO_PI);var c,d=.5*(u+l);if(s<-CesiumMath.PI_OVER_TWO+CesiumMath.RADIANS_PER_DEGREE&&o>CesiumMath.PI_OVER_TWO-CesiumMath.RADIANS_PER_DEGREE)c=0;else{var h=viewRectangle3DCartographic1$1;h.longitude=d,h.latitude=o,h.height=0;var p=viewRectangle3DCartographic2$1;p.longitude=d,p.latitude=s,p.height=0;var f=viewRectangle3DEllipsoidGeodesic$1;defined(f)&&f.ellipsoid===n||(viewRectangle3DEllipsoidGeodesic$1=f=new EllipsoidGeodesic(void 0,void 0,n)),f.setEndPoints(h,p),c=f.interpolateUsingFraction(.5,viewRectangle3DCartographic1$1).latitude}var m=viewRectangle3DCartographic1$1;m.longitude=d,m.latitude=c,m.height=0;var g=n.cartographicToCartesian(m,viewRectangle3DCenter$1),y=viewRectangle3DCartographic1$1;y.longitude=l,y.latitude=o;var v=n.cartographicToCartesian(y,viewRectangle3DNorthEast$1);y.longitude=u;var _=n.cartographicToCartesian(y,viewRectangle3DNorthWest$1);y.longitude=d;var C=n.cartographicToCartesian(y,viewRectangle3DNorthCenter$1);y.latitude=s;var x=n.cartographicToCartesian(y,viewRectangle3DSouthCenter$1);y.longitude=l;var b=n.cartographicToCartesian(y,viewRectangle3DSouthEast$1);y.longitude=u;var A=n.cartographicToCartesian(y,viewRectangle3DSouthWest$1);Cartesian3.subtract(_,g,_),Cartesian3.subtract(b,g,b),Cartesian3.subtract(v,g,v),Cartesian3.subtract(A,g,A),Cartesian3.subtract(C,g,C),Cartesian3.subtract(x,g,x);var S=n.geodeticSurfaceNormal(g,a.direction);Cartesian3.negate(S,S);var w=Cartesian3.cross(S,Cartesian3.UNIT_Z,a.right);Cartesian3.normalize(w,w);var E,T=Cartesian3.cross(w,S,a.up);if(e.frustum instanceof OrthographicFrustum){var P,M,D=Math.max(Cartesian3.distance(v,_),Cartesian3.distance(b,A)),I=Math.max(Cartesian3.distance(v,b),Cartesian3.distance(_,A)),O=e.frustum._offCenterFrustum.right/e.frustum._offCenterFrustum.top,R=I*O;R<D?M=(P=D)/O:(M=I,P=R),E=Math.max(P,M)}else{var L=Math.tan(.5*e.frustum.fovy),N=e.frustum.aspectRatio*L;if(E=Math.max(computeD$1(S,T,_,L),computeD$1(S,T,b,L),computeD$1(S,T,v,L),computeD$1(S,T,A,L),computeD$1(S,T,C,L),computeD$1(S,T,x,L),computeD$1(S,w,_,N),computeD$1(S,w,b,N),computeD$1(S,w,v,N),computeD$1(S,w,A,N),computeD$1(S,w,C,N),computeD$1(S,w,x,N)),s<0&&0<o){var k=viewRectangle3DCartographic1$1;k.longitude=u,k.latitude=0,k.height=0;var B=n.cartographicToCartesian(k,viewRectangle3DEquator$1);Cartesian3.subtract(B,g,B),E=Math.max(E,computeD$1(S,T,B,L),computeD$1(S,w,B,N)),k.longitude=l,B=n.cartographicToCartesian(k,viewRectangle3DEquator$1),Cartesian3.subtract(B,g,B),E=Math.max(E,computeD$1(S,T,B,L),computeD$1(S,w,B,N))}}return Cartesian3.add(g,Cartesian3.multiplyByScalar(S,-E,viewRectangle3DEquator$1),i)}var viewRectangleCVCartographic$1=new Cartographic,viewRectangleCVNorthEast$1=new Cartesian3,viewRectangleCVSouthWest$1=new Cartesian3;function rectangleCameraPositionColumbusView$1(e,t,i){var r=e._projection;t.west>t.east&&(t=Rectangle.MAX_VALUE);var n=e._actualTransform,a=e._actualInvTransform,o=viewRectangleCVCartographic$1;o.longitude=t.east,o.latitude=t.north;var s=r.project(o,viewRectangleCVNorthEast$1);Matrix4.multiplyByPoint(n,s,s),Matrix4.multiplyByPoint(a,s,s),o.longitude=t.west,o.latitude=t.south;var l=r.project(o,viewRectangleCVSouthWest$1);if(Matrix4.multiplyByPoint(n,l,l),Matrix4.multiplyByPoint(a,l,l),i.x=.5*(s.x-l.x)+l.x,i.y=.5*(s.y-l.y)+l.y,defined(e.frustum.fovy)){var u=Math.tan(.5*e.frustum.fovy),c=e.frustum.aspectRatio*u;i.z=.5*Math.max((s.x-l.x)/c,(s.y-l.y)/u)}else{var d=s.x-l.x,h=s.y-l.y;i.z=Math.max(d,h)}return i}var viewRectangle2DCartographic$1=new Cartographic,viewRectangle2DNorthEast$1=new Cartesian3,viewRectangle2DSouthWest$1=new Cartesian3;function rectangleCameraPosition2D$1(e,t,i){var r=e._projection,n=t.east;t.west>t.east&&(e._scene.mapMode2D===MapMode2D$3.INFINITE_SCROLL?n+=CesiumMath.TWO_PI:n=(t=Rectangle.MAX_VALUE).east);var a=viewRectangle2DCartographic$1;a.longitude=n,a.latitude=t.north;var o=r.project(a,viewRectangle2DNorthEast$1);a.longitude=t.west,a.latitude=t.south;var s,l,u=r.project(a,viewRectangle2DSouthWest$1),c=.5*Math.abs(o.x-u.x),d=.5*Math.abs(o.y-u.y),h=e.frustum.right/e.frustum.top,p=d*h;return p<c?l=(s=c)/h:(l=d,s=p),d=Math.max(2*s,2*l),i.x=.5*(o.x-u.x)+u.x,i.y=.5*(o.y-u.y)+u.y,(a=r.unproject(i,a)).height=d,i=r.project(a,i)}Camera$1.prototype.getRectangleCameraCoordinates=function(e,t){var i=this._mode;return defined(t)||(t=new Cartesian3),i===SceneMode$3.SCENE3D?rectangleCameraPosition3D$1(this,e,t):i===SceneMode$3.COLUMBUS_VIEW?rectangleCameraPositionColumbusView$1(this,e,t):i===SceneMode$3.SCENE2D?rectangleCameraPosition2D$1(this,e,t):void 0};var pickEllipsoid3DRay$1=new Ray;function pickEllipsoid3D$1(e,t,i,r){i=defaultValue(i,Ellipsoid.WGS84);var n=e.getPickRay(t,pickEllipsoid3DRay$1),a=IntersectionTests.rayEllipsoid(n,i);if(a){var o=0<a.start?a.start:a.stop;return Ray.getPoint(n,o,r)}}var pickEllipsoid2DRay$1=new Ray;function pickMap2D$1(e,t,i,r){var n=e.getPickRay(t,pickEllipsoid2DRay$1).origin;n=Cartesian3.fromElements(n.y,n.z,0,n);var a=i.unproject(n);if(!(a.latitude<-CesiumMath.PI_OVER_TWO||a.latitude>CesiumMath.PI_OVER_TWO))return i.ellipsoid.cartographicToCartesian(a,r)}var pickEllipsoidCVRay$1=new Ray;function pickMapColumbusView$1(e,t,i,r){var n=e.getPickRay(t,pickEllipsoidCVRay$1),a=-n.origin.x/n.direction.x;Ray.getPoint(n,a,r);var o=i.unproject(new Cartesian3(r.y,r.z,0));if(!(o.latitude<-CesiumMath.PI_OVER_TWO||o.latitude>CesiumMath.PI_OVER_TWO||o.longitude<-Math.PI||o.longitude>Math.PI))return i.ellipsoid.cartographicToCartesian(o,r)}Camera$1.prototype.pickEllipsoid=function(e,t,i){var r=this._scene.canvas;if(0!==r.clientWidth&&0!==r.clientHeight){if(defined(i)||(i=new Cartesian3),t=defaultValue(t,Ellipsoid.WGS84),this._mode===SceneMode$3.SCENE3D)i=pickEllipsoid3D$1(this,e,t,i);else if(this._mode===SceneMode$3.SCENE2D)i=pickMap2D$1(this,e,this._projection,i);else{if(this._mode!==SceneMode$3.COLUMBUS_VIEW)return;i=pickMapColumbusView$1(this,e,this._projection,i)}return i}};var pickPerspCenter$1=new Cartesian3,pickPerspXDir$1=new Cartesian3,pickPerspYDir$1=new Cartesian3;function getPickRayPerspective$1(e,t,i){var r=e._scene.canvas,n=r.clientWidth,a=r.clientHeight,o=Math.tan(.5*e.frustum.fovy),s=e.frustum.aspectRatio*o,l=e.frustum.near,u=2/n*t.x-1,c=2/a*(a-t.y)-1,d=e.positionWC;Cartesian3.clone(d,i.origin);var h=Cartesian3.multiplyByScalar(e.directionWC,l,pickPerspCenter$1);Cartesian3.add(d,h,h);var p=Cartesian3.multiplyByScalar(e.rightWC,u*l*s,pickPerspXDir$1),f=Cartesian3.multiplyByScalar(e.upWC,c*l*o,pickPerspYDir$1),m=Cartesian3.add(h,p,i.direction);return Cartesian3.add(m,f,m),Cartesian3.subtract(m,d,m),Cartesian3.normalize(m,m),i}var scratchDirection$1=new Cartesian3;function getPickRayOrthographic$1(e,t,i){var r=e._scene.canvas,n=r.clientWidth,a=r.clientHeight,o=e.frustum;defined(o._offCenterFrustum)&&(o=o._offCenterFrustum);var s=2/n*t.x-1;s*=.5*(o.right-o.left);var l=2/a*(a-t.y)-1;l*=.5*(o.top-o.bottom);var u=i.origin;return Cartesian3.clone(e.position,u),Cartesian3.multiplyByScalar(e.right,s,scratchDirection$1),Cartesian3.add(scratchDirection$1,u,u),Cartesian3.multiplyByScalar(e.up,l,scratchDirection$1),Cartesian3.add(scratchDirection$1,u,u),Cartesian3.clone(e.directionWC,i.direction),e._mode!==SceneMode$3.COLUMBUS_VIEW&&e._mode!==SceneMode$3.SCENE2D||Cartesian3.fromElements(i.origin.z,i.origin.x,i.origin.y,i.origin),i}Camera$1.prototype.getPickRay=function(e,t){defined(t)||(t=new Ray);var i=this.frustum;return defined(i.aspectRatio)&&defined(i.fov)&&defined(i.near)?getPickRayPerspective$1(this,e,t):getPickRayOrthographic$1(this,e,t)};var scratchToCenter$2=new Cartesian3,scratchProj$1=new Cartesian3;Camera$1.prototype.distanceToBoundingSphere=function(e){var t=Cartesian3.subtract(this.positionWC,e.center,scratchToCenter$2),i=Cartesian3.multiplyByScalar(this.directionWC,Cartesian3.dot(t,this.directionWC),scratchProj$1);return Math.max(0,Cartesian3.magnitude(i)-e.radius)};var scratchPixelSize$1=new Cartesian2;function createAnimationTemplateCV$1(i,r,e,t,n,a){var o=Cartesian3.clone(r);return e.y>t?o.y-=e.y-t:e.y<-t&&(o.y+=-t-e.y),e.z>n?o.z-=e.z-n:e.z<-n&&(o.z+=-n-e.z),{easingFunction:EasingFunction$1.EXPONENTIAL_OUT,startObject:{time:0},stopObject:{time:1},duration:a,update:function(e){var t=Cartesian3.lerp(r,o,e.time,new Cartesian3);i.worldToCameraCoordinatesPoint(t,i.position)}}}Camera$1.prototype.getPixelSize=function(e,t,i){var r=this.distanceToBoundingSphere(e),n=this.frustum.getPixelDimensions(t,i,r,this._scene.pixelRatio,scratchPixelSize$1);return Math.max(n.x,n.y)};var normalScratch$3=new Cartesian3,centerScratch$1=new Cartesian3,posScratch$1=new Cartesian3,scratchCartesian3Subtract$1=new Cartesian3;function createAnimationCV$1(e,t){var i=e.position,r=e.direction,n=e.worldToCameraCoordinatesVector(Cartesian3.UNIT_X,normalScratch$3),a=-Cartesian3.dot(n,i)/Cartesian3.dot(n,r),o=Cartesian3.add(i,Cartesian3.multiplyByScalar(r,a,centerScratch$1),centerScratch$1);e.cameraToWorldCoordinatesPoint(o,o),i=e.cameraToWorldCoordinatesPoint(e.position,posScratch$1);var s=Math.tan(.5*e.frustum.fovy),l=e.frustum.aspectRatio*s,u=Cartesian3.magnitude(Cartesian3.subtract(i,o,scratchCartesian3Subtract$1)),c=l*u,d=s*u,h=e._maxCoord.x,p=e._maxCoord.y,f=Math.max(c-h,h),m=Math.max(d-p,p);if(i.z<-f||i.z>f||i.y<-m||i.y>m){var g=o.y<-f||o.y>f,y=o.z<-m||o.z>m;if(g||y)return createAnimationTemplateCV$1(e,i,o,f,m,t)}}Camera$1.prototype.createCorrectPositionTween=function(e){if(this._mode===SceneMode$3.COLUMBUS_VIEW)return createAnimationCV$1(this,e)};var scratchFlyToDestination$1=new Cartesian3,newOptions$1={destination:void 0,heading:void 0,pitch:void 0,roll:void 0,duration:void 0,complete:void 0,cancel:void 0,endTransform:void 0,maximumHeight:void 0,easingFunction:void 0};function distanceToBoundingSphere3D$1(e,t){var i=e.frustum,r=Math.tan(.5*i.fovy),n=i.aspectRatio*r;return Math.max(t/n,t/r)}function distanceToBoundingSphere2D$1(e,t){var i,r,n=e.frustum;defined(n._offCenterFrustum)&&(n=n._offCenterFrustum);var a=n.right/n.top,o=t*a;return o<t?r=(i=t)/a:(r=t,i=o),1.5*Math.max(i,r)}Camera$1.prototype.cancelFlight=function(){defined(this._currentFlight)&&(this._currentFlight.cancelTween(),this._currentFlight=void 0)},Camera$1.prototype.flyTo=function(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).destination;if(this._mode!==SceneMode$3.MORPHING){this.cancelFlight();var i=defaultValue(e.orientation,defaultValue.EMPTY_OBJECT);if(defined(i.direction)&&(i=directionUpToHeadingPitchRoll$1(this,t,i,scratchSetViewOptions$1.orientation)),defined(e.duration)&&e.duration<=0){var r=scratchSetViewOptions$1;return r.destination=e.destination,r.orientation.heading=i.heading,r.orientation.pitch=i.pitch,r.orientation.roll=i.roll,r.convert=e.convert,r.endTransform=e.endTransform,this.setView(r),void("function"==typeof e.complete&&e.complete())}var n=defined(t.west);n&&(t=this.getRectangleCameraCoordinates(t,scratchFlyToDestination$1));var a,o=this;newOptions$1.destination=t,newOptions$1.heading=i.heading,newOptions$1.pitch=i.pitch,newOptions$1.roll=i.roll,newOptions$1.duration=e.duration,newOptions$1.complete=function(){a===o._currentFlight&&(o._currentFlight=void 0),defined(e.complete)&&e.complete()},newOptions$1.cancel=e.cancel,newOptions$1.endTransform=e.endTransform,newOptions$1.convert=!n&&e.convert,newOptions$1.maximumHeight=e.maximumHeight,newOptions$1.pitchAdjustHeight=e.pitchAdjustHeight,newOptions$1.flyOverLongitude=e.flyOverLongitude,newOptions$1.flyOverLongitudeWeight=e.flyOverLongitudeWeight,newOptions$1.easingFunction=e.easingFunction;var s=this._scene,l=CameraFlightPath$1.createTween(s,newOptions$1);if(0!==l.duration){a=s.tweens.add(l),this._currentFlight=a;var u=this._scene.preloadFlightCamera;this._mode!==SceneMode$3.SCENE2D&&(defined(u)||(u=Camera$1.clone(this)),u.setView({destination:t,orientation:i}),this._scene.preloadFlightCullingVolume=u.frustum.computeCullingVolume(u.positionWC,u.directionWC,u.upWC))}else"function"==typeof l.complete&&l.complete()}};var MINIMUM_ZOOM$1=100;function adjustBoundingSphereOffset$1(e,t,i){i=HeadingPitchRange.clone(defined(i)?i:Camera$1.DEFAULT_OFFSET);var r=e._scene.screenSpaceCameraController.minimumZoomDistance,n=e._scene.screenSpaceCameraController.maximumZoomDistance,a=i.range;if(!defined(a)||0===a){var o=t.radius;0===o?i.range=MINIMUM_ZOOM$1:e.frustum instanceof OrthographicFrustum||e._mode===SceneMode$3.SCENE2D?i.range=distanceToBoundingSphere2D$1(e,o):i.range=distanceToBoundingSphere3D$1(e,o),i.range=CesiumMath.clamp(i.range,r,n)}return i}Camera$1.prototype.viewBoundingSphere=function(e,t){t=adjustBoundingSphereOffset$1(this,e,t),this.lookAt(e.center,t)};var scratchflyToBoundingSphereTransform$1=new Matrix4,scratchflyToBoundingSphereDestination$1=new Cartesian3,scratchflyToBoundingSphereDirection$1=new Cartesian3,scratchflyToBoundingSphereUp$1=new Cartesian3,scratchflyToBoundingSphereRight$1=new Cartesian3,scratchFlyToBoundingSphereCart4$1=new Cartesian4,scratchFlyToBoundingSphereQuaternion$1=new Quaternion,scratchFlyToBoundingSphereMatrix3$1=new Matrix3;Camera$1.prototype.flyToBoundingSphere=function(e,t){t=defaultValue(t,defaultValue.EMPTY_OBJECT);var i=this._mode===SceneMode$3.SCENE2D||this._mode===SceneMode$3.COLUMBUS_VIEW;this._setTransform(Matrix4.IDENTITY);var r,n=adjustBoundingSphereOffset$1(this,e,t.offset);r=i?Cartesian3.multiplyByScalar(Cartesian3.UNIT_Z,n.range,scratchflyToBoundingSphereDestination$1):offsetFromHeadingPitchRange$1(n.heading,n.pitch,n.range);var a,o,s=Transforms.eastNorthUpToFixedFrame(e.center,Ellipsoid.WGS84,scratchflyToBoundingSphereTransform$1);if(Matrix4.multiplyByPoint(s,r,r),!i){if(a=Cartesian3.subtract(e.center,r,scratchflyToBoundingSphereDirection$1),Cartesian3.normalize(a,a),o=Matrix4.multiplyByPointAsVector(s,Cartesian3.UNIT_Z,scratchflyToBoundingSphereUp$1),1-Math.abs(Cartesian3.dot(a,o))<CesiumMath.EPSILON6){var l=Quaternion.fromAxisAngle(a,n.heading,scratchFlyToBoundingSphereQuaternion$1),u=Matrix3.fromQuaternion(l,scratchFlyToBoundingSphereMatrix3$1);Cartesian3.fromCartesian4(Matrix4.getColumn(s,1,scratchFlyToBoundingSphereCart4$1),o),Matrix3.multiplyByVector(u,o,o)}var c=Cartesian3.cross(a,o,scratchflyToBoundingSphereRight$1);Cartesian3.cross(c,a,o),Cartesian3.normalize(o,o)}this.flyTo({destination:r,orientation:{direction:a,up:o},duration:t.duration,complete:t.complete,cancel:t.cancel,endTransform:t.endTransform,maximumHeight:t.maximumHeight,easingFunction:t.easingFunction,flyOverLongitude:t.flyOverLongitude,flyOverLongitudeWeight:t.flyOverLongitudeWeight,pitchAdjustHeight:t.pitchAdjustHeight})};var scratchCartesian3_1$1=new Cartesian3,scratchCartesian3_2$1=new Cartesian3,scratchCartesian3_3$1=new Cartesian3,scratchCartesian3_4$1=new Cartesian3,horizonPoints$1=[new Cartesian3,new Cartesian3,new Cartesian3,new Cartesian3];function computeHorizonQuad$1(e,t){var i,r,n=t.radii,a=e.positionWC,o=Cartesian3.multiplyComponents(t.oneOverRadii,a,scratchCartesian3_1$1),s=Cartesian3.magnitude(o),l=Cartesian3.normalize(o,scratchCartesian3_2$1);r=Cartesian3.equalsEpsilon(l,Cartesian3.UNIT_Z,CesiumMath.EPSILON10)?(i=new Cartesian3(0,1,0),new Cartesian3(0,0,1)):(i=Cartesian3.normalize(Cartesian3.cross(Cartesian3.UNIT_Z,l,scratchCartesian3_3$1),scratchCartesian3_3$1),Cartesian3.normalize(Cartesian3.cross(l,i,scratchCartesian3_4$1),scratchCartesian3_4$1));var u=Math.sqrt(Cartesian3.magnitudeSquared(o)-1),c=Cartesian3.multiplyByScalar(l,1/s,scratchCartesian3_1$1),d=u/s,h=Cartesian3.multiplyByScalar(i,d,scratchCartesian3_2$1),p=Cartesian3.multiplyByScalar(r,d,scratchCartesian3_3$1),f=Cartesian3.add(c,p,horizonPoints$1[0]);Cartesian3.subtract(f,h,f),Cartesian3.multiplyComponents(n,f,f);var m=Cartesian3.subtract(c,p,horizonPoints$1[1]);Cartesian3.subtract(m,h,m),Cartesian3.multiplyComponents(n,m,m);var g=Cartesian3.subtract(c,p,horizonPoints$1[2]);Cartesian3.add(g,h,g),Cartesian3.multiplyComponents(n,g,g);var y=Cartesian3.add(c,p,horizonPoints$1[3]);return Cartesian3.add(y,h,y),Cartesian3.multiplyComponents(n,y,y),horizonPoints$1}var scratchPickCartesian2$1=new Cartesian2,scratchRectCartesian$1=new Cartesian3,cartoArray$1=[new Cartographic,new Cartographic,new Cartographic,new Cartographic];function addToResult$1(e,t,i,r,n,a){scratchPickCartesian2$1.x=e,scratchPickCartesian2$1.y=t;var o=r.pickEllipsoid(scratchPickCartesian2$1,n,scratchRectCartesian$1);return defined(o)?(cartoArray$1[i]=n.cartesianToCartographic(o,cartoArray$1[i]),1):(cartoArray$1[i]=n.cartesianToCartographic(a[i],cartoArray$1[i]),0)}function isColli$1(e,t,i){var r=Cartesian3.distance(e,t);return Cartesian3.distance(e,i)<=r+1.5}function pickDownPosition$1(e,t){t=defaultValue(t,1);var i=Cartographic.fromCartesian(e),r=Cartographic.clone(i);return r.height-=t,r.longitude=CesiumMath.toDegrees(r.longitude),r.latitude=CesiumMath.toDegrees(r.latitude),Cartesian3.fromDegrees(r.longitude,r.latitude,r.height)}function pickPosition$1(e,t,i,r,n){var a=new Ray(t,Cartesian3.normalize(Cartesian3.subtract(i,t,new Cartesian3),new Cartesian3)),o=e.pickFromRay(a,r,n);return defined(o)?o.position:void 0}Camera$1.prototype.computeViewRectangle=function(e,t){e=defaultValue(e,Ellipsoid.WGS84);var i=this.frustum.computeCullingVolume(this.positionWC,this.directionWC,this.upWC),r=new BoundingSphere(Cartesian3.ZERO,e.maximumRadius);if(i.computeVisibility(r)!==Intersect$1.OUTSIDE){var n=this._scene.canvas,a=n.clientWidth,o=n.clientHeight,s=0,l=computeHorizonQuad$1(this,e);if(s+=addToResult$1(0,0,0,this,e,l),s+=addToResult$1(0,o,1,this,e,l),s+=addToResult$1(a,o,2,this,e,l),(s+=addToResult$1(a,0,3,this,e,l))<2)return Rectangle.MAX_VALUE;t=Rectangle.fromCartographicArray(cartoArray$1,t);for(var u=0,c=cartoArray$1[3].longitude,d=0;d<4;++d){var h=cartoArray$1[d].longitude,p=Math.abs(h-c);p>CesiumMath.PI?u+=CesiumMath.TWO_PI-p:u+=p,c=h}return CesiumMath.equalsEpsilon(Math.abs(u),CesiumMath.TWO_PI,CesiumMath.EPSILON9)&&(t.west=-CesiumMath.PI,t.east=CesiumMath.PI,0<=cartoArray$1[0].latitude?t.north=CesiumMath.PI_OVER_TWO:t.south=-CesiumMath.PI_OVER_TWO),t}},Camera$1.prototype.switchToPerspectiveFrustum=function(){if(!(this._mode===SceneMode$3.SCENE2D||this.frustum instanceof PerspectiveFrustum)){var e=this._scene;this.frustum=new PerspectiveFrustum,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=CesiumMath.toRadians(60)}},Camera$1.prototype.switchToOrthographicFrustum=function(){if(!(this._mode===SceneMode$3.SCENE2D||this.frustum instanceof OrthographicFrustum)){var e=this._scene;this.frustum=new OrthographicFrustum,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.width=Cartesian3.magnitude(this.position),defined(this.frustum.projectionMatrix)&&this._adjustOrthographicFrustum(!0)}},Camera$1.prototype.changeHeading=function(e){var t=Cartesian3.normalize(Cartesian3.subtract(e,this.position,new Cartesian3),new Cartesian3),i=this._projection.ellipsoid,r=Matrix4.clone(this._transform,scratchHPRMatrix1$1),n=Transforms.eastNorthUpToFixedFrame(this.positionWC,i,scratchHPRMatrix2$1);this._setTransform(n);var a=getHeading$1(t,this.up);return this._setTransform(r),a},Camera$1.prototype.groundRoaming=function(e){if(this._mode===SceneMode$3.SCENE2D)return!1;var t=this._scene;if(!t.screenSpaceCameraController.enableGroundRoaming)return!1;var i=t.screenSpaceCameraController.defaultCollisionRayWidth,r=pickPosition$1(t,e,pickDownPosition$1(e),void 0,i);if(defined(r)){var n={destination:pickDownPosition$1(r,-1*t.screenSpaceCameraController.defaultGroundRoamingHeight),orientation:{heading:this.heading,pitch:this.pitch,roll:0}};return this.setView(n),!0}return!1},Camera$1.prototype.modelColliDetection=function(e,t,i){if(this._mode===SceneMode$3.SCENE2D)return!1;var r=this._scene;if(!r.screenSpaceCameraController.enableModelCollisionDetection)return!1;cameraGroundPosition$1=void 0;var n=r.screenSpaceCameraController.defaultGroundRoamingHeight/2,a=pickDownPosition$1(this.position);if(defined(cameraGroundPosition$1=pickPosition$1(r,this.position,a,t,i))){var o=pickDownPosition$1(cameraGroundPosition$1,-1*n),s=pickDownPosition$1(e,Cartesian3.distance(this.position,o)),l=pickPosition$1(r,o,s,t,i);if(defined(l)&&isColli$1(o,s,l))return!0}return!1},Camera$1.clone=function(e,t){return defined(t)||(t=new Camera$1(e._scene)),Cartesian3.clone(e.position,t.position),Cartesian3.clone(e.direction,t.direction),Cartesian3.clone(e.up,t.up),Cartesian3.clone(e.right,t.right),Matrix4.clone(e._transform,t.transform),t._transformChanged=!0,t.frustum=e.frustum.clone(),t};var CullFace$2={FRONT:WebGLConstants$1.FRONT,BACK:WebGLConstants$1.BACK,FRONT_AND_BACK:WebGLConstants$1.FRONT_AND_BACK},CullFace$3=Object.freeze(CullFace$2),BlendEquation$2={ADD:WebGLConstants$1.FUNC_ADD,SUBTRACT:WebGLConstants$1.FUNC_SUBTRACT,REVERSE_SUBTRACT:WebGLConstants$1.FUNC_REVERSE_SUBTRACT,MIN:WebGLConstants$1.MIN,MAX:WebGLConstants$1.MAX},BlendEquation$3=Object.freeze(BlendEquation$2),BlendFunction$2={ZERO:WebGLConstants$1.ZERO,ONE:WebGLConstants$1.ONE,SOURCE_COLOR:WebGLConstants$1.SRC_COLOR,ONE_MINUS_SOURCE_COLOR:WebGLConstants$1.ONE_MINUS_SRC_COLOR,DESTINATION_COLOR:WebGLConstants$1.DST_COLOR,ONE_MINUS_DESTINATION_COLOR:WebGLConstants$1.ONE_MINUS_DST_COLOR,SOURCE_ALPHA:WebGLConstants$1.SRC_ALPHA,ONE_MINUS_SOURCE_ALPHA:WebGLConstants$1.ONE_MINUS_SRC_ALPHA,DESTINATION_ALPHA:WebGLConstants$1.DST_ALPHA,ONE_MINUS_DESTINATION_ALPHA:WebGLConstants$1.ONE_MINUS_DST_ALPHA,CONSTANT_COLOR:WebGLConstants$1.CONSTANT_COLOR,ONE_MINUS_CONSTANT_COLOR:WebGLConstants$1.ONE_MINUS_CONSTANT_COLOR,CONSTANT_ALPHA:WebGLConstants$1.CONSTANT_ALPHA,ONE_MINUS_CONSTANT_ALPHA:WebGLConstants$1.ONE_MINUS_CONSTANT_ALPHA,SOURCE_ALPHA_SATURATE:WebGLConstants$1.SRC_ALPHA_SATURATE},BlendFunction$3=Object.freeze(BlendFunction$2),BlendingState$2={DISABLED:Object.freeze({enabled:!1}),ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:BlendEquation$3.ADD,equationAlpha:BlendEquation$3.ADD,functionSourceRgb:BlendFunction$3.SOURCE_ALPHA,functionSourceAlpha:BlendFunction$3.ONE,functionDestinationRgb:BlendFunction$3.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:BlendFunction$3.ONE_MINUS_SOURCE_ALPHA}),PRE_MULTIPLIED_ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:BlendEquation$3.ADD,equationAlpha:BlendEquation$3.ADD,functionSourceRgb:BlendFunction$3.ONE,functionSourceAlpha:BlendFunction$3.ONE,functionDestinationRgb:BlendFunction$3.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:BlendFunction$3.ONE_MINUS_SOURCE_ALPHA}),ADDITIVE_BLEND:Object.freeze({enabled:!0,equationRgb:BlendEquation$3.ADD,equationAlpha:BlendEquation$3.ADD,functionSourceRgb:BlendFunction$3.SOURCE_ALPHA,functionSourceAlpha:BlendFunction$3.ONE,functionDestinationRgb:BlendFunction$3.ONE,functionDestinationAlpha:BlendFunction$3.ONE})},BlendingState$3=Object.freeze(BlendingState$2);function Appearance$1(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this.material=e.material,this.translucent=defaultValue(e.translucent,!0),this._vertexShaderSource=e.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource,this._renderState=e.renderState,this._closed=defaultValue(e.closed,!1)}function PerInstanceColorAppearance$1(e){var t=defaultValue((e=defaultValue(e,defaultValue.EMPTY_OBJECT)).translucent,!0),i=defaultValue(e.closed,!1),r=defaultValue(e.flat,!1),n=r?PerInstanceFlatColorAppearanceVS:PerInstanceColorAppearanceVS,a=r?PerInstanceFlatColorAppearanceFS:PerInstanceColorAppearanceFS,o=r?PerInstanceColorAppearance$1.FLAT_VERTEX_FORMAT:PerInstanceColorAppearance$1.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=defaultValue(e.vertexShaderSource,n),this._fragmentShaderSource=defaultValue(e.fragmentShaderSource,a),this._renderState=Appearance$1.getDefaultRenderState(t,i,e.renderState),this._closed=i,this._vertexFormat=o,this._flat=r,this._faceForward=defaultValue(e.faceForward,!i)}function BatchTable$1(e,t,i){if(this._attributes=t,this._numberOfInstances=i,0!==t.length){var r=getDatatype$1(t),n=e.floatingPointTexture,a=r===PixelDatatype$1.FLOAT&&!n,o=createOffsets$1(t,a),s=getStride$1(o,t,a),l=Math.floor(ContextLimits.maximumTextureSize/s),u=Math.min(i,l),c=s*u,d=Math.ceil(i/u),h=1/c,p=.5*h,f=1/d,m=.5*f;this._textureDimensions=new Cartesian2(c,d),this._textureStep=new Cartesian4(h,p,f,m),this._pixelDatatype=a?PixelDatatype$1.UNSIGNED_BYTE:r,this._packFloats=a,this._offsets=o,this._stride=s,this._texture=void 0;var g=4*c*d;this._batchValues=r!==PixelDatatype$1.FLOAT||a?new Uint8Array(g):new Float32Array(g),this._batchValuesDirty=!1}}function getDatatype$1(e){for(var t=!1,i=e.length,r=0;r<i;++r)if(e[r].componentDatatype!==ComponentDatatype$1.UNSIGNED_BYTE){t=!0;break}return t?PixelDatatype$1.FLOAT:PixelDatatype$1.UNSIGNED_BYTE}function getAttributeType$1(e,t){var i=e[t].componentsPerAttribute;return 2===i?Cartesian2:3===i?Cartesian3:4===i?Cartesian4:Number}function createOffsets$1(e,t){for(var i=new Array(e.length),r=0,n=e.length,a=0;a<n;++a){var o=e[a].componentDatatype;i[a]=r,o!==ComponentDatatype$1.UNSIGNED_BYTE&&t?r+=4:++r}return i}function getStride$1(e,t,i){var r=e.length,n=e[r-1];return t[r-1].componentDatatype!==ComponentDatatype$1.UNSIGNED_BYTE&&i?n+4:n+1}Object.defineProperties(Appearance$1.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}}}),Appearance$1.prototype.getFragmentShaderSource=function(){var e=[];return this.flat&&e.push("#define FLAT"),this.faceForward&&e.push("#define FACE_FORWARD"),defined(this.material)&&e.push(this.material.shaderSource),e.push(this.fragmentShaderSource),e.join("\n")},Appearance$1.prototype.isTranslucent=function(){return defined(this.material)&&this.material.isTranslucent()||!defined(this.material)&&this.translucent},Appearance$1.prototype.getRenderState=function(){var e=this.isTranslucent(),t=clone(this.renderState,!1);return e?(t.depthMask=!1,t.blending=BlendingState$3.ALPHA_BLEND):t.depthMask=!0,t},Appearance$1.getDefaultRenderState=function(e,t,i){var r={depthTest:{enabled:!0}};return e&&(r.depthMask=!1,r.blending=BlendingState$3.ALPHA_BLEND),t&&(r.cull={enabled:!0,face:CullFace$3.BACK}),defined(i)&&(r=combine(i,r,!0)),r},Object.defineProperties(PerInstanceColorAppearance$1.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}}}),PerInstanceColorAppearance$1.VERTEX_FORMAT=VertexFormat.POSITION_AND_NORMAL,PerInstanceColorAppearance$1.FLAT_VERTEX_FORMAT=VertexFormat.POSITION_ONLY,PerInstanceColorAppearance$1.prototype.getFragmentShaderSource=Appearance$1.prototype.getFragmentShaderSource,PerInstanceColorAppearance$1.prototype.isTranslucent=Appearance$1.prototype.isTranslucent,PerInstanceColorAppearance$1.prototype.getRenderState=Appearance$1.prototype.getRenderState,Object.defineProperties(BatchTable$1.prototype,{attributes:{get:function(){return this._attributes}},numberOfInstances:{get:function(){return this._numberOfInstances}}});var scratchPackedFloatCartesian4$1=new Cartesian4;function getPackedFloat$1(e,t,i){var r=Cartesian4.unpack(e,t,scratchPackedFloatCartesian4$1),n=Cartesian4.unpackFloat(r);r=Cartesian4.unpack(e,t+4,scratchPackedFloatCartesian4$1);var a=Cartesian4.unpackFloat(r);r=Cartesian4.unpack(e,t+8,scratchPackedFloatCartesian4$1);var o=Cartesian4.unpackFloat(r);r=Cartesian4.unpack(e,t+12,scratchPackedFloatCartesian4$1);var s=Cartesian4.unpackFloat(r);return Cartesian4.fromElements(n,a,o,s,i)}function setPackedAttribute$1(e,t,i){var r=Cartesian4.packFloat(e.x,scratchPackedFloatCartesian4$1);Cartesian4.pack(r,t,i),r=Cartesian4.packFloat(e.y,r),Cartesian4.pack(r,t,i+4),r=Cartesian4.packFloat(e.z,r),Cartesian4.pack(r,t,i+8),r=Cartesian4.packFloat(e.w,r),Cartesian4.pack(r,t,i+12)}var scratchGetAttributeCartesian4$2=new Cartesian4;BatchTable$1.prototype.getBatchedAttribute=function(e,t,i){var r,n=this._attributes,a=this._offsets[t],o=4*this._stride*e+4*a;r=this._packFloats&&n[t].componentDatatype!==PixelDatatype$1.UNSIGNED_BYTE?getPackedFloat$1(this._batchValues,o,scratchGetAttributeCartesian4$2):Cartesian4.unpack(this._batchValues,o,scratchGetAttributeCartesian4$2);var s=getAttributeType$1(n,t);return defined(s.fromCartesian4)?s.fromCartesian4(r,i):defined(s.clone)?s.clone(r,i):r.x};var setAttributeScratchValues$1=[void 0,void 0,new Cartesian2,new Cartesian3,new Cartesian4],setAttributeScratchCartesian4$1=new Cartesian4;function createTexture$1(e,t){var i=e._textureDimensions;e._texture=new Texture({context:t,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:e._pixelDatatype,width:i.x,height:i.y,sampler:Sampler.NEAREST,flipY:!1})}function updateTexture$1(e){var t=e._textureDimensions;e._texture.copyFrom({width:t.x,height:t.y,arrayBufferView:e._batchValues})}function getGlslComputeSt$1(e){var t=e._stride;return 1===e._textureDimensions.y?"uniform vec4 batchTextureStep; \nvec2 computeSt(float batchId) \n{ \n float stepX = batchTextureStep.x; \n float centerX = batchTextureStep.y; \n float numberOfAttributes = float("+t+"); \n return vec2(centerX + (batchId * numberOfAttributes * stepX), 0.5); \n} \n":"uniform vec4 batchTextureStep; \nuniform vec2 batchTextureDimensions; \nvec2 computeSt(float batchId) \n{ \n float stepX = batchTextureStep.x; \n float centerX = batchTextureStep.y; \n float stepY = batchTextureStep.z; \n float centerY = batchTextureStep.w; \n float numberOfAttributes = float("+t+"); \n float xId = mod(batchId * numberOfAttributes, batchTextureDimensions.x); \n float yId = floor(batchId * numberOfAttributes / batchTextureDimensions.x); \n return vec2(centerX + (xId * stepX), centerY + (yId * stepY)); \n} \n"}function getComponentType$1(e){return 1===e?"float":"vec"+e}function getComponentSwizzle$1(e){return 1===e?".x":2===e?".xy":3===e?".xyz":""}function getGlslAttributeFunction$1(e,t){var i=e._attributes[t],r=i.componentsPerAttribute,n=i.functionName,a=getComponentType$1(r),o=getComponentSwizzle$1(r),s=a+" "+n+"(float batchId) \n{ \n vec2 st = computeSt(batchId); \n st.x += batchTextureStep.x * float("+e._offsets[t]+"); \n";return e._packFloats&&i.componentDatatype!==PixelDatatype$1.UNSIGNED_BYTE?s+="vec4 textureValue; \ntextureValue.x = czm_unpackFloat(texture2D(batchTexture, st)); \ntextureValue.y = czm_unpackFloat(texture2D(batchTexture, st + vec2(batchTextureStep.x, 0.0))); \ntextureValue.z = czm_unpackFloat(texture2D(batchTexture, st + vec2(batchTextureStep.x * 2.0, 0.0))); \ntextureValue.w = czm_unpackFloat(texture2D(batchTexture, st + vec2(batchTextureStep.x * 3.0, 0.0))); \n":s+=" vec4 textureValue = texture2D(batchTexture, st); \n",s+=" "+a+" value = textureValue"+o+"; \n",e._pixelDatatype!==PixelDatatype$1.UNSIGNED_BYTE||i.componentDatatype!==ComponentDatatype$1.UNSIGNED_BYTE||i.normalize?e._pixelDatatype===PixelDatatype$1.FLOAT&&i.componentDatatype===ComponentDatatype$1.UNSIGNED_BYTE&&i.normalize&&(s+="value /= 255.0; \n"):s+="value *= 255.0; \n",s+=" return value; \n} \n"}BatchTable$1.prototype.setBatchedAttribute=function(e,t,i){var r=this._attributes,n=setAttributeScratchValues$1[r[t].componentsPerAttribute],a=this.getBatchedAttribute(e,t,n),o=getAttributeType$1(this._attributes,t);if(!(defined(o.equals)?o.equals(a,i):a===i)){var s=setAttributeScratchCartesian4$1;s.x=defined(i.x)?i.x:i,s.y=defined(i.y)?i.y:0,s.z=defined(i.z)?i.z:0,s.w=defined(i.w)?i.w:0;var l=this._offsets[t],u=4*this._stride*e+4*l;this._packFloats&&r[t].componentDatatype!==PixelDatatype$1.UNSIGNED_BYTE?setPackedAttribute$1(s,this._batchValues,u):Cartesian4.pack(s,this._batchValues,u),this._batchValuesDirty=!0}},BatchTable$1.prototype.update=function(e){defined(this._texture)&&!this._batchValuesDirty||0===this._attributes.length||(this._batchValuesDirty=!1,defined(this._texture)||createTexture$1(this,e.context),updateTexture$1(this))},BatchTable$1.prototype.getUniformMapCallback=function(){var t=this;return function(e){return 0===t._attributes.length?e:combine(e,{batchTexture:function(){return t._texture},batchTextureDimensions:function(){return t._textureDimensions},batchTextureStep:function(){return t._textureStep}})}},BatchTable$1.prototype.getVertexShaderCallback=function(){var e=this._attributes;if(0===e.length)return function(e){return e};var n="uniform sampler2D batchTexture; \n";n+=getGlslComputeSt$1(this)+"\n";for(var t=e.length,i=0;i<t;++i)n+=getGlslAttributeFunction$1(this,i);return function(e){var t=e.indexOf("void main"),i=e.substring(0,t),r=e.substring(t);return i+"\n"+n+"\n"+r}},BatchTable$1.prototype.isDestroyed=function(){return!1},BatchTable$1.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),destroyObject(this)};var DepthFunction$2={NEVER:WebGLConstants$1.NEVER,LESS:WebGLConstants$1.LESS,EQUAL:WebGLConstants$1.EQUAL,LESS_OR_EQUAL:WebGLConstants$1.LEQUAL,GREATER:WebGLConstants$1.GREATER,NOT_EQUAL:WebGLConstants$1.NOTEQUAL,GREATER_OR_EQUAL:WebGLConstants$1.GEQUAL,ALWAYS:WebGLConstants$1.ALWAYS},DepthFunction$3=Object.freeze(DepthFunction$2);function transformToWorldCoordinates$1(e,t,i){var r,n=!i,a=e.length;if(!n&&1<a){var o=e[0].modelMatrix;for(r=1;r<a;++r)if(!Matrix4.equals(o,e[r].modelMatrix)){n=!0;break}}if(n)for(r=0;r<a;++r)defined(e[r].geometry)&&GeometryPipeline.transformToWorldCoordinates(e[r]);else Matrix4.multiplyTransformation(t,e[0].modelMatrix,t)}function addGeometryBatchId$1(e,t){var i=e.attributes,r=i.position,n=r.values.length/r.componentsPerAttribute;i.batchId=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:1,values:new Float32Array(n)});for(var a=i.batchId.values,o=0;o<n;++o)a[o]=t}function addBatchIds$1(e){for(var t=e.length,i=0;i<t;++i){var r=e[i];defined(r.geometry)?addGeometryBatchId$1(r.geometry,i):defined(r.westHemisphereGeometry)&&defined(r.eastHemisphereGeometry)&&(addGeometryBatchId$1(r.westHemisphereGeometry,i),addGeometryBatchId$1(r.eastHemisphereGeometry,i))}}function geometryPipeline$1(e){var t,i,r=e.instances,n=e.projection,a=e.elementIndexUintSupported,o=e.scene3DOnly,s=e.vertexCacheOptimize,l=e.compressVertices,u=e.modelMatrix,c=r.length;for(t=0;t<c;++t)if(defined(r[t].geometry)){r[t].geometry.primitiveType;break}if(transformToWorldCoordinates$1(r,u,o),!o)for(t=0;t<c;++t)defined(r[t].geometry)&&GeometryPipeline.splitLongitude(r[t]);if(addBatchIds$1(r),s)for(t=0;t<c;++t){var d=r[t];defined(d.geometry)?(GeometryPipeline.reorderForPostVertexCache(d.geometry),GeometryPipeline.reorderForPreVertexCache(d.geometry)):defined(d.westHemisphereGeometry)&&defined(d.eastHemisphereGeometry)&&(GeometryPipeline.reorderForPostVertexCache(d.westHemisphereGeometry),GeometryPipeline.reorderForPreVertexCache(d.westHemisphereGeometry),GeometryPipeline.reorderForPostVertexCache(d.eastHemisphereGeometry),GeometryPipeline.reorderForPreVertexCache(d.eastHemisphereGeometry))}var h=GeometryPipeline.combineInstances(r);for(c=h.length,t=0;t<c;++t){var p,f=(i=h[t]).attributes;if(o)for(p in f)f.hasOwnProperty(p)&&f[p].componentDatatype===ComponentDatatype$1.DOUBLE&&GeometryPipeline.encodeAttribute(i,p,p+"3DHigh",p+"3DLow");else for(p in f)if(f.hasOwnProperty(p)&&f[p].componentDatatype===ComponentDatatype$1.DOUBLE){var m=p+"3D",g=p+"2D";GeometryPipeline.projectTo2D(i,p,m,g,n),defined(i.boundingSphere)&&"position"===p&&(i.boundingSphereCV=BoundingSphere.fromVertices(i.attributes.position2D.values)),GeometryPipeline.encodeAttribute(i,m,m+"High",m+"Low"),GeometryPipeline.encodeAttribute(i,g,g+"High",g+"Low")}l&&GeometryPipeline.compressVertices(i)}if(!a){var y=[];for(c=h.length,t=0;t<c;++t)i=h[t],y=y.concat(GeometryPipeline.fitToUnsignedShortIndices(i));h=y}return h}function createPickOffsets$1(e,t,i,r){var n,a,o,s=r.length-1;if(0<=s){var l=r[s];n=l.offset+l.count,a=i[o=l.index].indices.length}else a=i[o=n=0].indices.length;for(var u=e.length,c=0;c<u;++c){var d=e[c][t];if(defined(d)){var h=d.indices.length;a<n+h&&(n=0,a=i[++o].indices.length),r.push({index:o,offset:n,count:h}),n+=h}}}function createInstancePickOffsets$1(e,t){var i=[];return createPickOffsets$1(e,"geometry",t,i),createPickOffsets$1(e,"westHemisphereGeometry",t,i),createPickOffsets$1(e,"eastHemisphereGeometry",t,i),i}var PrimitivePipeline$1={};function transferGeometry$1(e,t){var i=e.attributes;for(var r in i)if(i.hasOwnProperty(r)){var n=i[r];defined(n)&&defined(n.values)&&t.push(n.values.buffer)}defined(e.indices)&&t.push(e.indices.buffer)}function transferGeometries$1(e,t){for(var i=e.length,r=0;r<i;++r)transferGeometry$1(e[r],t)}function countCreateGeometryResults$1(e){for(var t=1,i=e.length,r=0;r<i;r++){var n=e[r];if(++t,defined(n)){var a=n.attributes;for(var o in t+=7+2*BoundingSphere.packedLength+(defined(n.indices)?n.indices.length:0),a){if(a.hasOwnProperty(o)&&defined(a[o]))t+=5+a[o].values.length}}}return t}function packInstancesForCombine$1(e,t){var i=e.length,r=new Float64Array(1+19*i),n=0;r[n++]=i;for(var a=0;a<i;a++){var o=e[a];if(Matrix4.pack(o.modelMatrix,r,n),n+=Matrix4.packedLength,defined(o.attributes)&&defined(o.attributes.offset)){var s=o.attributes.offset.value;r[n]=s[0],r[n+1]=s[1],r[n+2]=s[2]}n+=3}return t.push(r.buffer),r}function unpackInstancesForCombine$1(e){for(var t=e,i=new Array(t[0]),r=0,n=1;n<t.length;){var a,o=Matrix4.unpack(t,n);defined(t[n+=Matrix4.packedLength])&&(a={offset:new OffsetGeometryInstanceAttribute(t[n],t[n+1],t[n+2])}),n+=3,i[r++]={modelMatrix:o,attributes:a}}return i}function packBoundingSpheres$1(e){var t=e.length,i=1+(BoundingSphere.packedLength+1)*t,r=new Float32Array(i),n=0;r[n++]=t;for(var a=0;a<t;++a){defined(e[a])?(r[n++]=1,BoundingSphere.pack(e[a],r,n)):r[n++]=0,n+=BoundingSphere.packedLength}return r}function unpackBoundingSpheres$1(e){for(var t=new Array(e[0]),i=0,r=1;r<e.length;)1===e[r++]&&(t[i]=BoundingSphere.unpack(e,r)),++i,r+=BoundingSphere.packedLength;return t}PrimitivePipeline$1.combineGeometry=function(e){var t,i,r,n,a=e.instances,o=a.length,s=!1;0<o&&(0<(t=geometryPipeline$1(e)).length&&(i=GeometryPipeline.createAttributeLocations(t[0]),e.createPickOffsets&&(r=createInstancePickOffsets$1(a,t))),defined(a[0].attributes)&&defined(a[0].attributes.offset)&&(n=new Array(o),s=!0));for(var l=new Array(o),u=new Array(o),c=0;c<o;++c){var d=a[c],h=d.geometry;defined(h)&&(l[c]=h.boundingSphere,u[c]=h.boundingSphereCV,s&&(n[c]=d.geometry.offsetAttribute));var p=d.eastHemisphereGeometry,f=d.westHemisphereGeometry;defined(p)&&defined(f)&&(defined(p.boundingSphere)&&defined(f.boundingSphere)&&(l[c]=BoundingSphere.union(p.boundingSphere,f.boundingSphere)),defined(p.boundingSphereCV)&&defined(f.boundingSphereCV)&&(u[c]=BoundingSphere.union(p.boundingSphereCV,f.boundingSphereCV)))}return{geometries:t,modelMatrix:e.modelMatrix,attributeLocations:i,pickOffsets:r,offsetInstanceExtend:n,boundingSpheres:l,boundingSpheresCV:u}},PrimitivePipeline$1.packCreateGeometryResults=function(e,t){var i=new Float64Array(countCreateGeometryResults$1(e)),r=[],n={},a=e.length,o=0;i[o++]=a;for(var s=0;s<a;s++){var l=e[s],u=defined(l);if(i[o++]=u?1:0,u){i[o++]=l.primitiveType,i[o++]=l.geometryType,i[o++]=defaultValue(l.offsetAttribute,-1);var c=defined(l.boundingSphere)?1:0;(i[o++]=c)&&BoundingSphere.pack(l.boundingSphere,i,o),o+=BoundingSphere.packedLength;var d=defined(l.boundingSphereCV)?1:0;(i[o++]=d)&&BoundingSphere.pack(l.boundingSphereCV,i,o),o+=BoundingSphere.packedLength;var h=l.attributes,p=[];for(var f in h)h.hasOwnProperty(f)&&defined(h[f])&&(p.push(f),defined(n[f])||(n[f]=r.length,r.push(f)));i[o++]=p.length;for(var m=0;m<p.length;m++){var g=p[m],y=h[g];i[o++]=n[g],i[o++]=y.componentDatatype,i[o++]=y.componentsPerAttribute,i[o++]=y.normalize?1:0,i[o++]=y.values.length,i.set(y.values,o),o+=y.values.length}var v=defined(l.indices)?l.indices.length:0;0<(i[o++]=v)&&(i.set(l.indices,o),o+=v)}}return t.push(i.buffer),{stringTable:r,packedData:i}},PrimitivePipeline$1.unpackCreateGeometryResults=function(e){for(var t,i=e.stringTable,r=e.packedData,n=new Array(r[0]),a=0,o=1;o<r.length;){if(1===r[o++]){var s,l,u,c,d,h=r[o++],p=r[o++],f=r[o++];-1===f&&(f=void 0),1===r[o++]&&(s=BoundingSphere.unpack(r,o)),o+=BoundingSphere.packedLength,1===r[o++]&&(l=BoundingSphere.unpack(r,o)),o+=BoundingSphere.packedLength;var m,g=new GeometryAttributes,y=r[o++];for(t=0;t<y;t++){var v=i[r[o++]],_=r[o++];d=r[o++];var C=0!==r[o++];u=r[o++],c=ComponentDatatype$1.createTypedArray(_,u);for(var x=0;x<u;x++)c[x]=r[o++];g[v]=new GeometryAttribute({componentDatatype:_,componentsPerAttribute:d,normalize:C,values:c})}if(0<(u=r[o++])){var b=c.length/d;for(m=IndexDatatype$1.createTypedArray(b,u),t=0;t<u;t++)m[t]=r[o++]}n[a++]=new Geometry({primitiveType:h,geometryType:p,boundingSphere:s,boundingSphereCV:l,indices:m,attributes:g,offsetAttribute:f})}else n[a++]=void 0}return n},PrimitivePipeline$1.packCombineGeometryParameters=function(e,t){for(var i=e.createGeometryResults,r=i.length,n=0;n<r;n++)t.push(i[n].packedData.buffer);return{createGeometryResults:e.createGeometryResults,packedInstances:packInstancesForCombine$1(e.instances,t),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof GeographicProjection,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}},PrimitivePipeline$1.unpackCombineGeometryParameters=function(e){for(var t=unpackInstancesForCombine$1(e.packedInstances),i=e.createGeometryResults,r=i.length,n=0,a=0;a<r;a++)for(var o=PrimitivePipeline$1.unpackCreateGeometryResults(i[a]),s=o.length,l=0;l<s;l++){var u=o[l];t[n].geometry=u,++n}var c=Ellipsoid.clone(e.ellipsoid);return{instances:t,ellipsoid:c,projection:e.isGeographic?new GeographicProjection(c):new WebMercatorProjection(c),elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:Matrix4.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}},PrimitivePipeline$1.packCombineGeometryResults=function(e,t){defined(e.geometries)&&transferGeometries$1(e.geometries,t);var i=packBoundingSpheres$1(e.boundingSpheres),r=packBoundingSpheres$1(e.boundingSpheresCV);return t.push(i.buffer,r.buffer),{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:i,boundingSpheresCV:r}},PrimitivePipeline$1.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:unpackBoundingSpheres$1(e.boundingSpheres),boundingSpheresCV:unpackBoundingSpheres$1(e.boundingSpheresCV)}};var PrimitiveState$2={READY:0,CREATING:1,CREATED:2,COMBINING:3,COMBINED:4,COMPLETE:5,FAILED:6},PrimitiveState$3=Object.freeze(PrimitiveState$2),ShadowMode$2={DISABLED:0,ENABLED:1,CAST_ONLY:2,RECEIVE_ONLY:3,NUMBER_OF_SHADOW_MODES:4,castShadows:function(e){return e===ShadowMode$2.ENABLED||e===ShadowMode$2.CAST_ONLY},receiveShadows:function(e){return e===ShadowMode$2.ENABLED||e===ShadowMode$2.RECEIVE_ONLY},fromCastReceive:function(e,t){return e&&t?ShadowMode$2.ENABLED:e?ShadowMode$2.CAST_ONLY:t?ShadowMode$2.RECEIVE_ONLY:ShadowMode$2.DISABLED}},ShadowMode$3=Object.freeze(ShadowMode$2);function destroyTextures$1(e){e._colorTextures[0]&&!e._colorTextures[0].isDestroyed()&&e._colorTextures[0].destroy(),e.copyTexture&&!e.copyTexture.isDestroyed()&&e.copyTexture.destroy()}function destroyFramebuffer$4(e){e&&!e.isDestroyed()&&e.destroy()}function createTextures$1(e,t,i){return{colorTexture:new Texture({context:e,width:t,height:i,pixelFormat:PixelFormat$1.RGBA}),copyTexture:new Texture({context:e,width:t,height:i,pixelFormat:PixelFormat$1.RGBA})}}function createFramebuffer$2(e,t,i){var r=new Framebuffer({context:e,colorTextures:[t],destroyAttachments:!1,externalDepthStencil:!0});return r.copyTexture=i,r}function Primitive$1(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this.geometryInstances=e.geometryInstances,this.appearance=e.appearance,this._appearance=void 0,this._material=void 0,this.depthFailAppearance=e.depthFailAppearance,this._depthFailAppearance=void 0,this._depthFailMaterial=void 0,this.modelMatrix=Matrix4.clone(defaultValue(e.modelMatrix,Matrix4.IDENTITY)),this._modelMatrix=new Matrix4,this.show=defaultValue(e.show,!0),this._vertexCacheOptimize=defaultValue(e.vertexCacheOptimize,!1),this._interleave=defaultValue(e.interleave,!1),this._releaseGeometryInstances=defaultValue(e.releaseGeometryInstances,!0),this._allowPicking=defaultValue(e.allowPicking,!0),this._asynchronous=defaultValue(e.asynchronous,!0),this._compressVertices=defaultValue(e.compressVertices,!0),this.cull=defaultValue(e.cull,!0),this.debugShowBoundingVolume=defaultValue(e.debugShowBoundingVolume,!1),this.rtcCenter=e.rtcCenter,this.shadows=defaultValue(e.shadows,ShadowMode$3.DISABLED),this._translucent=void 0,this._state=PrimitiveState$3.READY,this._geometries=[],this._error=void 0,this._numberOfInstances=0,this._boundingSpheres=[],this._boundingSphereWC=[],this._boundingSphereCV=[],this._boundingSphere2D=[],this._boundingSphereMorph=[],this._perInstanceAttributeCache=[],this._instanceIds=[],this._lastPerInstanceAttributeIndex=0,this._va=[],this._attributeLocations=void 0,this._primitiveType=void 0,this._frontFaceRS=void 0,this._backFaceRS=void 0,this._sp=void 0,this._depthFailAppearance=void 0,this._spDepthFail=void 0,this._frontFaceDepthFailRS=void 0,this._backFaceDepthFailRS=void 0,this._pickIds=[],this._colorCommands=[],this._pickCommands=[],this._createBoundingVolumeFunction=e._createBoundingVolumeFunction,this._createRenderStatesFunction=e._createRenderStatesFunction,this._createShaderProgramFunction=e._createShaderProgramFunction,this._createCommandsFunction=e._createCommandsFunction,this._updateAndQueueCommandsFunction=e._updateAndQueueCommandsFunction,this._createPickOffsets=e._createPickOffsets,this._pickOffsets=void 0,this._createGeometryResults=void 0,this._ready=!1,this._readyPromise=when.defer(),this._batchTable=void 0,this._batchTableAttributeIndices=void 0,this._offsetInstanceExtend=void 0,this._batchTableOffsetAttribute2DIndex=void 0,this._batchTableOffsetsUpdated=!1,this._instanceBoundingSpheres=void 0,this._instanceBoundingSpheresCV=void 0,this._tempBoundingSpheres=void 0,this._recomputeBoundingSpheres=!1,this._batchTableBoundingSpheresUpdated=!1,this._batchTableBoundingSphereAttributeIndices=void 0,this._heatMap=e.heatMap,this._scaleHeight=e.scaleHeight,this._frameBuffer=null,this._enableFrameBuffer=e.enableFrameBuffer}function getCommonPerInstanceAttributeNames$1(e){var t,i=e.length,r=[],n=e[0].attributes;for(t in n)if(n.hasOwnProperty(t)&&defined(n[t])){for(var a=n[t],o=!0,s=1;s<i;++s){var l=e[s].attributes[t];if(!defined(l)||a.componentDatatype!==l.componentDatatype||a.componentsPerAttribute!==l.componentsPerAttribute||a.normalize!==l.normalize){o=!1;break}}o&&r.push(t)}return r}Object.defineProperties(Primitive$1.prototype,{vertexCacheOptimize:{get:function(){return this._vertexCacheOptimize}},interleave:{get:function(){return this._interleave}},releaseGeometryInstances:{get:function(){return this._releaseGeometryInstances}},allowPicking:{get:function(){return this._allowPicking}},asynchronous:{get:function(){return this._asynchronous}},compressVertices:{get:function(){return this._compressVertices}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}}});var scratchGetAttributeCartesian2$1=new Cartesian2,scratchGetAttributeCartesian3$1=new Cartesian3,scratchGetAttributeCartesian4$3=new Cartesian4;function getAttributeValue$1(e){var t=e.length;return 1===t?e[0]:2===t?Cartesian2.unpack(e,0,scratchGetAttributeCartesian2$1):3===t?Cartesian3.unpack(e,0,scratchGetAttributeCartesian3$1):4===t?Cartesian4.unpack(e,0,scratchGetAttributeCartesian4$3):void 0}function createBatchTable$2(e,t){var i=e.geometryInstances,r=Array.isArray(i)?i:[i],n=r.length;if(0!==n){var a,o,s,l,u=getCommonPerInstanceAttributeNames$1(r),c=u.length,d=[],h={},p={},f=r[0].attributes;for(o=0;o<c;++o)l=f[s=u[o]],h[s]=o,d.push({functionName:"czm_batchTable_"+s,componentDatatype:l.componentDatatype,componentsPerAttribute:l.componentsPerAttribute,normalize:l.normalize});-1!==u.indexOf("distanceDisplayCondition")&&(d.push({functionName:"czm_batchTable_boundingSphereCenter3DHigh",componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter3DLow",componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DHigh",componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DLow",componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereRadius",componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:1}),p.center3DHigh=d.length-5,p.center3DLow=d.length-4,p.center2DHigh=d.length-3,p.center2DLow=d.length-2,p.radius=d.length-1),-1!==u.indexOf("offset")&&(d.push({functionName:"czm_batchTable_offset2D",componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3}),a=d.length-1),d.push({functionName:"czm_batchTable_pickColor",componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0});var m=d.length,g=new BatchTable$1(t,d,n);for(o=0;o<n;++o){var y=r[o];f=y.attributes;for(var v=0;v<c;++v){var _=getAttributeValue$1((l=f[s=u[v]]).value),C=h[s];g.setBatchedAttribute(o,C,_)}var x={primitive:defaultValue(y.pickPrimitive,e)};defined(y.id)&&(x.id=y.id);var b=t.createPickId(x);e._pickIds.push(b);var A=b.color,S=scratchGetAttributeCartesian4$3;S.x=Color.floatToByte(A.red),S.y=Color.floatToByte(A.green),S.z=Color.floatToByte(A.blue),S.w=Color.floatToByte(A.alpha),g.setBatchedAttribute(o,m-1,S)}e._batchTable=g,e._batchTableAttributeIndices=h,e._batchTableBoundingSphereAttributeIndices=p,e._batchTableOffsetAttribute2DIndex=a}}function cloneAttribute$1(e){var t;return t=Array.isArray(e.values)?e.values.slice(0):new e.values.constructor(e.values),new GeometryAttribute({componentDatatype:e.componentDatatype,componentsPerAttribute:e.componentsPerAttribute,normalize:e.normalize,values:t})}function cloneGeometry$1(e){var t,i=e.attributes,r=new GeometryAttributes;for(var n in i)i.hasOwnProperty(n)&&defined(i[n])&&(r[n]=cloneAttribute$1(i[n]));if(defined(e.indices)){var a=e.indices;t=Array.isArray(a)?a.slice(0):new a.constructor(a)}return new Geometry({attributes:r,indices:t,primitiveType:e.primitiveType,boundingSphere:BoundingSphere.clone(e.boundingSphere)})}function cloneInstance$1(e,t){return{geometry:t,attributes:e.attributes,modelMatrix:Matrix4.clone(e.modelMatrix),pickPrimitive:e.pickPrimitive,id:e.id}}var positionRegex$1=/attribute\s+vec(?:3|4)\s+(.*)3DHigh;/g;function appendPickToVertexShader$1(e){return ShaderSource.replaceMain(e,"czm_non_pick_main")+"\nvarying vec4 v_pickColor; \nvoid main() \n{ \n czm_non_pick_main(); \n v_pickColor = czm_batchTable_pickColor(batchId); \n}"}function appendPickToFragmentShader$1(e){return"varying vec4 v_pickColor;\n"+e}function modifyForEncodedNormals$2(e,t){if(!e.compressVertices)return t;var i=-1!==t.search(/attribute\s+vec3\s+normal;/g),r=-1!==t.search(/attribute\s+vec2\s+st;/g);if(!i&&!r)return t;var n=-1!==t.search(/attribute\s+vec3\s+tangent;/g),a=-1!==t.search(/attribute\s+vec3\s+bitangent;/g),o=r&&i?2:1,s="compressedAttributes",l="attribute "+(1<(o+=n||a?1:0)?"vec"+o:"float")+" "+s+";",u="",c="";r&&(u+="vec2 st;\n",c+=" st = czm_decompressTextureCoordinates("+(1<o?s+".x":s)+");\n");i&&n&&a?(u+="vec3 normal;\nvec3 tangent;\nvec3 bitangent;\n",c+=" czm_octDecode("+s+"."+(r?"yz":"xy")+", normal, tangent, bitangent);\n"):(i&&(u+="vec3 normal;\n",c+=" normal = czm_octDecode("+s+(1<o?"."+(r?"y":"x"):"")+");\n"),n&&(u+="vec3 tangent;\n",c+=" tangent = czm_octDecode("+s+"."+(r&&i?"z":"y")+");\n"),a&&(u+="vec3 bitangent;\n",c+=" bitangent = czm_octDecode("+s+"."+(r&&i?"z":"y")+");\n"));var d=t;return d=(d=(d=(d=d.replace(/attribute\s+vec3\s+normal;/g,"")).replace(/attribute\s+vec2\s+st;/g,"")).replace(/attribute\s+vec3\s+tangent;/g,"")).replace(/attribute\s+vec3\s+bitangent;/g,""),[l,u,d=ShaderSource.replaceMain(d,"czm_non_compressed_main"),"void main() \n{ \n"+c+" czm_non_compressed_main(); \n}"].join("\n")}function depthClampVS$1(e){var t=ShaderSource.replaceMain(e,"czm_non_depth_clamp_main");return t+="varying float v_WindowZ;\nvoid main() {\n czm_non_depth_clamp_main();\n vec4 position = gl_Position;\n v_WindowZ = (0.5 * (position.z / position.w) + 0.5) * position.w;\n position.z = min(position.z, position.w);\n gl_Position = position;\n}\n"}function depthClampFS$1(e){var t=ShaderSource.replaceMain(e,"czm_non_depth_clamp_main");return t="#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n#endif\n"+(t+="varying float v_WindowZ;\nvoid main() {\n czm_non_depth_clamp_main();\n#if defined(GL_EXT_frag_depth)\n #if defined(LOG_DEPTH)\n czm_writeLogDepth();\n #else\n gl_FragDepthEXT = min(v_WindowZ * gl_FragCoord.w, 1.0);\n #endif\n#endif\n}\n")}function validateShaderMatching$1(e,t){e.vertexAttributes}function getUniformFunction$1(e,t){return function(){return e[t]}}Primitive$1._modifyShaderPosition=function(e,t,i){for(var r,n="",a="",o="";null!==(r=positionRegex$1.exec(t));){var s=r[1],l="vec4 czm_compute"+s[0].toUpperCase()+s.substr(1)+"()";"vec4 czm_computePosition()"!=l&&(n+=l+";\n"),defined(e.rtcCenter)?(n+="uniform mat4 u_modifiedModelView;\n",a+="attribute vec4 position;\n",o+=l+"\n{\n return u_modifiedModelView * position;\n}\n\n",t=(t=(t=(t=t.replace(/attribute\s+vec(?:3|4)\s+position3DHigh;/g,"")).replace(/attribute\s+vec(?:3|4)\s+position3DLow;/g,"")).replace(/czm_modelViewRelativeToEye\s+\*\s+/g,"")).replace(/czm_modelViewProjectionRelativeToEye/g,"czm_projection")):i?o+=l+"\n{\n return czm_translateRelativeToEye("+s+"3DHigh, "+s+"3DLow);\n}\n\n":(a+="attribute vec3 "+s+"2DHigh;\nattribute vec3 "+s+"2DLow;\n",o+=l+"\n{\n vec4 p;\n if (czm_morphTime == 1.0)\n {\n p = czm_translateRelativeToEye("+s+"3DHigh, "+s+"3DLow);\n }\n else if (czm_morphTime == 0.0)\n {\n p = czm_translateRelativeToEye("+s+"2DHigh.zxy, "+s+"2DLow.zxy);\n }\n else\n {\n p = czm_columbusViewMorph(\n czm_translateRelativeToEye("+s+"2DHigh.zxy, "+s+"2DLow.zxy),\n czm_translateRelativeToEye("+s+"3DHigh, "+s+"3DLow),\n czm_morphTime);\n }\n return p;\n}\n\n")}return[n,a,t,o].join("\n")},Primitive$1._appendShowToShader=function(e,t){if(!defined(e._batchTableAttributeIndices.show))return t;return ShaderSource.replaceMain(t,"czm_non_show_main")+"\nvoid main() \n{ \n czm_non_show_main(); \n gl_Position *= czm_batchTable_show(batchId); \n}"},Primitive$1._updateColorAttribute=function(e,t,i){if(!defined(e._batchTableAttributeIndices.color)&&!defined(e._batchTableAttributeIndices.depthFailColor))return t;if(-1===t.search(/attribute\s+vec4\s+color;/g))return t;var r=t;return r=r.replace(/attribute\s+vec4\s+color;/g,""),r=i?r.replace(/(\b)color(\b)/g,"$1czm_batchTable_depthFailColor(batchId)$2"):r.replace(/(\b)color(\b)/g,"$1czm_batchTable_color(batchId)$2")},Primitive$1._updatePickColorAttribute=function(e){var t=e.replace(/attribute\s+vec4\s+pickColor;/g,"");return t=t.replace(/(\b)pickColor(\b)/g,"$1czm_batchTable_pickColor(batchId)$2")},Primitive$1._appendOffsetToShader=function(e,t){if(!defined(e._batchTableAttributeIndices.offset))return t;var i=t.replace(/attribute\s+float\s+batchId;/g,"attribute float batchId;\nattribute float applyOffset;");return" if (czm_sceneMode == czm_sceneMode3D)\n"," {\n"," $1 = $1 + vec4(czm_batchTable_offset(batchId) * applyOffset, 0.0);"," }\n"," else\n"," {\n"," $1 = $1 + vec4(czm_batchTable_offset2D(batchId) * applyOffset, 0.0);"," }\n",i=i.replace(/vec4\s+([A-Za-z0-9_]+)\s+=\s+czm_computePosition\(\);/g,"vec4 $1 = czm_computePosition();\n if (czm_sceneMode == czm_sceneMode3D)\n {\n $1 = $1 + vec4(czm_batchTable_offset(batchId) * applyOffset, 0.0); }\n else\n {\n $1 = $1 + vec4(czm_batchTable_offset2D(batchId) * applyOffset, 0.0); }\n")},Primitive$1._appendDistanceDisplayConditionToShader=function(e,t,i){if(!defined(e._batchTableAttributeIndices.distanceDisplayCondition))return t;var r="void main() \n{ \n czm_non_distanceDisplayCondition_main(); \n vec2 distanceDisplayCondition = czm_batchTable_distanceDisplayCondition(batchId);\n vec3 boundingSphereCenter3DHigh = czm_batchTable_boundingSphereCenter3DHigh(batchId);\n vec3 boundingSphereCenter3DLow = czm_batchTable_boundingSphereCenter3DLow(batchId);\n float boundingSphereRadius = czm_batchTable_boundingSphereRadius(batchId);\n";return r+=i?" vec4 centerRTE = czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow);\n":" vec3 boundingSphereCenter2DHigh = czm_batchTable_boundingSphereCenter2DHigh(batchId);\n vec3 boundingSphereCenter2DLow = czm_batchTable_boundingSphereCenter2DLow(batchId);\n vec4 centerRTE;\n if (czm_morphTime == 1.0)\n {\n centerRTE = czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow);\n }\n else if (czm_morphTime == 0.0)\n {\n centerRTE = czm_translateRelativeToEye(boundingSphereCenter2DHigh.zxy, boundingSphereCenter2DLow.zxy);\n }\n else\n {\n centerRTE = czm_columbusViewMorph(\n czm_translateRelativeToEye(boundingSphereCenter2DHigh.zxy, boundingSphereCenter2DLow.zxy),\n czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow),\n czm_morphTime);\n }\n",ShaderSource.replaceMain(t,"czm_non_distanceDisplayCondition_main")+"\n"+(r+=" float radiusSq = boundingSphereRadius * boundingSphereRadius; \n float distanceSq; \n if (czm_sceneMode == czm_sceneMode2D) \n { \n distanceSq = czm_eyeHeight2D.y - radiusSq; \n } \n else \n { \n distanceSq = dot(centerRTE.xyz, centerRTE.xyz) - radiusSq; \n } \n distanceSq = max(distanceSq, 0.0); \n float nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x; \n float farSq = distanceDisplayCondition.y * distanceDisplayCondition.y; \n float show = (distanceSq >= nearSq && distanceSq <= farSq) ? 1.0 : 0.0; \n gl_Position *= show; \n}")};var numberOfCreationWorkers$1=Math.max(FeatureDetection$1.hardwareConcurrency-1,1),createGeometryTaskProcessors$1,combineGeometryTaskProcessor$1=new TaskProcessor("combineGeometry",Number.POSITIVE_INFINITY);function loadAsynchronous$1(i,r){var e,t,n,a,o=i._instanceIds;if(i._state===PrimitiveState$3.READY){e=Array.isArray(i.geometryInstances)?i.geometryInstances:[i.geometryInstances];var s,l=i._numberOfInstances=e.length,u=[],c=[];for(n=0;n<l;++n)t=e[n].geometry,o.push(e[n].id),c.push({moduleName:t._workerName,geometry:t});if(!defined(createGeometryTaskProcessors$1))for(createGeometryTaskProcessors$1=new Array(numberOfCreationWorkers$1),n=0;n<numberOfCreationWorkers$1;n++)createGeometryTaskProcessors$1[n]=new TaskProcessor("createGeometry",Number.POSITIVE_INFINITY);for(c=subdivideArray(c,numberOfCreationWorkers$1),n=0;n<c.length;n++){var d,h=0,p=c[n],f=p.length;for(a=0;a<f;++a)defined((t=(s=p[a]).geometry).constructor.pack)&&(s.offset=h,h+=defaultValue(t.constructor.packedLength,t.packedLength));if(0<h){var m=new Float64Array(h);for(d=[m.buffer],a=0;a<f;++a)defined((t=(s=p[a]).geometry).constructor.pack)&&(t.constructor.pack(t,m,s.offset),s.geometry=m)}u.push(createGeometryTaskProcessors$1[n].scheduleTask({subTasks:c[n]},d))}i._state=PrimitiveState$3.CREATING,when.all(u,function(e){i._createGeometryResults=e,i._state=PrimitiveState$3.CREATED;var t=r.mapProjection;processHeatMap$1(i,e,t.ellipsoid)}).otherwise(function(e){setReady$1(i,r,PrimitiveState$3.FAILED,e)})}else if(i._state===PrimitiveState$3.CREATED){var g=[];e=Array.isArray(i.geometryInstances)?i.geometryInstances:[i.geometryInstances];var y=r.scene3DOnly,v=r.mapProjection,_=combineGeometryTaskProcessor$1.scheduleTask(PrimitivePipeline$1.packCombineGeometryParameters({createGeometryResults:i._createGeometryResults,instances:e,ellipsoid:v.ellipsoid,projection:v,elementIndexUintSupported:r.context.elementIndexUint,scene3DOnly:y,vertexCacheOptimize:i.vertexCacheOptimize,compressVertices:i.compressVertices,modelMatrix:i.modelMatrix,createPickOffsets:i._createPickOffsets},g),g);i._createGeometryResults=void 0,i._state=PrimitiveState$3.COMBINING,when(_,function(e){var t=PrimitivePipeline$1.unpackCombineGeometryResults(e);i._geometries=t.geometries,i._attributeLocations=t.attributeLocations,i.modelMatrix=Matrix4.clone(t.modelMatrix,i.modelMatrix),i._pickOffsets=t.pickOffsets,i._offsetInstanceExtend=t.offsetInstanceExtend,i._instanceBoundingSpheres=t.boundingSpheres,i._instanceBoundingSpheresCV=t.boundingSpheresCV,defined(i._geometries)&&0<i._geometries.length?(i._recomputeBoundingSpheres=!0,i._state=PrimitiveState$3.COMBINED):setReady$1(i,r,PrimitiveState$3.FAILED,void 0)}).otherwise(function(e){setReady$1(i,r,PrimitiveState$3.FAILED,e)})}}function processHeatMap$1(e,t,i){if(defined(e._heatMap)&&1===t.length){var r=PrimitivePipeline$1.unpackCreateGeometryResults(t[0]),n=r[0].attributes;defined(n.tangent)||delete n.tangent,defined(n.bitangent)||delete n.bitangent,defined(n.color)||delete n.color,r[0].attributes.position.values=scaleToHeatMapHeight$1(e,r[0].attributes.position.values,i);var a=PrimitivePipeline$1.packCreateGeometryResults(r,[]);e._createGeometryResults=[a]}}var scaleToHeatMapHeightN$1=new Cartesian3,scaleToHeatMapHeightP$1=new Cartesian3,scaleCartPosition$1=new Cartographic;function scaleToHeatMapHeight$1(e,t,i){var r=e._heatMap;i=defaultValue(i,Ellipsoid.WGS84);var n=scaleToHeatMapHeightN$1,a=scaleToHeatMapHeightP$1;if(defined(t))for(var o=t.length,s=0,l=0;l<o;l+=3)Cartesian3.fromArray(t,l,a),(scaleCartPosition$1=Cartographic.fromCartesian(a,i,scaleCartPosition$1)).longitude=CesiumMath.toDegrees(scaleCartPosition$1.longitude),scaleCartPosition$1.latitude=CesiumMath.toDegrees(scaleCartPosition$1.latitude),0!==(s=r.getValueAt(scaleCartPosition$1.longitude,scaleCartPosition$1.latitude))&&(s*=e._scaleHeight,n=i.geodeticSurfaceNormal(a,n),Cartesian3.multiplyByScalar(n,s,n),Cartesian3.add(a,n,a)),t[l]=a.x,t[l+1]=a.y,t[l+2]=a.z;return t}function loadSynchronous$1(e,t){var i,r,n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances],a=e._numberOfInstances=n.length,o=new Array(a),s=e._instanceIds,l=0;for(r=0;r<a;r++){var u,c=(i=n[r]).geometry;u=defined(c.attributes)&&defined(c.primitiveType)?cloneGeometry$1(c):c.constructor.createGeometry(c),o[l++]=cloneInstance$1(i,u),s.push(i.id)}o.length=l;var d=t.scene3DOnly,h=t.mapProjection,p=PrimitivePipeline$1.combineGeometry({instances:o,ellipsoid:h.ellipsoid,projection:h,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:d,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets});e._geometries=p.geometries,e._attributeLocations=p.attributeLocations,e.modelMatrix=Matrix4.clone(p.modelMatrix,e.modelMatrix),e._pickOffsets=p.pickOffsets,e._offsetInstanceExtend=p.offsetInstanceExtend,e._instanceBoundingSpheres=p.boundingSpheres,e._instanceBoundingSpheresCV=p.boundingSpheresCV,defined(e._geometries)&&0<e._geometries.length?(e._recomputeBoundingSpheres=!0,e._state=PrimitiveState$3.COMBINED):setReady$1(e,t,PrimitiveState$3.FAILED,void 0)}function recomputeBoundingSpheres$1(e,t){var i=e._batchTableAttributeIndices.offset;if(e._recomputeBoundingSpheres&&defined(i)){var r,n=e._offsetInstanceExtend,a=e._instanceBoundingSpheres,o=a.length,s=e._tempBoundingSpheres;if(!defined(s)){for(s=new Array(o),r=0;r<o;r++)s[r]=new BoundingSphere;e._tempBoundingSpheres=s}for(r=0;r<o;++r){var l=s[r],u=e._batchTable.getBatchedAttribute(r,i,new Cartesian3);transformBoundingSphere$1(l=a[r].clone(l),u,n[r])}var c=[],d=[],h=[];for(r=0;r<o;++r){var p=s[r];0<p.center.x-p.radius||BoundingSphere.intersectPlane(p,Plane.ORIGIN_ZX_PLANE)!==Intersect$1.INTERSECTING?c.push(p):(d.push(p),h.push(p))}var f=c[0],m=h[0],g=d[0];for(r=1;r<c.length;r++)f=BoundingSphere.union(f,c[r]);for(r=1;r<h.length;r++)m=BoundingSphere.union(m,h[r]);for(r=1;r<d.length;r++)g=BoundingSphere.union(g,d[r]);var y=[];for(defined(f)&&y.push(f),defined(m)&&y.push(m),defined(g)&&y.push(g),r=0;r<y.length;r++){var v=y[r].clone(e._boundingSpheres[r]);e._boundingSpheres[r]=v,e._boundingSphereCV[r]=BoundingSphere.projectTo2D(v,t.mapProjection,e._boundingSphereCV[r])}Primitive$1._updateBoundingVolumes(e,t,e.modelMatrix,!0),e._recomputeBoundingSpheres=!1}else e._recomputeBoundingSpheres=!1}var scratchBoundingSphereCenterEncoded$1=new EncodedCartesian3,scratchBoundingSphereCartographic$1=new Cartographic,scratchBoundingSphereCenter2D$1=new Cartesian3,scratchBoundingSphere$6=new BoundingSphere;function updateBatchTableBoundingSpheres$1(e,t){if(defined(e._batchTableAttributeIndices.distanceDisplayCondition)&&!e._batchTableBoundingSpheresUpdated){for(var i=e._batchTableBoundingSphereAttributeIndices,r=i.center3DHigh,n=i.center3DLow,a=i.center2DHigh,o=i.center2DLow,s=i.radius,l=t.mapProjection,u=l.ellipsoid,c=e._batchTable,d=e._instanceBoundingSpheres,h=d.length,p=0;p<h;++p){var f=d[p];if(defined(f)){var m=e.modelMatrix;defined(m)&&(f=BoundingSphere.transform(f,m,scratchBoundingSphere$6));var g=f.center,y=f.radius,v=EncodedCartesian3.fromCartesian(g,scratchBoundingSphereCenterEncoded$1);if(c.setBatchedAttribute(p,r,v.high),c.setBatchedAttribute(p,n,v.low),!t.scene3DOnly){var _=u.cartesianToCartographic(g,scratchBoundingSphereCartographic$1),C=l.project(_,scratchBoundingSphereCenter2D$1);v=EncodedCartesian3.fromCartesian(C,scratchBoundingSphereCenterEncoded$1),c.setBatchedAttribute(p,a,v.high),c.setBatchedAttribute(p,o,v.low)}c.setBatchedAttribute(p,s,y)}}e._batchTableBoundingSpheresUpdated=!0}}var offsetScratchCartesian$1=new Cartesian3,offsetCenterScratch$1=new Cartesian3;function updateBatchTableOffsets$1(e,t){if(defined(e._batchTableAttributeIndices.offset)&&!e._batchTableOffsetsUpdated&&!t.scene3DOnly){for(var i=e._batchTableOffsetAttribute2DIndex,r=t.mapProjection,n=r.ellipsoid,a=e._batchTable,o=e._instanceBoundingSpheres,s=o.length,l=0;l<s;++l){var u=o[l];if(defined(u)){var c=a.getBatchedAttribute(l,e._batchTableAttributeIndices.offset);if(Cartesian3.equals(c,Cartesian3.ZERO))a.setBatchedAttribute(l,i,Cartesian3.ZERO);else{var d=e.modelMatrix;defined(d)&&(u=BoundingSphere.transform(u,d,scratchBoundingSphere$6));var h=u.center;h=n.scaleToGeodeticSurface(h,offsetCenterScratch$1);var p=n.cartesianToCartographic(h,scratchBoundingSphereCartographic$1),f=r.project(p,scratchBoundingSphereCenter2D$1),m=Cartesian3.add(c,h,offsetScratchCartesian$1);p=n.cartesianToCartographic(m,p);var g=r.project(p,offsetScratchCartesian$1),y=Cartesian3.subtract(g,f,offsetScratchCartesian$1),v=y.x;y.x=y.z,y.z=y.y,y.y=v,a.setBatchedAttribute(l,i,y)}}}e._batchTableOffsetsUpdated=!0}}function createVertexArray$1(e,t){for(var i=e._attributeLocations,r=e._geometries,n=t.scene3DOnly,a=t.context,o=[],s=r.length,l=0;l<s;++l){var u=r[l];if(o.push(VertexArray.fromGeometry({context:a,geometry:u,attributeLocations:i,bufferUsage:BufferUsage$1.STATIC_DRAW,interleave:e._interleave})),defined(e._createBoundingVolumeFunction))e._createBoundingVolumeFunction(t,u);else if(e._boundingSpheres.push(BoundingSphere.clone(u.boundingSphere)),e._boundingSphereWC.push(new BoundingSphere),!n){var c=u.boundingSphereCV.center,d=c.x,h=c.y,p=c.z;c.x=p,c.y=d,c.z=h,e._boundingSphereCV.push(BoundingSphere.clone(u.boundingSphereCV)),e._boundingSphere2D.push(new BoundingSphere),e._boundingSphereMorph.push(new BoundingSphere)}}e._va=o,e._primitiveType=r[0].primitiveType,e.releaseGeometryInstances&&(e.geometryInstances=void 0),e._geometries=void 0,setReady$1(e,t,PrimitiveState$3.COMPLETE,void 0)}function createRenderStates$5(e,t,i,r){var n,a=i.getRenderState();r?((n=clone(a,!1)).cull={enabled:!0,face:CullFace$3.BACK},e._frontFaceRS=RenderState.fromCache(n),n.cull.face=CullFace$3.FRONT,e._backFaceRS=RenderState.fromCache(n)):(e._frontFaceRS=RenderState.fromCache(a),e._backFaceRS=e._frontFaceRS),n=clone(a,!1),defined(e._depthFailAppearance)&&(n.depthTest.enabled=!1),defined(e._depthFailAppearance)&&((n=clone(a=e._depthFailAppearance.getRenderState(),!1)).depthTest.func=DepthFunction$3.GREATER,r?(n.cull={enabled:!0,face:CullFace$3.BACK},e._frontFaceDepthFailRS=RenderState.fromCache(n),n.cull.face=CullFace$3.FRONT,e._backFaceDepthFailRS=RenderState.fromCache(n)):(e._frontFaceDepthFailRS=RenderState.fromCache(n),e._backFaceDepthFailRS=e._frontFaceRS))}function createShaderProgram$3(e,t,i){var r=t.context,n=e._attributeLocations,a=e._batchTable.getVertexShaderCallback()(i.vertexShaderSource);a=Primitive$1._appendOffsetToShader(e,a),a=Primitive$1._appendShowToShader(e,a),a=appendPickToVertexShader$1(a=Primitive$1._appendDistanceDisplayConditionToShader(e,a,t.scene3DOnly)),a=modifyForEncodedNormals$2(e,a=Primitive$1._updateColorAttribute(e,a,!1)),a=Primitive$1._modifyShaderPosition(e,a,t.scene3DOnly);var o=i.getFragmentShaderSource();o=appendPickToFragmentShader$1(o),e._sp=ShaderProgram.replaceCache({context:r,shaderProgram:e._sp,vertexShaderSource:a,fragmentShaderSource:o,attributeLocations:n}),validateShaderMatching$1(e._sp),defined(e._depthFailAppearance)&&(a=e._batchTable.getVertexShaderCallback()(e._depthFailAppearance.vertexShaderSource),a=Primitive$1._appendShowToShader(e,a),a=appendPickToVertexShader$1(a=Primitive$1._appendDistanceDisplayConditionToShader(e,a,t.scene3DOnly)),a=modifyForEncodedNormals$2(e,a=Primitive$1._updateColorAttribute(e,a,!0)),a=depthClampVS$1(a=Primitive$1._modifyShaderPosition(e,a,t.scene3DOnly)),o=depthClampFS$1(o=appendPickToFragmentShader$1(o=e._depthFailAppearance.getFragmentShaderSource())),e._spDepthFail=ShaderProgram.replaceCache({context:r,shaderProgram:e._spDepthFail,vertexShaderSource:a,fragmentShaderSource:o,attributeLocations:n}),validateShaderMatching$1(e._spDepthFail))}var modifiedModelViewScratch$1=new Matrix4,rtcScratch$1=new Cartesian3;function getUniforms$1(t,e,i,r){var n=defined(i)?i._uniforms:void 0,a={},o=e.uniforms;if(defined(o))for(var s in o)o.hasOwnProperty(s)&&(a[s]=getUniformFunction$1(o,s));var l=combine(a,n);return l=t._batchTable.getUniformMapCallback()(l),defined(t.rtcCenter)&&(l.u_modifiedModelView=function(){var e=r.context.uniformState.view;return Matrix4.multiply(e,t._modelMatrix,modifiedModelViewScratch$1),Matrix4.multiplyByPoint(modifiedModelViewScratch$1,t.rtcCenter,rtcScratch$1),Matrix4.setTranslation(modifiedModelViewScratch$1,rtcScratch$1,modifiedModelViewScratch$1),modifiedModelViewScratch$1}),l}function createCommands$3(e,t,i,r,n,a,o,s){var l,u=getUniforms$1(e,t,i,s);defined(e._depthFailAppearance)&&(l=getUniforms$1(e,e._depthFailAppearance,e._depthFailAppearance.material,s));var c=r?Pass$1.TRANSLUCENT:Pass$1.OPAQUE,d=n?2:1;d*=defined(e._depthFailAppearance)?2:1,a.length=e._va.length*d;for(var h=a.length,p=0,f=0;f<h;++f){var m;n&&(defined(m=a[f])||(m=a[f]=new DrawCommand({owner:e,primitiveType:e._primitiveType})),m.vertexArray=e._va[p],m.renderState=e._backFaceRS,m.shaderProgram=e._sp,m.uniformMap=u,m.pass=c,++f),defined(m=a[f])||(m=a[f]=new DrawCommand({owner:e,primitiveType:e._primitiveType})),m.vertexArray=e._va[p],m.renderState=e._frontFaceRS,m.shaderProgram=e._sp,m.uniformMap=u,m.pass=c,defined(e._depthFailAppearance)&&(n&&(defined(m=a[++f])||(m=a[f]=new DrawCommand({owner:e,primitiveType:e._primitiveType})),m.vertexArray=e._va[p],m.renderState=e._backFaceDepthFailRS,m.shaderProgram=e._spDepthFail,m.uniformMap=l,m.pass=c),defined(m=a[++f])||(m=a[f]=new DrawCommand({owner:e,primitiveType:e._primitiveType})),m.vertexArray=e._va[p],m.renderState=e._frontFaceDepthFailRS,m.shaderProgram=e._spDepthFail,m.uniformMap=l,m.pass=c),++p}}function updateAndQueueCommands$4(e,t,i,r,n,a,o,s){var l;Primitive$1._updateBoundingVolumes(e,t,n),t.mode===SceneMode$3.SCENE3D?l=e._boundingSphereWC:t.mode===SceneMode$3.COLUMBUS_VIEW?l=e._boundingSphereCV:t.mode===SceneMode$3.SCENE2D&&defined(e._boundingSphere2D)?l=e._boundingSphere2D:defined(e._boundingSphereMorph)&&(l=e._boundingSphereMorph);var u=t.commandList,c=t.passes;if(c.render||c.pick){var d=e.allowPicking,h=ShadowMode$3.castShadows(e.shadows),p=ShadowMode$3.receiveShadows(e.shadows),f=i.length,m=s?2:1;m*=defined(e._depthFailAppearance)?2:1;for(var g=0;g<f;++g){var y=Math.floor(g/m),v=i[g];v.modelMatrix=n,v.boundingVolume=l[y],v.cull=a,v.debugShowBoundingVolume=o,v.castShadows=h,v.receiveShadows=p,v.pickId=d?"v_pickColor":void 0,u.push(v)}}}Primitive$1._updateBoundingVolumes=function(e,t,i,r){var n,a,o;if(r||!Matrix4.equals(i,e._modelMatrix))for(Matrix4.clone(i,e._modelMatrix),a=e._boundingSpheres.length,n=0;n<a;++n)defined(o=e._boundingSpheres[n])&&(e._boundingSphereWC[n]=BoundingSphere.transform(o,i,e._boundingSphereWC[n]),t.scene3DOnly||(e._boundingSphere2D[n]=BoundingSphere.clone(e._boundingSphereCV[n],e._boundingSphere2D[n]),e._boundingSphere2D[n].center.x=0,e._boundingSphereMorph[n]=BoundingSphere.union(e._boundingSphereWC[n],e._boundingSphereCV[n])));var s=e.appearance.pixelSize;if(defined(s))for(a=e._boundingSpheres.length,n=0;n<a;++n){o=e._boundingSpheres[n];var l=e._boundingSphereWC[n],u=t.camera.getPixelSize(o,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*s;l.radius=o.radius+u}},Primitive$1.prototype.update=function(e){if(!(!defined(this.geometryInstances)&&0===this._va.length||defined(this.geometryInstances)&&Array.isArray(this.geometryInstances)&&0===this.geometryInstances.length||!defined(this.appearance)||e.mode!==SceneMode$3.SCENE3D&&e.scene3DOnly||!e.passes.render&&!e.passes.pick)){if(defined(this._error))throw this._error;if(this._state!==PrimitiveState$3.FAILED){var t=e.context;if(defined(this._batchTable)||createBatchTable$2(this,t),0<this._batchTable.attributes.length){if(0===ContextLimits.maximumVertexTextureImageUnits)throw new RuntimeError("Vertex texture fetch support is required to render primitives with per-instance attributes. The maximum number of vertex texture image units must be greater than zero.");this._batchTable.update(e)}if(this._state!==PrimitiveState$3.COMPLETE&&this._state!==PrimitiveState$3.COMBINED&&(this.asynchronous?loadAsynchronous$1(this,e):loadSynchronous$1(this,e)),this._state===PrimitiveState$3.COMBINED&&(updateBatchTableBoundingSpheres$1(this,e),updateBatchTableOffsets$1(this,e),createVertexArray$1(this,e)),this.show&&this._state===PrimitiveState$3.COMPLETE){this._batchTableOffsetsUpdated||updateBatchTableOffsets$1(this,e),this._recomputeBoundingSpheres&&recomputeBoundingSpheres$1(this,e);var i=this.appearance,r=i.material,n=!1,a=!1,o=!1;this._appearance!==i?(this._appearance=i,this._material=r,a=n=!0):this._material!==r&&(this._material=r,a=!0);var s=this.depthFailAppearance,l=defined(s)?s.material:void 0;this._depthFailAppearance!==s?(this._depthFailAppearance=s,this._depthFailMaterial=l,a=n=!0):this._depthFailMaterial!==l&&(this._depthFailMaterial=l,a=!0);var u=this._appearance.isTranslucent();this._translucent!==u&&(this._translucent=u,n=!0),defined(this._material)&&this._material.update(t);var c=i.closed&&u;if(n)defaultValue(this._createRenderStatesFunction,createRenderStates$5)(this,t,i,c);if(a)defaultValue(this._createShaderProgramFunction,createShaderProgram$3)(this,e,i);if(this._enableFrameBuffer&&!defined(this._frameBuffer)&&(n||a)){var d=(f=e.context.canvas).clientWidth,h=f.clientHeight,p=createTextures$1(e.context,d,h);this._frameBuffer=createFramebuffer$2(e.context,p.colorTexture,p.copyTexture),o=!0}if(this._enableFrameBuffer&&defined(this._frameBuffer)){d=(f=e.context.canvas).clientWidth,h=f.clientHeight;var f,m=this._frameBuffer.copyTexture;if(m.width!==d||m.height!==h){destroyTextures$1(this._frameBuffer),destroyFramebuffer$4(this._frameBuffer);p=createTextures$1(e.context,d,h);this._frameBuffer=createFramebuffer$2(e.context,p.colorTexture,p.copyTexture),o=!0}}if(n||a||o)defaultValue(this._createCommandsFunction,createCommands$3)(this,i,r,u,c,this._colorCommands,this._pickCommands,e);defaultValue(this._updateAndQueueCommandsFunction,updateAndQueueCommands$4)(this,e,this._colorCommands,this._pickCommands,this.modelMatrix,this.cull,this.debugShowBoundingVolume,c)}}}};var offsetBoundingSphereScratch1$1=new BoundingSphere,offsetBoundingSphereScratch2$1=new BoundingSphere;function transformBoundingSphere$1(e,t,i){if(i===GeometryOffsetAttribute$1.TOP){var r=BoundingSphere.clone(e,offsetBoundingSphereScratch1$1),n=BoundingSphere.clone(e,offsetBoundingSphereScratch2$1);n.center=Cartesian3.add(n.center,t,n.center),e=BoundingSphere.union(r,n,e)}else i===GeometryOffsetAttribute$1.ALL&&(e.center=Cartesian3.add(e.center,t,e.center));return e}function createGetFunction$1(n,a,o){return function(){var e=n.getBatchedAttribute(a,o),t=n.attributes[o],i=t.componentsPerAttribute,r=ComponentDatatype$1.createTypedArray(t.componentDatatype,i);return defined(e.constructor.pack)?e.constructor.pack(e,r,0):r[0]=e,r}}function createSetFunction$1(i,r,n,a,o){return function(e){var t=getAttributeValue$1(e);i.setBatchedAttribute(r,n,t),"offset"===o&&(a._recomputeBoundingSpheres=!0,a._batchTableOffsetsUpdated=!1)}}var offsetScratch$3=new Cartesian3;function createBoundingSphereProperties$1(r,n,a){n.boundingSphere={get:function(){var e=r._instanceBoundingSpheres[a];if(defined(e)){e=e.clone();var t=r.modelMatrix,i=n.offset;defined(i)&&transformBoundingSphere$1(e,Cartesian3.fromArray(i.get(),0,offsetScratch$3),r._offsetInstanceExtend[a]),defined(t)&&(e=BoundingSphere.transform(e,t))}return e}},n.boundingSphereCV={get:function(){return r._instanceBoundingSpheresCV[a]}}}function createPickIdProperty$1(e,t,i){t.pickId={get:function(){return e._pickIds[i]}}}function setReady$1(e,t,i,r){e._error=r,e._state=i,t.afterRender.push(function(){e._ready=e._state===PrimitiveState$3.COMPLETE||e._state===PrimitiveState$3.FAILED,defined(r)?e._readyPromise.reject(r):e._readyPromise.resolve(e)})}function DebugCameraPrimitive$1(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this._camera=e.camera,this._color=defaultValue(e.color,Color.CYAN),this._updateOnChange=defaultValue(e.updateOnChange,!0),this.show=defaultValue(e.show,!0),this.id=e.id,this._id=void 0,this._outlinePrimitives=[],this._planesPrimitives=[]}Primitive$1.prototype.getGeometryInstanceAttributes=function(e){for(var t=-1,i=this._lastPerInstanceAttributeIndex,r=this._instanceIds,n=r.length,a=0;a<n;++a){var o=(i+a)%n;if(e===r[o]){t=o;break}}if(-1!==t){var s=this._perInstanceAttributeCache[t];if(defined(s))return s;var l=this._batchTable,u=this._batchTableAttributeIndices;s={};var c={};for(var d in u)if(u.hasOwnProperty(d)){var h=u[d];c[d]={get:createGetFunction$1(l,t,h),set:createSetFunction$1(l,t,h,this,d)}}return createBoundingSphereProperties$1(this,c,t),createPickIdProperty$1(this,c,t),Object.defineProperties(s,c),this._lastPerInstanceAttributeIndex=t,this._perInstanceAttributeCache[t]=s}},Primitive$1.prototype.isDestroyed=function(){return!1},Primitive$1.prototype.destroy=function(){var e,t;this._sp=this._sp&&this._sp.destroy(),this._spDepthFail=this._spDepthFail&&this._spDepthFail.destroy();var i=this._va;for(e=i.length,t=0;t<e;++t)i[t].destroy();this._va=void 0;var r=this._pickIds;for(e=r.length,t=0;t<e;++t)r[t].destroy();return this._pickIds=void 0,this._batchTable=this._batchTable&&this._batchTable.destroy(),this._instanceIds=void 0,this._perInstanceAttributeCache=void 0,this._attributeLocations=void 0,destroyObject(this)};var scratchRight$4=new Cartesian3,scratchRotation$2=new Matrix3,scratchOrientation$1=new Quaternion,scratchPerspective$1=new PerspectiveFrustum,scratchPerspectiveOffCenter$1=new PerspectiveOffCenterFrustum,scratchOrthographic$1=new OrthographicFrustum,scratchOrthographicOffCenter$1=new OrthographicOffCenterFrustum,scratchColor$1=new Color,scratchSplits$4=[1,1e5];function ViewShedMapShader(){}function ViewShedMap(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).context;this._enabled=defaultValue(e.enabled,!0),this._softShadows=defaultValue(e.softShadows,!1),this._normalOffset=defaultValue(e.normalOffset,!0),this.dirty=!0,this.fromLightSource=defaultValue(e.fromLightSource,!0),this.darkness=defaultValue(e.darkness,.3),this._darkness=this.darkness,this.maximumDistance=defaultValue(e.maximumDistance,5e3),this._outOfView=!1,this._outOfViewPrevious=!1;var i,r=this._needsUpdate=!0;(FeatureDetection$1.isInternetExplorer()||FeatureDetection$1.isEdge()||(FeatureDetection$1.isChrome()||FeatureDetection$1.isFirefox())&&FeatureDetection$1.isWindows()&&!t.depthTexture)&&(r=!1),this._polygonOffsetSupported=r,this._terrainBias={polygonOffset:r,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.5,normalShading:!0,normalShadingSmooth:.3,depthBias:1e-4},this._primitiveBias={polygonOffset:r,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.1,normalShading:!0,normalShadingSmooth:.05,depthBias:2e-5},this._pointBias={polygonOffset:!1,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:0,normalShading:!0,normalShadingSmooth:.1,depthBias:5e-4},this._depthAttachment=void 0,this._colorAttachment=void 0,this._shadowMapMatrix=new Matrix4,this._shadowMapTexture=void 0,this._lightDirectionEC=new Cartesian3,this._lightPositionEC=new Cartesian4,this._distance=0,this._lightCamera=e.lightCamera,this._shadowMapCamera=new ShadowMapCamera$3,this._shadowMapCullingVolume=void 0,this._sceneCamera=void 0,this._boundingSphere=new BoundingSphere,this._isPointLight=defaultValue(e.isPointLight,!1),this._pointLightRadius=defaultValue(e.pointLightRadius,100),this._cascadesEnabled=!this._isPointLight&&defaultValue(e.cascadesEnabled,!0),this._numberOfCascades=this._cascadesEnabled?defaultValue(e.numberOfCascades,4):0,this._fitNearFar=!1,this._maximumCascadeDistances=[25,150,700,Number.MAX_VALUE],this._textureSize=new Cartesian2,this._isSpotLight=!1,this._cascadesEnabled?this._shadowMapCamera.frustum=new OrthographicOffCenterFrustum:defined(this._lightCamera.frustum.fov)&&(this._isSpotLight=!0),this._cascadeSplits=[new Cartesian4,new Cartesian4],this._cascadeMatrices=[new Matrix4,new Matrix4,new Matrix4,new Matrix4],this._cascadeDistances=new Cartesian4,i=this._isPointLight?6:this._cascadesEnabled?this._numberOfCascades:1,this._passes=new Array(i);for(var n=0;n<i;++n)this._passes[n]=new ShadowPass$3(t);this.debugShow=!1,this.debugFreezeFrame=!1,this._debugFreezeFrame=!1,this._debugCascadeColors=!1,this._debugLightFrustum=void 0,this._debugCameraFrustum=void 0,this._debugCascadeFrustums=new Array(this._numberOfCascades),this._debugShadowViewCommand=void 0,this._usesDepthTexture=t.depthTexture,this._isPointLight&&(this._usesDepthTexture=!1),this._primitiveRenderState=void 0,this._terrainRenderState=void 0,this._pointRenderState=void 0,createRenderStates$6(this),this._clearCommand=new ClearCommand({depth:1,color:new Color}),this._clearPassState=new PassState(t),this._size=defaultValue(e.size,2048),this.size=this._size,this._visibleColor=defaultValue(e.visibleAreaColor,Color.GREEN.withAlpha(.5)),this._invisibleColor=defaultValue(e.invisibleAreaColor,Color.YELLOW.withAlpha(.5))}function ShadowPass$3(e){this.camera=new ShadowMapCamera$3,this.passState=new PassState(e),this.framebuffer=void 0,this.textureOffsets=void 0,this.commandList=[],this.cullingVolume=void 0}function createRenderState$3(e,t){return RenderState.fromCache({cull:{enabled:!0,face:CullFace$3.BACK},depthTest:{enabled:!0},colorMask:{red:e,green:e,blue:e,alpha:e},depthMask:!0,polygonOffset:{enabled:t.polygonOffset,factor:t.polygonOffsetFactor,units:t.polygonOffsetUnits}})}function createRenderStates$6(e){var t=!e._usesDepthTexture;e._primitiveRenderState=createRenderState$3(t,e._primitiveBias),e._terrainRenderState=createRenderState$3(t,e._terrainBias),e._pointRenderState=createRenderState$3(t,e._pointBias)}function destroyFramebuffer$5(e){for(var t=e._passes.length,i=0;i<t;++i){var r=e._passes[i],n=r.framebuffer;defined(n)&&!n.isDestroyed()&&n.destroy(),r.framebuffer=void 0}e._depthAttachment=e._depthAttachment&&e._depthAttachment.destroy(),e._colorAttachment=e._colorAttachment&&e._colorAttachment.destroy()}function createFramebufferColor$1(e,t){for(var i=new Renderbuffer({context:t,width:e._textureSize.x,height:e._textureSize.y,format:RenderbufferFormat$1.DEPTH_COMPONENT16}),r=new Texture({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:PixelDatatype$1.UNSIGNED_BYTE,sampler:Sampler.NEAREST}),n=new Framebuffer({context:t,depthRenderbuffer:i,colorTextures:[r],destroyAttachments:!1}),a=e._passes.length,o=0;o<a;++o){var s=e._passes[o];s.framebuffer=n,s.passState.framebuffer=n}e._shadowMapTexture=r,e._depthAttachment=i,e._colorAttachment=r}function createFramebufferDepth$1(e,t){for(var i=new Texture({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:PixelFormat$1.DEPTH_STENCIL,pixelDatatype:PixelDatatype$1.UNSIGNED_INT_24_8,sampler:Sampler.NEAREST}),r=new Framebuffer({context:t,depthStencilTexture:i,destroyAttachments:!1}),n=e._passes.length,a=0;a<n;++a){var o=e._passes[a];o.framebuffer=r,o.passState.framebuffer=r}e._shadowMapTexture=i,e._depthAttachment=i}function createFramebufferCube$1(e,t){for(var i=new Renderbuffer({context:t,width:e._textureSize.x,height:e._textureSize.y,format:RenderbufferFormat$1.DEPTH_COMPONENT16}),r=new CubeMap({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:PixelDatatype$1.UNSIGNED_BYTE,sampler:Sampler.NEAREST}),n=[r.negativeX,r.negativeY,r.negativeZ,r.positiveX,r.positiveY,r.positiveZ],a=0;a<6;++a){var o=new Framebuffer({context:t,depthRenderbuffer:i,colorTextures:[n[a]],destroyAttachments:!1}),s=e._passes[a];s.framebuffer=o,s.passState.framebuffer=o}e._shadowMapTexture=r,e._depthAttachment=i,e._colorAttachment=r}function createFramebuffer$3(e,t){e._isPointLight?createFramebufferCube$1(e,t):e._usesDepthTexture?createFramebufferDepth$1(e,t):createFramebufferColor$1(e,t)}function checkFramebuffer$1(e,t){e._usesDepthTexture&&e._passes[0].framebuffer.status!==WebGLConstants$1.FRAMEBUFFER_COMPLETE&&(e._usesDepthTexture=!1,createRenderStates$6(e),destroyFramebuffer$5(e),createFramebuffer$3(e,t))}function updateFramebuffer$1(e,t){defined(e._passes[0].framebuffer)&&e._shadowMapTexture.width===e._textureSize.x||(destroyFramebuffer$5(e),createFramebuffer$3(e,t),checkFramebuffer$1(e,t),clearFramebuffer$3(e,t))}function clearFramebuffer$3(e,t,i){i=defaultValue(i,0),!e._isPointLight&&0!==i||(e._clearCommand.framebuffer=e._passes[i].framebuffer,e._clearCommand.execute(t,e._clearPassState))}function resize$3(e,t){e._size=t;var i=e._passes,r=i.length,n=e._textureSize;if(e._isPointLight){t=ContextLimits.maximumCubeMapSize>=t?t:ContextLimits.maximumCubeMapSize,n.x=t;var a=new BoundingRectangle(0,0,n.y=t,t);i[0].passState.viewport=a,i[1].passState.viewport=a,i[2].passState.viewport=a,i[3].passState.viewport=a,i[4].passState.viewport=a,i[5].passState.viewport=a}else 1===r?(t=ContextLimits.maximumTextureSize>=t?t:ContextLimits.maximumTextureSize,n.x=t,n.y=t,i[0].passState.viewport=new BoundingRectangle(0,0,t,t)):4===r&&(t=ContextLimits.maximumTextureSize>=2*t?t:ContextLimits.maximumTextureSize/2,n.x=2*t,n.y=2*t,i[0].passState.viewport=new BoundingRectangle(0,0,t,t),i[1].passState.viewport=new BoundingRectangle(t,0,t,t),i[2].passState.viewport=new BoundingRectangle(0,t,t,t),i[3].passState.viewport=new BoundingRectangle(t,t,t,t));e._clearPassState.viewport=new BoundingRectangle(0,0,n.x,n.y);for(var o=0;o<r;++o){var s=i[o],l=s.passState.viewport,u=l.x/n.x,c=l.y/n.y,d=l.width/n.x,h=l.height/n.y;s.textureOffsets=new Matrix4(d,0,0,u,0,h,0,c,0,0,1,0,0,0,0,1)}}DebugCameraPrimitive$1.prototype.update=function(e){if(this.show){var t,i,r=this._planesPrimitives,n=this._outlinePrimitives;if(this._updateOnChange){for(i=r.length,t=0;t<i;++t)n[t]=n[t]&&n[t].destroy(),r[t]=r[t]&&r[t].destroy();r.length=0,n.length=0}if(0===r.length){var a,o=this._camera,s=o.frustum;a=s instanceof PerspectiveFrustum?scratchPerspective$1:s instanceof PerspectiveOffCenterFrustum?scratchPerspectiveOffCenter$1:s instanceof OrthographicFrustum?scratchOrthographic$1:scratchOrthographicOffCenter$1,a=s.clone(a);var l=e.frustumSplits,u=l.length-1;u<=0&&((l=scratchSplits$4)[0]=this._camera.frustum.near,l[1]=this._camera.frustum.far,u=1);var c=o.positionWC,d=o.directionWC,h=o.upWC,p=o.rightWC;p=Cartesian3.negate(p,scratchRight$4);var f=scratchRotation$2;Matrix3.setColumn(f,0,p,f),Matrix3.setColumn(f,1,h,f),Matrix3.setColumn(f,2,d,f);var m=Quaternion.fromRotationMatrix(f,scratchOrientation$1);for(r.length=n.length=u,t=0;t<u;++t)a.near=l[t],a.far=l[t+1],r[t]=new Primitive$1({geometryInstances:new GeometryInstance({geometry:new FrustumGeometry({origin:c,orientation:m,frustum:a,_drawNearPlane:0===t}),attributes:{color:ColorGeometryInstanceAttribute.fromColor(Color.fromAlpha(this._color,.1,scratchColor$1))},id:this.id,pickPrimitive:this}),appearance:new PerInstanceColorAppearance$1({translucent:!0,flat:!0}),asynchronous:!1}),n[t]=new Primitive$1({geometryInstances:new GeometryInstance({geometry:new FrustumOutlineGeometry({origin:c,orientation:m,frustum:a,_drawNearPlane:0===t}),attributes:{color:ColorGeometryInstanceAttribute.fromColor(this._color)},id:this.id,pickPrimitive:this}),appearance:new PerInstanceColorAppearance$1({translucent:!1,flat:!0}),asynchronous:!1})}for(i=r.length,t=0;t<i;++t)n[t].update(e),r[t].update(e)}},DebugCameraPrimitive$1.prototype.isDestroyed=function(){return!1},DebugCameraPrimitive$1.prototype.destroy=function(){for(var e=this._planesPrimitives.length,t=0;t<e;++t)this._outlinePrimitives[t]=this._outlinePrimitives[t]&&this._outlinePrimitives[t].destroy(),this._planesPrimitives[t]=this._planesPrimitives[t]&&this._planesPrimitives[t].destroy();return destroyObject(this)},ViewShedMapShader.getShadowCastShaderKeyword=function(e,t,i,r){return"castViewShed "+e+" "+t+" "+i+" "+r},ViewShedMapShader.createShadowCastVertexShader=function(e,t,i){var r=e.defines.slice(0),n=e.sources.slice(0);r.push("SHADOW_MAP"),i&&r.push("GENERATE_POSITION");var a=defined(ShaderSource.findPositionVarying(e));if(t&&!a){for(var o=n.length,s=0;s<o;++s)n[s]=ShaderSource.replaceMain(n[s],"czm_shadow_cast_main");n.push("varying vec3 v_positionEC; \nvoid main() \n{ \n czm_shadow_cast_main(); \n v_positionEC = (czm_inverseProjection * gl_Position).xyz; \n}")}return new ShaderSource({defines:r,sources:n})},ViewShedMapShader.createShadowCastFragmentShader=function(e,t,i,r){var n=e.defines.slice(0),a=e.sources.slice(0),o=ShaderSource.findPositionVarying(e),s=defined(o);s||(o="v_positionEC");for(var l=a.length,u=0;u<l;++u)a[u]=ShaderSource.replaceMain(a[u],"czm_shadow_cast_main");var c="";return t&&(s||(c+="varying vec3 v_positionEC; \n"),c+="uniform vec4 shadowMap_lightPositionEC; \n"),c+=r?"void main() \n{ \n":"void main() \n{ \n czm_shadow_cast_main(); \n if (gl_FragColor.a == 0.0) \n { \n discard; \n } \n",c+=t?" float distance = length("+o+"); \n if (distance >= shadowMap_lightPositionEC.w) \n { \n discard; \n } \n distance /= shadowMap_lightPositionEC.w; // radius \n gl_FragColor = czm_packDepth(distance); \n":i?" gl_FragColor = vec4(1.0); \n":" gl_FragColor = czm_packDepth(gl_FragCoord.z); \n",c+="} \n",a.push(c),new ShaderSource({defines:n,sources:a})},ViewShedMapShader.getShadowReceiveShaderKeyword=function(e,t,i,r){return"receiveViewShed "+e._usesDepthTexture+e._polygonOffsetSupported+e._isPointLight+e._isSpotLight+(1<e._numberOfCascades)+e.debugCascadeColors+e.softShadows+t+i+r},ViewShedMapShader.createShadowReceiveVertexShader=function(e,t,i){var r=e.defines.slice(0),n=e.sources.slice(0);return r.push("SHADOW_MAP"),t&&(i?r.push("GENERATE_POSITION_AND_NORMAL"):r.push("GENERATE_POSITION")),new ShaderSource({defines:r,sources:n})},ViewShedMapShader.createShadowReceiveFragmentShader=function(e,t,i,r,n){for(var a=ShaderSource.findNormalVarying(e),o=!r&&defined(a)||r&&n,s=ShaderSource.findPositionVarying(e),l=defined(s),u=t._usesDepthTexture,c=t._polygonOffsetSupported,d=t._isPointLight,h=t._isSpotLight,p=1<t._numberOfCascades,f=t.debugCascadeColors,m=t.softShadows,g=d?t._pointBias:r?t._terrainBias:t._primitiveBias,y=e.defines.slice(0),v=e.sources.slice(0),_=v.length,C=0;C<_;++C)v[C]=ShaderSource.replaceMain(v[C],"czm_shadow_receive_main");d?y.push("USE_CUBE_MAP_SHADOW"):u&&y.push("USE_SHADOW_DEPTH_TEXTURE"),m&&!d&&y.push("USE_SOFT_SHADOWS"),p&&i&&r&&(o?y.push("ENABLE_VERTEX_LIGHTING"):y.push("ENABLE_DAYNIGHT_SHADING")),i&&g.normalShading&&o&&(y.push("USE_NORMAL_SHADING"),0<g.normalShadingSmooth&&y.push("USE_NORMAL_SHADING_SMOOTH"));var x="";return x+=d?"uniform samplerCube shadowMap_textureCube; \n":"uniform sampler2D shadowMap_texture; \n",x+="uniform mat4 shadowMap_matrix; \nuniform vec3 shadowMap_lightDirectionEC; \nuniform vec4 shadowMap_lightPositionEC; \nuniform vec4 shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness; \nuniform vec4 shadowMap_texelSizeDepthBiasAndNormalShadingSmooth; \nuniform mat4 camera_projection_matrix; \nuniform mat4 camera_view_matrix; \nuniform float far; \nuniform vec4 u_visibleColor; \nuniform vec4 u_invisibleColor; \n#ifdef LOG_DEPTH \nvarying vec3 v_logPositionEC; \n#endif \nvec4 getPositionEC() \n{ \n"+(l?" return vec4("+s+", 1.0); \n":"#ifndef LOG_DEPTH \n return czm_windowToEyeCoordinates(gl_FragCoord); \n#else \n return vec4(v_logPositionEC, 1.0); \n#endif \n")+"} \nvec3 getNormalEC() \n{ \n"+(o?" return normalize("+a+"); \n":" return vec3(1.0); \n")+" return vec3(1.0); \n} \nvoid applyNormalOffset(inout vec4 positionEC, vec3 normalEC, float nDotL) \n{ \n"+(g.normalOffset&&o?" float normalOffset = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.x; \n float normalOffsetScale = 1.0 - nDotL; \n vec3 offset = normalOffset * normalOffsetScale * normalEC; \n positionEC.xyz += offset; \n":"")+"} \n",x+=" bool visible(in vec4 result)\n {\n result.x/=result.w;\n result.y/=result.w;\n result.z/=result.w;\n return result.x>=-1.&&result.x<=1.&&result.y>=-1.&&result.y<=1.&&result.z>=-1.&&result.z<=1.;\n }\n",x+="void main() \n{ \n czm_shadow_receive_main(); \n vec4 positionEC = getPositionEC(); \n vec4 wordPos = czm_inverseView * positionEC; \n vec4 vcPos = camera_view_matrix * wordPos; \n vec3 normalEC = getNormalEC(); \n float depth = -positionEC.z; \n",x+=" czm_shadowParameters shadowParameters; \n shadowParameters.texelStepSize = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.xy; \n shadowParameters.depthBias = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.z; \n shadowParameters.normalShadingSmooth = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.w; \n shadowParameters.darkness = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.w; \n",r?x+=" shadowParameters.depthBias *= max(depth * 0.01, 1.0); \n":c||(x+=" shadowParameters.depthBias *= mix(1.0, 100.0, depth * 0.0015); \n"),x+=d?" vec4 posInEye = camera_projection_matrix * vcPos; \n if(!visible(posInEye)) {\n return;\n }\n vec3 directionEC = positionEC.xyz - shadowMap_lightPositionEC.xyz; \n float distance = length(directionEC); \n directionEC = normalize(directionEC); \n float radius = shadowMap_lightPositionEC.w; \n // Stop early if the fragment is beyond the point light radius \n if (distance > radius) \n { \n return; \n } \n vec3 directionWC = czm_inverseViewRotation * directionEC; \n shadowParameters.depth = distance / radius - 0.0003; \n shadowParameters.nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0); \n shadowParameters.texCoords = directionWC; \n float visibility = czm_shadowVisibility(shadowMap_textureCube, shadowParameters); \n":h?" vec3 directionEC = normalize(positionEC.xyz - shadowMap_lightPositionEC.xyz); \n float nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0); \n applyNormalOffset(positionEC, normalEC, nDotL); \n vec4 shadowPosition = shadowMap_matrix * positionEC; \n // Spot light uses a perspective projection, so perform the perspective divide \n shadowPosition /= shadowPosition.w; \n // Stop early if the fragment is not in the shadow bounds \n if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0)))) \n { \n return; \n } \n shadowParameters.texCoords = shadowPosition.xy; \n shadowParameters.depth = shadowPosition.z; \n shadowParameters.nDotL = nDotL; \n float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); \n":p?" float maxDepth = shadowMap_cascadeSplits[1].w; \n // Stop early if the eye depth exceeds the last cascade \n if (depth > maxDepth) \n { \n return; \n } \n // Get the cascade based on the eye-space depth \n vec4 weights = czm_cascadeWeights(depth); \n // Apply normal offset \n float nDotL = clamp(dot(normalEC, shadowMap_lightDirectionEC), 0.0, 1.0); \n applyNormalOffset(positionEC, normalEC, nDotL); \n // Transform position into the cascade \n vec4 shadowPosition = czm_cascadeMatrix(weights) * positionEC; \n // Get visibility \n shadowParameters.texCoords = shadowPosition.xy; \n shadowParameters.depth = shadowPosition.z; \n shadowParameters.nDotL = nDotL; \n float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); \n // Fade out shadows that are far away \n float shadowMapMaximumDistance = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.z; \n float fade = max((depth - shadowMapMaximumDistance * 0.8) / (shadowMapMaximumDistance * 0.2), 0.0); \n visibility = mix(visibility, 1.0, fade); \n"+(f?" // Draw cascade colors for debugging \n gl_FragColor *= czm_cascadeColor(weights); \n":""):" float nDotL = clamp(dot(normalEC, shadowMap_lightDirectionEC), 0.0, 1.0); \n applyNormalOffset(positionEC, normalEC, nDotL); \n vec4 shadowPosition = shadowMap_matrix * positionEC; \n // Stop early if the fragment is not in the shadow bounds \n if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0)))) \n { \n return; \n } \n shadowParameters.texCoords = shadowPosition.xy; \n shadowParameters.depth = shadowPosition.z; \n shadowParameters.nDotL = nDotL; \n float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); \n",x+=" if(visibility > 0.3){ \n gl_FragColor = mix(gl_FragColor, u_visibleColor, .5);\n } else { \n gl_FragColor = mix(gl_FragColor, u_invisibleColor, .5);\n }\n} \n",v.push(x),new ShaderSource({defines:y,sources:v})},ViewShedMap.MAXIMUM_DISTANCE=2e4,ViewShedMap.prototype.debugCreateRenderStates=function(){createRenderStates$6(this)},Object.defineProperties(ViewShedMap.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this.dirty=this._enabled!==e,this._enabled=e}},normalOffset:{get:function(){return this._normalOffset},set:function(e){this.dirty=this._normalOffset!==e,this._normalOffset=e,this._terrainBias.normalOffset=e,this._primitiveBias.normalOffset=e,this._pointBias.normalOffset=e}},softShadows:{get:function(){return this._softShadows},set:function(e){this.dirty=this._softShadows!==e,this._softShadows=e}},size:{get:function(){return this._size},set:function(e){resize$3(this,e)}},outOfView:{get:function(){return this._outOfView}},shadowMapCullingVolume:{get:function(){return this._shadowMapCullingVolume}},passes:{get:function(){return this._passes}},isPointLight:{get:function(){return this._isPointLight}},debugCascadeColors:{get:function(){return this._debugCascadeColors},set:function(e){this.dirty=this._debugCascadeColors!==e,this._debugCascadeColors=e}},visibleColor:{get:function(){return this._visibleColor},set:function(e){this._visibleColor=e}},invisibleColor:{get:function(){return this._invisibleColor},set:function(e){this._invisibleColor=e}}});var scratchViewport$5=new BoundingRectangle;function createDebugShadowViewCommand$3(e,t){var i;i=e._isPointLight?"uniform samplerCube shadowMap_textureCube; \nvarying vec2 v_textureCoordinates; \nvoid main() \n{ \n vec2 uv = v_textureCoordinates; \n vec3 dir; \n \n if (uv.y < 0.5) \n { \n if (uv.x < 0.333) \n { \n dir.x = -1.0; \n dir.y = uv.x * 6.0 - 1.0; \n dir.z = uv.y * 4.0 - 1.0; \n } \n else if (uv.x < 0.666) \n { \n dir.y = -1.0; \n dir.x = uv.x * 6.0 - 3.0; \n dir.z = uv.y * 4.0 - 1.0; \n } \n else \n { \n dir.z = -1.0; \n dir.x = uv.x * 6.0 - 5.0; \n dir.y = uv.y * 4.0 - 1.0; \n } \n } \n else \n { \n if (uv.x < 0.333) \n { \n dir.x = 1.0; \n dir.y = uv.x * 6.0 - 1.0; \n dir.z = uv.y * 4.0 - 3.0; \n } \n else if (uv.x < 0.666) \n { \n dir.y = 1.0; \n dir.x = uv.x * 6.0 - 3.0; \n dir.z = uv.y * 4.0 - 3.0; \n } \n else \n { \n dir.z = 1.0; \n dir.x = uv.x * 6.0 - 5.0; \n dir.y = uv.y * 4.0 - 3.0; \n } \n } \n \n float shadow = czm_unpackDepth(textureCube(shadowMap_textureCube, dir)); \n gl_FragColor = vec4(vec3(shadow), 1.0); \n} \n":"uniform sampler2D shadowMap_texture; \nvarying vec2 v_textureCoordinates; \nvoid main() \n{ \n"+(e._usesDepthTexture?" float shadow = texture2D(shadowMap_texture, v_textureCoordinates).r; \n":" float shadow = czm_unpackDepth(texture2D(shadowMap_texture, v_textureCoordinates)); \n")+" gl_FragColor = vec4(vec3(shadow), 1.0); \n} \n";var r=t.createViewportQuadCommand(i,{uniformMap:{shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture}}});return r.pass=Pass$1.OVERLAY,r}function updateDebugShadowViewCommand$3(e,t){var i=t.context,r=t.context.drawingBufferWidth,n=t.context.drawingBufferHeight,a=.3*Math.min(r,n),o=scratchViewport$5;o.x=r-a,o.y=0,o.width=a,o.height=a;var s=e._debugShadowViewCommand;defined(s)||(s=createDebugShadowViewCommand$3(e,i),e._debugShadowViewCommand=s),defined(s.renderState)&&BoundingRectangle.equals(s.renderState.viewport,o)||(s.renderState=RenderState.fromCache({viewport:BoundingRectangle.clone(o)})),t.commandList.push(e._debugShadowViewCommand)}var frustumCornersNDC$4=new Array(8);frustumCornersNDC$4[0]=new Cartesian4(-1,-1,-1,1),frustumCornersNDC$4[1]=new Cartesian4(1,-1,-1,1),frustumCornersNDC$4[2]=new Cartesian4(1,1,-1,1),frustumCornersNDC$4[3]=new Cartesian4(-1,1,-1,1),frustumCornersNDC$4[4]=new Cartesian4(-1,-1,1,1),frustumCornersNDC$4[5]=new Cartesian4(1,-1,1,1),frustumCornersNDC$4[6]=new Cartesian4(1,1,1,1),frustumCornersNDC$4[7]=new Cartesian4(-1,1,1,1);for(var scratchMatrix$3=new Matrix4,scratchFrustumCorners$4=new Array(8),i$5=0;i$5<8;++i$5)scratchFrustumCorners$4[i$5]=new Cartesian4;function createDebugPointLight$3(e,t){return new Primitive$1({geometryInstances:[new GeometryInstance({geometry:new BoxOutlineGeometry({minimum:new Cartesian3(-.5,-.5,-.5),maximum:new Cartesian3(.5,.5,.5)}),attributes:{color:ColorGeometryInstanceAttribute.fromColor(t)}}),new GeometryInstance({geometry:new SphereOutlineGeometry({radius:.5}),attributes:{color:ColorGeometryInstanceAttribute.fromColor(t)}})],appearance:new PerInstanceColorAppearance$1({translucent:!1,flat:!0}),asynchronous:!1,modelMatrix:e})}var debugOutlineColors$3=[Color.RED,Color.GREEN,Color.BLUE,Color.MAGENTA],scratchScale$8=new Cartesian3;function applyDebugSettings$3(e,t){updateDebugShadowViewCommand$3(e,t);var i=e.debugFreezeFrame&&!e._debugFreezeFrame;if(e._debugFreezeFrame=e.debugFreezeFrame,e.debugFreezeFrame&&(i&&(e._debugCameraFrustum=e._debugCameraFrustum&&e._debugCameraFrustum.destroy(),e._debugCameraFrustum=new DebugCameraPrimitive$1({camera:e._sceneCamera,color:Color.CYAN,updateOnChange:!1})),e._debugCameraFrustum.update(t)),e._cascadesEnabled){if(e.debugFreezeFrame){i&&(e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=new DebugCameraPrimitive$1({camera:e._shadowMapCamera,color:Color.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t);for(var r=0;r<e._numberOfCascades;++r)i&&(e._debugCascadeFrustums[r]=e._debugCascadeFrustums[r]&&e._debugCascadeFrustums[r].destroy(),e._debugCascadeFrustums[r]=new DebugCameraPrimitive$1({camera:e._passes[r].camera,color:debugOutlineColors$3[r],updateOnChange:!1})),e._debugCascadeFrustums[r].update(t)}}else if(e._isPointLight){if(!defined(e._debugLightFrustum)||e._needsUpdate){var n=e._shadowMapCamera.positionWC,a=Quaternion.IDENTITY,o=2*e._pointLightRadius,s=Cartesian3.fromElements(o,o,o,scratchScale$8),l=Matrix4.fromTranslationQuaternionRotationScale(n,a,s,scratchMatrix$3);e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=createDebugPointLight$3(l,Color.YELLOW)}e._debugLightFrustum.update(t)}else defined(e._debugLightFrustum)&&!e._needsUpdate||(e._debugLightFrustum=new DebugCameraPrimitive$1({camera:e._shadowMapCamera,color:Color.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t)}function ShadowMapCamera$3(){this.viewMatrix=new Matrix4,this.inverseViewMatrix=new Matrix4,this.frustum=void 0,this.positionCartographic=new Cartographic,this.positionWC=new Cartesian3,this.directionWC=Cartesian3.clone(Cartesian3.UNIT_Z),this.upWC=Cartesian3.clone(Cartesian3.UNIT_Y),this.rightWC=Cartesian3.clone(Cartesian3.UNIT_X),this.viewProjectionMatrix=new Matrix4}ShadowMapCamera$3.prototype.clone=function(e){Matrix4.clone(e.viewMatrix,this.viewMatrix),Matrix4.clone(e.inverseViewMatrix,this.inverseViewMatrix),this.frustum=e.frustum.clone(this.frustum),Cartographic.clone(e.positionCartographic,this.positionCartographic),Cartesian3.clone(e.positionWC,this.positionWC),Cartesian3.clone(e.directionWC,this.directionWC),Cartesian3.clone(e.upWC,this.upWC),Cartesian3.clone(e.rightWC,this.rightWC)};var scaleBiasMatrix$3=new Matrix4(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);ShadowMapCamera$3.prototype.getViewProjection=function(){var e=this.viewMatrix,t=this.frustum.projectionMatrix;return Matrix4.multiply(t,e,this.viewProjectionMatrix),Matrix4.multiply(scaleBiasMatrix$3,this.viewProjectionMatrix,this.viewProjectionMatrix),this.viewProjectionMatrix};var scratchSplits$5=new Array(5),scratchFrustum$3=new PerspectiveFrustum,scratchCascadeDistances$3=new Array(4),scratchMin$4=new Cartesian3,scratchMax$4=new Cartesian3;function computeCascades$3(e,t){var i,r=e._shadowMapCamera,n=e._sceneCamera,a=n.frustum.near,o=n.frustum.far,s=e._numberOfCascades,l=o-a,u=o/a,c=.9,d=!1;t.viewShedState.closestObjectSize<200&&(d=!0,c=.9);var h=scratchCascadeDistances$3,p=scratchSplits$5;for(p[0]=a,p[s]=o,i=0;i<s;++i){var f=(i+1)/s,m=a*Math.pow(u,f),g=a+l*f,y=CesiumMath.lerp(g,m,c);p[i+1]=y,h[i]=y-p[i]}if(d){for(i=0;i<s;++i)h[i]=Math.min(h[i],e._maximumCascadeDistances[i]);var v=p[0];for(i=0;i<s-1;++i)v+=h[i],p[i+1]=v}Cartesian4.unpack(p,0,e._cascadeSplits[0]),Cartesian4.unpack(p,1,e._cascadeSplits[1]),Cartesian4.unpack(h,0,e._cascadeDistances);var _=r.frustum,C=_.left,x=_.right,b=_.bottom,A=_.top,S=_.near,w=_.far,E=r.positionWC,T=r.directionWC,P=r.upWC,M=n.frustum.clone(scratchFrustum$3),D=r.getViewProjection();for(i=0;i<s;++i){M.near=p[i],M.far=p[i+1];for(var I=Matrix4.multiply(M.projectionMatrix,n.viewMatrix,scratchMatrix$3),O=Matrix4.inverse(I,scratchMatrix$3),R=Matrix4.multiply(D,O,scratchMatrix$3),L=Cartesian3.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,scratchMin$4),N=Cartesian3.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,scratchMax$4),k=0;k<8;++k){var B=Cartesian4.clone(frustumCornersNDC$4[k],scratchFrustumCorners$4[k]);Matrix4.multiplyByVector(R,B,B),Cartesian3.divideByScalar(B,B.w,B),Cartesian3.minimumByComponent(B,L,L),Cartesian3.maximumByComponent(B,N,N)}L.x=Math.max(L.x,0),L.y=Math.max(L.y,0),L.z=0,N.x=Math.min(N.x,1),N.y=Math.min(N.y,1),N.z=Math.min(N.z,1);var F=e._passes[i],V=F.camera;V.clone(r);var z=V.frustum;z.left=C+L.x*(x-C),z.right=C+N.x*(x-C),z.bottom=b+L.y*(A-b),z.top=b+N.y*(A-b),z.near=S+L.z*(w-S),z.far=S+N.z*(w-S),F.cullingVolume=V.frustum.computeCullingVolume(E,T,P);var U=e._cascadeMatrices[i];Matrix4.multiply(V.getViewProjection(),n.inverseViewMatrix,U),Matrix4.multiply(F.textureOffsets,U,U)}}var scratchLightView$3=new Matrix4,scratchRight$5=new Cartesian3,scratchUp$3=new Cartesian3,scratchTranslation$3=new Cartesian3;function fitShadowMapToScene$3(e,t){var i=e._shadowMapCamera,r=e._sceneCamera,n=Matrix4.multiply(r.frustum.projectionMatrix,r.viewMatrix,scratchMatrix$3),a=Matrix4.inverse(n,scratchMatrix$3),o=i.directionWC,s=r.directionWC;Cartesian3.equalsEpsilon(o,s,CesiumMath.EPSILON10)&&(s=r.upWC);var l=Cartesian3.cross(o,s,scratchRight$5);s=Cartesian3.cross(l,o,scratchUp$3),Cartesian3.normalize(s,s),Cartesian3.normalize(l,l);for(var u=Cartesian3.fromElements(0,0,0,scratchTranslation$3),c=Matrix4.computeView(u,o,s,l,scratchLightView$3),d=Matrix4.multiply(c,a,scratchMatrix$3),h=Cartesian3.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,scratchMin$4),p=Cartesian3.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,scratchMax$4),f=0;f<8;++f){var m=Cartesian4.clone(frustumCornersNDC$4[f],scratchFrustumCorners$4[f]);Matrix4.multiplyByVector(d,m,m),Cartesian3.divideByScalar(m,m.w,m),Cartesian3.minimumByComponent(m,h,h),Cartesian3.maximumByComponent(m,p,p)}p.z+=1e3,h.z-=10;var g=scratchTranslation$3;g.x=-.5*(h.x+p.x),g.y=-.5*(h.y+p.y),g.z=-p.z;var y=Matrix4.fromTranslation(g,scratchMatrix$3);c=Matrix4.multiply(y,c,c);var v=.5*(p.x-h.x),_=.5*(p.y-h.y),C=p.z-h.z,x=i.frustum;x.left=-v,x.right=v,x.bottom=-_,x.top=_,x.near=.01,x.far=C,Matrix4.clone(c,i.viewMatrix),Matrix4.inverse(c,i.inverseViewMatrix),Matrix4.getTranslation(i.inverseViewMatrix,i.positionWC),t.mapProjection.ellipsoid.cartesianToCartographic(i.positionWC,i.positionCartographic),Cartesian3.clone(o,i.directionWC),Cartesian3.clone(s,i.upWC),Cartesian3.clone(l,i.rightWC)}var directions$3=[new Cartesian3(-1,0,0),new Cartesian3(0,-1,0),new Cartesian3(0,0,-1),new Cartesian3(1,0,0),new Cartesian3(0,1,0),new Cartesian3(0,0,1)],ups$3=[new Cartesian3(0,-1,0),new Cartesian3(0,0,-1),new Cartesian3(0,-1,0),new Cartesian3(0,-1,0),new Cartesian3(0,0,1),new Cartesian3(0,-1,0)],rights$3=[new Cartesian3(0,0,1),new Cartesian3(1,0,0),new Cartesian3(-1,0,0),new Cartesian3(0,0,-1),new Cartesian3(1,0,0),new Cartesian3(1,0,0)];function computeOmnidirectional$3(e,t){var i=new PerspectiveFrustum;i.fov=CesiumMath.PI_OVER_TWO,i.near=1,i.far=e._pointLightRadius,i.aspectRatio=1;for(var r=0;r<6;++r){var n=e._passes[r].camera;n.positionWC=e._shadowMapCamera.positionWC,n.positionCartographic=t.mapProjection.ellipsoid.cartesianToCartographic(n.positionWC,n.positionCartographic),n.directionWC=directions$3[r],n.upWC=ups$3[r],n.rightWC=rights$3[r],Matrix4.computeView(n.positionWC,n.directionWC,n.upWC,n.rightWC,n.viewMatrix),Matrix4.inverse(n.viewMatrix,n.inverseViewMatrix),n.frustum=i}}var scratchCartesian1$5=new Cartesian3,scratchCartesian2$8=new Cartesian3,scratchBoundingSphere$7=new BoundingSphere,scratchCenter$4=scratchBoundingSphere$7.center;function checkVisibility$3(e,t){var i=e._sceneCamera,r=e._shadowMapCamera,n=scratchBoundingSphere$7;if(e._cascadesEnabled){if(i.frustum.near>=e.maximumDistance)return e._outOfView=!0,void(e._needsUpdate=!1);var a=t.mapProjection.ellipsoid.geodeticSurfaceNormal(i.positionWC,scratchCartesian1$5),o=Cartesian3.negate(r.directionWC,scratchCartesian2$8),s=Cartesian3.dot(a,o),l=CesiumMath.clamp(s/.1,0,1);if(e._darkness=CesiumMath.lerp(1,e.darkness,l),s<0)return e._outOfView=!0,void(e._needsUpdate=!1);e._needsUpdate=!0,e._outOfView=!1}else if(e._isPointLight)n.center=r.positionWC,n.radius=e._pointLightRadius,e._outOfView=t.cullingVolume.computeVisibility(n)===Intersect$1.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(n),BoundingSphere.clone(n,e._boundingSphere);else{var u=r.frustum.far/2,c=Cartesian3.add(r.positionWC,Cartesian3.multiplyByScalar(r.directionWC,u,scratchCenter$4),scratchCenter$4);n.center=c,n.radius=u,e._outOfView=t.cullingVolume.computeVisibility(n)===Intersect$1.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(n),BoundingSphere.clone(n,e._boundingSphere)}}function updateCameras$3(e,t){var i=t.camera,r=e._lightCamera,n=e._sceneCamera,a=e._shadowMapCamera;e._cascadesEnabled?Cartesian3.clone(r.directionWC,a.directionWC):e._isPointLight?Cartesian3.clone(r.positionWC,a.positionWC):a.clone(r);var o,s,l=e._lightDirectionEC;Matrix4.multiplyByPointAsVector(i.viewMatrix,a.directionWC,l),Cartesian3.normalize(l,l),Cartesian3.negate(l,l),Matrix4.multiplyByPoint(i.viewMatrix,a.positionWC,e._lightPositionEC),e._lightPositionEC.w=e._pointLightRadius,s=e._fitNearFar?(o=Math.min(t.viewShedState.nearPlane,e.maximumDistance),Math.min(t.viewShedState.farPlane,e.maximumDistance+1)):(o=i.frustum.near,e.maximumDistance),e._sceneCamera=Camera$1.clone(i,n),i.frustum.clone(e._sceneCamera.frustum),e._sceneCamera.frustum.near=o,e._sceneCamera.frustum.far=s,e._distance=s-o,checkVisibility$3(e,t),!e._outOfViewPrevious&&e._outOfView&&(e._needsUpdate=!0),e._outOfViewPrevious=e._outOfView}ViewShedMap.prototype.update=function(e){if(updateCameras$3(this,e),this._needsUpdate)if(updateFramebuffer$1(this,e.context),this._isPointLight&&computeOmnidirectional$3(this,e),this._cascadesEnabled&&(fitShadowMapToScene$3(this,e),1<this._numberOfCascades&&computeCascades$3(this,e)),this._isPointLight)this._shadowMapCullingVolume=CullingVolume.fromBoundingSphere(this._boundingSphere);else{var t=this._shadowMapCamera,i=t.positionWC,r=t.directionWC,n=t.upWC;this._shadowMapCullingVolume=t.frustum.computeCullingVolume(i,r,n),1===this._passes.length&&this._passes[0].camera.clone(t)}if(1===this._passes.length){var a=this._sceneCamera.inverseViewMatrix;Matrix4.multiply(this._shadowMapCamera.getViewProjection(),a,this._shadowMapMatrix)}this.debugShow&&applyDebugSettings$3(this,e)},ViewShedMap.prototype.updatePass=function(e,t){clearFramebuffer$3(this,e,t)};var scratchTexelStepSize$3=new Cartesian2;function combineUniforms$3(t,e,i){var r=t._isPointLight?t._pointBias:i?t._terrainBias:t._primitiveBias;return combine(e,{shadowMap_texture:function(){return t._shadowMapTexture},shadowMap_textureCube:function(){return t._shadowMapTexture},shadowMap_matrix:function(){return t._shadowMapMatrix},shadowMap_cascadeSplits:function(){return t._cascadeSplits},shadowMap_cascadeMatrices:function(){return t._cascadeMatrices},shadowMap_lightDirectionEC:function(){return t._lightDirectionEC},shadowMap_lightPositionEC:function(){return t._lightPositionEC},shadowMap_cascadeDistances:function(){return t._cascadeDistances},shadowMap_texelSizeDepthBiasAndNormalShadingSmooth:function(){var e=scratchTexelStepSize$3;return e.x=1/t._textureSize.x,e.y=1/t._textureSize.y,Cartesian4.fromElements(e.x,e.y,r.depthBias,r.normalShadingSmooth,this.combinedUniforms1)},shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness:function(){return Cartesian4.fromElements(r.normalOffsetScale,t._distance,t.maximumDistance,t._darkness,this.combinedUniforms2)},camera_projection_matrix:function(){return t._lightCamera.frustum.projectionMatrix},camera_view_matrix:function(){return t._lightCamera.viewMatrix},far:function(){return t._pointLightRadius},u_visibleColor:function(){return t.visibleColor},u_invisibleColor:function(){return t.invisibleColor},combinedUniforms1:new Cartesian4,combinedUniforms2:new Cartesian4},!1)}function createCastDerivedCommand$1(e,t,i,r,n,a){var o,s,l;if(defined(a)&&(o=a.shaderProgram,s=a.renderState,l=a.uniformMap),(a=DrawCommand.shallowClone(i,a)).castShadows=!0,a.receiveShadows=!1,!defined(o)||n!==i.shaderProgram.id||t){var u=i.shaderProgram,c=i.pass===Pass$1.GLOBE,d=i.pass!==Pass$1.TRANSLUCENT,h=e._isPointLight,p=e._usesDepthTexture,f=ViewShedMapShader.getShadowCastShaderKeyword(h,c,p,d);if(!defined(o=r.shaderCache.getDerivedShaderProgram(u,f))){var m=u.vertexShaderSource,g=u.fragmentShaderSource,y=ViewShedMapShader.createShadowCastVertexShader(m,h,c),v=ViewShedMapShader.createShadowCastFragmentShader(g,h,p,d);o=r.shaderCache.createDerivedShaderProgram(u,f,{vertexShaderSource:y,fragmentShaderSource:v,attributeLocations:u._attributeLocations})}s=e._primitiveRenderState,h?s=e._pointRenderState:c&&(s=e._terrainRenderState),i.renderState.cull.enabled||((s=clone(s,!1)).cull=clone(s.cull,!1),s.cull.enabled=!1,s=RenderState.fromCache(s)),l=combineUniforms$3(e,i.uniformMap,c)}return a.shaderProgram=o,a.renderState=s,a.uniformMap=l,a}function WaterMaterialProperty(e){this._definitionChanged=new Event,this.baseWaterColor=defaultValue(e.baseWaterColor,new Geoworld.Color(.2,.3,.6,.5)),this.waterFrequency=defaultValue(e.waterFrequency,1e3),this.animationSpeed=defaultValue(e.animationSpeed,.01),this.amplitude=defaultValue(e.amplitude,10),this._translucnet=defaultValue(e.translucent,!0),this._time=(new Date).getTime()}ViewShedMap.createReceiveDerivedCommand=function(e,t,i,r,n){defined(n)||(n={});var a=0<e.length,o=t.shaderProgram,s=o.vertexShaderSource,l=o.fragmentShaderSource,u=t.pass===Pass$1.GLOBE,c=!1;if(u&&(c=t.owner.data.renderedMesh.encoding.hasVertexNormals),t.receiveShadows&&a){var d,h;defined(n.receiveCommand)&&(d=n.receiveCommand.shaderProgram,h=n.receiveCommand.uniformMap),n.receiveCommand=DrawCommand.shallowClone(t,n.receiveCommand),n.castShadows=!1,n.receiveShadows=!0;var p=n.receiveShaderCastShadows!==t.castShadows,f=n.receiveShaderProgramId!==t.shaderProgram.id;if(!defined(d)||f||i||p){var m=ViewShedMapShader.getShadowReceiveShaderKeyword(e[0],t.castShadows,u,c);if(!defined(d=r.shaderCache.getDerivedShaderProgram(o,m))){var g=ViewShedMapShader.createShadowReceiveVertexShader(s,u,c),y=ViewShedMapShader.createShadowReceiveFragmentShader(l,e[0],t.castShadows,u,c);d=r.shaderCache.createDerivedShaderProgram(o,m,{vertexShaderSource:g,fragmentShaderSource:y,attributeLocations:o._attributeLocations})}h=combineUniforms$3(e[0],t.uniformMap,u)}n.receiveCommand.shaderProgram=d,n.receiveCommand.uniformMap=h,n.receiveShaderProgramId=t.shaderProgram.id,n.receiveShaderCastShadows=t.castShadows}return n},ViewShedMap.createCastDerivedCommand=function(e,t,i,r,n){if(defined(n)||(n={}),t.castShadows){var a=n.castCommands;defined(a)||(a=n.castCommands=[]);var o=n.castShaderProgramId,s=e.length;a.length=s;for(var l=0;l<s;++l)a[l]=createCastDerivedCommand$1(e[l],i,t,r,o,a[l]);n.castShaderProgramId=t.shaderProgram.id}return n},ViewShedMap.prototype.isDestroyed=function(){return!1},ViewShedMap.prototype.destroy=function(){destroyFramebuffer$5(this),this._debugLightFrustum=this._debugLightFrustum&&this._debugLightFrustum.destroy(),this._debugCameraFrustum=this._debugCameraFrustum&&this._debugCameraFrustum.destroy(),this._debugShadowViewCommand=this._debugShadowViewCommand&&this._debugShadowViewCommand.shaderProgram&&this._debugShadowViewCommand.shaderProgram.destroy();for(var e=0;e<this._numberOfCascades;++e)this._debugCascadeFrustums[e]=this._debugCascadeFrustums[e]&&this._debugCascadeFrustums[e].destroy();return destroyObject(this)},Object.defineProperties(WaterMaterialProperty.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}}}),WaterMaterialProperty.prototype.getType=function(e){return Material.WaterType},WaterMaterialProperty.prototype.getValue=function(e,t){return defined(t)||(t={}),t.normalMap=GEOWORLD_BASE_URL+"./Assets/Images/waterNormals.jpg",t.baseWaterColor=this.baseWaterColor,t.frequency=this.waterFrequency,t.animationSpeed=this.animationSpeed,t.amplitude=this.amplitude,t},WaterMaterialProperty.prototype.update=function(){var e=JulianDate.now();return this.getValue(e)},WaterMaterialProperty.prototype.isTranslucent=function(){return this._translucnet},WaterMaterialProperty.prototype.equals=function(e){return this===e||e instanceof WaterMaterialProperty&&Property.equals(this.baseWaterColor,e.baseWaterColor)};var HeightmapEncoding={NONE:0,LERC:1},HeightmapEncoding$1=Object.freeze(HeightmapEncoding),TerrainQuantization={NONE:0,BITS12:1},TerrainQuantization$1=Object.freeze(TerrainQuantization),cartesian3Scratch=new Cartesian3,cartesian3DimScratch=new Cartesian3,cartesian2Scratch=new Cartesian2,matrix4Scratch=new Matrix4,matrix4Scratch2=new Matrix4,SHIFT_LEFT_12=Math.pow(2,12);function TerrainEncoding(e,t,i,r,n,a){var o,s,l,u=TerrainQuantization$1.NONE;if(defined(e)&&defined(t)&&defined(i)&&defined(r)){var c=e.minimum,d=e.maximum,h=Cartesian3.subtract(d,c,cartesian3DimScratch),p=i-t;u=Math.max(Cartesian3.maximumComponent(h),p)<SHIFT_LEFT_12-1?TerrainQuantization$1.BITS12:TerrainQuantization$1.NONE,o=e.center,s=Matrix4.inverseTransformation(r,new Matrix4);var f=Cartesian3.negate(c,cartesian3Scratch);Matrix4.multiply(Matrix4.fromTranslation(f,matrix4Scratch),s,s);var m=cartesian3Scratch;m.x=1/h.x,m.y=1/h.y,m.z=1/h.z,Matrix4.multiply(Matrix4.fromScale(m,matrix4Scratch),s,s),l=Matrix4.clone(r),Matrix4.setTranslation(l,Cartesian3.ZERO,l),r=Matrix4.clone(r,new Matrix4);var g=Matrix4.fromTranslation(c,matrix4Scratch),y=Matrix4.fromScale(h,matrix4Scratch2),v=Matrix4.multiply(g,y,matrix4Scratch);Matrix4.multiply(r,v,r),Matrix4.multiply(l,v,l)}this.quantization=u,this.minimumHeight=t,this.maximumHeight=i,this.center=o,this.toScaledENU=s,this.fromScaledENU=r,this.matrix=l,this.hasVertexNormals=n,this.hasWebMercatorT=defaultValue(a,!1)}TerrainEncoding.prototype.encode=function(e,t,i,r,n,a,o){var s=r.x,l=r.y;if(this.quantization===TerrainQuantization$1.BITS12){(i=Matrix4.multiplyByPoint(this.toScaledENU,i,cartesian3Scratch)).x=CesiumMath.clamp(i.x,0,1),i.y=CesiumMath.clamp(i.y,0,1),i.z=CesiumMath.clamp(i.z,0,1);var u=this.maximumHeight-this.minimumHeight,c=CesiumMath.clamp((n-this.minimumHeight)/u,0,1);Cartesian2.fromElements(i.x,i.y,cartesian2Scratch);var d=AttributeCompression.compressTextureCoordinates(cartesian2Scratch);Cartesian2.fromElements(i.z,c,cartesian2Scratch);var h=AttributeCompression.compressTextureCoordinates(cartesian2Scratch);Cartesian2.fromElements(s,l,cartesian2Scratch);var p=AttributeCompression.compressTextureCoordinates(cartesian2Scratch);if(e[t++]=d,e[t++]=h,e[t++]=p,this.hasWebMercatorT){Cartesian2.fromElements(o,0,cartesian2Scratch);var f=AttributeCompression.compressTextureCoordinates(cartesian2Scratch);e[t++]=f}}else Cartesian3.subtract(i,this.center,cartesian3Scratch),e[t++]=cartesian3Scratch.x,e[t++]=cartesian3Scratch.y,e[t++]=cartesian3Scratch.z,e[t++]=n,e[t++]=s,e[t++]=l,this.hasWebMercatorT&&(e[t++]=o);return this.hasVertexNormals&&(e[t++]=AttributeCompression.octPackFloat(a)),t},TerrainEncoding.prototype.decodePosition=function(e,t,i){if(defined(i)||(i=new Cartesian3),t*=this.getStride(),this.quantization!==TerrainQuantization$1.BITS12)return i.x=e[t],i.y=e[t+1],i.z=e[t+2],Cartesian3.add(i,this.center,i);var r=AttributeCompression.decompressTextureCoordinates(e[t],cartesian2Scratch);i.x=r.x,i.y=r.y;var n=AttributeCompression.decompressTextureCoordinates(e[t+1],cartesian2Scratch);return i.z=n.x,Matrix4.multiplyByPoint(this.fromScaledENU,i,i)},TerrainEncoding.prototype.decodeTextureCoordinates=function(e,t,i){return defined(i)||(i=new Cartesian2),t*=this.getStride(),this.quantization===TerrainQuantization$1.BITS12?AttributeCompression.decompressTextureCoordinates(e[t+2],i):Cartesian2.fromElements(e[t+4],e[t+5],i)},TerrainEncoding.prototype.decodeHeight=function(e,t){return t*=this.getStride(),this.quantization!==TerrainQuantization$1.BITS12?e[t+3]:AttributeCompression.decompressTextureCoordinates(e[t+1],cartesian2Scratch).y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight},TerrainEncoding.prototype.decodeWebMercatorT=function(e,t){return t*=this.getStride(),this.quantization===TerrainQuantization$1.BITS12?AttributeCompression.decompressTextureCoordinates(e[t+3],cartesian2Scratch).x:e[t+6]},TerrainEncoding.prototype.getOctEncodedNormal=function(e,t,i){var r=e[t=(t+1)*this.getStride()-1]/256,n=Math.floor(r),a=256*(r-n);return Cartesian2.fromElements(n,a,i)},TerrainEncoding.prototype.getStride=function(){var e;switch(this.quantization){case TerrainQuantization$1.BITS12:e=3;break;default:e=6}return this.hasWebMercatorT&&++e,this.hasVertexNormals&&++e,e};var attributesNone={position3DAndHeight:0,textureCoordAndEncodedNormals:1},attributes={compressed0:0,compressed1:1};TerrainEncoding.prototype.getAttributes=function(e){var t,i=ComponentDatatype$1.FLOAT,r=ComponentDatatype$1.getSizeInBytes(i);if(this.quantization===TerrainQuantization$1.NONE){var n=2;return this.hasWebMercatorT&&++n,this.hasVertexNormals&&++n,t=(4+n)*r,[{index:attributesNone.position3DAndHeight,vertexBuffer:e,componentDatatype:i,componentsPerAttribute:4,offsetInBytes:0,strideInBytes:t},{index:attributesNone.textureCoordAndEncodedNormals,vertexBuffer:e,componentDatatype:i,componentsPerAttribute:n,offsetInBytes:4*r,strideInBytes:t}]}var a=3,o=0;return(this.hasWebMercatorT||this.hasVertexNormals)&&++a,this.hasWebMercatorT&&this.hasVertexNormals?(t=(a+ ++o)*r,[{index:attributes.compressed0,vertexBuffer:e,componentDatatype:i,componentsPerAttribute:a,offsetInBytes:0,strideInBytes:t},{index:attributes.compressed1,vertexBuffer:e,componentDatatype:i,componentsPerAttribute:o,offsetInBytes:a*r,strideInBytes:t}]):[{index:attributes.compressed0,vertexBuffer:e,componentDatatype:i,componentsPerAttribute:a}]},TerrainEncoding.prototype.getAttributeLocations=function(){return this.quantization===TerrainQuantization$1.NONE?attributesNone:attributes},TerrainEncoding.clone=function(e,t){return defined(t)||(t=new TerrainEncoding),t.quantization=e.quantization,t.minimumHeight=e.minimumHeight,t.maximumHeight=e.maximumHeight,t.center=Cartesian3.clone(e.center),t.toScaledENU=Matrix4.clone(e.toScaledENU),t.fromScaledENU=Matrix4.clone(e.fromScaledENU),t.matrix=Matrix4.clone(e.matrix),t.hasVertexNormals=e.hasVertexNormals,t.hasWebMercatorT=e.hasWebMercatorT,t};var HeightmapTessellator={};HeightmapTessellator.DEFAULT_STRUCTURE=Object.freeze({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});var cartesian3Scratch$1=new Cartesian3,matrix4Scratch$1=new Matrix4,minimumScratch=new Cartesian3,maximumScratch=new Cartesian3;function TerrainMesh(e,t,i,r,n,a,o,s,l,u,c,d,h,p,f,m,g){this.center=e,this.vertices=t,this.stride=defaultValue(u,6),this.indices=i,this.indexCountWithoutSkirts=r,this.vertexCountWithoutSkirts=n,this.minimumHeight=a,this.maximumHeight=o,this.boundingSphere3D=s,this.occludeePointInScaledSpace=l,this.orientedBoundingBox=c,this.encoding=d,this.exaggeration=h,this.westIndicesSouthToNorth=p,this.southIndicesEastToWest=f,this.eastIndicesNorthToSouth=m,this.northIndicesWestToEast=g}function TerrainProvider(){DeveloperError.throwInstantiationError()}HeightmapTessellator.computeVertices=function(e){var t,i,r,n,a=Math.cos,o=Math.sin,s=Math.sqrt,l=Math.atan,u=Math.exp,c=CesiumMath.PI_OVER_TWO,d=CesiumMath.toRadians,h=e.heightmap,p=e.width,f=e.height,m=e.skirtHeight,g=defaultValue(e.isGeographic,!0),y=defaultValue(e.ellipsoid,Ellipsoid.WGS84),v=1/y.maximumRadius,_=e.nativeRectangle,C=e.rectangle;n=defined(C)?(t=C.west,i=C.south,r=C.east,C.north):g?(t=d(_.west),i=d(_.south),r=d(_.east),d(_.north)):(t=_.west*v,i=c-2*l(u(-_.south*v)),r=_.east*v,c-2*l(u(-_.north*v)));var x=e.relativeToCenter,b=defined(x);x=b?x:Cartesian3.ZERO;var A=defaultValue(e.exaggeration,1),S=defaultValue(e.includeWebMercatorT,!1),w=defaultValue(e.structure,HeightmapTessellator.DEFAULT_STRUCTURE),E=defaultValue(w.heightScale,HeightmapTessellator.DEFAULT_STRUCTURE.heightScale),T=defaultValue(w.heightOffset,HeightmapTessellator.DEFAULT_STRUCTURE.heightOffset),P=defaultValue(w.elementsPerHeight,HeightmapTessellator.DEFAULT_STRUCTURE.elementsPerHeight),M=defaultValue(w.stride,HeightmapTessellator.DEFAULT_STRUCTURE.stride),D=defaultValue(w.elementMultiplier,HeightmapTessellator.DEFAULT_STRUCTURE.elementMultiplier),I=defaultValue(w.isBigEndian,HeightmapTessellator.DEFAULT_STRUCTURE.isBigEndian),O=Rectangle.computeWidth(_),R=Rectangle.computeHeight(_),L=O/(p-1),N=R/(f-1);g||(O*=v,R*=v);var k,B,F=y.radiiSquared,V=F.x,z=F.y,U=F.z,G=65536,$=-65536,H=Transforms.eastNorthUpToFixedFrame(x,y),W=Matrix4.inverseTransformation(H,matrix4Scratch$1);S&&(k=WebMercatorProjection.geodeticLatitudeToMercatorAngle(i),B=1/(WebMercatorProjection.geodeticLatitudeToMercatorAngle(n)-k));var j=minimumScratch;j.x=Number.POSITIVE_INFINITY,j.y=Number.POSITIVE_INFINITY,j.z=Number.POSITIVE_INFINITY;var q=maximumScratch;q.x=Number.NEGATIVE_INFINITY,q.y=Number.NEGATIVE_INFINITY,q.z=Number.NEGATIVE_INFINITY;var Q=Number.POSITIVE_INFINITY,Y=p*f,X=Y+(0<m?2*p+2*f:0),Z=new Array(X),J=new Array(X),K=new Array(X),ee=S?new Array(X):[],te=0,ie=f,re=0,ne=p;0<m&&(--te,++ie,--re,++ne);for(var ae=te;ae<ie;++ae){var oe=ae;oe<0&&(oe=0),f<=oe&&(oe=f-1);var se=_.north-N*oe,le=((se=g?d(se):c-2*l(u(-se*v)))-i)/(n-i);le=CesiumMath.clamp(le,0,1);var ue=ae===te,ce=ae===ie-1;0<m&&(ue?se+=1e-5*R:ce&&(se-=1e-5*R));var de,he=a(se),pe=o(se),fe=U*pe;S&&(de=(WebMercatorProjection.geodeticLatitudeToMercatorAngle(se)-k)*B);for(var me=re;me<ne;++me){var ge=me;ge<0&&(ge=0),p<=ge&&(ge=p-1);var ye,ve,_e=oe*(p*M)+ge*M;if(1===P)ye=h[_e];else if(ye=0,I)for(ve=0;ve<P;++ve)ye=ye*D+h[_e+ve];else for(ve=P-1;0<=ve;--ve)ye=ye*D+h[_e+ve];ye=(ye*E+T)*A,$=Math.max($,ye),G=Math.min(G,ye);var Ce=_.west+L*ge;g?Ce=d(Ce):Ce*=v;var xe=(Ce-t)/(r-t);xe=CesiumMath.clamp(xe,0,1);var be=oe*p+ge;if(0<m){var Ae=me===re,Se=me===ne-1,we=ue||ce||Ae||Se;if((ue||ce)&&(Ae||Se))continue;we&&(ye-=m,Ae?(be=f-oe-1+Y,Ce-=1e-5*O):ce?be=Y+f+(p-ge-1):Se?(be=Y+f+p+oe,Ce+=1e-5*O):ue&&(be=Y+f+p+f+ge))}var Ee=he*a(Ce),Te=he*o(Ce),Pe=V*Ee,Me=z*Te,De=1/s(Pe*Ee+Me*Te+fe*pe),Ie=Pe*De,Oe=Me*De,Re=fe*De,Le=new Cartesian3;Le.x=Ie+Ee*ye,Le.y=Oe+Te*ye,Le.z=Re+pe*ye,Z[be]=Le,J[be]=ye,K[be]=new Cartesian2(xe,le),S&&(ee[be]=de),Matrix4.multiplyByPoint(W,Le,cartesian3Scratch$1),Cartesian3.minimumByComponent(cartesian3Scratch$1,j,j),Cartesian3.maximumByComponent(cartesian3Scratch$1,q,q),Q=Math.min(Q,ye)}}var Ne,ke,Be=BoundingSphere.fromPoints(Z);defined(C)&&(Ne=OrientedBoundingBox.fromRectangle(C,G,$,y)),b&&(ke=new EllipsoidalOccluder(y).computeHorizonCullingPointPossiblyUnderEllipsoid(x,Z,G));for(var Fe=new TerrainEncoding(new AxisAlignedBoundingBox(j,q,x),Q,$,H,!1,S),Ve=new Float32Array(X*Fe.getStride()),ze=0,Ue=0;Ue<X;++Ue)ze=Fe.encode(Ve,ze,Z[Ue],K[Ue],J[Ue],void 0,ee[Ue]);return{vertices:Ve,maximumHeight:$,minimumHeight:G,encoding:Fe,boundingSphere3D:Be,orientedBoundingBox:Ne,occludeePointInScaledSpace:ke}},Object.defineProperties(TerrainProvider.prototype,{errorEvent:{get:DeveloperError.throwInstantiationError},credit:{get:DeveloperError.throwInstantiationError},tilingScheme:{get:DeveloperError.throwInstantiationError},ready:{get:DeveloperError.throwInstantiationError},readyPromise:{get:DeveloperError.throwInstantiationError},hasWaterMask:{get:DeveloperError.throwInstantiationError},hasVertexNormals:{get:DeveloperError.throwInstantiationError},availability:{get:DeveloperError.throwInstantiationError}});var regularGridIndicesCache=[];TerrainProvider.getRegularGridIndices=function(e,t){var i=regularGridIndicesCache[e];defined(i)||(regularGridIndicesCache[e]=i=[]);var r=i[t];return defined(r)||addRegularGridIndices(e,t,r=e*t<CesiumMath.SIXTY_FOUR_KILOBYTES?i[t]=new Uint16Array((e-1)*(t-1)*6):i[t]=new Uint32Array((e-1)*(t-1)*6),0),r};var regularGridAndEdgeIndicesCache=[];TerrainProvider.getRegularGridIndicesAndEdgeIndices=function(e,t){var i=regularGridAndEdgeIndicesCache[e];defined(i)||(regularGridAndEdgeIndicesCache[e]=i=[]);var r=i[t];if(!defined(r)){var n=TerrainProvider.getRegularGridIndices(e,t),a=getEdgeIndices(e,t),o=a.westIndicesSouthToNorth,s=a.southIndicesEastToWest,l=a.eastIndicesNorthToSouth,u=a.northIndicesWestToEast;r=i[t]={indices:n,westIndicesSouthToNorth:o,southIndicesEastToWest:s,eastIndicesNorthToSouth:l,northIndicesWestToEast:u}}return r};var regularGridAndSkirtAndEdgeIndicesCache=[];function getEdgeIndices(e,t){var i,r=new Array(t),n=new Array(e),a=new Array(t),o=new Array(e);for(i=0;i<e;++i)n[o[i]=i]=e*t-1-i;for(i=0;i<t;++i)a[i]=(i+1)*e-1,r[i]=(t-i-1)*e;return{westIndicesSouthToNorth:r,southIndicesEastToWest:n,eastIndicesNorthToSouth:a,northIndicesWestToEast:o}}function addRegularGridIndices(e,t,i,r){for(var n=0,a=0;a<t-1;++a){for(var o=0;o<e-1;++o){var s=n,l=s+e,u=l+1,c=s+1;i[r++]=s,i[r++]=l,i[r++]=c,i[r++]=c,i[r++]=l,i[r++]=u,++n}++n}}function addSkirtIndices(e,t,i,r){for(var n=e[0],a=e.length,o=1;o<a;++o){var s=e[o];i[r++]=n,i[r++]=s,i[r++]=t,i[r++]=t,i[r++]=s,i[r++]=t+1,n=s,++t}return r}function HeightmapTerrainData(e){this._buffer=e.buffer,this._width=e.width,this._height=e.height,this._childTileMask=defaultValue(e.childTileMask,15),this._encoding=defaultValue(e.encoding,HeightmapEncoding$1.NONE);var t=HeightmapTessellator.DEFAULT_STRUCTURE,i=e.structure;defined(i)?i!==t&&(i.heightScale=defaultValue(i.heightScale,t.heightScale),i.heightOffset=defaultValue(i.heightOffset,t.heightOffset),i.elementsPerHeight=defaultValue(i.elementsPerHeight,t.elementsPerHeight),i.stride=defaultValue(i.stride,t.stride),i.elementMultiplier=defaultValue(i.elementMultiplier,t.elementMultiplier),i.isBigEndian=defaultValue(i.isBigEndian,t.isBigEndian)):i=t,this._structure=i,this._createdByUpsampling=defaultValue(e.createdByUpsampling,!1),this._waterMask=e.waterMask,this._skirtHeight=void 0,this._bufferType=this._encoding===HeightmapEncoding$1.LERC?Float32Array:this._buffer.constructor,this._mesh=void 0}TerrainProvider.getRegularGridAndSkirtIndicesAndEdgeIndices=function(e,t){var i=regularGridAndSkirtAndEdgeIndicesCache[e];defined(i)||(regularGridAndSkirtAndEdgeIndicesCache[e]=i=[]);var r=i[t];if(!defined(r)){var n=e*t,a=(e-1)*(t-1)*6,o=2*e+2*t,s=n+o,l=a+6*Math.max(0,o-4),u=getEdgeIndices(e,t),c=u.westIndicesSouthToNorth,d=u.southIndicesEastToWest,h=u.eastIndicesNorthToSouth,p=u.northIndicesWestToEast,f=IndexDatatype$1.createTypedArray(s,l);addRegularGridIndices(e,t,f,0),TerrainProvider.addSkirtIndices(c,d,h,p,n,f,a),r=i[t]={indices:f,westIndicesSouthToNorth:c,southIndicesEastToWest:d,eastIndicesNorthToSouth:h,northIndicesWestToEast:p,indexCountWithoutSkirts:a}}return r},TerrainProvider.addSkirtIndices=function(e,t,i,r,n,a,o){var s=n;o=addSkirtIndices(e,s,a,o),o=addSkirtIndices(t,s+=e.length,a,o),o=addSkirtIndices(i,s+=t.length,a,o),addSkirtIndices(r,s+=i.length,a,o)},TerrainProvider.heightmapTerrainQuality=.25,TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap=function(e,t,i){return 2*e.maximumRadius*Math.PI*TerrainProvider.heightmapTerrainQuality/(t*i)},TerrainProvider.prototype.requestTileGeometry=DeveloperError.throwInstantiationError,TerrainProvider.prototype.getLevelMaximumGeometricError=DeveloperError.throwInstantiationError,TerrainProvider.prototype.getTileDataAvailable=DeveloperError.throwInstantiationError,TerrainProvider.prototype.loadTileDataAvailability=DeveloperError.throwInstantiationError,Object.defineProperties(HeightmapTerrainData.prototype,{credits:{get:function(){}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}}});var taskProcessor=new TaskProcessor("createVerticesFromHeightmap");function interpolateHeight(e,t,i,r,n,a,o,s,l,u){var c=(l-a.west)*(o-1)/(a.east-a.west),d=(u-a.south)*(s-1)/(a.north-a.south),h=0|c,p=h+1;o<=p&&(p=o-1,h=o-2);var f=0|d,m=f+1;return s<=m&&(m=s-1,f=s-2),m=s-1-m,triangleInterpolateHeight(c-h,d-f,getHeight(e,t,i,r,n,(f=s-1-f)*o+h),getHeight(e,t,i,r,n,f*o+p),getHeight(e,t,i,r,n,m*o+h),getHeight(e,t,i,r,n,m*o+p))}function interpolateMeshHeight(e,t,i,r,n,a,o,s,l,u){var c=(s-n.west)*(a-1)/(n.east-n.west),d=(l-n.south)*(o-1)/(n.north-n.south),h=0|c,p=h+1;a<=p&&(p=a-1,h=a-2);var f=0|d,m=f+1;o<=m&&(m=o-1,f=o-2);var g=d-f;return f=o-1-f,m=o-1-m,triangleInterpolateHeight(c-h,g,(t.decodeHeight(e,f*a+h)/u-i)/r,(t.decodeHeight(e,f*a+p)/u-i)/r,(t.decodeHeight(e,m*a+h)/u-i)/r,(t.decodeHeight(e,m*a+p)/u-i)/r)}function triangleInterpolateHeight(e,t,i,r,n,a){return t<e?i+e*(r-i)+t*(a-r):i+e*(a-n)+t*(n-i)}function getHeight(e,t,i,r,n,a){a*=r;var o,s=0;if(n)for(o=0;o<t;++o)s=s*i+e[a+o];else for(o=t-1;0<=o;--o)s=s*i+e[a+o];return s}function setHeight(e,t,i,r,n,a,o,s){var l;if(o*=n,a)for(l=0;l<t-1;++l)e[o+l]=s/r|0,s-=e[o+l]*r,r/=i;else for(l=t-1;0<l;--l)e[o+l]=s/r|0,s-=e[o+l]*r,r/=i;e[o+l]=s}function TileAvailability(e,t){this._tilingScheme=e,this._maximumLevel=t,this._rootNodes=[]}HeightmapTerrainData.prototype.createMesh=function(e,t,i,r,n){var a=e.ellipsoid,o=e.tileXYToNativeRectangle(t,i,r),s=e.tileXYToRectangle(t,i,r);n=defaultValue(n,1);var l=a.cartographicToCartesian(Rectangle.center(s)),u=this._structure,c=TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap(a,this._width,e.getNumberOfXTilesAtLevel(0))/(1<<r);ExpandByTerra.underEarth.enable?this._skirtHeight=0:this._skirtHeight=Math.min(4*c,1e3);var d=taskProcessor.scheduleTask({heightmap:this._buffer,structure:u,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:o,rectangle:s,relativeToCenter:l,ellipsoid:a,skirtHeight:this._skirtHeight,isGeographic:e.projection instanceof GeographicProjection,exaggeration:n,encoding:this._encoding});if(defined(d)){var h=this;return when(d,function(e){var t;t=0<h._skirtHeight?TerrainProvider.getRegularGridAndSkirtIndicesAndEdgeIndices(e.gridWidth,e.gridHeight):TerrainProvider.getRegularGridIndicesAndEdgeIndices(e.gridWidth,e.gridHeight);var i=e.gridWidth*e.gridHeight;return h._mesh=new TerrainMesh(l,new Float32Array(e.vertices),t.indices,t.indexCountWithoutSkirts,i,e.minimumHeight,e.maximumHeight,BoundingSphere.clone(e.boundingSphere3D),Cartesian3.clone(e.occludeePointInScaledSpace),e.numberOfAttributes,OrientedBoundingBox.clone(e.orientedBoundingBox),TerrainEncoding.clone(e.encoding),n,t.westIndicesSouthToNorth,t.southIndicesEastToWest,t.eastIndicesNorthToSouth,t.northIndicesWestToEast),h._buffer=void 0,h._mesh})}},HeightmapTerrainData.prototype._createMeshSync=function(e,t,i,r,n){var a=e.ellipsoid,o=e.tileXYToNativeRectangle(t,i,r),s=e.tileXYToRectangle(t,i,r);n=defaultValue(n,1);var l=a.cartographicToCartesian(Rectangle.center(s)),u=this._structure,c=TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap(a,this._width,e.getNumberOfXTilesAtLevel(0))/(1<<r);this._skirtHeight=Math.min(4*c,1e3);var d,h=HeightmapTessellator.computeVertices({heightmap:this._buffer,structure:u,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:o,rectangle:s,relativeToCenter:l,ellipsoid:a,skirtHeight:this._skirtHeight,isGeographic:e.projection instanceof GeographicProjection,exaggeration:n});this._buffer=void 0,d=0<this._skirtHeight?TerrainProvider.getRegularGridAndSkirtIndicesAndEdgeIndices(this._width,this._height):TerrainProvider.getRegularGridIndicesAndEdgeIndices(this._width,this._height);var p=h.gridWidth*h.gridHeight;return new TerrainMesh(l,h.vertices,d.indices,d.indexCountWithoutSkirts,p,h.minimumHeight,h.maximumHeight,h.boundingSphere3D,h.occludeePointInScaledSpace,h.encoding.getStride(),h.orientedBoundingBox,h.encoding,n,d.westIndicesSouthToNorth,d.southIndicesEastToWest,d.eastIndicesNorthToSouth,d.northIndicesWestToEast)},HeightmapTerrainData.prototype.interpolateHeight=function(e,t,i){var r,n=this._width,a=this._height,o=this._structure,s=o.stride,l=o.elementsPerHeight,u=o.elementMultiplier,c=o.isBigEndian,d=o.heightOffset,h=o.heightScale;defined(this._mesh)?r=interpolateMeshHeight(this._mesh.vertices,this._mesh.encoding,d,h,e,n,a,t,i,this._mesh.exaggeration):r=(r=interpolateHeight(this._buffer,l,u,s,c,e,n,a,t,i))*h+d;return r},HeightmapTerrainData.prototype.upsample=function(e,t,i,r,n,a,o){var s=this._mesh;if(defined(s)){for(var l=this._width,u=this._height,c=this._structure,d=c.stride,h=new this._bufferType(l*u*d),p=s.vertices,f=s.encoding,m=e.tileXYToRectangle(t,i,r),g=e.tileXYToRectangle(n,a,o),y=c.heightOffset,v=c.heightScale,_=s.exaggeration,C=c.elementsPerHeight,x=c.elementMultiplier,b=c.isBigEndian,A=Math.pow(x,C-1),S=0;S<u;++S)for(var w=CesiumMath.lerp(g.north,g.south,S/(u-1)),E=0;E<l;++E){var T=interpolateMeshHeight(p,f,y,v,m,l,u,CesiumMath.lerp(g.west,g.east,E/(l-1)),w,_);setHeight(h,C,x,A,d,b,S*l+E,T=(T=T<c.lowestEncodedHeight?c.lowestEncodedHeight:T)>c.highestEncodedHeight?c.highestEncodedHeight:T)}return new HeightmapTerrainData({buffer:h,width:l,height:u,childTileMask:0,structure:this._structure,createdByUpsampling:!0})}},HeightmapTerrainData.prototype.isChildAvailable=function(e,t,i,r){var n=2;return i!==2*e&&++n,r!==2*t&&(n-=2),0!=(this._childTileMask&1<<n)},HeightmapTerrainData.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var rectangleScratch=new Rectangle;function findNode$1(e,t,i,r){for(var n=r.length,a=0;a<n;++a){var o=r[a];if(o.x===t&&o.y===i&&o.level===e)return!0}return!1}TileAvailability.prototype.addAvailableTileRange=function(e,t,i,r,n){var a=this._tilingScheme,o=this._rootNodes;if(0===e)for(var s=i;s<=n;++s)for(var l=t;l<=r;++l)findNode$1(e,l,s,o)||o.push(new QuadtreeNode(a,void 0,0,l,s));a.tileXYToRectangle(t,i,e,rectangleScratch);var u=rectangleScratch.west,c=rectangleScratch.north;a.tileXYToRectangle(r,n,e,rectangleScratch);for(var d=rectangleScratch.east,h=new RectangleWithLevel(e,u,rectangleScratch.south,d,c),p=0;p<o.length;++p){var f=o[p];rectanglesOverlap(f.extent,h)&&putRectangleInQuadtree(this._maximumLevel,f,h)}},TileAvailability.prototype.computeMaximumLevelAtPosition=function(e){for(var t,i=0;i<this._rootNodes.length;++i){var r=this._rootNodes[i];if(rectangleContainsPosition(r.extent,e)){t=r;break}}return defined(t)?findMaxLevelFromNode(void 0,t,e):-1};var rectanglesScratch=[],remainingToCoverByLevelScratch=[],westScratch=new Rectangle,eastScratch=new Rectangle;TileAvailability.prototype.computeBestAvailableLevelOverRectangle=function(e){var t=rectanglesScratch;t.length=0,e.east<e.west?(t.push(Rectangle.fromRadians(-Math.PI,e.south,e.east,e.north,westScratch)),t.push(Rectangle.fromRadians(e.west,e.south,Math.PI,e.north,eastScratch))):t.push(e);var i,r=remainingToCoverByLevelScratch;for(i=r.length=0;i<this._rootNodes.length;++i)updateCoverageWithNode(r,this._rootNodes[i],t);for(i=r.length-1;0<=i;--i)if(defined(r[i])&&0===r[i].length)return i;return 0};var cartographicScratch$1=new Cartographic;function QuadtreeNode(e,t,i,r,n){this.tilingScheme=e,this.parent=t,this.level=i,this.x=r,this.y=n,this.extent=e.tileXYToRectangle(r,n,i),this.rectangles=[],this._sw=void 0,this._se=void 0,this._nw=void 0,this._ne=void 0}function RectangleWithLevel(e,t,i,r,n){this.level=e,this.west=t,this.south=i,this.east=r,this.north=n}function rectanglesOverlap(e,t){var i=Math.max(e.west,t.west),r=Math.max(e.south,t.south),n=Math.min(e.east,t.east);return r<Math.min(e.north,t.north)&&i<n}function putRectangleInQuadtree(e,t,i){for(;t.level<e;)if(rectangleFullyContainsRectangle(t.nw.extent,i))t=t.nw;else if(rectangleFullyContainsRectangle(t.ne.extent,i))t=t.ne;else if(rectangleFullyContainsRectangle(t.sw.extent,i))t=t.sw;else{if(!rectangleFullyContainsRectangle(t.se.extent,i))break;t=t.se}if(0===t.rectangles.length||t.rectangles[t.rectangles.length-1].level<=i.level)t.rectangles.push(i);else{var r=binarySearch(t.rectangles,i.level,rectangleLevelComparator);r<=0&&(r=~r),t.rectangles.splice(r,0,i)}}function rectangleLevelComparator(e,t){return e.level-t}function rectangleFullyContainsRectangle(e,t){return t.west>=e.west&&t.east<=e.east&&t.south>=e.south&&t.north<=e.north}function rectangleContainsPosition(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north}function findMaxLevelFromNode(e,t,i){for(var r=0,n=!1;!n;){var a=t._nw&&rectangleContainsPosition(t._nw.extent,i),o=t._ne&&rectangleContainsPosition(t._ne.extent,i),s=t._sw&&rectangleContainsPosition(t._sw.extent,i),l=t._se&&rectangleContainsPosition(t._se.extent,i);if(1<a+o+s+l){a&&(r=Math.max(r,findMaxLevelFromNode(t,t._nw,i))),o&&(r=Math.max(r,findMaxLevelFromNode(t,t._ne,i))),s&&(r=Math.max(r,findMaxLevelFromNode(t,t._sw,i))),l&&(r=Math.max(r,findMaxLevelFromNode(t,t._se,i)));break}a?t=t._nw:o?t=t._ne:s?t=t._sw:l?t=t._se:n=!0}for(;t!==e;){for(var u=t.rectangles,c=u.length-1;0<=c&&u[c].level>r;--c){var d=u[c];rectangleContainsPosition(d,i)&&(r=d.level)}t=t.parent}return r}function updateCoverageWithNode(e,t,i){if(t){var r,n=!1;for(r=0;r<i.length;++r)n=n||rectanglesOverlap(t.extent,i[r]);if(n){var a=t.rectangles;for(r=0;r<a.length;++r){var o=a[r];e[o.level]||(e[o.level]=i),e[o.level]=subtractRectangle(e[o.level],o)}updateCoverageWithNode(e,t._nw,i),updateCoverageWithNode(e,t._ne,i),updateCoverageWithNode(e,t._sw,i),updateCoverageWithNode(e,t._se,i)}}}function subtractRectangle(e,t){for(var i=[],r=0;r<e.length;++r){var n=e[r];rectanglesOverlap(n,t)?(n.west<t.west&&i.push(new Rectangle(n.west,n.south,t.west,n.north)),n.east>t.east&&i.push(new Rectangle(t.east,n.south,n.east,n.north)),n.south<t.south&&i.push(new Rectangle(Math.max(t.west,n.west),n.south,Math.min(t.east,n.east),t.south)),n.north>t.north&&i.push(new Rectangle(Math.max(t.west,n.west),t.north,Math.min(t.east,n.east),n.north))):i.push(n)}return i}function formatError(e){var t,i=e.name,r=e.message;t=defined(i)&&defined(r)?i+": "+r:e.toString();var n=e.stack;return defined(n)&&(t+="\n"+n),t}function TileProviderError(e,t,i,r,n,a,o){this.provider=e,this.message=t,this.x=i,this.y=r,this.level=n,this.timesRetried=defaultValue(a,0),this.retry=!1,this.error=o}TileAvailability.prototype.isTileAvailable=function(e,t,i){var r=this._tilingScheme.tileXYToRectangle(t,i,e,rectangleScratch);return Rectangle.center(r,cartographicScratch$1),this.computeMaximumLevelAtPosition(cartographicScratch$1)>=e},TileAvailability.prototype.computeChildMaskForTile=function(e,t,i){var r=e+1;if(r>=this._maximumLevel)return 0;var n=0;return n|=this.isTileAvailable(r,2*t,2*i+1)?1:0,n|=this.isTileAvailable(r,2*t+1,2*i+1)?2:0,n|=this.isTileAvailable(r,2*t,2*i)?4:0,n|=this.isTileAvailable(r,2*t+1,2*i)?8:0},Object.defineProperties(QuadtreeNode.prototype,{nw:{get:function(){return this._nw||(this._nw=new QuadtreeNode(this.tilingScheme,this,this.level+1,2*this.x,2*this.y)),this._nw}},ne:{get:function(){return this._ne||(this._ne=new QuadtreeNode(this.tilingScheme,this,this.level+1,2*this.x+1,2*this.y)),this._ne}},sw:{get:function(){return this._sw||(this._sw=new QuadtreeNode(this.tilingScheme,this,this.level+1,2*this.x,2*this.y+1)),this._sw}},se:{get:function(){return this._se||(this._se=new QuadtreeNode(this.tilingScheme,this,this.level+1,2*this.x+1,2*this.y+1)),this._se}}}),TileProviderError.handleError=function(e,t,i,r,n,a,o,s,l){var u=e;return defined(e)?(u.provider=t,u.message=r,u.x=n,u.y=a,u.level=o,u.retry=!1,u.error=l,++u.timesRetried):u=new TileProviderError(t,r,n,a,o,0,l),0<i.numberOfListeners?i.raiseEvent(u):console.log('An error occurred in "'+t.constructor.name+'": '+formatError(r)),u.retry&&defined(s)&&s(),u},TileProviderError.handleSuccess=function(e){defined(e)&&(e.timesRetried=-1)};var ALL_CHILDREN=15;function ArcGISTiledElevationTerrainProvider(e){this._resource=void 0,this._credit=void 0,this._tilingScheme=void 0,this._levelZeroMaximumGeometricError=void 0,this._maxLevel=void 0,this._terrainDataStructure=void 0,this._ready=!1,this._width=void 0,this._height=void 0,this._encoding=void 0;var i=e.token;this._hasAvailability=!1,this._tilesAvailable=void 0,this._tilesAvailablityLoaded=void 0,this._availableCache={};var s=this,l=defaultValue(e.ellipsoid,Ellipsoid.WGS84);this._readyPromise=when(e.url).then(function(e){var t=Resource.createIfNeeded(e);return t.appendForwardSlash(),defined(i)&&(t=t.getDerivedResource({queryParameters:{token:i}})),(s._resource=t).getDerivedResource({queryParameters:{f:"pjson"}}).fetchJson()}).then(function(e){var t=e.copyrightText;defined(t)&&(s._credit=new Credit(t));var i=e.spatialReference,r=defaultValue(i.latestWkid,i.wkid),n=e.extent,a={ellipsoid:l};if(4326===r)a.rectangle=Rectangle.fromDegrees(n.xmin,n.ymin,n.xmax,n.ymax),s._tilingScheme=new GeographicTilingScheme(a);else{if(3857!==r)return when.reject(new RuntimeError("Invalid spatial reference"));a.rectangleSouthwestInMeters=new Cartesian2(n.xmin,n.ymin),a.rectangleNortheastInMeters=new Cartesian2(n.xmax,n.ymax),s._tilingScheme=new WebMercatorTilingScheme(a)}var o=e.tileInfo;return defined(o)?(s._width=o.rows+1,s._height=o.cols+1,s._encoding="LERC"===o.format?HeightmapEncoding$1.LERC:HeightmapEncoding$1.NONE,s._lodCount=o.lods.length-1,(s._hasAvailability=-1!==e.capabilities.indexOf("Tilemap"))&&(s._tilesAvailable=new TileAvailability(s._tilingScheme,s._lodCount),s._tilesAvailable.addAvailableTileRange(0,0,0,s._tilingScheme.getNumberOfXTilesAtLevel(0),s._tilingScheme.getNumberOfYTilesAtLevel(0)),s._tilesAvailablityLoaded=new TileAvailability(s._tilingScheme,s._lodCount)),s._levelZeroMaximumGeometricError=TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap(s._tilingScheme.ellipsoid,s._width,s._tilingScheme.getNumberOfXTilesAtLevel(0)),1<e.bandCount&&console.log("ArcGISTiledElevationTerrainProvider: Terrain data has more than 1 band. Using the first one."),s._terrainDataStructure={elementMultiplier:1,lowestEncodedHeight:e.minValues[0],highestEncodedHeight:e.maxValues[0]},s._ready=!0):when.reject(new RuntimeError("tileInfo is required"))}).otherwise(function(e){var t="An error occurred while accessing "+s._resource.url+".";return TileProviderError.handleError(void 0,s,s._errorEvent,t),when.reject(e)}),this._errorEvent=new Event}function isTileAvailable(e,t,i,r){if(e._hasAvailability){var n=e._tilesAvailablityLoaded,a=e._tilesAvailable;return!(t>e._lodCount)&&(!!a.isTileAvailable(t,i,r)||!n.isTileAvailable(t,i,r)&&void 0)}}function findRange(e,t,i,r){for(var n=t-1,a=i-1,o=r[e.y*t+e.x],s=[],l={startX:e.x,startY:e.y,endX:0,endY:0},u=new Cartesian2(e.x+1,e.y+1),c=!1,d=!1;!c||!d;){var h=u.x,p=d?u.y+1:u.y;if(!c){for(var f=e.y;f<p;++f)if(r[f*t+u.x]!==o){c=!0;break}c?(s.push(new Cartesian2(u.x,e.y)),--u.x,--h,l.endX=u.x):u.x===n?(l.endX=u.x,c=!0):++u.x}if(!d){for(var m=u.y*t,g=e.x;g<=h;++g)if(r[m+g]!==o){d=!0;break}d?(s.push(new Cartesian2(e.x,u.y)),--u.y,l.endY=u.y):u.y===a?(l.endY=u.y,d=!0):++u.y}}return{endingIndices:s,range:l,value:o}}function computeAvailability(e,t,i,r,n){var a=[];if(n.every(function(e){return e===n[0]}))return 1===n[0]&&a.push({startX:e,startY:t,endX:e+i-1,endY:t+r-1}),a;for(var o=[new Cartesian2(0,0)];0<o.length;){var s=findRange(o.pop(),i,r,n);if(1===s.value){var l=s.range;l.startX+=e,l.endX+=e,l.startY+=t,l.endY+=t,a.push(l)}var u=s.endingIndices;0<u.length&&(o=o.concat(u))}return a}function requestAvailability(a,o,s,l){if(!a._hasAvailability)return{};var u=128*Math.floor(s/128),c=128*Math.floor(l/128),d=Math.min(1<<o,128),t="tilemap/"+o+"/"+c+"/"+u+"/"+d+"/"+d,i=a._availableCache;if(defined(i[t]))return i[t];var e=new Request({throttle:!0,throttleByServer:!0,type:RequestType$1.TERRAIN}),r=a._resource.getDerivedResource({url:t,request:e}).fetchJson();return defined(r)?(r=r.then(function(e){var t=computeAvailability(u,c,d,d,e.data);a._tilesAvailablityLoaded.addAvailableTileRange(u,c,u+d,c+d);for(var i=a._tilesAvailable,r=0;r<t.length;++r){var n=t[r];i.addAvailableTileRange(o,n.startX,n.startY,n.endX,n.endY)}return isTileAvailable(a,o,s,l)}),i[t]={promise:r,request:e},{promise:r=r.always(function(e){return delete i[t],e}),request:e}):{}}function arraySlice(e,t,i){if("function"==typeof e.slice)return e.slice(t,i);for(var r=Array.prototype.slice.call(e,t,i),n=FeatureDetection$1.typedArrayTypes,a=n.length,o=0;o<a;++o)if(e instanceof n[o]){r=new n[o](r);break}return r}Object.defineProperties(ArcGISTiledElevationTerrainProvider.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}}}),ArcGISTiledElevationTerrainProvider.prototype.requestTileGeometry=function(t,i,r,n){var a,e=this._resource.getDerivedResource({url:"tile/"+r+"/"+i+"/"+t,request:n}),o=this._hasAvailability,s=when.resolve(!0);if(o&&!defined(isTileAvailable(this,r+1,2*t,2*i))){var l=requestAvailability(this,r+1,2*t,2*i);s=l.promise,a=l.request}var u=e.fetchArrayBuffer();if(defined(u)&&defined(s)){var c=this,d=this._tilesAvailable;return when.join(u,s).then(function(e){return new HeightmapTerrainData({buffer:e[0],width:c._width,height:c._height,childTileMask:o?d.computeChildMaskForTile(r,t,i):ALL_CHILDREN,structure:c._terrainDataStructure,encoding:c._encoding})}).otherwise(function(e){return defined(a)&&a.state===RequestState$1.CANCELLED?(n.cancel(),n.deferred.promise.always(function(){return n.state=RequestState$1.CANCELLED,when.reject(e)})):when.reject(e)})}},ArcGISTiledElevationTerrainProvider.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)},ArcGISTiledElevationTerrainProvider.prototype.getTileDataAvailable=function(e,t,i){if(this._hasAvailability){var r=isTileAvailable(this,i,e,t);if(defined(r))return r;requestAvailability(this,i,e,t)}},ArcGISTiledElevationTerrainProvider.prototype.loadTileDataAvailability=function(e,t,i){};var BingMapsApi={defaultKey:void 0,getKey:function(e){return defined(e)?e:BingMapsApi.defaultKey}},url="https://dev.virtualearth.net/REST/v1/Locations";function BingMapsGeocoderService(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).key;this._key=BingMapsApi.getKey(t),this._resource=new Resource({url:url,queryParameters:{key:this._key}})}Object.defineProperties(BingMapsGeocoderService.prototype,{url:{get:function(){return url}},key:{get:function(){return this._key}}}),BingMapsGeocoderService.prototype.geocode=function(e){return this._resource.getDerivedResource({queryParameters:{query:e}}).fetchJsonp("jsonp").then(function(e){return 0===e.resourceSets.length?[]:e.resourceSets[0].resources.map(function(e){var t=e.bbox,i=t[0],r=t[1],n=t[2],a=t[3];return{displayName:e.name,destination:Rectangle.fromDegrees(r,i,a,n)}})})};var diffScratch$1=new Cartesian3;function BoxGeometry(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).minimum,i=e.maximum,r=defaultValue(e.vertexFormat,VertexFormat.DEFAULT);this._minimum=Cartesian3.clone(t),this._maximum=Cartesian3.clone(i),this._vertexFormat=r,this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxGeometry"}BoxGeometry.fromDimensions=function(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).dimensions,i=Cartesian3.multiplyByScalar(t,.5,new Cartesian3);return new BoxGeometry({minimum:Cartesian3.negate(i,new Cartesian3),maximum:i,vertexFormat:e.vertexFormat,offsetAttribute:e.offsetAttribute})},BoxGeometry.fromAxisAlignedBoundingBox=function(e){return new BoxGeometry({minimum:e.minimum,maximum:e.maximum})},BoxGeometry.packedLength=2*Cartesian3.packedLength+VertexFormat.packedLength+1,BoxGeometry.pack=function(e,t,i){return i=defaultValue(i,0),Cartesian3.pack(e._minimum,t,i),Cartesian3.pack(e._maximum,t,i+Cartesian3.packedLength),VertexFormat.pack(e._vertexFormat,t,i+2*Cartesian3.packedLength),t[i+2*Cartesian3.packedLength+VertexFormat.packedLength]=defaultValue(e._offsetAttribute,-1),t};var scratchMin$5=new Cartesian3,scratchMax$5=new Cartesian3,scratchVertexFormat$3=new VertexFormat,scratchOptions$4={minimum:scratchMin$5,maximum:scratchMax$5,vertexFormat:scratchVertexFormat$3,offsetAttribute:void 0},unitBoxGeometry,implementation$1;function cancelAnimationFramePolyfill(e){implementation$1(e)}function CartographicGeocoderService(){}function Spline(){this.times=void 0,this.points=void 0,DeveloperError.throwInstantiationError()}function LinearSpline(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).points,i=e.times;this._times=i,this._points=t,this._lastTimeIndex=0}BoxGeometry.unpack=function(e,t,i){t=defaultValue(t,0);var r=Cartesian3.unpack(e,t,scratchMin$5),n=Cartesian3.unpack(e,t+Cartesian3.packedLength,scratchMax$5),a=VertexFormat.unpack(e,t+2*Cartesian3.packedLength,scratchVertexFormat$3),o=e[t+2*Cartesian3.packedLength+VertexFormat.packedLength];return defined(i)?(i._minimum=Cartesian3.clone(r,i._minimum),i._maximum=Cartesian3.clone(n,i._maximum),i._vertexFormat=VertexFormat.clone(a,i._vertexFormat),i._offsetAttribute=-1===o?void 0:o,i):(scratchOptions$4.offsetAttribute=-1===o?void 0:o,new BoxGeometry(scratchOptions$4))},BoxGeometry.createGeometry=function(e){var t=e._minimum,i=e._maximum,r=e._vertexFormat;if(!Cartesian3.equals(t,i)){var n,a,o=new GeometryAttributes;if(r.position&&(r.st||r.normal||r.tangent||r.bitangent)){if(r.position&&((a=new Float64Array(72))[0]=t.x,a[1]=t.y,a[2]=i.z,a[3]=i.x,a[4]=t.y,a[5]=i.z,a[6]=i.x,a[7]=i.y,a[8]=i.z,a[9]=t.x,a[10]=i.y,a[11]=i.z,a[12]=t.x,a[13]=t.y,a[14]=t.z,a[15]=i.x,a[16]=t.y,a[17]=t.z,a[18]=i.x,a[19]=i.y,a[20]=t.z,a[21]=t.x,a[22]=i.y,a[23]=t.z,a[24]=i.x,a[25]=t.y,a[26]=t.z,a[27]=i.x,a[28]=i.y,a[29]=t.z,a[30]=i.x,a[31]=i.y,a[32]=i.z,a[33]=i.x,a[34]=t.y,a[35]=i.z,a[36]=t.x,a[37]=t.y,a[38]=t.z,a[39]=t.x,a[40]=i.y,a[41]=t.z,a[42]=t.x,a[43]=i.y,a[44]=i.z,a[45]=t.x,a[46]=t.y,a[47]=i.z,a[48]=t.x,a[49]=i.y,a[50]=t.z,a[51]=i.x,a[52]=i.y,a[53]=t.z,a[54]=i.x,a[55]=i.y,a[56]=i.z,a[57]=t.x,a[58]=i.y,a[59]=i.z,a[60]=t.x,a[61]=t.y,a[62]=t.z,a[63]=i.x,a[64]=t.y,a[65]=t.z,a[66]=i.x,a[67]=t.y,a[68]=i.z,a[69]=t.x,a[70]=t.y,a[71]=i.z,o.position=new GeometryAttribute({componentDatatype:ComponentDatatype$1.DOUBLE,componentsPerAttribute:3,values:a})),r.normal){var s=new Float32Array(72);s[0]=0,s[1]=0,s[2]=1,s[3]=0,s[4]=0,s[5]=1,s[6]=0,s[7]=0,s[8]=1,s[9]=0,s[10]=0,s[11]=1,s[12]=0,s[13]=0,s[14]=-1,s[15]=0,s[16]=0,s[17]=-1,s[18]=0,s[19]=0,s[20]=-1,s[21]=0,s[22]=0,s[23]=-1,s[24]=1,s[25]=0,s[26]=0,s[27]=1,s[28]=0,s[29]=0,s[30]=1,s[31]=0,s[32]=0,s[33]=1,s[34]=0,s[35]=0,s[36]=-1,s[37]=0,s[38]=0,s[39]=-1,s[40]=0,s[41]=0,s[42]=-1,s[43]=0,s[44]=0,s[45]=-1,s[46]=0,s[47]=0,s[48]=0,s[49]=1,s[50]=0,s[51]=0,s[52]=1,s[53]=0,s[54]=0,s[55]=1,s[56]=0,s[57]=0,s[58]=1,s[59]=0,s[60]=0,s[61]=-1,s[62]=0,s[63]=0,s[64]=-1,s[65]=0,s[66]=0,s[67]=-1,s[68]=0,s[69]=0,s[70]=-1,s[71]=0,o.normal=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:s})}if(r.st){var l=new Float32Array(48);l[0]=0,l[1]=0,l[2]=1,l[3]=0,l[4]=1,l[5]=1,l[6]=0,l[7]=1,l[8]=1,l[9]=0,l[10]=0,l[11]=0,l[12]=0,l[13]=1,l[14]=1,l[15]=1,l[16]=0,l[17]=0,l[18]=1,l[19]=0,l[20]=1,l[21]=1,l[22]=0,l[23]=1,l[24]=1,l[25]=0,l[26]=0,l[27]=0,l[28]=0,l[29]=1,l[30]=1,l[31]=1,l[32]=1,l[33]=0,l[34]=0,l[35]=0,l[36]=0,l[37]=1,l[38]=1,l[39]=1,l[40]=0,l[41]=0,l[42]=1,l[43]=0,l[44]=1,l[45]=1,l[46]=0,l[47]=1,o.st=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:2,values:l})}if(r.tangent){var u=new Float32Array(72);u[0]=1,u[1]=0,u[2]=0,u[3]=1,u[4]=0,u[5]=0,u[6]=1,u[7]=0,u[8]=0,u[9]=1,u[10]=0,u[11]=0,u[12]=-1,u[13]=0,u[14]=0,u[15]=-1,u[16]=0,u[17]=0,u[18]=-1,u[19]=0,u[20]=0,u[21]=-1,u[22]=0,u[23]=0,u[24]=0,u[25]=1,u[26]=0,u[27]=0,u[28]=1,u[29]=0,u[30]=0,u[31]=1,u[32]=0,u[33]=0,u[34]=1,u[35]=0,u[36]=0,u[37]=-1,u[38]=0,u[39]=0,u[40]=-1,u[41]=0,u[42]=0,u[43]=-1,u[44]=0,u[45]=0,u[46]=-1,u[47]=0,u[48]=-1,u[49]=0,u[50]=0,u[51]=-1,u[52]=0,u[53]=0,u[54]=-1,u[55]=0,u[56]=0,u[57]=-1,u[58]=0,u[59]=0,u[60]=1,u[61]=0,u[62]=0,u[63]=1,u[64]=0,u[65]=0,u[66]=1,u[67]=0,u[68]=0,u[69]=1,u[70]=0,u[71]=0,o.tangent=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:u})}if(r.bitangent){var c=new Float32Array(72);c[0]=0,c[1]=1,c[2]=0,c[3]=0,c[4]=1,c[5]=0,c[6]=0,c[7]=1,c[8]=0,c[9]=0,c[10]=1,c[11]=0,c[12]=0,c[13]=1,c[14]=0,c[15]=0,c[16]=1,c[17]=0,c[18]=0,c[19]=1,c[20]=0,c[21]=0,c[22]=1,c[23]=0,c[24]=0,c[25]=0,c[26]=1,c[27]=0,c[28]=0,c[29]=1,c[30]=0,c[31]=0,c[32]=1,c[33]=0,c[34]=0,c[35]=1,c[36]=0,c[37]=0,c[38]=1,c[39]=0,c[40]=0,c[41]=1,c[42]=0,c[43]=0,c[44]=1,c[45]=0,c[46]=0,c[47]=1,c[48]=0,c[49]=0,c[50]=1,c[51]=0,c[52]=0,c[53]=1,c[54]=0,c[55]=0,c[56]=1,c[57]=0,c[58]=0,c[59]=1,c[60]=0,c[61]=0,c[62]=1,c[63]=0,c[64]=0,c[65]=1,c[66]=0,c[67]=0,c[68]=1,c[69]=0,c[70]=0,c[71]=1,o.bitangent=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:c})}(n=new Uint16Array(36))[0]=0,n[1]=1,n[2]=2,n[3]=0,n[4]=2,n[5]=3,n[6]=6,n[7]=5,n[8]=4,n[9]=7,n[10]=6,n[11]=4,n[12]=8,n[13]=9,n[14]=10,n[15]=8,n[16]=10,n[17]=11,n[18]=14,n[19]=13,n[20]=12,n[21]=15,n[22]=14,n[23]=12,n[24]=18,n[25]=17,n[26]=16,n[27]=19,n[28]=18,n[29]=16,n[30]=20,n[31]=21,n[32]=22,n[33]=20,n[34]=22,n[35]=23}else(a=new Float64Array(24))[0]=t.x,a[1]=t.y,a[2]=t.z,a[3]=i.x,a[4]=t.y,a[5]=t.z,a[6]=i.x,a[7]=i.y,a[8]=t.z,a[9]=t.x,a[10]=i.y,a[11]=t.z,a[12]=t.x,a[13]=t.y,a[14]=i.z,a[15]=i.x,a[16]=t.y,a[17]=i.z,a[18]=i.x,a[19]=i.y,a[20]=i.z,a[21]=t.x,a[22]=i.y,a[23]=i.z,o.position=new GeometryAttribute({componentDatatype:ComponentDatatype$1.DOUBLE,componentsPerAttribute:3,values:a}),(n=new Uint16Array(36))[0]=4,n[1]=5,n[2]=6,n[3]=4,n[4]=6,n[5]=7,n[6]=1,n[7]=0,n[8]=3,n[9]=1,n[10]=3,n[11]=2,n[12]=1,n[13]=6,n[14]=5,n[15]=1,n[16]=2,n[17]=6,n[18]=2,n[19]=3,n[20]=7,n[21]=2,n[22]=7,n[23]=6,n[24]=3,n[25]=0,n[26]=4,n[27]=3,n[28]=4,n[29]=7,n[30]=0,n[31]=1,n[32]=5,n[33]=0,n[34]=5,n[35]=4;var d=Cartesian3.subtract(i,t,diffScratch$1),h=.5*Cartesian3.magnitude(d);if(defined(e._offsetAttribute)){var p=a.length,f=new Uint8Array(p/3);arrayFill(f,e._offsetAttribute===GeometryOffsetAttribute$1.NONE?0:1),o.applyOffset=new GeometryAttribute({componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE,componentsPerAttribute:1,values:f})}return new Geometry({attributes:o,indices:n,primitiveType:PrimitiveType$1.TRIANGLES,boundingSphere:new BoundingSphere(Cartesian3.ZERO,h),offsetAttribute:e._offsetAttribute})}},BoxGeometry.getUnitBox=function(){return defined(unitBoxGeometry)||(unitBoxGeometry=BoxGeometry.createGeometry(BoxGeometry.fromDimensions({dimensions:new Cartesian3(1,1,1),vertexFormat:VertexFormat.POSITION_ONLY}))),unitBoxGeometry},"undefined"!=typeof cancelAnimationFrame&&(implementation$1=cancelAnimationFrame),function(){if(!defined(implementation$1)&&"undefined"!=typeof window)for(var e=["webkit","moz","ms","o"],t=0,i=e.length;t<i&&!defined(implementation$1);)defined(implementation$1=window[e[t]+"CancelAnimationFrame"])||(implementation$1=window[e[t]+"CancelRequestAnimationFrame"]),++t;defined(implementation$1)||(implementation$1=clearTimeout)}(),CartographicGeocoderService.prototype.geocode=function(e){var t=e.match(/[^\s,\n]+/g);if(2===t.length||3===t.length){var i=+t[0],r=+t[1],n=3===t.length?+t[2]:300;if(isNaN(i)&&isNaN(r))for(var a=/^(\d+.?\d*)([nsew])/i,o=0;o<t.length;++o){var s=t[o].match(a);a.test(t[o])&&3===s.length&&(/^[ns]/i.test(s[2])?r=/^[n]/i.test(s[2])?+s[1]:-s[1]:/^[ew]/i.test(s[2])&&(i=/^[e]/i.test(s[2])?+s[1]:-s[1]))}if(!isNaN(i)&&!isNaN(r)&&!isNaN(n)){var l={displayName:e,destination:Cartesian3.fromDegrees(i,r,n)};return when.resolve([l])}}return when.resolve([])},Spline.prototype.evaluate=DeveloperError.throwInstantiationError,Spline.prototype.findTimeInterval=function(e,t){var i,r=this.times,n=r.length;if(e>=r[t=defaultValue(t,0)]){if(t+1<n&&e<r[t+1])return t;if(t+2<n&&e<r[t+2])return t+1}else if(0<=t-1&&e>=r[t-1])return t-1;if(e>r[t])for(i=t;i<n-1&&!(e>=r[i]&&e<r[i+1]);++i);else for(i=t-1;0<=i&&!(e>=r[i]&&e<r[i+1]);--i);return i===n-1&&(i=n-2),i},Spline.prototype.wrapTime=function(e){var t=this.times,i=t[t.length-1],r=t[0],n=i-r;return e<r&&(e+=(Math.floor((r-e)/n)+1)*n),i<e&&(e-=(Math.floor((e-i)/n)+1)*n),e},Spline.prototype.clampTime=function(e){var t=this.times;return CesiumMath.clamp(e,t[0],t[t.length-1])},Object.defineProperties(LinearSpline.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}}),LinearSpline.prototype.findTimeInterval=Spline.prototype.findTimeInterval,LinearSpline.prototype.wrapTime=Spline.prototype.wrapTime,LinearSpline.prototype.clampTime=Spline.prototype.clampTime,LinearSpline.prototype.evaluate=function(e,t){var i=this.points,r=this.times,n=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),a=(e-r[n])/(r[n+1]-r[n]);return defined(t)||(t=new Cartesian3),Cartesian3.lerp(i[n],i[n+1],a,t)};var TridiagonalSystemSolver={solve:function(e,t,i,r){var n,a,o=new Array(i.length),s=new Array(r.length),l=new Array(r.length);for(n=0;n<s.length;n++)s[n]=new Cartesian3,l[n]=new Cartesian3;for(o[0]=i[0]/t[0],s[0]=Cartesian3.multiplyByScalar(r[0],1/t[0],s[0]),n=1;n<o.length;++n)a=1/(t[n]-o[n-1]*e[n-1]),o[n]=i[n]*a,s[n]=Cartesian3.subtract(r[n],Cartesian3.multiplyByScalar(s[n-1],e[n-1],s[n]),s[n]),s[n]=Cartesian3.multiplyByScalar(s[n],a,s[n]);for(a=1/(t[n]-o[n-1]*e[n-1]),s[n]=Cartesian3.subtract(r[n],Cartesian3.multiplyByScalar(s[n-1],e[n-1],s[n]),s[n]),s[n]=Cartesian3.multiplyByScalar(s[n],a,s[n]),l[l.length-1]=s[s.length-1],n=l.length-2;0<=n;--n)l[n]=Cartesian3.subtract(s[n],Cartesian3.multiplyByScalar(l[n+1],o[n],l[n]),l[n]);return l}},scratchLower=[],scratchDiagonal=[],scratchUpper=[],scratchRight$6=[];function generateClamped(e,t,i){var r,n=scratchLower,a=scratchUpper,o=scratchDiagonal,s=scratchRight$6;n.length=a.length=e.length-1,o.length=s.length=e.length,n[0]=o[0]=1;var l=s[a[0]=0];for(defined(l)||(l=s[0]=new Cartesian3),Cartesian3.clone(t,l),r=1;r<n.length-1;++r)n[r]=a[r]=1,o[r]=4,defined(l=s[r])||(l=s[r]=new Cartesian3),Cartesian3.subtract(e[r+1],e[r-1],l),Cartesian3.multiplyByScalar(l,3,l);return n[r]=0,a[r]=1,o[r]=4,defined(l=s[r])||(l=s[r]=new Cartesian3),Cartesian3.subtract(e[r+1],e[r-1],l),Cartesian3.multiplyByScalar(l,3,l),defined(l=s[r+(o[r+1]=1)])||(l=s[r+1]=new Cartesian3),Cartesian3.clone(i,l),TridiagonalSystemSolver.solve(n,o,a,s)}function generateNatural(e){var t,i=scratchLower,r=scratchUpper,n=scratchDiagonal,a=scratchRight$6;i.length=r.length=e.length-1,n.length=a.length=e.length,i[0]=r[0]=1,n[0]=2;var o=a[0];for(defined(o)||(o=a[0]=new Cartesian3),Cartesian3.subtract(e[1],e[0],o),Cartesian3.multiplyByScalar(o,3,o),t=1;t<i.length;++t)i[t]=r[t]=1,n[t]=4,defined(o=a[t])||(o=a[t]=new Cartesian3),Cartesian3.subtract(e[t+1],e[t-1],o),Cartesian3.multiplyByScalar(o,3,o);return n[t]=2,defined(o=a[t])||(o=a[t]=new Cartesian3),Cartesian3.subtract(e[t],e[t-1],o),Cartesian3.multiplyByScalar(o,3,o),TridiagonalSystemSolver.solve(i,n,r,a)}function HermiteSpline(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).points,i=e.times,r=e.inTangents,n=e.outTangents;this._times=i,this._points=t,this._inTangents=r,this._outTangents=n,this._lastTimeIndex=0}Object.defineProperties(HermiteSpline.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}},inTangents:{get:function(){return this._inTangents}},outTangents:{get:function(){return this._outTangents}}}),HermiteSpline.createC1=function(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).times,i=e.points,r=e.tangents,n=r.slice(0,r.length-1);return new HermiteSpline({times:t,points:i,inTangents:r.slice(1,r.length),outTangents:n})},HermiteSpline.createNaturalCubic=function(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).times,i=e.points;if(i.length<3)return new LinearSpline({points:i,times:t});var r=generateNatural(i),n=r.slice(0,r.length-1);return new HermiteSpline({times:t,points:i,inTangents:r.slice(1,r.length),outTangents:n})},HermiteSpline.createClampedCubic=function(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).times,i=e.points,r=e.firstTangent,n=e.lastTangent;if(i.length<3)return new LinearSpline({points:i,times:t});var a=generateClamped(i,r,n),o=a.slice(0,a.length-1);return new HermiteSpline({times:t,points:i,inTangents:a.slice(1,a.length),outTangents:o})},HermiteSpline.hermiteCoefficientMatrix=new Matrix4(2,-3,0,1,-2,3,0,0,1,-2,1,0,1,-1,0,0),HermiteSpline.prototype.findTimeInterval=Spline.prototype.findTimeInterval;var scratchTimeVec=new Cartesian4,scratchTemp=new Cartesian3;HermiteSpline.prototype.wrapTime=Spline.prototype.wrapTime,HermiteSpline.prototype.clampTime=Spline.prototype.clampTime,HermiteSpline.prototype.evaluate=function(e,t){defined(t)||(t=new Cartesian3);var i=this.points,r=this.times,n=this.inTangents,a=this.outTangents,o=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),s=(e-r[o])/(r[o+1]-r[o]),l=scratchTimeVec;l.z=s,l.y=s*s,l.x=l.y*s,l.w=1;var u=Matrix4.multiplyByVector(HermiteSpline.hermiteCoefficientMatrix,l,l);return t=Cartesian3.multiplyByScalar(i[o],u.x,t),Cartesian3.multiplyByScalar(i[o+1],u.y,scratchTemp),Cartesian3.add(t,scratchTemp,t),Cartesian3.multiplyByScalar(a[o],u.z,scratchTemp),Cartesian3.add(t,scratchTemp,t),Cartesian3.multiplyByScalar(n[o],u.w,scratchTemp),Cartesian3.add(t,scratchTemp,t)};var scratchTimeVec$1=new Cartesian4,scratchTemp0=new Cartesian3,scratchTemp1=new Cartesian3;function createEvaluateFunction(c){var d=c.points,h=c.times;if(d.length<3){var r=h[0],n=1/(h[1]-r),a=d[0],o=d[1];return function(e,t){defined(t)||(t=new Cartesian3);var i=(e-r)*n;return Cartesian3.lerp(a,o,i,t)}}return function(e,t){defined(t)||(t=new Cartesian3);var i,r,n,a,o,s=c._lastTimeIndex=c.findTimeInterval(e,c._lastTimeIndex),l=(e-h[s])/(h[s+1]-h[s]),u=scratchTimeVec$1;return u.z=l,u.y=l*l,u.x=u.y*l,u.w=1,o=0===s?(i=d[0],r=d[1],n=c.firstTangent,a=Cartesian3.subtract(d[2],i,scratchTemp0),Cartesian3.multiplyByScalar(a,.5,a),Matrix4.multiplyByVector(HermiteSpline.hermiteCoefficientMatrix,u,u)):s===d.length-2?(i=d[s],r=d[s+1],a=c.lastTangent,n=Cartesian3.subtract(r,d[s-1],scratchTemp0),Cartesian3.multiplyByScalar(n,.5,n),Matrix4.multiplyByVector(HermiteSpline.hermiteCoefficientMatrix,u,u)):(i=d[s-1],r=d[s],n=d[s+1],a=d[s+2],Matrix4.multiplyByVector(CatmullRomSpline.catmullRomCoefficientMatrix,u,u)),t=Cartesian3.multiplyByScalar(i,o.x,t),Cartesian3.multiplyByScalar(r,o.y,scratchTemp1),Cartesian3.add(t,scratchTemp1,t),Cartesian3.multiplyByScalar(n,o.z,scratchTemp1),Cartesian3.add(t,scratchTemp1,t),Cartesian3.multiplyByScalar(a,o.w,scratchTemp1),Cartesian3.add(t,scratchTemp1,t)}}var firstTangentScratch=new Cartesian3,lastTangentScratch=new Cartesian3;function CatmullRomSpline(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).points,i=e.times,r=e.firstTangent,n=e.lastTangent;if(2<t.length&&(defined(r)||(r=firstTangentScratch,Cartesian3.multiplyByScalar(t[1],2,r),Cartesian3.subtract(r,t[2],r),Cartesian3.subtract(r,t[0],r),Cartesian3.multiplyByScalar(r,.5,r)),!defined(n))){var a=t.length-1;n=lastTangentScratch,Cartesian3.multiplyByScalar(t[a-1],2,n),Cartesian3.subtract(t[a],n,n),Cartesian3.add(n,t[a-2],n),Cartesian3.multiplyByScalar(n,.5,n)}this._times=i,this._points=t,this._firstTangent=Cartesian3.clone(r),this._lastTangent=Cartesian3.clone(n),this._evaluateFunction=createEvaluateFunction(this),this._lastTimeIndex=0}function getStringFromTypedArray(e,t,i){return t=defaultValue(t,0),i=defaultValue(i,e.byteLength-t),e=e.subarray(t,t+i),getStringFromTypedArray.decode(e)}function inRange(e,t,i){return t<=e&&e<=i}function utf8Handler(e){for(var t=0,i=0,r=0,n=128,a=191,o=[],s=e.length,l=0;l<s;++l){var u=e[l];if(0===r){if(inRange(u,0,127)){o.push(u);continue}if(inRange(u,194,223)){r=1,t=31&u;continue}if(inRange(u,224,239)){224===u&&(n=160),237===u&&(a=159),r=2,t=15&u;continue}if(inRange(u,240,244)){240===u&&(n=144),244===u&&(a=143),r=3,t=7&u;continue}throw new RuntimeError("String decoding failed.")}inRange(u,n,a)?(n=128,a=191,t=t<<6|63&u,++i===r&&(o.push(t),t=r=i=0)):(t=r=i=0,n=128,a=191,--l)}return o}Object.defineProperties(CatmullRomSpline.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}},firstTangent:{get:function(){return this._firstTangent}},lastTangent:{get:function(){return this._lastTangent}}}),CatmullRomSpline.catmullRomCoefficientMatrix=new Matrix4(-.5,1,-.5,0,1.5,-2.5,0,1,-1.5,2,.5,0,.5,-.5,0,0),CatmullRomSpline.prototype.findTimeInterval=Spline.prototype.findTimeInterval,CatmullRomSpline.prototype.wrapTime=Spline.prototype.wrapTime,CatmullRomSpline.prototype.clampTime=Spline.prototype.clampTime,CatmullRomSpline.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)},getStringFromTypedArray.decodeWithTextDecoder=function(e){return new TextDecoder("utf-8").decode(e)},getStringFromTypedArray.decodeWithFromCharCode=function(e){for(var t="",i=utf8Handler(e),r=i.length,n=0;n<r;++n){var a=i[n];a<=65535?t+=String.fromCharCode(a):(a-=65536,t+=String.fromCharCode(55296+(a>>10),56320+(1023&a)))}return t},"undefined"!=typeof TextDecoder?getStringFromTypedArray.decode=getStringFromTypedArray.decodeWithTextDecoder:getStringFromTypedArray.decode=getStringFromTypedArray.decodeWithFromCharCode;var Intersections2D={};function QuantizedMeshTerrainData(e){this._quantizedVertices=e.quantizedVertices,this._encodedNormals=e.encodedNormals,this._indices=e.indices,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._boundingSphere=e.boundingSphere,this._orientedBoundingBox=e.orientedBoundingBox,this._horizonOcclusionPoint=e.horizonOcclusionPoint,this._credits=e.credits;var t=this._quantizedVertices.length/3,i=this._uValues=this._quantizedVertices.subarray(0,t),r=this._vValues=this._quantizedVertices.subarray(t,2*t);function n(e,t){return r[e]-r[t]}function a(e,t){return i[e]-i[t]}this._heightValues=this._quantizedVertices.subarray(2*t,3*t),this._westIndices=sortIndicesIfNecessary(e.westIndices,n,t),this._southIndices=sortIndicesIfNecessary(e.southIndices,a,t),this._eastIndices=sortIndicesIfNecessary(e.eastIndices,n,t),this._northIndices=sortIndicesIfNecessary(e.northIndices,a,t),this._westSkirtHeight=e.westSkirtHeight,this._southSkirtHeight=e.southSkirtHeight,this._eastSkirtHeight=e.eastSkirtHeight,this._northSkirtHeight=e.northSkirtHeight,this._childTileMask=defaultValue(e.childTileMask,15),this._createdByUpsampling=defaultValue(e.createdByUpsampling,!1),this._waterMask=e.waterMask,this._mesh=void 0}Intersections2D.clipTriangleAtAxisAlignedThreshold=function(e,t,i,r,n,a){var o,s,l;defined(a)?a.length=0:a=[],l=t?(o=i<e,s=r<e,n<e):(o=e<i,s=e<r,e<n);var u,c,d,h,p,f,m=o+s+l;return 1===m?o?(u=(e-i)/(r-i),c=(e-i)/(n-i),a.push(1),a.push(2),1!==c&&(a.push(-1),a.push(0),a.push(2),a.push(c)),1!==u&&(a.push(-1),a.push(0),a.push(1),a.push(u))):s?(d=(e-r)/(n-r),h=(e-r)/(i-r),a.push(2),a.push(0),1!==h&&(a.push(-1),a.push(1),a.push(0),a.push(h)),1!==d&&(a.push(-1),a.push(1),a.push(2),a.push(d))):l&&(p=(e-n)/(i-n),f=(e-n)/(r-n),a.push(0),a.push(1),1!==f&&(a.push(-1),a.push(2),a.push(1),a.push(f)),1!==p&&(a.push(-1),a.push(2),a.push(0),a.push(p))):2===m?o||i===e?s||r===e?l||n===e||(c=(e-i)/(n-i),d=(e-r)/(n-r),a.push(2),a.push(-1),a.push(0),a.push(2),a.push(c),a.push(-1),a.push(1),a.push(2),a.push(d)):(f=(e-n)/(r-n),u=(e-i)/(r-i),a.push(1),a.push(-1),a.push(2),a.push(1),a.push(f),a.push(-1),a.push(0),a.push(1),a.push(u)):(h=(e-r)/(i-r),p=(e-n)/(i-n),a.push(0),a.push(-1),a.push(1),a.push(0),a.push(h),a.push(-1),a.push(2),a.push(0),a.push(p)):3!==m&&(a.push(0),a.push(1),a.push(2)),a},Intersections2D.computeBarycentricCoordinates=function(e,t,i,r,n,a,o,s,l){var u=i-o,c=o-n,d=a-s,h=r-s,p=1/(d*u+c*h),f=t-s,m=e-o,g=(d*m+c*f)*p,y=(-h*m+u*f)*p,v=1-g-y;return defined(l)?(l.x=g,l.y=y,l.z=v,l):new Cartesian3(g,y,v)},Intersections2D.computeLineSegmentLineSegmentIntersection=function(e,t,i,r,n,a,o,s,l){var u=(s-a)*(i-e)-(o-n)*(r-t);if(0!=u){var c=((o-n)*(t-a)-(s-a)*(e-n))/u,d=((i-e)*(t-a)-(r-t)*(e-n))/u;return 0<=c&&c<=1&&0<=d&&d<=1?(defined(l)||(l=new Cartesian2),l.x=e+c*(i-e),l.y=t+c*(r-t),l):void 0}},Object.defineProperties(QuantizedMeshTerrainData.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}},canUpsample:{get:function(){return defined(this._mesh)}}});var arrayScratch=[];function sortIndicesIfNecessary(e,t,i){arrayScratch.length=e.length;for(var r=!1,n=0,a=e.length;n<a;++n)arrayScratch[n]=e[n],r=r||0<n&&0<t(e[n-1],e[n]);return r?(arrayScratch.sort(t),IndexDatatype$1.createTypedArray(i,arrayScratch)):e}var createMeshTaskProcessor=new TaskProcessor("createVerticesFromQuantizedTerrainMesh");QuantizedMeshTerrainData.prototype.createMesh=function(e,t,i,r,p){var n=e.ellipsoid,a=e.tileXYToRectangle(t,i,r);p=defaultValue(p,1),ExpandByTerra.underEarth.enable&&(this._westSkirtHeight=0,this._southSkirtHeight=0,this._eastSkirtHeight=0,this._northSkirtHeight=0);var o=createMeshTaskProcessor.scheduleTask({minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,quantizedVertices:this._quantizedVertices,octEncodedNormals:this._encodedNormals,includeWebMercatorT:!0,indices:this._indices,westIndices:this._westIndices,southIndices:this._southIndices,eastIndices:this._eastIndices,northIndices:this._northIndices,westSkirtHeight:this._westSkirtHeight,southSkirtHeight:this._southSkirtHeight,eastSkirtHeight:this._eastSkirtHeight,northSkirtHeight:this._northSkirtHeight,rectangle:a,relativeToCenter:this._boundingSphere.center,ellipsoid:n,exaggeration:p});if(defined(o)){var f=this;return when(o,function(e){var t=f._quantizedVertices.length/3,i=t+f._westIndices.length+f._southIndices.length+f._eastIndices.length+f._northIndices.length,r=IndexDatatype$1.createTypedArray(i,e.indices),n=new Float32Array(e.vertices),a=e.center,o=e.minimumHeight,s=e.maximumHeight,l=defaultValue(BoundingSphere.clone(e.boundingSphere),f._boundingSphere),u=defaultValue(OrientedBoundingBox.clone(e.orientedBoundingBox),f._orientedBoundingBox),c=defaultValue(Cartesian3.clone(e.occludeePointInScaledSpace),f._horizonOcclusionPoint),d=e.vertexStride,h=TerrainEncoding.clone(e.encoding);return f._mesh=new TerrainMesh(a,n,r,e.indexCountWithoutSkirts,t,o,s,l,c,d,u,h,p,e.westIndicesSouthToNorth,e.southIndicesEastToWest,e.eastIndicesNorthToSouth,e.northIndicesWestToEast),f._quantizedVertices=void 0,f._encodedNormals=void 0,f._indices=void 0,f._uValues=void 0,f._vValues=void 0,f._heightValues=void 0,f._westIndices=void 0,f._southIndices=void 0,f._eastIndices=void 0,f._northIndices=void 0,f._mesh})}};var upsampleTaskProcessor=new TaskProcessor("upsampleQuantizedTerrainMesh");QuantizedMeshTerrainData.prototype.upsample=function(e,t,i,r,n,a,o){var s=this._mesh;if(defined(this._mesh)){var l=2*t!==n,u=2*i===a,c=e.ellipsoid,d=e.tileXYToRectangle(n,a,o),h=upsampleTaskProcessor.scheduleTask({vertices:s.vertices,vertexCountWithoutSkirts:s.vertexCountWithoutSkirts,indices:s.indices,indexCountWithoutSkirts:s.indexCountWithoutSkirts,encoding:s.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:l,isNorthChild:u,childRectangle:d,ellipsoid:c,exaggeration:s.exaggeration});if(defined(h)){var p=Math.min(this._westSkirtHeight,this._eastSkirtHeight);p=Math.min(p,this._southSkirtHeight),p=Math.min(p,this._northSkirtHeight);var f=l?.5*p:this._westSkirtHeight,m=u?.5*p:this._southSkirtHeight,g=l?this._eastSkirtHeight:.5*p,y=u?this._northSkirtHeight:.5*p,v=this._credits;return when(h).then(function(e){var t,i=new Uint16Array(e.vertices),r=IndexDatatype$1.createTypedArray(i.length/3,e.indices);return defined(e.encodedNormals)&&(t=new Uint8Array(e.encodedNormals)),new QuantizedMeshTerrainData({quantizedVertices:i,indices:r,encodedNormals:t,minimumHeight:e.minimumHeight,maximumHeight:e.maximumHeight,boundingSphere:BoundingSphere.clone(e.boundingSphere),orientedBoundingBox:OrientedBoundingBox.clone(e.orientedBoundingBox),horizonOcclusionPoint:Cartesian3.clone(e.horizonOcclusionPoint),westIndices:e.westIndices,southIndices:e.southIndices,eastIndices:e.eastIndices,northIndices:e.northIndices,westSkirtHeight:f,southSkirtHeight:m,eastSkirtHeight:g,northSkirtHeight:y,childTileMask:0,credits:v,createdByUpsampling:!0})})}}};var maxShort=32767,barycentricCoordinateScratch=new Cartesian3;function pointInBoundingBox(e,t,i,r,n,a,o,s){var l=Math.min(i,n,o),u=Math.max(i,n,o),c=Math.min(r,a,s),d=Math.max(r,a,s);return l<=e&&e<=u&&c<=t&&t<=d}QuantizedMeshTerrainData.prototype.interpolateHeight=function(e,t,i){var r=CesiumMath.clamp((t-e.west)/e.width,0,1);r*=maxShort;var n=CesiumMath.clamp((i-e.south)/e.height,0,1);return n*=maxShort,defined(this._mesh)?interpolateMeshHeight$1(this,r,n):interpolateHeight$1(this,r,n)};var texCoordScratch0=new Cartesian2,texCoordScratch1=new Cartesian2,texCoordScratch2=new Cartesian2;function interpolateMeshHeight$1(e,t,i){for(var r=e._mesh,n=r.vertices,a=r.encoding,o=r.indices,s=0,l=o.length;s<l;s+=3){var u=o[s],c=o[s+1],d=o[s+2],h=a.decodeTextureCoordinates(n,u,texCoordScratch0),p=a.decodeTextureCoordinates(n,c,texCoordScratch1),f=a.decodeTextureCoordinates(n,d,texCoordScratch2);if(pointInBoundingBox(t,i,h.x,h.y,p.x,p.y,f.x,f.y)){var m=Intersections2D.computeBarycentricCoordinates(t,i,h.x,h.y,p.x,p.y,f.x,f.y,barycentricCoordinateScratch);if(-1e-15<=m.x&&-1e-15<=m.y&&-1e-15<=m.z){var g=a.decodeHeight(n,u),y=a.decodeHeight(n,c),v=a.decodeHeight(n,d);return m.x*g+m.y*y+m.z*v}}}}function interpolateHeight$1(e,t,i){for(var r=e._uValues,n=e._vValues,a=e._heightValues,o=e._indices,s=0,l=o.length;s<l;s+=3){var u=o[s],c=o[s+1],d=o[s+2],h=r[u],p=r[c],f=r[d],m=n[u],g=n[c],y=n[d];if(pointInBoundingBox(t,i,h,m,p,g,f,y)){var v=Intersections2D.computeBarycentricCoordinates(t,i,h,m,p,g,f,y,barycentricCoordinateScratch);if(-1e-15<=v.x&&-1e-15<=v.y&&-1e-15<=v.z){var _=v.x*a[u]+v.y*a[c]+v.z*a[d];return CesiumMath.lerp(e._minimumHeight,e._maximumHeight,_/maxShort)}}}}function LayerInformation(e){this.resource=e.resource,this.version=e.version,this.isHeightmap=e.isHeightmap,this.tileUrlTemplates=e.tileUrlTemplates,this.availability=e.availability,this.hasVertexNormals=e.hasVertexNormals,this.hasWaterMask=e.hasWaterMask,this.hasMetadata=e.hasMetadata,this.availabilityLevels=e.availabilityLevels,this.availabilityTilesLoaded=e.availabilityTilesLoaded,this.littleEndianExtensionSize=e.littleEndianExtensionSize,this.availabilityTilesLoaded=e.availabilityTilesLoaded,this.availabilityPromiseCache={}}function CesiumTerrainProvider(e){this._heightmapWidth=65,this._heightmapStructure=void 0,this._hasWaterMask=!1,this._hasVertexNormals=!1,this._ellipsoid=e.ellipsoid,this._requestVertexNormals=defaultValue(e.requestVertexNormals,!1),this._requestWaterMask=defaultValue(e.requestWaterMask,!1),this._requestMetadata=defaultValue(e.requestMetadata,!0),this._errorEvent=new Event;var t=e.credit;"string"==typeof t&&(t=new Credit(t)),this._credit=t,this._availability=void 0;var i=when.defer();this._ready=!1,this._readyPromise=i,this._tileCredits=void 0;var x,b,A,S=this,w=this._layers=[],E="",T=[],P=0;function M(e){var t;if(!e.format)return t="The tile format is not specified in the layer.json file.",void(A=TileProviderError.handleError(A,S,S._errorEvent,t,void 0,void 0,void 0,I));if(!e.tiles||0===e.tiles.length)return t="The layer.json file does not specify any tile URL templates.",void(A=TileProviderError.handleError(A,S,S._errorEvent,t,void 0,void 0,void 0,I));var i=!1,r=!1,n=!1,a=!0,o=!1;if("heightmap-1.0"===e.format)o=!0,defined(S._heightmapStructure)||(S._heightmapStructure={heightScale:.2,heightOffset:-1e3,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1,lowestEncodedHeight:0,highestEncodedHeight:65535}),r=!0,S._requestWaterMask=!0;else if(0!==e.format.indexOf("quantized-mesh-1."))return t='The tile format "'+e.format+'" is invalid or not supported.',void(A=TileProviderError.handleError(A,S,S._errorEvent,t,void 0,void 0,void 0,I));var s,l=e.tiles,u=e.maxzoom;if(P=Math.max(P,u),e.projection&&"EPSG:4326"!==e.projection){if("EPSG:3857"!==e.projection)return t='The projection "'+e.projection+'" is invalid or not supported.',void(A=TileProviderError.handleError(A,S,S._errorEvent,t,void 0,void 0,void 0,I));S._tilingScheme=new WebMercatorTilingScheme({numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:S._ellipsoid})}else S._tilingScheme=new GeographicTilingScheme({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:1,ellipsoid:S._ellipsoid});if(S._levelZeroMaximumGeometricError=TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap(S._tilingScheme.ellipsoid,S._heightmapWidth,S._tilingScheme.getNumberOfXTilesAtLevel(0)),e.scheme&&"tms"!==e.scheme&&"slippyMap"!==e.scheme)return t='The scheme "'+e.scheme+'" is invalid or not supported.',void(A=TileProviderError.handleError(A,S,S._errorEvent,t,void 0,void 0,void 0,I));S._scheme=e.scheme,defined(e.extensions)&&-1!==e.extensions.indexOf("octvertexnormals")?i=!0:defined(e.extensions)&&-1!==e.extensions.indexOf("vertexnormals")&&(a=!(i=!0)),defined(e.extensions)&&-1!==e.extensions.indexOf("watermask")&&(r=!0),defined(e.extensions)&&-1!==e.extensions.indexOf("metadata")&&(n=!0);var c,d=e.metadataAvailability,h=e.available;if(defined(h)&&!defined(d)){c=new TileAvailability(S._tilingScheme,h.length);for(var p=0;p<h.length;++p){var f=h[p],m=S._tilingScheme.getNumberOfYTilesAtLevel(p);defined(T[p])||(T[p]=[]);for(var g=0;g<f.length;++g){var y=f[g],v=m-y.endY-1,_=m-y.startY-1;T[p].push([y.startX,v,y.endX,_]),c.addAvailableTileRange(p,y.startX,v,y.endX,_)}}}else defined(d)&&(s=new TileAvailability(S._tilingScheme,u),c=new TileAvailability(S._tilingScheme,u),T[0]=[[0,0,1,0]],c.addAvailableTileRange(0,0,0,1,0));S._hasWaterMask=S._hasWaterMask||r,S._hasVertexNormals=S._hasVertexNormals||i,S._hasMetadata=S._hasMetadata||n,defined(e.attribution)&&(0<E.length&&(E+=" "),E+=e.attribution),w.push(new LayerInformation({resource:x,version:e.version,isHeightmap:o,tileUrlTemplates:l,availability:c,hasVertexNormals:i,hasWaterMask:r,hasMetadata:n,availabilityLevels:d,availabilityTilesLoaded:s,littleEndianExtensionSize:a}));var C=e.parentUrl;return defined(C)?defined(c)?((x=x.getDerivedResource({url:C})).appendForwardSlash(),when((b=x.getDerivedResource({url:"layer.json"})).fetchJson(),M,D)):(console.log("A layer.json can't have a parentUrl if it does't have an available array."),when.resolve()):when.resolve()}function D(e){var t="An error occurred while accessing "+b.url+".";A=TileProviderError.handleError(A,S,S._errorEvent,t,void 0,void 0,void 0,I)}function r(e){M(e).then(function(){if(!defined(A)){var e=T.length;if(0<e)for(var t=S._availability=new TileAvailability(S._tilingScheme,P),i=0;i<e;++i)for(var r=T[i],n=0;n<r.length;++n){var a=r[n];t.addAvailableTileRange(i,a[0],a[1],a[2],a[3])}if(0<E.length){var o=new Credit(E);defined(S._tileCredits)?S._tileCredits.push(o):S._tileCredits=[o]}S._ready=!0,S._readyPromise.resolve(!0)}})}function n(e){defined(e)&&404===e.statusCode?r({tilejson:"2.1.0",format:"heightmap-1.0",version:"1.0.0",scheme:"tms",tiles:["{z}/{x}/{y}.terrain?v={version}"]}):D()}function I(){when(b.fetchJson()).then(r).otherwise(n)}when(e.url).then(function(e){var t=Resource.createIfNeeded(e);t.appendForwardSlash(),b=(x=t).getDerivedResource({url:"layer.json"}),S._tileCredits=t.credits,I()}).otherwise(function(e){i.reject(e)})}QuantizedMeshTerrainData.prototype.isChildAvailable=function(e,t,i,r){var n=2;return i!==2*e&&++n,r!==2*t&&(n-=2),0!=(this._childTileMask&1<<n)},QuantizedMeshTerrainData.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var QuantizedMeshExtensionIds={OCT_VERTEX_NORMALS:1,WATER_MASK:2,METADATA:4};function getRequestHeader(e){return defined(e)&&0!==e.length?{Accept:"application/vnd.quantized-mesh;extensions="+e.join("-")+",application/octet-stream;q=0.9,*/*;q=0.01"}:{Accept:"application/vnd.quantized-mesh,application/octet-stream;q=0.9,*/*;q=0.01"}}function createHeightmapTerrainData(e,t,i,r,n){var a=new Uint16Array(t,0,e._heightmapWidth*e._heightmapWidth);return new HeightmapTerrainData({buffer:a,childTileMask:new Uint8Array(t,a.byteLength,1)[0],waterMask:new Uint8Array(t,a.byteLength+1,t.byteLength-a.byteLength-1),width:e._heightmapWidth,height:e._heightmapWidth,structure:e._heightmapStructure,credits:e._tileCredits})}function createQuantizedMeshTerrainData(e,t,i,r,n,a){var o=a.littleEndianExtensionSize,s=0,l=3*Float64Array.BYTES_PER_ELEMENT,u=4*Float64Array.BYTES_PER_ELEMENT,c=3*Uint16Array.BYTES_PER_ELEMENT,d=Uint16Array.BYTES_PER_ELEMENT,h=3*d,p=new DataView(t),f=new Cartesian3(p.getFloat64(s,!0),p.getFloat64(s+8,!0),p.getFloat64(s+16,!0));s+=l;var m=p.getFloat32(s,!0);s+=Float32Array.BYTES_PER_ELEMENT;var g=p.getFloat32(s,!0);s+=Float32Array.BYTES_PER_ELEMENT;var y=new BoundingSphere(new Cartesian3(p.getFloat64(s,!0),p.getFloat64(s+8,!0),p.getFloat64(s+16,!0)),p.getFloat64(s+l,!0));s+=u;var v=new Cartesian3(p.getFloat64(s,!0),p.getFloat64(s+8,!0),p.getFloat64(s+16,!0));s+=l;var _=p.getUint32(s,!0);s+=Uint32Array.BYTES_PER_ELEMENT;var C=new Uint16Array(t,s,3*_);s+=_*c,65536<_&&(h=3*(d=Uint32Array.BYTES_PER_ELEMENT));var x=C.subarray(0,_),b=C.subarray(_,2*_),A=C.subarray(2*_,3*_);AttributeCompression.zigZagDeltaDecode(x,b,A),s%d!=0&&(s+=d-s%d);var S=p.getUint32(s,!0);s+=Uint32Array.BYTES_PER_ELEMENT;var w=IndexDatatype$1.createTypedArrayFromArrayBuffer(_,t,s,3*S);s+=S*h;for(var E=0,T=w.length,P=0;P<T;++P){var M=w[P];w[P]=E-M,0===M&&++E}var D=p.getUint32(s,!0);s+=Uint32Array.BYTES_PER_ELEMENT;var I=IndexDatatype$1.createTypedArrayFromArrayBuffer(_,t,s,D);s+=D*d;var O=p.getUint32(s,!0);s+=Uint32Array.BYTES_PER_ELEMENT;var R=IndexDatatype$1.createTypedArrayFromArrayBuffer(_,t,s,O);s+=O*d;var L=p.getUint32(s,!0);s+=Uint32Array.BYTES_PER_ELEMENT;var N=IndexDatatype$1.createTypedArrayFromArrayBuffer(_,t,s,L);s+=L*d;var k=p.getUint32(s,!0);s+=Uint32Array.BYTES_PER_ELEMENT;var B,F,V=IndexDatatype$1.createTypedArrayFromArrayBuffer(_,t,s,k);for(s+=k*d;s<p.byteLength;){var z=p.getUint8(s,!0);s+=Uint8Array.BYTES_PER_ELEMENT;var U=p.getUint32(s,o);if(s+=Uint32Array.BYTES_PER_ELEMENT,z===QuantizedMeshExtensionIds.OCT_VERTEX_NORMALS&&e._requestVertexNormals)B=new Uint8Array(t,s,2*_);else if(z===QuantizedMeshExtensionIds.WATER_MASK&&e._requestWaterMask)F=new Uint8Array(t,s,U);else if(z===QuantizedMeshExtensionIds.METADATA&&e._requestMetadata){var G=p.getUint32(s,!0);if(0<G){var $=getStringFromTypedArray(new Uint8Array(t),s+Uint32Array.BYTES_PER_ELEMENT,G),H=JSON.parse($).available;if(defined(H))for(var W=0;W<H.length;++W)for(var j=i+W+1,q=H[W],Q=e._tilingScheme.getNumberOfYTilesAtLevel(j),Y=0;Y<q.length;++Y){var X=q[Y],Z=Q-X.endY-1,J=Q-X.startY-1;e.availability.addAvailableTileRange(j,X.startX,Z,X.endX,J),a.availability.addAvailableTileRange(j,X.startX,Z,X.endX,J)}}a.availabilityTilesLoaded.addAvailableTileRange(i,r,n,r,n)}s+=U}var K=5*e.getLevelMaximumGeometricError(i),ee=e._tilingScheme.tileXYToRectangle(r,n,i);return new QuantizedMeshTerrainData({center:f,minimumHeight:m,maximumHeight:g,boundingSphere:y,orientedBoundingBox:OrientedBoundingBox.fromRectangle(ee,m,g,e._tilingScheme.ellipsoid),horizonOcclusionPoint:v,quantizedVertices:C,encodedNormals:B,indices:w,westIndices:I,southIndices:R,eastIndices:N,northIndices:V,westSkirtHeight:K,southSkirtHeight:K,eastSkirtHeight:K,northSkirtHeight:K,childTileMask:e.availability.computeChildMaskForTile(i,r,n),waterMask:F,credits:e._tileCredits})}function requestTileGeometry(t,i,r,n,a,e){if(!defined(a))return when.reject(new RuntimeError("Terrain tile doesn't exist"));var o=a.tileUrlTemplates;if(0!==o.length){var s;if(t._scheme&&"tms"!==t._scheme)s=r;else s=t._tilingScheme.getNumberOfYTilesAtLevel(n)-r-1;var l,u,c=[];t._requestVertexNormals&&a.hasVertexNormals&&c.push(a.littleEndianExtensionSize?"octvertexnormals":"vertexnormals"),t._requestWaterMask&&a.hasWaterMask&&c.push("watermask"),t._requestMetadata&&a.hasMetadata&&c.push("metadata");var d=o[(i+s+n)%o.length],h=a.resource;l=defined(h._ionEndpoint)&&!defined(h._ionEndpoint.externalType)?(0!==c.length&&(u={extensions:c.join("-")}),getRequestHeader(void 0)):getRequestHeader(c);var p=h.getDerivedResource({url:d,templateValues:{version:a.version,z:n,x:i,y:s},queryParameters:u,headers:l,request:e}).fetchArrayBuffer();if(defined(p))return p.then(function(e){return defined(t._heightmapStructure)?createHeightmapTerrainData(t,e):createQuantizedMeshTerrainData(t,e,n,i,r,a)})}}function getAvailabilityTile(e,t,i,r){if(0!==r){var n=e.availabilityLevels,a=r%n==0?r-n:(r/n|0)*n,o=1<<r-a;return{level:a,x:t/o|0,y:i/o|0}}}function checkLayer(e,t,i,r,n,a){if(!defined(n.availabilityLevels))return{result:!1};for(var o,s=function(){delete n.availabilityPromiseCache[o]},l=n.availabilityTilesLoaded,u=n.availability,c=getAvailabilityTile(n,t,i,r);defined(c);){if(u.isTileAvailable(c.level,c.x,c.y)&&!l.isTileAvailable(c.level,c.x,c.y)){var d;if(!a&&(o=c.level+"-"+c.x+"-"+c.y,!defined(d=n.availabilityPromiseCache[o]))){var h=new Request({throttle:!0,throttleByServer:!0,type:RequestType$1.TERRAIN});defined(d=requestTileGeometry(e,c.x,c.y,c.level,n,h))&&(n.availabilityPromiseCache[o]=d).then(s)}return{result:!0,promise:d}}c=getAvailabilityTile(n,c.x,c.y,c.level)}return{result:!1}}CesiumTerrainProvider.prototype.requestTileGeometry=function(e,t,i,r){var n,a=this._layers,o=a.length;if(1===o)n=a[0];else for(var s=0;s<o;++s){var l=a[s];if(!defined(l.availability)||l.availability.isTileAvailable(i,e,t)){n=l;break}}return requestTileGeometry(this,e,t,i,n,r)},Object.defineProperties(CesiumTerrainProvider.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},hasWaterMask:{get:function(){return this._hasWaterMask&&this._requestWaterMask}},hasVertexNormals:{get:function(){return this._hasVertexNormals&&this._requestVertexNormals}},hasMetadata:{get:function(){return this._hasMetadata&&this._requestMetadata}},requestVertexNormals:{get:function(){return this._requestVertexNormals}},requestWaterMask:{get:function(){return this._requestWaterMask}},requestMetadata:{get:function(){return this._requestMetadata}},availability:{get:function(){return this._availability}}}),CesiumTerrainProvider.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)},CesiumTerrainProvider.prototype.getTileDataAvailable=function(e,t,i){if(defined(this._availability)){if(i>this._availability._maximumLevel)return!1;if(this._availability.isTileAvailable(i,e,t))return!0;if(!this._hasMetadata)return!1;for(var r=this._layers,n=r.length,a=0;a<n;++a){if(checkLayer(this,e,t,i,r[a],0===a).result)return}return!1}},CesiumTerrainProvider.prototype.loadTileDataAvailability=function(e,t,i){if(!(!defined(this._availability)||i>this._availability._maximumLevel||this._availability.isTileAvailable(i,e,t))&&this._hasMetadata)for(var r=this._layers,n=r.length,a=0;a<n;++a){var o=checkLayer(this,e,t,i,r[a],0===a);if(defined(o.promise))return o.promise}},CesiumTerrainProvider._getAvailabilityTile=getAvailabilityTile;var EllipseGeometryLibrary={},rotAxis=new Cartesian3,tempVec=new Cartesian3,unitQuat=new Quaternion,rotMtx=new Matrix3;function pointOnEllipsoid(e,t,i,r,n,a,o,s,l,u){var c=e+t;Cartesian3.multiplyByScalar(r,Math.cos(c),rotAxis),Cartesian3.multiplyByScalar(i,Math.sin(c),tempVec),Cartesian3.add(rotAxis,tempVec,rotAxis);var d=Math.cos(e);d*=d;var h=Math.sin(e);h*=h;var p=a/Math.sqrt(o*d+n*h)/s;return Quaternion.fromAxisAngle(rotAxis,p,unitQuat),Matrix3.fromQuaternion(unitQuat,rotMtx),Matrix3.multiplyByVector(rotMtx,l,u),Cartesian3.normalize(u,u),Cartesian3.multiplyByScalar(u,s,u),u}EllipseGeometryLibrary.pointOnEllipsoid=function(e,t,i,r,n,a,o,s,l,u){return pointOnEllipsoid(e,t,i,r,n,a,o,s,l,u)};var scratchCartesian1$6=new Cartesian3,scratchCartesian2$9=new Cartesian3,scratchCartesian3$9=new Cartesian3,scratchNormal$2=new Cartesian3;EllipseGeometryLibrary.raisePositionsToHeight=function(e,t,i){for(var r=t.ellipsoid,n=t.height,a=t.extrudedHeight,o=i?e.length/3*2:e.length/3,s=new Float64Array(3*o),l=e.length,u=i?l:0,c=0;c<l;c+=3){var d=c+1,h=c+2,p=Cartesian3.fromArray(e,c,scratchCartesian1$6);r.scaleToGeodeticSurface(p,p);var f=Cartesian3.clone(p,scratchCartesian2$9),m=r.geodeticSurfaceNormal(p,scratchNormal$2),g=Cartesian3.multiplyByScalar(m,n,scratchCartesian3$9);Cartesian3.add(p,g,p),i&&(Cartesian3.multiplyByScalar(m,a,g),Cartesian3.add(f,g,f),s[c+u]=f.x,s[d+u]=f.y,s[h+u]=f.z),s[c]=p.x,s[d]=p.y,s[h]=p.z}return s};var unitPosScratch=new Cartesian3,eastVecScratch=new Cartesian3,northVecScratch=new Cartesian3;EllipseGeometryLibrary.computeEllipsePositions=function(e,t,i){var r=e.semiMinorAxis,n=e.semiMajorAxis,a=e.rotation,o=e.center,s=8*e.granularity,l=r*r,u=n*n,c=n*r,d=Cartesian3.magnitude(o),h=Cartesian3.normalize(o,unitPosScratch),p=Cartesian3.cross(Cartesian3.UNIT_Z,o,eastVecScratch);p=Cartesian3.normalize(p,p);var f=Cartesian3.cross(h,p,northVecScratch),m=1+Math.ceil(CesiumMath.PI_OVER_TWO/s),g=CesiumMath.PI_OVER_TWO/(m-1),y=CesiumMath.PI_OVER_TWO-m*g;y<0&&(m-=Math.ceil(Math.abs(y)/g));var v,_,C,x,b,A=t?new Array(3*(m*(m+2)*2)):void 0,S=0,w=scratchCartesian1$6,E=scratchCartesian2$9,T=4*m*3,P=T-1,M=0,D=i?new Array(T):void 0;for(w=pointOnEllipsoid(y=CesiumMath.PI_OVER_TWO,a,f,p,l,c,u,d,h,w),t&&(A[S++]=w.x,A[S++]=w.y,A[S++]=w.z),i&&(D[P--]=w.z,D[P--]=w.y,D[P--]=w.x),y=CesiumMath.PI_OVER_TWO-g,v=1;v<m+1;++v){if(w=pointOnEllipsoid(y,a,f,p,l,c,u,d,h,w),E=pointOnEllipsoid(Math.PI-y,a,f,p,l,c,u,d,h,E),t){for(A[S++]=w.x,A[S++]=w.y,A[S++]=w.z,C=2*v+2,_=1;_<C-1;++_)x=_/(C-1),b=Cartesian3.lerp(w,E,x,scratchCartesian3$9),A[S++]=b.x,A[S++]=b.y,A[S++]=b.z;A[S++]=E.x,A[S++]=E.y,A[S++]=E.z}i&&(D[P--]=w.z,D[P--]=w.y,D[P--]=w.x,D[M++]=E.x,D[M++]=E.y,D[M++]=E.z),y=CesiumMath.PI_OVER_TWO-(v+1)*g}for(v=m;1<v;--v){if(w=pointOnEllipsoid(-(y=CesiumMath.PI_OVER_TWO-(v-1)*g),a,f,p,l,c,u,d,h,w),E=pointOnEllipsoid(y+Math.PI,a,f,p,l,c,u,d,h,E),t){for(A[S++]=w.x,A[S++]=w.y,A[S++]=w.z,C=2*(v-1)+2,_=1;_<C-1;++_)x=_/(C-1),b=Cartesian3.lerp(w,E,x,scratchCartesian3$9),A[S++]=b.x,A[S++]=b.y,A[S++]=b.z;A[S++]=E.x,A[S++]=E.y,A[S++]=E.z}i&&(D[P--]=w.z,D[P--]=w.y,D[P--]=w.x,D[M++]=E.x,D[M++]=E.y,D[M++]=E.z)}w=pointOnEllipsoid(-(y=CesiumMath.PI_OVER_TWO),a,f,p,l,c,u,d,h,w);var I={};return t&&(A[S++]=w.x,A[S++]=w.y,A[S++]=w.z,I.positions=A,I.numPts=m),i&&(D[P--]=w.z,D[P--]=w.y,D[P--]=w.x,I.outerPositions=D),I};var scratchCartesian1$7=new Cartesian3,scratchCartesian2$a=new Cartesian3,scratchCartesian3$a=new Cartesian3,scratchCartesian4$3=new Cartesian3,texCoordScratch=new Cartesian2,textureMatrixScratch=new Matrix3,tangentMatrixScratch$1=new Matrix3,quaternionScratch$1=new Quaternion,scratchNormal$3=new Cartesian3,scratchTangent$1=new Cartesian3,scratchBitangent$1=new Cartesian3,scratchCartographic$8=new Cartographic,projectedCenterScratch=new Cartesian3,scratchMinTexCoord=new Cartesian2,scratchMaxTexCoord=new Cartesian2;function computeTopBottomAttributes(e,t,i){var r=t.vertexFormat,n=t.center,a=t.semiMajorAxis,o=t.semiMinorAxis,s=t.ellipsoid,l=t.stRotation,u=i?e.length/3*2:e.length/3,c=t.shadowVolume,d=r.st?new Float32Array(2*u):void 0,h=r.normal?new Float32Array(3*u):void 0,p=r.tangent?new Float32Array(3*u):void 0,f=r.bitangent?new Float32Array(3*u):void 0,m=c?new Float32Array(3*u):void 0,g=0,y=scratchNormal$3,v=scratchTangent$1,_=scratchBitangent$1,C=new GeographicProjection(s),x=C.project(s.cartesianToCartographic(n,scratchCartographic$8),projectedCenterScratch),b=s.scaleToGeodeticSurface(n,scratchCartesian1$7);s.geodeticSurfaceNormal(b,b);var A=textureMatrixScratch,S=tangentMatrixScratch$1;if(0!==l){var w=Quaternion.fromAxisAngle(b,l,quaternionScratch$1);A=Matrix3.fromQuaternion(w,A),w=Quaternion.fromAxisAngle(b,-l,quaternionScratch$1),S=Matrix3.fromQuaternion(w,S)}else A=Matrix3.clone(Matrix3.IDENTITY,A),S=Matrix3.clone(Matrix3.IDENTITY,S);for(var E=Cartesian2.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,scratchMinTexCoord),T=Cartesian2.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,scratchMaxTexCoord),P=e.length,M=i?P:0,D=M/3*2,I=0;I<P;I+=3){var O=I+1,R=I+2,L=Cartesian3.fromArray(e,I,scratchCartesian1$7);if(r.st){var N=Matrix3.multiplyByVector(A,L,scratchCartesian2$a),k=C.project(s.cartesianToCartographic(N,scratchCartographic$8),scratchCartesian3$a);Cartesian3.subtract(k,x,k),texCoordScratch.x=(k.x+a)/(2*a),texCoordScratch.y=(k.y+o)/(2*o),E.x=Math.min(texCoordScratch.x,E.x),E.y=Math.min(texCoordScratch.y,E.y),T.x=Math.max(texCoordScratch.x,T.x),T.y=Math.max(texCoordScratch.y,T.y),i&&(d[g+D]=texCoordScratch.x,d[g+1+D]=texCoordScratch.y),d[g++]=texCoordScratch.x,d[g++]=texCoordScratch.y}(r.normal||r.tangent||r.bitangent||c)&&(y=s.geodeticSurfaceNormal(L,y),c&&(m[I+M]=-y.x,m[O+M]=-y.y,m[R+M]=-y.z),(r.normal||r.tangent||r.bitangent)&&((r.tangent||r.bitangent)&&(v=Cartesian3.normalize(Cartesian3.cross(Cartesian3.UNIT_Z,y,v),v),Matrix3.multiplyByVector(S,v,v)),r.normal&&(h[I]=y.x,h[O]=y.y,h[R]=y.z,i&&(h[I+M]=-y.x,h[O+M]=-y.y,h[R+M]=-y.z)),r.tangent&&(p[I]=v.x,p[O]=v.y,p[R]=v.z,i&&(p[I+M]=-v.x,p[O+M]=-v.y,p[R+M]=-v.z)),r.bitangent&&(_=Cartesian3.normalize(Cartesian3.cross(y,v,_),_),f[I]=_.x,f[O]=_.y,f[R]=_.z,i&&(f[I+M]=_.x,f[O+M]=_.y,f[R+M]=_.z))))}if(r.st){P=d.length;for(var B=0;B<P;B+=2)d[B]=(d[B]-E.x)/(T.x-E.x),d[B+1]=(d[B+1]-E.y)/(T.y-E.y)}var F=new GeometryAttributes;if(r.position){var V=EllipseGeometryLibrary.raisePositionsToHeight(e,t,i);F.position=new GeometryAttribute({componentDatatype:ComponentDatatype$1.DOUBLE,componentsPerAttribute:3,values:V})}if(r.st&&(F.st=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:2,values:d})),r.normal&&(F.normal=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:h})),r.tangent&&(F.tangent=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:p})),r.bitangent&&(F.bitangent=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:f})),c&&(F.extrudeDirection=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:m})),i&&defined(t.offsetAttribute)){var z=new Uint8Array(u);if(t.offsetAttribute===GeometryOffsetAttribute$1.TOP)z=arrayFill(z,1,0,u/2);else z=arrayFill(z,t.offsetAttribute===GeometryOffsetAttribute$1.NONE?0:1);F.applyOffset=new GeometryAttribute({componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE,componentsPerAttribute:1,values:z})}return F}function topIndices(e){var t,i,r,n,a,o=new Array(e*(e+1)*12-6),s=0;for(r=1,n=t=0;n<3;n++)o[s++]=r++,o[s++]=t,o[s++]=r;for(n=2;n<e+1;++n){for(r=n*(n+1)-1,t=(n-1)*n-1,o[s++]=r++,o[s++]=t,o[s++]=r,i=2*n,a=0;a<i-1;++a)o[s++]=r,o[s++]=t++,o[s++]=t,o[s++]=r++,o[s++]=t,o[s++]=r;o[s++]=r++,o[s++]=t,o[s++]=r}for(i=2*e,++r,++t,n=0;n<i-1;++n)o[s++]=r,o[s++]=t++,o[s++]=t,o[s++]=r++,o[s++]=t,o[s++]=r;for(o[s++]=r,o[s++]=t++,o[s++]=t,o[s++]=r++,o[s++]=t++,o[s++]=t,++t,n=e-1;1<n;--n){for(o[s++]=t++,o[s++]=t,o[s++]=r,i=2*n,a=0;a<i-1;++a)o[s++]=r,o[s++]=t++,o[s++]=t,o[s++]=r++,o[s++]=t,o[s++]=r;o[s++]=t++,o[s++]=t++,o[s++]=r++}for(n=0;n<3;n++)o[s++]=t++,o[s++]=t,o[s++]=r;return o}var boundingSphereCenter=new Cartesian3;function computeEllipse(e){var t=e.center;boundingSphereCenter=Cartesian3.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,boundingSphereCenter),e.height,boundingSphereCenter);var i=new BoundingSphere(boundingSphereCenter=Cartesian3.add(t,boundingSphereCenter,boundingSphereCenter),e.semiMajorAxis),r=EllipseGeometryLibrary.computeEllipsePositions(e,!0,!1),n=r.positions,a=r.numPts,o=computeTopBottomAttributes(n,e,!1),s=topIndices(a);return{boundingSphere:i,attributes:o,indices:s=IndexDatatype$1.createTypedArray(n.length/3,s)}}function computeWallAttributes(e,t){var i=t.vertexFormat,r=t.center,n=t.semiMajorAxis,a=t.semiMinorAxis,o=t.ellipsoid,s=t.height,l=t.extrudedHeight,u=t.stRotation,c=e.length/3*2,d=new Float64Array(3*c),h=i.st?new Float32Array(2*c):void 0,p=i.normal?new Float32Array(3*c):void 0,f=i.tangent?new Float32Array(3*c):void 0,m=i.bitangent?new Float32Array(3*c):void 0,g=t.shadowVolume,y=g?new Float32Array(3*c):void 0,v=0,_=scratchNormal$3,C=scratchTangent$1,x=scratchBitangent$1,b=new GeographicProjection(o),A=b.project(o.cartesianToCartographic(r,scratchCartographic$8),projectedCenterScratch),S=o.scaleToGeodeticSurface(r,scratchCartesian1$7);o.geodeticSurfaceNormal(S,S);for(var w=Quaternion.fromAxisAngle(S,u,quaternionScratch$1),E=Matrix3.fromQuaternion(w,textureMatrixScratch),T=Cartesian2.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,scratchMinTexCoord),P=Cartesian2.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,scratchMaxTexCoord),M=e.length,D=M/3*2,I=0;I<M;I+=3){var O,R=I+1,L=I+2,N=Cartesian3.fromArray(e,I,scratchCartesian1$7);if(i.st){var k=Matrix3.multiplyByVector(E,N,scratchCartesian2$a),B=b.project(o.cartesianToCartographic(k,scratchCartographic$8),scratchCartesian3$a);Cartesian3.subtract(B,A,B),texCoordScratch.x=(B.x+n)/(2*n),texCoordScratch.y=(B.y+a)/(2*a),T.x=Math.min(texCoordScratch.x,T.x),T.y=Math.min(texCoordScratch.y,T.y),P.x=Math.max(texCoordScratch.x,P.x),P.y=Math.max(texCoordScratch.y,P.y),h[v+D]=texCoordScratch.x,h[v+1+D]=texCoordScratch.y,h[v++]=texCoordScratch.x,h[v++]=texCoordScratch.y}N=o.scaleToGeodeticSurface(N,N),O=Cartesian3.clone(N,scratchCartesian2$a),_=o.geodeticSurfaceNormal(N,_),g&&(y[I+M]=-_.x,y[R+M]=-_.y,y[L+M]=-_.z);var F=Cartesian3.multiplyByScalar(_,s,scratchCartesian4$3);if(N=Cartesian3.add(N,F,N),F=Cartesian3.multiplyByScalar(_,l,F),O=Cartesian3.add(O,F,O),i.position&&(d[I+M]=O.x,d[R+M]=O.y,d[L+M]=O.z,d[I]=N.x,d[R]=N.y,d[L]=N.z),i.normal||i.tangent||i.bitangent){x=Cartesian3.clone(_,x);var V=Cartesian3.fromArray(e,(I+3)%M,scratchCartesian4$3);Cartesian3.subtract(V,N,V);var z=Cartesian3.subtract(O,N,scratchCartesian3$a);_=Cartesian3.normalize(Cartesian3.cross(z,V,_),_),i.normal&&(p[I]=_.x,p[R]=_.y,p[L]=_.z,p[I+M]=_.x,p[R+M]=_.y,p[L+M]=_.z),i.tangent&&(C=Cartesian3.normalize(Cartesian3.cross(x,_,C),C),f[I]=C.x,f[R]=C.y,f[L]=C.z,f[I+M]=C.x,f[I+1+M]=C.y,f[I+2+M]=C.z),i.bitangent&&(m[I]=x.x,m[R]=x.y,m[L]=x.z,m[I+M]=x.x,m[R+M]=x.y,m[L+M]=x.z)}}if(i.st){M=h.length;for(var U=0;U<M;U+=2)h[U]=(h[U]-T.x)/(P.x-T.x),h[U+1]=(h[U+1]-T.y)/(P.y-T.y)}var G=new GeometryAttributes;if(i.position&&(G.position=new GeometryAttribute({componentDatatype:ComponentDatatype$1.DOUBLE,componentsPerAttribute:3,values:d})),i.st&&(G.st=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:2,values:h})),i.normal&&(G.normal=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:p})),i.tangent&&(G.tangent=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:f})),i.bitangent&&(G.bitangent=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:m})),g&&(G.extrudeDirection=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:y})),defined(t.offsetAttribute)){var $=new Uint8Array(c);if(t.offsetAttribute===GeometryOffsetAttribute$1.TOP)$=arrayFill($,1,0,c/2);else $=arrayFill($,t.offsetAttribute===GeometryOffsetAttribute$1.NONE?0:1);G.applyOffset=new GeometryAttribute({componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE,componentsPerAttribute:1,values:$})}return G}function computeWallIndices(e){for(var t=e.length/3,i=IndexDatatype$1.createTypedArray(t,6*t),r=0,n=0;n<t;n++){var a=n,o=n+t,s=(a+1)%t,l=s+t;i[r++]=a,i[r++]=o,i[r++]=s,i[r++]=s,i[r++]=o,i[r++]=l}return i}var topBoundingSphere=new BoundingSphere,bottomBoundingSphere=new BoundingSphere;function computeExtrudedEllipse(e){var t=e.center,i=e.ellipsoid,r=e.semiMajorAxis,n=Cartesian3.multiplyByScalar(i.geodeticSurfaceNormal(t,scratchCartesian1$7),e.height,scratchCartesian1$7);topBoundingSphere.center=Cartesian3.add(t,n,topBoundingSphere.center),topBoundingSphere.radius=r,n=Cartesian3.multiplyByScalar(i.geodeticSurfaceNormal(t,n),e.extrudedHeight,n),bottomBoundingSphere.center=Cartesian3.add(t,n,bottomBoundingSphere.center),bottomBoundingSphere.radius=r;var a=EllipseGeometryLibrary.computeEllipsePositions(e,!0,!0),o=a.positions,s=a.numPts,l=a.outerPositions,u=BoundingSphere.union(topBoundingSphere,bottomBoundingSphere),c=computeTopBottomAttributes(o,e,!0),d=topIndices(s),h=d.length;d.length=2*h;for(var p=o.length/3,f=0;f<h;f+=3)d[f+h]=d[f+2]+p,d[f+1+h]=d[f+1]+p,d[f+2+h]=d[f]+p;var m=new Geometry({attributes:c,indices:IndexDatatype$1.createTypedArray(2*p/3,d),primitiveType:PrimitiveType$1.TRIANGLES}),g=computeWallAttributes(l,e);d=computeWallIndices(l);var y=new Geometry({attributes:g,indices:IndexDatatype$1.createTypedArray(2*l.length/3,d),primitiveType:PrimitiveType$1.TRIANGLES}),v=GeometryPipeline.combineInstances([new GeometryInstance({geometry:m}),new GeometryInstance({geometry:y})]);return{boundingSphere:u,attributes:v[0].attributes,indices:v[0].indices}}function computeRectangle$1(e,t,i,r,n,a,o){for(var s=EllipseGeometryLibrary.computeEllipsePositions({center:e,semiMajorAxis:t,semiMinorAxis:i,rotation:r,granularity:n},!1,!0).outerPositions,l=s.length/3,u=new Array(l),c=0;c<l;++c)u[c]=Cartesian3.fromArray(s,3*c);var d=Rectangle.fromCartesianArray(u,a,o);return d.width>CesiumMath.PI&&(d.north=0<d.north?CesiumMath.PI_OVER_TWO-CesiumMath.EPSILON7:d.north,d.south=d.south<0?CesiumMath.EPSILON7-CesiumMath.PI_OVER_TWO:d.south,d.east=CesiumMath.PI,d.west=-CesiumMath.PI),d}function EllipseGeometry(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).center,i=defaultValue(e.ellipsoid,Ellipsoid.WGS84),r=e.semiMajorAxis,n=e.semiMinorAxis,a=defaultValue(e.granularity,CesiumMath.RADIANS_PER_DEGREE),o=defaultValue(e.vertexFormat,VertexFormat.DEFAULT),s=defaultValue(e.height,0),l=defaultValue(e.extrudedHeight,s);this._center=Cartesian3.clone(t),this._semiMajorAxis=r,this._semiMinorAxis=n,this._ellipsoid=Ellipsoid.clone(i),this._rotation=defaultValue(e.rotation,0),this._stRotation=defaultValue(e.stRotation,0),this._height=Math.max(l,s),this._granularity=a,this._vertexFormat=VertexFormat.clone(o),this._extrudedHeight=Math.min(l,s),this._shadowVolume=defaultValue(e.shadowVolume,!1),this._workerName="createEllipseGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0}EllipseGeometry.packedLength=Cartesian3.packedLength+Ellipsoid.packedLength+VertexFormat.packedLength+9,EllipseGeometry.pack=function(e,t,i){return i=defaultValue(i,0),Cartesian3.pack(e._center,t,i),i+=Cartesian3.packedLength,Ellipsoid.pack(e._ellipsoid,t,i),i+=Ellipsoid.packedLength,VertexFormat.pack(e._vertexFormat,t,i),i+=VertexFormat.packedLength,t[i++]=e._semiMajorAxis,t[i++]=e._semiMinorAxis,t[i++]=e._rotation,t[i++]=e._stRotation,t[i++]=e._height,t[i++]=e._granularity,t[i++]=e._extrudedHeight,t[i++]=e._shadowVolume?1:0,t[i]=defaultValue(e._offsetAttribute,-1),t};var scratchCenter$5=new Cartesian3,scratchEllipsoid$2=new Ellipsoid,scratchVertexFormat$4=new VertexFormat,scratchOptions$5={center:scratchCenter$5,ellipsoid:scratchEllipsoid$2,vertexFormat:scratchVertexFormat$4,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,stRotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};function textureCoordinateRotationPoints$1(e){var t=-e._stRotation;if(0==t)return[0,0,0,1,1,0];for(var i=EllipseGeometryLibrary.computeEllipsePositions({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,rotation:e._rotation,granularity:e._granularity},!1,!0).outerPositions,r=i.length/3,n=new Array(r),a=0;a<r;++a)n[a]=Cartesian3.fromArray(i,3*a);var o=e._ellipsoid,s=e.rectangle;return Geometry._textureCoordinateRotationPoints(n,t,o,s)}function CircleGeometry(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).radius,i={center:e.center,semiMajorAxis:t,semiMinorAxis:t,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,vertexFormat:e.vertexFormat,stRotation:e.stRotation,shadowVolume:e.shadowVolume};this._ellipseGeometry=new EllipseGeometry(i),this._workerName="createCircleGeometry"}EllipseGeometry.unpack=function(e,t,i){t=defaultValue(t,0);var r=Cartesian3.unpack(e,t,scratchCenter$5);t+=Cartesian3.packedLength;var n=Ellipsoid.unpack(e,t,scratchEllipsoid$2);t+=Ellipsoid.packedLength;var a=VertexFormat.unpack(e,t,scratchVertexFormat$4);t+=VertexFormat.packedLength;var o=e[t++],s=e[t++],l=e[t++],u=e[t++],c=e[t++],d=e[t++],h=e[t++],p=1===e[t++],f=e[t];return defined(i)?(i._center=Cartesian3.clone(r,i._center),i._ellipsoid=Ellipsoid.clone(n,i._ellipsoid),i._vertexFormat=VertexFormat.clone(a,i._vertexFormat),i._semiMajorAxis=o,i._semiMinorAxis=s,i._rotation=l,i._stRotation=u,i._height=c,i._granularity=d,i._extrudedHeight=h,i._shadowVolume=p,i._offsetAttribute=-1===f?void 0:f,i):(scratchOptions$5.height=c,scratchOptions$5.extrudedHeight=h,scratchOptions$5.granularity=d,scratchOptions$5.stRotation=u,scratchOptions$5.rotation=l,scratchOptions$5.semiMajorAxis=o,scratchOptions$5.semiMinorAxis=s,scratchOptions$5.shadowVolume=p,scratchOptions$5.offsetAttribute=-1===f?void 0:f,new EllipseGeometry(scratchOptions$5))},EllipseGeometry.computeRectangle=function(e,t){var i=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).center,r=defaultValue(e.ellipsoid,Ellipsoid.WGS84),n=e.semiMajorAxis,a=e.semiMinorAxis,o=defaultValue(e.granularity,CesiumMath.RADIANS_PER_DEGREE);return computeRectangle$1(i,n,a,defaultValue(e.rotation,0),o,r,t)},EllipseGeometry.createGeometry=function(e){if(!(e._semiMajorAxis<=0||e._semiMinorAxis<=0)){var t=e._height,i=e._extrudedHeight,r=!CesiumMath.equalsEpsilon(t,i,0,CesiumMath.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);var n,a={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,vertexFormat:e._vertexFormat,stRotation:e._stRotation};if(r)a.extrudedHeight=i,a.shadowVolume=e._shadowVolume,a.offsetAttribute=e._offsetAttribute,n=computeExtrudedEllipse(a);else if(n=computeEllipse(a),defined(e._offsetAttribute)){var o=n.attributes.position.values.length,s=new Uint8Array(o/3);arrayFill(s,e._offsetAttribute===GeometryOffsetAttribute$1.NONE?0:1),n.attributes.applyOffset=new GeometryAttribute({componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE,componentsPerAttribute:1,values:s})}return new Geometry({attributes:n.attributes,indices:n.indices,primitiveType:PrimitiveType$1.TRIANGLES,boundingSphere:n.boundingSphere,offsetAttribute:e._offsetAttribute})}},EllipseGeometry.createShadowVolume=function(e,t,i){var r=e._granularity,n=e._ellipsoid,a=t(r,n),o=i(r,n);return new EllipseGeometry({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:n,rotation:e._rotation,stRotation:e._stRotation,granularity:r,extrudedHeight:a,height:o,vertexFormat:VertexFormat.POSITION_ONLY,shadowVolume:!0})},Object.defineProperties(EllipseGeometry.prototype,{rectangle:{get:function(){return defined(this._rectangle)||(this._rectangle=computeRectangle$1(this._center,this._semiMajorAxis,this._semiMinorAxis,this._rotation,this._granularity,this._ellipsoid)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return defined(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=textureCoordinateRotationPoints$1(this)),this._textureCoordinateRotationPoints}}}),CircleGeometry.packedLength=EllipseGeometry.packedLength,CircleGeometry.pack=function(e,t,i){return EllipseGeometry.pack(e._ellipseGeometry,t,i)};var scratchEllipseGeometry=new EllipseGeometry({center:new Cartesian3,semiMajorAxis:1,semiMinorAxis:1}),scratchOptions$6={center:new Cartesian3,radius:void 0,ellipsoid:Ellipsoid.clone(Ellipsoid.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,vertexFormat:new VertexFormat,stRotation:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0,shadowVolume:void 0};CircleGeometry.unpack=function(e,t,i){var r=EllipseGeometry.unpack(e,t,scratchEllipseGeometry);return scratchOptions$6.center=Cartesian3.clone(r._center,scratchOptions$6.center),scratchOptions$6.ellipsoid=Ellipsoid.clone(r._ellipsoid,scratchOptions$6.ellipsoid),scratchOptions$6.height=r._height,scratchOptions$6.extrudedHeight=r._extrudedHeight,scratchOptions$6.granularity=r._granularity,scratchOptions$6.vertexFormat=VertexFormat.clone(r._vertexFormat,scratchOptions$6.vertexFormat),scratchOptions$6.stRotation=r._stRotation,scratchOptions$6.shadowVolume=r._shadowVolume,defined(i)?(scratchOptions$6.semiMajorAxis=r._semiMajorAxis,scratchOptions$6.semiMinorAxis=r._semiMinorAxis,i._ellipseGeometry=new EllipseGeometry(scratchOptions$6),i):(scratchOptions$6.radius=r._semiMajorAxis,new CircleGeometry(scratchOptions$6))},CircleGeometry.createGeometry=function(e){return EllipseGeometry.createGeometry(e._ellipseGeometry)},CircleGeometry.createShadowVolume=function(e,t,i){var r=e._ellipseGeometry._granularity,n=e._ellipseGeometry._ellipsoid,a=t(r,n),o=i(r,n);return new CircleGeometry({center:e._ellipseGeometry._center,radius:e._ellipseGeometry._semiMajorAxis,ellipsoid:n,stRotation:e._ellipseGeometry._stRotation,granularity:r,extrudedHeight:a,height:o,vertexFormat:VertexFormat.POSITION_ONLY,shadowVolume:!0})},Object.defineProperties(CircleGeometry.prototype,{rectangle:{get:function(){return this._ellipseGeometry.rectangle}},textureCoordinateRotationPoints:{get:function(){return this._ellipseGeometry.textureCoordinateRotationPoints}}});var scratchCartesian1$8=new Cartesian3,boundingSphereCenter$1=new Cartesian3;function computeEllipse$1(e){var t=e.center;boundingSphereCenter$1=Cartesian3.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,boundingSphereCenter$1),e.height,boundingSphereCenter$1);for(var i=new BoundingSphere(boundingSphereCenter$1=Cartesian3.add(t,boundingSphereCenter$1,boundingSphereCenter$1),e.semiMajorAxis),r=EllipseGeometryLibrary.computeEllipsePositions(e,!1,!0).outerPositions,n=new GeometryAttributes({position:new GeometryAttribute({componentDatatype:ComponentDatatype$1.DOUBLE,componentsPerAttribute:3,values:EllipseGeometryLibrary.raisePositionsToHeight(r,e,!1)})}),a=r.length/3,o=IndexDatatype$1.createTypedArray(a,2*a),s=0,l=0;l<a;++l)o[s++]=l,o[s++]=(l+1)%a;return{boundingSphere:i,attributes:n,indices:o}}var topBoundingSphere$1=new BoundingSphere,bottomBoundingSphere$1=new BoundingSphere;function computeExtrudedEllipse$1(e){var t=e.center,i=e.ellipsoid,r=e.semiMajorAxis,n=Cartesian3.multiplyByScalar(i.geodeticSurfaceNormal(t,scratchCartesian1$8),e.height,scratchCartesian1$8);topBoundingSphere$1.center=Cartesian3.add(t,n,topBoundingSphere$1.center),topBoundingSphere$1.radius=r,n=Cartesian3.multiplyByScalar(i.geodeticSurfaceNormal(t,n),e.extrudedHeight,n),bottomBoundingSphere$1.center=Cartesian3.add(t,n,bottomBoundingSphere$1.center),bottomBoundingSphere$1.radius=r;var a=EllipseGeometryLibrary.computeEllipsePositions(e,!1,!0).outerPositions,o=new GeometryAttributes({position:new GeometryAttribute({componentDatatype:ComponentDatatype$1.DOUBLE,componentsPerAttribute:3,values:EllipseGeometryLibrary.raisePositionsToHeight(a,e,!0)})});a=o.position.values;var s=BoundingSphere.union(topBoundingSphere$1,bottomBoundingSphere$1),l=a.length/3;if(defined(e.offsetAttribute)){var u=new Uint8Array(l);if(e.offsetAttribute===GeometryOffsetAttribute$1.TOP)u=arrayFill(u,1,0,l/2);else u=arrayFill(u,e.offsetAttribute===GeometryOffsetAttribute$1.NONE?0:1);o.applyOffset=new GeometryAttribute({componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE,componentsPerAttribute:1,values:u})}var c=defaultValue(e.numberOfVerticalLines,16);c=CesiumMath.clamp(c,0,l/2);var d=IndexDatatype$1.createTypedArray(l,2*l+2*c);l/=2;var h,p,f=0;for(h=0;h<l;++h)d[f++]=h,d[f++]=(h+1)%l,d[f++]=h+l,d[f++]=(h+1)%l+l;if(0<c){var m=Math.min(c,l);p=Math.round(l/m);var g=Math.min(p*c,l);for(h=0;h<g;h+=p)d[f++]=h,d[f++]=h+l}return{boundingSphere:s,attributes:o,indices:d}}function EllipseOutlineGeometry(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).center,i=defaultValue(e.ellipsoid,Ellipsoid.WGS84),r=e.semiMajorAxis,n=e.semiMinorAxis,a=defaultValue(e.granularity,CesiumMath.RADIANS_PER_DEGREE),o=defaultValue(e.height,0),s=defaultValue(e.extrudedHeight,o);this._center=Cartesian3.clone(t),this._semiMajorAxis=r,this._semiMinorAxis=n,this._ellipsoid=Ellipsoid.clone(i),this._rotation=defaultValue(e.rotation,0),this._height=Math.max(s,o),this._granularity=a,this._extrudedHeight=Math.min(s,o),this._numberOfVerticalLines=Math.max(defaultValue(e.numberOfVerticalLines,16),0),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipseOutlineGeometry"}EllipseOutlineGeometry.packedLength=Cartesian3.packedLength+Ellipsoid.packedLength+8,EllipseOutlineGeometry.pack=function(e,t,i){return i=defaultValue(i,0),Cartesian3.pack(e._center,t,i),i+=Cartesian3.packedLength,Ellipsoid.pack(e._ellipsoid,t,i),i+=Ellipsoid.packedLength,t[i++]=e._semiMajorAxis,t[i++]=e._semiMinorAxis,t[i++]=e._rotation,t[i++]=e._height,t[i++]=e._granularity,t[i++]=e._extrudedHeight,t[i++]=e._numberOfVerticalLines,t[i]=defaultValue(e._offsetAttribute,-1),t};var scratchCenter$6=new Cartesian3,scratchEllipsoid$3=new Ellipsoid,scratchOptions$7={center:scratchCenter$6,ellipsoid:scratchEllipsoid$3,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};function CircleOutlineGeometry(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).radius,i={center:e.center,semiMajorAxis:t,semiMinorAxis:t,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,numberOfVerticalLines:e.numberOfVerticalLines};this._ellipseGeometry=new EllipseOutlineGeometry(i),this._workerName="createCircleOutlineGeometry"}EllipseOutlineGeometry.unpack=function(e,t,i){t=defaultValue(t,0);var r=Cartesian3.unpack(e,t,scratchCenter$6);t+=Cartesian3.packedLength;var n=Ellipsoid.unpack(e,t,scratchEllipsoid$3);t+=Ellipsoid.packedLength;var a=e[t++],o=e[t++],s=e[t++],l=e[t++],u=e[t++],c=e[t++],d=e[t++],h=e[t];return defined(i)?(i._center=Cartesian3.clone(r,i._center),i._ellipsoid=Ellipsoid.clone(n,i._ellipsoid),i._semiMajorAxis=a,i._semiMinorAxis=o,i._rotation=s,i._height=l,i._granularity=u,i._extrudedHeight=c,i._numberOfVerticalLines=d,i._offsetAttribute=-1===h?void 0:h,i):(scratchOptions$7.height=l,scratchOptions$7.extrudedHeight=c,scratchOptions$7.granularity=u,scratchOptions$7.rotation=s,scratchOptions$7.semiMajorAxis=a,scratchOptions$7.semiMinorAxis=o,scratchOptions$7.numberOfVerticalLines=d,scratchOptions$7.offsetAttribute=-1===h?void 0:h,new EllipseOutlineGeometry(scratchOptions$7))},EllipseOutlineGeometry.createGeometry=function(e){if(!(e._semiMajorAxis<=0||e._semiMinorAxis<=0)){var t=e._height,i=e._extrudedHeight,r=!CesiumMath.equalsEpsilon(t,i,0,CesiumMath.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);var n,a={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,numberOfVerticalLines:e._numberOfVerticalLines};if(r)a.extrudedHeight=i,a.offsetAttribute=e._offsetAttribute,n=computeExtrudedEllipse$1(a);else if(n=computeEllipse$1(a),defined(e._offsetAttribute)){var o=n.attributes.position.values.length,s=new Uint8Array(o/3);arrayFill(s,e._offsetAttribute===GeometryOffsetAttribute$1.NONE?0:1),n.attributes.applyOffset=new GeometryAttribute({componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE,componentsPerAttribute:1,values:s})}return new Geometry({attributes:n.attributes,indices:n.indices,primitiveType:PrimitiveType$1.LINES,boundingSphere:n.boundingSphere,offsetAttribute:e._offsetAttribute})}},CircleOutlineGeometry.packedLength=EllipseOutlineGeometry.packedLength,CircleOutlineGeometry.pack=function(e,t,i){return EllipseOutlineGeometry.pack(e._ellipseGeometry,t,i)};var scratchEllipseGeometry$1=new EllipseOutlineGeometry({center:new Cartesian3,semiMajorAxis:1,semiMinorAxis:1}),scratchOptions$8={center:new Cartesian3,radius:void 0,ellipsoid:Ellipsoid.clone(Ellipsoid.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,numberOfVerticalLines:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0};CircleOutlineGeometry.unpack=function(e,t,i){var r=EllipseOutlineGeometry.unpack(e,t,scratchEllipseGeometry$1);return scratchOptions$8.center=Cartesian3.clone(r._center,scratchOptions$8.center),scratchOptions$8.ellipsoid=Ellipsoid.clone(r._ellipsoid,scratchOptions$8.ellipsoid),scratchOptions$8.height=r._height,scratchOptions$8.extrudedHeight=r._extrudedHeight,scratchOptions$8.granularity=r._granularity,scratchOptions$8.numberOfVerticalLines=r._numberOfVerticalLines,defined(i)?(scratchOptions$8.semiMajorAxis=r._semiMajorAxis,scratchOptions$8.semiMinorAxis=r._semiMinorAxis,i._ellipseGeometry=new EllipseOutlineGeometry(scratchOptions$8),i):(scratchOptions$8.radius=r._semiMajorAxis,new CircleOutlineGeometry(scratchOptions$8))},CircleOutlineGeometry.createGeometry=function(e){return EllipseOutlineGeometry.createGeometry(e._ellipseGeometry)};var CoplanarPolygonGeometryLibrary={},scratchIntersectionPoint=new Cartesian3,scratchXAxis=new Cartesian3,scratchYAxis=new Cartesian3,scratchZAxis=new Cartesian3,obbScratch=new OrientedBoundingBox;function projectTo2D(e,t,i,r,n){var a=Cartesian3.subtract(e,t,scratchIntersectionPoint),o=Cartesian3.dot(i,a),s=Cartesian3.dot(r,a);return Cartesian2.fromElements(o,s,n)}CoplanarPolygonGeometryLibrary.validOutline=function(e){var t=OrientedBoundingBox.fromPoints(e,obbScratch).halfAxes,i=Matrix3.getColumn(t,0,scratchXAxis),r=Matrix3.getColumn(t,1,scratchYAxis),n=Matrix3.getColumn(t,2,scratchZAxis),a=Cartesian3.magnitude(i),o=Cartesian3.magnitude(r),s=Cartesian3.magnitude(n);return!(0===a&&(0===o||0===s)||0===o&&0===s)},CoplanarPolygonGeometryLibrary.computeProjectTo2DArguments=function(e,t,i,r){var n,a,o=OrientedBoundingBox.fromPoints(e,obbScratch),s=o.halfAxes,l=Matrix3.getColumn(s,0,scratchXAxis),u=Matrix3.getColumn(s,1,scratchYAxis),c=Matrix3.getColumn(s,2,scratchZAxis),d=Cartesian3.magnitude(l),h=Cartesian3.magnitude(u),p=Cartesian3.magnitude(c),f=Math.min(d,h,p);return(0!==d||0!==h&&0!==p)&&(0!==h||0!==p)&&(f!==h&&f!==p||(n=l),f===d?n=u:f===p&&(a=u),f!==d&&f!==h||(a=c),Cartesian3.normalize(n,i),Cartesian3.normalize(a,r),Cartesian3.clone(o.center,t),!0)},CoplanarPolygonGeometryLibrary.createProjectPointsTo2DFunction=function(r,n,a){return function(e){for(var t=new Array(e.length),i=0;i<e.length;i++)t[i]=projectTo2D(e[i],r,n,a);return t}},CoplanarPolygonGeometryLibrary.createProjectPointTo2DFunction=function(i,r,n){return function(e,t){return projectTo2D(e,i,r,n,t)}};var scratchPosition$4=new Cartesian3,scratchBR=new BoundingRectangle,stScratch=new Cartesian2,textureCoordinatesOrigin=new Cartesian2,scratchNormal$4=new Cartesian3,scratchTangent$2=new Cartesian3,scratchBitangent$2=new Cartesian3,centerScratch$2=new Cartesian3,axis1Scratch=new Cartesian3,axis2Scratch=new Cartesian3,quaternionScratch$2=new Quaternion,textureMatrixScratch$1=new Matrix3,tangentRotationScratch=new Matrix3,surfaceNormalScratch=new Cartesian3;function createGeometryFromPolygon(e,t,i,r,n,a,o,s){var l=e.positions,u=PolygonPipeline.triangulate(e.positions2D,e.holes);u.length<3&&(u=[0,1,2]);var c=IndexDatatype$1.createTypedArray(l.length,u.length);c.set(u);var d=textureMatrixScratch$1;if(0!==r){var h=Quaternion.fromAxisAngle(a,r,quaternionScratch$2);if(d=Matrix3.fromQuaternion(h,d),t.tangent||t.bitangent){h=Quaternion.fromAxisAngle(a,-r,quaternionScratch$2);var p=Matrix3.fromQuaternion(h,tangentRotationScratch);o=Cartesian3.normalize(Matrix3.multiplyByVector(p,o,o),o),t.bitangent&&(s=Cartesian3.normalize(Cartesian3.cross(a,o,s),s))}}else d=Matrix3.clone(Matrix3.IDENTITY,d);var f=textureCoordinatesOrigin;t.st&&(f.x=i.x,f.y=i.y);for(var m=l.length,g=3*m,y=new Float64Array(g),v=t.normal?new Float32Array(g):void 0,_=t.tangent?new Float32Array(g):void 0,C=t.bitangent?new Float32Array(g):void 0,x=t.st?new Float32Array(2*m):void 0,b=0,A=0,S=0,w=0,E=0,T=0;T<m;T++){var P=l[T];if(y[b++]=P.x,y[b++]=P.y,y[b++]=P.z,t.st){var M=n(Matrix3.multiplyByVector(d,P,scratchPosition$4),stScratch);Cartesian2.subtract(M,f,M);var D=CesiumMath.clamp(M.x/i.width,0,1),I=CesiumMath.clamp(M.y/i.height,0,1);x[E++]=D,x[E++]=I}t.normal&&(v[A++]=a.x,v[A++]=a.y,v[A++]=a.z),t.tangent&&(_[w++]=o.x,_[w++]=o.y,_[w++]=o.z),t.bitangent&&(C[S++]=s.x,C[S++]=s.y,C[S++]=s.z)}var O=new GeometryAttributes;return t.position&&(O.position=new GeometryAttribute({componentDatatype:ComponentDatatype$1.DOUBLE,componentsPerAttribute:3,values:y})),t.normal&&(O.normal=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:v})),t.tangent&&(O.tangent=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:_})),t.bitangent&&(O.bitangent=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:C})),t.st&&(O.st=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:2,values:x})),new Geometry({attributes:O,indices:c,primitiveType:PrimitiveType$1.TRIANGLES})}function CoplanarPolygonGeometry(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).polygonHierarchy,i=defaultValue(e.vertexFormat,VertexFormat.DEFAULT);this._vertexFormat=VertexFormat.clone(i),this._polygonHierarchy=t,this._stRotation=defaultValue(e.stRotation,0),this._ellipsoid=Ellipsoid.clone(defaultValue(e.ellipsoid,Ellipsoid.WGS84)),this._workerName="createCoplanarPolygonGeometry",this.packedLength=PolygonGeometryLibrary.computeHierarchyPackedLength(t)+VertexFormat.packedLength+Ellipsoid.packedLength+2}CoplanarPolygonGeometry.fromPositions=function(e){return new CoplanarPolygonGeometry({polygonHierarchy:{positions:(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).positions},vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid})},CoplanarPolygonGeometry.pack=function(e,t,i){return i=defaultValue(i,0),i=PolygonGeometryLibrary.packPolygonHierarchy(e._polygonHierarchy,t,i),Ellipsoid.pack(e._ellipsoid,t,i),i+=Ellipsoid.packedLength,VertexFormat.pack(e._vertexFormat,t,i),i+=VertexFormat.packedLength,t[i++]=e._stRotation,t[i]=e.packedLength,t};var scratchEllipsoid$4=Ellipsoid.clone(Ellipsoid.UNIT_SPHERE),scratchVertexFormat$5=new VertexFormat,scratchOptions$9={polygonHierarchy:{}};function createGeometryFromPositions(e){for(var t=e.length,i=new Float64Array(3*t),r=IndexDatatype$1.createTypedArray(t,2*t),n=0,a=0,o=0;o<t;o++){var s=e[o];i[n++]=s.x,i[n++]=s.y,i[n++]=s.z,r[a++]=o,r[a++]=(o+1)%t}return new Geometry({attributes:new GeometryAttributes({position:new GeometryAttribute({componentDatatype:ComponentDatatype$1.DOUBLE,componentsPerAttribute:3,values:i})}),indices:r,primitiveType:PrimitiveType$1.LINES})}function CoplanarPolygonOutlineGeometry(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).polygonHierarchy;this._polygonHierarchy=t,this._workerName="createCoplanarPolygonOutlineGeometry",this.packedLength=PolygonGeometryLibrary.computeHierarchyPackedLength(t)+1}CoplanarPolygonGeometry.unpack=function(e,t,i){t=defaultValue(t,0);var r=PolygonGeometryLibrary.unpackPolygonHierarchy(e,t);t=r.startingIndex,delete r.startingIndex;var n=Ellipsoid.unpack(e,t,scratchEllipsoid$4);t+=Ellipsoid.packedLength;var a=VertexFormat.unpack(e,t,scratchVertexFormat$5);t+=VertexFormat.packedLength;var o=e[t++],s=e[t];return defined(i)||(i=new CoplanarPolygonGeometry(scratchOptions$9)),i._polygonHierarchy=r,i._ellipsoid=Ellipsoid.clone(n,i._ellipsoid),i._vertexFormat=VertexFormat.clone(a,i._vertexFormat),i._stRotation=o,i.packedLength=s,i},CoplanarPolygonGeometry.createGeometry=function(e){var t=e._vertexFormat,i=e._polygonHierarchy,r=e._stRotation,n=i.positions;if(!((n=arrayRemoveDuplicates(n,Cartesian3.equalsEpsilon,!0)).length<3)){var a=scratchNormal$4,o=scratchTangent$2,s=scratchBitangent$2,l=axis1Scratch,u=axis2Scratch;if(CoplanarPolygonGeometryLibrary.computeProjectTo2DArguments(n,centerScratch$2,l,u)){if(a=Cartesian3.cross(l,u,a),a=Cartesian3.normalize(a,a),!Cartesian3.equalsEpsilon(centerScratch$2,Cartesian3.ZERO,CesiumMath.EPSILON6)){var c=e._ellipsoid.geodeticSurfaceNormal(centerScratch$2,surfaceNormalScratch);Cartesian3.dot(a,c)<0&&(a=Cartesian3.negate(a,a),l=Cartesian3.negate(l,l))}var d=CoplanarPolygonGeometryLibrary.createProjectPointsTo2DFunction(centerScratch$2,l,u),h=CoplanarPolygonGeometryLibrary.createProjectPointTo2DFunction(centerScratch$2,l,u);t.tangent&&(o=Cartesian3.clone(l,o)),t.bitangent&&(s=Cartesian3.clone(u,s));var p=PolygonGeometryLibrary.polygonsFromHierarchy(i,d,!1),f=p.hierarchy,m=p.polygons;if(0!==f.length){n=f[0].outerRing;for(var g=BoundingSphere.fromPoints(n),y=PolygonGeometryLibrary.computeBoundingRectangle(a,h,n,r,scratchBR),v=[],_=0;_<m.length;_++){var C=new GeometryInstance({geometry:createGeometryFromPolygon(m[_],t,y,r,h,a,o,s)});v.push(C)}var x=GeometryPipeline.combineInstances(v)[0];x.attributes.position.values=new Float64Array(x.attributes.position.values),x.indices=IndexDatatype$1.createTypedArray(x.attributes.position.values.length/3,x.indices);var b=x.attributes;return t.position||delete b.position,new Geometry({attributes:b,indices:x.indices,primitiveType:x.primitiveType,boundingSphere:g})}}}},CoplanarPolygonOutlineGeometry.fromPositions=function(e){return new CoplanarPolygonOutlineGeometry({polygonHierarchy:{positions:(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).positions}})},CoplanarPolygonOutlineGeometry.pack=function(e,t,i){return i=defaultValue(i,0),t[i=PolygonGeometryLibrary.packPolygonHierarchy(e._polygonHierarchy,t,i)]=e.packedLength,t};var scratchOptions$a={polygonHierarchy:{}};CoplanarPolygonOutlineGeometry.unpack=function(e,t,i){t=defaultValue(t,0);var r=PolygonGeometryLibrary.unpackPolygonHierarchy(e,t);t=r.startingIndex,delete r.startingIndex;var n=e[t];return defined(i)||(i=new CoplanarPolygonOutlineGeometry(scratchOptions$a)),i._polygonHierarchy=r,i.packedLength=n,i},CoplanarPolygonOutlineGeometry.createGeometry=function(e){var t=e._polygonHierarchy,i=t.positions;if(!((i=arrayRemoveDuplicates(i,Cartesian3.equalsEpsilon,!0)).length<3)&&CoplanarPolygonGeometryLibrary.validOutline(i)){var r=PolygonGeometryLibrary.polygonOutlinesFromHierarchy(t,!1);if(0!==r.length){for(var n=[],a=0;a<r.length;a++){var o=new GeometryInstance({geometry:createGeometryFromPositions(r[a])});n.push(o)}var s=GeometryPipeline.combineInstances(n)[0],l=BoundingSphere.fromPoints(t.positions);return new Geometry({attributes:s.attributes,indices:s.indices,primitiveType:s.primitiveType,boundingSphere:l})}}};var CornerType={ROUNDED:0,MITERED:1,BEVELED:2},CornerType$1=Object.freeze(CornerType),scratch2Array=[new Cartesian3,new Cartesian3],scratchCartesian1$9=new Cartesian3,scratchCartesian2$b=new Cartesian3,scratchCartesian3$b=new Cartesian3,scratchCartesian4$4=new Cartesian3,scratchCartesian5$1=new Cartesian3,scratchCartesian6$1=new Cartesian3,scratchCartesian7=new Cartesian3,scratchCartesian8=new Cartesian3,scratchCartesian9=new Cartesian3,scratch1=new Cartesian3,scratch2=new Cartesian3,PolylineVolumeGeometryLibrary={},cartographic=new Cartographic;function scaleToSurface(e,t){for(var i=new Array(e.length),r=0;r<e.length;r++){var n=e[r];cartographic=t.cartesianToCartographic(n,cartographic),i[r]=cartographic.height,e[r]=t.scaleToGeodeticSurface(n,n)}return i}function subdivideHeights$1(e,t,i,r){var n,a=e[0],o=e[1],s=Cartesian3.angleBetween(a,o),l=Math.ceil(s/r),u=new Array(l);if(t===i){for(n=0;n<l;n++)u[n]=t;return u.push(i),u}var c=(i-t)/l;for(n=1;n<l;n++){var d=t+n*c;u[n]=d}return u[0]=t,u.push(i),u}var nextScratch=new Cartesian3,prevScratch=new Cartesian3;function computeRotationAngle(e,t,i,r){var n=new EllipsoidTangentPlane(i,r),a=n.projectPointOntoPlane(Cartesian3.add(i,e,nextScratch),nextScratch),o=n.projectPointOntoPlane(Cartesian3.add(i,t,prevScratch),prevScratch),s=Cartesian2.angleBetween(a,o);return 0<=o.x*a.y-o.y*a.x?-s:s}var negativeX=new Cartesian3(-1,0,0),transform=new Matrix4,translation=new Matrix4,rotationZ=new Matrix3,scaleMatrix=Matrix3.IDENTITY.clone(),westScratch$1=new Cartesian3,finalPosScratch=new Cartesian4,heightCartesian=new Cartesian3;function addPosition(e,t,i,r,n,a,o,s){var l=westScratch$1,u=finalPosScratch;transform=Transforms.eastNorthUpToFixedFrame(e,n,transform),l=Matrix4.multiplyByPointAsVector(transform,negativeX,l);var c=computeRotationAngle(l=Cartesian3.normalize(l,l),t,e,n);rotationZ=Matrix3.fromRotationZ(c,rotationZ),heightCartesian.z=a,transform=Matrix4.multiplyTransformation(transform,Matrix4.fromRotationTranslation(rotationZ,heightCartesian,translation),transform);var d=scaleMatrix;d[0]=o;for(var h=0;h<s;h++)for(var p=0;p<i.length;p+=3)u=Cartesian3.fromArray(i,p,u),u=Matrix3.multiplyByVector(d,u,u),u=Matrix4.multiplyByPoint(transform,u,u),r.push(u.x,u.y,u.z);return r}var centerScratch$3=new Cartesian3;function addPositions(e,t,i,r,n,a,o){for(var s=0;s<e.length;s+=3){r=addPosition(Cartesian3.fromArray(e,s,centerScratch$3),t,i,r,n,a[s/3],o,1)}return r}function convertShapeTo3DDuplicate(e,t){var i=e.length,r=new Array(6*i),n=0,a=t.x+t.width/2,o=t.y+t.height/2,s=e[0];r[n++]=s.x-a,r[n++]=0,r[n++]=s.y-o;for(var l=1;l<i;l++){var u=(s=e[l]).x-a,c=s.y-o;r[n++]=u,r[n++]=0,r[n++]=c,r[n++]=u,r[n++]=0,r[n++]=c}return s=e[0],r[n++]=s.x-a,r[n++]=0,r[n++]=s.y-o,r}function convertShapeTo3D(e,t){for(var i=e.length,r=new Array(3*i),n=0,a=t.x+t.width/2,o=t.y+t.height/2,s=0;s<i;s++)r[n++]=e[s].x-a,r[n++]=0,r[n++]=e[s].y-o;return r}var quaterion=new Quaternion,startPointScratch=new Cartesian3,rotMatrix=new Matrix3;function computeRoundCorner(e,t,i,r,n,a,o,s,l,u){var c,d,h=Cartesian3.angleBetween(Cartesian3.subtract(t,e,scratch1),Cartesian3.subtract(i,e,scratch2)),p=r===CornerType$1.BEVELED?0:Math.ceil(h/CesiumMath.toRadians(5));if(c=n?Matrix3.fromQuaternion(Quaternion.fromAxisAngle(Cartesian3.negate(e,scratch1),h/(p+1),quaterion),rotMatrix):Matrix3.fromQuaternion(Quaternion.fromAxisAngle(e,h/(p+1),quaterion),rotMatrix),t=Cartesian3.clone(t,startPointScratch),0<p)for(var f=u?2:1,m=0;m<p;m++)t=Matrix3.multiplyByVector(c,t,t),d=Cartesian3.subtract(t,e,scratch1),d=Cartesian3.normalize(d,d),n||(d=Cartesian3.negate(d,d)),o=addPosition(a.scaleToGeodeticSurface(t,scratch2),d,s,o,a,l,1,f);else d=Cartesian3.subtract(t,e,scratch1),d=Cartesian3.normalize(d,d),n||(d=Cartesian3.negate(d,d)),o=addPosition(a.scaleToGeodeticSurface(t,scratch2),d,s,o,a,l,1,1),i=Cartesian3.clone(i,startPointScratch),d=Cartesian3.subtract(i,e,scratch1),d=Cartesian3.normalize(d,d),n||(d=Cartesian3.negate(d,d)),o=addPosition(a.scaleToGeodeticSurface(i,scratch2),d,s,o,a,l,1,1);return o}PolylineVolumeGeometryLibrary.removeDuplicatesFromShape=function(e){for(var t=e.length,i=[],r=t-1,n=0;n<t;r=n++){var a=e[r],o=e[n];Cartesian2.equals(a,o)||i.push(o)}return i},PolylineVolumeGeometryLibrary.angleIsGreaterThanPi=function(e,t,i,r){var n=new EllipsoidTangentPlane(i,r),a=n.projectPointOntoPlane(Cartesian3.add(i,e,nextScratch),nextScratch),o=n.projectPointOntoPlane(Cartesian3.add(i,t,prevScratch),prevScratch);return 0<=o.x*a.y-o.y*a.x};var scratchForwardProjection=new Cartesian3,scratchBackwardProjection=new Cartesian3;PolylineVolumeGeometryLibrary.computePositions=function(e,t,i,r,n){var a=r._ellipsoid,o=scaleToSurface(e,a),s=r._granularity,l=r._cornerType,u=n?convertShapeTo3DDuplicate(t,i):convertShapeTo3D(t,i),c=n?convertShapeTo3D(t,i):void 0,d=i.height/2,h=i.width/2,p=e.length,f=[],m=n?[]:void 0,g=scratchCartesian1$9,y=scratchCartesian2$b,v=scratchCartesian3$b,_=scratchCartesian4$4,C=scratchCartesian5$1,x=scratchCartesian6$1,b=scratchCartesian7,A=scratchCartesian8,S=scratchCartesian9,w=e[0],E=e[1];_=a.geodeticSurfaceNormal(w,_),g=Cartesian3.subtract(E,w,g),g=Cartesian3.normalize(g,g),A=Cartesian3.cross(_,g,A),A=Cartesian3.normalize(A,A);var T,P=o[0],M=o[1];n&&(m=addPosition(w,A,c,m,a,P+d,1,1)),S=Cartesian3.clone(w,S),w=E,y=Cartesian3.negate(g,y);for(var D=1;D<p-1;D++){var I=n?2:1;E=e[D+1],g=Cartesian3.subtract(E,w,g),g=Cartesian3.normalize(g,g),v=Cartesian3.add(g,y,v),v=Cartesian3.normalize(v,v),_=a.geodeticSurfaceNormal(w,_);var O=Cartesian3.multiplyByScalar(_,Cartesian3.dot(g,_),scratchForwardProjection);Cartesian3.subtract(g,O,O),Cartesian3.normalize(O,O);var R=Cartesian3.multiplyByScalar(_,Cartesian3.dot(y,_),scratchBackwardProjection);if(Cartesian3.subtract(y,R,R),Cartesian3.normalize(R,R),!CesiumMath.equalsEpsilon(Math.abs(Cartesian3.dot(O,R)),1,CesiumMath.EPSILON7)){v=Cartesian3.cross(v,_,v),v=Cartesian3.cross(_,v,v),v=Cartesian3.normalize(v,v);var L=1/Math.max(.25,Cartesian3.magnitude(Cartesian3.cross(v,y,scratch1))),N=PolylineVolumeGeometryLibrary.angleIsGreaterThanPi(g,y,w,a);S=(N?(C=Cartesian3.add(w,Cartesian3.multiplyByScalar(v,L*h,v),C),x=Cartesian3.add(C,Cartesian3.multiplyByScalar(A,h,x),x),scratch2Array[0]=Cartesian3.clone(S,scratch2Array[0]),scratch2Array[1]=Cartesian3.clone(x,scratch2Array[1]),T=subdivideHeights$1(scratch2Array,P+d,M+d,s),f=addPositions(PolylinePipeline.generateArc({positions:scratch2Array,granularity:s,ellipsoid:a}),A,u,f,a,T,1),A=Cartesian3.cross(_,g,A),A=Cartesian3.normalize(A,A),b=Cartesian3.add(C,Cartesian3.multiplyByScalar(A,h,b),b),l===CornerType$1.ROUNDED||l===CornerType$1.BEVELED?computeRoundCorner(C,x,b,l,N,a,f,u,M+d,n):f=addPosition(w,v=Cartesian3.negate(v,v),u,f,a,M+d,L,I)):(C=Cartesian3.add(w,Cartesian3.multiplyByScalar(v,L*h,v),C),x=Cartesian3.add(C,Cartesian3.multiplyByScalar(A,-h,x),x),scratch2Array[0]=Cartesian3.clone(S,scratch2Array[0]),scratch2Array[1]=Cartesian3.clone(x,scratch2Array[1]),T=subdivideHeights$1(scratch2Array,P+d,M+d,s),f=addPositions(PolylinePipeline.generateArc({positions:scratch2Array,granularity:s,ellipsoid:a}),A,u,f,a,T,1),A=Cartesian3.cross(_,g,A),A=Cartesian3.normalize(A,A),b=Cartesian3.add(C,Cartesian3.multiplyByScalar(A,-h,b),b),l===CornerType$1.ROUNDED||l===CornerType$1.BEVELED?computeRoundCorner(C,x,b,l,N,a,f,u,M+d,n):f=addPosition(w,v,u,f,a,M+d,L,I)),Cartesian3.clone(b,S)),y=Cartesian3.negate(g,y)}else f=addPosition(S,A,u,f,a,P+d,1,1),S=w;P=M,M=o[D+1],w=E}scratch2Array[0]=Cartesian3.clone(S,scratch2Array[0]),scratch2Array[1]=Cartesian3.clone(w,scratch2Array[1]),T=subdivideHeights$1(scratch2Array,P+d,M+d,s),f=addPositions(PolylinePipeline.generateArc({positions:scratch2Array,granularity:s,ellipsoid:a}),A,u,f,a,T,1),n&&(m=addPosition(w,A,c,m,a,M+d,1,1)),p=f.length;var k=n?p+m.length:p,B=new Float64Array(k);return B.set(f),n&&B.set(m,p),B};var CorridorGeometryLibrary={},scratch1$1=new Cartesian3,scratch2$1=new Cartesian3,scratch3=new Cartesian3,scratch4=new Cartesian3,scaleArray2=[new Cartesian3,new Cartesian3],cartesian1=new Cartesian3,cartesian2=new Cartesian3,cartesian3=new Cartesian3,cartesian4=new Cartesian3,cartesian5=new Cartesian3,cartesian6=new Cartesian3,cartesian7=new Cartesian3,cartesian8=new Cartesian3,cartesian9=new Cartesian3,cartesian10=new Cartesian3,quaterion$1=new Quaternion,rotMatrix$1=new Matrix3;function computeRoundCorner$1(e,t,i,r,n){var a,o=Cartesian3.angleBetween(Cartesian3.subtract(t,e,scratch1$1),Cartesian3.subtract(i,e,scratch2$1)),s=r===CornerType$1.BEVELED?1:Math.ceil(o/CesiumMath.toRadians(5))+1,l=3*s,u=new Array(l);u[l-3]=i.x,u[l-2]=i.y,u[l-1]=i.z,a=n?Matrix3.fromQuaternion(Quaternion.fromAxisAngle(Cartesian3.negate(e,scratch1$1),o/s,quaterion$1),rotMatrix$1):Matrix3.fromQuaternion(Quaternion.fromAxisAngle(e,o/s,quaterion$1),rotMatrix$1);var c=0;t=Cartesian3.clone(t,scratch1$1);for(var d=0;d<s;d++)t=Matrix3.multiplyByVector(a,t,t),u[c++]=t.x,u[c++]=t.y,u[c++]=t.z;return u}function addEndCaps(e){var t=cartesian1,i=cartesian2,r=cartesian3,n=e[1];i=Cartesian3.fromArray(e[1],n.length-3,i),r=Cartesian3.fromArray(e[0],0,r);var a=computeRoundCorner$1(t=Cartesian3.midpoint(i,r,t),i,r,CornerType$1.ROUNDED,!1),o=e.length-1,s=e[o-1];return n=e[o],i=Cartesian3.fromArray(s,s.length-3,i),r=Cartesian3.fromArray(n,0,r),[a,computeRoundCorner$1(t=Cartesian3.midpoint(i,r,t),i,r,CornerType$1.ROUNDED,!1)]}function computeMiteredCorner(e,t,i,r){var n=scratch1$1;return[(n=(r||(t=Cartesian3.negate(t,t)),Cartesian3.add(e,t,n))).x,n.y,n.z,i.x,i.y,i.z]}function addShiftedPositions(e,t,i,r){for(var n=new Array(e.length),a=new Array(e.length),o=Cartesian3.multiplyByScalar(t,i,scratch1$1),s=Cartesian3.negate(o,scratch2$1),l=0,u=e.length-1,c=0;c<e.length;c+=3){var d=Cartesian3.fromArray(e,c,scratch3),h=Cartesian3.add(d,s,scratch4);n[l++]=h.x,n[l++]=h.y,n[l++]=h.z;var p=Cartesian3.add(d,o,scratch4);a[u--]=p.z,a[u--]=p.y,a[u--]=p.x}return r.push(n,a),r}CorridorGeometryLibrary.addAttribute=function(e,t,i,r){var n=t.x,a=t.y,o=t.z;defined(i)&&(e[i]=n,e[i+1]=a,e[i+2]=o),defined(r)&&(e[r]=o,e[r-1]=a,e[r-2]=n)};var scratchForwardProjection$1=new Cartesian3,scratchBackwardProjection$1=new Cartesian3;CorridorGeometryLibrary.computePositions=function(e){var t=e.granularity,i=e.positions,r=e.ellipsoid,n=e.width/2,a=e.cornerType,o=e.saveAttributes,s=cartesian1,l=cartesian2,u=cartesian3,c=cartesian4,d=cartesian5,h=cartesian6,p=cartesian7,f=cartesian8,m=cartesian9,g=cartesian10,y=[],v=o?[]:void 0,_=o?[]:void 0,C=i[0],x=i[1];l=Cartesian3.normalize(Cartesian3.subtract(x,C,l),l),s=r.geodeticSurfaceNormal(C,s),c=Cartesian3.normalize(Cartesian3.cross(s,l,c),c),o&&(v.push(c.x,c.y,c.z),_.push(s.x,s.y,s.z)),p=Cartesian3.clone(C,p),C=x,u=Cartesian3.negate(l,u);var b,A,S=[],w=i.length;for(b=1;b<w-1;b++){s=r.geodeticSurfaceNormal(C,s),x=i[b+1],l=Cartesian3.normalize(Cartesian3.subtract(x,C,l),l),d=Cartesian3.normalize(Cartesian3.add(l,u,d),d);var E=Cartesian3.multiplyByScalar(s,Cartesian3.dot(l,s),scratchForwardProjection$1);Cartesian3.subtract(l,E,E),Cartesian3.normalize(E,E);var T=Cartesian3.multiplyByScalar(s,Cartesian3.dot(u,s),scratchBackwardProjection$1);if(Cartesian3.subtract(u,T,T),Cartesian3.normalize(T,T),!CesiumMath.equalsEpsilon(Math.abs(Cartesian3.dot(E,T)),1,CesiumMath.EPSILON7)){d=Cartesian3.cross(d,s,d),d=Cartesian3.cross(s,d,d),d=Cartesian3.normalize(d,d);var P=n/Math.max(.25,Cartesian3.magnitude(Cartesian3.cross(d,u,scratch1$1))),M=PolylineVolumeGeometryLibrary.angleIsGreaterThanPi(l,u,C,r);d=Cartesian3.multiplyByScalar(d,P,d),M?(f=Cartesian3.add(C,d,f),g=Cartesian3.add(f,Cartesian3.multiplyByScalar(c,n,g),g),m=Cartesian3.add(f,Cartesian3.multiplyByScalar(c,2*n,m),m),scaleArray2[0]=Cartesian3.clone(p,scaleArray2[0]),scaleArray2[1]=Cartesian3.clone(g,scaleArray2[1]),y=addShiftedPositions(PolylinePipeline.generateArc({positions:scaleArray2,granularity:t,ellipsoid:r}),c,n,y),o&&(v.push(c.x,c.y,c.z),_.push(s.x,s.y,s.z)),h=Cartesian3.clone(m,h),c=Cartesian3.normalize(Cartesian3.cross(s,l,c),c),m=Cartesian3.add(f,Cartesian3.multiplyByScalar(c,2*n,m),m),p=Cartesian3.add(f,Cartesian3.multiplyByScalar(c,n,p),p),a===CornerType$1.ROUNDED||a===CornerType$1.BEVELED?S.push({leftPositions:computeRoundCorner$1(f,h,m,a,M)}):S.push({leftPositions:computeMiteredCorner(C,Cartesian3.negate(d,d),m,M)})):(m=Cartesian3.add(C,d,m),g=Cartesian3.add(m,Cartesian3.negate(Cartesian3.multiplyByScalar(c,n,g),g),g),f=Cartesian3.add(m,Cartesian3.negate(Cartesian3.multiplyByScalar(c,2*n,f),f),f),scaleArray2[0]=Cartesian3.clone(p,scaleArray2[0]),scaleArray2[1]=Cartesian3.clone(g,scaleArray2[1]),y=addShiftedPositions(PolylinePipeline.generateArc({positions:scaleArray2,granularity:t,ellipsoid:r}),c,n,y),o&&(v.push(c.x,c.y,c.z),_.push(s.x,s.y,s.z)),h=Cartesian3.clone(f,h),c=Cartesian3.normalize(Cartesian3.cross(s,l,c),c),f=Cartesian3.add(m,Cartesian3.negate(Cartesian3.multiplyByScalar(c,2*n,f),f),f),p=Cartesian3.add(m,Cartesian3.negate(Cartesian3.multiplyByScalar(c,n,p),p),p),a===CornerType$1.ROUNDED||a===CornerType$1.BEVELED?S.push({rightPositions:computeRoundCorner$1(m,h,f,a,M)}):S.push({rightPositions:computeMiteredCorner(C,d,f,M)})),u=Cartesian3.negate(l,u)}C=x}return s=r.geodeticSurfaceNormal(C,s),scaleArray2[0]=Cartesian3.clone(p,scaleArray2[0]),scaleArray2[1]=Cartesian3.clone(C,scaleArray2[1]),y=addShiftedPositions(PolylinePipeline.generateArc({positions:scaleArray2,granularity:t,ellipsoid:r}),c,n,y),o&&(v.push(c.x,c.y,c.z),_.push(s.x,s.y,s.z)),a===CornerType$1.ROUNDED&&(A=addEndCaps(y)),{positions:y,corners:S,lefts:v,normals:_,endPositions:A}};var cartesian1$1=new Cartesian3,cartesian2$1=new Cartesian3,cartesian3$1=new Cartesian3,cartesian4$1=new Cartesian3,cartesian5$1=new Cartesian3,cartesian6$1=new Cartesian3,scratch1$2=new Cartesian3,scratch2$2=new Cartesian3;function scaleToSurface$1(e,t){for(var i=0;i<e.length;i++)e[i]=t.scaleToGeodeticSurface(e[i],e[i]);return e}function addNormals(e,t,i,r,n,a){var o=e.normals,s=e.tangents,l=e.bitangents,u=Cartesian3.normalize(Cartesian3.cross(i,t,scratch1$2),scratch1$2);a.normal&&CorridorGeometryLibrary.addAttribute(o,t,r,n),a.tangent&&CorridorGeometryLibrary.addAttribute(s,u,r,n),a.bitangent&&CorridorGeometryLibrary.addAttribute(l,i,r,n)}function combine$1(e,t,i){var r,n,a,o=e.positions,s=e.corners,l=e.endPositions,u=e.lefts,c=e.normals,d=new GeometryAttributes,h=0,p=0,f=0;for(n=0;n<o.length;n+=2)h+=a=o[n].length-3,f+=2*a,p+=o[n+1].length-3;for(h+=3,p+=3,n=0;n<s.length;n++){r=s[n];var m=s[n].leftPositions;defined(m)?h+=a=m.length:p+=a=s[n].rightPositions.length,f+=a}var g,y=defined(l);y&&(h+=g=l[0].length-3,p+=g,f+=6*(g/=3));var v,_,C,x,b,A,S=h+p,w=new Float64Array(S),E={normals:t.normal?new Float32Array(S):void 0,tangents:t.tangent?new Float32Array(S):void 0,bitangents:t.bitangent?new Float32Array(S):void 0},T=0,P=S-1,M=cartesian1$1,D=cartesian2$1,I=g/2,O=IndexDatatype$1.createTypedArray(S/3,f),R=0;if(y){A=cartesian3$1,b=cartesian4$1;var L=l[0];for(M=Cartesian3.fromArray(c,0,M),D=Cartesian3.fromArray(u,0,D),n=0;n<I;n++)A=Cartesian3.fromArray(L,3*(I-1-n),A),b=Cartesian3.fromArray(L,3*(I+n),b),CorridorGeometryLibrary.addAttribute(w,b,T),CorridorGeometryLibrary.addAttribute(w,A,void 0,P),addNormals(E,M,D,T,P,t),x=(_=T/3)+1,C=(v=(P-2)/3)-1,O[R++]=v,O[R++]=_,O[R++]=C,O[R++]=C,O[R++]=_,O[R++]=x,T+=3,P-=3}var N,k,B=0,F=0,V=o[B++],z=o[B++];for(w.set(V,T),w.set(z,P-z.length+1),D=Cartesian3.fromArray(u,F,D),a=z.length-3,n=0;n<a;n+=3)N=i.geodeticSurfaceNormal(Cartesian3.fromArray(V,n,scratch1$2),scratch1$2),k=i.geodeticSurfaceNormal(Cartesian3.fromArray(z,a-n,scratch2$2),scratch2$2),addNormals(E,M=Cartesian3.normalize(Cartesian3.add(N,k,M),M),D,T,P,t),x=(_=T/3)+1,C=(v=(P-2)/3)-1,O[R++]=v,O[R++]=_,O[R++]=C,O[R++]=C,O[R++]=_,O[R++]=x,T+=3,P-=3;for(N=i.geodeticSurfaceNormal(Cartesian3.fromArray(V,a,scratch1$2),scratch1$2),k=i.geodeticSurfaceNormal(Cartesian3.fromArray(z,a,scratch2$2),scratch2$2),M=Cartesian3.normalize(Cartesian3.add(N,k,M),M),F+=3,n=0;n<s.length;n++){var U,G,$,H=(r=s[n]).leftPositions,W=r.rightPositions,j=cartesian6$1,q=cartesian3$1,Q=cartesian4$1;if(M=Cartesian3.fromArray(c,F,M),defined(H)){for(addNormals(E,M,D,void 0,P,t),P-=3,G=x,$=C,U=0;U<H.length/3;U++)j=Cartesian3.fromArray(H,3*U,j),O[R++]=G,O[R++]=$-U-1,O[R++]=$-U,CorridorGeometryLibrary.addAttribute(w,j,void 0,P),q=Cartesian3.fromArray(w,3*($-U-1),q),Q=Cartesian3.fromArray(w,3*G,Q),addNormals(E,M,D=Cartesian3.normalize(Cartesian3.subtract(q,Q,D),D),void 0,P,t),P-=3;j=Cartesian3.fromArray(w,3*G,j),q=Cartesian3.subtract(Cartesian3.fromArray(w,3*$,q),j,q),Q=Cartesian3.subtract(Cartesian3.fromArray(w,3*($-U),Q),j,Q),addNormals(E,M,D=Cartesian3.normalize(Cartesian3.add(q,Q,D),D),T,void 0,t),T+=3}else{for(addNormals(E,M,D,T,void 0,t),T+=3,G=C,$=x,U=0;U<W.length/3;U++)j=Cartesian3.fromArray(W,3*U,j),O[R++]=G,O[R++]=$+U,O[R++]=$+U+1,CorridorGeometryLibrary.addAttribute(w,j,T),q=Cartesian3.fromArray(w,3*G,q),Q=Cartesian3.fromArray(w,3*($+U),Q),addNormals(E,M,D=Cartesian3.normalize(Cartesian3.subtract(q,Q,D),D),T,void 0,t),T+=3;j=Cartesian3.fromArray(w,3*G,j),q=Cartesian3.subtract(Cartesian3.fromArray(w,3*($+U),q),j,q),Q=Cartesian3.subtract(Cartesian3.fromArray(w,3*$,Q),j,Q),addNormals(E,M,D=Cartesian3.normalize(Cartesian3.negate(Cartesian3.add(Q,q,D),D),D),void 0,P,t),P-=3}for(V=o[B++],z=o[B++],V.splice(0,3),z.splice(z.length-3,3),w.set(V,T),w.set(z,P-z.length+1),a=z.length-3,F+=3,D=Cartesian3.fromArray(u,F,D),U=0;U<z.length;U+=3)N=i.geodeticSurfaceNormal(Cartesian3.fromArray(V,U,scratch1$2),scratch1$2),k=i.geodeticSurfaceNormal(Cartesian3.fromArray(z,a-U,scratch2$2),scratch2$2),addNormals(E,M=Cartesian3.normalize(Cartesian3.add(N,k,M),M),D,T,P,t),_=(x=T/3)-1,v=(C=(P-2)/3)+1,O[R++]=v,O[R++]=_,O[R++]=C,O[R++]=C,O[R++]=_,O[R++]=x,T+=3,P-=3;T-=3,P+=3}if(addNormals(E,M=Cartesian3.fromArray(c,c.length-3,M),D,T,P,t),y){T+=3,P-=3,A=cartesian3$1,b=cartesian4$1;var Y=l[1];for(n=0;n<I;n++)A=Cartesian3.fromArray(Y,3*(g-n-1),A),b=Cartesian3.fromArray(Y,3*n,b),CorridorGeometryLibrary.addAttribute(w,A,void 0,P),CorridorGeometryLibrary.addAttribute(w,b,T),addNormals(E,M,D,T,P,t),_=(x=T/3)-1,v=(C=(P-2)/3)+1,O[R++]=v,O[R++]=_,O[R++]=C,O[R++]=C,O[R++]=_,O[R++]=x,T+=3,P-=3}if(d.position=new GeometryAttribute({componentDatatype:ComponentDatatype$1.DOUBLE,componentsPerAttribute:3,values:w}),t.st){var X,Z,J=new Float32Array(S/3*2),K=0;if(y){h/=3,p/=3;var ee,te=Math.PI/(g+1);Z=1/(h-g+1),X=1/(p-g+1);var ie=g/2;for(n=1+ie;n<g+1;n++)ee=CesiumMath.PI_OVER_TWO+te*n,J[K++]=X*(1+Math.cos(ee)),J[K++]=.5*(1+Math.sin(ee));for(n=1;n<p-g+1;n++)J[K++]=n*X,J[K++]=0;for(n=g;ie<n;n--)ee=CesiumMath.PI_OVER_TWO-n*te,J[K++]=1-X*(1+Math.cos(ee)),J[K++]=.5*(1+Math.sin(ee));for(n=ie;0<n;n--)ee=CesiumMath.PI_OVER_TWO-te*n,J[K++]=1-Z*(1+Math.cos(ee)),J[K++]=.5*(1+Math.sin(ee));for(n=h-g;0<n;n--)J[K++]=n*Z,J[K++]=1;for(n=1;n<1+ie;n++)ee=CesiumMath.PI_OVER_TWO+te*n,J[K++]=Z*(1+Math.cos(ee)),J[K++]=.5*(1+Math.sin(ee))}else{for(Z=1/((h/=3)-1),X=1/((p/=3)-1),n=0;n<p;n++)J[K++]=n*X,J[K++]=0;for(n=h;0<n;n--)J[K++]=(n-1)*Z,J[K++]=1}d.st=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:2,values:J})}return t.normal&&(d.normal=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:E.normals})),t.tangent&&(d.tangent=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:E.tangents})),t.bitangent&&(d.bitangent=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:E.bitangents})),{attributes:d,indices:O}}function extrudedAttributes(e,t){if(!(t.normal||t.tangent||t.bitangent||t.st))return e;var i,r,n=e.position.values;(t.normal||t.bitangent)&&(i=e.normal.values,r=e.bitangent.values);var a,o=e.position.values.length/18,s=3*o,l=2*o,u=2*s;if(t.normal||t.bitangent||t.tangent){var c=t.normal?new Float32Array(6*s):void 0,d=t.tangent?new Float32Array(6*s):void 0,h=t.bitangent?new Float32Array(6*s):void 0,p=cartesian1$1,f=cartesian2$1,m=cartesian3$1,g=cartesian4$1,y=cartesian5$1,v=cartesian6$1,_=u;for(a=0;a<s;a+=3){var C=_+u;p=Cartesian3.fromArray(n,a,p),f=Cartesian3.fromArray(n,a+s,f),m=Cartesian3.fromArray(n,(a+3)%s,m),f=Cartesian3.subtract(f,p,f),m=Cartesian3.subtract(m,p,m),g=Cartesian3.normalize(Cartesian3.cross(f,m,g),g),t.normal&&(CorridorGeometryLibrary.addAttribute(c,g,C),CorridorGeometryLibrary.addAttribute(c,g,C+3),CorridorGeometryLibrary.addAttribute(c,g,_),CorridorGeometryLibrary.addAttribute(c,g,_+3)),(t.tangent||t.bitangent)&&(v=Cartesian3.fromArray(i,a,v),t.bitangent&&(CorridorGeometryLibrary.addAttribute(h,v,C),CorridorGeometryLibrary.addAttribute(h,v,C+3),CorridorGeometryLibrary.addAttribute(h,v,_),CorridorGeometryLibrary.addAttribute(h,v,_+3)),t.tangent&&(y=Cartesian3.normalize(Cartesian3.cross(v,g,y),y),CorridorGeometryLibrary.addAttribute(d,y,C),CorridorGeometryLibrary.addAttribute(d,y,C+3),CorridorGeometryLibrary.addAttribute(d,y,_),CorridorGeometryLibrary.addAttribute(d,y,_+3))),_+=6}if(t.normal){for(c.set(i),a=0;a<s;a+=3)c[a+s]=-i[a],c[a+s+1]=-i[a+1],c[a+s+2]=-i[a+2];e.normal.values=c}else e.normal=void 0;if(t.bitangent?(h.set(r),h.set(r,s),e.bitangent.values=h):e.bitangent=void 0,t.tangent){var x=e.tangent.values;d.set(x),d.set(x,s),e.tangent.values=d}}if(t.st){var b=e.st.values,A=new Float32Array(6*l);A.set(b),A.set(b,l);for(var S=2*l,w=0;w<2;w++){for(A[S++]=b[0],A[S++]=b[1],a=2;a<l;a+=2){var E=b[a],T=b[a+1];A[S++]=E,A[S++]=T,A[S++]=E,A[S++]=T}A[S++]=b[0],A[S++]=b[1]}e.st.values=A}return e}function addWallPositions(e,t,i){i[t++]=e[0],i[t++]=e[1],i[t++]=e[2];for(var r=3;r<e.length;r+=3){var n=e[r],a=e[r+1],o=e[r+2];i[t++]=n,i[t++]=a,i[t++]=o,i[t++]=n,i[t++]=a,i[t++]=o}return i[t++]=e[0],i[t++]=e[1],i[t++]=e[2],i}function computePositionsExtruded(e,t){var i=new VertexFormat({position:t.position,normal:t.normal||t.bitangent||e.shadowVolume,tangent:t.tangent,bitangent:t.normal||t.bitangent,st:t.st}),r=e.ellipsoid,n=combine$1(CorridorGeometryLibrary.computePositions(e),i,r),a=e.height,o=e.extrudedHeight,s=n.attributes,l=n.indices,u=s.position.values,c=u.length,d=new Float64Array(6*c),h=new Float64Array(c);h.set(u);var p,f=new Float64Array(4*c);f=addWallPositions(u=PolygonPipeline.scaleToGeodeticHeight(u,a,r),0,f),f=addWallPositions(h=PolygonPipeline.scaleToGeodeticHeight(h,o,r),2*c,f),d.set(u),d.set(h,c),d.set(f,2*c),s.position.values=d,s=extrudedAttributes(s,t);var m=c/3;if(e.shadowVolume){var g=s.normal.values;c=g.length;var y=new Float32Array(6*c);for(p=0;p<c;p++)g[p]=-g[p];y.set(g,c),y=addWallPositions(g,4*c,y),s.extrudeDirection=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:y}),t.normal||(s.normal=void 0)}if(defined(e.offsetAttribute)){var v=new Uint8Array(6*m);if(e.offsetAttribute===GeometryOffsetAttribute$1.TOP)v=arrayFill(v=arrayFill(v,1,0,m),1,2*m,4*m);else v=arrayFill(v,e.offsetAttribute===GeometryOffsetAttribute$1.NONE?0:1);s.applyOffset=new GeometryAttribute({componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE,componentsPerAttribute:1,values:v})}var _=l.length,C=m+m,x=IndexDatatype$1.createTypedArray(d.length/3,2*_+3*C);x.set(l);var b,A,S,w,E=_;for(p=0;p<_;p+=3){var T=l[p],P=l[p+1],M=l[p+2];x[E++]=M+m,x[E++]=P+m,x[E++]=T+m}for(p=0;p<C;p+=2)S=(b=p+C)+1,w=(A=b+C)+1,x[E++]=b,x[E++]=A,x[E++]=S,x[E++]=S,x[E++]=A,x[E++]=w;return{attributes:s,indices:x}}var scratchCartesian1$a=new Cartesian3,scratchCartesian2$c=new Cartesian3,scratchCartographic$9=new Cartographic;function computeOffsetPoints(e,t,i,r,n,a){var o=Cartesian3.subtract(t,e,scratchCartesian1$a);Cartesian3.normalize(o,o);var s=i.geodeticSurfaceNormal(e,scratchCartesian2$c),l=Cartesian3.cross(o,s,scratchCartesian1$a);Cartesian3.multiplyByScalar(l,r,l);var u=n.latitude,c=n.longitude,d=a.latitude,h=a.longitude;Cartesian3.add(e,l,scratchCartesian2$c),i.cartesianToCartographic(scratchCartesian2$c,scratchCartographic$9);var p=scratchCartographic$9.latitude,f=scratchCartographic$9.longitude;u=Math.min(u,p),c=Math.min(c,f),d=Math.max(d,p),h=Math.max(h,f),Cartesian3.subtract(e,l,scratchCartesian2$c),i.cartesianToCartographic(scratchCartesian2$c,scratchCartographic$9),p=scratchCartographic$9.latitude,f=scratchCartographic$9.longitude,u=Math.min(u,p),c=Math.min(c,f),d=Math.max(d,p),h=Math.max(h,f),n.latitude=u,n.longitude=c,a.latitude=d,a.longitude=h}var scratchCartesianOffset=new Cartesian3,scratchCartesianEnds=new Cartesian3,scratchCartographicMin=new Cartographic,scratchCartographicMax=new Cartographic;function computeRectangle$2(e,t,i,r,n){var a=arrayRemoveDuplicates(e=scaleToSurface$1(e,t),Cartesian3.equalsEpsilon),o=a.length;if(o<2||i<=0)return new Rectangle;var s,l,u=.5*i;if(scratchCartographicMin.latitude=Number.POSITIVE_INFINITY,scratchCartographicMin.longitude=Number.POSITIVE_INFINITY,scratchCartographicMax.latitude=Number.NEGATIVE_INFINITY,scratchCartographicMax.longitude=Number.NEGATIVE_INFINITY,r===CornerType$1.ROUNDED){var c=a[0];Cartesian3.subtract(c,a[1],scratchCartesianOffset),Cartesian3.normalize(scratchCartesianOffset,scratchCartesianOffset),Cartesian3.multiplyByScalar(scratchCartesianOffset,u,scratchCartesianOffset),Cartesian3.add(c,scratchCartesianOffset,scratchCartesianEnds),t.cartesianToCartographic(scratchCartesianEnds,scratchCartographic$9),s=scratchCartographic$9.latitude,l=scratchCartographic$9.longitude,scratchCartographicMin.latitude=Math.min(scratchCartographicMin.latitude,s),scratchCartographicMin.longitude=Math.min(scratchCartographicMin.longitude,l),scratchCartographicMax.latitude=Math.max(scratchCartographicMax.latitude,s),scratchCartographicMax.longitude=Math.max(scratchCartographicMax.longitude,l)}for(var d=0;d<o-1;++d)computeOffsetPoints(a[d],a[d+1],t,u,scratchCartographicMin,scratchCartographicMax);var h=a[o-1];Cartesian3.subtract(h,a[o-2],scratchCartesianOffset),Cartesian3.normalize(scratchCartesianOffset,scratchCartesianOffset),Cartesian3.multiplyByScalar(scratchCartesianOffset,u,scratchCartesianOffset),Cartesian3.add(h,scratchCartesianOffset,scratchCartesianEnds),computeOffsetPoints(h,scratchCartesianEnds,t,u,scratchCartographicMin,scratchCartographicMax),r===CornerType$1.ROUNDED&&(t.cartesianToCartographic(scratchCartesianEnds,scratchCartographic$9),s=scratchCartographic$9.latitude,l=scratchCartographic$9.longitude,scratchCartographicMin.latitude=Math.min(scratchCartographicMin.latitude,s),scratchCartographicMin.longitude=Math.min(scratchCartographicMin.longitude,l),scratchCartographicMax.latitude=Math.max(scratchCartographicMax.latitude,s),scratchCartographicMax.longitude=Math.max(scratchCartographicMax.longitude,l));var p=defined(n)?n:new Rectangle;return p.north=scratchCartographicMax.latitude,p.south=scratchCartographicMin.latitude,p.east=scratchCartographicMax.longitude,p.west=scratchCartographicMin.longitude,p}function CorridorGeometry(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).positions,i=e.width,r=defaultValue(e.height,0),n=defaultValue(e.extrudedHeight,r);this._positions=t,this._ellipsoid=Ellipsoid.clone(defaultValue(e.ellipsoid,Ellipsoid.WGS84)),this._vertexFormat=VertexFormat.clone(defaultValue(e.vertexFormat,VertexFormat.DEFAULT)),this._width=i,this._height=Math.max(r,n),this._extrudedHeight=Math.min(r,n),this._cornerType=defaultValue(e.cornerType,CornerType$1.ROUNDED),this._granularity=defaultValue(e.granularity,CesiumMath.RADIANS_PER_DEGREE),this._shadowVolume=defaultValue(e.shadowVolume,!1),this._workerName="createCorridorGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this.packedLength=1+t.length*Cartesian3.packedLength+Ellipsoid.packedLength+VertexFormat.packedLength+7}CorridorGeometry.pack=function(e,t,i){i=defaultValue(i,0);var r=e._positions,n=r.length;t[i++]=n;for(var a=0;a<n;++a,i+=Cartesian3.packedLength)Cartesian3.pack(r[a],t,i);return Ellipsoid.pack(e._ellipsoid,t,i),i+=Ellipsoid.packedLength,VertexFormat.pack(e._vertexFormat,t,i),i+=VertexFormat.packedLength,t[i++]=e._width,t[i++]=e._height,t[i++]=e._extrudedHeight,t[i++]=e._cornerType,t[i++]=e._granularity,t[i++]=e._shadowVolume?1:0,t[i]=defaultValue(e._offsetAttribute,-1),t};var scratchEllipsoid$5=Ellipsoid.clone(Ellipsoid.UNIT_SPHERE),scratchVertexFormat$6=new VertexFormat,scratchOptions$b={positions:void 0,ellipsoid:scratchEllipsoid$5,vertexFormat:scratchVertexFormat$6,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,shadowVolume:void 0,offsetAttribute:void 0};CorridorGeometry.unpack=function(e,t,i){t=defaultValue(t,0);for(var r=e[t++],n=new Array(r),a=0;a<r;++a,t+=Cartesian3.packedLength)n[a]=Cartesian3.unpack(e,t);var o=Ellipsoid.unpack(e,t,scratchEllipsoid$5);t+=Ellipsoid.packedLength;var s=VertexFormat.unpack(e,t,scratchVertexFormat$6);t+=VertexFormat.packedLength;var l=e[t++],u=e[t++],c=e[t++],d=e[t++],h=e[t++],p=1===e[t++],f=e[t];return defined(i)?(i._positions=n,i._ellipsoid=Ellipsoid.clone(o,i._ellipsoid),i._vertexFormat=VertexFormat.clone(s,i._vertexFormat),i._width=l,i._height=u,i._extrudedHeight=c,i._cornerType=d,i._granularity=h,i._shadowVolume=p,i._offsetAttribute=-1===f?void 0:f,i):(scratchOptions$b.positions=n,scratchOptions$b.width=l,scratchOptions$b.height=u,scratchOptions$b.extrudedHeight=c,scratchOptions$b.cornerType=d,scratchOptions$b.granularity=h,scratchOptions$b.shadowVolume=p,scratchOptions$b.offsetAttribute=-1===f?void 0:f,new CorridorGeometry(scratchOptions$b))},CorridorGeometry.computeRectangle=function(e,t){var i=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).positions,r=e.width;return computeRectangle$2(i,defaultValue(e.ellipsoid,Ellipsoid.WGS84),r,defaultValue(e.cornerType,CornerType$1.ROUNDED),t)},CorridorGeometry.createGeometry=function(e){var t=e._positions,i=e._width,r=e._ellipsoid,n=arrayRemoveDuplicates(t=scaleToSurface$1(t,r),Cartesian3.equalsEpsilon);if(!(n.length<2||i<=0)){var a,o=e._height,s=e._extrudedHeight,l=!CesiumMath.equalsEpsilon(o,s,0,CesiumMath.EPSILON2),u=e._vertexFormat,c={ellipsoid:r,positions:n,width:i,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!0};if(l)c.height=o,c.extrudedHeight=s,c.shadowVolume=e._shadowVolume,c.offsetAttribute=e._offsetAttribute,a=computePositionsExtruded(c,u);else if((a=combine$1(CorridorGeometryLibrary.computePositions(c),u,r)).attributes.position.values=PolygonPipeline.scaleToGeodeticHeight(a.attributes.position.values,o,r),defined(e._offsetAttribute)){var d=e._offsetAttribute===GeometryOffsetAttribute$1.NONE?0:1,h=a.attributes.position.values.length,p=new Uint8Array(h/3);arrayFill(p,d),a.attributes.applyOffset=new GeometryAttribute({componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE,componentsPerAttribute:1,values:p})}var f=a.attributes,m=BoundingSphere.fromVertices(f.position.values,void 0,3);return u.position||(a.attributes.position.values=void 0),new Geometry({attributes:f,indices:a.indices,primitiveType:PrimitiveType$1.TRIANGLES,boundingSphere:m,offsetAttribute:e._offsetAttribute})}},CorridorGeometry.createShadowVolume=function(e,t,i){var r=e._granularity,n=e._ellipsoid,a=t(r,n),o=i(r,n);return new CorridorGeometry({positions:e._positions,width:e._width,cornerType:e._cornerType,ellipsoid:n,granularity:r,extrudedHeight:a,height:o,vertexFormat:VertexFormat.POSITION_ONLY,shadowVolume:!0})},Object.defineProperties(CorridorGeometry.prototype,{rectangle:{get:function(){return defined(this._rectangle)||(this._rectangle=computeRectangle$2(this._positions,this._ellipsoid,this._width,this._cornerType)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return[0,0,0,1,1,0]}}});var cartesian1$2=new Cartesian3,cartesian2$2=new Cartesian3,cartesian3$2=new Cartesian3;function scaleToSurface$2(e,t){for(var i=0;i<e.length;i++)e[i]=t.scaleToGeodeticSurface(e[i],e[i]);return e}function combine$2(e,t){var i,r,n,a=[],o=e.positions,s=e.corners,l=e.endPositions,u=new GeometryAttributes,c=0,d=0,h=0;for(r=0;r<o.length;r+=2)c+=n=o[r].length-3,h+=n/3*4,d+=o[r+1].length-3;for(c+=3,d+=3,r=0;r<s.length;r++){i=s[r];var p=s[r].leftPositions;defined(p)?c+=n=p.length:d+=n=s[r].rightPositions.length,h+=n/3*2}var f,m=defined(l);m&&(c+=f=l[0].length-3,d+=f,h+=4*(f/=3));var g,y,v,_,C,x,b=c+d,A=new Float64Array(b),S=0,w=b-1,E=f/2,T=IndexDatatype$1.createTypedArray(b/3,h+4),P=0;if(T[P++]=S/3,T[P++]=(w-2)/3,m){a.push(S/3),x=cartesian1$2,C=cartesian2$2;var M=l[0];for(r=0;r<E;r++)x=Cartesian3.fromArray(M,3*(E-1-r),x),C=Cartesian3.fromArray(M,3*(E+r),C),CorridorGeometryLibrary.addAttribute(A,C,S),CorridorGeometryLibrary.addAttribute(A,x,void 0,w),_=(y=S/3)+1,v=(g=(w-2)/3)-1,T[P++]=g,T[P++]=v,T[P++]=y,T[P++]=_,S+=3,w-=3}var D=0,I=o[D++],O=o[D++];for(A.set(I,S),A.set(O,w-O.length+1),n=O.length-3,a.push(S/3,(w-2)/3),r=0;r<n;r+=3)_=(y=S/3)+1,v=(g=(w-2)/3)-1,T[P++]=g,T[P++]=v,T[P++]=y,T[P++]=_,S+=3,w-=3;for(r=0;r<s.length;r++){var R,L,N=(i=s[r]).leftPositions,k=i.rightPositions,B=cartesian3$2;if(defined(N)){for(w-=3,L=v,a.push(_),R=0;R<N.length/3;R++)B=Cartesian3.fromArray(N,3*R,B),T[P++]=L-R-1,T[P++]=L-R,CorridorGeometryLibrary.addAttribute(A,B,void 0,w),w-=3;a.push(L-Math.floor(N.length/6)),t===CornerType$1.BEVELED&&a.push((w-2)/3+1),S+=3}else{for(S+=3,L=_,a.push(v),R=0;R<k.length/3;R++)B=Cartesian3.fromArray(k,3*R,B),T[P++]=L+R,T[P++]=L+R+1,CorridorGeometryLibrary.addAttribute(A,B,S),S+=3;a.push(L+Math.floor(k.length/6)),t===CornerType$1.BEVELED&&a.push(S/3-1),w-=3}for(I=o[D++],O=o[D++],I.splice(0,3),O.splice(O.length-3,3),A.set(I,S),A.set(O,w-O.length+1),n=O.length-3,R=0;R<O.length;R+=3)y=(_=S/3)-1,g=(v=(w-2)/3)+1,T[P++]=g,T[P++]=v,T[P++]=y,T[P++]=_,S+=3,w-=3;S-=3,w+=3,a.push(S/3,(w-2)/3)}if(m){S+=3,w-=3,x=cartesian1$2,C=cartesian2$2;var F=l[1];for(r=0;r<E;r++)x=Cartesian3.fromArray(F,3*(f-r-1),x),C=Cartesian3.fromArray(F,3*r,C),CorridorGeometryLibrary.addAttribute(A,x,void 0,w),CorridorGeometryLibrary.addAttribute(A,C,S),y=(_=S/3)-1,g=(v=(w-2)/3)+1,T[P++]=g,T[P++]=v,T[P++]=y,T[P++]=_,S+=3,w-=3;a.push(S/3)}else a.push(S/3,(w-2)/3);return T[P++]=S/3,T[P++]=(w-2)/3,u.position=new GeometryAttribute({componentDatatype:ComponentDatatype$1.DOUBLE,componentsPerAttribute:3,values:A}),{attributes:u,indices:T,wallIndices:a}}function computePositionsExtruded$1(e){var t=e.ellipsoid,i=combine$2(CorridorGeometryLibrary.computePositions(e),e.cornerType),r=i.wallIndices,n=e.height,a=e.extrudedHeight,o=i.attributes,s=i.indices,l=o.position.values,u=l.length,c=new Float64Array(u);c.set(l);var d,h=new Float64Array(2*u);if(l=PolygonPipeline.scaleToGeodeticHeight(l,n,t),c=PolygonPipeline.scaleToGeodeticHeight(c,a,t),h.set(l),h.set(c,u),o.position.values=h,u/=3,defined(e.offsetAttribute)){var p=new Uint8Array(2*u);if(e.offsetAttribute===GeometryOffsetAttribute$1.TOP)p=arrayFill(p,1,0,u);else p=arrayFill(p,e.offsetAttribute===GeometryOffsetAttribute$1.NONE?0:1);o.applyOffset=new GeometryAttribute({componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE,componentsPerAttribute:1,values:p})}var f=s.length,m=IndexDatatype$1.createTypedArray(h.length/3,2*(f+r.length));m.set(s);var g,y,v=f;for(d=0;d<f;d+=2){var _=s[d],C=s[d+1];m[v++]=_+u,m[v++]=C+u}for(d=0;d<r.length;d++)y=(g=r[d])+u,m[v++]=g,m[v++]=y;return{attributes:o,indices:m}}function CorridorOutlineGeometry(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).positions,i=e.width,r=defaultValue(e.height,0),n=defaultValue(e.extrudedHeight,r);this._positions=t,this._ellipsoid=Ellipsoid.clone(defaultValue(e.ellipsoid,Ellipsoid.WGS84)),this._width=i,this._height=Math.max(r,n),this._extrudedHeight=Math.min(r,n),this._cornerType=defaultValue(e.cornerType,CornerType$1.ROUNDED),this._granularity=defaultValue(e.granularity,CesiumMath.RADIANS_PER_DEGREE),this._offsetAttribute=e.offsetAttribute,this._workerName="createCorridorOutlineGeometry",this.packedLength=1+t.length*Cartesian3.packedLength+Ellipsoid.packedLength+6}CorridorOutlineGeometry.pack=function(e,t,i){i=defaultValue(i,0);var r=e._positions,n=r.length;t[i++]=n;for(var a=0;a<n;++a,i+=Cartesian3.packedLength)Cartesian3.pack(r[a],t,i);return Ellipsoid.pack(e._ellipsoid,t,i),i+=Ellipsoid.packedLength,t[i++]=e._width,t[i++]=e._height,t[i++]=e._extrudedHeight,t[i++]=e._cornerType,t[i++]=e._granularity,t[i]=defaultValue(e._offsetAttribute,-1),t};var scratchEllipsoid$6=Ellipsoid.clone(Ellipsoid.UNIT_SPHERE),scratchOptions$c={positions:void 0,ellipsoid:scratchEllipsoid$6,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,offsetAttribute:void 0},defaultTokenCredit;CorridorOutlineGeometry.unpack=function(e,t,i){t=defaultValue(t,0);for(var r=e[t++],n=new Array(r),a=0;a<r;++a,t+=Cartesian3.packedLength)n[a]=Cartesian3.unpack(e,t);var o=Ellipsoid.unpack(e,t,scratchEllipsoid$6);t+=Ellipsoid.packedLength;var s=e[t++],l=e[t++],u=e[t++],c=e[t++],d=e[t++],h=e[t];return defined(i)?(i._positions=n,i._ellipsoid=Ellipsoid.clone(o,i._ellipsoid),i._width=s,i._height=l,i._extrudedHeight=u,i._cornerType=c,i._granularity=d,i._offsetAttribute=-1===h?void 0:h,i):(scratchOptions$c.positions=n,scratchOptions$c.width=s,scratchOptions$c.height=l,scratchOptions$c.extrudedHeight=u,scratchOptions$c.cornerType=c,scratchOptions$c.granularity=d,scratchOptions$c.offsetAttribute=-1===h?void 0:h,new CorridorOutlineGeometry(scratchOptions$c))},CorridorOutlineGeometry.createGeometry=function(e){var t=e._positions,i=e._width,r=e._ellipsoid,n=arrayRemoveDuplicates(t=scaleToSurface$2(t,r),Cartesian3.equalsEpsilon);if(!(n.length<2||i<=0)){var a,o=e._height,s=e._extrudedHeight,l=!CesiumMath.equalsEpsilon(o,s,0,CesiumMath.EPSILON2),u={ellipsoid:r,positions:n,width:i,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!1};if(l)u.height=o,u.extrudedHeight=s,u.offsetAttribute=e._offsetAttribute,a=computePositionsExtruded$1(u);else if((a=combine$2(CorridorGeometryLibrary.computePositions(u),u.cornerType)).attributes.position.values=PolygonPipeline.scaleToGeodeticHeight(a.attributes.position.values,o,r),defined(e._offsetAttribute)){var c=a.attributes.position.values.length,d=new Uint8Array(c/3);arrayFill(d,e._offsetAttribute===GeometryOffsetAttribute$1.NONE?0:1),a.attributes.applyOffset=new GeometryAttribute({componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE,componentsPerAttribute:1,values:d})}var h=a.attributes,p=BoundingSphere.fromVertices(h.position.values,void 0,3);return new Geometry({attributes:h,indices:a.indices,primitiveType:PrimitiveType$1.LINES,boundingSphere:p,offsetAttribute:e._offsetAttribute})}};var defaultAccessToken="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIwZGE4MzljNy1iNjVkLTQ1YmYtYmQ1MC0wNjUwYmEyYjQ3OWEiLCJpZCI6MjU5LCJzY29wZXMiOlsiYXNyIiwiZ2MiXSwiaWF0IjoxNTg1NzQ2MTM0fQ.2IfAIAuWWqz4C5NVq8sSTWqfrWkw1bjYW3RflwlpCuo",Ion={};function IonResource(e,t){var i,r=e.externalType,n=defined(r);if(n){if("3DTILES"!==r&&"STK_TERRAIN_SERVER"!==r)throw new RuntimeError("Ion.createResource does not support external imagery assets; use IonImageryProvider instead.");i={url:e.options.url}}else i={url:e.url,retryAttempts:1,retryCallback:retryCallback};Resource.call(this,i),this._ionEndpoint=e,this._ionEndpointDomain=n?void 0:new URI(e.url).authority,this._ionEndpointResource=t,this._ionRoot=void 0,this._pendingPromise=void 0,this._credits=void 0,this._isExternal=n}function retryCallback(t,e){var i=defaultValue(t._ionRoot,t),r=i._ionEndpointResource;return defined(e)&&(401===e.statusCode||e.target instanceof Image)?(defined(i._pendingPromise)||(i._pendingPromise=r.fetchJson().then(function(e){return i._ionEndpoint=e}).always(function(e){return i._pendingPromise=void 0,e})),i._pendingPromise.then(function(e){return t._ionEndpoint=e,!0})):when.resolve(!1)}function createWorldTerrain(e){return e=defaultValue(e,defaultValue.EMPTY_OBJECT),new CesiumTerrainProvider({url:IonResource.fromAssetId(1),requestVertexNormals:defaultValue(e.requestVertexNormals,!1),requestWaterMask:defaultValue(e.requestWaterMask,!1)})}Ion.defaultAccessToken=defaultAccessToken,Ion.defaultServer=new Resource({url:"https://api.cesium.com/"}),Ion.getDefaultTokenCredit=function(e){if(e===defaultAccessToken){if(!defined(defaultTokenCredit)){defaultTokenCredit=new Credit('<b> This application is using Cesium\'s default ion access token. Please assign <i>Cesium.Ion.defaultAccessToken</i> with an access token from your ion account before making any Cesium API calls. You can sign up for a free ion account at <a href="https://cesium.com">https://cesium.com</a>.</b>',!0)}return defaultTokenCredit}},defined(Object.create)&&(IonResource.prototype=Object.create(Resource.prototype),IonResource.prototype.constructor=IonResource),IonResource.fromAssetId=function(e,t){var i=IonResource._createEndpointResource(e,t);return i.fetchJson().then(function(e){return new IonResource(e,i)})},Object.defineProperties(IonResource.prototype,{credits:{get:function(){return defined(this._ionRoot)?this._ionRoot.credits:(defined(this._credits)||(this._credits=IonResource.getCreditsFromEndpoint(this._ionEndpoint,this._ionEndpointResource)),this._credits)}}}),IonResource.getCreditsFromEndpoint=function(e,t){var i=e.attributions.map(Credit.getIonCredit),r=Ion.getDefaultTokenCredit(t.queryParameters.access_token);return defined(r)&&i.push(Credit.clone(r)),i},IonResource.prototype.clone=function(e){var t=defaultValue(this._ionRoot,this);return defined(e)||(e=new IonResource(t._ionEndpoint,t._ionEndpointResource)),(e=Resource.prototype.clone.call(this,e))._ionRoot=t,e._isExternal=this._isExternal,e},IonResource.prototype.fetchImage=function(e){if(!this._isExternal){var t=e;e={preferBlob:!0},defined(t)&&(e.flipY=t.flipY,e.preferImageBitmap=t.preferImageBitmap)}return Resource.prototype.fetchImage.call(this,e)},IonResource.prototype._makeRequest=function(e){return this._isExternal||new URI(this.url).authority!==this._ionEndpointDomain||(defined(e.headers)||(e.headers={}),e.headers.Authorization="Bearer "+this._ionEndpoint.accessToken),Resource.prototype._makeRequest.call(this,e)},IonResource._createEndpointResource=function(e,t){var i=defaultValue((t=defaultValue(t,defaultValue.EMPTY_OBJECT)).server,Ion.defaultServer),r=defaultValue(t.accessToken,Ion.defaultAccessToken);i=Resource.createIfNeeded(i);var n={url:"v1/assets/"+e+"/endpoint"};return defined(r)&&(n.queryParameters={access_token:r}),i.getDerivedResource(n)};var CylinderGeometryLibrary={computePositions:function(e,t,i,r,n){var a,o=.5*e,s=-o,l=r+r,u=new Float64Array(3*(n?2*l:l)),c=0,d=0,h=n?3*l:0,p=n?3*(l+r):3*r;for(a=0;a<r;a++){var f=a/r*CesiumMath.TWO_PI,m=Math.cos(f),g=Math.sin(f),y=m*i,v=g*i,_=m*t,C=g*t;u[d+h]=y,u[d+h+1]=v,u[d+h+2]=s,u[d+p]=_,u[d+p+1]=C,u[d+p+2]=o,d+=3,n&&(u[c++]=y,u[c++]=v,u[c++]=s,u[c++]=_,u[c++]=C,u[c++]=o)}return u}},radiusScratch=new Cartesian2,normalScratch$4=new Cartesian3,bitangentScratch=new Cartesian3,tangentScratch=new Cartesian3,positionScratch$3=new Cartesian3;function CylinderGeometry(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).length,i=e.topRadius,r=e.bottomRadius,n=defaultValue(e.vertexFormat,VertexFormat.DEFAULT),a=defaultValue(e.slices,128);this._length=t,this._topRadius=i,this._bottomRadius=r,this._vertexFormat=VertexFormat.clone(n),this._slices=a,this._offsetAttribute=e.offsetAttribute,this._workerName="createCylinderGeometry"}CylinderGeometry.packedLength=VertexFormat.packedLength+5,CylinderGeometry.pack=function(e,t,i){return i=defaultValue(i,0),VertexFormat.pack(e._vertexFormat,t,i),i+=VertexFormat.packedLength,t[i++]=e._length,t[i++]=e._topRadius,t[i++]=e._bottomRadius,t[i++]=e._slices,t[i]=defaultValue(e._offsetAttribute,-1),t};var scratchVertexFormat$7=new VertexFormat,scratchOptions$d={vertexFormat:scratchVertexFormat$7,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,offsetAttribute:void 0},unitCylinderGeometry;CylinderGeometry.unpack=function(e,t,i){t=defaultValue(t,0);var r=VertexFormat.unpack(e,t,scratchVertexFormat$7);t+=VertexFormat.packedLength;var n=e[t++],a=e[t++],o=e[t++],s=e[t++],l=e[t];return defined(i)?(i._vertexFormat=VertexFormat.clone(r,i._vertexFormat),i._length=n,i._topRadius=a,i._bottomRadius=o,i._slices=s,i._offsetAttribute=-1===l?void 0:l,i):(scratchOptions$d.length=n,scratchOptions$d.topRadius=a,scratchOptions$d.bottomRadius=o,scratchOptions$d.slices=s,scratchOptions$d.offsetAttribute=-1===l?void 0:l,new CylinderGeometry(scratchOptions$d))},CylinderGeometry.createGeometry=function(e){var t=e._length,i=e._topRadius,r=e._bottomRadius,n=e._vertexFormat,a=e._slices;if(!(t<=0||i<0||r<0||0===i&&0===r)){var o,s=a+a,l=a+s,u=s+s,c=CylinderGeometryLibrary.computePositions(t,i,r,a,!0),d=n.st?new Float32Array(2*u):void 0,h=n.normal?new Float32Array(3*u):void 0,p=n.tangent?new Float32Array(3*u):void 0,f=n.bitangent?new Float32Array(3*u):void 0,m=n.normal||n.tangent||n.bitangent;if(m){var g=n.tangent||n.bitangent,y=0,v=0,_=0,C=Math.atan2(r-i,t),x=normalScratch$4;x.z=Math.sin(C);var b=Math.cos(C),A=tangentScratch,S=bitangentScratch;for(o=0;o<a;o++){var w=o/a*CesiumMath.TWO_PI,E=b*Math.cos(w),T=b*Math.sin(w);m&&(x.x=E,x.y=T,g&&(A=Cartesian3.normalize(Cartesian3.cross(Cartesian3.UNIT_Z,x,A),A)),n.normal&&(h[y++]=x.x,h[y++]=x.y,h[y++]=x.z,h[y++]=x.x,h[y++]=x.y,h[y++]=x.z),n.tangent&&(p[v++]=A.x,p[v++]=A.y,p[v++]=A.z,p[v++]=A.x,p[v++]=A.y,p[v++]=A.z),n.bitangent&&(S=Cartesian3.normalize(Cartesian3.cross(x,A,S),S),f[_++]=S.x,f[_++]=S.y,f[_++]=S.z,f[_++]=S.x,f[_++]=S.y,f[_++]=S.z))}for(o=0;o<a;o++)n.normal&&(h[y++]=0,h[y++]=0,h[y++]=-1),n.tangent&&(p[v++]=1,p[v++]=0,p[v++]=0),n.bitangent&&(f[_++]=0,f[_++]=-1,f[_++]=0);for(o=0;o<a;o++)n.normal&&(h[y++]=0,h[y++]=0,h[y++]=1),n.tangent&&(p[v++]=1,p[v++]=0,p[v++]=0),n.bitangent&&(f[_++]=0,f[_++]=1,f[_++]=0)}var P=12*a-12,M=IndexDatatype$1.createTypedArray(u,P),D=0,I=0;for(o=0;o<a-1;o++)M[D++]=I,M[D++]=I+2,M[D++]=I+3,M[D++]=I,M[D++]=I+3,M[D++]=I+1,I+=2;for(M[D++]=s-2,M[D++]=0,M[D++]=1,M[D++]=s-2,M[D++]=1,M[D++]=s-1,o=1;o<a-1;o++)M[D++]=s+o+1,M[D++]=s+o,M[D++]=s;for(o=1;o<a-1;o++)M[D++]=l,M[D++]=l+o,M[D++]=l+o+1;var O=0;if(n.st){var R=Math.max(i,r);for(o=0;o<u;o++){var L=Cartesian3.fromArray(c,3*o,positionScratch$3);d[O++]=(L.x+R)/(2*R),d[O++]=(L.y+R)/(2*R)}}var N=new GeometryAttributes;n.position&&(N.position=new GeometryAttribute({componentDatatype:ComponentDatatype$1.DOUBLE,componentsPerAttribute:3,values:c})),n.normal&&(N.normal=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:h})),n.tangent&&(N.tangent=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:p})),n.bitangent&&(N.bitangent=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:f})),n.st&&(N.st=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:2,values:d})),radiusScratch.x=.5*t,radiusScratch.y=Math.max(r,i);var k=new BoundingSphere(Cartesian3.ZERO,Cartesian2.magnitude(radiusScratch));if(defined(e._offsetAttribute)){t=c.length;var B=new Uint8Array(t/3);arrayFill(B,e._offsetAttribute===GeometryOffsetAttribute$1.NONE?0:1),N.applyOffset=new GeometryAttribute({componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE,componentsPerAttribute:1,values:B})}return new Geometry({attributes:N,indices:M,primitiveType:PrimitiveType$1.TRIANGLES,boundingSphere:k,offsetAttribute:e._offsetAttribute})}},CylinderGeometry.getUnitCylinder=function(){return defined(unitCylinderGeometry)||(unitCylinderGeometry=CylinderGeometry.createGeometry(new CylinderGeometry({topRadius:1,bottomRadius:1,length:1,vertexFormat:VertexFormat.POSITION_ONLY}))),unitCylinderGeometry};var radiusScratch$1=new Cartesian2;function CylinderOutlineGeometry(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).length,i=e.topRadius,r=e.bottomRadius,n=defaultValue(e.slices,128),a=Math.max(defaultValue(e.numberOfVerticalLines,16),0);this._length=t,this._topRadius=i,this._bottomRadius=r,this._slices=n,this._numberOfVerticalLines=a,this._offsetAttribute=e.offsetAttribute,this._workerName="createCylinderOutlineGeometry"}CylinderOutlineGeometry.packedLength=6,CylinderOutlineGeometry.pack=function(e,t,i){return i=defaultValue(i,0),t[i++]=e._length,t[i++]=e._topRadius,t[i++]=e._bottomRadius,t[i++]=e._slices,t[i++]=e._numberOfVerticalLines,t[i]=defaultValue(e._offsetAttribute,-1),t};var scratchOptions$e={length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};CylinderOutlineGeometry.unpack=function(e,t,i){t=defaultValue(t,0);var r=e[t++],n=e[t++],a=e[t++],o=e[t++],s=e[t++],l=e[t];return defined(i)?(i._length=r,i._topRadius=n,i._bottomRadius=a,i._slices=o,i._numberOfVerticalLines=s,i._offsetAttribute=-1===l?void 0:l,i):(scratchOptions$e.length=r,scratchOptions$e.topRadius=n,scratchOptions$e.bottomRadius=a,scratchOptions$e.slices=o,scratchOptions$e.numberOfVerticalLines=s,scratchOptions$e.offsetAttribute=-1===l?void 0:l,new CylinderOutlineGeometry(scratchOptions$e))},CylinderOutlineGeometry.createGeometry=function(e){var t=e._length,i=e._topRadius,r=e._bottomRadius,n=e._slices,a=e._numberOfVerticalLines;if(!(t<=0||i<0||r<0||0===i&&0===r)){var o,s=2*n,l=CylinderGeometryLibrary.computePositions(t,i,r,n,!1),u=2*n;if(0<a){var c=Math.min(a,n);o=Math.round(n/c),u+=c}var d,h=IndexDatatype$1.createTypedArray(s,2*u),p=0;for(d=0;d<n-1;d++)h[p++]=d,h[p++]=d+1,h[p++]=d+n,h[p++]=d+1+n;if(h[p++]=n-1,h[p++]=0,h[p++]=n+n-1,h[p++]=n,0<a)for(d=0;d<n;d+=o)h[p++]=d,h[p++]=d+n;var f=new GeometryAttributes;f.position=new GeometryAttribute({componentDatatype:ComponentDatatype$1.DOUBLE,componentsPerAttribute:3,values:l}),radiusScratch$1.x=.5*t,radiusScratch$1.y=Math.max(r,i);var m=new BoundingSphere(Cartesian3.ZERO,Cartesian2.magnitude(radiusScratch$1));if(defined(e._offsetAttribute)){t=l.length;var g=new Uint8Array(t/3);arrayFill(g,e._offsetAttribute===GeometryOffsetAttribute$1.NONE?0:1),f.applyOffset=new GeometryAttribute({componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE,componentsPerAttribute:1,values:g})}return new Geometry({attributes:f,indices:h,primitiveType:PrimitiveType$1.LINES,boundingSphere:m,offsetAttribute:e._offsetAttribute})}};var compressedMagic=1953029805,compressedMagicSwap=2917034100;function decodeGoogleEarthEnterpriseData(e,t){if(decodeGoogleEarthEnterpriseData.passThroughDataForTesting)return t;var i=e.byteLength;if(0===i||i%4!=0)throw new RuntimeError("The length of key must be greater than 0 and a multiple of 4.");var r=new DataView(t),n=r.getUint32(0,!0);if(n===compressedMagic||n===compressedMagicSwap)return t;for(var a,o=new DataView(e),s=0,l=t.byteLength,u=l-l%8,c=i,d=8;s<u;)for(a=d=(d+8)%24;s<u&&a<c;)r.setUint32(s,r.getUint32(s,!0)^o.getUint32(a,!0),!0),r.setUint32(s+4,r.getUint32(s+4,!0)^o.getUint32(a+4,!0),!0),s+=8,a+=24;if(s<l)for(c<=a&&(a=d=(d+8)%24);s<l;)r.setUint8(s,r.getUint8(s)^o.getUint8(a)),s++,a++}function deprecationWarning(e,t){oneTimeWarning(e,t)}function DistanceDisplayConditionGeometryInstanceAttribute(e,t){e=defaultValue(e,0),t=defaultValue(t,Number.MAX_VALUE),this.value=new Float32Array([e,t])}function DoublyLinkedList(){this.head=void 0,this.tail=void 0,this._length=0}function DoublyLinkedListNode(e,t,i){this.item=e,this.previous=t,this.next=i}function remove(e,t){defined(t.previous)&&defined(t.next)?(t.previous.next=t.next,t.next.previous=t.previous):defined(t.previous)?(t.previous.next=void 0,e.tail=t.previous):defined(t.next)?(t.next.previous=void 0,e.head=t.next):(e.head=void 0,e.tail=void 0),t.next=void 0,t.previous=void 0}decodeGoogleEarthEnterpriseData.passThroughDataForTesting=!1,Object.defineProperties(DistanceDisplayConditionGeometryInstanceAttribute.prototype,{componentDatatype:{get:function(){return ComponentDatatype$1.FLOAT}},componentsPerAttribute:{get:function(){return 2}},normalize:{get:function(){return!1}}}),DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition=function(e){return new DistanceDisplayConditionGeometryInstanceAttribute(e.near,e.far)},DistanceDisplayConditionGeometryInstanceAttribute.toValue=function(e,t){return defined(t)?(t[0]=e.near,t[1]=e.far,t):new Float32Array([e.near,e.far])},Object.defineProperties(DoublyLinkedList.prototype,{length:{get:function(){return this._length}}}),DoublyLinkedList.prototype.add=function(e){var t=new DoublyLinkedListNode(e,this.tail,void 0);return defined(this.tail)?this.tail.next=t:this.head=t,this.tail=t,++this._length,t},DoublyLinkedList.prototype.remove=function(e){defined(e)&&(remove(this,e),--this._length)},DoublyLinkedList.prototype.splice=function(e,t){if(e!==t){remove(this,t);var i=e.next;e.next=t,this.tail===e?this.tail=t:i.previous=t,t.next=i,t.previous=e}};var scratchPosition$5=new Cartesian3,scratchNormal$5=new Cartesian3,scratchTangent$3=new Cartesian3,scratchBitangent$3=new Cartesian3,scratchNormalST=new Cartesian3,defaultRadii$1=new Cartesian3(1,1,1),cos$1=Math.cos,sin$1=Math.sin;function EllipsoidGeometry(e){var t=defaultValue((e=defaultValue(e,defaultValue.EMPTY_OBJECT)).radii,defaultRadii$1),i=defaultValue(e.innerRadii,t),r=defaultValue(e.minimumClock,0),n=defaultValue(e.maximumClock,CesiumMath.TWO_PI),a=defaultValue(e.minimumCone,0),o=defaultValue(e.maximumCone,CesiumMath.PI),s=Math.round(defaultValue(e.stackPartitions,64)),l=Math.round(defaultValue(e.slicePartitions,64)),u=defaultValue(e.vertexFormat,VertexFormat.DEFAULT);this._radii=Cartesian3.clone(t),this._innerRadii=Cartesian3.clone(i),this._minimumClock=r,this._maximumClock=n,this._minimumCone=a,this._maximumCone=o,this._stackPartitions=s,this._slicePartitions=l,this._vertexFormat=VertexFormat.clone(u),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidGeometry"}EllipsoidGeometry.packedLength=2*Cartesian3.packedLength+VertexFormat.packedLength+7,EllipsoidGeometry.pack=function(e,t,i){return i=defaultValue(i,0),Cartesian3.pack(e._radii,t,i),i+=Cartesian3.packedLength,Cartesian3.pack(e._innerRadii,t,i),i+=Cartesian3.packedLength,VertexFormat.pack(e._vertexFormat,t,i),i+=VertexFormat.packedLength,t[i++]=e._minimumClock,t[i++]=e._maximumClock,t[i++]=e._minimumCone,t[i++]=e._maximumCone,t[i++]=e._stackPartitions,t[i++]=e._slicePartitions,t[i]=defaultValue(e._offsetAttribute,-1),t};var scratchRadii$1=new Cartesian3,scratchInnerRadii$1=new Cartesian3,scratchVertexFormat$8=new VertexFormat,scratchOptions$f={radii:scratchRadii$1,innerRadii:scratchInnerRadii$1,vertexFormat:scratchVertexFormat$8,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,offsetAttribute:void 0},unitEllipsoidGeometry;function EllipsoidTerrainProvider(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this._tilingScheme=e.tilingScheme,defined(this._tilingScheme)||(this._tilingScheme=new GeographicTilingScheme({ellipsoid:defaultValue(e.ellipsoid,Ellipsoid.WGS84)})),this._levelZeroMaximumGeometricError=TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,64,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new Event,this._readyPromise=when.resolve(!0)}function GeocoderService(){}EllipsoidGeometry.unpack=function(e,t,i){t=defaultValue(t,0);var r=Cartesian3.unpack(e,t,scratchRadii$1);t+=Cartesian3.packedLength;var n=Cartesian3.unpack(e,t,scratchInnerRadii$1);t+=Cartesian3.packedLength;var a=VertexFormat.unpack(e,t,scratchVertexFormat$8);t+=VertexFormat.packedLength;var o=e[t++],s=e[t++],l=e[t++],u=e[t++],c=e[t++],d=e[t++],h=e[t];return defined(i)?(i._radii=Cartesian3.clone(r,i._radii),i._innerRadii=Cartesian3.clone(n,i._innerRadii),i._vertexFormat=VertexFormat.clone(a,i._vertexFormat),i._minimumClock=o,i._maximumClock=s,i._minimumCone=l,i._maximumCone=u,i._stackPartitions=c,i._slicePartitions=d,i._offsetAttribute=-1===h?void 0:h,i):(scratchOptions$f.minimumClock=o,scratchOptions$f.maximumClock=s,scratchOptions$f.minimumCone=l,scratchOptions$f.maximumCone=u,scratchOptions$f.stackPartitions=c,scratchOptions$f.slicePartitions=d,scratchOptions$f.offsetAttribute=-1===h?void 0:h,new EllipsoidGeometry(scratchOptions$f))},EllipsoidGeometry.createGeometry=function(e){var t=e._radii;if(!(t.x<=0||t.y<=0||t.z<=0)){var i=e._innerRadii;if(!(i.x<=0||i.y<=0||i.z<=0)){var r,n,a=e._minimumClock,o=e._maximumClock,s=e._minimumCone,l=e._maximumCone,u=e._vertexFormat,c=e._slicePartitions+1,d=e._stackPartitions+1;(c=Math.round(c*Math.abs(o-a)/CesiumMath.TWO_PI))<2&&(c=2),(d=Math.round(d*Math.abs(l-s)/CesiumMath.PI))<2&&(d=2);var h=0,p=[s],f=[a];for(r=0;r<d;r++)p.push(s+r*(l-s)/(d-1));for(p.push(l),n=0;n<c;n++)f.push(a+n*(o-a)/(c-1));f.push(o);var m=p.length,g=f.length,y=0,v=1,_=i.x!==t.x||i.y!==t.y||i.z!==t.z,C=!1,x=!1,b=!1;_&&(v=2,0<s&&(C=!0,y+=c-1),l<Math.PI&&(x=!0,y+=c-1),(o-a)%CesiumMath.TWO_PI?(b=!0,y+=2*(d-1)+1):y+=1);var A=g*m*v,S=new Float64Array(3*A),w=arrayFill(new Array(A),!1),E=arrayFill(new Array(A),!1),T=c*d*v,P=6*(T+y+1-(c+d)*v),M=IndexDatatype$1.createTypedArray(T,P),D=u.normal?new Float32Array(3*A):void 0,I=u.tangent?new Float32Array(3*A):void 0,O=u.bitangent?new Float32Array(3*A):void 0,R=u.st?new Float32Array(2*A):void 0,L=new Array(m),N=new Array(m);for(r=0;r<m;r++)L[r]=sin$1(p[r]),N[r]=cos$1(p[r]);var k=new Array(g),B=new Array(g);for(n=0;n<g;n++)B[n]=cos$1(f[n]),k[n]=sin$1(f[n]);for(r=0;r<m;r++)for(n=0;n<g;n++)S[h++]=t.x*L[r]*B[n],S[h++]=t.y*L[r]*k[n],S[h++]=t.z*N[r];var F,V,z,U,G=A/2;if(_)for(r=0;r<m;r++)for(n=0;n<g;n++)S[h++]=i.x*L[r]*B[n],S[h++]=i.y*L[r]*k[n],S[h++]=i.z*N[r],w[G]=!0,0<r&&r!==m-1&&0!==n&&n!==g-1&&(E[G]=!0),G++;for(h=0,r=1;r<m-2;r++)for(F=r*g,V=(r+1)*g,n=1;n<g-2;n++)M[h++]=V+n,M[h++]=V+n+1,M[h++]=F+n+1,M[h++]=V+n,M[h++]=F+n+1,M[h++]=F+n;if(_){var $=m*g;for(r=1;r<m-2;r++)for(F=$+r*g,V=$+(r+1)*g,n=1;n<g-2;n++)M[h++]=V+n,M[h++]=F+n,M[h++]=F+n+1,M[h++]=V+n,M[h++]=F+n+1,M[h++]=V+n+1}if(_){if(C)for(U=m*g,r=1;r<g-2;r++)M[h++]=r,M[h++]=r+1,M[h++]=U+r+1,M[h++]=r,M[h++]=U+r+1,M[h++]=U+r;if(x)for(z=m*g-g,U=m*g*v-g,r=1;r<g-2;r++)M[h++]=z+r+1,M[h++]=z+r,M[h++]=U+r,M[h++]=z+r+1,M[h++]=U+r,M[h++]=U+r+1}if(b){for(r=1;r<m-2;r++)U=g*m+g*r,z=g*r,M[h++]=U,M[h++]=z+g,M[h++]=z,M[h++]=U,M[h++]=U+g,M[h++]=z+g;for(r=1;r<m-2;r++)U=g*m+g*(r+1)-1,z=g*(r+1)-1,M[h++]=z+g,M[h++]=U,M[h++]=z,M[h++]=z+g,M[h++]=U+g,M[h++]=U}var H=new GeometryAttributes;u.position&&(H.position=new GeometryAttribute({componentDatatype:ComponentDatatype$1.DOUBLE,componentsPerAttribute:3,values:S}));var W,j=0,q=0,Q=0,Y=0,X=A/2,Z=Ellipsoid.fromCartesian3(t),J=Ellipsoid.fromCartesian3(i);if(u.st||u.normal||u.tangent||u.bitangent){for(r=0;r<A;r++){W=w[r]?J:Z;var K=Cartesian3.fromArray(S,3*r,scratchPosition$5),ee=W.geodeticSurfaceNormal(K,scratchNormal$5);if(E[r]&&Cartesian3.negate(ee,ee),u.st){var te=Cartesian2.negate(ee,scratchNormalST);R[j++]=Math.atan2(te.y,te.x)/CesiumMath.TWO_PI+.5,R[j++]=Math.asin(ee.z)/Math.PI+.5}if(u.normal&&(D[q++]=ee.x,D[q++]=ee.y,D[q++]=ee.z),u.tangent||u.bitangent){var ie,re=scratchTangent$3,ne=0;if(w[r]&&(ne=X),ie=!C&&ne<=r&&r<ne+2*g?Cartesian3.UNIT_X:Cartesian3.UNIT_Z,Cartesian3.cross(ie,ee,re),Cartesian3.normalize(re,re),u.tangent&&(I[Q++]=re.x,I[Q++]=re.y,I[Q++]=re.z),u.bitangent){var ae=Cartesian3.cross(ee,re,scratchBitangent$3);Cartesian3.normalize(ae,ae),O[Y++]=ae.x,O[Y++]=ae.y,O[Y++]=ae.z}}}u.st&&(H.st=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:2,values:R})),u.normal&&(H.normal=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:D})),u.tangent&&(H.tangent=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:I})),u.bitangent&&(H.bitangent=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:O}))}if(defined(e._offsetAttribute)){var oe=S.length,se=new Uint8Array(oe/3);arrayFill(se,e._offsetAttribute===GeometryOffsetAttribute$1.NONE?0:1),H.applyOffset=new GeometryAttribute({componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE,componentsPerAttribute:1,values:se})}return new Geometry({attributes:H,indices:M,primitiveType:PrimitiveType$1.TRIANGLES,boundingSphere:BoundingSphere.fromEllipsoid(Z),offsetAttribute:e._offsetAttribute})}}},EllipsoidGeometry.getUnitEllipsoid=function(){return defined(unitEllipsoidGeometry)||(unitEllipsoidGeometry=EllipsoidGeometry.createGeometry(new EllipsoidGeometry({radii:new Cartesian3(1,1,1),vertexFormat:VertexFormat.POSITION_ONLY}))),unitEllipsoidGeometry},Object.defineProperties(EllipsoidTerrainProvider.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return!0}},readyPromise:{get:function(){return this._readyPromise}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}}}),EllipsoidTerrainProvider.prototype.requestTileGeometry=function(e,t,i,r){return when.resolve(new HeightmapTerrainData({buffer:new Uint8Array(256),width:16,height:16}))},EllipsoidTerrainProvider.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)},EllipsoidTerrainProvider.prototype.getTileDataAvailable=function(e,t,i){},EllipsoidTerrainProvider.prototype.loadTileDataAvailability=function(e,t,i){},GeocoderService.prototype.geocode=DeveloperError.throwInstantiationError;var GeocodeType={SEARCH:0,AUTOCOMPLETE:1},GeocodeType$1=Object.freeze(GeocodeType),context2DsByWidthAndHeight={};function getImagePixels(e,t,i){defined(t)||(t=e.width),defined(i)||(i=e.height);var r=context2DsByWidthAndHeight[t];defined(r)||(r={},context2DsByWidthAndHeight[t]=r);var n=r[i];if(!defined(n)){var a=document.createElement("canvas");a.width=t,a.height=i,(n=a.getContext("2d")).globalCompositeOperation="copy",r[i]=n}return n.drawImage(e,0,0,t,i),n.getImageData(0,0,t,i).data}function getMagic(e,t){return getStringFromTypedArray(e,t=defaultValue(t,0),Math.min(4,e.length))}var tmp$8={};!function(global,undefined$1){var Urs,Vrs,Wrs;Urs={1:[function(e,t,i){t.exports=function(e,t){for(var i=[],r=2;r<arguments.length;)i.push(arguments[r++]);var a=!0;return new Promise(function(r,n){i.push(function(e){if(a)if(a=!1,e)n(e);else{for(var t=[],i=1;i<arguments.length;)t.push(arguments[i++]);r.apply(null,t)}});try{e.apply(t||this,i)}catch(e){a&&(a=!1,n(e))}})}},{}],2:[function(e,t,i){var r=i;r.length=function(e){var t=e.length;if(!t)return 0;for(var i=0;1<--t%4&&"="===e.charAt(t);)++i;return Math.ceil(3*e.length)/4-i};for(var l=new Array(64),u=new Array(123),n=0;n<64;)u[l[n]=n<26?n+65:n<52?n+71:n<62?n-4:n-59|43]=n++;r.encode=function(e,t,i){for(var r,n=[],a=0,o=0;t<i;){var s=e[t++];switch(o){case 0:n[a++]=l[s>>2],r=(3&s)<<4,o=1;break;case 1:n[a++]=l[r|s>>4],r=(15&s)<<2,o=2;break;case 2:n[a++]=l[r|s>>6],n[a++]=l[63&s],o=0}}return o&&(n[a++]=l[r],n[a]=61,1===o&&(n[a+1]=61)),String.fromCharCode.apply(String,n)};var c="invalid encoding";r.decode=function(e,t,i){for(var r,n=i,a=0,o=0;o<e.length;){var s=e.charCodeAt(o++);if(61===s&&1<a)break;if((s=u[s])===undefined$1)throw Error(c);switch(a){case 0:r=s,a=1;break;case 1:t[i++]=r<<2|(48&s)>>4,r=s,a=2;break;case 2:t[i++]=(15&r)<<4|(60&s)>>2,r=s,a=3;break;case 3:t[i++]=(3&r)<<6|s,a=0}}if(1===a)throw Error(c);return i-n},r.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}},{}],3:[function(e,t,i){function r(){this._listeners={}}(t.exports=r).prototype.on=function(e,t,i){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:i||this}),this},r.prototype.off=function(e,t){if(e===undefined$1)this._listeners={};else if(t===undefined$1)this._listeners[e]=[];else for(var i=this._listeners[e],r=0;r<i.length;)i[r].fn===t?i.splice(r,1):++r;return this},r.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var i=[],r=1;r<arguments.length;)i.push(arguments[r++]);for(r=0;r<t.length;)t[r].fn.apply(t[r++].ctx,i)}return this}},{}],4:[function(require,module,exports){function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}module.exports=inquire},{}],5:[function(e,t,i){t.exports=function(i,r,e){var n=e||8192,a=n>>>1,o=null,s=n;return function(e){if(e<1||a<e)return i(e);n<s+e&&(o=i(n),s=0);var t=r.call(o,s,s+=e);return 7&s&&(s=1+(7|s)),t}}},{}],6:[function(e,t,i){var r=i;r.length=function(e){for(var t=0,i=0,r=0;r<e.length;++r)(i=e.charCodeAt(r))<128?t+=1:i<2048?t+=2:55296==(64512&i)&&56320==(64512&e.charCodeAt(r+1))?(++r,t+=4):t+=3;return t},r.read=function(e,t,i){if(i-t<1)return"";for(var r,n=null,a=[],o=0;t<i;)(r=e[t++])<128?a[o++]=r:191<r&&r<224?a[o++]=(31&r)<<6|63&e[t++]:239<r&&r<365?(r=((7&r)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,a[o++]=55296+(r>>10),a[o++]=56320+(1023&r)):a[o++]=(15&r)<<12|(63&e[t++])<<6|63&e[t++],8191<o&&((n=n||[]).push(String.fromCharCode.apply(String,a)),o=0);return n?(o&&n.push(String.fromCharCode.apply(String,a.slice(0,o))),n.join("")):String.fromCharCode.apply(String,a.slice(0,o))},r.write=function(e,t,i){for(var r,n,a=i,o=0;o<e.length;++o)(r=e.charCodeAt(o))<128?t[i++]=r:(r<2048?t[i++]=r>>6|192:(55296==(64512&r)&&56320==(64512&(n=e.charCodeAt(o+1)))?(r=65536+((1023&r)<<10)+(1023&n),++o,t[i++]=r>>18|240,t[i++]=r>>12&63|128):t[i++]=r>>12|224,t[i++]=r>>6&63|128),t[i++]=63&r|128);return i-a}},{}],7:[function(e,t,i){var r=i;function n(){r.Reader._configure(r.BufferReader),r.util._configure()}r.build="minimal",r.roots={},r.Writer=e(14),r.BufferWriter=e(15),r.Reader=e(8),r.BufferReader=e(9),r.util=e(13),r.rpc=e(10),r.configure=n,r.Writer._configure(r.BufferWriter),n()},{10:10,13:13,14:14,15:15,8:8,9:9}],8:[function(e,t,i){t.exports=l;var r,n=e(13),a=n.LongBits,o=n.utf8;function s(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function l(e){this.buf=e,this.pos=0,this.len=e.length}var u,c="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new l(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new l(e);throw Error("illegal buffer")};function d(){var e=new a(0,0),t=0;if(!(4<this.len-this.pos)){for(;t<3;++t){if(this.pos>=this.len)throw s(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,4<this.len-this.pos){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw s(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function h(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function p(){if(this.pos+8>this.len)throw s(this,8);return new a(h(this.buf,this.pos+=4),h(this.buf,this.pos+=4))}l.create=n.Buffer?function(e){return(l.create=function(e){return n.Buffer.isBuffer(e)?new r(e):c(e)})(e)}:c,l.prototype._slice=n.Array.prototype.subarray||n.Array.prototype.slice,l.prototype.uint32=(u=4294967295,function(){if(u=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return u;if((this.pos+=5)>this.len)throw this.pos=this.len,s(this,10);return u}),l.prototype.int32=function(){return 0|this.uint32()},l.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)|0},l.prototype.bool=function(){return 0!==this.uint32()},l.prototype.fixed32=function(){if(this.pos+4>this.len)throw s(this,4);return h(this.buf,this.pos+=4)},l.prototype.sfixed32=function(){if(this.pos+4>this.len)throw s(this,4);return 0|h(this.buf,this.pos+=4)};var f,m,g="undefined"!=typeof Float32Array?(f=new Float32Array(1),m=new Uint8Array(f.buffer),f[0]=-0,m[3]?function(e,t){return m[0]=e[t],m[1]=e[t+1],m[2]=e[t+2],m[3]=e[t+3],f[0]}:function(e,t){return m[0]=e[t+3],m[1]=e[t+2],m[2]=e[t+1],m[3]=e[t],f[0]}):function(e,t){var i=h(e,t+4),r=2*(i>>31)+1,n=i>>>23&255,a=8388607&i;return 255==n?a?NaN:1/0*r:0==n?1401298464324817e-60*r*a:r*Math.pow(2,n-150)*(8388608+a)};l.prototype.float=function(){if(this.pos+4>this.len)throw s(this,4);var e=g(this.buf,this.pos);return this.pos+=4,e};var y,v,_="undefined"!=typeof Float64Array?(y=new Float64Array(1),v=new Uint8Array(y.buffer),y[0]=-0,v[7]?function(e,t){return v[0]=e[t],v[1]=e[t+1],v[2]=e[t+2],v[3]=e[t+3],v[4]=e[t+4],v[5]=e[t+5],v[6]=e[t+6],v[7]=e[t+7],y[0]}:function(e,t){return v[0]=e[t+7],v[1]=e[t+6],v[2]=e[t+5],v[3]=e[t+4],v[4]=e[t+3],v[5]=e[t+2],v[6]=e[t+1],v[7]=e[t],y[0]}):function(e,t){var i=h(e,t+4),r=h(e,t+8),n=2*(r>>31)+1,a=r>>>20&2047,o=4294967296*(1048575&r)+i;return 2047==a?o?NaN:1/0*n:0==a?5e-324*n*o:n*Math.pow(2,a-1075)*(o+4503599627370496)};l.prototype.double=function(){if(this.pos+8>this.len)throw s(this,4);var e=_(this.buf,this.pos);return this.pos+=8,e},l.prototype.bytes=function(){var e=this.uint32(),t=this.pos,i=this.pos+e;if(i>this.len)throw s(this,e);return this.pos+=e,t===i?new this.buf.constructor(0):this._slice.call(this.buf,t,i)},l.prototype.string=function(){var e=this.bytes();return o.read(e,0,e.length)},l.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw s(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw s(this)}while(128&this.buf[this.pos++]);return this},l.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;;){if(4==(e=7&this.uint32()))break;this.skipType(e)}break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},l._configure=function(e){r=e;var t=n.Long?"toLong":"toNumber";n.merge(l.prototype,{int64:function(){return d.call(this)[t](!1)},uint64:function(){return d.call(this)[t](!0)},sint64:function(){return d.call(this).zzDecode()[t](!1)},fixed64:function(){return p.call(this)[t](!0)},sfixed64:function(){return p.call(this)[t](!1)}})}},{13:13}],9:[function(e,t,i){t.exports=a;var r=e(8);(a.prototype=Object.create(r.prototype)).constructor=a;var n=e(13);function a(e){r.call(this,e)}n.Buffer&&(a.prototype._slice=n.Buffer.prototype.slice),a.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len))}},{13:13,8:8}],10:[function(e,t,i){i.Service=e(11)},{11:11}],11:[function(e,t,i){t.exports=r;var s=e(13);function r(e,t,i){if("function"!=typeof e)throw TypeError("rpcImpl must be a function");s.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(i)}((r.prototype=Object.create(s.EventEmitter.prototype)).constructor=r).prototype.rpcCall=function e(i,t,r,n,a){if(!n)throw TypeError("request must be specified");var o=this;if(!a)return s.asPromise(e,o,i,t,r,n);if(!o.rpcImpl)return setTimeout(function(){a(Error("already ended"))},0),undefined$1;try{return o.rpcImpl(i,t[o.requestDelimited?"encodeDelimited":"encode"](n).finish(),function(e,t){if(e)return o.emit("error",e,i),a(e);if(null===t)return o.end(!0),undefined$1;if(!(t instanceof r))try{t=r[o.responseDelimited?"decodeDelimited":"decode"](t)}catch(e){return o.emit("error",e,i),a(e)}return o.emit("data",t,i),a(null,t)})}catch(e){return o.emit("error",e,i),setTimeout(function(){a(e)},0),undefined$1}},r.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},{13:13}],12:[function(e,t,i){t.exports=n;var r=e(13);function n(e,t){this.lo=e>>>0,this.hi=t>>>0}var a=n.zero=new n(0,0);a.toNumber=function(){return 0},a.zzEncode=a.zzDecode=function(){return this},a.length=function(){return 1};var o=n.zeroHash="\0\0\0\0\0\0\0\0";n.fromNumber=function(e){if(0===e)return a;var t=e<0;t&&(e=-e);var i=e>>>0,r=(e-i)/4294967296>>>0;return t&&(r=~r>>>0,i=~i>>>0,4294967295<++i&&(i=0,4294967295<++r&&(r=0))),new n(i,r)},n.from=function(e){if("number"==typeof e)return n.fromNumber(e);if(r.isString(e)){if(!r.Long)return n.fromNumber(parseInt(e,10));e=r.Long.fromString(e)}return e.low||e.high?new n(e.low>>>0,e.high>>>0):a},n.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,i=~this.hi>>>0;return t||(i=i+1>>>0),-(t+4294967296*i)}return this.lo+4294967296*this.hi},n.prototype.toLong=function(e){return r.Long?new r.Long(0|this.lo,0|this.hi,Boolean(e)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(e)}};var s=String.prototype.charCodeAt;n.fromHash=function(e){return e===o?a:new n((s.call(e,0)|s.call(e,1)<<8|s.call(e,2)<<16|s.call(e,3)<<24)>>>0,(s.call(e,4)|s.call(e,5)<<8|s.call(e,6)<<16|s.call(e,7)<<24)>>>0)},n.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},n.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},n.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},n.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,i=this.hi>>>24;return 0==i?0==t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:i<128?9:10}},{13:13}],13:[function(e,t,i){var r=i;function n(e,t,i){for(var r=Object.keys(t),n=0;n<r.length;++n)e[r[n]]!==undefined$1&&i||(e[r[n]]=t[r[n]]);return e}function a(e){function i(e,t){if(!(this instanceof i))return new i(e,t);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,i):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),t&&n(this,t)}return(i.prototype=Object.create(Error.prototype)).constructor=i,Object.defineProperty(i.prototype,"name",{get:function(){return e}}),i.prototype.toString=function(){return this.name+": "+this.message},i}r.asPromise=e(1),r.base64=e(2),r.EventEmitter=e(3),r.inquire=e(4),r.utf8=e(6),r.pool=e(5),r.LongBits=e(12),r.emptyArray=Object.freeze?Object.freeze([]):[],r.emptyObject=Object.freeze?Object.freeze({}):{},r.isNode=Boolean(global.process&&global.process.versions&&global.process.versions.node),r.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},r.isString=function(e){return"string"==typeof e||e instanceof String},r.isObject=function(e){return e&&"object"==typeof e},r.Buffer=function(){try{var e=r.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}}(),r._Buffer_from=null,r._Buffer_allocUnsafe=null,r.newBuffer=function(e){return"number"==typeof e?r.Buffer?r._Buffer_allocUnsafe(e):new r.Array(e):r.Buffer?r._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},r.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,r.Long=global.dcodeIO&&global.dcodeIO.Long||r.inquire("long"),r.key2Re=/^true|false|0|1$/,r.key32Re=/^-?(?:0|[1-9][0-9]*)$/,r.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,r.longToHash=function(e){return e?r.LongBits.from(e).toHash():r.LongBits.zeroHash},r.longFromHash=function(e,t){var i=r.LongBits.fromHash(e);return r.Long?r.Long.fromBits(i.lo,i.hi,t):i.toNumber(Boolean(t))},r.merge=n,r.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},r.newError=a,r.ProtocolError=a("ProtocolError"),r.oneOfGetter=function(e){for(var i={},t=0;t<e.length;++t)i[e[t]]=1;return function(){for(var e=Object.keys(this),t=e.length-1;-1<t;--t)if(1===i[e[t]]&&this[e[t]]!==undefined$1&&null!==this[e[t]])return e[t]}},r.oneOfSetter=function(i){return function(e){for(var t=0;t<i.length;++t)i[t]!==e&&delete this[i[t]]}},r.lazyResolve=function(e,t){for(var i=0;i<t.length;++i)for(var r=Object.keys(t[i]),n=0;n<r.length;++n){for(var a=t[i][r[n]].split("."),o=e;a.length;)o=o[a.shift()];t[i][r[n]]=o}},r.toJSONOptions={longs:String,enums:String,bytes:String},r._configure=function(){var i=r.Buffer;i?(r._Buffer_from=i.from!==Uint8Array.from&&i.from||function(e,t){return new i(e,t)},r._Buffer_allocUnsafe=i.allocUnsafe||function(e){return new i(e)}):r._Buffer_from=r._Buffer_allocUnsafe=null}},{1:1,12:12,2:2,3:3,4:4,5:5,6:6}],14:[function(e,t,i){t.exports=d;var r,n=e(13),a=n.LongBits,o=n.base64,s=n.utf8;function l(e,t,i){this.fn=e,this.len=t,this.next=undefined$1,this.val=i}function u(){}function c(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function d(){this.len=0,this.head=new l(u,0,0),this.tail=this.head,this.states=null}function h(e,t,i){t[i]=255&e}function p(e,t){this.len=e,this.next=undefined$1,this.val=t}function f(e,t,i){for(;e.hi;)t[i++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;127<e.lo;)t[i++]=127&e.lo|128,e.lo=e.lo>>>7;t[i++]=e.lo}function m(e,t,i){t[i++]=255&e,t[i++]=e>>>8&255,t[i++]=e>>>16&255,t[i]=e>>>24}d.create=n.Buffer?function(){return(d.create=function(){return new r})()}:function(){return new d},d.alloc=function(e){return new n.Array(e)},n.Array!==Array&&(d.alloc=n.pool(d.alloc,n.Array.prototype.subarray)),d.prototype.push=function(e,t,i){return this.tail=this.tail.next=new l(e,t,i),this.len+=t,this},(p.prototype=Object.create(l.prototype)).fn=function(e,t,i){for(;127<e;)t[i++]=127&e|128,e>>>=7;t[i]=e},d.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new p((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},d.prototype.int32=function(e){return e<0?this.push(f,10,a.fromNumber(e)):this.uint32(e)},d.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},d.prototype.int64=d.prototype.uint64=function(e){var t=a.from(e);return this.push(f,t.length(),t)},d.prototype.sint64=function(e){var t=a.from(e).zzEncode();return this.push(f,t.length(),t)},d.prototype.bool=function(e){return this.push(h,1,e?1:0)},d.prototype.sfixed32=d.prototype.fixed32=function(e){return this.push(m,4,e>>>0)},d.prototype.sfixed64=d.prototype.fixed64=function(e){var t=a.from(e);return this.push(m,4,t.lo).push(m,4,t.hi)};var g,y,v="undefined"!=typeof Float32Array?(g=new Float32Array(1),y=new Uint8Array(g.buffer),g[0]=-0,y[3]?function(e,t,i){g[0]=e,t[i++]=y[0],t[i++]=y[1],t[i++]=y[2],t[i]=y[3]}:function(e,t,i){g[0]=e,t[i++]=y[3],t[i++]=y[2],t[i++]=y[1],t[i]=y[0]}):function(e,t,i){var r=e<0?1:0;if(r&&(e=-e),0===e)m(0<1/e?0:2147483648,t,i);else if(isNaN(e))m(2147483647,t,i);else if(34028234663852886e22<e)m((r<<31|2139095040)>>>0,t,i);else if(e<11754943508222875e-54)m((r<<31|Math.round(e/1401298464324817e-60))>>>0,t,i);else{var n=Math.floor(Math.log(e)/Math.LN2);m((r<<31|n+127<<23|8388607&Math.round(e*Math.pow(2,-n)*8388608))>>>0,t,i)}};d.prototype.float=function(e){return this.push(v,4,e)};var _,C,x="undefined"!=typeof Float64Array?(_=new Float64Array(1),C=new Uint8Array(_.buffer),_[0]=-0,C[7]?function(e,t,i){_[0]=e,t[i++]=C[0],t[i++]=C[1],t[i++]=C[2],t[i++]=C[3],t[i++]=C[4],t[i++]=C[5],t[i++]=C[6],t[i]=C[7]}:function(e,t,i){_[0]=e,t[i++]=C[7],t[i++]=C[6],t[i++]=C[5],t[i++]=C[4],t[i++]=C[3],t[i++]=C[2],t[i++]=C[1],t[i]=C[0]}):function(e,t,i){var r=e<0?1:0;if(r&&(e=-e),0===e)m(0,t,i),m(0<1/e?0:2147483648,t,i+4);else if(isNaN(e))m(4294967295,t,i),m(2147483647,t,i+4);else if(17976931348623157e292<e)m(0,t,i),m((r<<31|2146435072)>>>0,t,i+4);else{var n;if(e<22250738585072014e-324)m((n=e/5e-324)>>>0,t,i),m((r<<31|n/4294967296)>>>0,t,i+4);else{var a=Math.floor(Math.log(e)/Math.LN2);1024===a&&(a=1023),m(4503599627370496*(n=e*Math.pow(2,-a))>>>0,t,i),m((r<<31|a+1023<<20|1048576*n&1048575)>>>0,t,i+4)}}};d.prototype.double=function(e){return this.push(x,8,e)};var b=n.Array.prototype.set?function(e,t,i){t.set(e,i)}:function(e,t,i){for(var r=0;r<e.length;++r)t[i+r]=e[r]};d.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this.push(h,1,0);if(n.isString(e)){var i=d.alloc(t=o.length(e));o.decode(e,i,0),e=i}return this.uint32(t).push(b,t,e)},d.prototype.string=function(e){var t=s.length(e);return t?this.uint32(t).push(s.write,t,e):this.push(h,1,0)},d.prototype.fork=function(){return this.states=new c(this),this.head=this.tail=new l(u,0,0),this.len=0,this},d.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new l(u,0,0),this.len=0),this},d.prototype.ldelim=function(){var e=this.head,t=this.tail,i=this.len;return this.reset().uint32(i),i&&(this.tail.next=e.next,this.tail=t,this.len+=i),this},d.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),i=0;e;)e.fn(e.val,t,i),i+=e.len,e=e.next;return t},d._configure=function(e){r=e}},{13:13}],15:[function(e,t,i){t.exports=o;var r=e(14);(o.prototype=Object.create(r.prototype)).constructor=o;var n=e(13),a=n.Buffer;function o(){r.call(this)}o.alloc=function(e){return(o.alloc=n._Buffer_allocUnsafe)(e)};var s=a&&a.prototype instanceof Uint8Array&&"set"===a.prototype.set.name?function(e,t,i){t.set(e,i)}:function(e,t,i){if(e.copy)e.copy(t,i,0,e.length);else for(var r=0;r<e.length;)t[i++]=e[r++]};function l(e,t,i){e.length<40?n.utf8.write(e,t,i):t.utf8Write(e,i)}o.prototype.bytes=function(e){n.isString(e)&&(e=n._Buffer_from(e,"base64"));var t=e.length>>>0;return this.uint32(t),t&&this.push(s,t,e),this},o.prototype.string=function(e){var t=a.byteLength(e);return this.uint32(t),t&&this.push(l,t,e),this}},{13:13,14:14}]},Vrs={},Wrs=[7],global.protobuf=function e(t){var i=Vrs[t];return i||Urs[t][0].call(i=Vrs[t]={exports:{}},e,i,i.exports),i.exports}(Wrs[0])}(tmp$8);var protobuf=tmp$8.protobuf;function isBitSet(e,t){return 0!=(e&t)}var childrenBitmasks=[1,2,4,8],anyChildBitmask=15,cacheFlagBitmask=16,imageBitmask=64,terrainBitmask=128;function GoogleEarthEnterpriseTileInformation(e,t,i,r,n,a){this._bits=e,this.cnodeVersion=t,this.imageryVersion=i,this.terrainVersion=r,this.imageryProvider=n,this.terrainProvider=a,this.ancestorHasTerrain=!1,this.terrainState=void 0}function stringToBuffer(e){for(var t=e.length,i=new ArrayBuffer(t),r=new Uint8Array(i),n=0;n<t;++n)r[n]=e.charCodeAt(n);return i}GoogleEarthEnterpriseTileInformation.clone=function(e,t){return defined(t)?(t._bits=e._bits,t.cnodeVersion=e.cnodeVersion,t.imageryVersion=e.imageryVersion,t.terrainVersion=e.terrainVersion,t.imageryProvider=e.imageryProvider,t.terrainProvider=e.terrainProvider):t=new GoogleEarthEnterpriseTileInformation(e._bits,e.cnodeVersion,e.imageryVersion,e.terrainVersion,e.imageryProvider,e.terrainProvider),t.ancestorHasTerrain=e.ancestorHasTerrain,t.terrainState=e.terrainState,t},GoogleEarthEnterpriseTileInformation.prototype.setParent=function(e){this.ancestorHasTerrain=e.ancestorHasTerrain||this.hasTerrain()},GoogleEarthEnterpriseTileInformation.prototype.hasSubtree=function(){return isBitSet(this._bits,cacheFlagBitmask)},GoogleEarthEnterpriseTileInformation.prototype.hasImagery=function(){return isBitSet(this._bits,imageBitmask)},GoogleEarthEnterpriseTileInformation.prototype.hasTerrain=function(){return isBitSet(this._bits,terrainBitmask)},GoogleEarthEnterpriseTileInformation.prototype.hasChildren=function(){return isBitSet(this._bits,anyChildBitmask)},GoogleEarthEnterpriseTileInformation.prototype.hasChild=function(e){return isBitSet(this._bits,childrenBitmasks[e])},GoogleEarthEnterpriseTileInformation.prototype.getChildBitmask=function(){return this._bits&anyChildBitmask};var defaultKey=stringToBuffer('Eô½\vyâjE"’,ÍqøIFgQ\0B%Æèa,f)\bÆ4Üjb%y\nwmiÖðœk“¡½NuàA[ß@V\fÙ»r›|3SîOlÔq°{ÀEVZ­wUe\v3’*¬l5Å0sø3>mF8J´Ýð.ÝuڌDt"úa"\f3"So¯9D\vŒ9Ù9L¹¿«\\ŒP_Ÿ"uxéq‘h;Áěð<VqH‚\'UfYNe˜u£aF}a?A\0Ÿ×´4M·F°Õ¸Š\'{‹Ü+»Mg0ÈÑö\\Pú[/F›n5/\'C.ë\n\f^¥se4ål.jC\'c#U©?q{gC}:¯ÍâTUœýKÆâŸ/(íË\\Æ-fˆ§;/*"N°k.Ý\r•}}GºC²²+>Mª>}æÎI‰Ææx\fa1-¤O¥~q ˆì\r1èN\v\0nPh}=\b\r•¦n£h—$[kó#ó¶s³\r\v@ÀŸØQ]ú".jßI\0¹ wUÆïj¿{GLƒîÜÜF…©­S+S4ÿ”Yä8è1ƒN¹XFkË-#†’p\x005ˆ"Ï1²&/çÃu-6,rt°#G·ÓÑ&…7râ\0ŒDÏÚ3-Þ`†i#i*|ÍKQ\r•T9w.)ê¦P¢joP™\\>TûïP[\vE‰m(w7ێJfJo™ åpâ¹q~\fmI-zþrÇòY0»]såÉ êxì ðŠB|G`°½&·q¶ÇŸÑ3‚=Ó«îc™È+S D\\qÆÌD2O<ÊÀ)=RÓaX©}e´ÜÏ\rô=ñ\b©BÚ#\tØ¿^PIøMÀËGLO÷{+ØÅ1’;µoÜl\r’ˆўÛ?âéÚ_ԄâFaZÞUϤ\0¾ýÎgñJi—æ HØ]~®q N®ÀV©‘<‚rçvì)IÖ]-ƒãÛ6©;f—‡jÕ¶=P^R¹KÇsWxÉô.Y•“oÐKW>\'\'Ç`Û;íšSD>?’mw¢\në?R¨ÆU^1I7…ôÅ&-©¿‹\'TÚÃj å*x°Öprª‹h½ˆ÷_H±~ÀXL?fù>áeÀp§Ï8i¯ðVldIœ\'­xtO‡ÞV9\0Úw\vË-‰û5Oõ\bQ`Á\nZGM&30xÚÀœFGâ[y`In7gS\n>éìF9²ñ4\rƄSuná\fYÙÞ)…{II¥wy¾IV.6ç\v:»Ob{ÒM1•/½8{¨O!áìFpv•})"xˆ\nÝ\\ÚÞQÏðüYRe|3ßóHÚ»*uÛ`²Ôüíì5¨ÿ(1-È܈F|Š["');function GoogleEarthEnterpriseMetadata(e){var t=e;"string"==typeof t||t instanceof Resource||(t=e.url);var i=Resource.createIfNeeded(t);i.appendForwardSlash(),this._resource=i,this.imageryPresent=!0,this.protoImagery=void 0,this.terrainPresent=!0,this.negativeAltitudeExponentBias=32,this.negativeAltitudeThreshold=CesiumMath.EPSILON12,this.providers={},this.key=void 0,this._quadPacketVersion=1,this._tileInfo={},this._subtreePromises={};var r=this;this._readyPromise=requestDbRoot(this).then(function(){return r.getQuadTreePacket("",r._quadPacketVersion)}).then(function(){return!0}).otherwise(function(e){var t="An error occurred while accessing "+getMetadataResource(r,"",1).url+".";return when.reject(new RuntimeError(t))})}Object.defineProperties(GoogleEarthEnterpriseMetadata.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},resource:{get:function(){return this._resource}},readyPromise:{get:function(){return this._readyPromise}}}),GoogleEarthEnterpriseMetadata.tileXYToQuadKey=function(e,t,i){for(var r="",n=i;0<=n;--n){var a=1<<n,o=0;isBitSet(t,a)?isBitSet(e,a)&&(o|=1):(o|=2,isBitSet(e,a)||(o|=1)),r+=o}return r},GoogleEarthEnterpriseMetadata.quadKeyToTileXY=function(e){for(var t=0,i=0,r=e.length-1,n=r;0<=n;--n){var a=1<<n,o=+e[r-n];isBitSet(o,2)?isBitSet(o,1)||(t|=a):(i|=a,isBitSet(o,1)&&(t|=a))}return{x:t,y:i,level:r}},GoogleEarthEnterpriseMetadata.prototype.isValid=function(e){var t=this.getTileInformationFromQuadKey(e);if(defined(t))return null!==t;for(var i,r=!0,n=e;1<n.length;){if(i=n.substring(n.length-1),n=n.substring(0,n.length-1),defined(t=this.getTileInformationFromQuadKey(n))){t.hasSubtree()||t.hasChild(parseInt(i))||(r=!1);break}if(null===t){r=!1;break}}return r};var taskProcessor$1=new TaskProcessor("decodeGoogleEarthEnterprisePacket",Number.POSITIVE_INFINITY),dbrootParser,dbrootParserPromise;function populateSubtree(e,t,i){var r,n=e._tileInfo,a=t,o=n[a];if(defined(o)&&(!o.hasSubtree()||o.hasChildren()))return o;for(;void 0===o&&1<a.length;)o=n[a=a.substring(0,a.length-1)];var s=e._subtreePromises,l=s[a];return defined(l)?l.then(function(){return r=new Request({throttle:i.throttle,throttleByServer:i.throttleByServer,type:i.type,priorityFunction:i.priorityFunction}),populateSubtree(e,t,r)}):defined(o)&&o.hasSubtree()?defined(l=e.getQuadTreePacket(a,o.cnodeVersion,i))?(s[a]=l).then(function(){return r=new Request({throttle:i.throttle,throttleByServer:i.throttleByServer,type:i.type,priorityFunction:i.priorityFunction}),populateSubtree(e,t,r)}).always(function(){delete s[a]}):void 0:when.reject(new RuntimeError("Couldn't load metadata for tile "+t))}function getMetadataResource(e,t,i,r){return e._resource.getDerivedResource({url:"flatfile?q2-0"+t+"-q."+i.toString(),request:r})}function requestDbRoot(u){var e=u._resource.getDerivedResource({url:"dbRoot.v5",queryParameters:{output:"proto"}});if(!defined(dbrootParserPromise)){var t=buildModuleUrl("ThirdParty/google-earth-dbroot-parser.js"),i=window.cesiumGoogleEarthDbRootParser;dbrootParserPromise=loadAndExecuteScript(t).then(function(){dbrootParser=window.cesiumGoogleEarthDbRootParser(protobuf),defined(i)?window.cesiumGoogleEarthDbRootParser=i:delete window.cesiumGoogleEarthDbRootParser})}return dbrootParserPromise.then(function(){return e.fetchArrayBuffer()}).then(function(e){var t=dbrootParser.EncryptedDbRootProto.decode(new Uint8Array(e)),i=t.encryptionData,r=i.byteOffset,n=r+i.byteLength,a=u.key=i.buffer.slice(r,n);n=(r=(i=t.dbrootData).byteOffset)+i.byteLength;var o=i.buffer.slice(r,n);return taskProcessor$1.scheduleTask({buffer:o,type:"DbRoot",key:a},[o])}).then(function(e){var t=dbrootParser.DbRootProto.decode(new Uint8Array(e.buffer));if(u.imageryPresent=defaultValue(t.imageryPresent,u.imageryPresent),u.protoImagery=t.protoImagery,u.terrainPresent=defaultValue(t.terrainPresent,u.terrainPresent),defined(t.endSnippet)&&defined(t.endSnippet.model)){var i=t.endSnippet.model;u.negativeAltitudeExponentBias=defaultValue(i.negativeAltitudeExponentBias,u.negativeAltitudeExponentBias),u.negativeAltitudeThreshold=defaultValue(i.compressedNegativeAltitudeThreshold,u.negativeAltitudeThreshold)}defined(t.databaseVersion)&&(u._quadPacketVersion=defaultValue(t.databaseVersion.quadtreeVersion,u._quadPacketVersion));for(var r=u.providers,n=defaultValue(t.providerInfo,[]),a=n.length,o=0;o<a;++o){var s=n[o],l=s.copyrightString;defined(l)&&(r[s.providerId]=new Credit(l.value))}}).otherwise(function(){console.log("Failed to retrieve "+e.url+". Using defaults."),u.key=defaultKey})}function GoogleEarthEnterpriseTerrainData(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this._buffer=e.buffer,this._credits=e.credits,this._negativeAltitudeExponentBias=e.negativeAltitudeExponentBias,this._negativeElevationThreshold=e.negativeElevationThreshold;var t=defaultValue(e.childTileMask,15),i=3&t;i|=4&t?8:0,i|=8&t?4:0,this._childTileMask=i,this._createdByUpsampling=defaultValue(e.createdByUpsampling,!1),this._skirtHeight=void 0,this._bufferType=this._buffer.constructor,this._mesh=void 0,this._minimumHeight=void 0,this._maximumHeight=void 0}GoogleEarthEnterpriseMetadata.prototype.getQuadTreePacket=function(d,e,t){e=defaultValue(e,1);var i=getMetadataResource(this,d=defaultValue(d,""),e,t).fetchArrayBuffer();if(defined(i)){var h=this._tileInfo,r=this.key;return i.then(function(e){return taskProcessor$1.scheduleTask({buffer:e,quadKey:d,type:"Metadata",key:r},[e]).then(function(e){var t,i=-1;if(""!==d){i=d.length+1;var r=e[d];(t=h[d])._bits|=r._bits,delete e[d]}var n=Object.keys(e);n.sort(function(e,t){return e.length-t.length});for(var a=n.length,o=0;o<a;++o){var s=n[o];if(null!==e[s]){var l=GoogleEarthEnterpriseTileInformation.clone(e[s]),u=s.length;if(u===i)l.setParent(t);else if(1<u){var c=h[s.substring(0,s.length-1)];l.setParent(c)}h[s]=l}else h[s]=null}})})}},GoogleEarthEnterpriseMetadata.prototype.populateSubtree=function(e,t,i,r){return populateSubtree(this,GoogleEarthEnterpriseMetadata.tileXYToQuadKey(e,t,i),r)},GoogleEarthEnterpriseMetadata.prototype.getTileInformation=function(e,t,i){var r=GoogleEarthEnterpriseMetadata.tileXYToQuadKey(e,t,i);return this._tileInfo[r]},GoogleEarthEnterpriseMetadata.prototype.getTileInformationFromQuadKey=function(e){return this._tileInfo[e]},Object.defineProperties(GoogleEarthEnterpriseTerrainData.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){}}});var taskProcessor$2=new TaskProcessor("createVerticesFromGoogleEarthEnterpriseBuffer"),nativeRectangleScratch=new Rectangle,rectangleScratch$1=new Rectangle;GoogleEarthEnterpriseTerrainData.prototype.createMesh=function(e,t,i,r,n){var a=e.ellipsoid;e.tileXYToNativeRectangle(t,i,r,nativeRectangleScratch),e.tileXYToRectangle(t,i,r,rectangleScratch$1),n=defaultValue(n,1);var o=a.cartographicToCartesian(Rectangle.center(rectangleScratch$1)),s=40075.16/(1<<r);ExpandByTerra.underEarth.enable?this._skirtHeight=0:this._skirtHeight=Math.min(8*s,1e3);var l=taskProcessor$2.scheduleTask({buffer:this._buffer,nativeRectangle:nativeRectangleScratch,rectangle:rectangleScratch$1,relativeToCenter:o,ellipsoid:a,skirtHeight:this._skirtHeight,exaggeration:n,includeWebMercatorT:!0,negativeAltitudeExponentBias:this._negativeAltitudeExponentBias,negativeElevationThreshold:this._negativeElevationThreshold});if(defined(l)){var u=this;return l.then(function(e){return u._mesh=new TerrainMesh(o,new Float32Array(e.vertices),new Uint16Array(e.indices),e.indexCountWithoutSkirts,e.vertexCountWithoutSkirts,e.minimumHeight,e.maximumHeight,BoundingSphere.clone(e.boundingSphere3D),Cartesian3.clone(e.occludeePointInScaledSpace),e.numberOfAttributes,OrientedBoundingBox.clone(e.orientedBoundingBox),TerrainEncoding.clone(e.encoding),n,e.westIndicesSouthToNorth,e.southIndicesEastToWest,e.eastIndicesNorthToSouth,e.northIndicesWestToEast),u._minimumHeight=e.minimumHeight,u._maximumHeight=e.maximumHeight,u._buffer=void 0,u._mesh})}},GoogleEarthEnterpriseTerrainData.prototype.interpolateHeight=function(e,t,i){var r=CesiumMath.clamp((t-e.west)/e.width,0,1),n=CesiumMath.clamp((i-e.south)/e.height,0,1);return defined(this._mesh)?interpolateMeshHeight$2(this,r,n):interpolateHeight$2(this,r,n,e)};var upsampleTaskProcessor$1=new TaskProcessor("upsampleQuantizedTerrainMesh");GoogleEarthEnterpriseTerrainData.prototype.upsample=function(e,t,i,r,n,a,o){var s=this._mesh;if(defined(this._mesh)){var l=2*t!==n,u=2*i===a,c=e.ellipsoid,d=e.tileXYToRectangle(n,a,o),h=upsampleTaskProcessor$1.scheduleTask({vertices:s.vertices,indices:s.indices,indexCountWithoutSkirts:s.indexCountWithoutSkirts,vertexCountWithoutSkirts:s.vertexCountWithoutSkirts,encoding:s.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:l,isNorthChild:u,childRectangle:d,ellipsoid:c,exaggeration:s.exaggeration});if(defined(h)){var p=this;return h.then(function(e){var t=new Uint16Array(e.vertices),i=IndexDatatype$1.createTypedArray(t.length/3,e.indices),r=p._skirtHeight;return new QuantizedMeshTerrainData({quantizedVertices:t,indices:i,minimumHeight:e.minimumHeight,maximumHeight:e.maximumHeight,boundingSphere:BoundingSphere.clone(e.boundingSphere),orientedBoundingBox:OrientedBoundingBox.clone(e.orientedBoundingBox),horizonOcclusionPoint:Cartesian3.clone(e.horizonOcclusionPoint),westIndices:e.westIndices,southIndices:e.southIndices,eastIndices:e.eastIndices,northIndices:e.northIndices,westSkirtHeight:r,southSkirtHeight:r,eastSkirtHeight:r,northSkirtHeight:r,childTileMask:0,createdByUpsampling:!0,credits:p._credits})})}}},GoogleEarthEnterpriseTerrainData.prototype.isChildAvailable=function(e,t,i,r){var n=2;return i!==2*e&&++n,r!==2*t&&(n-=2),0!=(this._childTileMask&1<<n)},GoogleEarthEnterpriseTerrainData.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var texCoordScratch0$1=new Cartesian2,texCoordScratch1$1=new Cartesian2,texCoordScratch2$1=new Cartesian2,barycentricCoordinateScratch$1=new Cartesian3;function interpolateMeshHeight$2(e,t,i){for(var r=e._mesh,n=r.vertices,a=r.encoding,o=r.indices,s=0,l=o.length;s<l;s+=3){var u=o[s],c=o[s+1],d=o[s+2],h=a.decodeTextureCoordinates(n,u,texCoordScratch0$1),p=a.decodeTextureCoordinates(n,c,texCoordScratch1$1),f=a.decodeTextureCoordinates(n,d,texCoordScratch2$1),m=Intersections2D.computeBarycentricCoordinates(t,i,h.x,h.y,p.x,p.y,f.x,f.y,barycentricCoordinateScratch$1);if(-1e-15<=m.x&&-1e-15<=m.y&&-1e-15<=m.z){var g=a.decodeHeight(n,u),y=a.decodeHeight(n,c),v=a.decodeHeight(n,d);return m.x*g+m.y*y+m.z*v}}}var sizeOfUint16=Uint16Array.BYTES_PER_ELEMENT,sizeOfUint32$2=Uint32Array.BYTES_PER_ELEMENT,sizeOfInt32=Int32Array.BYTES_PER_ELEMENT,sizeOfFloat=Float32Array.BYTES_PER_ELEMENT,sizeOfDouble=Float64Array.BYTES_PER_ELEMENT;function interpolateHeight$2(e,t,i,r){var n=e._buffer,a=0,o=0,s=0;.5<i?(.5<t?(a=2,o=.5):a=3,s=.5):.5<t&&(a=1,o=.5);for(var l=new DataView(n),u=0,c=0;c<a;++c)u+=l.getUint32(u,!0),u+=sizeOfUint32$2;u+=sizeOfUint32$2,u+=2*sizeOfDouble;var d=CesiumMath.toRadians(180*l.getFloat64(u,!0));u+=sizeOfDouble;var h=CesiumMath.toRadians(180*l.getFloat64(u,!0));u+=sizeOfDouble;var p=r.width/d/2,f=r.height/h/2,m=l.getInt32(u,!0);u+=sizeOfInt32;var g=3*l.getInt32(u,!0);u+=sizeOfInt32,u+=sizeOfInt32;var y,v=new Array(m),_=new Array(m),C=new Array(m);for(y=0;y<m;++y)v[y]=o+l.getUint8(u++)*p,_[y]=s+l.getUint8(u++)*f,C[y]=6371010*l.getFloat32(u,!0),u+=sizeOfFloat;var x=new Array(g);for(y=0;y<g;++y)x[y]=l.getUint16(u,!0),u+=sizeOfUint16;for(y=0;y<g;y+=3){var b=x[y],A=x[y+1],S=x[y+2],w=v[b],E=v[A],T=v[S],P=_[b],M=_[A],D=_[S],I=Intersections2D.computeBarycentricCoordinates(t,i,w,P,E,M,T,D,barycentricCoordinateScratch$1);if(-1e-15<=I.x&&-1e-15<=I.y&&-1e-15<=I.z)return I.x*C[b]+I.y*C[A]+I.z*C[S]}}var TerrainState={UNKNOWN:0,NONE:1,SELF:2,PARENT:3},julianDateScratch$1=new JulianDate;function TerrainCache(){this._terrainCache={},this._lastTidy=JulianDate.now()}function GoogleEarthEnterpriseTerrainProvider(e){var i;if(defined((e=defaultValue(e,defaultValue.EMPTY_OBJECT)).metadata))i=e.metadata;else{var t=Resource.createIfNeeded(e.url);i=new GoogleEarthEnterpriseMetadata(t)}this._metadata=i,this._tilingScheme=new GeographicTilingScheme({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new Rectangle(-CesiumMath.PI,-CesiumMath.PI,CesiumMath.PI,CesiumMath.PI),ellipsoid:e.ellipsoid});var r=e.credit;"string"==typeof r&&(r=new Credit(r)),this._credit=r,this._levelZeroMaximumGeometricError=40075.16,this._terrainCache=new TerrainCache,this._terrainPromises={},this._terrainRequests={},this._errorEvent=new Event,this._ready=!1;var n,a=this;this._readyPromise=i.readyPromise.then(function(e){if(i.terrainPresent)return TileProviderError.handleSuccess(n),a._ready=e;var t=new RuntimeError("The server "+i.url+" doesn't have terrain");return n=TileProviderError.handleError(n,a,a._errorEvent,t.message,void 0,void 0,void 0,t),when.reject(t)}).otherwise(function(e){return n=TileProviderError.handleError(n,a,a._errorEvent,e.message,void 0,void 0,void 0,e),when.reject(e)})}TerrainCache.prototype.add=function(e,t){this._terrainCache[e]={buffer:t,timestamp:JulianDate.now()}},TerrainCache.prototype.get=function(e){var t=this._terrainCache[e];if(defined(t))return delete this._terrainCache[e],t.buffer},TerrainCache.prototype.tidy=function(){if(JulianDate.now(julianDateScratch$1),10<JulianDate.secondsDifference(julianDateScratch$1,this._lastTidy)){for(var e=this._terrainCache,t=Object.keys(e),i=t.length,r=0;r<i;++r){var n=t[r],a=e[n];10<JulianDate.secondsDifference(julianDateScratch$1,a.timestamp)&&delete e[n]}JulianDate.clone(julianDateScratch$1,this._lastTidy)}},Object.defineProperties(GoogleEarthEnterpriseTerrainProvider.prototype,{url:{get:function(){return this._metadata.url}},proxy:{get:function(){return this._metadata.proxy}},tilingScheme:{get:function(){return this._tilingScheme}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){return this._credit}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});var taskProcessor$3=new TaskProcessor("decodeGoogleEarthEnterprisePacket",Number.POSITIVE_INFINITY);function computeChildMask(e,t,i){var r=t.getChildBitmask();if(t.terrainState===TerrainState.PARENT)for(var n=r=0;n<4;++n){var a=i.getTileInformationFromQuadKey(e+n.toString());defined(a)&&a.hasTerrain()&&(r|=1<<n)}return r}function buildTerrainResource(e,t,i,r){return i=defined(i)&&0<i?i:1,e._metadata.resource.getDerivedResource({url:"flatfile?f1c-0"+t+"-t."+i.toString(),request:r})}GoogleEarthEnterpriseTerrainProvider.prototype.requestTileGeometry=function(e,t,i,r){var n=GoogleEarthEnterpriseMetadata.tileXYToQuadKey(e,t,i),s=this._terrainCache,l=this._metadata,a=l.getTileInformationFromQuadKey(n);if(!defined(a))return when.reject(new RuntimeError("Terrain tile doesn't exist"));var o=a.terrainState;defined(o)||(o=a.terrainState=TerrainState.UNKNOWN);var u,c=s.get(n);if(defined(c)){var d=l.providers[a.terrainProvider];return when.resolve(new GoogleEarthEnterpriseTerrainData({buffer:c,childTileMask:computeChildMask(n,a,l),credits:defined(d)?[d]:void 0,negativeAltitudeExponentBias:l.negativeAltitudeExponentBias,negativeElevationThreshold:l.negativeAltitudeThreshold}))}if(s.tidy(),!a.ancestorHasTerrain)return when.resolve(new HeightmapTerrainData({buffer:new Uint8Array(256),width:16,height:16}));if(o===TerrainState.NONE)return when.reject(new RuntimeError("Terrain tile doesn't exist"));var h=n,p=-1;switch(o){case TerrainState.SELF:p=a.terrainVersion;break;case TerrainState.PARENT:h=h.substring(0,h.length-1),p=(u=l.getTileInformationFromQuadKey(h)).terrainVersion;break;case TerrainState.UNKNOWN:a.hasTerrain()?p=a.terrainVersion:(h=h.substring(0,h.length-1),defined(u=l.getTileInformationFromQuadKey(h))&&u.hasTerrain()&&(p=u.terrainVersion))}if(p<0)return when.reject(new RuntimeError("Terrain tile doesn't exist"));var f,m,g=this._terrainPromises,y=this._terrainRequests;if(defined(g[h]))f=g[h],m=y[h];else{var v=buildTerrainResource(this,h,p,m=r).fetchArrayBuffer();if(!defined(v))return;f=v.then(function(e){return defined(e)?taskProcessor$3.scheduleTask({buffer:e,type:"Terrain",key:l.key},[e]).then(function(e){var t=l.getTileInformationFromQuadKey(h);t.terrainState=TerrainState.SELF,s.add(h,e[0]);for(var i=t.terrainProvider,r=e.length-1,n=0;n<r;++n){var a=h+n.toString(),o=l.getTileInformationFromQuadKey(a);defined(o)&&(s.add(a,e[n+1]),o.terrainState=TerrainState.PARENT,0===o.terrainProvider&&(o.terrainProvider=i))}}):when.reject(new RuntimeError("Failed to load terrain."))}),g[h]=f,y[h]=m,f=f.always(function(){delete g[h],delete y[h]})}return f.then(function(){var e=s.get(n);if(defined(e)){var t=l.providers[a.terrainProvider];return new GoogleEarthEnterpriseTerrainData({buffer:e,childTileMask:computeChildMask(n,a,l),credits:defined(t)?[t]:void 0,negativeAltitudeExponentBias:l.negativeAltitudeExponentBias,negativeElevationThreshold:l.negativeAltitudeThreshold})}return when.reject(new RuntimeError("Failed to load terrain."))}).otherwise(function(e){return m.state===RequestState$1.CANCELLED?r.state=m.state:a.terrainState=TerrainState.NONE,when.reject(e)})},GoogleEarthEnterpriseTerrainProvider.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)},GoogleEarthEnterpriseTerrainProvider.prototype.getTileDataAvailable=function(e,t,i){var r=this._metadata,n=GoogleEarthEnterpriseMetadata.tileXYToQuadKey(e,t,i),a=r.getTileInformation(e,t,i);if(null===a)return!1;if(defined(a)){if(!a.ancestorHasTerrain)return!0;var o=a.terrainState;if(o===TerrainState.NONE)return!1;if(!(defined(o)&&o!==TerrainState.UNKNOWN||(a.terrainState=TerrainState.UNKNOWN,a.hasTerrain()))){n=n.substring(0,n.length-1);var s=r.getTileInformationFromQuadKey(n);if(!defined(s)||!s.hasTerrain())return!1}return!0}if(r.isValid(n)){var l=new Request({throttle:!0,throttleByServer:!0,type:RequestType$1.TERRAIN});r.populateSubtree(e,t,i,l)}return!1},GoogleEarthEnterpriseTerrainProvider.prototype.loadTileDataAvailability=function(e,t,i){};var factorial=CesiumMath.factorial;function calculateCoefficientTerm(e,t,i,r,n,a){var o,s,l,u=0;if(0<r){for(s=0;s<n;s++){for(o=!1,l=0;l<a.length&&!o;l++)s===a[l]&&(o=!0);o||(a.push(s),u+=calculateCoefficientTerm(e,t,i,r-1,n,a),a.splice(a.length-1,1))}return u}for(u=1,s=0;s<n;s++){for(o=!1,l=0;l<a.length&&!o;l++)s===a[l]&&(o=!0);o||(u*=e-i[t[s]])}return u}var HermitePolynomialApproximation={type:"Hermite",getRequiredDataPoints:function(e,t){return t=defaultValue(t,0),Math.max(Math.floor((e+1)/(t+1)),2)},interpolateOrderZero:function(e,t,i,r,n){var a,o,s,l,u;defined(n)||(n=new Array(r));var c=t.length,d=new Array(r);for(a=0;a<r;a++){n[a]=0;var h=new Array(c);for(d[a]=h,o=0;o<c;o++)h[o]=[]}var p=c,f=new Array(p);for(a=0;a<p;a++)f[a]=a;var m=c-1;for(l=0;l<r;l++){for(o=0;o<p;o++)u=f[o]*r+l,d[l][0].push(i[u]);for(a=1;a<p;a++){var g=!1;for(o=0;o<p-a;o++){var y,v=t[f[o]],_=t[f[o+a]];_-v<=0?(y=i[u=f[o]*r+r*a+l],d[l][a].push(y/factorial(a))):(y=d[l][a-1][o+1]-d[l][a-1][o],d[l][a].push(y/(_-v))),g=g||0!==y}g||(m=a-1)}}for(s=0;s<=0;s++)for(a=s;a<=m;a++){var C=calculateCoefficientTerm(e,f,t,s,a,[]);for(l=0;l<r;l++){var x=d[l][a][0];n[l+s*r]+=x*C}}return n}},arrayScratch$1=[];function fillCoefficientList(e,t,i,r,n,a){for(var o,s,l=-1,u=t.length,c=u*(u+1)/2,d=0;d<n;d++){var h=Math.floor(d*c);for(o=0;o<u;o++)s=t[o]*n*(a+1)+d,e[h+o]=r[s];for(var p=1;p<u;p++){var f=0,m=Math.floor(p*(1-p)/2)+u*p,g=!1;for(o=0;o<u-p;o++){var y,v,_=i[t[o]],C=i[t[o+p]];if(C-_<=0)v=(y=r[s=t[o]*n*(a+1)+n*p+d])/CesiumMath.factorial(p),e[h+m+f]=v,f++;else{var x=Math.floor((p-1)*(2-p)/2)+u*(p-1);v=(y=e[h+x+o+1]-e[h+x+o])/(C-_),e[h+m+f]=v,f++}g=g||0!==y}g&&(l=Math.max(l,p))}}return l}function IauOrientationParameters(e,t,i,r){this.rightAscension=e,this.declination=t,this.rotation=i,this.rotationRate=r}HermitePolynomialApproximation.interpolate=function(e,t,i,r,n,a,o){var s=r*(a+1);defined(o)||(o=new Array(s));for(var l=0;l<s;l++)o[l]=0;var u,c=t.length,d=new Array(c*(n+1));for(u=0;u<c;u++)for(var h=0;h<n+1;h++)d[u*(n+1)+h]=u;for(var p=d.length,f=arrayScratch$1,m=fillCoefficientList(f,d,t,i,r,n),g=[],y=p*(p+1)/2,v=Math.min(m,a),_=0;_<=v;_++)for(u=_;u<=m;u++){g.length=0;for(var C=calculateCoefficientTerm(e,d,t,_,u,g),x=Math.floor(u*(1-u)/2)+p*u,b=0;b<r;b++){var A=f[Math.floor(b*y)+x];o[b+_*r]+=A*C}}return o};var Iau2000Orientation={},TdtMinusTai=32.184,J2000d=2451545,c1=-.0529921,c2=-.1059842,c3$1=13.0120009,c4=13.3407154,c5=.9856003,c6=26.4057084,c7=13.064993,c8=.3287146,c9=1.7484877,c10=-.1589763,c11=.0036096,c12=.1643573,c13=12.9590088,dateTT=new JulianDate;function IauOrientationAxes(e){defined(e)&&"function"==typeof e||(e=Iau2000Orientation.ComputeMoon),this._computeFunction=e}Iau2000Orientation.ComputeMoon=function(e,t){defined(e)||(e=JulianDate.now()),dateTT=JulianDate.addSeconds(e,TdtMinusTai,dateTT);var i=JulianDate.totalDays(dateTT)-J2000d,r=i/TimeConstants$1.DAYS_PER_JULIAN_CENTURY,n=(125.045+c1*i)*CesiumMath.RADIANS_PER_DEGREE,a=(250.089+c2*i)*CesiumMath.RADIANS_PER_DEGREE,o=(260.008+c3$1*i)*CesiumMath.RADIANS_PER_DEGREE,s=(176.625+c4*i)*CesiumMath.RADIANS_PER_DEGREE,l=(357.529+c5*i)*CesiumMath.RADIANS_PER_DEGREE,u=(311.589+c6*i)*CesiumMath.RADIANS_PER_DEGREE,c=(134.963+c7*i)*CesiumMath.RADIANS_PER_DEGREE,d=(276.617+c8*i)*CesiumMath.RADIANS_PER_DEGREE,h=(34.226+c9*i)*CesiumMath.RADIANS_PER_DEGREE,p=(15.134+c10*i)*CesiumMath.RADIANS_PER_DEGREE,f=(119.743+c11*i)*CesiumMath.RADIANS_PER_DEGREE,m=(239.961+c12*i)*CesiumMath.RADIANS_PER_DEGREE,g=(25.053+c13*i)*CesiumMath.RADIANS_PER_DEGREE,y=Math.sin(n),v=Math.sin(a),_=Math.sin(o),C=Math.sin(s),x=Math.sin(l),b=Math.sin(u),A=Math.sin(c),S=Math.sin(d),w=Math.sin(h),E=Math.sin(p),T=Math.sin(f),P=Math.sin(m),M=Math.sin(g),D=Math.cos(n),I=Math.cos(a),O=Math.cos(o),R=Math.cos(s),L=Math.cos(l),N=Math.cos(u),k=Math.cos(c),B=Math.cos(d),F=Math.cos(h),V=Math.cos(p),z=Math.cos(f),U=Math.cos(m),G=Math.cos(g),$=(269.9949+.0031*r-3.8787*y-.1204*v+.07*_-.0172*C+.0072*b-.0052*E+.0043*M)*CesiumMath.RADIANS_PER_DEGREE,H=(66.5392+.013*r+1.5419*D+.0239*I-.0278*O+.0068*R-.0029*N+9e-4*k+8e-4*V-9e-4*G)*CesiumMath.RADIANS_PER_DEGREE,W=(38.3213+13.17635815*i-14e-13*i*i+3.561*y+.1208*v-.0642*_+.0158*C+.0252*x-.0066*b-.0047*A-.0046*S+.0028*w+.0052*E+.004*T+.0019*P-.0044*M)*CesiumMath.RADIANS_PER_DEGREE,j=(13.17635815-2*i*14e-13+3.561*D*c1+.1208*I*c2-.0642*O*c3$1+.0158*R*c4+.0252*L*c5-.0066*N*c6-.0047*k*c7-.0046*B*c8+.0028*F*c9+.0052*V*c10+.004*z*c11+.0019*U*c12-.0044*G*c13)/86400*CesiumMath.RADIANS_PER_DEGREE;return defined(t)||(t=new IauOrientationParameters),t.rightAscension=$,t.declination=H,t.rotation=W,t.rotationRate=j,t};var xAxisScratch=new Cartesian3,yAxisScratch=new Cartesian3,zAxisScratch=new Cartesian3;function computeRotationMatrix(e,t,i){var r=xAxisScratch;r.x=Math.cos(e+CesiumMath.PI_OVER_TWO),r.y=Math.sin(e+CesiumMath.PI_OVER_TWO),r.z=0;var n=Math.cos(t),a=zAxisScratch;a.x=n*Math.cos(e),a.y=n*Math.sin(e),a.z=Math.sin(t);var o=Cartesian3.cross(a,r,yAxisScratch);return defined(i)||(i=new Matrix3),i[0]=r.x,i[1]=o.x,i[2]=a.x,i[3]=r.y,i[4]=o.y,i[5]=a.y,i[6]=r.z,i[7]=o.z,i[8]=a.z,i}var rotMtxScratch=new Matrix3,quatScratch=new Quaternion;IauOrientationAxes.prototype.evaluate=function(e,t){defined(e)||(e=JulianDate.now());var i=this._computeFunction(e),r=computeRotationMatrix(i.rightAscension,i.declination,t),n=CesiumMath.zeroToTwoPi(i.rotation),a=Quaternion.fromAxisAngle(Cartesian3.UNIT_Z,n,quatScratch),o=Matrix3.fromQuaternion(Quaternion.conjugate(a,a),rotMtxScratch);return Matrix3.multiply(o,r,r)};var InterpolationAlgorithm={};function PeliasGeocoderService(e){this._url=Resource.createIfNeeded(e),this._url.appendForwardSlash()}function IonGeocoderService(e){var t=defaultValue((e=defaultValue(e,defaultValue.EMPTY_OBJECT)).accessToken,Ion.defaultAccessToken),i=Resource.createIfNeeded(defaultValue(e.server,Ion.defaultServer));i.appendForwardSlash();var r=Ion.getDefaultTokenCredit(t);defined(r)&&e.scene.frameState.creditDisplay.addDefaultCredit(Credit.clone(r));var n=i.getDerivedResource({url:"v1/geocode"});defined(t)&&n.appendQueryParameters({access_token:t}),this._accessToken=t,this._server=i,this._pelias=new PeliasGeocoderService(n)}InterpolationAlgorithm.type=void 0,InterpolationAlgorithm.getRequiredDataPoints=DeveloperError.throwInstantiationError,InterpolationAlgorithm.interpolateOrderZero=DeveloperError.throwInstantiationError,InterpolationAlgorithm.interpolate=DeveloperError.throwInstantiationError,Object.defineProperties(PeliasGeocoderService.prototype,{url:{get:function(){return this._url}}}),PeliasGeocoderService.prototype.geocode=function(e,t){return this._url.getDerivedResource({url:t===GeocodeType$1.AUTOCOMPLETE?"autocomplete":"search",queryParameters:{text:e}}).fetchJson().then(function(e){return e.features.map(function(e){var t,i=e.bbox;if(defined(i))t=Rectangle.fromDegrees(i[0],i[1],i[2],i[3]);else{var r=e.geometry.coordinates[0],n=e.geometry.coordinates[1];t=Cartesian3.fromDegrees(r,n)}return{displayName:e.properties.label,destination:t}})})},IonGeocoderService.prototype.geocode=function(e,t){return this._pelias.geocode(e,t)};var isArray=Array.isArray;function isArrayFunction(e){return deprecationWarning("isArray","isArray will be removed in Cesium 1.69. Use the native `Array.isArray` function instead."),isArray(e)}defined(isArray)||(isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)});var LagrangePolynomialApproximation={type:"Lagrange"};function loadImageFromTypedArray(e){var t,i=e.uint8Array,r=e.format,n=e.request,a=defaultValue(e.flipY,!1),o=new Blob([i],{type:r});return Resource.supportsImageBitmapOptions().then(function(e){return e?when(Resource.createImageBitmapFromBlob(o,{flipY:a,premultiplyAlpha:!1})):new Resource({url:t=window.URL.createObjectURL(o),request:n}).fetchImage({flipY:a})}).then(function(e){return defined(t)&&window.URL.revokeObjectURL(t),e}).otherwise(function(e){return defined(t)&&window.URL.revokeObjectURL(t),when.reject(e)})}function ManagedArray(e){e=defaultValue(e,0),this._array=new Array(e),this._length=e}LagrangePolynomialApproximation.getRequiredDataPoints=function(e){return Math.max(e+1,2)},LagrangePolynomialApproximation.interpolateOrderZero=function(e,t,i,r,n){var a,o;defined(n)||(n=new Array(r));var s=t.length;for(a=0;a<r;a++)n[a]=0;for(a=0;a<s;a++){var l=1;for(o=0;o<s;o++)if(o!==a){var u=t[a]-t[o];l*=(e-t[o])/u}for(o=0;o<r;o++)n[o]+=l*i[a*r+o]}return n},Object.defineProperties(ManagedArray.prototype,{length:{get:function(){return this._length},set:function(e){(this._length=e)>this._array.length&&(this._array.length=e)}},values:{get:function(){return this._array}}}),ManagedArray.prototype.get=function(e){return this._array[e]},ManagedArray.prototype.set=function(e,t){e>=this.length&&(this.length=e+1),this._array[e]=t},ManagedArray.prototype.peek=function(){return this._array[this._length-1]},ManagedArray.prototype.push=function(e){var t=this.length++;this._array[t]=e},ManagedArray.prototype.pop=function(){return this._array[--this.length]},ManagedArray.prototype.reserve=function(e){e>this._array.length&&(this._array.length=e)},ManagedArray.prototype.resize=function(e){this.length=e},ManagedArray.prototype.trim=function(e){e=defaultValue(e,this.length),this._array.length=e};var MapboxApi={defaultAccessToken:void 0},printedMapboxWarning=!1,errorCredit,errorString="<b>This application is using Cesium's default Mapbox access token. Please create a new access token for the application as soon as possible and prior to deployment by visiting <a href=https://www.mapbox.com/account/apps/>https://www.mapbox.com/account/apps/</a>, and provide your token to Cesium by setting the Cesium.MapboxApi.defaultAccessToken property before constructing the CesiumWidget or any other object that uses the Mapbox API.</b>";function MapProjection(){DeveloperError.throwInstantiationError()}MapboxApi.getAccessToken=function(e){return defined(e)?e:defined(MapboxApi.defaultAccessToken)?MapboxApi.defaultAccessToken:(printedMapboxWarning||(console.log(errorString),printedMapboxWarning=!0),"pk.eyJ1IjoiYW5hbHl0aWNhbGdyYXBoaWNzIiwiYSI6ImNpd204Zm4wejAwNzYyeW5uNjYyZmFwdWEifQ.7i-VIZZWX8pd1bTfxIVj9g")},MapboxApi.getErrorCredit=function(e){if(!defined(e)&&!defined(MapboxApi.defaultAccessToken))return defined(errorCredit)||(errorCredit=new Credit(errorString,!0)),errorCredit},Object.defineProperties(MapProjection.prototype,{ellipsoid:{get:DeveloperError.throwInstantiationError}}),MapProjection.prototype.project=DeveloperError.throwInstantiationError,MapProjection.prototype.unproject=DeveloperError.throwInstantiationError;var leftScratchArray=[],rightScratchArray=[];function merge(e,t,i,r,n,a){var o,s,l=n-r+1,u=a-n,c=leftScratchArray,d=rightScratchArray;for(o=0;o<l;++o)c[o]=e[r+o];for(s=0;s<u;++s)d[s]=e[n+s+1];s=o=0;for(var h=r;h<=a;++h){var p=c[o],f=d[s];o<l&&(u<=s||t(p,f,i)<=0)?(e[h]=p,++o):s<u&&(e[h]=f,++s)}}function sort$1(e,t,i,r,n){if(!(n<=r)){var a=Math.floor(.5*(r+n));sort$1(e,t,i,r,a),sort$1(e,t,i,a+1,n),merge(e,t,i,r,a,n)}}function mergeSort(e,t,i){var r=e.length,n=Math.ceil(.5*r);leftScratchArray.length=n,rightScratchArray.length=n,sort$1(e,t,i,0,r-1),leftScratchArray.length=0,rightScratchArray.length=0}var Visibility={NONE:-1,PARTIAL:0,FULL:1},Visibility$1=Object.freeze(Visibility);function Occluder(e,t){this._occluderPosition=Cartesian3.clone(e.center),this._occluderRadius=e.radius,this._horizonDistance=0,this._horizonPlaneNormal=void 0,this._horizonPlanePosition=void 0,this._cameraPosition=void 0,this.cameraPosition=t}var scratchCartesian3$c=new Cartesian3;Object.defineProperties(Occluder.prototype,{position:{get:function(){return this._occluderPosition}},radius:{get:function(){return this._occluderRadius}},cameraPosition:{set:function(e){e=Cartesian3.clone(e,this._cameraPosition);var t,i,r,n=Cartesian3.subtract(this._occluderPosition,e,scratchCartesian3$c),a=Cartesian3.magnitudeSquared(n),o=this._occluderRadius*this._occluderRadius;if(o<a){t=Math.sqrt(a-o),a=1/Math.sqrt(a),i=Cartesian3.multiplyByScalar(n,a,scratchCartesian3$c);var s=t*t*a;r=Cartesian3.add(e,Cartesian3.multiplyByScalar(i,s,scratchCartesian3$c),scratchCartesian3$c)}else t=Number.MAX_VALUE;this._horizonDistance=t,this._horizonPlaneNormal=i,this._horizonPlanePosition=r,this._cameraPosition=e}}}),Occluder.fromBoundingSphere=function(e,t,i){return defined(i)?(Cartesian3.clone(e.center,i._occluderPosition),i._occluderRadius=e.radius,i.cameraPosition=t,i):new Occluder(e,t)};var tempVecScratch=new Cartesian3;Occluder.prototype.isPointVisible=function(e){if(this._horizonDistance!==Number.MAX_VALUE){var t=Cartesian3.subtract(e,this._occluderPosition,tempVecScratch),i=this._occluderRadius;if(0<(i=Cartesian3.magnitudeSquared(t)-i*i))return i=Math.sqrt(i)+this._horizonDistance,t=Cartesian3.subtract(e,this._cameraPosition,t),i*i>Cartesian3.magnitudeSquared(t)}return!1};var occludeePositionScratch=new Cartesian3;Occluder.prototype.isBoundingSphereVisible=function(e){var t=Cartesian3.clone(e.center,occludeePositionScratch),i=e.radius;if(this._horizonDistance===Number.MAX_VALUE)return!1;var r=Cartesian3.subtract(t,this._occluderPosition,tempVecScratch),n=this._occluderRadius-i;if(n=Cartesian3.magnitudeSquared(r)-n*n,i<this._occluderRadius)return 0<n&&(n=Math.sqrt(n)+this._horizonDistance,r=Cartesian3.subtract(t,this._cameraPosition,r),n*n+i*i>Cartesian3.magnitudeSquared(r));if(0<n){r=Cartesian3.subtract(t,this._cameraPosition,r);var a=Cartesian3.magnitudeSquared(r),o=this._occluderRadius*this._occluderRadius,s=i*i;return(this._horizonDistance*this._horizonDistance+o)*s>a*o||a<(n=Math.sqrt(n)+this._horizonDistance)*n+s}return!0};var tempScratch$1=new Cartesian3;Occluder.prototype.computeVisibility=function(e){var t=Cartesian3.clone(e.center),i=e.radius;if(i>this._occluderRadius)return Visibility$1.FULL;if(this._horizonDistance!==Number.MAX_VALUE){var r=Cartesian3.subtract(t,this._occluderPosition,tempScratch$1),n=this._occluderRadius-i,a=Cartesian3.magnitudeSquared(r);if(0<(n=a-n*n)){n=Math.sqrt(n)+this._horizonDistance,r=Cartesian3.subtract(t,this._cameraPosition,r);var o=Cartesian3.magnitudeSquared(r);return n*n+i*i<o?Visibility$1.NONE:0<(n=a-(n=this._occluderRadius+i)*n)?o<(n=Math.sqrt(n)+this._horizonDistance)*n+i*i?Visibility$1.FULL:Visibility$1.PARTIAL:(r=Cartesian3.subtract(t,this._horizonPlanePosition,r),Cartesian3.dot(r,this._horizonPlaneNormal)>-i?Visibility$1.PARTIAL:Visibility$1.FULL)}}return Visibility$1.NONE};var occludeePointScratch=new Cartesian3;Occluder.computeOccludeePoint=function(e,t,i){var r=Cartesian3.clone(t),n=Cartesian3.clone(e.center),a=e.radius,o=i.length,s=Cartesian3.normalize(Cartesian3.subtract(r,n,occludeePointScratch),occludeePointScratch),l=-Cartesian3.dot(s,n),u=Occluder._anyRotationVector(n,s,l),c=Occluder._horizonToPlaneNormalDotProduct(e,s,l,u,i[0]);if(c){for(var d,h=1;h<o;++h){if(!(d=Occluder._horizonToPlaneNormalDotProduct(e,s,l,u,i[h])))return;d<c&&(c=d)}if(!(c<.0017453283658983088)){var p=a/c;return Cartesian3.add(n,Cartesian3.multiplyByScalar(s,p,occludeePointScratch),occludeePointScratch)}}};var computeOccludeePointFromRectangleScratch=[];Occluder.computeOccludeePointFromRectangle=function(e,t){t=defaultValue(t,Ellipsoid.WGS84);var i=Rectangle.subsample(e,t,0,computeOccludeePointFromRectangleScratch),r=BoundingSphere.fromPoints(i),n=Cartesian3.ZERO;if(!Cartesian3.equals(n,r.center))return Occluder.computeOccludeePoint(new BoundingSphere(n,t.minimumRadius),r.center,i)};var tempVec0Scratch=new Cartesian3;Occluder._anyRotationVector=function(e,t,i){var r=Cartesian3.abs(t,tempVec0Scratch),n=r.x>r.y?0:1;(0===n&&r.z>r.x||1===n&&r.z>r.y)&&(n=2);var a,o=new Cartesian3;a=0===n?(r.x=e.x,r.y=e.y+1,r.z=e.z+1,Cartesian3.UNIT_X):1===n?(r.x=e.x+1,r.y=e.y,r.z=e.z+1,Cartesian3.UNIT_Y):(r.x=e.x+1,r.y=e.y+1,r.z=e.z,Cartesian3.UNIT_Z);var s=(Cartesian3.dot(t,r)+i)/-Cartesian3.dot(t,a);return Cartesian3.normalize(Cartesian3.subtract(Cartesian3.add(r,Cartesian3.multiplyByScalar(a,s,o),r),e,r),r)};var posDirectionScratch=new Cartesian3;Occluder._rotationVector=function(e,t,i,r,n){var a=Cartesian3.subtract(r,e,posDirectionScratch);if(a=Cartesian3.normalize(a,a),Cartesian3.dot(t,a)<.9999999847691291){var o=Cartesian3.cross(t,a,a);if(Cartesian3.magnitude(o)>CesiumMath.EPSILON13)return Cartesian3.normalize(o,new Cartesian3)}return n};var posScratch1=new Cartesian3,occluerPosScratch=new Cartesian3,posScratch2=new Cartesian3,horizonPlanePosScratch=new Cartesian3;function OpenCageGeocoderService(e,t,i){(e=Resource.createIfNeeded(e)).appendForwardSlash(),e.setQueryParameters({key:t}),this._url=e,this._params=defaultValue(i,{})}Occluder._horizonToPlaneNormalDotProduct=function(e,t,i,r,n){var a=Cartesian3.clone(n,posScratch1),o=Cartesian3.clone(e.center,occluerPosScratch),s=e.radius,l=Cartesian3.subtract(o,a,posScratch2),u=Cartesian3.magnitudeSquared(l),c=s*s;if(u<c)return!1;var d=u-c,h=Math.sqrt(d),p=h*(1/Math.sqrt(u))*h;l=Cartesian3.normalize(l,l);var f=Cartesian3.add(a,Cartesian3.multiplyByScalar(l,p,horizonPlanePosScratch),horizonPlanePosScratch),m=Math.sqrt(d-p*p),g=this._rotationVector(o,t,i,a,r),y=Cartesian3.fromElements(g.x*g.x*l.x+(g.x*g.y-g.z)*l.y+(g.x*g.z+g.y)*l.z,(g.x*g.y+g.z)*l.x+g.y*g.y*l.y+(g.y*g.z-g.x)*l.z,(g.x*g.z-g.y)*l.x+(g.y*g.z+g.x)*l.y+g.z*g.z*l.z,posScratch1);y=Cartesian3.normalize(y,y);var v=Cartesian3.multiplyByScalar(y,m,posScratch1);g=Cartesian3.normalize(Cartesian3.subtract(Cartesian3.add(f,v,posScratch2),o,posScratch2),posScratch2);var _=Cartesian3.dot(t,g);g=Cartesian3.normalize(Cartesian3.subtract(Cartesian3.subtract(f,v,g),o,g),g);var C=Cartesian3.dot(t,g);return _<C?_:C},Object.defineProperties(OpenCageGeocoderService.prototype,{url:{get:function(){return this._url}},params:{get:function(){return this._params}}}),OpenCageGeocoderService.prototype.geocode=function(e){return this._url.getDerivedResource({url:"json",queryParameters:combine(this._params,{q:e})}).fetchJson().then(function(e){return e.results.map(function(e){var t,i=e.bounds;if(defined(i))t=Rectangle.fromDegrees(i.southwest.lng,i.southwest.lat,i.northeast.lng,i.northeast.lat);else{var r=e.geometry.lat,n=e.geometry.lng;t=Cartesian3.fromDegrees(r,n)}return{displayName:e.formatted,destination:t}})})};var Packable={packedLength:void 0,pack:DeveloperError.throwInstantiationError,unpack:DeveloperError.throwInstantiationError},PackableForInterpolation={packedInterpolationLength:void 0,convertPackedArrayForInterpolation:DeveloperError.throwInstantiationError,unpackInterpolationResult:DeveloperError.throwInstantiationError};function PlaneGeometry(e){var t=defaultValue((e=defaultValue(e,defaultValue.EMPTY_OBJECT)).vertexFormat,VertexFormat.DEFAULT);this._vertexFormat=t,this._workerName="createPlaneGeometry"}PlaneGeometry.packedLength=VertexFormat.packedLength,PlaneGeometry.pack=function(e,t,i){return i=defaultValue(i,0),VertexFormat.pack(e._vertexFormat,t,i),t};var scratchVertexFormat$9=new VertexFormat,scratchOptions$g={vertexFormat:scratchVertexFormat$9};PlaneGeometry.unpack=function(e,t,i){t=defaultValue(t,0);var r=VertexFormat.unpack(e,t,scratchVertexFormat$9);return defined(i)?(i._vertexFormat=VertexFormat.clone(r,i._vertexFormat),i):new PlaneGeometry(scratchOptions$g)};var min=new Cartesian3(-.5,-.5,0),max=new Cartesian3(.5,.5,0);function PlaneOutlineGeometry(){this._workerName="createPlaneOutlineGeometry"}PlaneGeometry.createGeometry=function(e){var t,i,r=e._vertexFormat,n=new GeometryAttributes;if(r.position){if((i=new Float64Array(12))[0]=min.x,i[1]=min.y,i[2]=0,i[3]=max.x,i[4]=min.y,i[5]=0,i[6]=max.x,i[7]=max.y,i[8]=0,i[9]=min.x,i[10]=max.y,i[11]=0,n.position=new GeometryAttribute({componentDatatype:ComponentDatatype$1.DOUBLE,componentsPerAttribute:3,values:i}),r.normal){var a=new Float32Array(12);a[0]=0,a[1]=0,a[2]=1,a[3]=0,a[4]=0,a[5]=1,a[6]=0,a[7]=0,a[8]=1,a[9]=0,a[10]=0,a[11]=1,n.normal=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:a})}if(r.st){var o=new Float32Array(8);o[0]=0,o[1]=0,o[2]=1,o[3]=0,o[4]=1,o[5]=1,o[6]=0,o[7]=1,n.st=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:2,values:o})}if(r.tangent){var s=new Float32Array(12);s[0]=1,s[1]=0,s[2]=0,s[3]=1,s[4]=0,s[5]=0,s[6]=1,s[7]=0,s[8]=0,s[9]=1,s[10]=0,s[11]=0,n.tangent=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:s})}if(r.bitangent){var l=new Float32Array(12);l[0]=0,l[1]=1,l[2]=0,l[3]=0,l[4]=1,l[5]=0,l[6]=0,l[7]=1,l[8]=0,l[9]=0,l[10]=1,l[11]=0,n.bitangent=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:l})}(t=new Uint16Array(6))[0]=0,t[1]=1,t[2]=2,t[3]=0,t[4]=2,t[5]=3}return new Geometry({attributes:n,indices:t,primitiveType:PrimitiveType$1.TRIANGLES,boundingSphere:new BoundingSphere(Cartesian3.ZERO,Math.sqrt(2))})},PlaneOutlineGeometry.packedLength=0,PlaneOutlineGeometry.pack=function(e,t){return t},PlaneOutlineGeometry.unpack=function(e,t,i){return defined(i)?i:new PlaneOutlineGeometry};var min$1=new Cartesian3(-.5,-.5,0),max$1=new Cartesian3(.5,.5,0);PlaneOutlineGeometry.createGeometry=function(){var e=new GeometryAttributes,t=new Uint16Array(8),i=new Float64Array(12);return i[0]=min$1.x,i[1]=min$1.y,i[2]=min$1.z,i[3]=max$1.x,i[4]=min$1.y,i[5]=min$1.z,i[6]=max$1.x,i[7]=max$1.y,i[8]=min$1.z,i[9]=min$1.x,i[10]=max$1.y,i[11]=min$1.z,e.position=new GeometryAttribute({componentDatatype:ComponentDatatype$1.DOUBLE,componentsPerAttribute:3,values:i}),t[0]=0,t[1]=1,t[2]=1,t[3]=2,t[4]=2,t[5]=3,t[6]=3,t[7]=0,new Geometry({attributes:e,indices:t,primitiveType:PrimitiveType$1.LINES,boundingSphere:new BoundingSphere(Cartesian3.ZERO,Math.sqrt(2))})};var coords=new Cartesian3;function pointInsideTriangle(e,t,i,r){return barycentricCoordinates(e,t,i,r,coords),0<coords.x&&0<coords.y&&0<coords.z}var createGeometryFromPositionsPositions=[],createGeometryFromPositionsSubdivided=[];function createGeometryFromPositions$1(e,t,i,r,n){var a,o,s=EllipsoidTangentPlane.fromPoints(t,e).projectPointsOntoPlane(t,createGeometryFromPositionsPositions);PolygonPipeline.computeWindingOrder2D(s)===WindingOrder$1.CLOCKWISE&&(s.reverse(),t=t.slice().reverse());var l=t.length,u=0;if(r)for(a=new Float64Array(2*l*3),o=0;o<l;o++){var c=t[o],d=t[(o+1)%l];a[u++]=c.x,a[u++]=c.y,a[u++]=c.z,a[u++]=d.x,a[u++]=d.y,a[u++]=d.z}else{var h=0;if(n===ArcType$1.GEODESIC)for(o=0;o<l;o++)h+=PolygonGeometryLibrary.subdivideLineCount(t[o],t[(o+1)%l],i);else if(n===ArcType$1.RHUMB)for(o=0;o<l;o++)h+=PolygonGeometryLibrary.subdivideRhumbLineCount(e,t[o],t[(o+1)%l],i);for(a=new Float64Array(3*h),o=0;o<l;o++){var p;n===ArcType$1.GEODESIC?p=PolygonGeometryLibrary.subdivideLine(t[o],t[(o+1)%l],i,createGeometryFromPositionsSubdivided):n===ArcType$1.RHUMB&&(p=PolygonGeometryLibrary.subdivideRhumbLine(e,t[o],t[(o+1)%l],i,createGeometryFromPositionsSubdivided));for(var f=p.length,m=0;m<f;++m)a[u++]=p[m]}}var g=2*(l=a.length/3),y=IndexDatatype$1.createTypedArray(l,g);for(o=u=0;o<l-1;o++)y[u++]=o,y[u++]=o+1;return y[u++]=l-1,y[u++]=0,new GeometryInstance({geometry:new Geometry({attributes:new GeometryAttributes({position:new GeometryAttribute({componentDatatype:ComponentDatatype$1.DOUBLE,componentsPerAttribute:3,values:a})}),indices:y,primitiveType:PrimitiveType$1.LINES})})}function createGeometryFromPositionsExtruded$1(e,t,i,r,n){var a,o,s=EllipsoidTangentPlane.fromPoints(t,e).projectPointsOntoPlane(t,createGeometryFromPositionsPositions);PolygonPipeline.computeWindingOrder2D(s)===WindingOrder$1.CLOCKWISE&&(s.reverse(),t=t.slice().reverse());var l=t.length,u=new Array(l),c=0;if(r)for(a=new Float64Array(2*l*3*2),o=0;o<l;++o){u[o]=c/3;var d=t[o],h=t[(o+1)%l];a[c++]=d.x,a[c++]=d.y,a[c++]=d.z,a[c++]=h.x,a[c++]=h.y,a[c++]=h.z}else{var p=0;if(n===ArcType$1.GEODESIC)for(o=0;o<l;o++)p+=PolygonGeometryLibrary.subdivideLineCount(t[o],t[(o+1)%l],i);else if(n===ArcType$1.RHUMB)for(o=0;o<l;o++)p+=PolygonGeometryLibrary.subdivideRhumbLineCount(e,t[o],t[(o+1)%l],i);for(a=new Float64Array(3*p*2),o=0;o<l;++o){var f;u[o]=c/3,n===ArcType$1.GEODESIC?f=PolygonGeometryLibrary.subdivideLine(t[o],t[(o+1)%l],i,createGeometryFromPositionsSubdivided):n===ArcType$1.RHUMB&&(f=PolygonGeometryLibrary.subdivideRhumbLine(e,t[o],t[(o+1)%l],i,createGeometryFromPositionsSubdivided));for(var m=f.length,g=0;g<m;++g)a[c++]=f[g]}}l=a.length/6;var y=u.length,v=2*(2*l+y),_=IndexDatatype$1.createTypedArray(l+y,v);for(o=c=0;o<l;++o)_[c++]=o,_[c++]=(o+1)%l,_[c++]=o+l,_[c++]=(o+1)%l+l;for(o=0;o<y;o++){var C=u[o];_[c++]=C,_[c++]=C+l}return new GeometryInstance({geometry:new Geometry({attributes:new GeometryAttributes({position:new GeometryAttribute({componentDatatype:ComponentDatatype$1.DOUBLE,componentsPerAttribute:3,values:a})}),indices:_,primitiveType:PrimitiveType$1.LINES})})}function PolygonOutlineGeometry(e){var t=e.polygonHierarchy,i=defaultValue(e.ellipsoid,Ellipsoid.WGS84),r=defaultValue(e.granularity,CesiumMath.RADIANS_PER_DEGREE),n=defaultValue(e.perPositionHeight,!1),a=n&&defined(e.extrudedHeight),o=defaultValue(e.arcType,ArcType$1.GEODESIC),s=defaultValue(e.height,0),l=defaultValue(e.extrudedHeight,s);if(!a){var u=Math.max(s,l);l=Math.min(s,l),s=u}this._ellipsoid=Ellipsoid.clone(i),this._granularity=r,this._height=s,this._extrudedHeight=l,this._arcType=o,this._polygonHierarchy=t,this._perPositionHeight=n,this._perPositionHeightExtrude=a,this._offsetAttribute=e.offsetAttribute,this._workerName="createPolygonOutlineGeometry",this.packedLength=PolygonGeometryLibrary.computeHierarchyPackedLength(t)+Ellipsoid.packedLength+8}PolygonOutlineGeometry.pack=function(e,t,i){return i=defaultValue(i,0),i=PolygonGeometryLibrary.packPolygonHierarchy(e._polygonHierarchy,t,i),Ellipsoid.pack(e._ellipsoid,t,i),i+=Ellipsoid.packedLength,t[i++]=e._height,t[i++]=e._extrudedHeight,t[i++]=e._granularity,t[i++]=e._perPositionHeightExtrude?1:0,t[i++]=e._perPositionHeight?1:0,t[i++]=e._arcType,t[i++]=defaultValue(e._offsetAttribute,-1),t[i]=e.packedLength,t};var scratchEllipsoid$7=Ellipsoid.clone(Ellipsoid.UNIT_SPHERE),dummyOptions$1={polygonHierarchy:{}};function computeAttributes$1(e,t,i,r){var n=new GeometryAttributes;r.position&&(n.position=new GeometryAttribute({componentDatatype:ComponentDatatype$1.DOUBLE,componentsPerAttribute:3,values:e}));var a,o,s,l,u,c,d=t.length,h=e.length/3,p=(h-2*d)/(2*d),f=PolygonPipeline.triangulate(t),m=(p-1)*d*6+2*f.length,g=IndexDatatype$1.createTypedArray(h,m),y=2*d,v=0;for(a=0;a<p-1;a++){for(o=0;o<d-1;o++)c=(s=2*o+a*d*2)+y,u=(l=s+1)+y,g[v++]=l,g[v++]=s,g[v++]=u,g[v++]=u,g[v++]=s,g[v++]=c;u=(l=(s=2*d-2+a*d*2)+1)+y,c=s+y,g[v++]=l,g[v++]=s,g[v++]=u,g[v++]=u,g[v++]=s,g[v++]=c}if(r.st||r.tangent||r.bitangent){var _,C,x=new Float32Array(2*h),b=1/(p-1),A=1/i.height,S=i.height/2,w=0;for(a=0;a<p;a++){for(_=a*b,C=A*(t[0].y+S),x[w++]=_,x[w++]=C,o=1;o<d;o++)C=A*(t[o].y+S),x[w++]=_,x[w++]=C,x[w++]=_,x[w++]=C;C=A*(t[0].y+S),x[w++]=_,x[w++]=C}for(o=0;o<d;o++)_=0,C=A*(t[o].y+S),x[w++]=_,x[w++]=C;for(o=0;o<d;o++)_=(p-1)*b,C=A*(t[o].y+S),x[w++]=_,x[w++]=C;n.st=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:2,values:new Float32Array(x)})}var E=h-2*d;for(a=0;a<f.length;a+=3){var T=f[a]+E,P=f[a+1]+E,M=f[a+2]+E;g[v++]=T,g[v++]=P,g[v++]=M,g[v++]=M+d,g[v++]=P+d,g[v++]=T+d}var D=new Geometry({attributes:n,indices:g,boundingSphere:BoundingSphere.fromVertices(e),primitiveType:PrimitiveType$1.TRIANGLES});if(r.normal&&(D=GeometryPipeline.computeNormal(D)),r.tangent||r.bitangent){try{D=GeometryPipeline.computeTangentAndBitangent(D)}catch(e){oneTimeWarning("polyline-volume-tangent-bitangent","Unable to compute tangents and bitangents for polyline volume geometry")}r.tangent||(D.attributes.tangent=void 0),r.bitangent||(D.attributes.bitangent=void 0),r.st||(D.attributes.st=void 0)}return D}function PolylineVolumeGeometry(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).polylinePositions,i=e.shapePositions;this._positions=t,this._shape=i,this._ellipsoid=Ellipsoid.clone(defaultValue(e.ellipsoid,Ellipsoid.WGS84)),this._cornerType=defaultValue(e.cornerType,CornerType$1.ROUNDED),this._vertexFormat=VertexFormat.clone(defaultValue(e.vertexFormat,VertexFormat.DEFAULT)),this._granularity=defaultValue(e.granularity,CesiumMath.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeGeometry";var r=1+t.length*Cartesian3.packedLength;r+=1+i.length*Cartesian2.packedLength,this.packedLength=r+Ellipsoid.packedLength+VertexFormat.packedLength+2}PolygonOutlineGeometry.unpack=function(e,t,i){t=defaultValue(t,0);var r=PolygonGeometryLibrary.unpackPolygonHierarchy(e,t);t=r.startingIndex,delete r.startingIndex;var n=Ellipsoid.unpack(e,t,scratchEllipsoid$7);t+=Ellipsoid.packedLength;var a=e[t++],o=e[t++],s=e[t++],l=1===e[t++],u=1===e[t++],c=e[t++],d=e[t++],h=e[t];return defined(i)||(i=new PolygonOutlineGeometry(dummyOptions$1)),i._polygonHierarchy=r,i._ellipsoid=Ellipsoid.clone(n,i._ellipsoid),i._height=a,i._extrudedHeight=o,i._granularity=s,i._perPositionHeight=u,i._perPositionHeightExtrude=l,i._arcType=c,i._offsetAttribute=-1===d?void 0:d,i.packedLength=h,i},PolygonOutlineGeometry.fromPositions=function(e){return new PolygonOutlineGeometry({polygonHierarchy:{positions:(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).positions},height:e.height,extrudedHeight:e.extrudedHeight,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight,arcType:e.arcType,offsetAttribute:e.offsetAttribute})},PolygonOutlineGeometry.createGeometry=function(e){var t=e._ellipsoid,i=e._granularity,r=e._polygonHierarchy,n=e._perPositionHeight,a=e._arcType,o=PolygonGeometryLibrary.polygonOutlinesFromHierarchy(r,!n,t);if(0!==o.length){var s,l,u=[],c=CesiumMath.chordLength(i,t.maximumRadius),d=e._height,h=e._extrudedHeight;if(e._perPositionHeightExtrude||!CesiumMath.equalsEpsilon(d,h,0,CesiumMath.EPSILON2))for(l=0;l<o.length;l++){if((s=createGeometryFromPositionsExtruded$1(t,o[l],c,n,a)).geometry=PolygonGeometryLibrary.scaleToGeodeticHeightExtruded(s.geometry,d,h,t,n),defined(e._offsetAttribute)){var p=s.geometry.attributes.position.values.length/3,f=new Uint8Array(p);f=e._offsetAttribute===GeometryOffsetAttribute$1.TOP?arrayFill(f,1,0,p/2):arrayFill(f,e._offsetAttribute===GeometryOffsetAttribute$1.NONE?0:1),s.geometry.attributes.applyOffset=new GeometryAttribute({componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE,componentsPerAttribute:1,values:f})}u.push(s)}else for(l=0;l<o.length;l++){if((s=createGeometryFromPositions$1(t,o[l],c,n,a)).geometry.attributes.position.values=PolygonPipeline.scaleToGeodeticHeight(s.geometry.attributes.position.values,d,t,!n),defined(e._offsetAttribute)){var m=s.geometry.attributes.position.values.length,g=new Uint8Array(m/3);arrayFill(g,e._offsetAttribute===GeometryOffsetAttribute$1.NONE?0:1),s.geometry.attributes.applyOffset=new GeometryAttribute({componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE,componentsPerAttribute:1,values:g})}u.push(s)}var y=GeometryPipeline.combineInstances(u)[0],v=BoundingSphere.fromVertices(y.attributes.position.values);return new Geometry({attributes:y.attributes,indices:y.indices,primitiveType:y.primitiveType,boundingSphere:v,offsetAttribute:e._offsetAttribute})}},PolylineVolumeGeometry.pack=function(e,t,i){var r;i=defaultValue(i,0);var n=e._positions,a=n.length;for(t[i++]=a,r=0;r<a;++r,i+=Cartesian3.packedLength)Cartesian3.pack(n[r],t,i);var o=e._shape;for(a=o.length,t[i++]=a,r=0;r<a;++r,i+=Cartesian2.packedLength)Cartesian2.pack(o[r],t,i);return Ellipsoid.pack(e._ellipsoid,t,i),i+=Ellipsoid.packedLength,VertexFormat.pack(e._vertexFormat,t,i),i+=VertexFormat.packedLength,t[i++]=e._cornerType,t[i]=e._granularity,t};var scratchEllipsoid$8=Ellipsoid.clone(Ellipsoid.UNIT_SPHERE),scratchVertexFormat$a=new VertexFormat,scratchOptions$h={polylinePositions:void 0,shapePositions:void 0,ellipsoid:scratchEllipsoid$8,vertexFormat:scratchVertexFormat$a,cornerType:void 0,granularity:void 0};PolylineVolumeGeometry.unpack=function(e,t,i){var r;t=defaultValue(t,0);var n=e[t++],a=new Array(n);for(r=0;r<n;++r,t+=Cartesian3.packedLength)a[r]=Cartesian3.unpack(e,t);n=e[t++];var o=new Array(n);for(r=0;r<n;++r,t+=Cartesian2.packedLength)o[r]=Cartesian2.unpack(e,t);var s=Ellipsoid.unpack(e,t,scratchEllipsoid$8);t+=Ellipsoid.packedLength;var l=VertexFormat.unpack(e,t,scratchVertexFormat$a);t+=VertexFormat.packedLength;var u=e[t++],c=e[t];return defined(i)?(i._positions=a,i._shape=o,i._ellipsoid=Ellipsoid.clone(s,i._ellipsoid),i._vertexFormat=VertexFormat.clone(l,i._vertexFormat),i._cornerType=u,i._granularity=c,i):(scratchOptions$h.polylinePositions=a,scratchOptions$h.shapePositions=o,scratchOptions$h.cornerType=u,scratchOptions$h.granularity=c,new PolylineVolumeGeometry(scratchOptions$h))};var brScratch=new BoundingRectangle;function computeAttributes$2(e,t){var i=new GeometryAttributes;i.position=new GeometryAttribute({componentDatatype:ComponentDatatype$1.DOUBLE,componentsPerAttribute:3,values:e});var r,n,a=t.length,o=i.position.values.length/3,s=e.length/3/a,l=IndexDatatype$1.createTypedArray(o,2*a*(1+s)),u=0,c=(r=0)*a;for(n=0;n<a-1;n++)l[u++]=n+c,l[u++]=n+c+1;for(l[u++]=a-1+c,l[u++]=c,c=(r=s-1)*a,n=0;n<a-1;n++)l[u++]=n+c,l[u++]=n+c+1;for(l[u++]=a-1+c,l[u++]=c,r=0;r<s-1;r++){var d=a*r,h=d+a;for(n=0;n<a;n++)l[u++]=n+d,l[u++]=n+h}return new Geometry({attributes:i,indices:IndexDatatype$1.createTypedArray(o,l),boundingSphere:BoundingSphere.fromVertices(e),primitiveType:PrimitiveType$1.LINES})}function PolylineVolumeOutlineGeometry(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).polylinePositions,i=e.shapePositions;this._positions=t,this._shape=i,this._ellipsoid=Ellipsoid.clone(defaultValue(e.ellipsoid,Ellipsoid.WGS84)),this._cornerType=defaultValue(e.cornerType,CornerType$1.ROUNDED),this._granularity=defaultValue(e.granularity,CesiumMath.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeOutlineGeometry";var r=1+t.length*Cartesian3.packedLength;r+=1+i.length*Cartesian2.packedLength,this.packedLength=r+Ellipsoid.packedLength+2}PolylineVolumeGeometry.createGeometry=function(e){var t=arrayRemoveDuplicates(e._positions,Cartesian3.equalsEpsilon),i=e._shape;if(i=PolylineVolumeGeometryLibrary.removeDuplicatesFromShape(i),!(t.length<2||i.length<3)){PolygonPipeline.computeWindingOrder2D(i)===WindingOrder$1.CLOCKWISE&&i.reverse();var r=BoundingRectangle.fromPoints(i,brScratch);return computeAttributes$1(PolylineVolumeGeometryLibrary.computePositions(t,i,r,e,!0),i,r,e._vertexFormat)}},PolylineVolumeOutlineGeometry.pack=function(e,t,i){var r;i=defaultValue(i,0);var n=e._positions,a=n.length;for(t[i++]=a,r=0;r<a;++r,i+=Cartesian3.packedLength)Cartesian3.pack(n[r],t,i);var o=e._shape;for(a=o.length,t[i++]=a,r=0;r<a;++r,i+=Cartesian2.packedLength)Cartesian2.pack(o[r],t,i);return Ellipsoid.pack(e._ellipsoid,t,i),i+=Ellipsoid.packedLength,t[i++]=e._cornerType,t[i]=e._granularity,t};var scratchEllipsoid$9=Ellipsoid.clone(Ellipsoid.UNIT_SPHERE),scratchOptions$i={polylinePositions:void 0,shapePositions:void 0,ellipsoid:scratchEllipsoid$9,height:void 0,cornerType:void 0,granularity:void 0};PolylineVolumeOutlineGeometry.unpack=function(e,t,i){var r;t=defaultValue(t,0);var n=e[t++],a=new Array(n);for(r=0;r<n;++r,t+=Cartesian3.packedLength)a[r]=Cartesian3.unpack(e,t);n=e[t++];var o=new Array(n);for(r=0;r<n;++r,t+=Cartesian2.packedLength)o[r]=Cartesian2.unpack(e,t);var s=Ellipsoid.unpack(e,t,scratchEllipsoid$9);t+=Ellipsoid.packedLength;var l=e[t++],u=e[t];return defined(i)?(i._positions=a,i._shape=o,i._ellipsoid=Ellipsoid.clone(s,i._ellipsoid),i._cornerType=l,i._granularity=u,i):(scratchOptions$i.polylinePositions=a,scratchOptions$i.shapePositions=o,scratchOptions$i.cornerType=l,scratchOptions$i.granularity=u,new PolylineVolumeOutlineGeometry(scratchOptions$i))};var brScratch$1=new BoundingRectangle;function createEvaluateFunction$1(o){var s=o.points,l=o.times;return function(e,t){defined(t)||(t=new Quaternion);var i=o._lastTimeIndex=o.findTimeInterval(e,o._lastTimeIndex),r=(e-l[i])/(l[i+1]-l[i]),n=s[i],a=s[i+1];return Quaternion.fastSlerp(n,a,r,t)}}function QuaternionSpline(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).points,i=e.times;this._times=i,this._points=t,this._evaluateFunction=createEvaluateFunction$1(this),this._lastTimeIndex=0}function quickselect(e,t,i,r,n){quickselectStep(e,t,i||0,r||e.length-1,n||defaultCompare)}function quickselectStep(e,t,i,r,n){for(;i<r;){if(600<r-i){var a=r-i+1,o=t-i+1,s=Math.log(a),l=.5*Math.exp(2*s/3),u=.5*Math.sqrt(s*l*(a-l)/a)*(o-a/2<0?-1:1);quickselectStep(e,t,Math.max(i,Math.floor(t-o*l/a+u)),Math.min(r,Math.floor(t+(a-o)*l/a+u)),n)}var c=e[t],d=i,h=r;for(swap$2(e,i,t),0<n(e[r],c)&&swap$2(e,i,r);d<h;){for(swap$2(e,d,h),d++,h--;n(e[d],c)<0;)d++;for(;0<n(e[h],c);)h--}0===n(e[i],c)?swap$2(e,i,h):swap$2(e,++h,r),h<=t&&(i=h+1),t<=h&&(r=h-1)}}function swap$2(e,t,i){var r=e[t];e[t]=e[i],e[i]=r}function defaultCompare(e,t){return e<t?-1:t<e?1:0}function rbush(e,t){if(!(this instanceof rbush))return new rbush(e,t);this._maxEntries=Math.max(4,e||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),t&&this._initFormat(t),this.clear()}function findItem(e,t,i){if(!i)return t.indexOf(e);for(var r=0;r<t.length;r++)if(i(e,t[r]))return r;return-1}function calcBBox(e,t){distBBox(e,0,e.children.length,t,e)}function distBBox(e,t,i,r,n){(n=n||createNode(null)).minX=1/0,n.minY=1/0,n.maxX=-1/0,n.maxY=-1/0;for(var a,o=t;o<i;o++)a=e.children[o],extend(n,e.leaf?r(a):a);return n}function extend(e,t){return e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),e}function compareNodeMinX(e,t){return e.minX-t.minX}function compareNodeMinY(e,t){return e.minY-t.minY}function bboxArea(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function bboxMargin(e){return e.maxX-e.minX+(e.maxY-e.minY)}function enlargedArea(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function intersectionArea(e,t){var i=Math.max(e.minX,t.minX),r=Math.max(e.minY,t.minY),n=Math.min(e.maxX,t.maxX),a=Math.min(e.maxY,t.maxY);return Math.max(0,n-i)*Math.max(0,a-r)}function contains(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function intersects$1(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function createNode(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function multiSelect(e,t,i,r,n){for(var a,o=[t,i];o.length;)(i=o.pop())-(t=o.pop())<=r||(quickselect(e,a=t+Math.ceil((i-t)/r/2)*r,t,i,n),o.push(t,a,a,i))}function RectangleCollisionChecker(){this._tree=rbush()}function RectangleWithId(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.id=""}function idCompare(e,t){return e.id===t.id}PolylineVolumeOutlineGeometry.createGeometry=function(e){var t=arrayRemoveDuplicates(e._positions,Cartesian3.equalsEpsilon),i=e._shape;if(i=PolylineVolumeGeometryLibrary.removeDuplicatesFromShape(i),!(t.length<2||i.length<3)){PolygonPipeline.computeWindingOrder2D(i)===WindingOrder$1.CLOCKWISE&&i.reverse();var r=BoundingRectangle.fromPoints(i,brScratch$1);return computeAttributes$2(PolylineVolumeGeometryLibrary.computePositions(t,i,r,e,!1),i)}},Object.defineProperties(QuaternionSpline.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}}),QuaternionSpline.prototype.findTimeInterval=Spline.prototype.findTimeInterval,QuaternionSpline.prototype.wrapTime=Spline.prototype.wrapTime,QuaternionSpline.prototype.clampTime=Spline.prototype.clampTime,QuaternionSpline.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)},rbush.prototype={all:function(){return this._all(this.data,[])},search:function(e){var t=this.data,i=[],r=this.toBBox;if(!intersects$1(e,t))return i;for(var n,a,o,s,l=[];t;){for(n=0,a=t.children.length;n<a;n++)o=t.children[n],intersects$1(e,s=t.leaf?r(o):o)&&(t.leaf?i.push(o):contains(e,s)?this._all(o,i):l.push(o));t=l.pop()}return i},collides:function(e){var t=this.data,i=this.toBBox;if(!intersects$1(e,t))return!1;for(var r,n,a,o,s=[];t;){for(r=0,n=t.children.length;r<n;r++)if(a=t.children[r],intersects$1(e,o=t.leaf?i(a):a)){if(t.leaf||contains(e,o))return!0;s.push(a)}t=s.pop()}return!1},load:function(e){if(!e||!e.length)return this;if(e.length<this._minEntries){for(var t=0,i=e.length;t<i;t++)this.insert(e[t]);return this}var r=this._build(e.slice(),0,e.length-1,0);if(this.data.children.length)if(this.data.height===r.height)this._splitRoot(this.data,r);else{if(this.data.height<r.height){var n=this.data;this.data=r,r=n}this._insert(r,this.data.height-r.height-1,!0)}else this.data=r;return this},insert:function(e){return e&&this._insert(e,this.data.height-1),this},clear:function(){return this.data=createNode([]),this},remove:function(e,t){if(!e)return this;for(var i,r,n,a,o=this.data,s=this.toBBox(e),l=[],u=[];o||l.length;){if(o||(o=l.pop(),r=l[l.length-1],i=u.pop(),a=!0),o.leaf&&-1!==(n=findItem(e,o.children,t)))return o.children.splice(n,1),l.push(o),this._condense(l),this;a||o.leaf||!contains(o,s)?r?(i++,o=r.children[i],a=!1):o=null:(l.push(o),u.push(i),i=0,o=(r=o).children[0])}return this},toBBox:function(e){return e},compareMinX:compareNodeMinX,compareMinY:compareNodeMinY,toJSON:function(){return this.data},fromJSON:function(e){return this.data=e,this},_all:function(e,t){for(var i=[];e;)e.leaf?t.push.apply(t,e.children):i.push.apply(i,e.children),e=i.pop();return t},_build:function(e,t,i,r){var n,a=i-t+1,o=this._maxEntries;if(a<=o)return calcBBox(n=createNode(e.slice(t,i+1)),this.toBBox),n;r||(r=Math.ceil(Math.log(a)/Math.log(o)),o=Math.ceil(a/Math.pow(o,r-1))),(n=createNode([])).leaf=!1,n.height=r;var s,l,u,c,d=Math.ceil(a/o),h=d*Math.ceil(Math.sqrt(o));for(multiSelect(e,t,i,h,this.compareMinX),s=t;s<=i;s+=h)for(multiSelect(e,s,u=Math.min(s+h-1,i),d,this.compareMinY),l=s;l<=u;l+=d)c=Math.min(l+d-1,u),n.children.push(this._build(e,l,c,r-1));return calcBBox(n,this.toBBox),n},_chooseSubtree:function(e,t,i,r){for(var n,a,o,s,l,u,c,d;r.push(t),!t.leaf&&r.length-1!==i;){for(c=d=1/0,n=0,a=t.children.length;n<a;n++)l=bboxArea(o=t.children[n]),(u=enlargedArea(e,o)-l)<d?(d=u,c=l<c?l:c,s=o):u===d&&l<c&&(c=l,s=o);t=s||t.children[0]}return t},_insert:function(e,t,i){var r=this.toBBox,n=i?e:r(e),a=[],o=this._chooseSubtree(n,this.data,t,a);for(o.children.push(e),extend(o,n);0<=t&&a[t].children.length>this._maxEntries;)this._split(a,t),t--;this._adjustParentBBoxes(n,a,t)},_split:function(e,t){var i=e[t],r=i.children.length,n=this._minEntries;this._chooseSplitAxis(i,n,r);var a=this._chooseSplitIndex(i,n,r),o=createNode(i.children.splice(a,i.children.length-a));o.height=i.height,o.leaf=i.leaf,calcBBox(i,this.toBBox),calcBBox(o,this.toBBox),t?e[t-1].children.push(o):this._splitRoot(i,o)},_splitRoot:function(e,t){this.data=createNode([e,t]),this.data.height=e.height+1,this.data.leaf=!1,calcBBox(this.data,this.toBBox)},_chooseSplitIndex:function(e,t,i){var r,n,a,o,s,l,u,c;for(l=u=1/0,r=t;r<=i-t;r++)o=intersectionArea(n=distBBox(e,0,r,this.toBBox),a=distBBox(e,r,i,this.toBBox)),s=bboxArea(n)+bboxArea(a),o<l?(l=o,c=r,u=s<u?s:u):o===l&&s<u&&(u=s,c=r);return c},_chooseSplitAxis:function(e,t,i){var r=e.leaf?this.compareMinX:compareNodeMinX,n=e.leaf?this.compareMinY:compareNodeMinY;this._allDistMargin(e,t,i,r)<this._allDistMargin(e,t,i,n)&&e.children.sort(r)},_allDistMargin:function(e,t,i,r){e.children.sort(r);var n,a,o=this.toBBox,s=distBBox(e,0,t,o),l=distBBox(e,i-t,i,o),u=bboxMargin(s)+bboxMargin(l);for(n=t;n<i-t;n++)a=e.children[n],extend(s,e.leaf?o(a):a),u+=bboxMargin(s);for(n=i-t-1;t<=n;n--)a=e.children[n],extend(l,e.leaf?o(a):a),u+=bboxMargin(l);return u},_adjustParentBBoxes:function(e,t,i){for(var r=i;0<=r;r--)extend(t[r],e)},_condense:function(e){for(var t,i=e.length-1;0<=i;i--)0===e[i].children.length?0<i?(t=e[i-1].children).splice(t.indexOf(e[i]),1):this.clear():calcBBox(e[i],this.toBBox)},_initFormat:function(e){var t=["return a"," - b",";"];this.compareMinX=new Function("a","b",t.join(e[0])),this.compareMinY=new Function("a","b",t.join(e[1])),this.toBBox=new Function("a","return {minX: a"+e[0]+", minY: a"+e[1]+", maxX: a"+e[2]+", maxY: a"+e[3]+"};")}},RectangleWithId.fromRectangleAndId=function(e,t,i){return i.minX=t.west,i.minY=t.south,i.maxX=t.east,i.maxY=t.north,i.id=e,i},RectangleCollisionChecker.prototype.insert=function(e,t){var i=RectangleWithId.fromRectangleAndId(e,t,new RectangleWithId);this._tree.insert(i)};var removalScratch=new RectangleWithId;RectangleCollisionChecker.prototype.remove=function(e,t){var i=RectangleWithId.fromRectangleAndId(e,t,removalScratch);this._tree.remove(i,idCompare)};var collisionScratch=new RectangleWithId;RectangleCollisionChecker.prototype.collides=function(e){var t=RectangleWithId.fromRectangleAndId("",e,collisionScratch);return this._tree.collides(t)};var cos$2=Math.cos,sin$2=Math.sin,sqrt=Math.sqrt,RectangleGeometryLibrary={computePosition:function(e,t,i,r,n,a,o){var s=t.radiiSquared,l=e.nwCorner,u=e.boundingRectangle,c=l.latitude-e.granYCos*r+n*e.granXSin,d=cos$2(c),h=sin$2(c),p=s.z*h,f=l.longitude+r*e.granYSin+n*e.granXCos,m=d*cos$2(f),g=d*sin$2(f),y=s.x*m,v=s.y*g,_=sqrt(y*m+v*g+p*h);if(a.x=y/_,a.y=v/_,a.z=p/_,i){var C=e.stNwCorner;defined(C)?(c=C.latitude-e.stGranYCos*r+n*e.stGranXSin,f=C.longitude+r*e.stGranYSin+n*e.stGranXCos,o.x=(f-e.stWest)*e.lonScalar,o.y=(c-e.stSouth)*e.latScalar):(o.x=(f-u.west)*e.lonScalar,o.y=(c-u.south)*e.latScalar)}}},rotationMatrixScratch=new Matrix2,nwCartesian=new Cartesian3,centerScratch$4=new Cartographic,centerCartesian=new Cartesian3,proj=new GeographicProjection;function getRotationOptions(e,t,i,r,n,a,o){var s=Math.cos(t),l=r*s,u=i*s,c=Math.sin(t),d=r*c,h=i*c;nwCartesian=proj.project(e,nwCartesian),nwCartesian=Cartesian3.subtract(nwCartesian,centerCartesian,nwCartesian);var p=Matrix2.fromRotation(t,rotationMatrixScratch);nwCartesian=Matrix2.multiplyByVector(p,nwCartesian,nwCartesian),nwCartesian=Cartesian3.add(nwCartesian,centerCartesian,nwCartesian),a-=1,o-=1;var f=(e=proj.unproject(nwCartesian,e)).latitude,m=f+a*h,g=f-l*o,y=f-l*o+a*h,v=Math.max(f,m,g,y),_=Math.min(f,m,g,y),C=e.longitude,x=C+a*u,b=C+o*d,A=C+o*d+a*u;return{north:v,south:_,east:Math.max(C,x,b,A),west:Math.min(C,x,b,A),granYCos:l,granYSin:d,granXCos:u,granXSin:h,nwCorner:e}}RectangleGeometryLibrary.computeOptions=function(e,t,i,r,n,a,o){var s,l,u,c,d,h=e.east,p=e.west,f=e.north,m=e.south,g=!1,y=!1;f===CesiumMath.PI_OVER_TWO&&(g=!0),m===-CesiumMath.PI_OVER_TWO&&(y=!0);var v=f-m;u=(d=h<p?CesiumMath.TWO_PI-p+h:h-p)/((s=Math.ceil(d/t)+1)-1),c=v/((l=Math.ceil(v/t)+1)-1);var _=Rectangle.northwest(e,a),C=Rectangle.center(e,centerScratch$4);0===i&&0===r||(C.longitude<_.longitude&&(C.longitude+=CesiumMath.TWO_PI),centerCartesian=proj.project(C,centerCartesian));var x=c,b=u,A=Rectangle.clone(e,n),S={granYCos:x,granYSin:0,granXCos:b,granXSin:0,nwCorner:_,boundingRectangle:A,width:s,height:l,northCap:g,southCap:y};if(0!==i){var w=getRotationOptions(_,i,u,c,C,s,l);f=w.north,m=w.south,h=w.east,p=w.west,S.granYCos=w.granYCos,S.granYSin=w.granYSin,S.granXCos=w.granXCos,S.granXSin=w.granXSin,A.north=f,A.south=m,A.east=h,A.west=p}if(0!==r){i-=r;var E=Rectangle.northwest(A,o),T=getRotationOptions(E,i,u,c,C,s,l);S.stGranYCos=T.granYCos,S.stGranXCos=T.granXCos,S.stGranYSin=T.granYSin,S.stGranXSin=T.granXSin,S.stNwCorner=E,S.stWest=T.west,S.stSouth=T.south}return S};var positionScratch$4=new Cartesian3,normalScratch$5=new Cartesian3,tangentScratch$1=new Cartesian3,bitangentScratch$1=new Cartesian3,rectangleScratch$2=new Rectangle,stScratch$1=new Cartesian2,bottomBoundingSphere$2=new BoundingSphere,topBoundingSphere$2=new BoundingSphere;function createAttributes(e,t){var i=new Geometry({attributes:new GeometryAttributes,primitiveType:PrimitiveType$1.TRIANGLES});return i.attributes.position=new GeometryAttribute({componentDatatype:ComponentDatatype$1.DOUBLE,componentsPerAttribute:3,values:t.positions}),e.normal&&(i.attributes.normal=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:t.normals})),e.tangent&&(i.attributes.tangent=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:t.tangents})),e.bitangent&&(i.attributes.bitangent=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:t.bitangents})),i}function calculateAttributes(e,t,i,r){var n=e.length,a=t.normal?new Float32Array(n):void 0,o=t.tangent?new Float32Array(n):void 0,s=t.bitangent?new Float32Array(n):void 0,l=0,u=bitangentScratch$1,c=tangentScratch$1,d=normalScratch$5;if(t.normal||t.tangent||t.bitangent)for(var h=0;h<n;h+=3){var p=Cartesian3.fromArray(e,h,positionScratch$4),f=l+1,m=l+2;d=i.geodeticSurfaceNormal(p,d),(t.tangent||t.bitangent)&&(Cartesian3.cross(Cartesian3.UNIT_Z,d,c),Matrix3.multiplyByVector(r,c,c),Cartesian3.normalize(c,c),t.bitangent&&Cartesian3.normalize(Cartesian3.cross(d,c,u),u)),t.normal&&(a[l]=d.x,a[f]=d.y,a[m]=d.z),t.tangent&&(o[l]=c.x,o[f]=c.y,o[m]=c.z),t.bitangent&&(s[l]=u.x,s[f]=u.y,s[m]=u.z),l+=3}return createAttributes(t,{positions:e,normals:a,tangents:o,bitangents:s})}var v1Scratch=new Cartesian3,v2Scratch=new Cartesian3;function calculateAttributesWall(e,t,i){var r=e.length,n=t.normal?new Float32Array(r):void 0,a=t.tangent?new Float32Array(r):void 0,o=t.bitangent?new Float32Array(r):void 0,s=0,l=0,u=0,c=!0,d=bitangentScratch$1,h=tangentScratch$1,p=normalScratch$5;if(t.normal||t.tangent||t.bitangent)for(var f=0;f<r;f+=6){var m=Cartesian3.fromArray(e,f,positionScratch$4),g=Cartesian3.fromArray(e,(f+6)%r,v1Scratch);if(c){var y=Cartesian3.fromArray(e,(f+3)%r,v2Scratch);Cartesian3.subtract(g,m,g),Cartesian3.subtract(y,m,y),p=Cartesian3.normalize(Cartesian3.cross(y,g,p),p),c=!1}Cartesian3.equalsEpsilon(g,m,CesiumMath.EPSILON10)&&(c=!0),(t.tangent||t.bitangent)&&(d=i.geodeticSurfaceNormal(m,d),t.tangent&&(h=Cartesian3.normalize(Cartesian3.cross(d,p,h),h))),t.normal&&(n[s++]=p.x,n[s++]=p.y,n[s++]=p.z,n[s++]=p.x,n[s++]=p.y,n[s++]=p.z),t.tangent&&(a[l++]=h.x,a[l++]=h.y,a[l++]=h.z,a[l++]=h.x,a[l++]=h.y,a[l++]=h.z),t.bitangent&&(o[u++]=d.x,o[u++]=d.y,o[u++]=d.z,o[u++]=d.x,o[u++]=d.y,o[u++]=d.z)}return createAttributes(t,{positions:e,normals:n,tangents:a,bitangents:o})}function constructRectangle(e,t){var i=e._vertexFormat,r=e._ellipsoid,n=t.height,a=t.width,o=t.northCap,s=t.southCap,l=0,u=n,c=n,d=0;o&&(c-=l=1,d+=1),s&&(u-=1,c-=1,d+=1),d+=a*c;for(var h=i.position?new Float64Array(3*d):void 0,p=i.st?new Float32Array(2*d):void 0,f=0,m=0,g=positionScratch$4,y=stScratch$1,v=Number.MAX_VALUE,_=Number.MAX_VALUE,C=-Number.MAX_VALUE,x=-Number.MAX_VALUE,b=l;b<u;++b)for(var A=0;A<a;++A)RectangleGeometryLibrary.computePosition(t,r,i.st,b,A,g,y),h[f++]=g.x,h[f++]=g.y,h[f++]=g.z,i.st&&(p[m++]=y.x,p[m++]=y.y,v=Math.min(v,y.x),_=Math.min(_,y.y),C=Math.max(C,y.x),x=Math.max(x,y.y));if(o&&(RectangleGeometryLibrary.computePosition(t,r,i.st,0,0,g,y),h[f++]=g.x,h[f++]=g.y,h[f++]=g.z,i.st&&(p[m++]=y.x,p[m++]=y.y,v=y.x,_=y.y,C=y.x,x=y.y)),s&&(RectangleGeometryLibrary.computePosition(t,r,i.st,n-1,0,g,y),h[f++]=g.x,h[f++]=g.y,h[f]=g.z,i.st&&(p[m++]=y.x,p[m]=y.y,v=Math.min(v,y.x),_=Math.min(_,y.y),C=Math.max(C,y.x),x=Math.max(x,y.y))),i.st&&(v<0||_<0||1<C||1<x))for(var S=0;S<p.length;S+=2)p[S]=(p[S]-v)/(C-v),p[S+1]=(p[S+1]-_)/(x-_);var w=calculateAttributes(h,i,r,t.tangentRotationMatrix),E=6*(a-1)*(c-1);o&&(E+=3*(a-1)),s&&(E+=3*(a-1));var T,P=IndexDatatype$1.createTypedArray(d,E),M=0,D=0;for(T=0;T<c-1;++T){for(var I=0;I<a-1;++I){var O=M,R=O+a,L=R+1,N=O+1;P[D++]=O,P[D++]=R,P[D++]=N,P[D++]=N,P[D++]=R,P[D++]=L,++M}++M}if(o||s){var k,B,F=d-1,V=d-1;if(o&&s&&(F=d-2),M=0,o)for(T=0;T<a-1;T++)B=(k=M)+1,P[D++]=F,P[D++]=k,P[D++]=B,++M;if(s)for(M=(c-1)*a,T=0;T<a-1;T++)B=(k=M)+1,P[D++]=k,P[D++]=V,P[D++]=B,++M}return w.indices=P,i.st&&(w.attributes.st=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:2,values:p})),w}function addWallPositions$1(e,t,i,r,n){return e[t++]=r[i],e[t++]=r[i+1],e[t++]=r[i+2],e[t++]=n[i],e[t++]=n[i+1],e[t]=n[i+2],e}function addWallTextureCoordinates(e,t,i,r){return e[t++]=r[i],e[t++]=r[i+1],e[t++]=r[i],e[t]=r[i+1],e}var scratchVertexFormat$b=new VertexFormat;function constructExtrudedRectangle(e,t){var i,r=e._shadowVolume,n=e._offsetAttribute,a=e._vertexFormat,o=e._extrudedHeight,s=e._surfaceHeight,l=e._ellipsoid,u=t.height,c=t.width;if(r){var d=VertexFormat.clone(a,scratchVertexFormat$b);d.normal=!0,e._vertexFormat=d}var h=constructRectangle(e,t);r&&(e._vertexFormat=a);var p=PolygonPipeline.scaleToGeodeticHeight(h.attributes.position.values,s,l,!1),f=(p=new Float64Array(p)).length,m=2*f,g=new Float64Array(m);g.set(p);var y=PolygonPipeline.scaleToGeodeticHeight(h.attributes.position.values,o,l);g.set(y,f),h.attributes.position.values=g;var v,_,C=a.normal?new Float32Array(m):void 0,x=a.tangent?new Float32Array(m):void 0,b=a.bitangent?new Float32Array(m):void 0,A=a.st?new Float32Array(m/3*2):void 0;if(a.normal){for(_=h.attributes.normal.values,C.set(_),i=0;i<f;i++)_[i]=-_[i];C.set(_,f),h.attributes.normal.values=C}if(r){_=h.attributes.normal.values,a.normal||(h.attributes.normal=void 0);var S=new Float32Array(m);for(i=0;i<f;i++)_[i]=-_[i];S.set(_,f),h.attributes.extrudeDirection=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:S})}var w=defined(n);if(w){var E=f/3*2,T=new Uint8Array(E);T=n===GeometryOffsetAttribute$1.TOP?arrayFill(T,1,0,E/2):arrayFill(T,n===GeometryOffsetAttribute$1.NONE?0:1),h.attributes.applyOffset=new GeometryAttribute({componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE,componentsPerAttribute:1,values:T})}if(a.tangent){var P=h.attributes.tangent.values;for(x.set(P),i=0;i<f;i++)P[i]=-P[i];x.set(P,f),h.attributes.tangent.values=x}if(a.bitangent){var M=h.attributes.bitangent.values;b.set(M),b.set(M,f),h.attributes.bitangent.values=b}a.st&&(v=h.attributes.st.values,A.set(v),A.set(v,f/3*2),h.attributes.st.values=A);var D=h.indices,I=D.length,O=f/3,R=IndexDatatype$1.createTypedArray(m/3,2*I);for(R.set(D),i=0;i<I;i+=3)R[i+I]=D[i+2]+O,R[i+1+I]=D[i+1]+O,R[i+2+I]=D[i]+O;h.indices=R;var L=t.northCap,N=t.southCap,k=u,B=2,F=0,V=4,z=4;L&&(B-=1,k-=1,F+=1,V-=2,z-=1),N&&(B-=1,k-=1,F+=1,V-=2,z-=1);var U=2*((F+=B*c+2*k-V)+z),G=new Float64Array(3*U),$=r?new Float32Array(3*U):void 0,H=w?new Uint8Array(U):void 0,W=a.st?new Float32Array(2*U):void 0,j=n===GeometryOffsetAttribute$1.TOP;w&&!j&&(H=arrayFill(H,n===GeometryOffsetAttribute$1.ALL?1:0));var q,Q=0,Y=0,X=0,Z=0,J=c*k;for(i=0;i<J;i+=c)G=addWallPositions$1(G,Q,q=3*i,p,y),Q+=6,a.st&&(W=addWallTextureCoordinates(W,Y,2*i,v),Y+=4),r&&(X+=3,$[X++]=_[q],$[X++]=_[q+1],$[X++]=_[q+2]),j&&(H[Z++]=1,Z+=1);if(N){var K=L?1+J:J;for(q=3*K,i=0;i<2;i++)G=addWallPositions$1(G,Q,q,p,y),Q+=6,a.st&&(W=addWallTextureCoordinates(W,Y,2*K,v),Y+=4),r&&(X+=3,$[X++]=_[q],$[X++]=_[q+1],$[X++]=_[q+2]),j&&(H[Z++]=1,Z+=1)}else for(i=J-c;i<J;i++)G=addWallPositions$1(G,Q,q=3*i,p,y),Q+=6,a.st&&(W=addWallTextureCoordinates(W,Y,2*i,v),Y+=4),r&&(X+=3,$[X++]=_[q],$[X++]=_[q+1],$[X++]=_[q+2]),j&&(H[Z++]=1,Z+=1);for(i=J-1;0<i;i-=c)G=addWallPositions$1(G,Q,q=3*i,p,y),Q+=6,a.st&&(W=addWallTextureCoordinates(W,Y,2*i,v),Y+=4),r&&(X+=3,$[X++]=_[q],$[X++]=_[q+1],$[X++]=_[q+2]),j&&(H[Z++]=1,Z+=1);if(L){var ee=J;for(q=3*ee,i=0;i<2;i++)G=addWallPositions$1(G,Q,q,p,y),Q+=6,a.st&&(W=addWallTextureCoordinates(W,Y,2*ee,v),Y+=4),r&&(X+=3,$[X++]=_[q],$[X++]=_[q+1],$[X++]=_[q+2]),j&&(H[Z++]=1,Z+=1)}else for(i=c-1;0<=i;i--)G=addWallPositions$1(G,Q,q=3*i,p,y),Q+=6,a.st&&(W=addWallTextureCoordinates(W,Y,2*i,v),Y+=4),r&&(X+=3,$[X++]=_[q],$[X++]=_[q+1],$[X++]=_[q+2]),j&&(H[Z++]=1,Z+=1);var te=calculateAttributesWall(G,a,l);a.st&&(te.attributes.st=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:2,values:W})),r&&(te.attributes.extrudeDirection=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:$})),w&&(te.attributes.applyOffset=new GeometryAttribute({componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE,componentsPerAttribute:1,values:H}));var ie,re,ne,ae,oe=IndexDatatype$1.createTypedArray(U,6*F);f=G.length/3;var se=0;for(i=0;i<f-1;i+=2){ae=((ie=i)+2)%f;var le=Cartesian3.fromArray(G,3*ie,v1Scratch),ue=Cartesian3.fromArray(G,3*ae,v2Scratch);Cartesian3.equalsEpsilon(le,ue,CesiumMath.EPSILON10)||(ne=(2+(re=(ie+1)%f))%f,oe[se++]=ie,oe[se++]=re,oe[se++]=ae,oe[se++]=ae,oe[se++]=re,oe[se++]=ne)}return te.indices=oe,(te=GeometryPipeline.combineInstances([new GeometryInstance({geometry:h}),new GeometryInstance({geometry:te})]))[0]}var scratchRectanglePoints=[new Cartesian3,new Cartesian3,new Cartesian3,new Cartesian3],nwScratch=new Cartographic,stNwScratch=new Cartographic;function computeRectangle$3(e,t,i,r,n){if(0===i)return Rectangle.clone(e,n);var a=RectangleGeometryLibrary.computeOptions(e,t,i,0,rectangleScratch$2,nwScratch),o=a.height,s=a.width,l=scratchRectanglePoints;return RectangleGeometryLibrary.computePosition(a,r,!1,0,0,l[0]),RectangleGeometryLibrary.computePosition(a,r,!1,0,s-1,l[1]),RectangleGeometryLibrary.computePosition(a,r,!1,o-1,0,l[2]),RectangleGeometryLibrary.computePosition(a,r,!1,o-1,s-1,l[3]),Rectangle.fromCartesianArray(l,r,n)}function RectangleGeometry(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).rectangle,i=defaultValue(e.height,0),r=defaultValue(e.extrudedHeight,i);this._rectangle=Rectangle.clone(t),this._granularity=defaultValue(e.granularity,CesiumMath.RADIANS_PER_DEGREE),this._ellipsoid=Ellipsoid.clone(defaultValue(e.ellipsoid,Ellipsoid.WGS84)),this._surfaceHeight=Math.max(i,r),this._rotation=defaultValue(e.rotation,0),this._stRotation=defaultValue(e.stRotation,0),this._vertexFormat=VertexFormat.clone(defaultValue(e.vertexFormat,VertexFormat.DEFAULT)),this._extrudedHeight=Math.min(i,r),this._shadowVolume=defaultValue(e.shadowVolume,!1),this._workerName="createRectangleGeometry",this._offsetAttribute=e.offsetAttribute,this._rotatedRectangle=void 0,this._textureCoordinateRotationPoints=void 0}RectangleGeometry.packedLength=Rectangle.packedLength+Ellipsoid.packedLength+VertexFormat.packedLength+7,RectangleGeometry.pack=function(e,t,i){return i=defaultValue(i,0),Rectangle.pack(e._rectangle,t,i),i+=Rectangle.packedLength,Ellipsoid.pack(e._ellipsoid,t,i),i+=Ellipsoid.packedLength,VertexFormat.pack(e._vertexFormat,t,i),i+=VertexFormat.packedLength,t[i++]=e._granularity,t[i++]=e._surfaceHeight,t[i++]=e._rotation,t[i++]=e._stRotation,t[i++]=e._extrudedHeight,t[i++]=e._shadowVolume?1:0,t[i]=defaultValue(e._offsetAttribute,-1),t};var scratchRectangle=new Rectangle,scratchEllipsoid$a=Ellipsoid.clone(Ellipsoid.UNIT_SPHERE),scratchOptions$j={rectangle:scratchRectangle,ellipsoid:scratchEllipsoid$a,vertexFormat:scratchVertexFormat$b,granularity:void 0,height:void 0,rotation:void 0,stRotation:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};RectangleGeometry.unpack=function(e,t,i){t=defaultValue(t,0);var r=Rectangle.unpack(e,t,scratchRectangle);t+=Rectangle.packedLength;var n=Ellipsoid.unpack(e,t,scratchEllipsoid$a);t+=Ellipsoid.packedLength;var a=VertexFormat.unpack(e,t,scratchVertexFormat$b);t+=VertexFormat.packedLength;var o=e[t++],s=e[t++],l=e[t++],u=e[t++],c=e[t++],d=1===e[t++],h=e[t];return defined(i)?(i._rectangle=Rectangle.clone(r,i._rectangle),i._ellipsoid=Ellipsoid.clone(n,i._ellipsoid),i._vertexFormat=VertexFormat.clone(a,i._vertexFormat),i._granularity=o,i._surfaceHeight=s,i._rotation=l,i._stRotation=u,i._extrudedHeight=c,i._shadowVolume=d,i._offsetAttribute=-1===h?void 0:h,i):(scratchOptions$j.granularity=o,scratchOptions$j.height=s,scratchOptions$j.rotation=l,scratchOptions$j.stRotation=u,scratchOptions$j.extrudedHeight=c,scratchOptions$j.shadowVolume=d,scratchOptions$j.offsetAttribute=-1===h?void 0:h,new RectangleGeometry(scratchOptions$j))},RectangleGeometry.computeRectangle=function(e,t){var i=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).rectangle,r=defaultValue(e.granularity,CesiumMath.RADIANS_PER_DEGREE),n=defaultValue(e.ellipsoid,Ellipsoid.WGS84);return computeRectangle$3(i,r,defaultValue(e.rotation,0),n,t)};var tangentRotationMatrixScratch=new Matrix3,quaternionScratch$3=new Quaternion,centerScratch$5=new Cartographic;RectangleGeometry.createGeometry=function(e){if(!CesiumMath.equalsEpsilon(e._rectangle.north,e._rectangle.south,CesiumMath.EPSILON10)&&!CesiumMath.equalsEpsilon(e._rectangle.east,e._rectangle.west,CesiumMath.EPSILON10)){var t=e._rectangle,i=e._ellipsoid,r=e._rotation,n=e._stRotation,a=e._vertexFormat,o=RectangleGeometryLibrary.computeOptions(t,e._granularity,r,n,rectangleScratch$2,nwScratch,stNwScratch),s=tangentRotationMatrixScratch;if(0!==n||0!==r){var l=Rectangle.center(t,centerScratch$5),u=i.geodeticSurfaceNormalCartographic(l,v1Scratch);Quaternion.fromAxisAngle(u,-n,quaternionScratch$3),Matrix3.fromQuaternion(quaternionScratch$3,s)}else Matrix3.clone(Matrix3.IDENTITY,s);var c,d,h=e._surfaceHeight,p=e._extrudedHeight,f=!CesiumMath.equalsEpsilon(h,p,0,CesiumMath.EPSILON2);if(o.lonScalar=1/e._rectangle.width,o.latScalar=1/e._rectangle.height,o.tangentRotationMatrix=s,t=e._rectangle,f){c=constructExtrudedRectangle(e,o);var m=BoundingSphere.fromRectangle3D(t,i,h,topBoundingSphere$2),g=BoundingSphere.fromRectangle3D(t,i,p,bottomBoundingSphere$2);d=BoundingSphere.union(m,g)}else{if((c=constructRectangle(e,o)).attributes.position.values=PolygonPipeline.scaleToGeodeticHeight(c.attributes.position.values,h,i,!1),defined(e._offsetAttribute)){var y=c.attributes.position.values.length,v=new Uint8Array(y/3);arrayFill(v,e._offsetAttribute===GeometryOffsetAttribute$1.NONE?0:1),c.attributes.applyOffset=new GeometryAttribute({componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE,componentsPerAttribute:1,values:v})}d=BoundingSphere.fromRectangle3D(t,i,h)}return a.position||delete c.attributes.position,new Geometry({attributes:c.attributes,indices:c.indices,primitiveType:c.primitiveType,boundingSphere:d,offsetAttribute:e._offsetAttribute})}},RectangleGeometry.createShadowVolume=function(e,t,i){var r=e._granularity,n=e._ellipsoid,a=t(r,n),o=i(r,n);return new RectangleGeometry({rectangle:e._rectangle,rotation:e._rotation,ellipsoid:n,stRotation:e._stRotation,granularity:r,extrudedHeight:o,height:a,vertexFormat:VertexFormat.POSITION_ONLY,shadowVolume:!0})};var unrotatedTextureRectangleScratch=new Rectangle,points2DScratch$2=[new Cartesian2,new Cartesian2,new Cartesian2],rotation2DScratch$1=new Matrix2,rectangleCenterScratch$2=new Cartographic;function textureCoordinateRotationPoints$2(e){if(0===e._stRotation)return[0,0,0,1,1,0];var t=Rectangle.clone(e._rectangle,unrotatedTextureRectangleScratch),i=e._granularity,r=e._ellipsoid,n=computeRectangle$3(t,i,e._rotation-e._stRotation,r,unrotatedTextureRectangleScratch),a=points2DScratch$2;a[0].x=n.west,a[0].y=n.south,a[1].x=n.west,a[1].y=n.north,a[2].x=n.east,a[2].y=n.south;for(var o=e.rectangle,s=Matrix2.fromRotation(e._stRotation,rotation2DScratch$1),l=Rectangle.center(o,rectangleCenterScratch$2),u=0;u<3;++u){var c=a[u];c.x-=l.longitude,c.y-=l.latitude,Matrix2.multiplyByVector(s,c,c),c.x+=l.longitude,c.y+=l.latitude,c.x=(c.x-o.west)/o.width,c.y=(c.y-o.south)/o.height}var d=a[0],h=a[1],p=a[2],f=new Array(6);return Cartesian2.pack(d,f),Cartesian2.pack(h,f,2),Cartesian2.pack(p,f,4),f}Object.defineProperties(RectangleGeometry.prototype,{rectangle:{get:function(){return defined(this._rotatedRectangle)||(this._rotatedRectangle=computeRectangle$3(this._rectangle,this._granularity,this._rotation,this._ellipsoid)),this._rotatedRectangle}},textureCoordinateRotationPoints:{get:function(){return defined(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=textureCoordinateRotationPoints$2(this)),this._textureCoordinateRotationPoints}}});var bottomBoundingSphere$3=new BoundingSphere,topBoundingSphere$3=new BoundingSphere,positionScratch$5=new Cartesian3,rectangleScratch$3=new Rectangle;function constructRectangle$1(e,t){var i=e._ellipsoid,r=t.height,n=t.width,a=t.northCap,o=t.southCap,s=r,l=2,u=0,c=4;a&&(l-=1,s-=1,u+=1,c-=2),o&&(l-=1,s-=1,u+=1,c-=2),u+=l*n+2*s-c;var d,h=new Float64Array(3*u),p=0,f=0,m=positionScratch$5;if(a)RectangleGeometryLibrary.computePosition(t,i,!1,f,0,m),h[p++]=m.x,h[p++]=m.y,h[p++]=m.z;else for(d=0;d<n;d++)RectangleGeometryLibrary.computePosition(t,i,!1,f,d,m),h[p++]=m.x,h[p++]=m.y,h[p++]=m.z;for(d=n-1,f=1;f<r;f++)RectangleGeometryLibrary.computePosition(t,i,!1,f,d,m),h[p++]=m.x,h[p++]=m.y,h[p++]=m.z;if(f=r-1,!o)for(d=n-2;0<=d;d--)RectangleGeometryLibrary.computePosition(t,i,!1,f,d,m),h[p++]=m.x,h[p++]=m.y,h[p++]=m.z;for(d=0,f=r-2;0<f;f--)RectangleGeometryLibrary.computePosition(t,i,!1,f,d,m),h[p++]=m.x,h[p++]=m.y,h[p++]=m.z;for(var g=h.length/3*2,y=IndexDatatype$1.createTypedArray(h.length/3,g),v=0,_=0;_<h.length/3-1;_++)y[v++]=_,y[v++]=_+1;y[v++]=h.length/3-1,y[v++]=0;var C=new Geometry({attributes:new GeometryAttributes,primitiveType:PrimitiveType$1.LINES});return C.attributes.position=new GeometryAttribute({componentDatatype:ComponentDatatype$1.DOUBLE,componentsPerAttribute:3,values:h}),C.indices=y,C}function constructExtrudedRectangle$1(e,t){var i=e._surfaceHeight,r=e._extrudedHeight,n=e._ellipsoid,a=r,o=i,s=constructRectangle$1(e,t),l=t.height,u=t.width,c=PolygonPipeline.scaleToGeodeticHeight(s.attributes.position.values,o,n,!1),d=c.length,h=new Float64Array(2*d);h.set(c);var p=PolygonPipeline.scaleToGeodeticHeight(s.attributes.position.values,a,n);h.set(p,d),s.attributes.position.values=h;var f=t.northCap,m=t.southCap,g=4;f&&(g-=1),m&&(g-=1);var y=2*(h.length/3+g),v=IndexDatatype$1.createTypedArray(h.length/3,y);d=h.length/6;for(var _,C=0,x=0;x<d-1;x++)v[C++]=x,v[C++]=x+1,v[C++]=x+d,v[C++]=x+d+1;if(v[C++]=d-1,v[C++]=0,v[C++]=d+d-1,v[C++]=d,v[C++]=0,v[C++]=d,f)_=l-1;else{var b=u-1;v[C++]=b,v[C++]=b+d,_=u+l-2}if(v[C++]=_,v[C++]=_+d,!m){var A=u+_-1;v[C++]=A,v[C]=A+d}return s.indices=v,s}function RectangleOutlineGeometry(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).rectangle,i=defaultValue(e.granularity,CesiumMath.RADIANS_PER_DEGREE),r=defaultValue(e.ellipsoid,Ellipsoid.WGS84),n=defaultValue(e.rotation,0),a=defaultValue(e.height,0),o=defaultValue(e.extrudedHeight,a);this._rectangle=Rectangle.clone(t),this._granularity=i,this._ellipsoid=r,this._surfaceHeight=Math.max(a,o),this._rotation=n,this._extrudedHeight=Math.min(a,o),this._offsetAttribute=e.offsetAttribute,this._workerName="createRectangleOutlineGeometry"}RectangleOutlineGeometry.packedLength=Rectangle.packedLength+Ellipsoid.packedLength+5,RectangleOutlineGeometry.pack=function(e,t,i){return i=defaultValue(i,0),Rectangle.pack(e._rectangle,t,i),i+=Rectangle.packedLength,Ellipsoid.pack(e._ellipsoid,t,i),i+=Ellipsoid.packedLength,t[i++]=e._granularity,t[i++]=e._surfaceHeight,t[i++]=e._rotation,t[i++]=e._extrudedHeight,t[i]=defaultValue(e._offsetAttribute,-1),t};var scratchRectangle$1=new Rectangle,scratchEllipsoid$b=Ellipsoid.clone(Ellipsoid.UNIT_SPHERE),scratchOptions$k={rectangle:scratchRectangle$1,ellipsoid:scratchEllipsoid$b,granularity:void 0,height:void 0,rotation:void 0,extrudedHeight:void 0,offsetAttribute:void 0};RectangleOutlineGeometry.unpack=function(e,t,i){t=defaultValue(t,0);var r=Rectangle.unpack(e,t,scratchRectangle$1);t+=Rectangle.packedLength;var n=Ellipsoid.unpack(e,t,scratchEllipsoid$b);t+=Ellipsoid.packedLength;var a=e[t++],o=e[t++],s=e[t++],l=e[t++],u=e[t];return defined(i)?(i._rectangle=Rectangle.clone(r,i._rectangle),i._ellipsoid=Ellipsoid.clone(n,i._ellipsoid),i._surfaceHeight=o,i._rotation=s,i._extrudedHeight=l,i._offsetAttribute=-1===u?void 0:u,i):(scratchOptions$k.granularity=a,scratchOptions$k.height=o,scratchOptions$k.rotation=s,scratchOptions$k.extrudedHeight=l,scratchOptions$k.offsetAttribute=-1===u?void 0:u,new RectangleOutlineGeometry(scratchOptions$k))};var nwScratch$1=new Cartographic,implementation$2;function requestAnimationFramePolyFill(e){return implementation$2(e)}function sampleTerrain(e,t,i){return e.readyPromise.then(function(){return doSampling(e,t,i)})}function doSampling(e,t,i){var r,n=e.tilingScheme,a=[],o={};for(r=0;r<i.length;++r){var s=n.positionToTileXY(i[r],t),l=s.toString();if(!o.hasOwnProperty(l)){var u={x:s.x,y:s.y,level:t,tilingScheme:n,terrainProvider:e,positions:[]};o[l]=u,a.push(u)}o[l].positions.push(i[r])}var c=[];for(r=0;r<a.length;++r){var d=a[r],h=d.terrainProvider.requestTileGeometry(d.x,d.y,d.level).then(createInterpolateFunction(d)).otherwise(createMarkFailedFunction(d));c.push(h)}return when.all(c,function(){return i})}function createInterpolateFunction(e){var r=e.positions,n=e.tilingScheme.tileXYToRectangle(e.x,e.y,e.level);return function(e){for(var t=0;t<r.length;++t){var i=r[t];i.height=e.interpolateHeight(n,i.longitude,i.latitude)}}}function createMarkFailedFunction(e){var t=e.positions;return function(){for(var e=0;e<t.length;++e){t[e].height=void 0}}}RectangleOutlineGeometry.createGeometry=function(e){var t,i,r=e._rectangle,n=e._ellipsoid,a=RectangleGeometryLibrary.computeOptions(r,e._granularity,e._rotation,0,rectangleScratch$3,nwScratch$1);if(!CesiumMath.equalsEpsilon(r.north,r.south,CesiumMath.EPSILON10)&&!CesiumMath.equalsEpsilon(r.east,r.west,CesiumMath.EPSILON10)){var o=e._surfaceHeight,s=e._extrudedHeight;if(!CesiumMath.equalsEpsilon(o,s,0,CesiumMath.EPSILON2)){if(t=constructExtrudedRectangle$1(e,a),defined(e._offsetAttribute)){var l=t.attributes.position.values.length/3,u=new Uint8Array(l);u=e._offsetAttribute===GeometryOffsetAttribute$1.TOP?arrayFill(u,1,0,l/2):arrayFill(u,e._offsetAttribute===GeometryOffsetAttribute$1.NONE?0:1),t.attributes.applyOffset=new GeometryAttribute({componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE,componentsPerAttribute:1,values:u})}var c=BoundingSphere.fromRectangle3D(r,n,o,topBoundingSphere$3),d=BoundingSphere.fromRectangle3D(r,n,s,bottomBoundingSphere$3);i=BoundingSphere.union(c,d)}else{if((t=constructRectangle$1(e,a)).attributes.position.values=PolygonPipeline.scaleToGeodeticHeight(t.attributes.position.values,o,n,!1),defined(e._offsetAttribute)){var h=t.attributes.position.values.length,p=new Uint8Array(h/3);arrayFill(p,e._offsetAttribute===GeometryOffsetAttribute$1.NONE?0:1),t.attributes.applyOffset=new GeometryAttribute({componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE,componentsPerAttribute:1,values:p})}i=BoundingSphere.fromRectangle3D(r,n,o)}return new Geometry({attributes:t.attributes,indices:t.indices,primitiveType:PrimitiveType$1.LINES,boundingSphere:i,offsetAttribute:e._offsetAttribute})}},"undefined"!=typeof requestAnimationFrame&&(implementation$2=requestAnimationFrame),function(){if(!defined(implementation$2)&&"undefined"!=typeof window)for(var e=["webkit","moz","ms","o"],t=0,i=e.length;t<i&&!defined(implementation$2);)implementation$2=window[e[t]+"RequestAnimationFrame"],++t;if(!defined(implementation$2)){var r=0;implementation$2=function(e){var t=getTimestamp$1(),i=Math.max(1e3/60-(t-r),0);return r=t+i,setTimeout(function(){e(r)},i)}}}();var scratchCartesian2$d=new Cartesian2;function sampleTerrainMostDetailed(u,c){return u.readyPromise.then(function(){for(var e=[],r=[],n=u.availability,t=[],i=0;i<c.length;++i){var a=c[i],o=n.computeMaximumLevelAtPosition(a);if(0===(r[i]=o)){u.tilingScheme.positionToTileXY(a,1,scratchCartesian2$d);var s=u.loadTileDataAvailability(scratchCartesian2$d.x,scratchCartesian2$d.y,1);defined(s)&&t.push(s)}var l=e[o];defined(l)||(e[o]=l=[]),l.push(a)}return when.all(t).then(function(){return when.all(e.map(function(e,t){if(defined(e))return sampleTerrain(u,t,e)}))}).then(function(){for(var e=[],t=0;t<c.length;++t){var i=c[t];n.computeMaximumLevelAtPosition(i)!==r[t]&&e.push(i)}if(0<e.length)return sampleTerrainMostDetailed(u,e)}).then(function(){return c})})}function ShowGeometryInstanceAttribute(e){e=defaultValue(e,!0),this.value=ShowGeometryInstanceAttribute.toValue(e)}Object.defineProperties(ShowGeometryInstanceAttribute.prototype,{componentDatatype:{get:function(){return ComponentDatatype$1.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 1}},normalize:{get:function(){return!1}}}),ShowGeometryInstanceAttribute.toValue=function(e,t){return defined(t)?(t[0]=e,t):new Uint8Array([e])};var Simon1994PlanetaryPositions={};function computeTdbMinusTtSpice(e){var t=6.239996+.0172019696544*e;return.001657*Math.sin(t+.01671*Math.sin(t))}var TdtMinusTai$1=32.184,J2000d$1=2451545;function taiToTdb(e,t){t=JulianDate.addSeconds(e,TdtMinusTai$1,t);var i=JulianDate.totalDays(t)-J2000d$1;return t=JulianDate.addSeconds(t,computeTdbMinusTtSpice(i),t)}var epoch=new JulianDate(2451545,0,TimeStandard$1.TAI),MetersPerKilometer=1e3,RadiansPerDegree=CesiumMath.RADIANS_PER_DEGREE,RadiansPerArcSecond=CesiumMath.RADIANS_PER_ARCSECOND,MetersPerAstronomicalUnit=14959787e4,perifocalToEquatorial=new Matrix3;function elementsToCartesian(e,t,i,r,n,a,o){i<0&&(i=-i,n+=CesiumMath.PI);var s=e*(1-t),l=r-n,u=n,c=meanAnomalyToTrueAnomaly(a-r,t);perifocalToCartesianMatrix(l,i,u,perifocalToEquatorial);var d=s*(1+t),h=Math.cos(c),p=Math.sin(c),f=d/(1+t*h);return defined(o)?(o.x=f*h,o.y=f*p,o.z=0):o=new Cartesian3(f*h,f*p,0),Matrix3.multiplyByVector(perifocalToEquatorial,o,o)}function meanAnomalyToTrueAnomaly(e,t){return eccentricAnomalyToTrueAnomaly(meanAnomalyToEccentricAnomaly(e,t),t)}var maxIterationCount=50,keplerEqConvergence=CesiumMath.EPSILON8;function meanAnomalyToEccentricAnomaly(e,t){var i,r=Math.floor(e/CesiumMath.TWO_PI),n=(e-=r*CesiumMath.TWO_PI)+t*Math.sin(e)/(1-Math.sin(e+t)+Math.sin(e)),a=Number.MAX_VALUE;for(i=0;i<maxIterationCount&&Math.abs(a-n)>keplerEqConvergence;++i){n=(a=n)-(a-t*Math.sin(a)-e)/(1-t*Math.cos(a))}return a=n+r*CesiumMath.TWO_PI}function eccentricAnomalyToTrueAnomaly(e,t){var i=Math.floor(e/CesiumMath.TWO_PI);e-=i*CesiumMath.TWO_PI;var r=Math.cos(e)-t,n=Math.sin(e)*Math.sqrt(1-t*t),a=Math.atan2(n,r);return a=CesiumMath.zeroToTwoPi(a),e<0&&(a-=CesiumMath.TWO_PI),a+=i*CesiumMath.TWO_PI}function perifocalToCartesianMatrix(e,t,i,r){var n=Math.cos(e),a=Math.sin(e),o=Math.cos(t),s=Math.sin(t),l=Math.cos(i),u=Math.sin(i);return defined(r)?(r[0]=l*n-u*a*o,r[1]=u*n+l*a*o,r[2]=a*s,r[3]=-l*a-u*n*o,r[4]=-u*a+l*n*o,r[5]=n*s,r[6]=u*s,r[7]=-l*s,r[8]=o):r=new Matrix3(l*n-u*a*o,-l*a-u*n*o,u*s,u*n+l*a*o,-u*a+l*n*o,-l*s,a*s,n*s,o),r}var semiMajorAxis0=1.0000010178*MetersPerAstronomicalUnit,meanLongitude0=100.46645683*RadiansPerDegree,meanLongitude1=1295977422.83429*RadiansPerArcSecond,p1u=16002,p2u=21863,p3u=32004,p4u=10931,p5u=14529,p6u=16368,p7u=15318,p8u=32794,Ca1=64e-7*MetersPerAstronomicalUnit,Ca2=-152e-7*MetersPerAstronomicalUnit,Ca3=62e-7*MetersPerAstronomicalUnit,Ca4=-8e-7*MetersPerAstronomicalUnit,Ca5=32e-7*MetersPerAstronomicalUnit,Ca6=-41e-7*MetersPerAstronomicalUnit,Ca7=19e-7*MetersPerAstronomicalUnit,Ca8=-11e-7*MetersPerAstronomicalUnit,Sa1=1e-7*-150*MetersPerAstronomicalUnit,Sa2=-46e-7*MetersPerAstronomicalUnit,Sa3=68*1e-7*MetersPerAstronomicalUnit,Sa4=54e-7*MetersPerAstronomicalUnit,Sa5=14e-7*MetersPerAstronomicalUnit,Sa6=24e-7*MetersPerAstronomicalUnit,Sa7=-28e-7*MetersPerAstronomicalUnit,Sa8=22e-7*MetersPerAstronomicalUnit,q1u=10,q2u=16002,q3u=21863,q4u=10931,q5u=1473,q6u=32004,q7u=4387,q8u=73,Cl1=-325e-7,Cl2=-322e-7,Cl3=1e-7*-79,Cl4=232*1e-7,Cl5=1e-7*-52,Cl6=97e-7,Cl7=55e-7,Cl8=-41e-7,Sl1=-105e-7,Sl2=-137e-7,Sl3=258e-7,Sl4=35e-7,Sl5=1e-7*-116,Sl6=-88e-7,Sl7=-112e-7,Sl8=-8e-6,scratchDate=new JulianDate(0,0,TimeStandard$1.TAI);function computeSimonEarthMoonBarycenter(e,t){taiToTdb(e,scratchDate);var i=(scratchDate.dayNumber-epoch.dayNumber+(scratchDate.secondsOfDay-epoch.secondsOfDay)/TimeConstants$1.SECONDS_PER_DAY)/(10*TimeConstants$1.DAYS_PER_JULIAN_CENTURY),r=.3595362*i,n=semiMajorAxis0+Ca1*Math.cos(p1u*r)+Sa1*Math.sin(p1u*r)+Ca2*Math.cos(p2u*r)+Sa2*Math.sin(p2u*r)+Ca3*Math.cos(p3u*r)+Sa3*Math.sin(p3u*r)+Ca4*Math.cos(p4u*r)+Sa4*Math.sin(p4u*r)+Ca5*Math.cos(p5u*r)+Sa5*Math.sin(p5u*r)+Ca6*Math.cos(p6u*r)+Sa6*Math.sin(p6u*r)+Ca7*Math.cos(p7u*r)+Sa7*Math.sin(p7u*r)+Ca8*Math.cos(p8u*r)+Sa8*Math.sin(p8u*r),a=meanLongitude0+meanLongitude1*i+Cl1*Math.cos(q1u*r)+Sl1*Math.sin(q1u*r)+Cl2*Math.cos(q2u*r)+Sl2*Math.sin(q2u*r)+Cl3*Math.cos(q3u*r)+Sl3*Math.sin(q3u*r)+Cl4*Math.cos(q4u*r)+Sl4*Math.sin(q4u*r)+Cl5*Math.cos(q5u*r)+Sl5*Math.sin(q5u*r)+Cl6*Math.cos(q6u*r)+Sl6*Math.sin(q6u*r)+Cl7*Math.cos(q7u*r)+Sl7*Math.sin(q7u*r)+Cl8*Math.cos(q8u*r)+Sl8*Math.sin(q8u*r);return elementsToCartesian(n,.0167086342-.0004203654*i,469.97289*RadiansPerArcSecond*i,102.93734808*RadiansPerDegree+11612.3529*RadiansPerArcSecond*i,174.87317577*RadiansPerDegree-8679.27034*RadiansPerArcSecond*i,a,t)}function computeSimonMoon(e,t){taiToTdb(e,scratchDate);var i=(scratchDate.dayNumber-epoch.dayNumber+(scratchDate.secondsOfDay-epoch.secondsOfDay)/TimeConstants$1.SECONDS_PER_DAY)/TimeConstants$1.DAYS_PER_JULIAN_CENTURY,r=i*i,n=r*i,a=n*i,o=383397.7725+.004*i,s=.055545526-16e-9*i,l=5.15668983*RadiansPerDegree,u=-8e-5*i+.02966*r-42e-6*n-13e-8*a,c=83.35324312*RadiansPerDegree,d=14643420.2669*i-38.2702*r-.045047*n+21301e-8*a,h=125.04455501*RadiansPerDegree,p=-6967919.3631*i+6.3602*r+.007625*n-3586e-8*a,f=218.31664563*RadiansPerDegree,m=1732559343.4847*i-6.391*r+.006588*n-3169e-8*a,g=297.85019547*RadiansPerDegree+RadiansPerArcSecond*(1602961601.209*i-6.3706*r+.006593*n-3169e-8*a),y=134.96340251*RadiansPerDegree+RadiansPerArcSecond*(1717915923.2178*i+31.8792*r+.051635*n-2447e-7*a),v=357.52910918*RadiansPerDegree+RadiansPerArcSecond*(129596581.0481*i-.5532*r+136e-6*n-1149e-8*a),_=310.17137918*RadiansPerDegree-RadiansPerArcSecond*(6967051.436*i+6.2068*r+.007618*n-3219e-8*a),C=2*g,x=4*g,b=6*g,A=2*y,S=3*y,w=4*y,E=2*(93.27209062*RadiansPerDegree+RadiansPerArcSecond*(1739527262.8478*i-12.7512*r-.001037*n+417e-8*a));o+=3400.4*Math.cos(C)-635.6*Math.cos(C-y)-235.6*Math.cos(y)+218.1*Math.cos(C-v)+181*Math.cos(C+y),s+=.014216*Math.cos(C-y)+.008551*Math.cos(C-A)-.001383*Math.cos(y)+.001356*Math.cos(C+y)-.001147*Math.cos(x-S)-914e-6*Math.cos(x-A)+869e-6*Math.cos(C-v-y)-627e-6*Math.cos(C)-394e-6*Math.cos(x-w)+282e-6*Math.cos(C-v-A)-279e-6*Math.cos(g-y)-236e-6*Math.cos(A)+231e-6*Math.cos(x)+229e-6*Math.cos(b-w)-201e-6*Math.cos(A-E),u+=486.26*Math.cos(C-E)-40.13*Math.cos(C)+37.51*Math.cos(E)+25.73*Math.cos(A-E)+19.97*Math.cos(C-v-E),d+=-55609*Math.sin(C-y)-34711*Math.sin(C-A)-9792*Math.sin(y)+9385*Math.sin(x-S)+7505*Math.sin(x-A)+5318*Math.sin(C+y)+3484*Math.sin(x-w)-3417*Math.sin(C-v-y)-2530*Math.sin(b-w)-2376*Math.sin(C)-2075*Math.sin(C-S)-1883*Math.sin(A)-1736*Math.sin(b-5*y)+1626*Math.sin(v)-1370*Math.sin(b-S),p+=-5392*Math.sin(C-E)-540*Math.sin(v)-441*Math.sin(C)+423*Math.sin(E)-288*Math.sin(A-E),m+=-3332.9*Math.sin(C)+1197.4*Math.sin(C-y)-662.5*Math.sin(v)+396.3*Math.sin(y)-218*Math.sin(C-v);var T=2*_,P=3*_;u+=46.997*Math.cos(_)*i-.614*Math.cos(C-E+_)*i+.614*Math.cos(C-E-_)*i-.0297*Math.cos(T)*r-.0335*Math.cos(_)*r+.0012*Math.cos(C-E+T)*r-16e-5*Math.cos(_)*n+4e-5*Math.cos(P)*n+4e-5*Math.cos(T)*n;var M=2.116*Math.sin(_)*i-.111*Math.sin(C-E-_)*i-.0015*Math.sin(_)*r;return d+=M,m+=M,p+=-520.77*Math.sin(_)*i+13.66*Math.sin(C-E+_)*i+1.12*Math.sin(C-_)*i-1.06*Math.sin(E-_)*i+.66*Math.sin(T)*r+.371*Math.sin(_)*r-.035*Math.sin(C-E+T)*r-.015*Math.sin(C-E+_)*r+.0014*Math.sin(_)*n-.0011*Math.sin(P)*n-9e-4*Math.sin(T)*n,elementsToCartesian(o*=MetersPerKilometer,s,l+u*RadiansPerArcSecond,c+d*RadiansPerArcSecond,h+p*RadiansPerArcSecond,f+m*RadiansPerArcSecond,t)}var moonEarthMassRatio=.012300034,factor=moonEarthMassRatio/(moonEarthMassRatio+1)*-1;function computeSimonEarth(e,t){return t=computeSimonMoon(e,t),Cartesian3.multiplyByScalar(t,factor,t)}var axesTransformation=new Matrix3(1.0000000000000002,5619723173785822e-31,4690511510146299e-34,-5154129427414611e-31,.9174820620691819,-.39777715593191376,-223970096136568e-30,.39777715593191376,.9174820620691819),translation$1=new Cartesian3;function interpolateColors$1(e,t,i,r,n,a,o){var s,l=PolylinePipeline.numberOfPoints(e,t,n),u=i.red,c=i.green,d=i.blue,h=i.alpha,p=r.red,f=r.green,m=r.blue,g=r.alpha;if(Color.equals(i,r)){for(s=0;s<l;s++)a[o++]=Color.floatToByte(u),a[o++]=Color.floatToByte(c),a[o++]=Color.floatToByte(d),a[o++]=Color.floatToByte(h);return o}var y=(p-u)/l,v=(f-c)/l,_=(m-d)/l,C=(g-h)/l,x=o;for(s=0;s<l;s++)a[x++]=Color.floatToByte(u+s*y),a[x++]=Color.floatToByte(c+s*v),a[x++]=Color.floatToByte(d+s*_),a[x++]=Color.floatToByte(h+s*C);return x}function SimplePolylineGeometry(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).positions,i=e.colors,r=defaultValue(e.colorsPerVertex,!1);this._positions=t,this._colors=i,this._colorsPerVertex=r,this._arcType=defaultValue(e.arcType,ArcType$1.GEODESIC),this._granularity=defaultValue(e.granularity,CesiumMath.RADIANS_PER_DEGREE),this._ellipsoid=defaultValue(e.ellipsoid,Ellipsoid.WGS84),this._workerName="createSimplePolylineGeometry";var n=1+t.length*Cartesian3.packedLength;n+=defined(i)?1+i.length*Color.packedLength:1,this.packedLength=n+Ellipsoid.packedLength+3}Simon1994PlanetaryPositions.computeSunPositionInEarthInertialFrame=function(e,t){return defined(e)||(e=JulianDate.now()),defined(t)||(t=new Cartesian3),translation$1=computeSimonEarthMoonBarycenter(e,translation$1),t=Cartesian3.negate(translation$1,t),computeSimonEarth(e,translation$1),Cartesian3.subtract(t,translation$1,t),Matrix3.multiplyByVector(axesTransformation,t,t),t},Simon1994PlanetaryPositions.computeMoonPositionInEarthInertialFrame=function(e,t){return defined(e)||(e=JulianDate.now()),t=computeSimonMoon(e,t),Matrix3.multiplyByVector(axesTransformation,t,t),t},SimplePolylineGeometry.pack=function(e,t,i){var r;i=defaultValue(i,0);var n=e._positions,a=n.length;for(t[i++]=a,r=0;r<a;++r,i+=Cartesian3.packedLength)Cartesian3.pack(n[r],t,i);var o=e._colors;for(a=defined(o)?o.length:0,t[i++]=a,r=0;r<a;++r,i+=Color.packedLength)Color.pack(o[r],t,i);return Ellipsoid.pack(e._ellipsoid,t,i),i+=Ellipsoid.packedLength,t[i++]=e._colorsPerVertex?1:0,t[i++]=e._arcType,t[i]=e._granularity,t},SimplePolylineGeometry.unpack=function(e,t,i){var r;t=defaultValue(t,0);var n=e[t++],a=new Array(n);for(r=0;r<n;++r,t+=Cartesian3.packedLength)a[r]=Cartesian3.unpack(e,t);var o=0<(n=e[t++])?new Array(n):void 0;for(r=0;r<n;++r,t+=Color.packedLength)o[r]=Color.unpack(e,t);var s=Ellipsoid.unpack(e,t);t+=Ellipsoid.packedLength;var l=1===e[t++],u=e[t++],c=e[t];return defined(i)?(i._positions=a,i._colors=o,i._ellipsoid=s,i._colorsPerVertex=l,i._arcType=u,i._granularity=c,i):new SimplePolylineGeometry({positions:a,colors:o,ellipsoid:s,colorsPerVertex:l,arcType:u,granularity:c})};var scratchArray1=new Array(2),scratchArray2=new Array(2),generateArcOptionsScratch={positions:scratchArray1,height:scratchArray2,ellipsoid:void 0,minDistance:void 0,granularity:void 0};function SphereGeometry(e){var t=defaultValue(e.radius,1),i={radii:new Cartesian3(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,vertexFormat:e.vertexFormat};this._ellipsoidGeometry=new EllipsoidGeometry(i),this._workerName="createSphereGeometry"}SimplePolylineGeometry.createGeometry=function(e){var t,i,r,n,a,o=e._positions,s=e._colors,l=e._colorsPerVertex,u=e._arcType,c=e._granularity,d=e._ellipsoid,h=CesiumMath.chordLength(c,d.maximumRadius),p=defined(s)&&!l,f=o.length,m=0;if(u===ArcType$1.GEODESIC||u===ArcType$1.RHUMB){var g,y,v;v=u===ArcType$1.GEODESIC?(g=CesiumMath.chordLength(c,d.maximumRadius),y=PolylinePipeline.numberOfPoints,PolylinePipeline.generateArc):(g=c,y=PolylinePipeline.numberOfPointsRhumbLine,PolylinePipeline.generateRhumbArc);var _=PolylinePipeline.extractHeights(o,d),C=generateArcOptionsScratch;if(u===ArcType$1.GEODESIC?C.minDistance=h:C.granularity=c,C.ellipsoid=d,p){var x=0;for(t=0;t<f-1;t++)x+=y(o[t],o[t+1],g)+1;i=new Float64Array(3*x),n=new Uint8Array(4*x),C.positions=scratchArray1,C.height=scratchArray2;var b=0;for(t=0;t<f-1;++t){scratchArray1[0]=o[t],scratchArray1[1]=o[t+1],scratchArray2[0]=_[t],scratchArray2[1]=_[t+1];var A=v(C);if(defined(s)){var S=A.length/3;a=s[t];for(var w=0;w<S;++w)n[b++]=Color.floatToByte(a.red),n[b++]=Color.floatToByte(a.green),n[b++]=Color.floatToByte(a.blue),n[b++]=Color.floatToByte(a.alpha)}i.set(A,m),m+=A.length}}else if(C.positions=o,C.height=_,i=new Float64Array(v(C)),defined(s)){for(n=new Uint8Array(i.length/3*4),t=0;t<f-1;++t){m=interpolateColors$1(o[t],o[t+1],s[t],s[t+1],h,n,m)}var E=s[f-1];n[m++]=Color.floatToByte(E.red),n[m++]=Color.floatToByte(E.green),n[m++]=Color.floatToByte(E.blue),n[m++]=Color.floatToByte(E.alpha)}}else{r=p?2*f-2:f,i=new Float64Array(3*r),n=defined(s)?new Uint8Array(4*r):void 0;var T=0,P=0;for(t=0;t<f;++t){var M=o[t];if(p&&0<t&&(Cartesian3.pack(M,i,T),T+=3,a=s[t-1],n[P++]=Color.floatToByte(a.red),n[P++]=Color.floatToByte(a.green),n[P++]=Color.floatToByte(a.blue),n[P++]=Color.floatToByte(a.alpha)),p&&t===f-1)break;Cartesian3.pack(M,i,T),T+=3,defined(s)&&(a=s[t],n[P++]=Color.floatToByte(a.red),n[P++]=Color.floatToByte(a.green),n[P++]=Color.floatToByte(a.blue),n[P++]=Color.floatToByte(a.alpha))}}var D=new GeometryAttributes;D.position=new GeometryAttribute({componentDatatype:ComponentDatatype$1.DOUBLE,componentsPerAttribute:3,values:i}),defined(s)&&(D.color=new GeometryAttribute({componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE,componentsPerAttribute:4,values:n,normalize:!0}));var I=2*((r=i.length/3)-1),O=IndexDatatype$1.createTypedArray(r,I),R=0;for(t=0;t<r-1;++t)O[R++]=t,O[R++]=t+1;return new Geometry({attributes:D,indices:O,primitiveType:PrimitiveType$1.LINES,boundingSphere:BoundingSphere.fromPoints(o)})},SphereGeometry.packedLength=EllipsoidGeometry.packedLength,SphereGeometry.pack=function(e,t,i){return EllipsoidGeometry.pack(e._ellipsoidGeometry,t,i)};var scratchEllipsoidGeometry$1=new EllipsoidGeometry,scratchOptions$l={radius:void 0,radii:new Cartesian3,vertexFormat:new VertexFormat,stackPartitions:void 0,slicePartitions:void 0};function Spherical(e,t,i){this.clock=defaultValue(e,0),this.cone=defaultValue(t,0),this.magnitude=defaultValue(i,1)}function TerrainData(){DeveloperError.throwInstantiationError()}SphereGeometry.unpack=function(e,t,i){var r=EllipsoidGeometry.unpack(e,t,scratchEllipsoidGeometry$1);return scratchOptions$l.vertexFormat=VertexFormat.clone(r._vertexFormat,scratchOptions$l.vertexFormat),scratchOptions$l.stackPartitions=r._stackPartitions,scratchOptions$l.slicePartitions=r._slicePartitions,defined(i)?(Cartesian3.clone(r._radii,scratchOptions$l.radii),i._ellipsoidGeometry=new EllipsoidGeometry(scratchOptions$l),i):(scratchOptions$l.radius=r._radii.x,new SphereGeometry(scratchOptions$l))},SphereGeometry.createGeometry=function(e){return EllipsoidGeometry.createGeometry(e._ellipsoidGeometry)},Spherical.fromCartesian3=function(e,t){var i=e.x,r=e.y,n=e.z,a=i*i+r*r;return defined(t)||(t=new Spherical),t.clock=Math.atan2(r,i),t.cone=Math.atan2(Math.sqrt(a),n),t.magnitude=Math.sqrt(a+n*n),t},Spherical.clone=function(e,t){if(defined(e))return defined(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=e.magnitude,t):new Spherical(e.clock,e.cone,e.magnitude)},Spherical.normalize=function(e,t){return defined(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=1,t):new Spherical(e.clock,e.cone,1)},Spherical.equals=function(e,t){return e===t||defined(e)&&defined(t)&&e.clock===t.clock&&e.cone===t.cone&&e.magnitude===t.magnitude},Spherical.equalsEpsilon=function(e,t,i){return i=defaultValue(i,0),e===t||defined(e)&&defined(t)&&Math.abs(e.clock-t.clock)<=i&&Math.abs(e.cone-t.cone)<=i&&Math.abs(e.magnitude-t.magnitude)<=i},Spherical.prototype.equals=function(e){return Spherical.equals(this,e)},Spherical.prototype.clone=function(e){return Spherical.clone(this,e)},Spherical.prototype.equalsEpsilon=function(e,t){return Spherical.equalsEpsilon(this,e,t)},Spherical.prototype.toString=function(){return"("+this.clock+", "+this.cone+", "+this.magnitude+")"},Object.defineProperties(TerrainData.prototype,{credits:{get:DeveloperError.throwInstantiationError},waterMask:{get:DeveloperError.throwInstantiationError}}),TerrainData.prototype.interpolateHeight=DeveloperError.throwInstantiationError,TerrainData.prototype.isChildAvailable=DeveloperError.throwInstantiationError,TerrainData.prototype.createMesh=DeveloperError.throwInstantiationError,TerrainData.prototype.upsample=DeveloperError.throwInstantiationError,TerrainData.prototype.wasCreatedByUpsampling=DeveloperError.throwInstantiationError;var TileEdge={WEST:0,NORTH:1,EAST:2,SOUTH:3,NORTHWEST:4,NORTHEAST:5,SOUTHWEST:6,SOUTHEAST:7};function TilingScheme(e){}function VideoSynchronizer(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this._clock=void 0,this._element=void 0,this._clockSubscription=void 0,this._seekFunction=void 0,this._lastPlaybackRate=void 0,this.clock=e.clock,this.element=e.element,this.epoch=defaultValue(e.epoch,Iso8601.MINIMUM_VALUE),this.tolerance=defaultValue(e.tolerance,1),this._seeking=!1,this._seekFunction=void 0,this._firstTickAfterSeek=!1}function createSeekFunction(e){return function(){e._seeking=!1,e._firstTickAfterSeek=!0}}function DataRectangle(e,t){this.rectangle=e,this.maxLevel=t}function VRTheWorldTerrainProvider(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT);var t=Resource.createIfNeeded(e.url);this._resource=t,this._errorEvent=new Event,this._ready=!1,this._readyPromise=when.defer(),this._terrainDataStructure={heightScale:.001,heightOffset:-1e3,elementsPerHeight:3,stride:4,elementMultiplier:256,isBigEndian:!0,lowestEncodedHeight:0,highestEncodedHeight:16777215};var i=e.credit;"string"==typeof i&&(i=new Credit(i)),this._credit=i,this._tilingScheme=void 0,this._rectangles=[];var r,d=this,h=defaultValue(e.ellipsoid,Ellipsoid.WGS84);function n(e){var t=e.getElementsByTagName("SRS")[0].textContent;if("EPSG:4326"===t){d._tilingScheme=new GeographicTilingScheme({ellipsoid:h});var i=e.getElementsByTagName("TileFormat")[0];d._heightmapWidth=parseInt(i.getAttribute("width"),10),d._heightmapHeight=parseInt(i.getAttribute("height"),10),d._levelZeroMaximumGeometricError=TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap(h,Math.min(d._heightmapWidth,d._heightmapHeight),d._tilingScheme.getNumberOfXTilesAtLevel(0));for(var r=e.getElementsByTagName("DataExtent"),n=0;n<r.length;++n){var a=r[n],o=CesiumMath.toRadians(parseFloat(a.getAttribute("minx"))),s=CesiumMath.toRadians(parseFloat(a.getAttribute("miny"))),l=CesiumMath.toRadians(parseFloat(a.getAttribute("maxx"))),u=CesiumMath.toRadians(parseFloat(a.getAttribute("maxy"))),c=parseInt(a.getAttribute("maxlevel"),10);d._rectangles.push(new DataRectangle(new Rectangle(o,s,l,u),c))}d._ready=!0,d._readyPromise.resolve(!0)}else p("SRS "+t+" is not supported.")}function p(e){var t=defaultValue(e,"An error occurred while accessing "+d._resource.url+".");r=TileProviderError.handleError(r,d,d._errorEvent,t,void 0,void 0,void 0,a)}function a(){when(d._resource.fetchXML(),n,p)}a()}Object.defineProperties(TilingScheme.prototype,{ellipsoid:{get:DeveloperError.throwInstantiationError},rectangle:{get:DeveloperError.throwInstantiationError},projection:{get:DeveloperError.throwInstantiationError}}),TilingScheme.prototype.getNumberOfXTilesAtLevel=DeveloperError.throwInstantiationError,TilingScheme.prototype.getNumberOfYTilesAtLevel=DeveloperError.throwInstantiationError,TilingScheme.prototype.rectangleToNativeRectangle=DeveloperError.throwInstantiationError,TilingScheme.prototype.tileXYToNativeRectangle=DeveloperError.throwInstantiationError,TilingScheme.prototype.tileXYToRectangle=DeveloperError.throwInstantiationError,TilingScheme.prototype.positionToTileXY=DeveloperError.throwInstantiationError,Object.defineProperties(VideoSynchronizer.prototype,{clock:{get:function(){return this._clock},set:function(e){var t=this._clock;t!==e&&(defined(t)&&(this._clockSubscription(),this._clockSubscription=void 0),defined(e)&&(this._clockSubscription=e.onTick.addEventListener(VideoSynchronizer.prototype._onTick,this)),this._clock=e)}},element:{get:function(){return this._element},set:function(e){var t=this._element;t!==e&&(defined(t)&&t.removeEventListener("seeked",this._seekFunction,!1),defined(e)&&(this._seeking=!1,this._seekFunction=createSeekFunction(this),e.addEventListener("seeked",this._seekFunction,!1)),this._element=e,this._seeking=!1,this._firstTickAfterSeek=!1)}}}),VideoSynchronizer.prototype.destroy=function(){return this.element=void 0,this.clock=void 0,destroyObject(this)},VideoSynchronizer.prototype.isDestroyed=function(){return!1},VideoSynchronizer.prototype._trySetPlaybackRate=function(e){if(this._lastPlaybackRate!==e.multiplier){var t=this._element;try{t.playbackRate=e.multiplier}catch(e){t.playbackRate=0}this._lastPlaybackRate=e.multiplier}},VideoSynchronizer.prototype._onTick=function(e){var t=this._element;if(defined(t)&&!(t.readyState<2)){var i=t.paused,r=e.shouldAnimate;if(r===i&&(r?t.play():t.pause()),this._seeking||this._firstTickAfterSeek)this._firstTickAfterSeek=!1;else{this._trySetPlaybackRate(e);var n,a=e.currentTime,o=defaultValue(this.epoch,Iso8601.MINIMUM_VALUE),s=JulianDate.secondsDifference(a,o),l=t.duration,u=t.currentTime;n=t.loop?((s%=l)<0&&(s=l-s),s):l<s?l:s<0?0:s;var c=r?defaultValue(this.tolerance,1):.001;Math.abs(n-u)>c&&(this._seeking=!0,t.currentTime=n)}}},Object.defineProperties(VRTheWorldTerrainProvider.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}}}),VRTheWorldTerrainProvider.prototype.requestTileGeometry=function(t,i,r,e){var n=this._tilingScheme.getNumberOfYTilesAtLevel(r),a=this._resource.getDerivedResource({url:r+"/"+t+"/"+(n-i-1)+".tif",queryParameters:{cesium:!0},request:e}).fetchImage({preferImageBitmap:!0});if(defined(a)){var o=this;return when(a).then(function(e){return new HeightmapTerrainData({buffer:getImagePixels(e),width:o._heightmapWidth,height:o._heightmapHeight,childTileMask:getChildMask(o,t,i,r),structure:o._terrainDataStructure})})}},VRTheWorldTerrainProvider.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};var rectangleScratch$4=new Rectangle;function getChildMask(e,t,i,r){for(var n=e._tilingScheme,a=e._rectangles,o=n.tileXYToRectangle(t,i,r),s=0,l=0;l<a.length&&15!==s;++l){var u=a[l];if(!(u.maxLevel<=r)){var c=u.rectangle;defined(Rectangle.intersection(c,o,rectangleScratch$4))&&(isTileInRectangle(n,c,2*t,2*i,r+1)&&(s|=4),isTileInRectangle(n,c,2*t+1,2*i,r+1)&&(s|=8),isTileInRectangle(n,c,2*t,2*i+1,r+1)&&(s|=1),isTileInRectangle(n,c,2*t+1,2*i+1,r+1)&&(s|=2))}}return s}function isTileInRectangle(e,t,i,r,n){var a=e.tileXYToRectangle(i,r,n);return defined(Rectangle.intersection(a,t,rectangleScratch$4))}VRTheWorldTerrainProvider.prototype.getTileDataAvailable=function(e,t,i){},VRTheWorldTerrainProvider.prototype.loadTileDataAvailability=function(e,t,i){};var WallGeometryLibrary={};function latLonEquals(e,t){return CesiumMath.equalsEpsilon(e.latitude,t.latitude,CesiumMath.EPSILON14)&&CesiumMath.equalsEpsilon(e.longitude,t.longitude,CesiumMath.EPSILON14)}var scratchCartographic1$2=new Cartographic,scratchCartographic2$1=new Cartographic;function removeDuplicates(e,t,i,r){var n=t.length;if(!(n<2)){var a=defined(r),o=defined(i),s=!0,l=new Array(n),u=new Array(n),c=new Array(n),d=t[0];l[0]=d;var h=e.cartesianToCartographic(d,scratchCartographic1$2);o&&(h.height=i[0]),s=s&&h.height<=0,u[0]=h.height,c[0]=a?r[0]:0;for(var p=1,f=1;f<n;++f){var m=t[f],g=e.cartesianToCartographic(m,scratchCartographic2$1);o&&(g.height=i[f]),s=s&&g.height<=0,latLonEquals(h,g)?h.height<g.height&&(u[p-1]=g.height):(l[p]=m,u[p]=g.height,c[p]=a?r[f]:0,Cartographic.clone(g,h),++p)}if(!(s||p<2))return l.length=p,u.length=p,c.length=p,{positions:l,topHeights:u,bottomHeights:c}}}var positionsArrayScratch=new Array(2),heightsArrayScratch=new Array(2),generateArcOptionsScratch$1={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};WallGeometryLibrary.computePositions=function(e,t,i,r,n,a){var o=removeDuplicates(e,t,i,r);if(defined(o)){if(t=o.positions,i=o.topHeights,r=o.bottomHeights,3<=t.length){var s=EllipsoidTangentPlane.fromPoints(t,e).projectPointsOntoPlane(t);PolygonPipeline.computeWindingOrder2D(s)===WindingOrder$1.CLOCKWISE&&(t.reverse(),i.reverse(),r.reverse())}var l,u,c=t.length,d=c-2,h=CesiumMath.chordLength(n,e.maximumRadius),p=generateArcOptionsScratch$1;if(p.minDistance=h,p.ellipsoid=e,a){var f,m=0;for(f=0;f<c-1;f++)m+=PolylinePipeline.numberOfPoints(t[f],t[f+1],h)+1;l=new Float64Array(3*m),u=new Float64Array(3*m);var g=positionsArrayScratch,y=heightsArrayScratch;p.positions=g,p.height=y;var v=0;for(f=0;f<c-1;f++){g[0]=t[f],g[1]=t[f+1],y[0]=i[f],y[1]=i[f+1];var _=PolylinePipeline.generateArc(p);l.set(_,v),y[0]=r[f],y[1]=r[f+1],u.set(PolylinePipeline.generateArc(p),v),v+=_.length}}else p.positions=t,p.height=i,l=new Float64Array(PolylinePipeline.generateArc(p)),p.height=r,u=new Float64Array(PolylinePipeline.generateArc(p));return{bottomPositions:u,topPositions:l,numCorners:d}}};var scratchCartesian3Position1=new Cartesian3,scratchCartesian3Position2=new Cartesian3,scratchCartesian3Position3=new Cartesian3,scratchCartesian3Position4=new Cartesian3,scratchCartesian3Position5=new Cartesian3,scratchBitangent$4=new Cartesian3,scratchTangent$4=new Cartesian3,scratchNormal$6=new Cartesian3;function WallGeometry(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).positions,i=e.maximumHeights,r=e.minimumHeights,n=defaultValue(e.vertexFormat,VertexFormat.DEFAULT),a=defaultValue(e.granularity,CesiumMath.RADIANS_PER_DEGREE),o=defaultValue(e.ellipsoid,Ellipsoid.WGS84);this._positions=t,this._minimumHeights=r,this._maximumHeights=i,this._vertexFormat=VertexFormat.clone(n),this._granularity=a,this._ellipsoid=Ellipsoid.clone(o),this._workerName="createWallGeometry";var s=1+t.length*Cartesian3.packedLength+2;defined(r)&&(s+=r.length),defined(i)&&(s+=i.length),this.packedLength=s+Ellipsoid.packedLength+VertexFormat.packedLength+1}WallGeometry.pack=function(e,t,i){var r;i=defaultValue(i,0);var n=e._positions,a=n.length;for(t[i++]=a,r=0;r<a;++r,i+=Cartesian3.packedLength)Cartesian3.pack(n[r],t,i);var o=e._minimumHeights;if(a=defined(o)?o.length:0,t[i++]=a,defined(o))for(r=0;r<a;++r)t[i++]=o[r];var s=e._maximumHeights;if(a=defined(s)?s.length:0,t[i++]=a,defined(s))for(r=0;r<a;++r)t[i++]=s[r];return Ellipsoid.pack(e._ellipsoid,t,i),i+=Ellipsoid.packedLength,VertexFormat.pack(e._vertexFormat,t,i),t[i+=VertexFormat.packedLength]=e._granularity,t};var scratchEllipsoid$c=Ellipsoid.clone(Ellipsoid.UNIT_SPHERE),scratchVertexFormat$c=new VertexFormat,scratchOptions$m={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:scratchEllipsoid$c,vertexFormat:scratchVertexFormat$c,granularity:void 0};WallGeometry.unpack=function(e,t,i){var r;t=defaultValue(t,0);var n,a,o=e[t++],s=new Array(o);for(r=0;r<o;++r,t+=Cartesian3.packedLength)s[r]=Cartesian3.unpack(e,t);if(0<(o=e[t++]))for(n=new Array(o),r=0;r<o;++r)n[r]=e[t++];if(0<(o=e[t++]))for(a=new Array(o),r=0;r<o;++r)a[r]=e[t++];var l=Ellipsoid.unpack(e,t,scratchEllipsoid$c);t+=Ellipsoid.packedLength;var u=VertexFormat.unpack(e,t,scratchVertexFormat$c),c=e[t+=VertexFormat.packedLength];return defined(i)?(i._positions=s,i._minimumHeights=n,i._maximumHeights=a,i._ellipsoid=Ellipsoid.clone(l,i._ellipsoid),i._vertexFormat=VertexFormat.clone(u,i._vertexFormat),i._granularity=c,i):(scratchOptions$m.positions=s,scratchOptions$m.minimumHeights=n,scratchOptions$m.maximumHeights=a,scratchOptions$m.granularity=c,new WallGeometry(scratchOptions$m))},WallGeometry.fromConstantHeights=function(e){var t,i,r=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).positions,n=e.minimumHeight,a=e.maximumHeight,o=defined(n),s=defined(a);if(o||s){var l=r.length;t=o?new Array(l):void 0,i=s?new Array(l):void 0;for(var u=0;u<l;++u)o&&(t[u]=n),s&&(i[u]=a)}return new WallGeometry({positions:r,maximumHeights:i,minimumHeights:t,ellipsoid:e.ellipsoid,vertexFormat:e.vertexFormat})},WallGeometry.createGeometry=function(e){var t=e._positions,i=e._minimumHeights,r=e._maximumHeights,n=e._vertexFormat,a=e._granularity,o=e._ellipsoid,s=WallGeometryLibrary.computePositions(o,t,r,i,a,!0);if(defined(s)){var l,u=s.bottomPositions,c=s.topPositions,d=s.numCorners,h=c.length,p=2*h,f=n.position?new Float64Array(p):void 0,m=n.normal?new Float32Array(p):void 0,g=n.tangent?new Float32Array(p):void 0,y=n.bitangent?new Float32Array(p):void 0,v=n.st?new Float32Array(p/3*2):void 0,_=0,C=0,x=0,b=0,A=0,S=scratchNormal$6,w=scratchTangent$4,E=scratchBitangent$4,T=!0,P=0,M=1/((h/=3)-t.length+1);for(l=0;l<h;++l){var D=3*l,I=Cartesian3.fromArray(c,D,scratchCartesian3Position1),O=Cartesian3.fromArray(u,D,scratchCartesian3Position2);if(n.position&&(f[_++]=O.x,f[_++]=O.y,f[_++]=O.z,f[_++]=I.x,f[_++]=I.y,f[_++]=I.z),n.st&&(v[A++]=P,v[A++]=0,v[A++]=P,v[A++]=1),n.normal||n.tangent||n.bitangent){var R,L=Cartesian3.clone(Cartesian3.ZERO,scratchCartesian3Position5),N=o.scaleToGeodeticSurface(Cartesian3.fromArray(c,D,scratchCartesian3Position2),scratchCartesian3Position2);if(l+1<h&&(R=o.scaleToGeodeticSurface(Cartesian3.fromArray(c,3+D,scratchCartesian3Position3),scratchCartesian3Position3),L=Cartesian3.fromArray(c,3+D,scratchCartesian3Position5)),T){var k=Cartesian3.subtract(L,I,scratchCartesian3Position4),B=Cartesian3.subtract(N,I,scratchCartesian3Position1);S=Cartesian3.normalize(Cartesian3.cross(B,k,S),S),T=!1}Cartesian3.equalsEpsilon(R,N,CesiumMath.EPSILON10)?T=!0:(P+=M,n.tangent&&(w=Cartesian3.normalize(Cartesian3.subtract(R,N,w),w)),n.bitangent&&(E=Cartesian3.normalize(Cartesian3.cross(S,w,E),E))),n.normal&&(m[C++]=S.x,m[C++]=S.y,m[C++]=S.z,m[C++]=S.x,m[C++]=S.y,m[C++]=S.z),n.tangent&&(g[b++]=w.x,g[b++]=w.y,g[b++]=w.z,g[b++]=w.x,g[b++]=w.y,g[b++]=w.z),n.bitangent&&(y[x++]=E.x,y[x++]=E.y,y[x++]=E.z,y[x++]=E.x,y[x++]=E.y,y[x++]=E.z)}}var F=new GeometryAttributes;n.position&&(F.position=new GeometryAttribute({componentDatatype:ComponentDatatype$1.DOUBLE,componentsPerAttribute:3,values:f})),n.normal&&(F.normal=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:m})),n.tangent&&(F.tangent=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:g})),n.bitangent&&(F.bitangent=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:y})),n.st&&(F.st=new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:2,values:v}));var V=p/3;p-=6*(d+1);var z=IndexDatatype$1.createTypedArray(V,p),U=0;for(l=0;l<V-2;l+=2){var G=l,$=l+2,H=Cartesian3.fromArray(f,3*G,scratchCartesian3Position1),W=Cartesian3.fromArray(f,3*$,scratchCartesian3Position2);if(!Cartesian3.equalsEpsilon(H,W,CesiumMath.EPSILON10)){var j=l+1,q=l+3;z[U++]=j,z[U++]=G,z[U++]=q,z[U++]=q,z[U++]=G,z[U++]=$}}return new Geometry({attributes:F,indices:z,primitiveType:PrimitiveType$1.TRIANGLES,boundingSphere:new BoundingSphere.fromVertices(f)})}};var scratchCartesian3Position1$1=new Cartesian3,scratchCartesian3Position2$1=new Cartesian3;function WallOutlineGeometry(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).positions,i=e.maximumHeights,r=e.minimumHeights,n=defaultValue(e.granularity,CesiumMath.RADIANS_PER_DEGREE),a=defaultValue(e.ellipsoid,Ellipsoid.WGS84);this._positions=t,this._minimumHeights=r,this._maximumHeights=i,this._granularity=n,this._ellipsoid=Ellipsoid.clone(a),this._workerName="createWallOutlineGeometry";var o=1+t.length*Cartesian3.packedLength+2;defined(r)&&(o+=r.length),defined(i)&&(o+=i.length),this.packedLength=o+Ellipsoid.packedLength+1}WallOutlineGeometry.pack=function(e,t,i){var r;i=defaultValue(i,0);var n=e._positions,a=n.length;for(t[i++]=a,r=0;r<a;++r,i+=Cartesian3.packedLength)Cartesian3.pack(n[r],t,i);var o=e._minimumHeights;if(a=defined(o)?o.length:0,t[i++]=a,defined(o))for(r=0;r<a;++r)t[i++]=o[r];var s=e._maximumHeights;if(a=defined(s)?s.length:0,t[i++]=a,defined(s))for(r=0;r<a;++r)t[i++]=s[r];return Ellipsoid.pack(e._ellipsoid,t,i),t[i+=Ellipsoid.packedLength]=e._granularity,t};var scratchEllipsoid$d=Ellipsoid.clone(Ellipsoid.UNIT_SPHERE),scratchOptions$n={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:scratchEllipsoid$d,granularity:void 0};function webGLConstantToGlslType(e){switch(e){case WebGLConstants$1.FLOAT:return"float";case WebGLConstants$1.FLOAT_VEC2:return"vec2";case WebGLConstants$1.FLOAT_VEC3:return"vec3";case WebGLConstants$1.FLOAT_VEC4:return"vec4";case WebGLConstants$1.FLOAT_MAT2:return"mat2";case WebGLConstants$1.FLOAT_MAT3:return"mat3";case WebGLConstants$1.FLOAT_MAT4:return"mat4";case WebGLConstants$1.SAMPLER_2D:return"sampler2D";case WebGLConstants$1.BOOL:return"bool"}}function WeightSpline(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).weights,i=e.times;this._times=i,this._weights=t,this._count=t.length/i.length,this._lastTimeIndex=0}function wrapFunction(e,t,i){return function(){i.apply(e,arguments),t.apply(e,arguments)}}WallOutlineGeometry.unpack=function(e,t,i){var r;t=defaultValue(t,0);var n,a,o=e[t++],s=new Array(o);for(r=0;r<o;++r,t+=Cartesian3.packedLength)s[r]=Cartesian3.unpack(e,t);if(0<(o=e[t++]))for(n=new Array(o),r=0;r<o;++r)n[r]=e[t++];if(0<(o=e[t++]))for(a=new Array(o),r=0;r<o;++r)a[r]=e[t++];var l=Ellipsoid.unpack(e,t,scratchEllipsoid$d),u=e[t+=Ellipsoid.packedLength];return defined(i)?(i._positions=s,i._minimumHeights=n,i._maximumHeights=a,i._ellipsoid=Ellipsoid.clone(l,i._ellipsoid),i._granularity=u,i):(scratchOptions$n.positions=s,scratchOptions$n.minimumHeights=n,scratchOptions$n.maximumHeights=a,scratchOptions$n.granularity=u,new WallOutlineGeometry(scratchOptions$n))},WallOutlineGeometry.fromConstantHeights=function(e){var t,i,r=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).positions,n=e.minimumHeight,a=e.maximumHeight,o=defined(n),s=defined(a);if(o||s){var l=r.length;t=o?new Array(l):void 0,i=s?new Array(l):void 0;for(var u=0;u<l;++u)o&&(t[u]=n),s&&(i[u]=a)}return new WallOutlineGeometry({positions:r,maximumHeights:i,minimumHeights:t,ellipsoid:e.ellipsoid})},WallOutlineGeometry.createGeometry=function(e){var t=e._positions,i=e._minimumHeights,r=e._maximumHeights,n=e._granularity,a=e._ellipsoid,o=WallGeometryLibrary.computePositions(a,t,r,i,n,!1);if(defined(o)){var s,l=o.bottomPositions,u=o.topPositions,c=u.length,d=2*c,h=new Float64Array(d),p=0;for(c/=3,s=0;s<c;++s){var f=3*s,m=Cartesian3.fromArray(u,f,scratchCartesian3Position1$1),g=Cartesian3.fromArray(l,f,scratchCartesian3Position2$1);h[p++]=g.x,h[p++]=g.y,h[p++]=g.z,h[p++]=m.x,h[p++]=m.y,h[p++]=m.z}var y=new GeometryAttributes({position:new GeometryAttribute({componentDatatype:ComponentDatatype$1.DOUBLE,componentsPerAttribute:3,values:h})}),v=d/3;d=2*v-4+v;var _=IndexDatatype$1.createTypedArray(v,d),C=0;for(s=0;s<v-2;s+=2){var x=s,b=s+2,A=Cartesian3.fromArray(h,3*x,scratchCartesian3Position1$1),S=Cartesian3.fromArray(h,3*b,scratchCartesian3Position2$1);if(!Cartesian3.equalsEpsilon(A,S,CesiumMath.EPSILON10)){var w=s+1,E=s+3;_[C++]=w,_[C++]=x,_[C++]=w,_[C++]=E,_[C++]=x,_[C++]=b}}return _[C++]=v-2,_[C++]=v-1,new Geometry({attributes:y,indices:_,primitiveType:PrimitiveType$1.LINES,boundingSphere:new BoundingSphere.fromVertices(h)})}},Object.defineProperties(WeightSpline.prototype,{times:{get:function(){return this._times}},weights:{get:function(){return this._weights}}}),WeightSpline.prototype.findTimeInterval=Spline.prototype.findTimeInterval,WeightSpline.prototype.wrapTime=Spline.prototype.wrapTime,WeightSpline.prototype.clampTime=Spline.prototype.clampTime,WeightSpline.prototype.evaluate=function(e,t){var i=this.weights,r=this.times,n=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),a=(e-r[n])/(r[n+1]-r[n]);defined(t)||(t=new Array(this._count));for(var o=0;o<this._count;o++){var s=n*this._count+o;t[o]=i[s]*(1-a)+i[s+this._count]*a}return t};var BoundingSphereState={DONE:0,PENDING:1,FAILED:2},BoundingSphereState$1=Object.freeze(BoundingSphereState),defaultColor$3=Color.WHITE,defaultEyeOffset$1=Cartesian3.ZERO,defaultHeightReference$1=HeightReference$1.NONE,defaultPixelOffset$1=Cartesian2.ZERO,defaultScale$2=1,defaultRotation$2=0,defaultAlignedAxis$1=Cartesian3.ZERO,defaultHorizontalOrigin$1=HorizontalOrigin$1.CENTER,defaultVerticalOrigin$1=VerticalOrigin$1.CENTER,defaultSizeInMeters$1=!1,positionScratch$6=new Cartesian3,colorScratch$1=new Color,eyeOffsetScratch=new Cartesian3,pixelOffsetScratch=new Cartesian2,scaleByDistanceScratch$1=new NearFarScalar,translucencyByDistanceScratch$1=new NearFarScalar,pixelOffsetScaleByDistanceScratch$1=new NearFarScalar,boundingRectangleScratch$1=new BoundingRectangle,distanceDisplayConditionScratch$1=new DistanceDisplayCondition;function EntityData$1(e){this.entity=e,this.billboard=void 0,this.textureValue=void 0}function BillboardVisualizer(e,t){t.collectionChanged.addEventListener(BillboardVisualizer.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new AssociativeArray,this._onCollectionChanged(t,t.values,[],[])}function returnPrimitive$1(e,t,i){defined(e)&&(e.billboard=void 0,i.removeBillboard(t))}function MaterialProperty(){DeveloperError.throwInstantiationError()}function DynamicGeometryUpdater(e,t,i){this._primitives=t,this._orderedGroundPrimitives=i,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=e,this._options=e._options,this._entity=e._entity,this._material=void 0}BillboardVisualizer.prototype.update=function(e){for(var t=this._items.values,i=this._cluster,r=0,n=t.length;r<n;r++){var a,o,s=t[r],l=s.entity,u=l._billboard,c=s.billboard,d=l.isShowing&&l.isAvailable(e)&&Property.getValueOrDefault(u._show,e,!0);if(d&&(o=Property.getValueOrUndefined(l._position,e,positionScratch$6),a=Property.getValueOrUndefined(u._image,e),d=defined(o)&&defined(a)),d){Property.isConstant(l._position)||(i._clusterDirty=!0),defined(c)||((c=i.getBillboard(l)).id=l,c.image=void 0,s.billboard=c),c.show=d,defined(c.image)&&s.textureValue===a||(c.image=a,s.textureValue=a),c.position=o,c.color=Property.getValueOrDefault(u._color,e,defaultColor$3,colorScratch$1),c.eyeOffset=Property.getValueOrDefault(u._eyeOffset,e,defaultEyeOffset$1,eyeOffsetScratch),c.heightReference=Property.getValueOrDefault(u._heightReference,e,defaultHeightReference$1),c.pixelOffset=Property.getValueOrDefault(u._pixelOffset,e,defaultPixelOffset$1,pixelOffsetScratch),c.scale=Property.getValueOrDefault(u._scale,e,defaultScale$2),c.rotation=Property.getValueOrDefault(u._rotation,e,defaultRotation$2),c.alignedAxis=Property.getValueOrDefault(u._alignedAxis,e,defaultAlignedAxis$1),c.horizontalOrigin=Property.getValueOrDefault(u._horizontalOrigin,e,defaultHorizontalOrigin$1),c.verticalOrigin=Property.getValueOrDefault(u._verticalOrigin,e,defaultVerticalOrigin$1),c.width=Property.getValueOrUndefined(u._width,e),c.height=Property.getValueOrUndefined(u._height,e),c.scaleByDistance=Property.getValueOrUndefined(u._scaleByDistance,e,scaleByDistanceScratch$1),c.translucencyByDistance=Property.getValueOrUndefined(u._translucencyByDistance,e,translucencyByDistanceScratch$1),c.pixelOffsetScaleByDistance=Property.getValueOrUndefined(u._pixelOffsetScaleByDistance,e,pixelOffsetScaleByDistanceScratch$1),c.sizeInMeters=Property.getValueOrDefault(u._sizeInMeters,e,defaultSizeInMeters$1),c.distanceDisplayCondition=Property.getValueOrUndefined(u._distanceDisplayCondition,e,distanceDisplayConditionScratch$1),c.disableDepthTestDistance=Property.getValueOrUndefined(u._disableDepthTestDistance,e);var h=Property.getValueOrUndefined(u._imageSubRegion,e,boundingRectangleScratch$1);defined(h)&&c.setImageSubRegion(c._imageId,h)}else returnPrimitive$1(s,l,i)}return!0},BillboardVisualizer.prototype.getBoundingSphere=function(e,t){var i=this._items.get(e.id);if(!defined(i)||!defined(i.billboard))return BoundingSphereState$1.FAILED;var r=i.billboard;if(r.heightReference===HeightReference$1.NONE)t.center=Cartesian3.clone(r.position,t.center);else{if(!defined(r._clampedPosition))return BoundingSphereState$1.PENDING;t.center=Cartesian3.clone(r._clampedPosition,t.center)}return t.radius=0,BoundingSphereState$1.DONE},BillboardVisualizer.prototype.isDestroyed=function(){return!1},BillboardVisualizer.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(BillboardVisualizer.prototype._onCollectionChanged,this);for(var e=this._entityCollection.values,t=0;t<e.length;t++)this._cluster.removeBillboard(e[t]);return destroyObject(this)},BillboardVisualizer.prototype._onCollectionChanged=function(e,t,i,r){var n,a,o=this._items,s=this._cluster;for(n=t.length-1;-1<n;n--)defined((a=t[n])._billboard)&&defined(a._position)&&o.set(a.id,new EntityData$1(a));for(n=r.length-1;-1<n;n--)defined((a=r[n])._billboard)&&defined(a._position)?o.contains(a.id)||o.set(a.id,new EntityData$1(a)):(returnPrimitive$1(o.get(a.id),a,s),o.remove(a.id));for(n=i.length-1;-1<n;n--)a=i[n],returnPrimitive$1(o.get(a.id),a,s),o.remove(a.id)},Object.defineProperties(MaterialProperty.prototype,{isConstant:{get:DeveloperError.throwInstantiationError},definitionChanged:{get:DeveloperError.throwInstantiationError}}),MaterialProperty.prototype.getType=DeveloperError.throwInstantiationError,MaterialProperty.prototype.getValue=DeveloperError.throwInstantiationError,MaterialProperty.prototype.equals=DeveloperError.throwInstantiationError,MaterialProperty.getValue=function(e,t,i){var r;return defined(t)&&defined(r=t.getType(e))?(defined(i)&&i.type===r||(i=Material.fromType(r)),t.getValue(e,i.uniforms)):(defined(i)&&i.type===Material.ColorType||(i=Material.fromType(Material.ColorType)),Color.clone(Color.WHITE,i.uniforms.color)),i},DynamicGeometryUpdater.prototype._isHidden=function(e,t,i){return!e.isShowing||!e.isAvailable(i)||!Property.getValueOrDefault(t.show,i,!0)},DynamicGeometryUpdater.prototype._setOptions=DeveloperError.throwInstantiationError,DynamicGeometryUpdater.prototype.update=function(e){var t=this._geometryUpdater,i=t._onTerrain,r=this._primitives,n=this._orderedGroundPrimitives;i?n.remove(this._primitive):(r.removeAndDestroy(this._primitive),r.removeAndDestroy(this._outlinePrimitive),this._outlinePrimitive=void 0),this._primitive=void 0;var a=this._entity,o=a[this._geometryUpdater._geometryPropertyName];if(this._setOptions(a,o,e),!this._isHidden(a,o,e)){var s=this._geometryUpdater.shadowsProperty.getValue(e),l=this._options;if(!defined(o.fill)||o.fill.getValue(e)){var u,c=t.fillMaterialProperty,d=c instanceof ColorMaterialProperty,h=t._getIsClosed(l);if(d)u=new PerInstanceColorAppearance({closed:h,flat:i&&!t._supportsMaterialsforEntitiesOnTerrain});else{var p=MaterialProperty.getValue(e,c,this._material);u=new MaterialAppearance({material:this._material=p,translucent:p.isTranslucent(),closed:h})}if(i)l.vertexFormat=PerInstanceColorAppearance.VERTEX_FORMAT,this._primitive=n.add(new GroundPrimitive({geometryInstances:this._geometryUpdater.createFillGeometryInstance(e),appearance:u,asynchronous:!1,shadows:s,classificationType:this._geometryUpdater.classificationTypeProperty.getValue(e)}),Property.getValueOrUndefined(this._geometryUpdater.zIndex,e));else{l.vertexFormat=u.vertexFormat;var f=this._geometryUpdater.createFillGeometryInstance(e);d&&(u.translucent=255!==f.attributes.color.value[3]),this._primitive=r.add(new Primitive({geometryInstances:f,appearance:u,asynchronous:!1,shadows:s}))}}if(!i&&defined(o.outline)&&o.outline.getValue(e)){var m=this._geometryUpdater.createOutlineGeometryInstance(e),g=Property.getValueOrDefault(o.outlineWidth,e,1);this._outlinePrimitive=r.add(new Primitive({geometryInstances:m,appearance:new PerInstanceColorAppearance({flat:!0,translucent:255!==m.attributes.color.value[3],renderState:{lineWidth:t._scene.clampLineWidth(g)}}),asynchronous:!1,shadows:s}))}}},DynamicGeometryUpdater.prototype.getBoundingSphere=function(e){var t,i=this._entity,r=this._primitive,n=this._outlinePrimitive;return defined(r)&&r.show&&r.ready&&defined(t=r.getGeometryInstanceAttributes(i))&&defined(t.boundingSphere)?(BoundingSphere.clone(t.boundingSphere,e),BoundingSphereState$1.DONE):defined(n)&&n.show&&n.ready&&defined(t=n.getGeometryInstanceAttributes(i))&&defined(t.boundingSphere)?(BoundingSphere.clone(t.boundingSphere,e),BoundingSphereState$1.DONE):defined(r)&&!r.ready||defined(n)&&!n.ready?BoundingSphereState$1.PENDING:BoundingSphereState$1.FAILED},DynamicGeometryUpdater.prototype.isDestroyed=function(){return!1},DynamicGeometryUpdater.prototype.destroy=function(){var e=this._primitives,t=this._orderedGroundPrimitives;this._geometryUpdater._onTerrain?t.remove(this._primitive):e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),destroyObject(this)};var defaultMaterial=new ColorMaterialProperty(Color.WHITE),defaultShow=new ConstantProperty(!0),defaultFill$1=new ConstantProperty(!0),defaultOutline=new ConstantProperty(!1),defaultOutlineColor$1=new ConstantProperty(Color.BLACK),defaultShadows=new ConstantProperty(ShadowMode$1.DISABLED),defaultDistanceDisplayCondition=new ConstantProperty(new DistanceDisplayCondition),defaultClassificationType=new ConstantProperty(ClassificationType$1.BOTH);function GeometryUpdater(e){var t=e.entity,i=e.geometryPropertyName;this._entity=t,this._scene=e.scene,this._fillEnabled=!1,this._isClosed=!1,this._onTerrain=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new Event,this._showProperty=void 0,this._materialProperty=void 0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._classificationTypeProperty=void 0,this._options=e.geometryOptions,this._geometryPropertyName=i,this._id=i+"-"+t.id,this._observedPropertyNames=e.observedPropertyNames,this._supportsMaterialsforEntitiesOnTerrain=Entity.supportsMaterialsforEntitiesOnTerrain(e.scene)}Object.defineProperties(GeometryUpdater.prototype,{id:{get:function(){return this._id}},entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!defined(this._entity.availability)&&Property.isConstant(this._showProperty)&&Property.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!defined(this._entity.availability)&&Property.isConstant(this._showProperty)&&Property.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},classificationTypeProperty:{get:function(){return this._classificationTypeProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return this._isClosed}},onTerrain:{get:function(){return this._onTerrain}},geometryChanged:{get:function(){return this._geometryChanged}}}),GeometryUpdater.prototype.isOutlineVisible=function(e){var t=this._entity;return defaultValue(this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e),!1)},GeometryUpdater.prototype.isFilled=function(e){var t=this._entity;return defaultValue(this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e),!1)},GeometryUpdater.prototype.createFillGeometryInstance=DeveloperError.throwInstantiationError,GeometryUpdater.prototype.createOutlineGeometryInstance=DeveloperError.throwInstantiationError,GeometryUpdater.prototype.isDestroyed=function(){return!1},GeometryUpdater.prototype.destroy=function(){destroyObject(this)},GeometryUpdater.prototype._isHidden=function(e,t){var i=t.show;return defined(i)&&i.isConstant&&!i.getValue(Iso8601.MINIMUM_VALUE)},GeometryUpdater.prototype._isOnTerrain=function(e,t){return!1},GeometryUpdater.prototype._getIsClosed=function(e){return!0},GeometryUpdater.prototype._isDynamic=DeveloperError.throwInstantiationError,GeometryUpdater.prototype._setStaticOptions=DeveloperError.throwInstantiationError,GeometryUpdater.prototype._onEntityPropertyChanged=function(e,t,i,r){if(-1!==this._observedPropertyNames.indexOf(t)){var n=this._entity[this._geometryPropertyName];if(defined(n)){var a=n.fill,o=!defined(a)||!a.isConstant||a.getValue(Iso8601.MINIMUM_VALUE),s=n.outline,l=defined(s);if(l&&s.isConstant&&(l=s.getValue(Iso8601.MINIMUM_VALUE)),o||l){var u=n.show;if(this._isHidden(e,n))(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));else{this._materialProperty=defaultValue(n.material,defaultMaterial),this._fillProperty=defaultValue(a,defaultFill$1),this._showProperty=defaultValue(u,defaultShow),this._showOutlineProperty=defaultValue(n.outline,defaultOutline),this._outlineColorProperty=l?defaultValue(n.outlineColor,defaultOutlineColor$1):void 0,this._shadowsProperty=defaultValue(n.shadows,defaultShadows),this._distanceDisplayConditionProperty=defaultValue(n.distanceDisplayCondition,defaultDistanceDisplayCondition),this._classificationTypeProperty=defaultValue(n.classificationType,defaultClassificationType),this._fillEnabled=o;var c=this._isOnTerrain(e,n)&&(this._supportsMaterialsforEntitiesOnTerrain||this._materialProperty instanceof ColorMaterialProperty);if(l&&c&&(oneTimeWarning(oneTimeWarning.geometryOutlines),l=!1),this._onTerrain=c,this._outlineEnabled=l,this._isDynamic(e,n))this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this));else{this._setStaticOptions(e,n),this._isClosed=this._getIsClosed(this._options);var d=n.outlineWidth;this._outlineWidth=defined(d)?d.getValue(Iso8601.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}}}else(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this))}else(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this))}},GeometryUpdater.prototype.createDynamicUpdater=function(e,t){return new this.constructor.DynamicGeometryUpdater(this,e,t)};var scratchPosition$6=new Cartesian3,scratchCarto=new Cartographic;function TerrainOffsetProperty(e,t,i,r){this._scene=e,this._heightReference=i,this._extrudedHeightReference=r,this._positionProperty=t,this._position=new Cartesian3,this._cartographicPosition=new Cartographic,this._normal=new Cartesian3,this._definitionChanged=new Event,this._terrainHeight=0,this._removeCallbackFunc=void 0,this._removeEventListener=void 0,this._removeModeListener=void 0;var n=this;if(defined(e.globe)&&(this._removeEventListener=e.terrainProviderChanged.addEventListener(function(){n._updateClamping()}),this._removeModeListener=e.morphComplete.addEventListener(function(){n._updateClamping()})),t.isConstant){var a=t.getValue(Iso8601.MINIMUM_VALUE,scratchPosition$6);if(!defined(a)||Cartesian3.equals(a,Cartesian3.ZERO)||!defined(e.globe))return;this._position=Cartesian3.clone(a,this._position),this._updateClamping(),this._normal=e.globe.ellipsoid.geodeticSurfaceNormal(a,this._normal)}}function heightReferenceOnEntityPropertyChanged(e,t,i,r){if(GeometryUpdater.prototype._onEntityPropertyChanged.call(this,e,t,i,r),-1!==this._observedPropertyNames.indexOf(t)){var n=this._entity[this._geometryPropertyName];if(defined(n)){defined(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0);var a=n.heightReference;if(defined(a)){var o=new CallbackProperty(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new TerrainOffsetProperty(this._scene,o,a)}}}}Object.defineProperties(TerrainOffsetProperty.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}}}),TerrainOffsetProperty.prototype._updateClamping=function(){defined(this._removeCallbackFunc)&&this._removeCallbackFunc();var i=this._scene,e=i.globe,t=this._position;if(defined(e)&&!Cartesian3.equals(t,Cartesian3.ZERO)){var r=e.ellipsoid,n=e._surface,a=this,o=r.cartesianToCartographic(t,this._cartographicPosition),s=e.getHeight(o);defined(s)?this._terrainHeight=s:this._terrainHeight=0,this._removeCallbackFunc=n.updateHeight(o,function(e){if(i.mode===SceneMode$1.SCENE3D){var t=r.cartesianToCartographic(e,scratchCarto);a._terrainHeight=t.height}else a._terrainHeight=e.x;a.definitionChanged.raiseEvent()})}else this._terrainHeight=0},TerrainOffsetProperty.prototype.getValue=function(e,t){var i=Property.getValueOrDefault(this._heightReference,e,HeightReference$1.NONE),r=Property.getValueOrDefault(this._extrudedHeightReference,e,HeightReference$1.NONE);if(i===HeightReference$1.NONE&&r!==HeightReference$1.RELATIVE_TO_GROUND)return this._position=Cartesian3.clone(Cartesian3.ZERO,this._position),Cartesian3.clone(Cartesian3.ZERO,t);if(this._positionProperty.isConstant)return Cartesian3.multiplyByScalar(this._normal,this._terrainHeight,t);var n=this._scene,a=this._positionProperty.getValue(e,scratchPosition$6);if(!defined(a)||Cartesian3.equals(a,Cartesian3.ZERO)||!defined(n.globe))return Cartesian3.clone(Cartesian3.ZERO,t);if(Cartesian3.equalsEpsilon(this._position,a,CesiumMath.EPSILON10))return Cartesian3.multiplyByScalar(this._normal,this._terrainHeight,t);this._position=Cartesian3.clone(a,this._position),this._updateClamping();var o=n.globe.ellipsoid.geodeticSurfaceNormal(a,this._normal);return Cartesian3.multiplyByScalar(o,this._terrainHeight,t)},TerrainOffsetProperty.prototype.isDestroyed=function(){return!1},TerrainOffsetProperty.prototype.destroy=function(){return defined(this._removeEventListener)&&this._removeEventListener(),defined(this._removeModeListener)&&this._removeModeListener(),defined(this._removeCallbackFunc)&&this._removeCallbackFunc(),destroyObject(this)};var defaultOffset=Cartesian3.ZERO,offsetScratch$4=new Cartesian3,positionScratch$7=new Cartesian3,scratchColor$2=new Color;function BoxGeometryOptions(e){this.id=e,this.vertexFormat=void 0,this.dimensions=void 0,this.offsetAttribute=void 0}function BoxGeometryUpdater(e,t){GeometryUpdater.call(this,{entity:e,scene:t,geometryOptions:new BoxGeometryOptions(e),geometryPropertyName:"box",observedPropertyNames:["availability","position","orientation","box"]}),this._onEntityPropertyChanged(e,"box",e.box,void 0)}function DynamicBoxGeometryUpdater(e,t,i){DynamicGeometryUpdater.call(this,e,t,i)}defined(Object.create)&&(BoxGeometryUpdater.prototype=Object.create(GeometryUpdater.prototype),BoxGeometryUpdater.prototype.constructor=BoxGeometryUpdater),Object.defineProperties(BoxGeometryUpdater.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}}),BoxGeometryUpdater.prototype.createFillGeometryInstance=function(e){var t,i=this._entity,r=i.isAvailable(e),n=new ShowGeometryInstanceAttribute(r&&i.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),a=this._distanceDisplayConditionProperty.getValue(e),o={show:n,distanceDisplayCondition:DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(a),color:void 0,offset:void 0};this._materialProperty instanceof ColorMaterialProperty&&(defined(this._materialProperty.color)&&(this._materialProperty.color.isConstant||r)&&(t=this._materialProperty.color.getValue(e,scratchColor$2)),defined(t)||(t=Color.WHITE),o.color=ColorGeometryInstanceAttribute.fromColor(t));return defined(this._options.offsetAttribute)&&(o.offset=OffsetGeometryInstanceAttribute.fromCartesian3(Property.getValueOrDefault(this._terrainOffsetProperty,e,defaultOffset,offsetScratch$4))),new GeometryInstance({id:i,geometry:BoxGeometry.fromDimensions(this._options),modelMatrix:i.computeModelMatrixForHeightReference(e,i.box.heightReference,.5*this._options.dimensions.z,this._scene.mapProjection.ellipsoid),attributes:o})},BoxGeometryUpdater.prototype.createOutlineGeometryInstance=function(e){var t=this._entity,i=t.isAvailable(e),r=Property.getValueOrDefault(this._outlineColorProperty,e,Color.BLACK,scratchColor$2),n=this._distanceDisplayConditionProperty.getValue(e),a={show:new ShowGeometryInstanceAttribute(i&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:ColorGeometryInstanceAttribute.fromColor(r),distanceDisplayCondition:DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(n),offset:void 0};return defined(this._options.offsetAttribute)&&(a.offset=OffsetGeometryInstanceAttribute.fromCartesian3(Property.getValueOrDefault(this._terrainOffsetProperty,e,defaultOffset,offsetScratch$4))),new GeometryInstance({id:t,geometry:BoxOutlineGeometry.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,.5*this._options.dimensions.z,this._scene.mapProjection.ellipsoid),attributes:a})},BoxGeometryUpdater.prototype._computeCenter=function(e,t){return Property.getValueOrUndefined(this._entity.position,e,t)},BoxGeometryUpdater.prototype._isHidden=function(e,t){return!defined(t.dimensions)||!defined(e.position)||GeometryUpdater.prototype._isHidden.call(this,e,t)},BoxGeometryUpdater.prototype._isDynamic=function(e,t){return!(e.position.isConstant&&Property.isConstant(e.orientation)&&t.dimensions.isConstant&&Property.isConstant(t.outlineWidth))},BoxGeometryUpdater.prototype._setStaticOptions=function(e,t){var i=Property.getValueOrDefault(t.heightReference,Iso8601.MINIMUM_VALUE,HeightReference$1.NONE),r=this._options;r.vertexFormat=this._materialProperty instanceof ColorMaterialProperty?PerInstanceColorAppearance.VERTEX_FORMAT:MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat,r.dimensions=t.dimensions.getValue(Iso8601.MINIMUM_VALUE,r.dimensions),r.offsetAttribute=i!==HeightReference$1.NONE?GeometryOffsetAttribute$1.ALL:void 0},BoxGeometryUpdater.prototype._onEntityPropertyChanged=heightReferenceOnEntityPropertyChanged,BoxGeometryUpdater.DynamicGeometryUpdater=DynamicBoxGeometryUpdater,defined(Object.create)&&(DynamicBoxGeometryUpdater.prototype=Object.create(DynamicGeometryUpdater.prototype),DynamicBoxGeometryUpdater.prototype.constructor=DynamicBoxGeometryUpdater),DynamicBoxGeometryUpdater.prototype._isHidden=function(e,t,i){var r=Property.getValueOrUndefined(e.position,i,positionScratch$7),n=this._options.dimensions;return!defined(r)||!defined(n)||DynamicGeometryUpdater.prototype._isHidden.call(this,e,t,i)},DynamicBoxGeometryUpdater.prototype._setOptions=function(e,t,i){var r=Property.getValueOrDefault(t.heightReference,i,HeightReference$1.NONE),n=this._options;n.dimensions=Property.getValueOrUndefined(t.dimensions,i,n.dimensions),n.offsetAttribute=r!==HeightReference$1.NONE?GeometryOffsetAttribute$1.ALL:void 0};var Axis={X:0,Y:1,Z:2,Y_UP_TO_Z_UP:Matrix4.fromRotationTranslation(Matrix3.fromRotationX(CesiumMath.PI_OVER_TWO)),Z_UP_TO_Y_UP:Matrix4.fromRotationTranslation(Matrix3.fromRotationX(-CesiumMath.PI_OVER_TWO)),X_UP_TO_Z_UP:Matrix4.fromRotationTranslation(Matrix3.fromRotationY(-CesiumMath.PI_OVER_TWO)),Z_UP_TO_X_UP:Matrix4.fromRotationTranslation(Matrix3.fromRotationY(CesiumMath.PI_OVER_TWO)),X_UP_TO_Y_UP:Matrix4.fromRotationTranslation(Matrix3.fromRotationZ(CesiumMath.PI_OVER_TWO)),Y_UP_TO_X_UP:Matrix4.fromRotationTranslation(Matrix3.fromRotationZ(-CesiumMath.PI_OVER_TWO)),fromName:function(e){return Axis[e]}},Axis$1=Object.freeze(Axis),AttributeType={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"},AttributeType$1=Object.freeze(AttributeType),Cesium3DTileColorBlendMode={HIGHLIGHT:0,REPLACE:1,MIX:2},Cesium3DTileColorBlendMode$1=Object.freeze(Cesium3DTileColorBlendMode),ComponentsPerAttribute={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},ClassPerType={SCALAR:void 0,VEC2:Cartesian2,VEC3:Cartesian3,VEC4:Cartesian4,MAT2:Matrix2,MAT3:Matrix3,MAT4:Matrix4};function getBinaryAccessor(e){var r,t=e.componentType;r="string"==typeof t?ComponentDatatype$1.fromName(t):t;var n=ComponentsPerAttribute[e.type],i=ClassPerType[e.type];return{componentsPerAttribute:n,classType:i,createArrayBufferView:function(e,t,i){return ComponentDatatype$1.createArrayBufferView(r,e,t,n*i)}}}var DEFAULT_COLOR_VALUE=Color.WHITE,DEFAULT_SHOW_VALUE=!0;function Cesium3DTileBatchTable(e,t,i,r,n){var a;this.featuresLength=t,this._translucentFeaturesLength=0,defined(i)&&(a=i.extensions),this._extensions=defaultValue(a,{});var o,s,l=initializeProperties(i);if(this._properties=l,this._batchTableHierarchy=initializeHierarchy(this,i,r),this._batchTableBinaryProperties=getBinaryProperties(t,l,r),this._showAlphaProperties=void 0,this._batchValues=void 0,this._batchValuesDirty=!1,this._batchTexture=void 0,this._defaultTexture=void 0,this._pickTexture=void 0,this._pickIds=[],this._content=e,this._colorChangedCallback=n,0<t){var u=Math.min(t,ContextLimits.maximumTextureSize),c=Math.ceil(t/ContextLimits.maximumTextureSize),d=1/u,h=.5*d,p=1/c,f=.5*p;o=new Cartesian2(u,c),s=new Cartesian4(d,h,p,f)}this._textureDimensions=o,this._textureStep=s}function initializeProperties(e){var t={};if(!defined(e))return t;for(var i in e)e.hasOwnProperty(i)&&"HIERARCHY"!==i&&"extensions"!==i&&"extras"!==i&&(t[i]=clone(e[i],!0));return t}function initializeHierarchy(e,t,i){if(defined(t)){var r=e._extensions["3DTILES_batch_table_hierarchy"],n=t.HIERARCHY;if(defined(n)&&(Cesium3DTileBatchTable._deprecationWarning("batchTableHierarchyExtension","The batch table HIERARCHY property has been moved to an extension. Use extensions.3DTILES_batch_table_hierarchy instead."),r=e._extensions["3DTILES_batch_table_hierarchy"]=n),defined(r))return initializeHierarchyValues(r,i)}}function initializeHierarchyValues(e,t){var i,r,n,a=e.instancesLength,o=e.classes,s=e.classIds,l=e.parentCounts,u=e.parentIds,c=a;if(defined(s.byteOffset)&&(s.componentType=defaultValue(s.componentType,ComponentDatatype$1.UNSIGNED_SHORT),s.type=AttributeType$1.SCALAR,s=getBinaryAccessor(s).createArrayBufferView(t.buffer,t.byteOffset+s.byteOffset,a)),defined(l))for(defined(l.byteOffset)&&(l.componentType=defaultValue(l.componentType,ComponentDatatype$1.UNSIGNED_SHORT),l.type=AttributeType$1.SCALAR,l=getBinaryAccessor(l).createArrayBufferView(t.buffer,t.byteOffset+l.byteOffset,a)),n=new Uint16Array(a),i=c=0;i<a;++i)n[i]=c,c+=l[i];defined(u)&&defined(u.byteOffset)&&(u.componentType=defaultValue(u.componentType,ComponentDatatype$1.UNSIGNED_SHORT),u.type=AttributeType$1.SCALAR,u=getBinaryAccessor(u).createArrayBufferView(t.buffer,t.byteOffset+u.byteOffset,c));var d=o.length;for(i=0;i<d;++i){var h=o[i].length,p=o[i].instances,f=getBinaryProperties(h,p,t);o[i].instances=combine(f,p)}var m=arrayFill(new Array(d),0),g=new Uint16Array(a);for(i=0;i<a;++i)r=s[i],g[i]=m[r],++m[r];return{classes:o,classIds:s,classIndexes:g,parentCounts:l,parentIndexes:n,parentIds:u}}function getBinaryProperties(e,t,i){var r;for(var n in t)if(t.hasOwnProperty(n)){var a=t[n],o=a.byteOffset;if(defined(o)){var s=a.componentType,l=a.type;if(!defined(s))throw new RuntimeError("componentType is required.");if(!defined(l))throw new RuntimeError("type is required.");if(!defined(i))throw new RuntimeError("Property "+n+" requires a batch table binary.");var u=getBinaryAccessor(a),c=u.componentsPerAttribute,d=u.classType,h=u.createArrayBufferView(i.buffer,i.byteOffset+o,e);defined(r)||(r={}),r[n]={typedArray:h,componentCount:c,type:d}}}return r}function getByteLength(e){var t=e._textureDimensions;return t.x*t.y*4}function getBatchValues(e){if(!defined(e._batchValues)){var t=getByteLength(e),i=new Uint8Array(t);arrayFill(i,255),e._batchValues=i}return e._batchValues}function getShowAlphaProperties(e){if(!defined(e._showAlphaProperties)){var t=2*e.featuresLength,i=new Uint8Array(t);arrayFill(i,255),e._showAlphaProperties=i}return e._showAlphaProperties}Cesium3DTileBatchTable._deprecationWarning=deprecationWarning,Object.defineProperties(Cesium3DTileBatchTable.prototype,{memorySizeInBytes:{get:function(){var e=0;return defined(this._pickTexture)&&(e+=this._pickTexture.sizeInBytes),defined(this._batchTexture)&&(e+=this._batchTexture.sizeInBytes),e}}}),Cesium3DTileBatchTable.getBinaryProperties=function(e,t,i){return getBinaryProperties(e,t,i)},Cesium3DTileBatchTable.prototype.setShow=function(e,t){if(!t||defined(this._showAlphaProperties)){var i=getShowAlphaProperties(this),r=2*e,n=t?255:0;if(i[r]!==n)i[r]=n,getBatchValues(this)[4*e+3]=t?i[1+r]:0,this._batchValuesDirty=!0}},Cesium3DTileBatchTable.prototype.setAllShow=function(e){for(var t=this.featuresLength,i=0;i<t;++i)this.setShow(i,e)},Cesium3DTileBatchTable.prototype.getShow=function(e){if(!defined(this._showAlphaProperties))return!0;var t=2*e;return 255===this._showAlphaProperties[t]};var scratchColorBytes=new Array(4);Cesium3DTileBatchTable.prototype.setColor=function(e,t){if(!Color.equals(t,DEFAULT_COLOR_VALUE)||defined(this._batchValues)){var i=t.toBytes(scratchColorBytes),r=i[3],n=getBatchValues(this),a=4*e,o=getShowAlphaProperties(this),s=2*e;if(n[a]!==i[0]||n[1+a]!==i[1]||n[2+a]!==i[2]||o[1+s]!==r){n[a]=i[0],n[1+a]=i[1],n[2+a]=i[2];var l=255!==o[1+s],u=0!==o[s];n[3+a]=u?r:0;var c=255!==(o[1+s]=r);c&&!l?++this._translucentFeaturesLength:!c&&l&&--this._translucentFeaturesLength,this._batchValuesDirty=!0,defined(this._colorChangedCallback)&&this._colorChangedCallback(e,t)}}},Cesium3DTileBatchTable.prototype.setAllColor=function(e){for(var t=this.featuresLength,i=0;i<t;++i)this.setColor(i,e)},Cesium3DTileBatchTable.prototype.getColor=function(e,t){if(!defined(this._batchValues))return Color.clone(DEFAULT_COLOR_VALUE,t);var i=this._batchValues,r=4*e,n=this._showAlphaProperties,a=2*e;return Color.fromBytes(i[r],i[1+r],i[2+r],n[1+a],t)},Cesium3DTileBatchTable.prototype.getPickColor=function(e){return this._pickIds[e]};var scratchColor$3=new Color;function getBinaryProperty(e,t){var i=e.typedArray,r=e.componentCount;return 1===r?i[t]:e.type.unpack(i,t*r)}function setBinaryProperty(e,t,i){var r=e.typedArray,n=e.componentCount;1===n?r[t]=i:e.type.pack(i,r,t*n)}Cesium3DTileBatchTable.prototype.applyStyle=function(e){if(!defined(e))return this.setAllColor(DEFAULT_COLOR_VALUE),void this.setAllShow(DEFAULT_SHOW_VALUE);for(var t=this._content,i=this.featuresLength,r=0;r<i;++r){var n=t.getFeature(r),a=defined(e.color)?e.color.evaluateColor(n,scratchColor$3):DEFAULT_COLOR_VALUE,o=defined(e.show)?e.show.evaluate(n):DEFAULT_SHOW_VALUE;this.setColor(r,a),this.setShow(r,o)}};var scratchVisited=[],scratchStack=[],marker=0;function traverseHierarchyMultipleParents(e,t,i){var r=e.classIds,n=e.parentCounts,a=e.parentIds,o=e.parentIndexes,s=r.length,l=scratchVisited;l.length=Math.max(l.length,s);var u=++marker,c=scratchStack;for(c.length=0,c.push(t);0<c.length;)if(l[t=c.pop()]!==u){l[t]=u;var d=i(e,t);if(defined(d))return d;for(var h=n[t],p=o[t],f=0;f<h;++f){var m=a[p+f];m!==t&&c.push(m)}}}function traverseHierarchySingleParent(e,t,i){for(var r=!0;r;){var n=i(e,t);if(defined(n))return n;var a=e.parentIds[t];r=a!==t,t=a}}function traverseHierarchy(e,t,i){var r=e.parentCounts;return defined(e.parentIds)?defined(r)?traverseHierarchyMultipleParents(e,t,i):traverseHierarchySingleParent(e,t,i):i(e,t)}function hasPropertyInHierarchy(e,t,r){return defined(traverseHierarchy(e._batchTableHierarchy,t,function(e,t){var i=e.classIds[t];if(defined(e.classes[i].instances[r]))return!0}))}function getPropertyNamesInHierarchy(e,t,a){traverseHierarchy(e._batchTableHierarchy,t,function(e,t){var i=e.classIds[t],r=e.classes[i].instances;for(var n in r)r.hasOwnProperty(n)&&-1===a.indexOf(n)&&a.push(n)})}function getHierarchyProperty(e,t,o){return traverseHierarchy(e._batchTableHierarchy,t,function(e,t){var i=e.classIds[t],r=e.classes[i],n=e.classIndexes[t],a=r.instances[o];if(defined(a))return defined(a.typedArray)?getBinaryProperty(a,n):clone(a[n],!0)})}function setHierarchyProperty(e,t,o,s){return defined(traverseHierarchy(e._batchTableHierarchy,t,function(e,t){var i=e.classIds[t],r=e.classes[i],n=e.classIndexes[t],a=r.instances[o];if(defined(a))return defined(a.typedArray)?setBinaryProperty(a,n,s):a[n]=clone(s,!0),!0}))}function getGlslComputeSt$2(e){return 1===e._textureDimensions.y?"uniform vec4 tile_textureStep; \nvec2 computeSt(float batchId) \n{ \n float stepX = tile_textureStep.x; \n float centerX = tile_textureStep.y; \n return vec2(centerX + (batchId * stepX), 0.5); \n} \n":"uniform vec4 tile_textureStep; \nuniform vec2 tile_textureDimensions; \nvec2 computeSt(float batchId) \n{ \n float stepX = tile_textureStep.x; \n float centerX = tile_textureStep.y; \n float stepY = tile_textureStep.z; \n float centerY = tile_textureStep.w; \n float xId = mod(batchId, tile_textureDimensions.x); \n float yId = floor(batchId / tile_textureDimensions.x); \n return vec2(centerX + (xId * stepX), centerY + (yId * stepY)); \n} \n"}function getDefaultShader(e,t){return e=ShaderSource.replaceMain(e,"tile_main"),t?e+"uniform float tile_colorBlend; \nvoid tile_color(vec4 tile_featureColor) \n{ \n tile_main(); \n tile_featureColor = czm_gammaCorrect(tile_featureColor); \n gl_FragColor.a *= tile_featureColor.a; \n float highlight = ceil(tile_colorBlend); \n gl_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight); \n} \n":e+"void tile_color(vec4 tile_featureColor) \n{ \n tile_main(); \n} \n"}function replaceDiffuseTextureCalls(e,t){for(var i,r="texture2D("+t,n=0,a=e.indexOf(r,n);-1<a;){for(var o=0,s=a;s<e.length;++s){var l=e.charAt(s);if("("===l)++o;else if(")"===l&&0===--o){i=s+1;break}}var u="tile_diffuse_final("+e.slice(a,i)+", tile_diffuse)";e=e.slice(0,a)+u+e.slice(i),n=a+u.length,a=e.indexOf(r,n)}return e}function modifyDiffuse(e,t,i){if(!defined(t))return getDefaultShader(e,i);var r=new RegExp("(uniform|attribute|in)\\s+(vec[34]|sampler2D)\\s+"+t+";"),n=e.match(r);if(!defined(n))return getDefaultShader(e,i);var a=n[0],o=n[2];e=(e=ShaderSource.replaceMain(e,"tile_main")).replace(a,"");var s;if("vec3"===o||"vec4"===o){var l="vec3"===o?"vec4("+t+", 1.0)":t,u="vec3"===o?"tile_diffuse.xyz":"tile_diffuse";r=new RegExp(t,"g"),e=e.replace(r,u),s=" vec4 source = "+l+"; \n tile_diffuse = tile_diffuse_final(source, tile_featureColor); \n tile_main(); \n"}else"sampler2D"===o&&(e=replaceDiffuseTextureCalls(e,t),s=" tile_diffuse = tile_featureColor; \n tile_main(); \n");return e="uniform float tile_colorBlend; \nvec4 tile_diffuse = vec4(1.0); \nbool isWhite(vec3 color) \n{ \n return all(greaterThan(color, vec3(1.0 - czm_epsilon3))); \n} \nvec4 tile_diffuse_final(vec4 sourceDiffuse, vec4 tileDiffuse) \n{ \n vec4 blendDiffuse = mix(sourceDiffuse, tileDiffuse, tile_colorBlend); \n vec4 diffuse = isWhite(tileDiffuse.rgb) ? sourceDiffuse : blendDiffuse; \n return vec4(diffuse.rgb, sourceDiffuse.a); \n} \n"+a+"\n"+e+"\nvoid tile_color(vec4 tile_featureColor) \n{ \n"+s,i&&(e+=" tile_featureColor = czm_gammaCorrect(tile_featureColor); \n gl_FragColor.a *= tile_featureColor.a; \n float highlight = ceil(tile_colorBlend); \n gl_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight); \n"),e+="} \n"}function getColorBlend(e){var t=e._content.tileset,i=t.colorBlendMode,r=t.colorBlendAmount;return i===Cesium3DTileColorBlendMode$1.HIGHLIGHT?0:i===Cesium3DTileColorBlendMode$1.REPLACE?1:i===Cesium3DTileColorBlendMode$1.MIX?CesiumMath.clamp(r,CesiumMath.EPSILON4,1):void 0}Cesium3DTileBatchTable.prototype.isClass=function(e,r){var t=this._batchTableHierarchy;return!!defined(t)&&defined(traverseHierarchy(t,e,function(e,t){var i=e.classIds[t];if(e.classes[i].name===r)return!0}))},Cesium3DTileBatchTable.prototype.isExactClass=function(e,t){return this.getExactClassName(e)===t},Cesium3DTileBatchTable.prototype.getExactClassName=function(e){var t=this._batchTableHierarchy;if(defined(t)){var i=t.classIds[e];return t.classes[i].name}},Cesium3DTileBatchTable.prototype.hasProperty=function(e,t){return defined(this._properties[t])||defined(this._batchTableHierarchy)&&hasPropertyInHierarchy(this,e,t)},Cesium3DTileBatchTable.prototype.getPropertyNames=function(e,t){(t=defined(t)?t:[]).length=0;var i=Object.keys(this._properties);return t.push.apply(t,i),defined(this._batchTableHierarchy)&&getPropertyNamesInHierarchy(this,e,t),t},Cesium3DTileBatchTable.prototype.getProperty=function(e,t){if(defined(this._batchTableBinaryProperties)){var i=this._batchTableBinaryProperties[t];if(defined(i))return getBinaryProperty(i,e)}var r=this._properties[t];if(defined(r))return clone(r[e],!0);if(defined(this._batchTableHierarchy)){var n=getHierarchyProperty(this,e,t);if(defined(n))return n}},Cesium3DTileBatchTable.prototype.setProperty=function(e,t,i){var r=this.featuresLength;if(defined(this._batchTableBinaryProperties)){var n=this._batchTableBinaryProperties[t];if(defined(n))return void setBinaryProperty(n,e,i)}if(!defined(this._batchTableHierarchy)||!setHierarchyProperty(this,e,t,i)){var a=this._properties[t];defined(a)||(this._properties[t]=new Array(r),a=this._properties[t]),a[e]=clone(i,!0)}},Cesium3DTileBatchTable.prototype.getVertexShaderCallback=function(r,n,a){if(0!==this.featuresLength){var o=this;return function(e){var t,i=modifyDiffuse(e,a,!1);return 0<ContextLimits.maximumVertexTextureImageUnits?(t="",r&&(t+="uniform bool tile_translucentCommand; \n"),t+="uniform sampler2D tile_batchTexture; \nvarying vec4 tile_featureColor; \nvarying vec2 tile_featureSt; \nvoid main() \n{ \n vec2 st = computeSt("+n+"); \n vec4 featureProperties = texture2D(tile_batchTexture, st); \n tile_color(featureProperties); \n float show = ceil(featureProperties.a); \n gl_Position *= show; \n",r&&(t+=" bool isStyleTranslucent = (featureProperties.a != 1.0); \n if (czm_pass == czm_passTranslucent) \n { \n if (!isStyleTranslucent && !tile_translucentCommand) \n { \n gl_Position *= 0.0; \n } \n } \n else \n { \n if (isStyleTranslucent) \n { \n gl_Position *= 0.0; \n } \n } \n"),t+=" tile_featureColor = featureProperties; \n tile_featureSt = st; \n}"):t="varying vec2 tile_featureSt; \nvoid main() \n{ \n tile_color(vec4(1.0)); \n tile_featureSt = computeSt("+n+"); \n}",i+"\n"+getGlslComputeSt$2(o)+t}}},Cesium3DTileBatchTable.prototype.getFragmentShaderCallback=function(t,i){if(0!==this.featuresLength)return function(e){return e=modifyDiffuse(e,i,!0),0<ContextLimits.maximumVertexTextureImageUnits?e+="uniform sampler2D tile_pickTexture; \nvarying vec2 tile_featureSt; \nvarying vec4 tile_featureColor; \nvoid main() \n{ \n tile_color(tile_featureColor); \n}":(t&&(e+="uniform bool tile_translucentCommand; \n"),e+="uniform sampler2D tile_pickTexture; \nuniform sampler2D tile_batchTexture; \nvarying vec2 tile_featureSt; \nvoid main() \n{ \n vec4 featureProperties = texture2D(tile_batchTexture, tile_featureSt); \n if (featureProperties.a == 0.0) { \n discard; \n } \n",t&&(e+=" bool isStyleTranslucent = (featureProperties.a != 1.0); \n if (czm_pass == czm_passTranslucent) \n { \n if (!isStyleTranslucent && !tile_translucentCommand) \n { \n discard; \n } \n } \n else \n { \n if (isStyleTranslucent) \n { \n discard; \n } \n } \n"),e+=" tile_color(featureProperties); \n} \n"),e}},Cesium3DTileBatchTable.prototype.getClassificationFragmentShaderCallback=function(){if(0!==this.featuresLength)return function(e){return e=ShaderSource.replaceMain(e,"tile_main"),0<ContextLimits.maximumVertexTextureImageUnits?e+="uniform sampler2D tile_pickTexture;\nvarying vec2 tile_featureSt; \nvarying vec4 tile_featureColor; \nvoid main() \n{ \n tile_main(); \n gl_FragColor = tile_featureColor; \n}":e+="uniform sampler2D tile_batchTexture; \nuniform sampler2D tile_pickTexture;\nvarying vec2 tile_featureSt; \nvoid main() \n{ \n tile_main(); \n vec4 featureProperties = texture2D(tile_batchTexture, tile_featureSt); \n if (featureProperties.a == 0.0) { \n discard; \n } \n gl_FragColor = featureProperties; \n} \n",e}},Cesium3DTileBatchTable.prototype.getUniformMapCallback=function(){if(0!==this.featuresLength){var t=this;return function(e){return combine(e,{tile_batchTexture:function(){return defaultValue(t._batchTexture,t._defaultTexture)},tile_textureDimensions:function(){return t._textureDimensions},tile_textureStep:function(){return t._textureStep},tile_colorBlend:function(){return getColorBlend(t)},tile_pickTexture:function(){return t._pickTexture}})}}},Cesium3DTileBatchTable.prototype.getPickId=function(){return"texture2D(tile_pickTexture, tile_featureSt)"};var StyleCommandsNeeded={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};function getStyleCommandsNeeded(e){var t=e._translucentFeaturesLength;return 0===t?StyleCommandsNeeded.ALL_OPAQUE:t===e.featuresLength?StyleCommandsNeeded.ALL_TRANSLUCENT:StyleCommandsNeeded.OPAQUE_AND_TRANSLUCENT}function deriveCommand(e){var t=DrawCommand.shallowClone(e),i=t.pass===Pass$1.TRANSLUCENT;return t.uniformMap=defined(t.uniformMap)?t.uniformMap:{},t.uniformMap.tile_translucentCommand=function(){return i},t}function deriveTranslucentCommand(e){var t=DrawCommand.shallowClone(e);return t.pass=Pass$1.TRANSLUCENT,t.renderState=getTranslucentRenderState(e.renderState),t}function deriveOpaqueCommand(e){var t=DrawCommand.shallowClone(e);return t.renderState=getOpaqueRenderState(e.renderState),t}function getLogDepthPolygonOffsetFragmentShaderProgram(e,t){var i=e.shaderCache.getDerivedShaderProgram(t,"zBackfaceLogDepth");if(!defined(i)){var r=t.fragmentShaderSource.clone();r.defines=defined(r.defines)?r.defines.slice(0):[],r.defines.push("POLYGON_OFFSET"),r.sources.unshift("#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\n"),i=e.shaderCache.createDerivedShaderProgram(t,"zBackfaceLogDepth",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:r,attributeLocations:t._attributeLocations})}return i}function deriveZBackfaceCommand(e,t){var i=DrawCommand.shallowClone(t),r=clone(i.renderState,!0);r.cull.enabled=!0,r.cull.face=CullFace$1.FRONT,r.colorMask={red:!1,green:!1,blue:!1,alpha:!1},r.polygonOffset={enabled:!0,factor:5,units:5},r.stencilTest=StencilConstants$1.setCesium3DTileBit(),r.stencilMask=StencilConstants$1.CESIUM_3D_TILE_MASK,i.renderState=RenderState.fromCache(r),i.castShadows=!1,i.receiveShadows=!1,i.uniformMap=clone(t.uniformMap);var n=new Cartesian2(5,5);return i.uniformMap.u_polygonOffset=function(){return n},i.shaderProgram=getLogDepthPolygonOffsetFragmentShaderProgram(e,t.shaderProgram),i}function deriveStencilCommand(e,t){var i=DrawCommand.shallowClone(e),r=clone(i.renderState,!0);return r.stencilTest.enabled=!0,r.stencilTest.mask=StencilConstants$1.SKIP_LOD_MASK,r.stencilTest.reference=StencilConstants$1.CESIUM_3D_TILE_MASK|t<<StencilConstants$1.SKIP_LOD_BIT_SHIFT,r.stencilTest.frontFunction=StencilFunction$1.GREATER_OR_EQUAL,r.stencilTest.frontOperation.zPass=StencilOperation$1.REPLACE,r.stencilTest.backFunction=StencilFunction$1.GREATER_OR_EQUAL,r.stencilTest.backOperation.zPass=StencilOperation$1.REPLACE,r.stencilMask=StencilConstants$1.CESIUM_3D_TILE_MASK|StencilConstants$1.SKIP_LOD_MASK,i.renderState=RenderState.fromCache(r),i}function getLastSelectionDepth(e){return(e.renderState.stencilTest.reference&StencilConstants$1.SKIP_LOD_MASK)>>>StencilConstants$1.SKIP_LOD_BIT_SHIFT}function getTranslucentRenderState(e){var t=clone(e,!0);return t.cull.enabled=!1,t.depthTest.enabled=!0,t.depthMask=!1,t.blending=BlendingState$1.ALPHA_BLEND,RenderState.fromCache(t)}function getOpaqueRenderState(e){var t=clone(e,!0);return t.stencilTest=StencilConstants$1.setCesium3DTileBit(),t.stencilMask=StencilConstants$1.CESIUM_3D_TILE_MASK,RenderState.fromCache(t)}function createTexture$2(e,t,i){var r=e._textureDimensions;return new Texture({context:t,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:PixelDatatype$1.UNSIGNED_BYTE,source:{width:r.x,height:r.y,arrayBufferView:i},flipY:!1,sampler:Sampler.NEAREST})}function createPickTexture(e,t){var i=e.featuresLength;if(!defined(e._pickTexture)&&0<i){for(var r=e._pickIds,n=getByteLength(e),a=new Uint8Array(n),o=e._content,s=0;s<i;++s){var l=t.createPickId(o.getFeature(s));r.push(l);var u=l.color,c=4*s;a[c]=Color.floatToByte(u.red),a[1+c]=Color.floatToByte(u.green),a[2+c]=Color.floatToByte(u.blue),a[3+c]=Color.floatToByte(u.alpha)}e._pickTexture=createTexture$2(e,t,a),o.tileset._statistics.batchTableByteLength+=e._pickTexture.sizeInBytes}}function updateBatchTexture(e){var t=e._textureDimensions;e._batchTexture.copyFrom({width:t.x,height:t.y,arrayBufferView:e._batchValues})}function Cesium3DTileFeature(e,t){this._content=e,this._batchId=t,this._color=void 0}function Cesium3DTileFeatureTable(e,t){this.json=e,this.buffer=t,this._cachedTypedArrays={},this.featuresLength=0}function getTypedArrayFromBinary(e,t,i,r,n,a){var o=e._cachedTypedArrays,s=o[t];return defined(s)||(s=ComponentDatatype$1.createArrayBufferView(i,e.buffer.buffer,e.buffer.byteOffset+a,n*r),o[t]=s),s}function getTypedArrayFromArray(e,t,i,r){var n=e._cachedTypedArrays,a=n[t];return defined(a)||(a=ComponentDatatype$1.createTypedArray(i,r),n[t]=a),a}function addToArray(e,t,i){if(i=defaultValue(i,!1)){var r=e.indexOf(t);if(-1<r)return r}return e.push(t),e.length-1}function hasExtension(e,t){return defined(e.extensionsUsed)&&0<=e.extensionsUsed.indexOf(t)}function ForEach(){}function numberOfComponentsForType(e){switch(e){case"SCALAR":return 1;case"VEC2":return 2;case"VEC3":return 3;case"VEC4":case"MAT2":return 4;case"MAT3":return 9;case"MAT4":return 16}}function getAccessorByteStride(e,t){var i=t.bufferView;if(defined(i)){var r=e.bufferViews[i];if(defined(r.byteStride)&&0<r.byteStride)return r.byteStride}return ComponentDatatype$1.getSizeInBytes(t.componentType)*numberOfComponentsForType(t.type)}function addDefaults(n){ForEach.accessor(n,function(e){defined(e.bufferView)&&(e.byteOffset=defaultValue(e.byteOffset,0))}),ForEach.bufferView(n,function(e){defined(e.buffer)&&(e.byteOffset=defaultValue(e.byteOffset,0))}),ForEach.mesh(n,function(e){ForEach.meshPrimitive(e,function(e){if(e.mode=defaultValue(e.mode,WebGLConstants$1.TRIANGLES),!defined(e.material)){defined(n.materials)||(n.materials=[]);e.material=addToArray(n.materials,{name:"default"})}})}),ForEach.accessorContainingVertexAttributeData(n,function(e){var t=n.accessors[e],i=t.bufferView;if(t.normalized=defaultValue(t.normalized,!1),defined(i)){var r=n.bufferViews[i];r.byteStride=getAccessorByteStride(n,t),r.target=WebGLConstants$1.ARRAY_BUFFER}}),ForEach.accessorContainingIndexData(n,function(e){var t=n.accessors[e].bufferView;defined(t)&&(n.bufferViews[t].target=WebGLConstants$1.ELEMENT_ARRAY_BUFFER)}),ForEach.material(n,function(e){var t=defaultValue(e.extensions,defaultValue.EMPTY_OBJECT),i=t.KHR_materials_common;if(defined(i)){var r=i.technique,n=defined(i.values)?i.values:{};return(i.values=n).ambient=defined(n.ambient)?n.ambient:[0,0,0,1],n.emission=defined(n.emission)?n.emission:[0,0,0,1],n.transparency=defaultValue(n.transparency,1),n.transparent=defaultValue(n.transparent,!1),n.doubleSided=defaultValue(n.doubleSided,!1),void("CONSTANT"!==r&&(n.diffuse=defined(n.diffuse)?n.diffuse:[0,0,0,1],"LAMBERT"!==r&&(n.specular=defined(n.specular)?n.specular:[0,0,0,1],n.shininess=defaultValue(n.shininess,0))))}e.emissiveFactor=defaultValue(e.emissiveFactor,[0,0,0]),e.alphaMode=defaultValue(e.alphaMode,"OPAQUE"),e.doubleSided=defaultValue(e.doubleSided,!1),"MASK"===e.alphaMode&&(e.alphaCutoff=defaultValue(e.alphaCutoff,.5)),defined(t.KHR_techniques_webgl)&&ForEach.materialValue(e,function(e){defined(e.index)&&addTextureDefaults(e)}),addTextureDefaults(e.emissiveTexture),addTextureDefaults(e.normalTexture),addTextureDefaults(e.occlusionTexture);var a=e.pbrMetallicRoughness;defined(a)&&(a.baseColorFactor=defaultValue(a.baseColorFactor,[1,1,1,1]),a.metallicFactor=defaultValue(a.metallicFactor,1),a.roughnessFactor=defaultValue(a.roughnessFactor,1),addTextureDefaults(a.baseColorTexture),addTextureDefaults(a.metallicRoughnessTexture));var o=t.pbrSpecularGlossiness;defined(o)&&(o.diffuseFactor=defaultValue(o.diffuseFactor,[1,1,1,1]),o.specularFactor=defaultValue(o.specularFactor,[1,1,1]),o.glossinessFactor=defaultValue(o.glossinessFactor,1),addTextureDefaults(o.specularGlossinessTexture))}),ForEach.animation(n,function(e){ForEach.animationSampler(e,function(e){e.interpolation=defaultValue(e.interpolation,"LINEAR")})});var i=getAnimatedNodes(n);return ForEach.node(n,function(e,t){defined(i[t])||defined(e.translation)||defined(e.rotation)||defined(e.scale)?(e.translation=defaultValue(e.translation,[0,0,0]),e.rotation=defaultValue(e.rotation,[0,0,0,1]),e.scale=defaultValue(e.scale,[1,1,1])):e.matrix=defaultValue(e.matrix,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}),ForEach.sampler(n,function(e){e.wrapS=defaultValue(e.wrapS,WebGLConstants$1.REPEAT),e.wrapT=defaultValue(e.wrapT,WebGLConstants$1.REPEAT)}),defined(n.scenes)&&!defined(n.scene)&&(n.scene=0),n}function getAnimatedNodes(e){var n={};return ForEach.animation(e,function(e){ForEach.animationChannel(e,function(e){var t=e.target,i=t.node,r=t.path;"translation"!==r&&"rotation"!==r&&"scale"!==r||(n[i]=!0)})}),n}function addTextureDefaults(e){defined(e)&&(e.texCoord=defaultValue(e.texCoord,0))}function addPipelineExtras(e){return ForEach.shader(e,function(e){addExtras(e)}),ForEach.buffer(e,function(e){addExtras(e)}),ForEach.image(e,function(e){addExtras(e),ForEach.compressedImage(e,function(e){addExtras(e)})}),addExtras(e),e}function addExtras(e){e.extras=defined(e.extras)?e.extras:{},e.extras._pipeline=defined(e.extras._pipeline)?e.extras._pipeline:{}}function removeExtensionsRequired(e,t){var i=e.extensionsRequired;if(defined(i)){var r=i.indexOf(t);0<=r&&i.splice(r,1),0===i.length&&delete e.extensionsRequired}}function removeExtensionsUsed(e,t){var i=e.extensionsUsed;if(defined(i)){var r=i.indexOf(t);0<=r&&i.splice(r,1),removeExtensionsRequired(e,t),0===i.length&&delete e.extensionsUsed}}Cesium3DTileBatchTable.prototype.addDerivedCommands=function(e,t){for(var i=e.commandList,r=i.length,n=this._content._tile,a=n._finalResolution,o=n.tileset,s=o._skipLevelOfDetail&&o._hasMixedContent&&e.context.stencilBuffer,l=getStyleCommandsNeeded(this),u=t;u<r;++u){var c=i[u],d=c.derivedCommands.tileset;defined(d)&&!c.dirty||(d={},(c.derivedCommands.tileset=d).originalCommand=deriveCommand(c),c.dirty=!1);var h=d.originalCommand;l!==StyleCommandsNeeded.ALL_OPAQUE&&c.pass!==Pass$1.TRANSLUCENT&&(defined(d.translucent)||(d.translucent=deriveTranslucentCommand(h))),l!==StyleCommandsNeeded.ALL_TRANSLUCENT&&c.pass!==Pass$1.TRANSLUCENT&&(defined(d.opaque)||(d.opaque=deriveOpaqueCommand(h)),s&&(a||(defined(d.zback)||(d.zback=deriveZBackfaceCommand(e.context,h)),o._backfaceCommands.push(d.zback)),defined(d.stencil)&&n._selectionDepth===getLastSelectionDepth(d.stencil)||(c.renderState.depthMask?d.stencil=deriveStencilCommand(h,n._selectionDepth):d.stencil=d.opaque)));var p=s?d.stencil:d.opaque,f=d.translucent;c.pass!==Pass$1.TRANSLUCENT?(l===StyleCommandsNeeded.ALL_OPAQUE&&(i[u]=p),l===StyleCommandsNeeded.ALL_TRANSLUCENT&&(i[u]=f),l===StyleCommandsNeeded.OPAQUE_AND_TRANSLUCENT&&(i[u]=p,i.push(f))):i[u]=h}},Cesium3DTileBatchTable.prototype.update=function(e,t){var i=t.context;this._defaultTexture=i.defaultTexture;var r=t.passes;(r.pick||r.postProcess)&&createPickTexture(this,i),this._batchValuesDirty&&(this._batchValuesDirty=!1,defined(this._batchTexture)||(this._batchTexture=createTexture$2(this,i,this._batchValues),e._statistics.batchTableByteLength+=this._batchTexture.sizeInBytes),updateBatchTexture(this))},Cesium3DTileBatchTable.prototype.isDestroyed=function(){return!1},Cesium3DTileBatchTable.prototype.destroy=function(){this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),this._pickTexture=this._pickTexture&&this._pickTexture.destroy();for(var e=this._pickIds,t=e.length,i=0;i<t;++i)e[i].destroy();return destroyObject(this)},Object.defineProperties(Cesium3DTileFeature.prototype,{show:{get:function(){return this._content.batchTable.getShow(this._batchId)},set:function(e){this._content.batchTable.setShow(this._batchId,e)}},color:{get:function(){return defined(this._color)||(this._color=new Color),this._content.batchTable.getColor(this._batchId,this._color)},set:function(e){this._content.batchTable.setColor(this._batchId,e)}},content:{get:function(){return this._content}},tileset:{get:function(){return this._content.tileset}},primitive:{get:function(){return this._content.tileset}},pickId:{get:function(){return this._content.batchTable.getPickColor(this._batchId)}}}),Cesium3DTileFeature.prototype.hasProperty=function(e){return this._content.batchTable.hasProperty(this._batchId,e)},Cesium3DTileFeature.prototype.getPropertyNames=function(e){return this._content.batchTable.getPropertyNames(this._batchId,e)},Cesium3DTileFeature.prototype.getProperty=function(e){return this._content.batchTable.getProperty(this._batchId,e)},Cesium3DTileFeature.prototype.setProperty=function(e,t){this._content.batchTable.setProperty(this._batchId,e,t),this._content.featurePropertiesDirty=!0},Cesium3DTileFeature.prototype.isExactClass=function(e){return this._content.batchTable.isExactClass(this._batchId,e)},Cesium3DTileFeature.prototype.isClass=function(e){return this._content.batchTable.isClass(this._batchId,e)},Cesium3DTileFeature.prototype.getExactClassName=function(){return this._content.batchTable.getExactClassName(this._batchId)},Cesium3DTileFeatureTable.prototype.getGlobalProperty=function(e,t,i){var r=this.json[e];if(defined(r))return defined(r.byteOffset)?getTypedArrayFromBinary(this,e,t=defaultValue(t,ComponentDatatype$1.UNSIGNED_INT),i=defaultValue(i,1),1,r.byteOffset):r},Cesium3DTileFeatureTable.prototype.getPropertyArray=function(e,t,i){var r=this.json[e];if(defined(r))return defined(r.byteOffset)?(defined(r.componentType)&&(t=ComponentDatatype$1.fromName(r.componentType)),getTypedArrayFromBinary(this,e,t,i,this.featuresLength,r.byteOffset)):getTypedArrayFromArray(this,e,t,r)},Cesium3DTileFeatureTable.prototype.getProperty=function(e,t,i,r,n){if(defined(this.json[e])){var a=this.getPropertyArray(e,t,i);if(1===i)return a[r];for(var o=0;o<i;++o)n[o]=a[i*r+o];return n}},ForEach.objectLegacy=function(e,t){if(defined(e))for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var r=t(e[i],i);if(defined(r))return r}},ForEach.object=function(e,t){if(defined(e))for(var i=e.length,r=0;r<i;r++){var n=t(e[r],r);if(defined(n))return n}},ForEach.topLevel=function(e,t,i){var r=e[t];return defined(r)&&!Array.isArray(r)?ForEach.objectLegacy(r,i):ForEach.object(r,i)},ForEach.accessor=function(e,t){return ForEach.topLevel(e,"accessors",t)},ForEach.accessorWithSemantic=function(e,r,n){var a={};return ForEach.mesh(e,function(e){return ForEach.meshPrimitive(e,function(e){var t=ForEach.meshPrimitiveAttribute(e,function(e,t){if(0===t.indexOf(r)&&!defined(a[e])){a[e]=!0;var i=n(e);if(defined(i))return i}});return defined(t)?t:ForEach.meshPrimitiveTarget(e,function(e){return ForEach.meshPrimitiveTargetAttribute(e,function(e,t){if(0===t.indexOf(r)&&!defined(a[e])){a[e]=!0;var i=n(e);if(defined(i))return i}})})})})},ForEach.accessorContainingVertexAttributeData=function(e,i){var r={};return ForEach.mesh(e,function(e){return ForEach.meshPrimitive(e,function(e){var t=ForEach.meshPrimitiveAttribute(e,function(e){if(!defined(r[e])){r[e]=!0;var t=i(e);if(defined(t))return t}});return defined(t)?t:ForEach.meshPrimitiveTarget(e,function(e){return ForEach.meshPrimitiveTargetAttribute(e,function(e){if(!defined(r[e])){r[e]=!0;var t=i(e);if(defined(t))return t}})})})})},ForEach.accessorContainingIndexData=function(e,r){var n={};return ForEach.mesh(e,function(e){return ForEach.meshPrimitive(e,function(e){var t=e.indices;if(defined(t)&&!defined(n[t])){n[t]=!0;var i=r(t);if(defined(i))return i}})})},ForEach.animation=function(e,t){return ForEach.topLevel(e,"animations",t)},ForEach.animationChannel=function(e,t){var i=e.channels;return ForEach.object(i,t)},ForEach.animationSampler=function(e,t){var i=e.samplers;return ForEach.object(i,t)},ForEach.buffer=function(e,t){return ForEach.topLevel(e,"buffers",t)},ForEach.bufferView=function(e,t){return ForEach.topLevel(e,"bufferViews",t)},ForEach.camera=function(e,t){return ForEach.topLevel(e,"cameras",t)},ForEach.image=function(e,t){return ForEach.topLevel(e,"images",t)},ForEach.compressedImage=function(e,t){if(defined(e.extras)){var i=e.extras.compressedImage3DTiles;for(var r in i)if(Object.prototype.hasOwnProperty.call(i,r)){var n=t(i[r],r);if(defined(n))return n}}},ForEach.material=function(e,t){return ForEach.topLevel(e,"materials",t)},ForEach.materialValue=function(e,t){var i=e.values;for(var r in defined(e.extensions)&&defined(e.extensions.KHR_techniques_webgl)&&(i=e.extensions.KHR_techniques_webgl.values),i)if(Object.prototype.hasOwnProperty.call(i,r)){var n=t(i[r],r);if(defined(n))return n}},ForEach.mesh=function(e,t){return ForEach.topLevel(e,"meshes",t)},ForEach.meshPrimitive=function(e,t){var i=e.primitives;if(defined(i))for(var r=i.length,n=0;n<r;n++){var a=t(i[n],n);if(defined(a))return a}},ForEach.meshPrimitiveAttribute=function(e,t){var i=e.attributes;for(var r in i)if(Object.prototype.hasOwnProperty.call(i,r)){var n=t(i[r],r);if(defined(n))return n}},ForEach.meshPrimitiveTarget=function(e,t){var i=e.targets;if(defined(i))for(var r=i.length,n=0;n<r;++n){var a=t(i[n],n);if(defined(a))return a}},ForEach.meshPrimitiveTargetAttribute=function(e,t){for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var r=t(e[i],i);if(defined(r))return r}},ForEach.node=function(e,t){return ForEach.topLevel(e,"nodes",t)},ForEach.nodeInTree=function(e,t,i){var r=e.nodes;if(defined(r))for(var n=t.length,a=0;a<n;a++){var o=t[a],s=r[o];if(defined(s)){var l=i(s,o);if(defined(l))return l;var u=s.children;if(defined(u)&&defined(l=ForEach.nodeInTree(e,u,i)))return l}}},ForEach.nodeInScene=function(e,t,i){var r=t.nodes;if(defined(r))return ForEach.nodeInTree(e,r,i)},ForEach.program=function(e,t){return hasExtension(e,"KHR_techniques_webgl")?ForEach.object(e.extensions.KHR_techniques_webgl.programs,t):ForEach.topLevel(e,"programs",t)},ForEach.sampler=function(e,t){return ForEach.topLevel(e,"samplers",t)},ForEach.scene=function(e,t){return ForEach.topLevel(e,"scenes",t)},ForEach.shader=function(e,t){return hasExtension(e,"KHR_techniques_webgl")?ForEach.object(e.extensions.KHR_techniques_webgl.shaders,t):ForEach.topLevel(e,"shaders",t)},ForEach.skin=function(e,t){return ForEach.topLevel(e,"skins",t)},ForEach.skinJoint=function(e,t){var i=e.joints;if(defined(i))for(var r=i.length,n=0;n<r;n++){var a=t(i[n]);if(defined(a))return a}},ForEach.techniqueAttribute=function(e,t){var i=e.attributes;for(var r in i)if(Object.prototype.hasOwnProperty.call(i,r)){var n=t(i[r],r);if(defined(n))return n}},ForEach.techniqueUniform=function(e,t){var i=e.uniforms;for(var r in i)if(Object.prototype.hasOwnProperty.call(i,r)){var n=t(i[r],r);if(defined(n))return n}},ForEach.techniqueParameter=function(e,t){var i=e.parameters;for(var r in i)if(Object.prototype.hasOwnProperty.call(i,r)){var n=t(i[r],r);if(defined(n))return n}},ForEach.technique=function(e,t){return hasExtension(e,"KHR_techniques_webgl")?ForEach.object(e.extensions.KHR_techniques_webgl.techniques,t):ForEach.topLevel(e,"techniques",t)},ForEach.texture=function(e,t){return ForEach.topLevel(e,"textures",t)};var sizeOfUint32$3=4;function parseGlb(e){if("glTF"!==getMagic(e))throw new RuntimeError("File is not valid binary glTF");var t=readHeader(e,0,5),i=t[1];if(1!==i&&2!==i)throw new RuntimeError("Binary glTF version is not 1 or 2");return 1===i?parseGlbVersion1(e,t):parseGlbVersion2(e,t)}function readHeader(e,t,i){for(var r=new DataView(e.buffer),n=new Array(i),a=0;a<i;++a)n[a]=r.getUint32(e.byteOffset+t+a*sizeOfUint32$3,!0);return n}function parseGlbVersion1(e,t){var i=t[2],r=t[3];if(0!==t[4])throw new RuntimeError("Binary glTF scene format is not JSON");var n=20+r,a=getStringFromTypedArray(e,20,r),o=JSON.parse(a);addPipelineExtras(o);var s=e.subarray(n,i),l=o.buffers;if(defined(l)&&0<Object.keys(l).length){var u=defaultValue(l.binary_glTF,l.KHR_binary_glTF);defined(u)&&(u.extras._pipeline.source=s)}return removeExtensionsUsed(o,"KHR_binary_glTF"),o}function parseGlbVersion2(e,t){for(var i,r,n=t[2],a=12;a<n;){var o=readHeader(e,a,2),s=o[0],l=o[1];a+=8;var u=e.subarray(a,a+s);if(a+=s,1313821514===l){var c=getStringFromTypedArray(u);addPipelineExtras(i=JSON.parse(c))}else 5130562===l&&(r=u)}if(defined(i)&&defined(r)){var d=i.buffers;if(defined(d)&&0<d.length)d[0].extras._pipeline.source=r}return i}function addExtensionsUsed(e,t){var i=e.extensionsUsed;defined(i)||(i=[],e.extensionsUsed=i),addToArray(i,t,!0)}function getComponentReader(e){switch(e){case ComponentDatatype$1.BYTE:return function(e,t,i,r,n){for(var a=0;a<i;++a)n[a]=e.getInt8(t+a*r)};case ComponentDatatype$1.UNSIGNED_BYTE:return function(e,t,i,r,n){for(var a=0;a<i;++a)n[a]=e.getUint8(t+a*r)};case ComponentDatatype$1.SHORT:return function(e,t,i,r,n){for(var a=0;a<i;++a)n[a]=e.getInt16(t+a*r,!0)};case ComponentDatatype$1.UNSIGNED_SHORT:return function(e,t,i,r,n){for(var a=0;a<i;++a)n[a]=e.getUint16(t+a*r,!0)};case ComponentDatatype$1.INT:return function(e,t,i,r,n){for(var a=0;a<i;++a)n[a]=e.getInt32(t+a*r,!0)};case ComponentDatatype$1.UNSIGNED_INT:return function(e,t,i,r,n){for(var a=0;a<i;++a)n[a]=e.getUint32(t+a*r,!0)};case ComponentDatatype$1.FLOAT:return function(e,t,i,r,n){for(var a=0;a<i;++a)n[a]=e.getFloat32(t+a*r,!0)};case ComponentDatatype$1.DOUBLE:return function(e,t,i,r,n){for(var a=0;a<i;++a)n[a]=e.getFloat64(t+a*r,!0)}}}function findAccessorMinMax(e,t){var i=e.bufferViews,r=e.buffers,n=t.bufferView,a=numberOfComponentsForType(t.type);if(!defined(t.bufferView))return{min:arrayFill(new Array(a),0),max:arrayFill(new Array(a),0)};for(var o=arrayFill(new Array(a),Number.POSITIVE_INFINITY),s=arrayFill(new Array(a),Number.NEGATIVE_INFINITY),l=i[n],u=r[l.buffer].extras._pipeline.source,c=t.count,d=getAccessorByteStride(e,t),h=t.byteOffset+l.byteOffset+u.byteOffset,p=t.componentType,f=ComponentDatatype$1.getSizeInBytes(p),m=new DataView(u.buffer),g=new Array(a),y=getComponentReader(p),v=0;v<c;v++){y(m,h,a,f,g);for(var _=0;_<a;_++){var C=g[_];o[_]=Math.min(o[_],C),s[_]=Math.max(s[_],C)}h+=d}return{min:o,max:s}}var defaultBlendEquation=[WebGLConstants$1.FUNC_ADD,WebGLConstants$1.FUNC_ADD],defaultBlendFactors=[WebGLConstants$1.ONE,WebGLConstants$1.ZERO,WebGLConstants$1.ONE,WebGLConstants$1.ZERO];function isStateEnabled(e,t){var i=e.enable;return!!defined(i)&&-1<i.indexOf(t)}var supportedBlendFactors=[WebGLConstants$1.ZERO,WebGLConstants$1.ONE,WebGLConstants$1.SRC_COLOR,WebGLConstants$1.ONE_MINUS_SRC_COLOR,WebGLConstants$1.SRC_ALPHA,WebGLConstants$1.ONE_MINUS_SRC_ALPHA,WebGLConstants$1.DST_ALPHA,WebGLConstants$1.ONE_MINUS_DST_ALPHA,WebGLConstants$1.DST_COLOR,WebGLConstants$1.ONE_MINUS_DST_COLOR];function getSupportedBlendFactors(e,t){if(!defined(e))return t;for(var i=0;i<4;i++)if(-1===supportedBlendFactors.indexOf(e[i]))return t;return e}function moveTechniqueRenderStates(e){var a={},o={};return defined(e.techniques)&&(ForEach.technique(e,function(e,t){var i=e.states;if(defined(i)){var r=o[t]={};if(isStateEnabled(i,WebGLConstants$1.BLEND)){r.alphaMode="BLEND";var n=i.functions;defined(n)&&(defined(n.blendEquationSeparate)||defined(n.blendFuncSeparate))&&(a[t]={blendEquation:defaultValue(n.blendEquationSeparate,defaultBlendEquation),blendFactors:getSupportedBlendFactors(n.blendFuncSeparate,defaultBlendFactors)})}isStateEnabled(i,WebGLConstants$1.CULL_FACE)||(r.doubleSided=!0),delete e.states}}),0<Object.keys(a).length&&(defined(e.extensions)||(e.extensions={}),addExtensionsUsed(e,"KHR_blend")),ForEach.material(e,function(i){if(defined(i.technique)){var e=o[i.technique];ForEach.objectLegacy(e,function(e,t){i[t]=e});var t=a[i.technique];defined(t)&&(defined(i.extensions)||(i.extensions={}),i.extensions.KHR_blend=t)}})),e}function addExtensionsRequired(e,t){var i=e.extensionsRequired;defined(i)||(i=[],e.extensionsRequired=i),addToArray(i,t,!0),addExtensionsUsed(e,t)}function moveTechniquesToExtension(l){var e=l.techniques,u={},c={};if(defined(e)){var d={programs:[],shaders:[],techniques:[]},h=l.glExtensionsUsed;delete l.glExtensionsUsed,ForEach.technique(l,function(i,e){var r,n={name:i.name,program:void 0,attributes:{},uniforms:{}};ForEach.techniqueAttribute(i,function(e,t){r=i.parameters[e],n.attributes[t]={semantic:r.semantic}}),ForEach.techniqueUniform(i,function(e,t){r=i.parameters[e],n.uniforms[t]={count:r.count,node:r.node,type:r.type,semantic:r.semantic,value:r.value},u[e]=t});var t=l.programs[i.program],a={name:t.name,fragmentShader:void 0,vertexShader:void 0,glExtensions:h},o=l.shaders[t.fragmentShader];a.fragmentShader=addToArray(d.shaders,o,!0);var s=l.shaders[t.vertexShader];a.vertexShader=addToArray(d.shaders,s,!0),n.program=addToArray(d.programs,a),c[e]=addToArray(d.techniques,n)}),0<d.techniques.length&&(defined(l.extensions)||(l.extensions={}),l.extensions.KHR_techniques_webgl=d,addExtensionsUsed(l,"KHR_techniques_webgl"),addExtensionsRequired(l,"KHR_techniques_webgl"))}return ForEach.material(l,function(e){if(defined(e.technique)){var r={technique:c[e.technique]};ForEach.objectLegacy(e.values,function(e,t){defined(r.values)||(r.values={});var i=u[t];r.values[i]=e}),defined(e.extensions)||(e.extensions={}),e.extensions.KHR_techniques_webgl=r}delete e.technique,delete e.values}),delete l.techniques,delete l.programs,delete l.shaders,l}var allElementTypes=["mesh","node","material","accessor","bufferView","buffer"];function removeUnusedElements(t,i){return i=defaultValue(i,allElementTypes),allElementTypes.forEach(function(e){-1<i.indexOf(e)&&removeUnusedElementsByType(t,e)}),t}var TypeToGltfElementName={accessor:"accessors",buffer:"buffers",bufferView:"bufferViews",node:"nodes",material:"materials",mesh:"meshes"};function removeUnusedElementsByType(e,t){var i=e[TypeToGltfElementName[t]];if(defined(i))for(var r=0,n=getListOfElementsIdsInUse[t](e),a=i.length,o=0;o<a;++o)n[o]||(Remove[t](e,o-r),r++)}function Remove(){}function getListOfElementsIdsInUse(){}function nodeIsEmpty(t,e){return!(defined(e.mesh)||defined(e.camera)||defined(e.skin)||defined(e.weights)||defined(e.extras)||defined(e.extensions)&&0!==e.extensions.length)&&(!defined(e.children)||0===e.children.filter(function(e){return!nodeIsEmpty(t,t.nodes[e])}).length)}function addBuffer(e,t){var i={byteLength:t.length,extras:{_pipeline:{source:t}}},r={buffer:addToArray(e.buffers,i),byteOffset:0,byteLength:t.length};return addToArray(e.bufferViews,r)}function readAccessorPacked(e,t){var i=getAccessorByteStride(e,t),r=ComponentDatatype$1.getSizeInBytes(t.componentType),n=numberOfComponentsForType(t.type),a=t.count,o=new Array(n*a);if(!defined(t.bufferView))return arrayFill(o,0),o;for(var s=e.bufferViews[t.bufferView],l=e.buffers[s.buffer].extras._pipeline.source,u=t.byteOffset+s.byteOffset+l.byteOffset,c=new DataView(l.buffer),d=new Array(n),h=getComponentReader(t.componentType),p=0;p<a;++p){h(c,u,n,r,d);for(var f=0;f<n;++f)o[p*n+f]=d[f];u+=i}return o}function updateAccessorComponentTypes(i){var r;return ForEach.accessorWithSemantic(i,"JOINTS_0",function(e){var t=i.accessors[e];(r=t.componentType)===WebGLConstants$1.BYTE?convertType(i,t,ComponentDatatype$1.UNSIGNED_BYTE):r!==WebGLConstants$1.UNSIGNED_BYTE&&r!==WebGLConstants$1.UNSIGNED_SHORT&&convertType(i,t,ComponentDatatype$1.UNSIGNED_SHORT)}),ForEach.accessorWithSemantic(i,"WEIGHTS_0",function(e){var t=i.accessors[e];(r=t.componentType)===WebGLConstants$1.BYTE?convertType(i,t,ComponentDatatype$1.UNSIGNED_BYTE):r===WebGLConstants$1.SHORT&&convertType(i,t,ComponentDatatype$1.UNSIGNED_SHORT)}),i}function convertType(e,t,i){var r=ComponentDatatype$1.createTypedArray(i,readAccessorPacked(e,t)),n=new Uint8Array(r.buffer);t.bufferView=addBuffer(e,n),t.componentType=i,t.byteOffset=0}Remove.accessor=function(e,r){e.accessors.splice(r,1),ForEach.mesh(e,function(e){ForEach.meshPrimitive(e,function(i){ForEach.meshPrimitiveAttribute(i,function(e,t){r<e&&i.attributes[t]--}),ForEach.meshPrimitiveTarget(i,function(i){ForEach.meshPrimitiveTargetAttribute(i,function(e,t){r<e&&i[t]--})});var e=i.indices;defined(e)&&r<e&&i.indices--})}),ForEach.skin(e,function(e){defined(e.inverseBindMatrices)&&e.inverseBindMatrices>r&&e.inverseBindMatrices--}),ForEach.animation(e,function(e){ForEach.animationSampler(e,function(e){defined(e.input)&&e.input>r&&e.input--,defined(e.output)&&e.output>r&&e.output--})})},Remove.buffer=function(e,t){e.buffers.splice(t,1),ForEach.bufferView(e,function(e){defined(e.buffer)&&e.buffer>t&&e.buffer--})},Remove.bufferView=function(e,i){e.bufferViews.splice(i,1),ForEach.accessor(e,function(e){defined(e.bufferView)&&e.bufferView>i&&e.bufferView--}),ForEach.shader(e,function(e){defined(e.bufferView)&&e.bufferView>i&&e.bufferView--}),ForEach.image(e,function(e){defined(e.bufferView)&&e.bufferView>i&&e.bufferView--,ForEach.compressedImage(e,function(e){var t=e.bufferView;defined(t)&&i<t&&e.bufferView--})}),hasExtension(e,"KHR_draco_mesh_compression")&&ForEach.mesh(e,function(e){ForEach.meshPrimitive(e,function(e){defined(e.extensions)&&defined(e.extensions.KHR_draco_mesh_compression)&&e.extensions.KHR_draco_mesh_compression.bufferView>i&&e.extensions.KHR_draco_mesh_compression.bufferView--})})},Remove.mesh=function(e,t){e.meshes.splice(t,1),ForEach.node(e,function(e){defined(e.mesh)&&(e.mesh>t?e.mesh--:e.mesh===t&&delete e.mesh)})},Remove.node=function(e,t){e.nodes.splice(t,1),ForEach.skin(e,function(e){defined(e.skeleton)&&e.skeleton>t&&e.skeleton--,e.joints=e.joints.map(function(e){return t<e?e-1:e})}),ForEach.animation(e,function(e){ForEach.animationChannel(e,function(e){defined(e.target)&&defined(e.target.node)&&e.target.node>t&&e.target.node--})}),ForEach.technique(e,function(e){ForEach.techniqueUniform(e,function(e){defined(e.node)&&e.node>t&&e.node--})}),ForEach.node(e,function(e){defined(e.children)&&(e.children=e.children.filter(function(e){return e!==t}).map(function(e){return t<e?e-1:e}))}),ForEach.scene(e,function(e){e.nodes=e.nodes.filter(function(e){return e!==t}).map(function(e){return t<e?e-1:e})})},Remove.material=function(e,t){e.materials.splice(t,1),ForEach.mesh(e,function(e){ForEach.meshPrimitive(e,function(e){defined(e.material)&&e.material>t&&e.material--})})},getListOfElementsIdsInUse.accessor=function(e){var i={};return ForEach.mesh(e,function(e){ForEach.meshPrimitive(e,function(e){ForEach.meshPrimitiveAttribute(e,function(e){i[e]=!0}),ForEach.meshPrimitiveTarget(e,function(e){ForEach.meshPrimitiveTargetAttribute(e,function(e){i[e]=!0})});var t=e.indices;defined(t)&&(i[t]=!0)})}),ForEach.skin(e,function(e){defined(e.inverseBindMatrices)&&(i[e.inverseBindMatrices]=!0)}),ForEach.animation(e,function(e){ForEach.animationSampler(e,function(e){defined(e.input)&&(i[e.input]=!0),defined(e.output)&&(i[e.output]=!0)})}),i},getListOfElementsIdsInUse.buffer=function(e){var t={};return ForEach.bufferView(e,function(e){defined(e.buffer)&&(t[e.buffer]=!0)}),t},getListOfElementsIdsInUse.bufferView=function(e){var t={};return ForEach.accessor(e,function(e){defined(e.bufferView)&&(t[e.bufferView]=!0)}),ForEach.shader(e,function(e){defined(e.bufferView)&&(t[e.bufferView]=!0)}),ForEach.image(e,function(e){defined(e.bufferView)&&(t[e.bufferView]=!0),ForEach.compressedImage(e,function(e){defined(e.bufferView)&&(t[e.bufferView]=!0)})}),hasExtension(e,"KHR_draco_mesh_compression")&&ForEach.mesh(e,function(e){ForEach.meshPrimitive(e,function(e){defined(e.extensions)&&defined(e.extensions.KHR_draco_mesh_compression)&&(t[e.extensions.KHR_draco_mesh_compression.bufferView]=!0)})}),t},getListOfElementsIdsInUse.mesh=function(i){var r={};return ForEach.node(i,function(e){if(defined(e.mesh&&defined(i.meshes))){var t=i.meshes[e.mesh];defined(t)&&defined(t.primitives)&&0<t.primitives.length&&(r[e.mesh]=!0)}}),r},getListOfElementsIdsInUse.node=function(i){var r={};return ForEach.node(i,function(e,t){nodeIsEmpty(i,e)||(r[t]=!0)}),ForEach.skin(i,function(e){defined(e.skeleton)&&(r[e.skeleton]=!0),ForEach.skinJoint(e,function(e){r[e]=!0})}),ForEach.animation(i,function(e){ForEach.animationChannel(e,function(e){defined(e.target)&&defined(e.target.node)&&(r[e.target.node]=!0)})}),ForEach.technique(i,function(e){ForEach.techniqueUniform(e,function(e){defined(e.node)&&(r[e.node]=!0)})}),r},getListOfElementsIdsInUse.material=function(e){var t={};return ForEach.mesh(e,function(e){ForEach.meshPrimitive(e,function(e){defined(e.material)&&(t[e.material]=!0)})}),t};var updateFunctions={.8:glTF08to10,"1.0":glTF10to20,"2.0":void 0};function updateVersion(e,t){var i=(t=defaultValue(t,defaultValue.EMPTY_OBJECT)).targetVersion,r=e.version;e.asset=defaultValue(e.asset,{version:"1.0"}),e.asset.version=defaultValue(e.asset.version,"1.0"),r=defaultValue(r,e.asset.version).toString(),Object.prototype.hasOwnProperty.call(updateFunctions,r)||(defined(r)&&(r=r.substring(0,3)),Object.prototype.hasOwnProperty.call(updateFunctions,r)||(r="1.0"));for(var n=updateFunctions[r];defined(n)&&r!==i;)n(e,t),r=e.asset.version,n=updateFunctions[r];return e}function updateInstanceTechniques(e){var t=e.materials;for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var r=t[i],n=r.instanceTechnique;defined(n)&&(r.technique=n.technique,r.values=n.values,delete r.instanceTechnique)}}function setPrimitiveModes(e){var t=e.meshes;for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var r=t[i].primitives;if(defined(r))for(var n=r.length,a=0;a<n;++a){var o=r[a],s=defaultValue(o.primitive,WebGLConstants$1.TRIANGLES);o.mode=defaultValue(o.mode,s),delete o.primitive}}}function updateNodes(e){var t=e.nodes,i=new Cartesian3,r=new Quaternion;for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){var a=t[n];if(defined(a.rotation)){var o=a.rotation;Cartesian3.fromArray(o,0,i),Quaternion.fromAxisAngle(i,o[3],r),a.rotation=[r.x,r.y,r.z,r.w]}var s=a.instanceSkin;defined(s)&&(a.skeletons=s.skeletons,a.skin=s.skin,a.meshes=s.meshes,delete a.instanceSkin)}}function updateAnimations(e){var t=e.animations,i=e.accessors,r=e.bufferViews,n=e.buffers,a={},o=new Cartesian3,s=new Quaternion;for(var l in t)if(Object.prototype.hasOwnProperty.call(t,l)){var u=t[l],c=u.channels,d=u.parameters,h=u.samplers;if(defined(c))for(var p=c.length,f=0;f<p;++f){var m=c[f];if("rotation"===m.target.path){var g=d[h[m.sampler].output];if(defined(a[g]))continue;a[g]=!0;for(var y=i[g],v=r[y.bufferView],_=n[v.buffer].extras._pipeline.source,C=_.byteOffset+v.byteOffset+y.byteOffset,x=y.componentType,b=y.count,A=numberOfComponentsForType(y.type),S=y.count*A,w=ComponentDatatype$1.createArrayBufferView(x,_.buffer,C,S),E=0;E<b;E++){var T=E*A;Cartesian3.unpack(w,T,o);var P=w[3+T];Quaternion.fromAxisAngle(o,P,s),Quaternion.pack(s,w,T)}}}}}function removeTechniquePasses(e){var t=e.techniques;for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var r=t[i],n=r.passes;if(defined(n)){var a=defaultValue(r.pass,"defaultPass");if(Object.prototype.hasOwnProperty.call(n,a)){var o=n[a],s=o.instanceProgram;r.attributes=defaultValue(r.attributes,s.attributes),r.program=defaultValue(r.program,s.program),r.uniforms=defaultValue(r.uniforms,s.uniforms),r.states=defaultValue(r.states,o.states)}delete r.passes,delete r.pass}}}function glTF08to10(e){defined(e.asset)||(e.asset={});var t=e.asset;if(t.version="1.0","string"==typeof t.profile){var i=t.profile.split(" ");t.profile={api:i[0],version:i[1]}}else t.profile={};if(defined(e.version)&&delete e.version,updateInstanceTechniques(e),setPrimitiveModes(e),updateNodes(e),updateAnimations(e),removeTechniquePasses(e),defined(e.allExtensions)&&(e.extensionsUsed=e.allExtensions,delete e.allExtensions),defined(e.lights)){var r=defaultValue(e.extensions,{}),n=defaultValue((e.extensions=r).KHR_materials_common,{});(r.KHR_materials_common=n).lights=e.lights,delete e.lights,addExtensionsUsed(e,"KHR_materials_common")}}function removeAnimationSamplersIndirection(e){var t=e.animations;for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var r=t[i],n=r.parameters;if(defined(n)){var a=r.samplers;for(var o in a)if(Object.prototype.hasOwnProperty.call(a,o)){var s=a[o];s.input=n[s.input],s.output=n[s.output]}delete r.parameters}}}function objectToArray(e,t){var i=[];for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var n=e[r];t[r]=i.length,i.push(n),defined(n.name)||(n.name=r)}return i}function objectsToArrays(l){var u,e,c={accessors:{},animations:{},buffers:{},bufferViews:{},cameras:{},images:{},materials:{},meshes:{},nodes:{},programs:{},samplers:{},scenes:{},shaders:{},skins:{},textures:{},techniques:{}},n={},t=l.nodes;for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&defined(e=t[i].jointName)&&(n[e]=i);for(var r in l)if(Object.prototype.hasOwnProperty.call(l,r)&&defined(c[r])){var a={},o=l[r];l[r]=objectToArray(o,a),c[r]=a}for(e in n)Object.prototype.hasOwnProperty.call(n,e)&&(n[e]=c.nodes[n[e]]);defined(l.scene)&&(l.scene=c.scenes[l.scene]),ForEach.bufferView(l,function(e){defined(e.buffer)&&(e.buffer=c.buffers[e.buffer])}),ForEach.accessor(l,function(e){defined(e.bufferView)&&(e.bufferView=c.bufferViews[e.bufferView])}),ForEach.shader(l,function(e){var t=e.extensions;if(defined(t)){var i=t.KHR_binary_glTF;defined(i)&&(e.bufferView=c.bufferViews[i.bufferView],delete t.KHR_binary_glTF),0===Object.keys(t).length&&delete e.extensions}}),ForEach.program(l,function(e){defined(e.vertexShader)&&(e.vertexShader=c.shaders[e.vertexShader]),defined(e.fragmentShader)&&(e.fragmentShader=c.shaders[e.fragmentShader])}),ForEach.technique(l,function(e){defined(e.program)&&(e.program=c.programs[e.program]),ForEach.techniqueParameter(e,function(e){defined(e.node)&&(e.node=c.nodes[e.node]);var t=e.value;"string"==typeof t&&(e.value={index:c.textures[t]})})}),ForEach.mesh(l,function(e){ForEach.meshPrimitive(e,function(i){defined(i.indices)&&(i.indices=c.accessors[i.indices]),ForEach.meshPrimitiveAttribute(i,function(e,t){i.attributes[t]=c.accessors[e]}),defined(i.material)&&(i.material=c.materials[i.material])})}),ForEach.node(l,function(e){var t=e.children;if(defined(t)){var i=t.length;for(u=0;u<i;++u)t[u]=c.nodes[t[u]]}if(defined(e.meshes)){var r=e.meshes,n=r.length;if(0<n)for(e.mesh=c.meshes[r[0]],u=1;u<n;++u){var a={mesh:c.meshes[r[u]]},o=addToArray(l.nodes,a);defined(t)||(t=[],e.children=t),t.push(o)}delete e.meshes}if(defined(e.camera)&&(e.camera=c.cameras[e.camera]),defined(e.skin)&&(e.skin=c.skins[e.skin]),defined(e.skeletons)){var s=e.skeletons;if(0<s.length&&defined(e.skin))l.skins[e.skin].skeleton=c.nodes[s[0]];delete e.skeletons}defined(e.jointName)&&delete e.jointName}),ForEach.skin(l,function(e){defined(e.inverseBindMatrices)&&(e.inverseBindMatrices=c.accessors[e.inverseBindMatrices]);var t=e.jointNames;if(defined(t)){var i=[],r=t.length;for(u=0;u<r;++u)i[u]=n[t[u]];e.joints=i,delete e.jointNames}}),ForEach.scene(l,function(e){var t=e.nodes;if(defined(t)){var i=t.length;for(u=0;u<i;++u)t[u]=c.nodes[t[u]]}}),ForEach.animation(l,function(e){var i={};e.samplers=objectToArray(e.samplers,i),ForEach.animationSampler(e,function(e){e.input=c.accessors[e.input],e.output=c.accessors[e.output]}),ForEach.animationChannel(e,function(e){e.sampler=i[e.sampler];var t=e.target;defined(t)&&(t.node=c.nodes[t.id],delete t.id)})}),ForEach.material(l,function(i){defined(i.technique)&&(i.technique=c.techniques[i.technique]),ForEach.materialValue(i,function(e,t){"string"==typeof e&&(i.values[t]={index:c.textures[e]})});var e=i.extensions;if(defined(e)){var r=e.KHR_materials_common;defined(r)&&ForEach.materialValue(r,function(e,t){"string"==typeof e&&(r.values[t]={index:c.textures[e]})})}}),ForEach.image(l,function(e){var r=e.extensions;if(defined(r)){var t=r.KHR_binary_glTF;defined(t)&&(e.bufferView=c.bufferViews[t.bufferView],e.mimeType=t.mimeType,delete r.KHR_binary_glTF),0===Object.keys(r).length&&delete e.extensions}ForEach.compressedImage(e,function(e){var t=e.extensions;if(defined(t)){var i=t.KHR_binary_glTF;defined(i)&&(e.bufferView=c.bufferViews[i.bufferView],e.mimeType=i.mimeType,delete t.KHR_binary_glTF),0===Object.keys(r).length&&delete e.extensions}})}),ForEach.texture(l,function(e){defined(e.sampler)&&(e.sampler=c.samplers[e.sampler]),defined(e.source)&&(e.source=c.images[e.source])})}function removeAnimationSamplerNames(e){ForEach.animation(e,function(e){ForEach.animationSampler(e,function(e){delete e.name})})}function removeEmptyArrays(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)){var i=e[t];Array.isArray(i)&&0===i.length&&delete e[t]}ForEach.node(e,function(e){defined(e.children)&&0===e.children.length&&delete e.children})}function stripAsset(e){var t=e.asset;delete t.profile,delete t.premultipliedAlpha}var knownExtensions={CESIUM_RTC:!0,KHR_materials_common:!0,WEB3D_quantized_attributes:!0};function requireKnownExtensions(e){var t=e.extensionsUsed;if(e.extensionsRequired=defaultValue(e.extensionsRequired,[]),defined(t))for(var i=t.length,r=0;r<i;++r){var n=t[r];defined(knownExtensions[n])&&e.extensionsRequired.push(n)}}function removeBufferType(e){ForEach.buffer(e,function(e){delete e.type})}function removeTextureProperties(e){ForEach.texture(e,function(e){delete e.format,delete e.internalFormat,delete e.target,delete e.type})}function requireAttributeSetIndex(e){ForEach.mesh(e,function(e){ForEach.meshPrimitive(e,function(i){ForEach.meshPrimitiveAttribute(i,function(e,t){"TEXCOORD"===t?i.attributes.TEXCOORD_0=e:"COLOR"===t&&(i.attributes.COLOR_0=e)}),delete i.attributes.TEXCOORD,delete i.attributes.COLOR})}),ForEach.technique(e,function(e){ForEach.techniqueParameter(e,function(e){var t=e.semantic;defined(t)&&("TEXCOORD"===t?e.semantic="TEXCOORD_0":"COLOR"===t&&(e.semantic="COLOR_0"))})})}var knownSemantics={POSITION:!0,NORMAL:!0,TANGENT:!0},indexedSemantics={COLOR:"COLOR",JOINT:"JOINTS",JOINTS:"JOINTS",TEXCOORD:"TEXCOORD",WEIGHT:"WEIGHTS",WEIGHTS:"WEIGHTS"};function underscoreApplicationSpecificSemantics(e){var s={};ForEach.mesh(e,function(e){ForEach.meshPrimitive(e,function(e){for(var t in ForEach.meshPrimitiveAttribute(e,function(e,t){if("_"!==t.charAt(0)){var i,r=t.search(/_[0-9]+/g),n=t,a="_0";0<=r&&(n=t.substring(0,r),a=t.substring(r));var o=indexedSemantics[n];defined(o)?(i=o+a,s[t]=i):defined(knownSemantics[n])||(i="_"+t,s[t]=i)}}),s)if(Object.prototype.hasOwnProperty.call(s,t)){var i=s[t],r=e.attributes[t];defined(r)&&(delete e.attributes[t],e.attributes[i]=r)}})}),ForEach.technique(e,function(e){ForEach.techniqueParameter(e,function(e){var t=s[e.semantic];defined(t)&&(e.semantic=t)})})}function clampCameraParameters(e){ForEach.camera(e,function(e){var t=e.perspective;if(defined(t)){var i=t.aspectRatio;defined(i)&&0===i&&delete t.aspectRatio;var r=t.yfov;defined(r)&&0===r&&(t.yfov=1)}})}function computeAccessorByteStride(e,t){return defined(t.byteStride)&&0!==t.byteStride?t.byteStride:getAccessorByteStride(e,t)}function requireByteLength(a){ForEach.buffer(a,function(e){defined(e.byteLength)||(e.byteLength=e.extras._pipeline.source.length)}),ForEach.accessor(a,function(e){var t=e.bufferView;if(defined(t)){var i=a.bufferViews[t],r=computeAccessorByteStride(a,e),n=e.byteOffset+e.count*r;i.byteLength=Math.max(defaultValue(i.byteLength,0),n)}})}function moveByteStrideToBufferView(i){var e,t,r,n=i.bufferViews,a={};ForEach.accessorContainingVertexAttributeData(i,function(e){var t=i.accessors[e];defined(t.bufferView)&&(a[t.bufferView]=!0)});var o={};for(var s in ForEach.accessor(i,function(e){defined(e.bufferView)&&(o[e.bufferView]=defaultValue(o[e.bufferView],[]),o[e.bufferView].push(e))}),o)if(Object.prototype.hasOwnProperty.call(o,s)){r=n[s];var l=o[s];l.sort(function(e,t){return e.byteOffset-t.byteOffset});var u=0,c=0,d=l.length;for(e=0;e<d;++e){var h=l[e],p=computeAccessorByteStride(i,h),f=h.byteOffset,m=h.count*p;delete h.byteStride;var g=e<d-1;if(p!==(g?computeAccessorByteStride(i,l[e+1]):void 0)){var y=clone(r,!0);a[s]&&(y.byteStride=p),y.byteOffset+=u,y.byteLength=f+m-u;var v=addToArray(n,y);for(t=c;t<=e;++t)(h=l[t]).bufferView=v,h.byteOffset=h.byteOffset-u;u=g?l[e+1].byteOffset:void 0,c=e+1}}}removeUnusedElements(i,["accessor","bufferView","buffer"])}function requirePositionAccessorMinMax(r){ForEach.accessorWithSemantic(r,"POSITION",function(e){var t=r.accessors[e];if(!defined(t.min)||!defined(t.max)){var i=findAccessorMinMax(r,t);t.min=i.min,t.max=i.max}})}function isNodeEmpty(e){return(!defined(e.children)||0===e.children.length)&&(!defined(e.meshes)||0===e.meshes.length)&&!defined(e.camera)&&!defined(e.skin)&&!defined(e.skeletons)&&!defined(e.jointName)&&(!defined(e.translation)||Cartesian3.fromArray(e.translation).equals(Cartesian3.ZERO))&&(!defined(e.scale)||Cartesian3.fromArray(e.scale).equals(new Cartesian3(1,1,1)))&&(!defined(e.rotation)||Cartesian4.fromArray(e.rotation).equals(new Cartesian4(0,0,0,1)))&&(!defined(e.matrix)||Matrix4.fromColumnMajorArray(e.matrix).equals(Matrix4.IDENTITY))&&!defined(e.extensions)&&!defined(e.extras)}function deleteNode(r,n){ForEach.scene(r,function(e){var t=e.nodes;if(defined(t))for(var i=t.length;0<=i;--i)if(t[i]===n)return void t.splice(i,1)}),ForEach.node(r,function(e,t){if(defined(e.children)){var i=e.children.indexOf(n);-1<i&&(e.children.splice(i,1),isNodeEmpty(e)&&deleteNode(r,t))}}),delete r.nodes[n]}function removeEmptyNodes(i){return ForEach.node(i,function(e,t){isNodeEmpty(e)&&deleteNode(i,t)}),i}function requireAnimationAccessorMinMax(r){ForEach.animation(r,function(e){ForEach.animationSampler(e,function(e){var t=r.accessors[e.input];if(!defined(t.min)||!defined(t.max)){var i=findAccessorMinMax(r,t);t.min=i.min,t.max=i.max}})})}function glTF10to20(e){e.asset=defaultValue(e.asset,{}),e.asset.version="2.0",updateInstanceTechniques(e),removeAnimationSamplersIndirection(e),removeEmptyNodes(e),objectsToArrays(e),removeAnimationSamplerNames(e),stripAsset(e),requireKnownExtensions(e),requireByteLength(e),moveByteStrideToBufferView(e),requirePositionAccessorMinMax(e),requireAnimationAccessorMinMax(e),removeBufferType(e),removeTextureProperties(e),requireAttributeSetIndex(e),underscoreApplicationSpecificSemantics(e),updateAccessorComponentTypes(e),clampCameraParameters(e),moveTechniqueRenderStates(e),moveTechniquesToExtension(e),removeEmptyArrays(e)}function ModelLoadResources(){this.initialized=!1,this.resourcesParsed=!1,this.vertexBuffersToCreate=new Queue,this.indexBuffersToCreate=new Queue,this.buffers={},this.pendingBufferLoads=0,this.programsToCreate=new Queue,this.shaders={},this.pendingShaderLoads=0,this.texturesToCreate=new Queue,this.pendingTextureLoads=0,this.texturesToCreateFromBufferView=new Queue,this.pendingBufferViewToImage=0,this.createSamplers=!0,this.createSkins=!0,this.createRuntimeAnimations=!0,this.createVertexArrays=!0,this.createRenderStates=!0,this.createUniformMaps=!0,this.createRuntimeNodes=!0,this.createdBufferViews={},this.primitivesToDecode=new Queue,this.activeDecodingTasks=0,this.pendingDecodingCache=!1,this.skinnedNodesIds=[]}function getSubarray(e,t,i){return e.subarray(t,t+i)}ModelLoadResources.prototype.getBuffer=function(e){return getSubarray(this.buffers[e.buffer],e.byteOffset,e.byteLength)},ModelLoadResources.prototype.finishedPendingBufferLoads=function(){return 0===this.pendingBufferLoads},ModelLoadResources.prototype.finishedBuffersCreation=function(){return 0===this.pendingBufferLoads&&0===this.vertexBuffersToCreate.length&&0===this.indexBuffersToCreate.length},ModelLoadResources.prototype.finishedProgramCreation=function(){return 0===this.pendingShaderLoads&&0===this.programsToCreate.length},ModelLoadResources.prototype.finishedTextureCreation=function(){var e=0===this.pendingTextureLoads,t=0===this.texturesToCreate.length&&0===this.texturesToCreateFromBufferView.length;return e&&t},ModelLoadResources.prototype.finishedEverythingButTextureCreation=function(){var e=0===this.pendingBufferLoads&&0===this.pendingShaderLoads,t=0===this.vertexBuffersToCreate.length&&0===this.indexBuffersToCreate.length&&0===this.programsToCreate.length&&0===this.pendingBufferViewToImage;return this.finishedDecoding()&&e&&t},ModelLoadResources.prototype.finishedDecoding=function(){return 0===this.primitivesToDecode.length&&0===this.activeDecodingTasks&&!this.pendingDecodingCache},ModelLoadResources.prototype.finished=function(){return this.finishedDecoding()&&this.finishedTextureCreation()&&this.finishedEverythingButTextureCreation()};var ModelUtility={updateForwardAxis:function(e){var t=e.gltf.extras.sourceVersion;(defined(t)&&"2.0"!==t||"2.0"!==ModelUtility.getAssetVersion(e.gltf))&&(e._gltfForwardAxis=Axis$1.X)},getAssetVersion:function(e){return defined(e.asset)&&defined(e.asset.version)?e.asset.version:"1.0"},splitIncompatibleMaterials:function(e){var m=e.accessors,g=e.materials,y={};return ForEach.mesh(e,function(e){ForEach.meshPrimitive(e,function(e){var t,i,r=e.material,n=g[r],a=e.attributes.JOINTS_0;if(defined(a)){var o=m[a];t=o.componentType,i=o.type}var s=defined(a),l=defined(e.attributes.COLOR_0),u=defined(e.targets),c=defined(e.attributes.NORMAL),d=defined(e.attributes.TANGENT),h=defined(e.attributes.TEXCOORD_0),p=y[r];if(defined(p)){if(p.skinning.skinned!==s||p.skinning.type!==i||p.hasVertexColors!==l||p.hasMorphTargets!==u||p.hasNormals!==c||p.hasTangents!==d||p.hasTexCoords!==h){var f=clone(n,!0);r=addToArray(g,f),e.material=r,y[r]={skinning:{skinned:s,componentType:t,type:i},hasVertexColors:l,hasMorphTargets:u,hasNormals:c,hasTangents:d,hasTexCoords:h}}}else y[r]={skinning:{skinned:s,componentType:t,type:i},hasVertexColors:l,hasMorphTargets:u,hasNormals:c,hasTangents:d,hasTexCoords:h}})}),y},getShaderVariable:function(e){return"SCALAR"===e?"float":e.toLowerCase()},ModelState:{NEEDS_LOAD:0,LOADING:1,LOADED:2,FAILED:3},getFailedLoadFunction:function(i,r,n){return function(e){i._state=ModelUtility.ModelState.FAILED;var t="Failed to load "+r+": "+n;defined(e)&&(t+="\n"+e.message),i._readyPromise.reject(new RuntimeError(t))}},parseBuffers:function(r,n){var a=r._loadResources;ForEach.buffer(r.gltf,function(e,t){if(defined(e.extras._pipeline.source))a.buffers[t]=e.extras._pipeline.source;else if(defined(n)){var i=r._resource.getDerivedResource({url:e.uri});++a.pendingBufferLoads,i.fetchArrayBuffer().then(n(r,t)).otherwise(ModelUtility.getFailedLoadFunction(r,"buffer",i.url))}})}},aMinScratch=new Cartesian3,aMaxScratch=new Cartesian3;function techniqueAttributeForSemantic(e,i){return ForEach.techniqueAttribute(e,function(e,t){if(e.semantic===i)return t})}function ensureSemanticExistenceForPrimitive(e,t){var i=e.accessors,r=e.materials,n=e.extensions.KHR_techniques_webgl,a=n.techniques,o=n.programs,s=n.shaders,l=t.targets,u=t.attributes;for(var c in l)if(l.hasOwnProperty(c)){var d=l[c];for(var h in d)"extras"!==h&&(u[h+"_"+c]=d[h])}var p=a[r[t.material].extensions.KHR_techniques_webgl.technique],f=s[o[p.program].vertexShader];for(var m in u)if(u.hasOwnProperty(m)&&!defined(techniqueAttributeForSemantic(p,m))){var g=i[u[m]],y=m.toLowerCase();"_"===y.charAt(0)&&(y=y.slice(1));var v="a_"+y;p.attributes[v]={semantic:m,type:g.componentType};var _=f.extras._pipeline,C=_.source;C="attribute "+ModelUtility.getShaderVariable(g.type)+" "+v+";\n"+C,_.source=C}}function getTechniqueAttributeOrUniformFunction(e,r,n,a){return hasExtension(e,"KHR_techniques_webgl")?function(e,t){if(!(e.semantic!==n||a&&defined(e.node)))return t}:function(e,t){var i=r.parameters[e];if(!(i.semantic!==n||a&&defined(i.node)))return t}}ModelUtility.computeBoundingSphere=function(e){for(var t=e.gltf,i=t.nodes,r=t.meshes,n=t.scenes[t.scene].nodes,a=n.length,o=[],s=new Cartesian3(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),l=new Cartesian3(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),u=0;u<a;++u){var c=i[n[u]];for(c._transformToRoot=ModelUtility.getTransform(c),o.push(c);0<o.length;){var d=(c=o.pop())._transformToRoot,h=c.mesh;if(defined(h))for(var p=r[h].primitives,f=p.length,m=0;m<f;++m){var g=p[m].attributes.POSITION;if(defined(g)){var y=ModelUtility.getAccessorMinMax(t,g),v=Cartesian3.fromArray(y.min,0,aMinScratch),_=Cartesian3.fromArray(y.max,0,aMaxScratch);defined(s)&&defined(l)&&(Matrix4.multiplyByPoint(d,v,v),Matrix4.multiplyByPoint(d,_,_),Cartesian3.minimumByComponent(s,v,s),Cartesian3.maximumByComponent(l,_,l))}}var C=c.children;if(defined(C))for(var x=C.length,b=0;b<x;++b){var A=i[C[b]];A._transformToRoot=ModelUtility.getTransform(A),Matrix4.multiplyTransformation(d,A._transformToRoot,A._transformToRoot),o.push(A)}delete c._transformToRoot}}var S=BoundingSphere.fromCornerPoints(s,l);return e._forwardAxis===Axis$1.Z&&BoundingSphere.transformWithoutScale(S,Axis$1.Z_UP_TO_X_UP,S),e._upAxis===Axis$1.Y?BoundingSphere.transformWithoutScale(S,Axis$1.Y_UP_TO_Z_UP,S):e._upAxis===Axis$1.X&&BoundingSphere.transformWithoutScale(S,Axis$1.X_UP_TO_Z_UP,S),S},ModelUtility.ensureSemanticExistence=function(t){return ForEach.mesh(t,function(e){ForEach.meshPrimitive(e,function(e){ensureSemanticExistenceForPrimitive(t,e)})}),t},ModelUtility.createAttributeLocations=function(e,t){var i={},r=!1,n=1;if(ForEach.techniqueAttribute(e,function(e,t){/pos/i.test(t)&&!r?(i[t]=0,r=!0):i[t]=n++}),defined(t))for(var a in t)t.hasOwnProperty(a)&&(i[a]=n++);return i},ModelUtility.getAccessorMinMax=function(e,t){var i=e.accessors[t],r=i.extensions,n=i.min,a=i.max;if(defined(r)){var o=r.WEB3D_quantized_attributes;defined(o)&&(n=o.decodedMin,a=o.decodedMax)}return{min:n,max:a}},ModelUtility.getAttributeOrUniformBySemantic=function(i,r,n,a){return ForEach.technique(i,function(e){if(!defined(n)||e.program===n){var t=ForEach.techniqueAttribute(e,getTechniqueAttributeOrUniformFunction(i,e,r,a));return defined(t)?t:ForEach.techniqueUniform(e,getTechniqueAttributeOrUniformFunction(i,e,r,a))}})},ModelUtility.getDiffuseAttributeOrUniform=function(e,t){var i=ModelUtility.getAttributeOrUniformBySemantic(e,"COLOR_0",t);return defined(i)||(i=ModelUtility.getAttributeOrUniformBySemantic(e,"_3DTILESDIFFUSE",t)),i};var nodeTranslationScratch=new Cartesian3,nodeQuaternionScratch=new Quaternion,nodeScaleScratch=new Cartesian3;function replaceAllButFirstInString(e,t,i){t+="(?!\\w)",t=new RegExp(t,"g");var r=e.search(t);return e.replace(t,function(e,t){return r===t?e:i})}function getQuantizedAttributes(e,t){var i=e.accessors[t].extensions;if(defined(i))return i.WEB3D_quantized_attributes}function getAttributeVariableName(e,t,i){var r=t.material,n=e.materials[r];if(hasExtension(e,"KHR_techniques_webgl")&&defined(n.extensions)&&defined(n.extensions.KHR_techniques_webgl)){var a=n.extensions.KHR_techniques_webgl.technique,o=e.extensions.KHR_techniques_webgl.techniques[a];return ForEach.techniqueAttribute(o,function(e,t){if(e.semantic===i)return t})}}function getScalarUniformFunction(e){var t={value:e,clone:function(e,t){return e},func:function(){return t.value}};return t}function getVec2UniformFunction(e){var t={value:Cartesian2.fromArray(e),clone:Cartesian2.clone,func:function(){return t.value}};return t}function getVec3UniformFunction(e){var t={value:Cartesian3.fromArray(e),clone:Cartesian3.clone,func:function(){return t.value}};return t}function getVec4UniformFunction(e){var t={value:Cartesian4.fromArray(e),clone:Cartesian4.clone,func:function(){return t.value}};return t}function getMat2UniformFunction(e){var t={value:Matrix2.fromColumnMajorArray(e),clone:Matrix2.clone,func:function(){return t.value}};return t}function getMat3UniformFunction(e){var t={value:Matrix3.fromColumnMajorArray(e),clone:Matrix3.clone,func:function(){return t.value}};return t}function getMat4UniformFunction(e){var t={value:Matrix4.fromColumnMajorArray(e),clone:Matrix4.clone,func:function(){return t.value}};return t}function DelayLoadedTextureUniform(e,t,i){this._value=void 0,this._textureId=e.index,this._textures=t,this._defaultTexture=i}function getTextureUniformFunction(e,t,i){var r=new DelayLoadedTextureUniform(e,t,i);return r.func=function(){return r.value},r}ModelUtility.getTransform=function(e,t){return defined(e.matrix)?Matrix4.fromColumnMajorArray(e.matrix,t):Matrix4.fromTranslationQuaternionRotationScale(Cartesian3.fromArray(e.translation,0,nodeTranslationScratch),Quaternion.unpack(e.rotation,0,nodeQuaternionScratch),Cartesian3.fromArray(e.scale,0,nodeScaleScratch),t)},ModelUtility.getUsedExtensions=function(e){var t=e.extensionsUsed,i={};if(defined(t))for(var r=t.length,n=0;n<r;n++){i[t[n]]=!0}return i},ModelUtility.getRequiredExtensions=function(e){var t=e.extensionsRequired,i={};if(defined(t))for(var r=t.length,n=0;n<r;n++){i[t[n]]=!0}return i},ModelUtility.supportedExtensions={AGI_articulations:!0,CESIUM_RTC:!0,EXT_texture_webp:!0,KHR_blend:!0,KHR_binary_glTF:!0,KHR_draco_mesh_compression:!0,KHR_materials_common:!0,KHR_techniques_webgl:!0,KHR_materials_unlit:!0,KHR_materials_pbrSpecularGlossiness:!0,KHR_texture_transform:!0,WEB3D_quantized_attributes:!0},ModelUtility.checkSupportedExtensions=function(e,t){for(var i in e)if(e.hasOwnProperty(i)){if(!ModelUtility.supportedExtensions[i])throw new RuntimeError("Unsupported glTF Extension: "+i);if("EXT_texture_webp"===i&&!1===t)throw new RuntimeError("Loaded model requires WebP but browser does not support it.")}},ModelUtility.checkSupportedGlExtensions=function(e,t){if(defined(e))for(var i=e.length,r=0;r<i;r++){var n=e[r];if("OES_element_index_uint"!==n)throw new RuntimeError("Unsupported WebGL Extension: "+n);if(!t.elementIndexUint)throw new RuntimeError("OES_element_index_uint WebGL extension is not enabled.")}},ModelUtility.modifyShaderForDracoQuantizedAttributes=function(e,t,i,r){var n={};for(var a in r)if(r.hasOwnProperty(a)){var o=r[a],s=o.quantization;if(!defined(s))continue;var l=getAttributeVariableName(e,t,a);"_"===a.charAt(0)&&(a=a.substring(1));var u="gltf_u_dec_"+a.toLowerCase();if(!defined(n[u])){var c,d="gltf_decoded_"+a,h=l.replace("a_","gltf_a_dec_"),p=o.componentsPerAttribute;i=replaceAllButFirstInString(i,l,h),i=(c=s.octEncoded?"vec3":1<p?"vec"+p:"float")+" "+h+";\n"+i;var f=3===p&&"COLOR_0"===a;f&&(i=replaceAllButFirstInString(i,h,"vec4("+h+", 1.0)"));var m="";if(s.octEncoded){var g=u+"_rangeConstant";i="uniform float "+g+";\n"+i,m="\nvoid main() {\n "+h+" = czm_octDecode("+l+".xy, "+g+").zxy;\n "+d+"();\n}\n"}else{var y=u+"_normConstant",v=u+"_min";i="uniform float "+y+";\nuniform "+c+" "+v+";\n"+i,m="\nvoid main() {\n "+h+" = "+v+" + "+l+(f?".xyz":"")+" * "+y+";\n "+d+"();\n}\n"}i=ShaderSource.replaceMain(i,d),i+=m}}return{shader:i}},ModelUtility.modifyShaderForQuantizedAttributes=function(e,t,i){var r={},n=t.attributes;for(var a in n)if(n.hasOwnProperty(a)){var o=getAttributeVariableName(e,t,a),s=t.attributes[a];"_"===a.charAt(0)&&(a=a.substring(1));var l="gltf_u_dec_"+a.toLowerCase(),u=l+"_scale",c=l+"_translate";if(!defined(r[l])&&!defined(r[u])){var d=getQuantizedAttributes(e,s);if(defined(d)){var h,p=d.decodeMatrix,f="gltf_decoded_"+a,m=o.replace("a_","gltf_a_dec_"),g=Math.floor(Math.sqrt(p.length));i=(h=2<g?"vec"+(g-1):"float")+" "+m+";\n"+(i=replaceAllButFirstInString(i,o,m));var y="";5===g?(i="uniform vec4 "+c+";\n"+(i="uniform mat4 "+u+";\n"+i),y="\nvoid main() {\n "+m+" = "+u+" * "+o+" + "+c+";\n "+f+"();\n}\n",r[u]={mat:4},r[c]={vec:4}):(i="uniform mat"+g+" "+l+";\n"+i,y="\nvoid main() {\n "+m+" = "+h+"("+l+" * vec"+g+"("+o+",1.0));\n "+f+"();\n}\n",r[l]={mat:g}),i=ShaderSource.replaceMain(i,f),i+=y}}}return{shader:i,uniforms:r}},ModelUtility.toClipCoordinatesGLSL=function(e,t){var i=ModelUtility.getAttributeOrUniformBySemantic(e,"POSITION"),r=i.replace("a_","gltf_a_dec_");-1!==t.indexOf(r)&&(i=r);var n=ModelUtility.getAttributeOrUniformBySemantic(e,"MODELVIEWPROJECTION",void 0,!0);if(!defined(n)||-1===t.indexOf(n)){var a=ModelUtility.getAttributeOrUniformBySemantic(e,"PROJECTION",void 0,!0),o=ModelUtility.getAttributeOrUniformBySemantic(e,"MODELVIEW",void 0,!0);-1!==t.indexOf("czm_instanced_modelView ")?o="czm_instanced_modelView":defined(o)||(o=ModelUtility.getAttributeOrUniformBySemantic(e,"CESIUM_RTC_MODELVIEW",void 0,!0)),n=a+" * "+o}return n+" * vec4("+i+".xyz, 1.0)"},ModelUtility.modifyFragmentShaderForLogDepth=function(e){return e=ShaderSource.replaceMain(e,"czm_depth_main"),e+="\nvoid main() \n{ \n czm_depth_main(); \n czm_writeLogDepth(); \n} \n"},ModelUtility.modifyVertexShaderForLogDepth=function(e,t){return e=ShaderSource.replaceMain(e,"czm_depth_main"),e+="\nvoid main() \n{ \n czm_depth_main(); \n czm_vertexLogDepth("+t+"); \n} \n"},Object.defineProperties(DelayLoadedTextureUniform.prototype,{value:{get:function(){if(!defined(this._value)){var e=this._textures[this._textureId];if(!defined(e))return this._defaultTexture;this._value=e}return this._value},set:function(e){this._value=e}}}),DelayLoadedTextureUniform.prototype.clone=function(e){return e},DelayLoadedTextureUniform.prototype.func=void 0;var gltfUniformFunctions={};function scaleFromMatrix5Array(e){return[e[0],e[1],e[2],e[3],e[5],e[6],e[7],e[8],e[10],e[11],e[12],e[13],e[15],e[16],e[17],e[18]]}function translateFromMatrix5Array(e){return[e[20],e[21],e[22],e[23]]}gltfUniformFunctions[WebGLConstants$1.FLOAT]=getScalarUniformFunction,gltfUniformFunctions[WebGLConstants$1.FLOAT_VEC2]=getVec2UniformFunction,gltfUniformFunctions[WebGLConstants$1.FLOAT_VEC3]=getVec3UniformFunction,gltfUniformFunctions[WebGLConstants$1.FLOAT_VEC4]=getVec4UniformFunction,gltfUniformFunctions[WebGLConstants$1.INT]=getScalarUniformFunction,gltfUniformFunctions[WebGLConstants$1.INT_VEC2]=getVec2UniformFunction,gltfUniformFunctions[WebGLConstants$1.INT_VEC3]=getVec3UniformFunction,gltfUniformFunctions[WebGLConstants$1.INT_VEC4]=getVec4UniformFunction,gltfUniformFunctions[WebGLConstants$1.BOOL]=getScalarUniformFunction,gltfUniformFunctions[WebGLConstants$1.BOOL_VEC2]=getVec2UniformFunction,gltfUniformFunctions[WebGLConstants$1.BOOL_VEC3]=getVec3UniformFunction,gltfUniformFunctions[WebGLConstants$1.BOOL_VEC4]=getVec4UniformFunction,gltfUniformFunctions[WebGLConstants$1.FLOAT_MAT2]=getMat2UniformFunction,gltfUniformFunctions[WebGLConstants$1.FLOAT_MAT3]=getMat3UniformFunction,gltfUniformFunctions[WebGLConstants$1.FLOAT_MAT4]=getMat4UniformFunction,gltfUniformFunctions[WebGLConstants$1.SAMPLER_2D]=getTextureUniformFunction,ModelUtility.createUniformFunction=function(e,t,i,r){return gltfUniformFunctions[e](t,i,r)},ModelUtility.createUniformsForDracoQuantizedAttributes=function(e){var t={};for(var i in e)if(e.hasOwnProperty(i)){var r=e[i],n=r.quantization;if(!defined(n))continue;"_"===i.charAt(0)&&(i=i.substring(1));var a="gltf_u_dec_"+i.toLowerCase();if(n.octEncoded){var o=a+"_rangeConstant",s=(1<<n.quantizationBits)-1;t[o]=getScalarUniformFunction(s).func;continue}var l=a+"_normConstant",u=n.range/(1<<n.quantizationBits);t[l]=getScalarUniformFunction(u).func;var c=a+"_min";switch(r.componentsPerAttribute){case 1:t[c]=getScalarUniformFunction(n.minValues).func;break;case 2:t[c]=getVec2UniformFunction(n.minValues).func;break;case 3:t[c]=getVec3UniformFunction(n.minValues).func;break;case 4:t[c]=getVec4UniformFunction(n.minValues).func}}return t},ModelUtility.createUniformsForQuantizedAttributes=function(e,t,i){var r=e.accessors,n={},a={},o=t.attributes;for(var s in o)if(o.hasOwnProperty(s)){var l=r[o[s]],u=l.extensions;if("_"===s.charAt(0)&&(s=s.substring(1)),defined(u)){var c=u.WEB3D_quantized_attributes;if(defined(c)){var d=c.decodeMatrix,h="gltf_u_dec_"+s.toLowerCase();switch(l.type){case AttributeType$1.SCALAR:a[h]=getMat2UniformFunction(d).func,n[h]=!0;break;case AttributeType$1.VEC2:a[h]=getMat3UniformFunction(d).func,n[h]=!0;break;case AttributeType$1.VEC3:a[h]=getMat4UniformFunction(d).func,n[h]=!0;break;case AttributeType$1.VEC4:var p=h+"_scale",f=h+"_translate";a[p]=getMat4UniformFunction(scaleFromMatrix5Array(d)).func,a[f]=getVec4UniformFunction(translateFromMatrix5Array(d)).func,n[p]=!0,n[f]=!0}}}}for(var m in i)if(i.hasOwnProperty(m)&&!n[m]){var g=i[m];defined(g.mat)&&(2===g.mat?a[m]=getMat2UniformFunction(Matrix2.IDENTITY).func:3===g.mat?a[m]=getMat3UniformFunction(Matrix3.IDENTITY).func:4===g.mat&&(a[m]=getMat4UniformFunction(Matrix4.IDENTITY).func)),defined(g.vec)&&4===g.vec&&(a[m]=getVec4UniformFunction([0,0,0,0]).func)}return a};var scratchTranslationRtc=new Cartesian3,gltfSemanticUniforms={MODEL:function(e,t){return function(){return e.model}},VIEW:function(e,t){return function(){return e.view}},PROJECTION:function(e,t){return function(){return e.projection}},MODELVIEW:function(e,t){return function(){return e.modelView}},CESIUM_RTC_MODELVIEW:function(e,t){var i=new Matrix4;return function(){return defined(t._rtcCenter)?(Matrix4.getTranslation(e.model,scratchTranslationRtc),Cartesian3.add(scratchTranslationRtc,t._rtcCenter,scratchTranslationRtc),Matrix4.multiplyByPoint(e.view,scratchTranslationRtc,scratchTranslationRtc),Matrix4.setTranslation(e.modelView,scratchTranslationRtc,i)):e.modelView}},MODELVIEWPROJECTION:function(e,t){return function(){return e.modelViewProjection}},MODELINVERSE:function(e,t){return function(){return e.inverseModel}},VIEWINVERSE:function(e,t){return function(){return e.inverseView}},PROJECTIONINVERSE:function(e,t){return function(){return e.inverseProjection}},MODELVIEWINVERSE:function(e,t){return function(){return e.inverseModelView}},MODELVIEWPROJECTIONINVERSE:function(e,t){return function(){return e.inverseModelViewProjection}},MODELINVERSETRANSPOSE:function(e,t){return function(){return e.inverseTransposeModel}},MODELVIEWINVERSETRANSPOSE:function(e,t){return function(){return e.normal}},VIEWPORT:function(e,t){return function(){return e.viewportCartesian4}}};function processModelMaterialsCommon(u,c){if(c=defaultValue(c,defaultValue.EMPTY_OBJECT),defined(u)&&hasExtension(u,"KHR_materials_common")){hasExtension(u,"KHR_techniques_webgl")||(defined(u.extensions)||(u.extensions={}),u.extensions.KHR_techniques_webgl={programs:[],shaders:[],techniques:[]},u.extensionsUsed.push("KHR_techniques_webgl"),u.extensionsRequired.push("KHR_techniques_webgl"));var d=u.extensions.KHR_techniques_webgl;lightDefaults(u);var h=generateLightParameters(u),p=ModelUtility.splitIncompatibleMaterials(u),f={},m=!1;return ForEach.material(u,function(e,t){if(defined(e.extensions)&&defined(e.extensions.KHR_materials_common)){var i=e.extensions.KHR_materials_common,r=p[t],n=getTechniqueKey(i,r),a=f[n];defined(a)||(a=generateTechnique(u,d,r,i,h,c.addBatchIdToGeneratedShaders),f[n]=a,m=!0);var o={},s=i.values;for(var l in s)s.hasOwnProperty(l)&&"transparent"!==l&&"doubleSided"!==l&&(o["u_"+l.toLowerCase()]=s[l]);e.extensions.KHR_techniques_webgl={technique:a,values:o},e.alphaMode="OPAQUE",i.transparent&&(e.alphaMode="BLEND"),i.doubleSided&&(e.doubleSided=!0)}}),m?(ModelUtility.ensureSemanticExistence(u),u):u}}function generateLightParameters(e){var t,i={};if(defined(e.extensions)&&defined(e.extensions.KHR_materials_common)&&(t=e.extensions.KHR_materials_common.lights),defined(t)){var r=e.nodes;for(var n in r)if(r.hasOwnProperty(n)){var a=r[n];if(defined(a.extensions)&&defined(a.extensions.KHR_materials_common)){var o=a.extensions.KHR_materials_common.light;defined(o)&&defined(t[o])&&(t[o].node=n),delete a.extensions.KHR_materials_common}}var s=0;for(var l in t)if(t.hasOwnProperty(l)){var u=t[l],c=u.type;if("ambient"!==c&&!defined(u.node)){delete t[l];continue}var d="light"+s.toString();switch(u.baseName=d,c){case"ambient":var h=u.ambient;i[d+"Color"]={type:WebGLConstants$1.FLOAT_VEC3,value:h.color};break;case"directional":var p=u.directional;i[d+"Color"]={type:WebGLConstants$1.FLOAT_VEC3,value:p.color},defined(u.node)&&(i[d+"Transform"]={node:u.node,semantic:"MODELVIEW",type:WebGLConstants$1.FLOAT_MAT4});break;case"point":var f=u.point;i[d+"Color"]={type:WebGLConstants$1.FLOAT_VEC3,value:f.color},defined(u.node)&&(i[d+"Transform"]={node:u.node,semantic:"MODELVIEW",type:WebGLConstants$1.FLOAT_MAT4}),i[d+"Attenuation"]={type:WebGLConstants$1.FLOAT_VEC3,value:[f.constantAttenuation,f.linearAttenuation,f.quadraticAttenuation]};break;case"spot":var m=u.spot;i[d+"Color"]={type:WebGLConstants$1.FLOAT_VEC3,value:m.color},defined(u.node)&&(i[d+"Transform"]={node:u.node,semantic:"MODELVIEW",type:WebGLConstants$1.FLOAT_MAT4},i[d+"InverseTransform"]={node:u.node,semantic:"MODELVIEWINVERSE",type:WebGLConstants$1.FLOAT_MAT4,useInFragment:!0}),i[d+"Attenuation"]={type:WebGLConstants$1.FLOAT_VEC3,value:[m.constantAttenuation,m.linearAttenuation,m.quadraticAttenuation]},i[d+"FallOff"]={type:WebGLConstants$1.FLOAT_VEC2,value:[m.fallOffAngle,m.fallOffExponent]}}++s}}return i}function generateTechnique(e,t,i,r,n,a){defined(r)||(r={}),a=defaultValue(a,!1);var o,s=t.techniques,l=t.shaders,u=t.programs,c=r.technique.toUpperCase();defined(e.extensions)&&defined(e.extensions.KHR_materials_common)&&(o=e.extensions.KHR_materials_common.lights);var d,h=r.values,p=defaultValue(r.jointCount,0),f=!1,m=!1;defined(i)&&(f=(d=i.skinning).skinned,m=i.hasVertexColors);var g,y="precision highp float;\n",v="precision highp float;\n",_="CONSTANT"!==c,C={u_modelViewMatrix:{semantic:hasExtension(e,"CESIUM_RTC")?"CESIUM_RTC_MODELVIEW":"MODELVIEW",type:WebGLConstants$1.FLOAT_MAT4},u_projectionMatrix:{semantic:"PROJECTION",type:WebGLConstants$1.FLOAT_MAT4}};_&&(C.u_normalMatrix={semantic:"MODELVIEWINVERSETRANSPOSE",type:WebGLConstants$1.FLOAT_MAT3}),f&&(C.u_jointMatrix={count:p,semantic:"JOINTMATRIX",type:WebGLConstants$1.FLOAT_MAT4});var x=!1;for(var b in h)if(h.hasOwnProperty(b)&&"transparent"!==b&&"doubleSided"!==b){var A=getKHRMaterialsCommonValueType(b,h[b]);g="u_"+b.toLowerCase(),x||A!==WebGLConstants$1.SAMPLER_2D||(x=!0),C[g]={type:A}}if(defined(C.u_diffuse)&&(C.u_diffuse.semantic="_3DTILESDIFFUSE"),defined(n))for(var S in n)n.hasOwnProperty(S)&&(C[g="u_"+S]=n[S]);for(g in C)if(C.hasOwnProperty(g)){var w=C[g],E=defined(w.count)?"["+w.count+"]":"";w.type!==WebGLConstants$1.FLOAT_MAT3&&w.type!==WebGLConstants$1.FLOAT_MAT4||w.useInFragment?(v+="uniform "+webGLConstantToGlslType(w.type)+" "+g+E+";\n",delete w.useInFragment):y+="uniform "+webGLConstantToGlslType(w.type)+" "+g+E+";\n"}var T="";if(f){var P,M,D=numberOfComponentsForType(d.type),I=!1;if(0===d.type.indexOf("MAT")&&(I=!0,D=Math.sqrt(D)),I)for(P=0;P<D;P++)for(M=0;M<D;M++)T+=0===P&&0===M?" mat4 skinMat = ":" skinMat += ",T+="a_weight["+P+"]["+M+"] * u_jointMatrix[int(a_joint["+P+"]["+M+"])];\n";else for(P=0;P<D;P++)T+=0===P?" mat4 skinMat = ":" skinMat += ",T+="a_weight["+P+"] * u_jointMatrix[int(a_joint["+P+"])];\n"}var O,R={a_position:{semantic:"POSITION"}};if(y+="attribute vec3 a_position;\n",y+="varying vec3 v_positionEC;\n",T+=f?" vec4 pos = u_modelViewMatrix * skinMat * vec4(a_position,1.0);\n":" vec4 pos = u_modelViewMatrix * vec4(a_position,1.0);\n",T+=" v_positionEC = pos.xyz;\n",T+=" gl_Position = u_projectionMatrix * pos;\n",v+="varying vec3 v_positionEC;\n",_&&(R.a_normal={semantic:"NORMAL"},y+="attribute vec3 a_normal;\n",y+="varying vec3 v_normal;\n",T+=f?" v_normal = u_normalMatrix * mat3(skinMat) * a_normal;\n":" v_normal = u_normalMatrix * a_normal;\n",v+="varying vec3 v_normal;\n"),x&&(R.a_texcoord_0={semantic:"TEXCOORD_0"},y+="attribute vec2 a_texcoord_0;\n",y+="varying vec2 "+(O="v_texcoord_0")+";\n",T+=" "+O+" = a_texcoord_0;\n",v+="varying vec2 "+O+";\n"),f){var L=ModelUtility.getShaderVariable(d.type);R.a_joint={semantic:"JOINT"},R.a_weight={semantic:"WEIGHT"},y+="attribute "+L+" a_joint;\n",y+="attribute "+L+" a_weight;\n"}m&&(R.a_vertexColor={semantic:"COLOR_0"},y+="attribute vec4 a_vertexColor;\n",y+="varying vec4 v_vertexColor;\n",T+=" v_vertexColor = a_vertexColor;\n",v+="varying vec4 v_vertexColor;\n"),a&&(R.a_batchId={semantic:"_BATCHID"},y+="attribute float a_batchId;\n");var N=_&&("BLINN"===c||"PHONG"===c)&&defined(C.u_specular)&&defined(C.u_shininess)&&0<C.u_shininess,k=!1,B=!1,F="";for(var V in o)if(o.hasOwnProperty(V)){var z=o[V],U=z.type.toLowerCase(),G=z.baseName;F+=" {\n";var $,H,W="u_"+G+"Color";"ambient"===U?(B=!0,F+=" ambientLight += "+W+";\n"):_&&(k=!0,$="v_"+G+"Direction",H="v_"+G+"Position","point"!==U&&(y+="varying vec3 "+$+";\n",v+="varying vec3 "+$+";\n",T+=" "+$+" = mat3(u_"+G+"Transform) * vec3(0.,0.,1.);\n","directional"===U&&(F+=" vec3 l = normalize("+$+");\n")),"directional"!==U?(y+="varying vec3 "+H+";\n",v+="varying vec3 "+H+";\n",T+=" "+H+" = u_"+G+"Transform[3].xyz;\n",F+=" vec3 VP = "+H+" - v_positionEC;\n",F+=" vec3 l = normalize(VP);\n",F+=" float range = length(VP);\n",F+=" float attenuation = 1.0 / (u_"+G+"Attenuation.x + ",F+="(u_"+G+"Attenuation.y * range) + ",F+="(u_"+G+"Attenuation.z * range * range));\n"):F+=" float attenuation = 1.0;\n","spot"===U&&(F+=" float spotDot = dot(l, normalize("+$+"));\n",F+=" if (spotDot < cos(u_"+G+"FallOff.x * 0.5))\n",F+=" {\n",F+=" attenuation = 0.0;\n",F+=" }\n",F+=" else\n",F+=" {\n",F+=" attenuation *= max(0.0, pow(spotDot, u_"+G+"FallOff.y));\n",F+=" }\n"),F+=" diffuseLight += "+W+"* max(dot(normal,l), 0.) * attenuation;\n",N&&("BLINN"===c?(F+=" vec3 h = normalize(l + viewDir);\n",F+=" float specularIntensity = max(0., pow(max(dot(normal, h), 0.), u_shininess)) * attenuation;\n"):(F+=" vec3 reflectDir = reflect(-l, normal);\n",F+=" float specularIntensity = max(0., pow(max(dot(reflectDir, viewDir), 0.), u_shininess)) * attenuation;\n"),F+=" specularLight += "+W+" * specularIntensity;\n")),F+=" }\n"}if(B||(F+=" ambientLight += vec3(0.2, 0.2, 0.2);\n"),!k&&"CONSTANT"!==c){v+="#ifdef USE_CUSTOM_LIGHT_COLOR \n",v+="uniform vec3 gltf_lightColor; \n",v+="#endif \n",F+="#ifndef USE_CUSTOM_LIGHT_COLOR \n",F+=" vec3 lightColor = czm_lightColor;\n",F+="#else \n",F+=" vec3 lightColor = gltf_lightColor;\n",F+="#endif \n",F+=" vec3 l = normalize(czm_lightDirectionEC);\n";F+=" diffuseLight += lightColor * max(dot(normal,l), 0.2);\n",N&&("BLINN"===c?(F+=" vec3 h = normalize(l + viewDir);\n",F+=" float specularIntensity = max(0., pow(max(dot(normal, h), 0.), u_shininess));\n"):(F+=" vec3 reflectDir = reflect(-l, normal);\n",F+=" float specularIntensity = max(0., pow(max(dot(reflectDir, viewDir), 0.), u_shininess));\n"),F+=" specularLight += lightColor * specularIntensity;\n")}y+="void main(void) {\n",y+=T,y+="}\n",v+="void main(void) {\n";var j,q=" vec3 color = vec3(0.0, 0.0, 0.0);\n";_&&(v+=" vec3 normal = normalize(v_normal);\n",r.doubleSided&&(v+=" if (gl_FrontFacing == false)\n",v+=" {\n",v+=" normal = -normal;\n",v+=" }\n")),j="CONSTANT"!==c?(defined(C.u_diffuse)&&(C.u_diffuse.type===WebGLConstants$1.SAMPLER_2D?v+=" vec4 diffuse = texture2D(u_diffuse, "+O+");\n":v+=" vec4 diffuse = u_diffuse;\n",v+=" vec3 diffuseLight = vec3(0.0, 0.0, 0.0);\n",q+=" color += diffuse.rgb * diffuseLight;\n"),N&&(C.u_specular.type===WebGLConstants$1.SAMPLER_2D?v+=" vec3 specular = texture2D(u_specular, "+O+").rgb;\n":v+=" vec3 specular = u_specular.rgb;\n",v+=" vec3 specularLight = vec3(0.0, 0.0, 0.0);\n",q+=" color += specular * specularLight;\n"),defined(C.u_transparency)?" gl_FragColor = vec4(color * diffuse.a * u_transparency, diffuse.a * u_transparency);\n":" gl_FragColor = vec4(color * diffuse.a, diffuse.a);\n"):defined(C.u_transparency)?" gl_FragColor = vec4(color * u_transparency, u_transparency);\n":" gl_FragColor = vec4(color, 1.0);\n",m&&(q+=" color *= v_vertexColor.rgb;\n"),defined(C.u_emission)&&(C.u_emission.type===WebGLConstants$1.SAMPLER_2D?v+=" vec3 emission = texture2D(u_emission, "+O+").rgb;\n":v+=" vec3 emission = u_emission.rgb;\n",q+=" color += emission;\n"),!defined(C.u_ambient)&&"CONSTANT"===c||(defined(C.u_ambient)?C.u_ambient.type===WebGLConstants$1.SAMPLER_2D?v+=" vec3 ambient = texture2D(u_ambient, "+O+").rgb;\n":v+=" vec3 ambient = u_ambient.rgb;\n":v+=" vec3 ambient = diffuse.rgb;\n",q+=" color += ambient * ambientLight;\n"),v+=" vec3 viewDir = -normalize(v_positionEC);\n",v+=" vec3 ambientLight = vec3(0.0, 0.0, 0.0);\n",v+=F,v+=q,v+=j,v+="}\n";var Q=addToArray(l,{type:WebGLConstants$1.VERTEX_SHADER,extras:{_pipeline:{source:y,extension:".glsl"}}});return addToArray(s,{attributes:R,program:addToArray(u,{fragmentShader:addToArray(l,{type:WebGLConstants$1.FRAGMENT_SHADER,extras:{_pipeline:{source:v,extension:".glsl"}}}),vertexShader:Q}),uniforms:C})}function getKHRMaterialsCommonValueType(e,t){var i;switch(i=defined(t.value)?t.value:defined(t.index)?[t.index]:t,e){case"ambient":case"diffuse":case"emission":case"specular":return 1===i.length?WebGLConstants$1.SAMPLER_2D:WebGLConstants$1.FLOAT_VEC4;case"shininess":case"transparency":return WebGLConstants$1.FLOAT;case"transparent":case"doubleSided":return WebGLConstants$1.BOOL}}function getTechniqueKey(e,t){var i="";i+="technique:"+e.technique+";";for(var r=e.values,n=Object.keys(r).sort(),a=n.length,o=0;o<a;++o){var s=n[o];r.hasOwnProperty(s)&&(i+=s+":"+getKHRMaterialsCommonValueType(s,r[s]),i+=";")}var l=defaultValue(e.jointCount,0);if(i+=l.toString()+";",defined(t)){var u=t.skinning;0<l&&(i+=u.type+";"),i+=t.hasVertexColors}return i}function lightDefaults(e){var t=e.extensions.KHR_materials_common;if(defined(t)&&defined(t.lights))for(var i=t.lights,r=i.length,n=0;n<r;n++){var a=i[n];if("ambient"===a.type){defined(a.ambient)||(a.ambient={});var o=a.ambient;defined(o.color)||(o.color=[1,1,1])}else if("directional"===a.type){defined(a.directional)||(a.directional={});var s=a.directional;defined(s.color)||(s.color=[1,1,1])}else if("point"===a.type){defined(a.point)||(a.point={});var l=a.point;defined(l.color)||(l.color=[1,1,1]),l.constantAttenuation=defaultValue(l.constantAttenuation,1),l.linearAttenuation=defaultValue(l.linearAttenuation,0),l.quadraticAttenuation=defaultValue(l.quadraticAttenuation,0)}else if("spot"===a.type){defined(a.spot)||(a.spot={});var u=a.spot;defined(u.color)||(u.color=[1,1,1]),u.constantAttenuation=defaultValue(u.constantAttenuation,1),u.fallOffAngle=defaultValue(u.fallOffAngle,3.14159265),u.fallOffExponent=defaultValue(u.fallOffExponent,0),u.linearAttenuation=defaultValue(u.linearAttenuation,0),u.quadraticAttenuation=defaultValue(u.quadraticAttenuation,0)}}}function processPbrMaterials(n,a){if(a=defaultValue(a,defaultValue.EMPTY_OBJECT),hasExtension(n,"KHR_techniques_webgl"))return n;if(!defined(n.materials)||0===n.materials.length)return n;defined(n.extensions)||(n.extensions={}),defined(n.extensionsUsed)||(n.extensionsUsed=[]),defined(n.extensionsRequired)||(n.extensionsRequired=[]),n.extensions.KHR_techniques_webgl={programs:[],shaders:[],techniques:[]},n.extensionsUsed.push("KHR_techniques_webgl"),n.extensionsRequired.push("KHR_techniques_webgl");var o=ModelUtility.splitIncompatibleMaterials(n);return ForEach.material(n,function(e,t){var i={},r=generateTechnique$1(n,e,t,i,o,a);defined(e.extensions)||(e.extensions={}),e.extensions.KHR_techniques_webgl={values:i,technique:r}}),ModelUtility.ensureSemanticExistence(n),n}function isSpecularGlossinessMaterial(e){return defined(e.extensions)&&defined(e.extensions.KHR_materials_pbrSpecularGlossiness)}function addTextureCoordinates(e,t,i,r,n){var a;return defined(i[t+"Offset"])?(a=t+"Coord",n.fragmentShaderMain+=" vec2 "+a+" = computeTexCoord("+r+", "+t+"Offset, "+t+"Rotation, "+t+"Scale);\n"):a=r,a}ModelUtility.getGltfSemanticUniforms=function(){return gltfSemanticUniforms};var DEFAULT_TEXTURE_OFFSET=[0,0],DEFAULT_TEXTURE_ROTATION=[0],DEFAULT_TEXTURE_SCALE=[1,1];function handleKHRTextureTransform(e,t,i){if(-1!==e.indexOf("Texture")&&defined(t.extensions)&&defined(t.extensions.KHR_texture_transform)){var r="u_"+e,n=t.extensions.KHR_texture_transform;i[r+"Offset"]=defaultValue(n.offset,DEFAULT_TEXTURE_OFFSET),i[r+"Rotation"]=defaultValue(n.rotation,DEFAULT_TEXTURE_ROTATION),i[r+"Scale"]=defaultValue(n.scale,DEFAULT_TEXTURE_SCALE),defined(t.texCoord)&&defined(n.texCoord)&&(i[r].texCoord=n.texCoord)}}function generateTechnique$1(e,t,i,r,n,a){var o,s,l,u=defaultValue(a.addBatchIdToGeneratedShaders,!1),c=e.extensions.KHR_techniques_webgl,d=c.techniques,h=c.shaders,p=c.programs,f=isSpecularGlossinessMaterial(t),m=t.pbrMetallicRoughness;if(defined(m)&&!f)for(s in m)m.hasOwnProperty(s)&&(l=m[s],handleKHRTextureTransform(s,r[o="u_"+s]=l,r));if(f){var g=t.extensions.KHR_materials_pbrSpecularGlossiness;for(s in g)g.hasOwnProperty(s)&&(l=g[s],handleKHRTextureTransform(s,r[o="u_"+s]=l,r))}for(var y in t)t.hasOwnProperty(y)&&(0<=y.indexOf("Texture")||0<=y.indexOf("Factor"))&&(l=t[y],handleKHRTextureTransform(y,r[o="u_"+y]=l,r));var v,_="precision highp float;\n",C="precision highp float;\n";defined(e.skins)&&(v=e.skins[0]);var x,b,A=defined(v)?v.joints:[],S=A.length,w=n[i],E=!1,T=!1,P=!1,M=!1,D=!1,I=!1,O=!1;defined(w)&&(E=(x=w.skinning).skinned&&0<A.length,T=w.hasVertexColors,P=w.hasMorphTargets,M=w.hasNormals,D=w.hasTangents,I=w.hasTexCoords),P&&ForEach.mesh(e,function(e){ForEach.meshPrimitive(e,function(e){if(e.material===i){var t=e.targets;defined(t)&&(b=t)}})});var R={u_modelViewMatrix:{semantic:hasExtension(e,"CESIUM_RTC")?"CESIUM_RTC_MODELVIEW":"MODELVIEW",type:WebGLConstants$1.FLOAT_MAT4},u_projectionMatrix:{semantic:"PROJECTION",type:WebGLConstants$1.FLOAT_MAT4}};defined(t.extensions)&&defined(t.extensions.KHR_materials_unlit)&&(D=M=!(O=!0)),M&&(R.u_normalMatrix={semantic:"MODELVIEWINVERSETRANSPOSE",type:WebGLConstants$1.FLOAT_MAT3}),E&&(R.u_jointMatrix={count:S,semantic:"JOINTMATRIX",type:WebGLConstants$1.FLOAT_MAT4}),P&&(R.u_morphWeights={count:b.length,semantic:"MORPHWEIGHTS",type:WebGLConstants$1.FLOAT});var L=t.alphaMode;for(o in defined(L)&&"MASK"===L&&(R.u_alphaCutoff={semantic:"ALPHACUTOFF",type:WebGLConstants$1.FLOAT}),r)r.hasOwnProperty(o)&&(R[o]={type:getPBRValueType(o)});var N=defaultValue(R.u_baseColorTexture,R.u_baseColorFactor);for(o in defined(N)&&(N.semantic="_3DTILESDIFFUSE"),R)if(R.hasOwnProperty(o)){var k=R[o],B=defined(k.count)?"["+k.count+"]":"";k.type!==WebGLConstants$1.FLOAT_MAT3&&k.type!==WebGLConstants$1.FLOAT_MAT4&&"u_morphWeights"!==o||k.useInFragment?(C+="uniform "+webGLConstantToGlslType(k.type)+" "+o+B+";\n",delete k.useInFragment):_+="uniform "+webGLConstantToGlslType(k.type)+" "+o+B+";\n"}var F="";if(E){var V,z,U=numberOfComponentsForType(x.type),G=!1;if(0===x.type.indexOf("MAT")&&(G=!0,U=Math.sqrt(U)),G)for(V=0;V<U;V++)for(z=0;z<U;z++)F+=0===V&&0===z?" mat4 skinMatrix = ":" skinMatrix += ",F+="a_weight["+V+"]["+z+"] * u_jointMatrix[int(a_joint["+V+"]["+z+"])];\n";else for(V=0;V<U;V++)F+=0===V?" mat4 skinMatrix = ":" skinMatrix += ",F+="a_weight["+V+"] * u_jointMatrix[int(a_joint["+V+"])];\n"}var $={a_position:{semantic:"POSITION"}};if(_+="attribute vec3 a_position;\n",M&&(_+="varying vec3 v_positionEC;\n"),F+=" vec3 weightedPosition = a_position;\n",M&&(F+=" vec3 weightedNormal = a_normal;\n"),D&&(F+=" vec4 weightedTangent = a_tangent;\n"),P)for(var H=0;H<b.length;H++){var W=b[H];for(var j in W)if(W.hasOwnProperty(j)&&"extras"!==j){var q="a_"+j+"_"+H;$[q]={semantic:j+"_"+H},_+="attribute vec3 "+q+";\n","POSITION"===j?F+=" weightedPosition += u_morphWeights["+H+"] * "+q+";\n":"NORMAL"===j?F+=" weightedNormal += u_morphWeights["+H+"] * "+q+";\n":D&&"TANGENT"===j&&(F+=" weightedTangent.xyz += u_morphWeights["+H+"] * "+q+";\n")}}F+=E?" vec4 position = skinMatrix * vec4(weightedPosition, 1.0);\n":" vec4 position = vec4(weightedPosition, 1.0);\n",F+=" position = u_modelViewMatrix * position;\n",M&&(F+=" v_positionEC = position.xyz;\n"),F+=" gl_Position = u_projectionMatrix * position;\n",M&&($.a_normal={semantic:"NORMAL"},_+="attribute vec3 a_normal;\n",_+="varying vec3 v_normal;\n",F+=E?" v_normal = u_normalMatrix * mat3(skinMatrix) * weightedNormal;\n":" v_normal = u_normalMatrix * weightedNormal;\n",C+="varying vec3 v_normal;\n",C+="varying vec3 v_positionEC;\n"),D&&($.a_tangent={semantic:"TANGENT"},_+="attribute vec4 a_tangent;\n",_+="varying vec4 v_tangent;\n",F+=" v_tangent.xyz = u_normalMatrix * weightedTangent.xyz;\n",F+=" v_tangent.w = weightedTangent.w;\n",C+="varying vec4 v_tangent;\n");var Q,Y,X,Z,J,K,ee,te,ie="";if(I){$.a_texcoord_0={semantic:"TEXCOORD_0"},_+="attribute vec2 a_texcoord_0;\n",_+="varying vec2 "+(Q="v_texcoord_0")+";\n",F+=" "+Q+" = a_texcoord_0;\n",C+="varying vec2 "+Q+";\n";var re={fragmentShaderMain:ie};Y=addTextureCoordinates(e,"u_normalTexture",r,Q,re),X=addTextureCoordinates(e,"u_baseColorTexture",r,Q,re),Z=addTextureCoordinates(e,"u_specularGlossinessTexture",r,Q,re),J=addTextureCoordinates(e,"u_diffuseTexture",r,Q,re),K=addTextureCoordinates(e,"u_metallicRoughnessTexture",r,Q,re),ee=addTextureCoordinates(e,"u_occlusionTexture",r,Q,re),te=addTextureCoordinates(e,"u_emmissiveTexture",r,Q,re),ie=re.fragmentShaderMain}if(E){var ne=ModelUtility.getShaderVariable(x.type);$.a_joint={semantic:"JOINTS_0"},$.a_weight={semantic:"WEIGHTS_0"},_+="attribute "+ne+" a_joint;\n",_+="attribute "+ne+" a_weight;\n"}T&&($.a_vertexColor={semantic:"COLOR_0"},_+="attribute vec4 a_vertexColor;\n",_+="varying vec4 v_vertexColor;\n",F+=" v_vertexColor = a_vertexColor;\n",C+="varying vec4 v_vertexColor;\n"),u&&($.a_batchId={semantic:"_BATCHID"},_+="attribute float a_batchId;\n"),_+="void main(void) \n{\n",_+=F,_+="}\n",M&&(C+="const float M_PI = 3.141592653589793;\n",C+="vec3 lambertianDiffuse(vec3 diffuseColor) \n{\n return diffuseColor / M_PI;\n}\n\n",C+="vec3 fresnelSchlick2(vec3 f0, vec3 f90, float VdotH) \n{\n return f0 + (f90 - f0) * pow(clamp(1.0 - VdotH, 0.0, 1.0), 5.0);\n}\n\n",C+="vec3 fresnelSchlick(float metalness, float VdotH) \n{\n return metalness + (vec3(1.0) - metalness) * pow(1.0 - VdotH, 5.0);\n}\n\n",C+="float smithVisibilityG1(float NdotV, float roughness) \n{\n float k = (roughness + 1.0) * (roughness + 1.0) / 8.0;\n return NdotV / (NdotV * (1.0 - k) + k);\n}\n\n",C+="float smithVisibilityGGX(float roughness, float NdotL, float NdotV) \n{\n return smithVisibilityG1(NdotL, roughness) * smithVisibilityG1(NdotV, roughness);\n}\n\n",C+="float GGX(float roughness, float NdotH) \n{\n float roughnessSquared = roughness * roughness;\n float f = (NdotH * roughnessSquared - NdotH) * NdotH + 1.0;\n return roughnessSquared / (M_PI * f * f);\n}\n\n"),C+="vec3 SRGBtoLINEAR3(vec3 srgbIn) \n{\n return pow(srgbIn, vec3(2.2));\n}\n\n",C+="vec4 SRGBtoLINEAR4(vec4 srgbIn) \n{\n vec3 linearOut = pow(srgbIn.rgb, vec3(2.2));\n return vec4(linearOut, srgbIn.a);\n}\n\n",C+="vec3 applyTonemapping(vec3 linearIn) \n{\n#ifndef HDR \n return czm_acesTonemapping(linearIn);\n#else \n return linearIn;\n#endif \n}\n\n",C+="vec3 LINEARtoSRGB(vec3 linearIn) \n{\n#ifndef HDR \n return pow(linearIn, vec3(1.0/2.2));\n#else \n return linearIn;\n#endif \n}\n\n",C+="vec2 computeTexCoord(vec2 texCoords, vec2 offset, float rotation, vec2 scale) \n{\n rotation = -rotation; \n mat3 transform = mat3(\n cos(rotation) * scale.x, sin(rotation) * scale.x, 0.0, \n -sin(rotation) * scale.y, cos(rotation) * scale.y, 0.0, \n offset.x, offset.y, 1.0); \n vec2 transformedTexCoords = (transform * vec3(fract(texCoords), 1.0)).xy; \n return transformedTexCoords; \n}\n\n",C+="#ifdef USE_IBL_LIGHTING \n",C+="uniform vec2 gltf_iblFactor; \n",C+="#endif \n",C+="#ifdef USE_CUSTOM_LIGHT_COLOR \n",C+="uniform vec3 gltf_lightColor; \n",C+="#endif \n",C+="void main(void) \n{\n",C+=ie,M&&(C+=" vec3 ng = normalize(v_normal);\n",C+=" vec3 positionWC = vec3(czm_inverseView * vec4(v_positionEC, 1.0));\n",defined(r.u_normalTexture)?D?(C+=" vec3 t = normalize(v_tangent.xyz);\n",C+=" vec3 b = normalize(cross(ng, t) * v_tangent.w);\n",C+=" mat3 tbn = mat3(t, b, ng);\n",C+=" vec3 n = texture2D(u_normalTexture, "+Y+").rgb;\n",C+=" n = normalize(tbn * (2.0 * n - 1.0));\n"):(C="#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\n"+C,C+="#ifdef GL_OES_standard_derivatives\n",C+=" vec3 pos_dx = dFdx(v_positionEC);\n",C+=" vec3 pos_dy = dFdy(v_positionEC);\n",C+=" vec3 tex_dx = dFdx(vec3("+Y+",0.0));\n",C+=" vec3 tex_dy = dFdy(vec3("+Y+",0.0));\n",C+=" vec3 t = (tex_dy.t * pos_dx - tex_dx.t * pos_dy) / (tex_dx.s * tex_dy.t - tex_dy.s * tex_dx.t);\n",C+=" t = normalize(t - ng * dot(ng, t));\n",C+=" vec3 b = normalize(cross(ng, t));\n",C+=" mat3 tbn = mat3(t, b, ng);\n",C+=" vec3 n = texture2D(u_normalTexture, "+Y+").rgb;\n",C+=" n = normalize(tbn * (2.0 * n - 1.0));\n",C+="#else\n",C+=" vec3 n = ng;\n",C+="#endif\n"):C+=" vec3 n = ng;\n",t.doubleSided&&(C+=" if (gl_FrontFacing == false)\n",C+=" {\n",C+=" n = -n;\n",C+=" }\n")),defined(r.u_baseColorTexture)?(C+=" vec4 baseColorWithAlpha = SRGBtoLINEAR4(texture2D(u_baseColorTexture, "+X+"));\n",defined(r.u_baseColorFactor)&&(C+=" baseColorWithAlpha *= u_baseColorFactor;\n")):defined(r.u_baseColorFactor)?C+=" vec4 baseColorWithAlpha = u_baseColorFactor;\n":C+=" vec4 baseColorWithAlpha = vec4(1.0);\n",T&&(C+=" baseColorWithAlpha *= v_vertexColor;\n"),C+=" vec3 baseColor = baseColorWithAlpha.rgb;\n",M?(f?(defined(r.u_specularGlossinessTexture)?(C+=" vec4 specularGlossiness = SRGBtoLINEAR4(texture2D(u_specularGlossinessTexture, "+Z+"));\n",C+=" vec3 specular = specularGlossiness.rgb;\n",C+=" float glossiness = specularGlossiness.a;\n",defined(r.u_specularFactor)&&(C+=" specular *= u_specularFactor;\n"),defined(r.u_glossinessFactor)&&(C+=" glossiness *= u_glossinessFactor;\n")):(defined(r.u_specularFactor)?C+=" vec3 specular = clamp(u_specularFactor, vec3(0.0), vec3(1.0));\n":C+=" vec3 specular = vec3(1.0);\n",defined(r.u_glossinessFactor)?C+=" float glossiness = clamp(u_glossinessFactor, 0.0, 1.0);\n":C+=" float glossiness = 1.0;\n"),defined(r.u_diffuseTexture)?(C+=" vec4 diffuse = SRGBtoLINEAR4(texture2D(u_diffuseTexture, "+J+"));\n",defined(r.u_diffuseFactor)&&(C+=" diffuse *= u_diffuseFactor;\n")):defined(r.u_diffuseFactor)?C+=" vec4 diffuse = clamp(u_diffuseFactor, vec4(0.0), vec4(1.0));\n":C+=" vec4 diffuse = vec4(1.0);\n"):defined(r.u_metallicRoughnessTexture)?(C+=" vec3 metallicRoughness = texture2D(u_metallicRoughnessTexture, "+K+").rgb;\n",C+=" float metalness = clamp(metallicRoughness.b, 0.0, 1.0);\n",C+=" float roughness = clamp(metallicRoughness.g, 0.04, 1.0);\n",defined(r.u_metallicFactor)&&(C+=" metalness *= u_metallicFactor;\n"),defined(r.u_roughnessFactor)&&(C+=" roughness *= u_roughnessFactor;\n")):(defined(r.u_metallicFactor)?C+=" float metalness = clamp(u_metallicFactor, 0.0, 1.0);\n":C+=" float metalness = 1.0;\n",defined(r.u_roughnessFactor)?C+=" float roughness = clamp(u_roughnessFactor, 0.04, 1.0);\n":C+=" float roughness = 1.0;\n"),C+=" vec3 v = -normalize(v_positionEC);\n",C+="#ifndef USE_CUSTOM_LIGHT_COLOR \n",C+=" vec3 lightColorHdr = czm_lightColorHdr;\n",C+="#else \n",C+=" vec3 lightColorHdr = gltf_lightColor;\n",C+="#endif \n",C+=" vec3 l = normalize(czm_lightDirectionEC);\n",C+=" vec3 h = normalize(v + l);\n",C+=" float NdotL = clamp(dot(n, l), 0.001, 1.0);\n",C+=" float NdotV = abs(dot(n, v)) + 0.001;\n",C+=" float NdotH = clamp(dot(n, h), 0.0, 1.0);\n",C+=" float LdotH = clamp(dot(l, h), 0.0, 1.0);\n",C+=" float VdotH = clamp(dot(v, h), 0.0, 1.0);\n",C+=" vec3 f0 = vec3(0.04);\n",f?(C+=" float roughness = 1.0 - glossiness;\n",C+=" vec3 diffuseColor = diffuse.rgb * (1.0 - max(max(specular.r, specular.g), specular.b));\n",C+=" vec3 specularColor = specular;\n"):(C+=" vec3 diffuseColor = baseColor * (1.0 - metalness) * (1.0 - f0);\n",C+=" vec3 specularColor = mix(f0, baseColor, metalness);\n"),C+=" float alpha = roughness * roughness;\n",C+=" float reflectance = max(max(specularColor.r, specularColor.g), specularColor.b);\n",C+=" vec3 r90 = vec3(clamp(reflectance * 25.0, 0.0, 1.0));\n",C+=" vec3 r0 = specularColor.rgb;\n",C+=" vec3 F = fresnelSchlick2(r0, r90, VdotH);\n",C+=" float G = smithVisibilityGGX(alpha, NdotL, NdotV);\n",C+=" float D = GGX(alpha, NdotH);\n",C+=" vec3 diffuseContribution = (1.0 - F) * lambertianDiffuse(diffuseColor);\n",C+=" vec3 specularContribution = F * G * D / (4.0 * NdotL * NdotV);\n",C+=" vec3 color = NdotL * lightColorHdr * (diffuseContribution + specularContribution);\n",C+="#if defined(USE_IBL_LIGHTING) && !defined(DIFFUSE_IBL) && !defined(SPECULAR_IBL) \n",C+=" vec3 r = normalize(czm_inverseViewRotation * normalize(reflect(v, n)));\n",C+=" float vertexRadius = length(positionWC);\n",C+=" float horizonDotNadir = 1.0 - min(1.0, czm_ellipsoidRadii.x / vertexRadius);\n",C+=" float reflectionDotNadir = dot(r, normalize(positionWC));\n",C+=" r.x = -r.x;\n",C+=" r = -normalize(czm_temeToPseudoFixed * r);\n",C+=" r.x = -r.x;\n",C+=" float inverseRoughness = 1.04 - roughness;\n",C+=" inverseRoughness *= inverseRoughness;\n",C+=" vec3 sceneSkyBox = textureCube(czm_environmentMap, r).rgb * inverseRoughness;\n",C+=" float atmosphereHeight = 0.05;\n",C+=" float blendRegionSize = 0.1 * ((1.0 - inverseRoughness) * 8.0 + 1.1 - horizonDotNadir);\n",C+=" float blendRegionOffset = roughness * -1.0;\n",C+=" float farAboveHorizon = clamp(horizonDotNadir - blendRegionSize * 0.5 + blendRegionOffset, 1.0e-10 - blendRegionSize, 0.99999);\n",C+=" float aroundHorizon = clamp(horizonDotNadir + blendRegionSize * 0.5, 1.0e-10 - blendRegionSize, 0.99999);\n",C+=" float farBelowHorizon = clamp(horizonDotNadir + blendRegionSize * 1.5, 1.0e-10 - blendRegionSize, 0.99999);\n",C+=" float smoothstepHeight = smoothstep(0.0, atmosphereHeight, horizonDotNadir);\n",C+=" vec3 belowHorizonColor = mix(vec3(0.1, 0.15, 0.25), vec3(0.4, 0.7, 0.9), smoothstepHeight);\n",C+=" vec3 nadirColor = belowHorizonColor * 0.5;\n",C+=" vec3 aboveHorizonColor = mix(vec3(0.9, 1.0, 1.2), belowHorizonColor, roughness * 0.5);\n",C+=" vec3 blueSkyColor = mix(vec3(0.18, 0.26, 0.48), aboveHorizonColor, reflectionDotNadir * inverseRoughness * 0.5 + 0.75);\n",C+=" vec3 zenithColor = mix(blueSkyColor, sceneSkyBox, smoothstepHeight);\n",C+=" vec3 blueSkyDiffuseColor = vec3(0.7, 0.85, 0.9);\n",C+=" float diffuseIrradianceFromEarth = (1.0 - horizonDotNadir) * (reflectionDotNadir * 0.25 + 0.75) * smoothstepHeight;\n",C+=" float diffuseIrradianceFromSky = (1.0 - smoothstepHeight) * (1.0 - (reflectionDotNadir * 0.25 + 0.25));\n",C+=" vec3 diffuseIrradiance = blueSkyDiffuseColor * clamp(diffuseIrradianceFromEarth + diffuseIrradianceFromSky, 0.0, 1.0);\n",C+=" float notDistantRough = (1.0 - horizonDotNadir * roughness * 0.8);\n",C+=" vec3 specularIrradiance = mix(zenithColor, aboveHorizonColor, smoothstep(farAboveHorizon, aroundHorizon, reflectionDotNadir) * notDistantRough);\n",C+=" specularIrradiance = mix(specularIrradiance, belowHorizonColor, smoothstep(aroundHorizon, farBelowHorizon, reflectionDotNadir) * inverseRoughness);\n",C+=" specularIrradiance = mix(specularIrradiance, nadirColor, smoothstep(farBelowHorizon, 1.0, reflectionDotNadir) * inverseRoughness);\n",C+="#ifdef USE_SUN_LUMINANCE \n",C+=" float LdotZenith = clamp(dot(normalize(czm_inverseViewRotation * l), normalize(positionWC * -1.0)), 0.001, 1.0);\n",C+=" float S = acos(LdotZenith);\n",C+=" float NdotZenith = clamp(dot(normalize(czm_inverseViewRotation * n), normalize(positionWC * -1.0)), 0.001, 1.0);\n",C+=" float gamma = acos(NdotL);\n",C+=" float numerator = ((0.91 + 10.0 * exp(-3.0 * gamma) + 0.45 * pow(NdotL, 2.0)) * (1.0 - exp(-0.32 / NdotZenith)));\n",C+=" float denominator = (0.91 + 10.0 * exp(-3.0 * S) + 0.45 * pow(LdotZenith,2.0)) * (1.0 - exp(-0.32));\n",C+=" float luminance = gltf_luminanceAtZenith * (numerator / denominator);\n",C+="#endif \n",C+=" vec2 brdfLut = texture2D(czm_brdfLut, vec2(NdotV, roughness)).rg;\n",C+=" vec3 IBLColor = (diffuseIrradiance * diffuseColor * gltf_iblFactor.x) + (specularIrradiance * SRGBtoLINEAR3(specularColor * brdfLut.x + brdfLut.y) * gltf_iblFactor.y);\n",C+=" float maximumComponent = max(max(lightColorHdr.x, lightColorHdr.y), lightColorHdr.z);\n",C+=" vec3 lightColor = lightColorHdr / max(maximumComponent, 1.0);\n",C+=" IBLColor *= lightColor;\n",C+="#ifdef USE_SUN_LUMINANCE \n",C+=" color += IBLColor * luminance;\n",C+="#else \n",C+=" color += IBLColor; \n",C+="#endif \n",C+="#elif defined(DIFFUSE_IBL) || defined(SPECULAR_IBL) \n",C+=" mat3 fixedToENU = mat3(gltf_clippingPlanesMatrix[0][0], gltf_clippingPlanesMatrix[1][0], gltf_clippingPlanesMatrix[2][0], \n",C+=" gltf_clippingPlanesMatrix[0][1], gltf_clippingPlanesMatrix[1][1], gltf_clippingPlanesMatrix[2][1], \n",C+=" gltf_clippingPlanesMatrix[0][2], gltf_clippingPlanesMatrix[1][2], gltf_clippingPlanesMatrix[2][2]); \n",C+=" const mat3 yUpToZUp = mat3(-1.0, 0.0, 0.0, 0.0, 0.0, -1.0, 0.0, 1.0, 0.0); \n",C+=" vec3 cubeDir = normalize(yUpToZUp * fixedToENU * normalize(reflect(-v, n))); \n",C+="#ifdef DIFFUSE_IBL \n",C+="#ifdef CUSTOM_SPHERICAL_HARMONICS \n",C+=" vec3 diffuseIrradiance = czm_sphericalHarmonics(cubeDir, gltf_sphericalHarmonicCoefficients); \n",C+="#else \n",C+=" vec3 diffuseIrradiance = czm_sphericalHarmonics(cubeDir, czm_sphericalHarmonicCoefficients); \n",C+="#endif \n",C+="#else \n",C+=" vec3 diffuseIrradiance = vec3(0.0); \n",C+="#endif \n",C+="#ifdef SPECULAR_IBL \n",C+=" vec2 brdfLut = texture2D(czm_brdfLut, vec2(NdotV, roughness)).rg;\n",C+="#ifdef CUSTOM_SPECULAR_IBL \n",C+=" vec3 specularIBL = czm_sampleOctahedralProjection(gltf_specularMap, gltf_specularMapSize, cubeDir, roughness * gltf_maxSpecularLOD, gltf_maxSpecularLOD);\n",C+="#else \n",C+=" vec3 specularIBL = czm_sampleOctahedralProjection(czm_specularEnvironmentMaps, czm_specularEnvironmentMapSize, cubeDir, roughness * czm_specularEnvironmentMapsMaximumLOD, czm_specularEnvironmentMapsMaximumLOD);\n",C+="#endif \n",C+=" specularIBL *= F * brdfLut.x + brdfLut.y;\n",C+="#else \n",C+=" vec3 specularIBL = vec3(0.0); \n",C+="#endif \n",C+=" color += diffuseIrradiance * diffuseColor + specularColor * specularIBL;\n",C+="#endif \n"):C+=" vec3 color = baseColor;\n",O||(defined(r.u_occlusionTexture)&&(C+=" color *= texture2D(u_occlusionTexture, "+ee+").r;\n"),defined(r.u_emissiveTexture)?(C+=" vec3 emissive = SRGBtoLINEAR3(texture2D(u_emissiveTexture, "+te+").rgb);\n",defined(r.u_emissiveFactor)&&(C+=" emissive *= u_emissiveFactor;\n"),C+=" color += emissive;\n"):defined(r.u_emissiveFactor)&&(C+=" color += u_emissiveFactor;\n")),O||(C+=" color = applyTonemapping(color);\n"),C+=" color = LINEARtoSRGB(color);\n",defined(L)?"MASK"===L?(C+=" if (baseColorWithAlpha.a < u_alphaCutoff) {\n",C+=" discard;\n",C+=" }\n",C+=" gl_FragColor = vec4(color, 1.0);\n"):C+="BLEND"===L?" gl_FragColor = vec4(color, baseColorWithAlpha.a);\n":" gl_FragColor = vec4(color, 1.0);\n":C+=" gl_FragColor = vec4(color, 1.0);\n",C+="}\n";var ae=addToArray(h,{type:WebGLConstants$1.VERTEX_SHADER,extras:{_pipeline:{source:_,extension:".glsl"}}});return addToArray(d,{attributes:$,program:addToArray(p,{fragmentShader:addToArray(h,{type:WebGLConstants$1.FRAGMENT_SHADER,extras:{_pipeline:{source:C,extension:".glsl"}}}),vertexShader:ae}),uniforms:R})}function getPBRValueType(e){if(-1!==e.indexOf("Offset"))return WebGLConstants$1.FLOAT_VEC2;if(-1!==e.indexOf("Rotation"))return WebGLConstants$1.FLOAT;if(-1!==e.indexOf("Scale"))return WebGLConstants$1.FLOAT_VEC2;if(-1!==e.indexOf("Texture"))return WebGLConstants$1.SAMPLER_2D;switch(e){case"u_baseColorFactor":return WebGLConstants$1.FLOAT_VEC4;case"u_metallicFactor":case"u_roughnessFactor":return WebGLConstants$1.FLOAT;case"u_emissiveFactor":return WebGLConstants$1.FLOAT_VEC3;case"u_diffuseFactor":return WebGLConstants$1.FLOAT_VEC4;case"u_specularFactor":return WebGLConstants$1.FLOAT_VEC3;case"u_glossinessFactor":return WebGLConstants$1.FLOAT}}function Vector3DTileBatch(e){this.offset=e.offset,this.count=e.count,this.color=e.color,this.batchIds=e.batchIds}var VectorTileVS="attribute vec3 position;\nattribute float a_batchId;\nuniform mat4 u_modifiedModelViewProjection;\nvoid main()\n{\ngl_Position = czm_depthClampFarPlane(u_modifiedModelViewProjection * vec4(position, 1.0));\n}\n",tmp$9={},vHt,yHt,zHt,UHt,VHt,XHt,YHt,ZHt;function SHt(e,t){var i=new Error(e+" at character "+t);throw i.index=t,i.description=e,i}function WHt(e){var t,i=0;for(var r in e)(t=r.length)>i&&e.hasOwnProperty(r)&&(i=t);return i}function _Ht(e){return VHt[e]||0}function aIt(e,t,i){return{type:"||"===e||"&&"===e?"LogicalExpression":"BinaryExpression",operator:e,left:t,right:i}}function bIt(e){return 48<=e&&e<=57}function cIt(e){return 36===e||95===e||65<=e&&e<=90||97<=e&&e<=122||128<=e&&!VHt[String.fromCharCode(e)]}function eIt(n){for(var e,t,l=0,i=n.charAt,r=n.charCodeAt,a=function(e){return i.call(n,e)},o=function(e){return r.call(n,e)},s=n.length,u=function(){for(var e=o(l);32===e||9===e;)e=o(++l)},c=function(){var e,t,i=h();return u(),63!==o(l)?i:(l++,(e=c())||SHt("Expected expression",l),u(),58===o(l)?(l++,(t=c())||SHt("Expected expression",l),{type:"ConditionalExpression",test:i,consequent:e,alternate:t}):void SHt("Expected :",l))},d=function(){u();for(var e=n.substr(l,YHt),t=e.length;0<t;){if(VHt.hasOwnProperty(e))return l+=t,e;e=e.substr(0,--t)}return!1},h=function(){var e,t,i,r,n,a,o,s;if(a=p(),!(t=d()))return a;for(n={value:t,prec:_Ht(t)},(o=p())||SHt("Expected expression after "+t,l),r=[a,n,o];(t=d())&&0!==(i=_Ht(t));){for(n={value:t,prec:i};2<r.length&&i<=r[r.length-2].prec;)o=r.pop(),t=r.pop().value,a=r.pop(),e=aIt(t,a,o),r.push(e);(e=p())||SHt("Expected expression after "+t,l),r.push(n,e)}for(e=r[s=r.length-1];1<s;)e=aIt(r[s-1].value,r[s-2],e),s-=2;return e},p=function(){var e,t,i;if(u(),e=o(l),bIt(e)||46===e)return f();if(39===e||34===e)return m();if(cIt(e)||40===e)return v();if(91===e)return C();for(i=(t=n.substr(l,XHt)).length;0<i;){if(UHt.hasOwnProperty(t))return l+=i,{type:"UnaryExpression",operator:t,argument:p(),prefix:!0};t=t.substr(0,--i)}return!1},f=function(){for(var e,t,i="";bIt(o(l));)i+=a(l++);if(46===o(l))for(i+=a(l++);bIt(o(l));)i+=a(l++);if("e"===(e=a(l))||"E"===e){for(i+=a(l++),"+"!==(e=a(l))&&"-"!==e||(i+=a(l++));bIt(o(l));)i+=a(l++);bIt(o(l-1))||SHt("Expected exponent ("+i+a(l)+")",l)}return t=o(l),cIt(t)?SHt("Variable names cannot start with a number ("+i+a(l)+")",l):46===t&&SHt("Unexpected period",l),{type:zHt,value:parseFloat(i),raw:i}},m=function(){for(var e,t="",i=a(l++),r=!1;l<s;){if((e=a(l++))===i){r=!0;break}if("\\"===e)switch(e=a(l++)){case"n":t+="\n";break;case"r":t+="\r";break;case"t":t+="\t";break;case"b":t+="\b";break;case"f":t+="\f";break;case"v":t+="\v";break;default:t+="\\"+e}else t+=e}return r||SHt('Unclosed quote after "'+t+'"',l),{type:zHt,value:t,raw:i+t+i}},g=function(){var e,t,i=o(l),r=l;for(cIt(i)?l++:SHt("Unexpected "+a(l),l);l<s&&(i=o(l),36===(t=i)||95===t||65<=t&&t<=90||97<=t&&t<=122||48<=t&&t<=57||128<=t&&!VHt[String.fromCharCode(t)]);)l++;return e=n.slice(r,l),ZHt.hasOwnProperty(e)?{type:zHt,value:ZHt[e],raw:e}:"this"===e?{type:"ThisExpression"}:{type:"Identifier",name:e}},y=function(e){for(var t,i,r=[],n=!1;l<s;){if(u(),(t=o(l))===e){n=!0,l++;break}44===t?l++:((i=c())&&"Compound"!==i.type||SHt("Expected comma",l),r.push(i))}return n||SHt("Expected "+String.fromCharCode(e),l),r},v=function(){var e,t;for(t=40===(e=o(l))?_():g(),u(),e=o(l);46===e||91===e||40===e;)l++,46===e?(u(),t={type:yHt,computed:!1,object:t,property:g()}):91===e?(t={type:yHt,computed:!0,object:t,property:c()},u(),93!==(e=o(l))&&SHt("Unclosed [",l),l++):40===e&&(t={type:"CallExpression",arguments:y(41),callee:t}),u(),e=o(l);return t},_=function(){l++;var e=c();if(u(),41===o(l))return l++,e;SHt("Unclosed (",l)},C=function(){return l++,{type:"ArrayExpression",elements:y(93)}},x=[];l<s;)59===(e=o(l))||44===e?l++:(t=c())?x.push(t):l<s&&SHt('Unexpected "'+a(l)+'"',l);return 1===x.length?x[0]:{type:"Compound",body:x}}vHt=tmp$9,yHt="MemberExpression",zHt="Literal",UHt={"-":!0,"!":!0,"~":!0,"+":!0},VHt={"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10},XHt=WHt(UHt),YHt=WHt(VHt),ZHt={true:!0,false:!1,null:null},eIt.version="0.3.1",eIt.toString=function(){return"JavaScript Expression Parser (JSEP) v"+eIt.version},eIt.addUnaryOp=function(e){return XHt=Math.max(e.length,XHt),UHt[e]=!0,this},eIt.addBinaryOp=function(e,t){return YHt=Math.max(e.length,YHt),VHt[e]=t,this},eIt.addLiteral=function(e,t){return ZHt[e]=t,this},eIt.removeUnaryOp=function(e){return delete UHt[e],e.length===XHt&&(XHt=WHt(UHt)),this},eIt.removeAllUnaryOps=function(){return UHt={},XHt=0,this},eIt.removeBinaryOp=function(e){return delete VHt[e],e.length===YHt&&(YHt=WHt(VHt)),this},eIt.removeAllBinaryOps=function(){return VHt={},YHt=0,this},eIt.removeLiteral=function(e){return delete ZHt[e],this},eIt.removeAllLiterals=function(){return ZHt={},this},vHt.jsep=eIt;var jsep=tmp$9.jsep,ExpressionNodeType={VARIABLE:0,UNARY:1,BINARY:2,TERNARY:3,CONDITIONAL:4,MEMBER:5,FUNCTION_CALL:6,ARRAY:7,REGEX:8,VARIABLE_IN_STRING:9,LITERAL_NULL:10,LITERAL_BOOLEAN:11,LITERAL_NUMBER:12,LITERAL_STRING:13,LITERAL_COLOR:14,LITERAL_VECTOR:15,LITERAL_REGEX:16,LITERAL_UNDEFINED:17,BUILTIN_VARIABLE:18},ExpressionNodeType$1=Object.freeze(ExpressionNodeType);function Expression(e,t){var i;e=replaceVariables(removeBackslashes(e=replaceDefines(this._expression=e,t))),jsep.addBinaryOp("=~",0),jsep.addBinaryOp("!~",0);try{i=jsep(e)}catch(e){throw new RuntimeError(e)}this._runtimeAst=createRuntimeAst(this,i)}Object.defineProperties(Expression.prototype,{expression:{get:function(){return this._expression}}});var scratchStorage={arrayIndex:0,arrayArray:[[]],cartesian2Index:0,cartesian3Index:0,cartesian4Index:0,cartesian2Array:[new Cartesian2],cartesian3Array:[new Cartesian3],cartesian4Array:[new Cartesian4],reset:function(){this.arrayIndex=0,this.cartesian2Index=0,this.cartesian3Index=0,this.cartesian4Index=0},getArray:function(){this.arrayIndex>=this.arrayArray.length&&this.arrayArray.push([]);var e=this.arrayArray[this.arrayIndex++];return e.length=0,e},getCartesian2:function(){return this.cartesian2Index>=this.cartesian2Array.length&&this.cartesian2Array.push(new Cartesian2),this.cartesian2Array[this.cartesian2Index++]},getCartesian3:function(){return this.cartesian3Index>=this.cartesian3Array.length&&this.cartesian3Array.push(new Cartesian3),this.cartesian3Array[this.cartesian3Index++]},getCartesian4:function(){return this.cartesian4Index>=this.cartesian4Array.length&&this.cartesian4Array.push(new Cartesian4),this.cartesian4Array[this.cartesian4Index++]}};Expression.prototype.evaluate=function(e,t){scratchStorage.reset();var i=this._runtimeAst.evaluate(e);return t instanceof Color&&i instanceof Cartesian4?Color.fromCartesian4(i,t):i instanceof Cartesian2||i instanceof Cartesian3||i instanceof Cartesian4?i.clone(t):i},Expression.prototype.evaluateColor=function(e,t){scratchStorage.reset();var i=this._runtimeAst.evaluate(e);return Color.fromCartesian4(i,t)},Expression.prototype.getShaderFunction=function(e,t,i,r){var n=this.getShaderExpression(t,i);return n=r+" "+e+"() \n{ \n return "+n+"; \n} \n"},Expression.prototype.getShaderExpression=function(e,t){return this._runtimeAst.getShaderExpression(e,t)};var unaryOperators=["!","-","+"],binaryOperators=["+","-","*","/","%","===","!==",">",">=","<","<=","&&","||","!~","=~"],variableRegex=/\${(.*?)}/g,backslashRegex=/\\/g,backslashReplacement="@#%",replacementRegex=/@#%/g,scratchColor$4=new Color,unaryFunctions={abs:getEvaluateUnaryComponentwise(Math.abs),sqrt:getEvaluateUnaryComponentwise(Math.sqrt),cos:getEvaluateUnaryComponentwise(Math.cos),sin:getEvaluateUnaryComponentwise(Math.sin),tan:getEvaluateUnaryComponentwise(Math.tan),acos:getEvaluateUnaryComponentwise(Math.acos),asin:getEvaluateUnaryComponentwise(Math.asin),atan:getEvaluateUnaryComponentwise(Math.atan),radians:getEvaluateUnaryComponentwise(CesiumMath.toRadians),degrees:getEvaluateUnaryComponentwise(CesiumMath.toDegrees),sign:getEvaluateUnaryComponentwise(CesiumMath.sign),floor:getEvaluateUnaryComponentwise(Math.floor),ceil:getEvaluateUnaryComponentwise(Math.ceil),round:getEvaluateUnaryComponentwise(Math.round),exp:getEvaluateUnaryComponentwise(Math.exp),exp2:getEvaluateUnaryComponentwise(exp2),log:getEvaluateUnaryComponentwise(Math.log),log2:getEvaluateUnaryComponentwise(log2),fract:getEvaluateUnaryComponentwise(fract),length:length,normalize:normalize},binaryFunctions={atan2:getEvaluateBinaryComponentwise(Math.atan2,!1),pow:getEvaluateBinaryComponentwise(Math.pow,!1),min:getEvaluateBinaryComponentwise(Math.min,!0),max:getEvaluateBinaryComponentwise(Math.max,!0),distance:distance,dot:dot,cross:cross},ternaryFunctions={clamp:getEvaluateTernaryComponentwise(CesiumMath.clamp,!0),mix:getEvaluateTernaryComponentwise(CesiumMath.lerp,!0)};function fract(e){return e-Math.floor(e)}function exp2(e){return Math.pow(2,e)}function log2(e){return CesiumMath.log2(e)}function getEvaluateUnaryComponentwise(i){return function(e,t){if("number"==typeof t)return i(t);if(t instanceof Cartesian2)return Cartesian2.fromElements(i(t.x),i(t.y),scratchStorage.getCartesian2());if(t instanceof Cartesian3)return Cartesian3.fromElements(i(t.x),i(t.y),i(t.z),scratchStorage.getCartesian3());if(t instanceof Cartesian4)return Cartesian4.fromElements(i(t.x),i(t.y),i(t.z),i(t.w),scratchStorage.getCartesian4());throw new RuntimeError('Function "'+e+'" requires a vector or number argument. Argument is '+t+".")}}function getEvaluateBinaryComponentwise(r,n){return function(e,t,i){if(n&&"number"==typeof i){if("number"==typeof t)return r(t,i);if(t instanceof Cartesian2)return Cartesian2.fromElements(r(t.x,i),r(t.y,i),scratchStorage.getCartesian2());if(t instanceof Cartesian3)return Cartesian3.fromElements(r(t.x,i),r(t.y,i),r(t.z,i),scratchStorage.getCartesian3());if(t instanceof Cartesian4)return Cartesian4.fromElements(r(t.x,i),r(t.y,i),r(t.z,i),r(t.w,i),scratchStorage.getCartesian4())}if("number"==typeof t&&"number"==typeof i)return r(t,i);if(t instanceof Cartesian2&&i instanceof Cartesian2)return Cartesian2.fromElements(r(t.x,i.x),r(t.y,i.y),scratchStorage.getCartesian2());if(t instanceof Cartesian3&&i instanceof Cartesian3)return Cartesian3.fromElements(r(t.x,i.x),r(t.y,i.y),r(t.z,i.z),scratchStorage.getCartesian3());if(t instanceof Cartesian4&&i instanceof Cartesian4)return Cartesian4.fromElements(r(t.x,i.x),r(t.y,i.y),r(t.z,i.z),r(t.w,i.w),scratchStorage.getCartesian4());throw new RuntimeError('Function "'+e+'" requires vector or number arguments of matching types. Arguments are '+t+" and "+i+".")}}function getEvaluateTernaryComponentwise(n,a){return function(e,t,i,r){if(a&&"number"==typeof r){if("number"==typeof t&&"number"==typeof i)return n(t,i,r);if(t instanceof Cartesian2&&i instanceof Cartesian2)return Cartesian2.fromElements(n(t.x,i.x,r),n(t.y,i.y,r),scratchStorage.getCartesian2());if(t instanceof Cartesian3&&i instanceof Cartesian3)return Cartesian3.fromElements(n(t.x,i.x,r),n(t.y,i.y,r),n(t.z,i.z,r),scratchStorage.getCartesian3());if(t instanceof Cartesian4&&i instanceof Cartesian4)return Cartesian4.fromElements(n(t.x,i.x,r),n(t.y,i.y,r),n(t.z,i.z,r),n(t.w,i.w,r),scratchStorage.getCartesian4())}if("number"==typeof t&&"number"==typeof i&&"number"==typeof r)return n(t,i,r);if(t instanceof Cartesian2&&i instanceof Cartesian2&&r instanceof Cartesian2)return Cartesian2.fromElements(n(t.x,i.x,r.x),n(t.y,i.y,r.y),scratchStorage.getCartesian2());if(t instanceof Cartesian3&&i instanceof Cartesian3&&r instanceof Cartesian3)return Cartesian3.fromElements(n(t.x,i.x,r.x),n(t.y,i.y,r.y),n(t.z,i.z,r.z),scratchStorage.getCartesian3());if(t instanceof Cartesian4&&i instanceof Cartesian4&&r instanceof Cartesian4)return Cartesian4.fromElements(n(t.x,i.x,r.x),n(t.y,i.y,r.y),n(t.z,i.z,r.z),n(t.w,i.w,r.w),scratchStorage.getCartesian4());throw new RuntimeError('Function "'+e+'" requires vector or number arguments of matching types. Arguments are '+t+", "+i+", and "+r+".")}}function length(e,t){if("number"==typeof t)return Math.abs(t);if(t instanceof Cartesian2)return Cartesian2.magnitude(t);if(t instanceof Cartesian3)return Cartesian3.magnitude(t);if(t instanceof Cartesian4)return Cartesian4.magnitude(t);throw new RuntimeError('Function "'+e+'" requires a vector or number argument. Argument is '+t+".")}function normalize(e,t){if("number"==typeof t)return 1;if(t instanceof Cartesian2)return Cartesian2.normalize(t,scratchStorage.getCartesian2());if(t instanceof Cartesian3)return Cartesian3.normalize(t,scratchStorage.getCartesian3());if(t instanceof Cartesian4)return Cartesian4.normalize(t,scratchStorage.getCartesian4());throw new RuntimeError('Function "'+e+'" requires a vector or number argument. Argument is '+t+".")}function distance(e,t,i){if("number"==typeof t&&"number"==typeof i)return Math.abs(t-i);if(t instanceof Cartesian2&&i instanceof Cartesian2)return Cartesian2.distance(t,i);if(t instanceof Cartesian3&&i instanceof Cartesian3)return Cartesian3.distance(t,i);if(t instanceof Cartesian4&&i instanceof Cartesian4)return Cartesian4.distance(t,i);throw new RuntimeError('Function "'+e+'" requires vector or number arguments of matching types. Arguments are '+t+" and "+i+".")}function dot(e,t,i){if("number"==typeof t&&"number"==typeof i)return t*i;if(t instanceof Cartesian2&&i instanceof Cartesian2)return Cartesian2.dot(t,i);if(t instanceof Cartesian3&&i instanceof Cartesian3)return Cartesian3.dot(t,i);if(t instanceof Cartesian4&&i instanceof Cartesian4)return Cartesian4.dot(t,i);throw new RuntimeError('Function "'+e+'" requires vector or number arguments of matching types. Arguments are '+t+" and "+i+".")}function cross(e,t,i){if(t instanceof Cartesian3&&i instanceof Cartesian3)return Cartesian3.cross(t,i,scratchStorage.getCartesian3());throw new RuntimeError('Function "'+e+'" requires vec3 arguments. Arguments are '+t+" and "+i+".")}function Node$2(e,t,i,r,n){this._type=e,this._value=t,this._left=i,this._right=r,this._test=n,this.evaluate=void 0,setEvaluateFunction(this)}function replaceDefines(e,t){if(!defined(t))return e;for(var i in t)if(t.hasOwnProperty(i)){var r=new RegExp("\\$\\{"+i+"\\}","g"),n="("+t[i]+")";defined(n)&&(e=e.replace(r,n))}return e}function removeBackslashes(e){return e.replace(backslashRegex,backslashReplacement)}function replaceBackslashes(e){return e.replace(replacementRegex,"\\")}function replaceVariables(e){for(var t=e,i="",r=t.indexOf("${");0<=r;){var n,a=t.indexOf("'"),o=t.indexOf('"');if(0<=a&&a<r)n=t.indexOf("'",a+1),i+=t.substr(0,n+1),r=(t=t.substr(n+1)).indexOf("${");else if(0<=o&&o<r)n=t.indexOf('"',o+1),i+=t.substr(0,n+1),r=(t=t.substr(n+1)).indexOf("${");else{i+=t.substr(0,r);var s=t.indexOf("}");if(s<0)throw new RuntimeError("Unmatched {.");i+="czm_"+t.substr(r+2,s-(r+2)),r=(t=t.substr(s+1)).indexOf("${")}}return i+=t}function parseLiteral(e){var t=typeof e.value;return null===e.value?new Node$2(ExpressionNodeType$1.LITERAL_NULL,null):"boolean"==t?new Node$2(ExpressionNodeType$1.LITERAL_BOOLEAN,e.value):"number"==t?new Node$2(ExpressionNodeType$1.LITERAL_NUMBER,e.value):"string"==t?0<=e.value.indexOf("${")?new Node$2(ExpressionNodeType$1.VARIABLE_IN_STRING,e.value):new Node$2(ExpressionNodeType$1.LITERAL_STRING,replaceBackslashes(e.value)):void 0}function parseCall(e,t){var i,r,n,a,o=t.arguments,s=o.length;if("MemberExpression"===t.callee.type){i=t.callee.property.name;var l=t.callee.object;if("test"===i||"exec"===i){if("regExp"!==l.callee.name)throw new RuntimeError(i+" is not a function.");return 0===s?"test"===i?new Node$2(ExpressionNodeType$1.LITERAL_BOOLEAN,!1):new Node$2(ExpressionNodeType$1.LITERAL_NULL,null):(n=createRuntimeAst(e,l),a=createRuntimeAst(e,o[0]),new Node$2(ExpressionNodeType$1.FUNCTION_CALL,i,n,a))}if("toString"===i)return r=createRuntimeAst(e,l),new Node$2(ExpressionNodeType$1.FUNCTION_CALL,i,r);throw new RuntimeError('Unexpected function call "'+i+'".')}if("color"===(i=t.callee.name)){if(0===s)return new Node$2(ExpressionNodeType$1.LITERAL_COLOR,i);if(r=createRuntimeAst(e,o[0]),defined(o[1])){var u=createRuntimeAst(e,o[1]);return new Node$2(ExpressionNodeType$1.LITERAL_COLOR,i,[r,u])}return new Node$2(ExpressionNodeType$1.LITERAL_COLOR,i,[r])}if("rgb"===i||"hsl"===i){if(s<3)throw new RuntimeError(i+" requires three arguments.");return r=[createRuntimeAst(e,o[0]),createRuntimeAst(e,o[1]),createRuntimeAst(e,o[2])],new Node$2(ExpressionNodeType$1.LITERAL_COLOR,i,r)}if("rgba"===i||"hsla"===i){if(s<4)throw new RuntimeError(i+" requires four arguments.");return r=[createRuntimeAst(e,o[0]),createRuntimeAst(e,o[1]),createRuntimeAst(e,o[2]),createRuntimeAst(e,o[3])],new Node$2(ExpressionNodeType$1.LITERAL_COLOR,i,r)}if("vec2"===i||"vec3"===i||"vec4"===i){r=new Array(s);for(var c=0;c<s;++c)r[c]=createRuntimeAst(e,o[c]);return new Node$2(ExpressionNodeType$1.LITERAL_VECTOR,i,r)}if("isNaN"===i||"isFinite"===i)return 0===s?new Node$2(ExpressionNodeType$1.LITERAL_BOOLEAN,"isNaN"===i):(r=createRuntimeAst(e,o[0]),new Node$2(ExpressionNodeType$1.UNARY,i,r));if("isExactClass"===i||"isClass"===i){if(s<1||1<s)throw new RuntimeError(i+" requires exactly one argument.");return r=createRuntimeAst(e,o[0]),new Node$2(ExpressionNodeType$1.UNARY,i,r)}if("getExactClassName"===i){if(0<s)throw new RuntimeError(i+" does not take any argument.");return new Node$2(ExpressionNodeType$1.UNARY,i)}if(defined(unaryFunctions[i])){if(1!==s)throw new RuntimeError(i+" requires exactly one argument.");return r=createRuntimeAst(e,o[0]),new Node$2(ExpressionNodeType$1.UNARY,i,r)}if(defined(binaryFunctions[i])){if(2!==s)throw new RuntimeError(i+" requires exactly two arguments.");return n=createRuntimeAst(e,o[0]),a=createRuntimeAst(e,o[1]),new Node$2(ExpressionNodeType$1.BINARY,i,n,a)}if(defined(ternaryFunctions[i])){if(3!==s)throw new RuntimeError(i+" requires exactly three arguments.");n=createRuntimeAst(e,o[0]),a=createRuntimeAst(e,o[1]);var d=createRuntimeAst(e,o[2]);return new Node$2(ExpressionNodeType$1.TERNARY,i,n,a,d)}if("Boolean"===i)return 0===s?new Node$2(ExpressionNodeType$1.LITERAL_BOOLEAN,!1):(r=createRuntimeAst(e,o[0]),new Node$2(ExpressionNodeType$1.UNARY,i,r));if("Number"===i)return 0===s?new Node$2(ExpressionNodeType$1.LITERAL_NUMBER,0):(r=createRuntimeAst(e,o[0]),new Node$2(ExpressionNodeType$1.UNARY,i,r));if("String"===i)return 0===s?new Node$2(ExpressionNodeType$1.LITERAL_STRING,""):(r=createRuntimeAst(e,o[0]),new Node$2(ExpressionNodeType$1.UNARY,i,r));if("regExp"===i)return parseRegex$1(e,t);throw new RuntimeError('Unexpected function call "'+i+'".')}function parseRegex$1(e,t){var i=t.arguments;if(0===i.length)return new Node$2(ExpressionNodeType$1.LITERAL_REGEX,new RegExp);var r,n=createRuntimeAst(e,i[0]);if(1<i.length){var a=createRuntimeAst(e,i[1]);if(isLiteralType(n)&&isLiteralType(a)){try{r=new RegExp(replaceBackslashes(String(n._value)),a._value)}catch(e){throw new RuntimeError(e)}return new Node$2(ExpressionNodeType$1.LITERAL_REGEX,r)}return new Node$2(ExpressionNodeType$1.REGEX,n,a)}if(isLiteralType(n)){try{r=new RegExp(replaceBackslashes(String(n._value)))}catch(e){throw new RuntimeError(e)}return new Node$2(ExpressionNodeType$1.LITERAL_REGEX,r)}return new Node$2(ExpressionNodeType$1.REGEX,n)}function parseKeywordsAndVariables(e){if(isVariable(e.name)){var t=getPropertyName(e.name);return"tiles3d_"===t.substr(0,8)?new Node$2(ExpressionNodeType$1.BUILTIN_VARIABLE,t):new Node$2(ExpressionNodeType$1.VARIABLE,t)}if("NaN"===e.name)return new Node$2(ExpressionNodeType$1.LITERAL_NUMBER,NaN);if("Infinity"===e.name)return new Node$2(ExpressionNodeType$1.LITERAL_NUMBER,1/0);if("undefined"===e.name)return new Node$2(ExpressionNodeType$1.LITERAL_UNDEFINED,void 0);throw new RuntimeError(e.name+" is not defined.")}function parseMathConstant(e){var t=e.property.name;return"PI"===t?new Node$2(ExpressionNodeType$1.LITERAL_NUMBER,Math.PI):"E"===t?new Node$2(ExpressionNodeType$1.LITERAL_NUMBER,Math.E):void 0}function parseNumberConstant(e){if("POSITIVE_INFINITY"===e.property.name)return new Node$2(ExpressionNodeType$1.LITERAL_NUMBER,Number.POSITIVE_INFINITY)}function parseMemberExpression(e,t){if("Math"===t.object.name)return parseMathConstant(t);if("Number"===t.object.name)return parseNumberConstant(t);var i,r=createRuntimeAst(e,t.object);return t.computed?(i=createRuntimeAst(e,t.property),new Node$2(ExpressionNodeType$1.MEMBER,"brackets",r,i)):(i=new Node$2(ExpressionNodeType$1.LITERAL_STRING,t.property.name),new Node$2(ExpressionNodeType$1.MEMBER,"dot",r,i))}function isLiteralType(e){return e._type>=ExpressionNodeType$1.LITERAL_NULL}function isVariable(e){return"czm_"===e.substr(0,4)}function getPropertyName(e){return e.substr(4)}function createRuntimeAst(e,t){var i,r,n,a;if("Literal"===t.type)i=parseLiteral(t);else if("CallExpression"===t.type)i=parseCall(e,t);else if("Identifier"===t.type)i=parseKeywordsAndVariables(t);else if("UnaryExpression"===t.type){r=t.operator;var o=createRuntimeAst(e,t.argument);if(!(-1<unaryOperators.indexOf(r)))throw new RuntimeError('Unexpected operator "'+r+'".');i=new Node$2(ExpressionNodeType$1.UNARY,r,o)}else if("BinaryExpression"===t.type){if(r=t.operator,n=createRuntimeAst(e,t.left),a=createRuntimeAst(e,t.right),!(-1<binaryOperators.indexOf(r)))throw new RuntimeError('Unexpected operator "'+r+'".');i=new Node$2(ExpressionNodeType$1.BINARY,r,n,a)}else if("LogicalExpression"===t.type)r=t.operator,n=createRuntimeAst(e,t.left),a=createRuntimeAst(e,t.right),-1<binaryOperators.indexOf(r)&&(i=new Node$2(ExpressionNodeType$1.BINARY,r,n,a));else if("ConditionalExpression"===t.type){var s=createRuntimeAst(e,t.test);n=createRuntimeAst(e,t.consequent),a=createRuntimeAst(e,t.alternate),i=new Node$2(ExpressionNodeType$1.CONDITIONAL,"?",n,a,s)}else if("MemberExpression"===t.type)i=parseMemberExpression(e,t);else{if("ArrayExpression"!==t.type)throw"Compound"===t.type?new RuntimeError("Provide exactly one expression."):new RuntimeError("Cannot parse expression.");for(var l=[],u=0;u<t.elements.length;u++)l[u]=createRuntimeAst(e,t.elements[u]);i=new Node$2(ExpressionNodeType$1.ARRAY,l)}return i}function setEvaluateFunction(e){e._type===ExpressionNodeType$1.CONDITIONAL?e.evaluate=e._evaluateConditional:e._type===ExpressionNodeType$1.FUNCTION_CALL?"test"===e._value?e.evaluate=e._evaluateRegExpTest:"exec"===e._value?e.evaluate=e._evaluateRegExpExec:"toString"===e._value&&(e.evaluate=e._evaluateToString):e._type===ExpressionNodeType$1.UNARY?"!"===e._value?e.evaluate=e._evaluateNot:"-"===e._value?e.evaluate=e._evaluateNegative:"+"===e._value?e.evaluate=e._evaluatePositive:"isNaN"===e._value?e.evaluate=e._evaluateNaN:"isFinite"===e._value?e.evaluate=e._evaluateIsFinite:"isExactClass"===e._value?e.evaluate=e._evaluateIsExactClass:"isClass"===e._value?e.evaluate=e._evaluateIsClass:"getExactClassName"===e._value?e.evaluate=e._evaluateGetExactClassName:"Boolean"===e._value?e.evaluate=e._evaluateBooleanConversion:"Number"===e._value?e.evaluate=e._evaluateNumberConversion:"String"===e._value?e.evaluate=e._evaluateStringConversion:defined(unaryFunctions[e._value])&&(e.evaluate=getEvaluateUnaryFunction(e._value)):e._type===ExpressionNodeType$1.BINARY?"+"===e._value?e.evaluate=e._evaluatePlus:"-"===e._value?e.evaluate=e._evaluateMinus:"*"===e._value?e.evaluate=e._evaluateTimes:"/"===e._value?e.evaluate=e._evaluateDivide:"%"===e._value?e.evaluate=e._evaluateMod:"==="===e._value?e.evaluate=e._evaluateEqualsStrict:"!=="===e._value?e.evaluate=e._evaluateNotEqualsStrict:"<"===e._value?e.evaluate=e._evaluateLessThan:"<="===e._value?e.evaluate=e._evaluateLessThanOrEquals:">"===e._value?e.evaluate=e._evaluateGreaterThan:">="===e._value?e.evaluate=e._evaluateGreaterThanOrEquals:"&&"===e._value?e.evaluate=e._evaluateAnd:"||"===e._value?e.evaluate=e._evaluateOr:"=~"===e._value?e.evaluate=e._evaluateRegExpMatch:"!~"===e._value?e.evaluate=e._evaluateRegExpNotMatch:defined(binaryFunctions[e._value])&&(e.evaluate=getEvaluateBinaryFunction(e._value)):e._type===ExpressionNodeType$1.TERNARY?e.evaluate=getEvaluateTernaryFunction(e._value):e._type===ExpressionNodeType$1.MEMBER?"brackets"===e._value?e.evaluate=e._evaluateMemberBrackets:e.evaluate=e._evaluateMemberDot:e._type===ExpressionNodeType$1.ARRAY?e.evaluate=e._evaluateArray:e._type===ExpressionNodeType$1.VARIABLE?e.evaluate=e._evaluateVariable:e._type===ExpressionNodeType$1.VARIABLE_IN_STRING?e.evaluate=e._evaluateVariableString:e._type===ExpressionNodeType$1.LITERAL_COLOR?e.evaluate=e._evaluateLiteralColor:e._type===ExpressionNodeType$1.LITERAL_VECTOR?e.evaluate=e._evaluateLiteralVector:e._type===ExpressionNodeType$1.LITERAL_STRING?e.evaluate=e._evaluateLiteralString:e._type===ExpressionNodeType$1.REGEX?e.evaluate=e._evaluateRegExp:e._type===ExpressionNodeType$1.BUILTIN_VARIABLE?"tiles3d_tileset_time"===e._value&&(e.evaluate=evaluateTilesetTime):e.evaluate=e._evaluateLiteral}function evaluateTilesetTime(e){return defined(e)?e.content.tileset.timeSinceLoad:0}function getEvaluateUnaryFunction(i){var r=unaryFunctions[i];return function(e){var t=this._left.evaluate(e);return r(i,t)}}function getEvaluateBinaryFunction(r){var n=binaryFunctions[r];return function(e){var t=this._left.evaluate(e),i=this._right.evaluate(e);return n(r,t,i)}}function getEvaluateTernaryFunction(n){var a=ternaryFunctions[n];return function(e){var t=this._left.evaluate(e),i=this._right.evaluate(e),r=this._test.evaluate(e);return a(n,t,i,r)}}function getFeatureProperty(e,t){if(defined(e))return e.getProperty(t)}function checkFeature(e){return"feature"===e._value}function convertHSLToRGB(e){for(var t=e._left,i=t.length,r=0;r<i;++r)if(t[r]._type!==ExpressionNodeType$1.LITERAL_NUMBER)return;var n=t[0]._value,a=t[1]._value,o=t[2]._value,s=4===i?t[3]._value:1;return Color.fromHsl(n,a,o,s,scratchColor$4)}function convertRGBToColor(e){for(var t=e._left,i=t.length,r=0;r<i;++r)if(t[r]._type!==ExpressionNodeType$1.LITERAL_NUMBER)return;var n=scratchColor$4;return n.red=t[0]._value/255,n.green=t[1]._value/255,n.blue=t[2]._value/255,n.alpha=4===i?t[3]._value:1,n}function numberToString(e){return e%1==0?e.toFixed(1):e.toString()}function colorToVec3(e){return"vec3("+numberToString(e.red)+", "+numberToString(e.green)+", "+numberToString(e.blue)+")"}function colorToVec4(e){return"vec4("+numberToString(e.red)+", "+numberToString(e.green)+", "+numberToString(e.blue)+", "+numberToString(e.alpha)+")"}function getExpressionArray(e,t,i,r){for(var n=e.length,a=new Array(n),o=0;o<n;++o)a[o]=e[o].getShaderExpression(t,i,r);return a}Node$2.prototype._evaluateLiteral=function(){return this._value},Node$2.prototype._evaluateLiteralColor=function(e){var t=scratchColor$4,i=this._left;if("color"===this._value)defined(i)?1<i.length?(Color.fromCssColorString(i[0].evaluate(e),t),t.alpha=i[1].evaluate(e)):Color.fromCssColorString(i[0].evaluate(e),t):Color.fromBytes(255,255,255,255,t);else if("rgb"===this._value)Color.fromBytes(i[0].evaluate(e),i[1].evaluate(e),i[2].evaluate(e),255,t);else if("rgba"===this._value){var r=255*i[3].evaluate(e);Color.fromBytes(i[0].evaluate(e),i[1].evaluate(e),i[2].evaluate(e),r,t)}else"hsl"===this._value?Color.fromHsl(i[0].evaluate(e),i[1].evaluate(e),i[2].evaluate(e),1,t):"hsla"===this._value&&Color.fromHsl(i[0].evaluate(e),i[1].evaluate(e),i[2].evaluate(e),i[3].evaluate(e),t);return Cartesian4.fromColor(t,scratchStorage.getCartesian4())},Node$2.prototype._evaluateLiteralVector=function(e){for(var t=scratchStorage.getArray(),i=this._value,r=this._left,n=r.length,a=0;a<n;++a){var o=r[a].evaluate(e);if("number"==typeof o)t.push(o);else if(o instanceof Cartesian2)t.push(o.x,o.y);else if(o instanceof Cartesian3)t.push(o.x,o.y,o.z);else{if(!(o instanceof Cartesian4))throw new RuntimeError(i+" argument must be a vector or number. Argument is "+o+".");t.push(o.x,o.y,o.z,o.w)}}var s=t.length,l=parseInt(i.charAt(3));if(0===s)throw new RuntimeError("Invalid "+i+" constructor. No valid arguments.");if(s<l&&1<s)throw new RuntimeError("Invalid "+i+" constructor. Not enough arguments.");if(l<s&&1<n)throw new RuntimeError("Invalid "+i+" constructor. Too many arguments.");if(1===s){var u=t[0];t.push(u,u,u)}return"vec2"===i?Cartesian2.fromArray(t,0,scratchStorage.getCartesian2()):"vec3"===i?Cartesian3.fromArray(t,0,scratchStorage.getCartesian3()):"vec4"===i?Cartesian4.fromArray(t,0,scratchStorage.getCartesian4()):void 0},Node$2.prototype._evaluateLiteralString=function(){return this._value},Node$2.prototype._evaluateVariableString=function(e){for(var t=this._value,i=variableRegex.exec(t);null!==i;){var r=i[0],n=getFeatureProperty(e,i[1]);defined(n)||(n=""),t=t.replace(r,n),i=variableRegex.exec(t)}return t},Node$2.prototype._evaluateVariable=function(e){return getFeatureProperty(e,this._value)},Node$2.prototype._evaluateMemberDot=function(e){if(checkFeature(this._left))return getFeatureProperty(e,this._right.evaluate(e));var t=this._left.evaluate(e);if(defined(t)){var i=this._right.evaluate(e);if(t instanceof Cartesian2||t instanceof Cartesian3||t instanceof Cartesian4){if("r"===i)return t.x;if("g"===i)return t.y;if("b"===i)return t.z;if("a"===i)return t.w}return t[i]}},Node$2.prototype._evaluateMemberBrackets=function(e){if(checkFeature(this._left))return getFeatureProperty(e,this._right.evaluate(e));var t=this._left.evaluate(e);if(defined(t)){var i=this._right.evaluate(e);if(t instanceof Cartesian2||t instanceof Cartesian3||t instanceof Cartesian4){if(0===i||"r"===i)return t.x;if(1===i||"g"===i)return t.y;if(2===i||"b"===i)return t.z;if(3===i||"a"===i)return t.w}return t[i]}},Node$2.prototype._evaluateArray=function(e){for(var t=[],i=0;i<this._value.length;i++)t[i]=this._value[i].evaluate(e);return t},Node$2.prototype._evaluateNot=function(e){var t=this._left.evaluate(e);if("boolean"!=typeof t)throw new RuntimeError('Operator "!" requires a boolean argument. Argument is '+t+".");return!t},Node$2.prototype._evaluateNegative=function(e){var t=this._left.evaluate(e);if(t instanceof Cartesian2)return Cartesian2.negate(t,scratchStorage.getCartesian2());if(t instanceof Cartesian3)return Cartesian3.negate(t,scratchStorage.getCartesian3());if(t instanceof Cartesian4)return Cartesian4.negate(t,scratchStorage.getCartesian4());if("number"==typeof t)return-t;throw new RuntimeError('Operator "-" requires a vector or number argument. Argument is '+t+".")},Node$2.prototype._evaluatePositive=function(e){var t=this._left.evaluate(e);if(!(t instanceof Cartesian2||t instanceof Cartesian3||t instanceof Cartesian4||"number"==typeof t))throw new RuntimeError('Operator "+" requires a vector or number argument. Argument is '+t+".");return t},Node$2.prototype._evaluateLessThan=function(e){var t=this._left.evaluate(e),i=this._right.evaluate(e);if("number"!=typeof t||"number"!=typeof i)throw new RuntimeError('Operator "<" requires number arguments. Arguments are '+t+" and "+i+".");return t<i},Node$2.prototype._evaluateLessThanOrEquals=function(e){var t=this._left.evaluate(e),i=this._right.evaluate(e);if("number"!=typeof t||"number"!=typeof i)throw new RuntimeError('Operator "<=" requires number arguments. Arguments are '+t+" and "+i+".");return t<=i},Node$2.prototype._evaluateGreaterThan=function(e){var t=this._left.evaluate(e),i=this._right.evaluate(e);if("number"!=typeof t||"number"!=typeof i)throw new RuntimeError('Operator ">" requires number arguments. Arguments are '+t+" and "+i+".");return i<t},Node$2.prototype._evaluateGreaterThanOrEquals=function(e){var t=this._left.evaluate(e),i=this._right.evaluate(e);if("number"!=typeof t||"number"!=typeof i)throw new RuntimeError('Operator ">=" requires number arguments. Arguments are '+t+" and "+i+".");return i<=t},Node$2.prototype._evaluateOr=function(e){var t=this._left.evaluate(e);if("boolean"!=typeof t)throw new RuntimeError('Operator "||" requires boolean arguments. First argument is '+t+".");if(t)return!0;var i=this._right.evaluate(e);if("boolean"!=typeof i)throw new RuntimeError('Operator "||" requires boolean arguments. Second argument is '+i+".");return t||i},Node$2.prototype._evaluateAnd=function(e){var t=this._left.evaluate(e);if("boolean"!=typeof t)throw new RuntimeError('Operator "&&" requires boolean arguments. First argument is '+t+".");if(!t)return!1;var i=this._right.evaluate(e);if("boolean"!=typeof i)throw new RuntimeError('Operator "&&" requires boolean arguments. Second argument is '+i+".");return t&&i},Node$2.prototype._evaluatePlus=function(e){var t=this._left.evaluate(e),i=this._right.evaluate(e);if(i instanceof Cartesian2&&t instanceof Cartesian2)return Cartesian2.add(t,i,scratchStorage.getCartesian2());if(i instanceof Cartesian3&&t instanceof Cartesian3)return Cartesian3.add(t,i,scratchStorage.getCartesian3());if(i instanceof Cartesian4&&t instanceof Cartesian4)return Cartesian4.add(t,i,scratchStorage.getCartesian4());if("string"==typeof t||"string"==typeof i)return t+i;if("number"==typeof t&&"number"==typeof i)return t+i;throw new RuntimeError('Operator "+" requires vector or number arguments of matching types, or at least one string argument. Arguments are '+t+" and "+i+".")},Node$2.prototype._evaluateMinus=function(e){var t=this._left.evaluate(e),i=this._right.evaluate(e);if(i instanceof Cartesian2&&t instanceof Cartesian2)return Cartesian2.subtract(t,i,scratchStorage.getCartesian2());if(i instanceof Cartesian3&&t instanceof Cartesian3)return Cartesian3.subtract(t,i,scratchStorage.getCartesian3());if(i instanceof Cartesian4&&t instanceof Cartesian4)return Cartesian4.subtract(t,i,scratchStorage.getCartesian4());if("number"==typeof t&&"number"==typeof i)return t-i;throw new RuntimeError('Operator "-" requires vector or number arguments of matching types. Arguments are '+t+" and "+i+".")},Node$2.prototype._evaluateTimes=function(e){var t=this._left.evaluate(e),i=this._right.evaluate(e);if(i instanceof Cartesian2&&t instanceof Cartesian2)return Cartesian2.multiplyComponents(t,i,scratchStorage.getCartesian2());if(i instanceof Cartesian2&&"number"==typeof t)return Cartesian2.multiplyByScalar(i,t,scratchStorage.getCartesian2());if(t instanceof Cartesian2&&"number"==typeof i)return Cartesian2.multiplyByScalar(t,i,scratchStorage.getCartesian2());if(i instanceof Cartesian3&&t instanceof Cartesian3)return Cartesian3.multiplyComponents(t,i,scratchStorage.getCartesian3());if(i instanceof Cartesian3&&"number"==typeof t)return Cartesian3.multiplyByScalar(i,t,scratchStorage.getCartesian3());if(t instanceof Cartesian3&&"number"==typeof i)return Cartesian3.multiplyByScalar(t,i,scratchStorage.getCartesian3());if(i instanceof Cartesian4&&t instanceof Cartesian4)return Cartesian4.multiplyComponents(t,i,scratchStorage.getCartesian4());if(i instanceof Cartesian4&&"number"==typeof t)return Cartesian4.multiplyByScalar(i,t,scratchStorage.getCartesian4());if(t instanceof Cartesian4&&"number"==typeof i)return Cartesian4.multiplyByScalar(t,i,scratchStorage.getCartesian4());if("number"==typeof t&&"number"==typeof i)return t*i;throw new RuntimeError('Operator "*" requires vector or number arguments. If both arguments are vectors they must be matching types. Arguments are '+t+" and "+i+".")},Node$2.prototype._evaluateDivide=function(e){var t=this._left.evaluate(e),i=this._right.evaluate(e);if(i instanceof Cartesian2&&t instanceof Cartesian2)return Cartesian2.divideComponents(t,i,scratchStorage.getCartesian2());if(t instanceof Cartesian2&&"number"==typeof i)return Cartesian2.divideByScalar(t,i,scratchStorage.getCartesian2());if(i instanceof Cartesian3&&t instanceof Cartesian3)return Cartesian3.divideComponents(t,i,scratchStorage.getCartesian3());if(t instanceof Cartesian3&&"number"==typeof i)return Cartesian3.divideByScalar(t,i,scratchStorage.getCartesian3());if(i instanceof Cartesian4&&t instanceof Cartesian4)return Cartesian4.divideComponents(t,i,scratchStorage.getCartesian4());if(t instanceof Cartesian4&&"number"==typeof i)return Cartesian4.divideByScalar(t,i,scratchStorage.getCartesian4());if("number"==typeof t&&"number"==typeof i)return t/i;throw new RuntimeError('Operator "/" requires vector or number arguments of matching types, or a number as the second argument. Arguments are '+t+" and "+i+".")},Node$2.prototype._evaluateMod=function(e){var t=this._left.evaluate(e),i=this._right.evaluate(e);if(i instanceof Cartesian2&&t instanceof Cartesian2)return Cartesian2.fromElements(t.x%i.x,t.y%i.y,scratchStorage.getCartesian2());if(i instanceof Cartesian3&&t instanceof Cartesian3)return Cartesian3.fromElements(t.x%i.x,t.y%i.y,t.z%i.z,scratchStorage.getCartesian3());if(i instanceof Cartesian4&&t instanceof Cartesian4)return Cartesian4.fromElements(t.x%i.x,t.y%i.y,t.z%i.z,t.w%i.w,scratchStorage.getCartesian4());if("number"==typeof t&&"number"==typeof i)return t%i;throw new RuntimeError('Operator "%" requires vector or number arguments of matching types. Arguments are '+t+" and "+i+".")},Node$2.prototype._evaluateEqualsStrict=function(e){var t=this._left.evaluate(e),i=this._right.evaluate(e);return i instanceof Cartesian2&&t instanceof Cartesian2||i instanceof Cartesian3&&t instanceof Cartesian3||i instanceof Cartesian4&&t instanceof Cartesian4?t.equals(i):t===i},Node$2.prototype._evaluateNotEqualsStrict=function(e){var t=this._left.evaluate(e),i=this._right.evaluate(e);return i instanceof Cartesian2&&t instanceof Cartesian2||i instanceof Cartesian3&&t instanceof Cartesian3||i instanceof Cartesian4&&t instanceof Cartesian4?!t.equals(i):t!==i},Node$2.prototype._evaluateConditional=function(e){var t=this._test.evaluate(e);if("boolean"!=typeof t)throw new RuntimeError("Conditional argument of conditional expression must be a boolean. Argument is "+t+".");return t?this._left.evaluate(e):this._right.evaluate(e)},Node$2.prototype._evaluateNaN=function(e){return isNaN(this._left.evaluate(e))},Node$2.prototype._evaluateIsFinite=function(e){return isFinite(this._left.evaluate(e))},Node$2.prototype._evaluateIsExactClass=function(e){return!!defined(e)&&e.isExactClass(this._left.evaluate(e))},Node$2.prototype._evaluateIsClass=function(e){return!!defined(e)&&e.isClass(this._left.evaluate(e))},Node$2.prototype._evaluateGetExactClassName=function(e){if(defined(e))return e.getExactClassName()},Node$2.prototype._evaluateBooleanConversion=function(e){return Boolean(this._left.evaluate(e))},Node$2.prototype._evaluateNumberConversion=function(e){return Number(this._left.evaluate(e))},Node$2.prototype._evaluateStringConversion=function(e){return String(this._left.evaluate(e))},Node$2.prototype._evaluateRegExp=function(e){var t,i=this._value.evaluate(e),r="";defined(this._left)&&(r=this._left.evaluate(e));try{t=new RegExp(i,r)}catch(e){throw new RuntimeError(e)}return t},Node$2.prototype._evaluateRegExpTest=function(e){var t=this._left.evaluate(e),i=this._right.evaluate(e);if(!(t instanceof RegExp&&"string"==typeof i))throw new RuntimeError("RegExp.test requires the first argument to be a RegExp and the second argument to be a string. Arguments are "+t+" and "+i+".");return t.test(i)},Node$2.prototype._evaluateRegExpMatch=function(e){var t=this._left.evaluate(e),i=this._right.evaluate(e);if(t instanceof RegExp&&"string"==typeof i)return t.test(i);if(i instanceof RegExp&&"string"==typeof t)return i.test(t);throw new RuntimeError('Operator "=~" requires one RegExp argument and one string argument. Arguments are '+t+" and "+i+".")},Node$2.prototype._evaluateRegExpNotMatch=function(e){var t=this._left.evaluate(e),i=this._right.evaluate(e);if(t instanceof RegExp&&"string"==typeof i)return!t.test(i);if(i instanceof RegExp&&"string"==typeof t)return!i.test(t);throw new RuntimeError('Operator "!~" requires one RegExp argument and one string argument. Arguments are '+t+" and "+i+".")},Node$2.prototype._evaluateRegExpExec=function(e){var t=this._left.evaluate(e),i=this._right.evaluate(e);if(!(t instanceof RegExp&&"string"==typeof i))throw new RuntimeError("RegExp.exec requires the first argument to be a RegExp and the second argument to be a string. Arguments are "+t+" and "+i+".");var r=t.exec(i);return defined(r)?r[1]:null},Node$2.prototype._evaluateToString=function(e){var t=this._left.evaluate(e);if(t instanceof RegExp||t instanceof Cartesian2||t instanceof Cartesian3||t instanceof Cartesian4)return String(t);throw new RuntimeError('Unexpected function call "'+this._value+'".')};var nullSentinel="czm_infinity";function Vector3DTilePrimitive(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._positions=e.positions,this._vertexBatchIds=e.vertexBatchIds,this._indices=e.indices,this._indexCounts=e.indexCounts,this._indexOffsets=e.indexOffsets,this._batchedIndices=e.batchedIndices,this._boundingVolume=e.boundingVolume,this._boundingVolumes=e.boundingVolumes,this._center=defaultValue(e.center,Cartesian3.ZERO),this._va=void 0,this._sp=void 0,this._spStencil=void 0,this._spPick=void 0,this._uniformMap=void 0,this._vaSwap=void 0,this._rsStencilPreloadPass=void 0,this._rsStencilPreloadPass3DTiles=void 0,this._rsStencilDepthPass=void 0,this._rsStencilDepthPass3DTiles=void 0,this._rsColorPass=void 0,this._rsPickPass=void 0,this._rsWireframe=void 0,this._commands=[],this._commandsIgnoreShow=[],this._pickCommands=[],this._constantColor=Color.clone(Color.WHITE),this._highlightColor=this._constantColor,this._batchDirty=!0,this._pickCommandsDirty=!0,this._framesSinceLastRebatch=0,this._updatingAllCommands=!1,this._trianglesLength=this._indices.length/3,this._geometryByteLength=this._indices.byteLength+this._positions.byteLength+this._vertexBatchIds.byteLength,this.debugWireframe=!1,this._debugWireframe=this.debugWireframe,this._wireframeDirty=!1,this.forceRebatch=!1,this.classificationType=defaultValue(e.classificationType,ClassificationType$1.BOTH),this._vertexShaderSource=e._vertexShaderSource,this._fragmentShaderSource=e._fragmentShaderSource,this._attributeLocations=e._attributeLocations,this._uniformMap=e._uniformMap,this._pickId=e._pickId,this._modelMatrix=e._modelMatrix,this._boundingSphere=e._boundingSphere,this._batchIdLookUp={};for(var t=this._batchIds.length,i=0;i<t;++i){var r=this._batchIds[i];this._batchIdLookUp[r]=i}}Node$2.prototype.getShaderExpression=function(e,t,i){var r,n,a,o,s=this._type,l=this._value;switch(defined(this._left)&&(n=Array.isArray(this._left)?getExpressionArray(this._left,e,t,this):this._left.getShaderExpression(e,t,this)),defined(this._right)&&(a=this._right.getShaderExpression(e,t,this)),defined(this._test)&&(o=this._test.getShaderExpression(e,t,this)),Array.isArray(this._value)&&(l=getExpressionArray(this._value,e,t,this)),s){case ExpressionNodeType$1.VARIABLE:return e+l;case ExpressionNodeType$1.UNARY:if("Boolean"===l)return"bool("+n+")";if("Number"===l)return"float("+n+")";if("round"===l)return"floor("+n+" + 0.5)";if(defined(unaryFunctions[l]))return l+"("+n+")";if("isNaN"===l)return"("+n+" != "+n+")";if("isFinite"===l)return"(abs("+n+") < czm_infinity)";if("String"===l||"isExactClass"===l||"isClass"===l||"getExactClassName"===l)throw new RuntimeError('Error generating style shader: "'+l+'" is not supported.');return defined(unaryFunctions[l])?l+"("+n+")":l+n;case ExpressionNodeType$1.BINARY:return"%"===l?"mod("+n+", "+a+")":"==="===l?"("+n+" == "+a+")":"!=="===l?"("+n+" != "+a+")":"atan2"===l?"atan("+n+", "+a+")":defined(binaryFunctions[l])?l+"("+n+", "+a+")":"("+n+" "+l+" "+a+")";case ExpressionNodeType$1.TERNARY:if(defined(ternaryFunctions[l]))return l+"("+n+", "+a+", "+o+")";break;case ExpressionNodeType$1.CONDITIONAL:return"("+o+" ? "+n+" : "+a+")";case ExpressionNodeType$1.MEMBER:return"r"===a||"x"===a||"0.0"===a?n+"[0]":"g"===a||"y"===a||"1.0"===a?n+"[1]":"b"===a||"z"===a||"2.0"===a?n+"[2]":"a"===a||"w"===a||"3.0"===a?n+"[3]":n+"[int("+a+")]";case ExpressionNodeType$1.FUNCTION_CALL:throw new RuntimeError('Error generating style shader: "'+l+'" is not supported.');case ExpressionNodeType$1.ARRAY:if(4===l.length)return"vec4("+l[0]+", "+l[1]+", "+l[2]+", "+l[3]+")";if(3===l.length)return"vec3("+l[0]+", "+l[1]+", "+l[2]+")";if(2===l.length)return"vec2("+l[0]+", "+l[1]+")";throw new RuntimeError("Error generating style shader: Invalid array length. Array length should be 2, 3, or 4.");case ExpressionNodeType$1.REGEX:throw new RuntimeError("Error generating style shader: Regular expressions are not supported.");case ExpressionNodeType$1.VARIABLE_IN_STRING:throw new RuntimeError("Error generating style shader: Converting a variable to a string is not supported.");case ExpressionNodeType$1.LITERAL_NULL:return nullSentinel;case ExpressionNodeType$1.LITERAL_BOOLEAN:return l?"true":"false";case ExpressionNodeType$1.LITERAL_NUMBER:return numberToString(l);case ExpressionNodeType$1.LITERAL_STRING:if(defined(i)&&i._type===ExpressionNodeType$1.MEMBER&&("r"===l||"g"===l||"b"===l||"a"===l||"x"===l||"y"===l||"z"===l||"w"===l))return l;if(defined(r=Color.fromCssColorString(l,scratchColor$4)))return colorToVec3(r);throw new RuntimeError("Error generating style shader: String literals are not supported.");case ExpressionNodeType$1.LITERAL_COLOR:var u=n;if("color"===l){if(!defined(u))return"vec4(1.0)";if(1<u.length){var c=u[0],d=u[1];return"1.0"!==d&&(t.translucent=!0),"vec4("+c+", "+d+")"}return"vec4("+u[0]+", 1.0)"}if("rgb"===l)return defined(r=convertRGBToColor(this))?colorToVec4(r):"vec4("+u[0]+" / 255.0, "+u[1]+" / 255.0, "+u[2]+" / 255.0, 1.0)";if("rgba"===l)return"1.0"!==u[3]&&(t.translucent=!0),defined(r=convertRGBToColor(this))?colorToVec4(r):"vec4("+u[0]+" / 255.0, "+u[1]+" / 255.0, "+u[2]+" / 255.0, "+u[3]+")";if("hsl"===l)return defined(r=convertHSLToRGB(this))?colorToVec4(r):"vec4(czm_HSLToRGB(vec3("+u[0]+", "+u[1]+", "+u[2]+")), 1.0)";if("hsla"===l)return defined(r=convertHSLToRGB(this))?(1!==r.alpha&&(t.translucent=!0),colorToVec4(r)):("1.0"!==u[3]&&(t.translucent=!0),"vec4(czm_HSLToRGB(vec3("+u[0]+", "+u[1]+", "+u[2]+")), "+u[3]+")");break;case ExpressionNodeType$1.LITERAL_VECTOR:for(var h=n.length,p=l+"(",f=0;f<h;++f)p+=n[f],f<h-1&&(p+=", ");return p+=")";case ExpressionNodeType$1.LITERAL_REGEX:throw new RuntimeError("Error generating style shader: Regular expressions are not supported.");case ExpressionNodeType$1.LITERAL_UNDEFINED:return nullSentinel;case ExpressionNodeType$1.BUILTIN_VARIABLE:if("tiles3d_tileset_time"===l)return"u_time"}},Object.defineProperties(Vector3DTilePrimitive.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}}});var defaultAttributeLocations={position:0,a_batchId:1};function createVertexArray$2(e,t){if(!defined(e._va)){var i=Buffer$1.createVertexBuffer({context:t,typedArray:e._positions,usage:BufferUsage$1.STATIC_DRAW}),r=Buffer$1.createVertexBuffer({context:t,typedArray:e._vertexBatchIds,usage:BufferUsage$1.STATIC_DRAW}),n=Buffer$1.createIndexBuffer({context:t,typedArray:e._indices,usage:BufferUsage$1.DYNAMIC_DRAW,indexDatatype:2===e._indices.BYTES_PER_ELEMENT?IndexDatatype$1.UNSIGNED_SHORT:IndexDatatype$1.UNSIGNED_INT}),a=[{index:0,vertexBuffer:i,componentDatatype:ComponentDatatype$1.fromTypedArray(e._positions),componentsPerAttribute:3},{index:1,vertexBuffer:r,componentDatatype:ComponentDatatype$1.fromTypedArray(e._vertexBatchIds),componentsPerAttribute:1}];e._va=new VertexArray({context:t,attributes:a,indexBuffer:n}),t.webgl2&&(e._vaSwap=new VertexArray({context:t,attributes:a,indexBuffer:Buffer$1.createIndexBuffer({context:t,sizeInBytes:n.sizeInBytes,usage:BufferUsage$1.DYNAMIC_DRAW,indexDatatype:n.indexDatatype})})),e._batchedPositions=void 0,e._transferrableBatchIds=void 0,e._vertexBatchIds=void 0,e._verticesPromise=void 0}}function createShaders(e,t){if(!defined(e._sp)){var i=e._batchTable,r=defaultValue(e._attributeLocations,defaultAttributeLocations),n=e._pickId,a=e._vertexShaderSource,o=e._fragmentShaderSource;if(defined(a))return e._sp=ShaderProgram.fromCache({context:t,vertexShaderSource:a,fragmentShaderSource:o,attributeLocations:r}),e._spStencil=e._sp,o=(o=ShaderSource.replaceMain(o,"czm_non_pick_main"))+"void main() \n{ \n czm_non_pick_main(); \n gl_FragColor = "+n+"; \n} \n",void(e._spPick=ShaderProgram.fromCache({context:t,vertexShaderSource:a,fragmentShaderSource:o,attributeLocations:r}));var s=i.getVertexShaderCallback(!1,"a_batchId",void 0)(VectorTileVS),l=i.getFragmentShaderCallback()(ShadowVolumeFS,!1,void 0);n=i.getPickId();var u=new ShaderSource({sources:[s]}),c=new ShaderSource({defines:["VECTOR_TILE"],sources:[l]});e._sp=ShaderProgram.fromCache({context:t,vertexShaderSource:u,fragmentShaderSource:c,attributeLocations:r}),u=new ShaderSource({sources:[VectorTileVS]}),c=new ShaderSource({defines:["VECTOR_TILE"],sources:[ShadowVolumeFS]}),e._spStencil=ShaderProgram.fromCache({context:t,vertexShaderSource:u,fragmentShaderSource:c,attributeLocations:r}),l=(l=ShaderSource.replaceMain(l,"czm_non_pick_main"))+"\nvoid main() \n{ \n czm_non_pick_main(); \n gl_FragColor = "+n+"; \n} \n";var d=new ShaderSource({sources:[s]}),h=new ShaderSource({defines:["VECTOR_TILE"],sources:[l]});e._spPick=ShaderProgram.fromCache({context:t,vertexShaderSource:d,fragmentShaderSource:h,attributeLocations:r})}}function getStencilPreloadRenderState$1(e){var t=e?StencilFunction$1.EQUAL:StencilFunction$1.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:t,frontOperation:{fail:StencilOperation$1.KEEP,zFail:StencilOperation$1.DECREMENT_WRAP,zPass:StencilOperation$1.DECREMENT_WRAP},backFunction:t,backOperation:{fail:StencilOperation$1.KEEP,zFail:StencilOperation$1.INCREMENT_WRAP,zPass:StencilOperation$1.INCREMENT_WRAP},reference:StencilConstants$1.CESIUM_3D_TILE_MASK,mask:StencilConstants$1.CESIUM_3D_TILE_MASK},stencilMask:StencilConstants$1.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1}}function getStencilDepthRenderState$1(e){var t=e?StencilFunction$1.EQUAL:StencilFunction$1.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:t,frontOperation:{fail:StencilOperation$1.KEEP,zFail:StencilOperation$1.KEEP,zPass:StencilOperation$1.INCREMENT_WRAP},backFunction:t,backOperation:{fail:StencilOperation$1.KEEP,zFail:StencilOperation$1.KEEP,zPass:StencilOperation$1.DECREMENT_WRAP},reference:StencilConstants$1.CESIUM_3D_TILE_MASK,mask:StencilConstants$1.CESIUM_3D_TILE_MASK},stencilMask:StencilConstants$1.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:DepthFunction$1.LESS_OR_EQUAL},depthMask:!1}}var colorRenderState={stencilTest:{enabled:!0,frontFunction:StencilFunction$1.NOT_EQUAL,frontOperation:{fail:StencilOperation$1.KEEP,zFail:StencilOperation$1.KEEP,zPass:StencilOperation$1.DECREMENT_WRAP},backFunction:StencilFunction$1.NOT_EQUAL,backOperation:{fail:StencilOperation$1.KEEP,zFail:StencilOperation$1.KEEP,zPass:StencilOperation$1.DECREMENT_WRAP},reference:0,mask:StencilConstants$1.CLASSIFICATION_MASK},stencilMask:StencilConstants$1.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:BlendingState$1.ALPHA_BLEND},pickRenderState$1={stencilTest:{enabled:!0,frontFunction:StencilFunction$1.NOT_EQUAL,frontOperation:{fail:StencilOperation$1.KEEP,zFail:StencilOperation$1.KEEP,zPass:StencilOperation$1.DECREMENT_WRAP},backFunction:StencilFunction$1.NOT_EQUAL,backOperation:{fail:StencilOperation$1.KEEP,zFail:StencilOperation$1.KEEP,zPass:StencilOperation$1.DECREMENT_WRAP},reference:0,mask:StencilConstants$1.CLASSIFICATION_MASK},stencilMask:StencilConstants$1.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function createRenderStates$7(e){defined(e._rsStencilPreloadPass)||(e._rsStencilPreloadPass=RenderState.fromCache(getStencilPreloadRenderState$1(!1)),e._rsStencilPreloadPass3DTiles=RenderState.fromCache(getStencilPreloadRenderState$1(!0)),e._rsStencilDepthPass=RenderState.fromCache(getStencilDepthRenderState$1(!1)),e._rsStencilDepthPass3DTiles=RenderState.fromCache(getStencilDepthRenderState$1(!0)),e._rsColorPass=RenderState.fromCache(colorRenderState),e._rsPickPass=RenderState.fromCache(pickRenderState$1))}var modifiedModelViewScratch$2=new Matrix4,rtcScratch$2=new Cartesian3;function createUniformMap(i,r){if(!defined(i._uniformMap)){var e={u_modifiedModelViewProjection:function(){var e=r.uniformState.view,t=r.uniformState.projection;return Matrix4.clone(e,modifiedModelViewScratch$2),Matrix4.multiplyByPoint(modifiedModelViewScratch$2,i._center,rtcScratch$2),Matrix4.setTranslation(modifiedModelViewScratch$2,rtcScratch$2,modifiedModelViewScratch$2),Matrix4.multiply(t,modifiedModelViewScratch$2,modifiedModelViewScratch$2),modifiedModelViewScratch$2},u_highlightColor:function(){return i._highlightColor}};i._uniformMap=i._batchTable.getUniformMapCallback()(e)}}function copyIndicesCPU(e,t,i,r,n,a,o){for(var s=e.constructor.BYTES_PER_ELEMENT,l=a.length,u=0;u<l;++u){var c=o[a[u]],d=r[c],h=n[c],p=new e.constructor(e.buffer,s*d,h);t.set(p,i),r[c]=i,i+=h}return i}function rebatchCPU(e,t){var i=e._indices,r=e._indexOffsets,n=e._indexCounts,a=e._batchIdLookUp,o=new i.constructor(i.length),s=t.pop(),l=[s],u=copyIndicesCPU(i,o,0,r,n,s.batchIds,a);for(s.offset=0,s.count=u;0<t.length;){var c=t.pop();if(Color.equals(c.color,s.color))u=copyIndicesCPU(i,o,u,r,n,c.batchIds,a),s.batchIds=s.batchIds.concat(c.batchIds),s.count=u-s.offset;else{var d=u;u=copyIndicesCPU(i,o,u,r,n,c.batchIds,a),c.offset=d,c.count=u-d,l.push(c),s=c}}e._va.indexBuffer.copyFromArrayView(o),e._indices=o,e._batchedIndices=l}function copyIndicesGPU(e,t,i,r,n,a,o){for(var s=e.bytesPerIndex,l=a.length,u=0;u<l;++u){var c=o[a[u]],d=r[c],h=n[c];t.copyFromBuffer(e,d*s,i*s,h*s),r[c]=i,i+=h}return i}function rebatchGPU(e,t){var i=e._indexOffsets,r=e._indexCounts,n=e._batchIdLookUp,a=t.pop(),o=[a],s=e._va.indexBuffer,l=e._vaSwap.indexBuffer,u=copyIndicesGPU(s,l,0,i,r,a.batchIds,n);for(a.offset=0,a.count=u;0<t.length;){var c=t.pop();if(Color.equals(c.color,a.color))u=copyIndicesGPU(s,l,u,i,r,c.batchIds,n),a.batchIds=a.batchIds.concat(c.batchIds),a.count=u-a.offset;else{var d=u;u=copyIndicesGPU(s,l,u,i,r,c.batchIds,n),c.offset=d,c.count=u-d,o.push(c),a=c}}var h=e._va;e._va=e._vaSwap,e._vaSwap=h,e._batchedIndices=o}function compareColors(e,t){return t.color.toRgba()-e.color.toRgba()}function rebatchCommands(e,t){if(!e._batchDirty)return!1;for(var i=e._batchedIndices,r=i.length,n=!1,a={},o=0;o<r;++o){var s=i[o].color.toRgba();if(defined(a[s])){n=!0;break}a[s]=!0}return n?n&&!e.forceRebatch&&e._framesSinceLastRebatch<120?void++e._framesSinceLastRebatch:(i.sort(compareColors),t.webgl2?rebatchGPU(e,i):rebatchCPU(e,i),e._framesSinceLastRebatch=0,e._batchDirty=!1,e._pickCommandsDirty=!0,e._wireframeDirty=!0):e._batchDirty=!1}function createColorCommands$1(e,t){var i=rebatchCommands(e,t),r=e._commands,n=e._batchedIndices,a=n.length,o=3*a;if(!defined(r)||i||r.length!==o){r.length=o;for(var s=e._va,l=e._sp,u=defaultValue(e._modelMatrix,Matrix4.IDENTITY),c=e._uniformMap,d=e._boundingVolume,h=0;h<a;++h){var p=n[h].offset,f=n[h].count,m=r[3*h];defined(m)||(m=r[3*h]=new DrawCommand({owner:e})),m.vertexArray=s,m.modelMatrix=u,m.offset=p,m.count=f,m.renderState=e._rsStencilPreloadPass,m.shaderProgram=l,m.uniformMap=c,m.boundingVolume=d,m.cull=!1,m.pass=Pass$1.TERRAIN_CLASSIFICATION;var g=DrawCommand.shallowClone(m,m.derivedCommands.tileset);g.renderState=e._rsStencilPreloadPass3DTiles,g.pass=Pass$1.CESIUM_3D_TILE_CLASSIFICATION,m.derivedCommands.tileset=g;var y=r[3*h+1];defined(y)||(y=r[3*h+1]=new DrawCommand({owner:e})),y.vertexArray=s,y.modelMatrix=u,y.offset=p,y.count=f,y.renderState=e._rsStencilDepthPass,y.shaderProgram=l,y.uniformMap=c,y.boundingVolume=d,y.cull=!1,y.pass=Pass$1.TERRAIN_CLASSIFICATION;var v=DrawCommand.shallowClone(y,y.derivedCommands.tileset);v.renderState=e._rsStencilDepthPass3DTiles,v.pass=Pass$1.CESIUM_3D_TILE_CLASSIFICATION,y.derivedCommands.tileset=v;var _=r[3*h+2];defined(_)||(_=r[3*h+2]=new DrawCommand({owner:e})),_.vertexArray=s,_.modelMatrix=u,_.offset=p,_.count=f,_.renderState=e._rsColorPass,_.shaderProgram=l,_.uniformMap=c,_.boundingVolume=d,_.cull=!1,_.pass=Pass$1.TERRAIN_CLASSIFICATION;var C=DrawCommand.shallowClone(_,_.derivedCommands.tileset);C.pass=Pass$1.CESIUM_3D_TILE_CLASSIFICATION,_.derivedCommands.tileset=C}e._commandsDirty=!0}}function createColorCommandsIgnoreShow(e,t){if(e.classificationType!==ClassificationType$1.TERRAIN&&t.invertClassification&&(!defined(e._commandsIgnoreShow)||e._commandsDirty)){for(var i=e._commands,r=e._commandsIgnoreShow,n=e._spStencil,a=i.length,o=r.length=a/3*2,s=0,l=0;l<o;l+=2){var u=r[l]=DrawCommand.shallowClone(i[s],r[l]);u.shaderProgram=n,u.pass=Pass$1.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,(u=r[l+1]=DrawCommand.shallowClone(i[s+1],r[l+1])).shaderProgram=n,u.pass=Pass$1.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,s+=3}e._commandsDirty=!1}}function createPickCommands$1(e){if(e._pickCommandsDirty){var t=e._indexOffsets.length,i=e._pickCommands;i.length=3*t;for(var r=e._va,n=e._spStencil,a=e._spPick,o=defaultValue(e._modelMatrix,Matrix4.IDENTITY),s=e._uniformMap,l=0;l<t;++l){var u=e._indexOffsets[l],c=e._indexCounts[l],d=defined(e._boundingVolumes)?e._boundingVolumes[l]:e.boundingVolume,h=i[3*l];defined(h)||(h=i[3*l]=new DrawCommand({owner:e,pickOnly:!0})),h.vertexArray=r,h.modelMatrix=o,h.offset=u,h.count=c,h.renderState=e._rsStencilPreloadPass,h.shaderProgram=n,h.uniformMap=s,h.boundingVolume=d,h.pass=Pass$1.TERRAIN_CLASSIFICATION;var p=DrawCommand.shallowClone(h,h.derivedCommands.tileset);p.renderState=e._rsStencilPreloadPass3DTiles,p.pass=Pass$1.CESIUM_3D_TILE_CLASSIFICATION,h.derivedCommands.tileset=p;var f=i[3*l+1];defined(f)||(f=i[3*l+1]=new DrawCommand({owner:e,pickOnly:!0})),f.vertexArray=r,f.modelMatrix=o,f.offset=u,f.count=c,f.renderState=e._rsStencilDepthPass,f.shaderProgram=n,f.uniformMap=s,f.boundingVolume=d,f.pass=Pass$1.TERRAIN_CLASSIFICATION;var m=DrawCommand.shallowClone(f,f.derivedCommands.tileset);m.renderState=e._rsStencilDepthPass3DTiles,m.pass=Pass$1.CESIUM_3D_TILE_CLASSIFICATION,f.derivedCommands.tileset=m;var g=i[3*l+2];defined(g)||(g=i[3*l+2]=new DrawCommand({owner:e,pickOnly:!0})),g.vertexArray=r,g.modelMatrix=o,g.offset=u,g.count=c,g.renderState=e._rsPickPass,g.shaderProgram=a,g.uniformMap=s,g.boundingVolume=d,g.pass=Pass$1.TERRAIN_CLASSIFICATION;var y=DrawCommand.shallowClone(g,g.derivedCommands.tileset);y.pass=Pass$1.CESIUM_3D_TILE_CLASSIFICATION,g.derivedCommands.tileset=y}e._pickCommandsDirty=!1}}function clearStyle(e,t){e._updatingAllCommands=!0;var i,r=e._batchIds,n=r.length;for(i=0;i<n;++i){var a=t[r[i]];a.show=!0,a.color=Color.WHITE}var o=e._batchedIndices;for(n=o.length,i=0;i<n;++i)o[i].color=Color.clone(Color.WHITE);e._updatingAllCommands=!1,e._batchDirty=!0}Vector3DTilePrimitive.prototype.createFeatures=function(e,t){for(var i=this._batchIds,r=i.length,n=0;n<r;++n){var a=i[n];t[a]=new Cesium3DTileFeature(e,a)}},Vector3DTilePrimitive.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};var scratchColor$5=new Color,DEFAULT_COLOR_VALUE$1=Color.WHITE,DEFAULT_SHOW_VALUE$1=!0,complexExpressionReg=/\$/;function queueCommands(e,t,i,r){var n,a,o=e.classificationType,s=o!==ClassificationType$1.CESIUM_3D_TILE,l=o!==ClassificationType$1.TERRAIN,u=t.commandList,c=i.length;for(a=0;a<c;++a)s&&((n=i[a]).pass=Pass$1.TERRAIN_CLASSIFICATION,u.push(n)),l&&((n=i[a].derivedCommands.tileset).pass=Pass$1.CESIUM_3D_TILE_CLASSIFICATION,u.push(n));if(t.invertClassification&&defined(r))for(c=r.length,a=0;a<c;++a)u.push(r[a])}function queueWireframeCommands(e,t){for(var i=e.commandList,r=t.length,n=0;n<r;n+=3){var a=t[n+2];a.pass=Pass$1.OPAQUE,i.push(a)}}function updateWireframe(e){var t=e.debugWireframe===e._debugWireframe;if(!(t=t&&!(e.debugWireframe&&e._wireframeDirty))){var i,r;defined(e._rsWireframe)||(e._rsWireframe=RenderState.fromCache({})),r=e.debugWireframe?(i=e._rsWireframe,PrimitiveType$1.LINES):(i=e._rsColorPass,PrimitiveType$1.TRIANGLES);for(var n=e._commands,a=n.length,o=0;o<a;o+=3){var s=n[o+2];s.renderState=i,s.primitiveType=r}e._debugWireframe=e.debugWireframe,e._wireframeDirty=!1}}Vector3DTilePrimitive.prototype.applyStyle=function(e,t){if(defined(e)){var i=e.color,r=i instanceof Expression&&!complexExpressionReg.test(i.expression);this._updatingAllCommands=r;var n,a=this._batchIds,o=a.length;for(n=0;n<o;++n){var s=t[a[n]];s.color=defined(e.color)?e.color.evaluateColor(s,scratchColor$5):DEFAULT_COLOR_VALUE$1,s.show=defined(e.show)?e.show.evaluate(s):DEFAULT_SHOW_VALUE$1}if(r){var l=this._batchedIndices;for(o=l.length,n=0;n<o;++n)l[n].color=Color.clone(Color.WHITE);this._updatingAllCommands=!1,this._batchDirty=!0}}else clearStyle(this,t)},Vector3DTilePrimitive.prototype.updateCommands=function(e,t){if(!this._updatingAllCommands){var i=this._batchIdLookUp,r=i[e];if(defined(r)){var n,a=this._indexOffsets,o=this._indexCounts,s=a[r],l=o[r],u=this._batchedIndices,c=u.length;for(n=0;n<c;++n){var d=u[n].offset,h=u[n].count;if(d<=s&&s<d+h)break}u.push(new Vector3DTileBatch({color:Color.clone(t),offset:s,count:l,batchIds:[e]}));for(var p=[],f=[],m=u[n].batchIds,g=m.length,y=0;y<g;++y){var v=m[y];if(v!==e)a[i[v]]<s?p.push(v):f.push(v)}0!==f.length&&u.push(new Vector3DTileBatch({color:Color.clone(u[n].color),offset:s+l,count:u[n].offset+u[n].count-(s+l),batchIds:f})),0!==p.length?(u[n].count=s-u[n].offset,u[n].batchIds=p):u.splice(n,1),this._batchDirty=!0}}},Vector3DTilePrimitive.prototype.update=function(e){var t=e.context;createVertexArray$2(this,t),createShaders(this,t),createRenderStates$7(this),createUniformMap(this,t);var i=e.passes;i.render&&(createColorCommands$1(this,t),createColorCommandsIgnoreShow(this,e),updateWireframe(this),this._debugWireframe?queueWireframeCommands(e,this._commands):queueCommands(this,e,this._commands,this._commandsIgnoreShow)),i.pick&&(createPickCommands$1(this),queueCommands(this,e,this._pickCommands))},Vector3DTilePrimitive.prototype.isDestroyed=function(){return!1},Vector3DTilePrimitive.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._vaSwap=this._vaSwap&&this._vaSwap.destroy(),destroyObject(this)};var boundingSphereCartesian3Scratch=new Cartesian3,ModelState=ModelUtility.ModelState;function ClassificationModel(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).gltf;if(t instanceof ArrayBuffer&&(t=new Uint8Array(t)),!(t instanceof Uint8Array))throw new RuntimeError("Only binary glTF is supported as a classifier.");updateVersion(t=parseGlb(t)),addDefaults(t),processModelMaterialsCommon(t),processPbrMaterials(t),ForEach.buffer(t,function(e){if(!defined(e.extras._pipeline.source))throw new RuntimeError("Buffer data must be embedded in the binary gltf.")});var i=t.nodes,r=t.meshes,n=i[0].mesh;if(1!==i.length||!defined(n))throw new RuntimeError("Only one node is supported for classification and it must have a mesh.");if(1!==r.length)throw new RuntimeError("Only one mesh is supported when using b3dm for classification.");var a=r[0].primitives;if(1!==a.length)throw new RuntimeError("Only one primitive per mesh is supported when using b3dm for classification.");if(!defined(a[0].attributes.POSITION))throw new RuntimeError("The mesh must have a position attribute.");if(!defined(a[0].attributes._BATCHID))throw new RuntimeError("The mesh must have a batch id attribute.");this._gltf=t,this.show=defaultValue(e.show,!0),this.modelMatrix=Matrix4.clone(defaultValue(e.modelMatrix,Matrix4.IDENTITY)),this._modelMatrix=Matrix4.clone(this.modelMatrix),this._ready=!1,this._readyPromise=when.defer(),this.debugShowBoundingVolume=defaultValue(e.debugShowBoundingVolume,!1),this._debugShowBoundingVolume=!1,this.debugWireframe=defaultValue(e.debugWireframe,!1),this._debugWireframe=!1,this._classificationType=e.classificationType,this._vertexShaderLoaded=e.vertexShaderLoaded,this._classificationShaderLoaded=e.classificationShaderLoaded,this._uniformMapLoaded=e.uniformMapLoaded,this._pickIdLoaded=e.pickIdLoaded,this._ignoreCommands=defaultValue(e.ignoreCommands,!1),this._upAxis=defaultValue(e.upAxis,Axis$1.Y),this._batchTable=e.batchTable,this._computedModelMatrix=new Matrix4,this._initialRadius=void 0,this._boundingSphere=void 0,this._scaledBoundingSphere=new BoundingSphere,this._state=ModelState.NEEDS_LOAD,this._loadResources=void 0,this._mode=void 0,this._dirty=!1,this._nodeMatrix=new Matrix4,this._primitive=void 0,this._extensionsUsed=void 0,this._extensionsRequired=void 0,this._quantizedUniforms=void 0,this._buffers={},this._vertexArray=void 0,this._shaderProgram=void 0,this._uniformMap=void 0,this._geometryByteLength=0,this._trianglesLength=0,this._rtcCenter=void 0,this._rtcCenterEye=void 0,this._rtcCenter3D=void 0,this._rtcCenter2D=void 0}function addBuffersToLoadResources(e){var t=e.gltf,i=e._loadResources;ForEach.buffer(t,function(e,t){i.buffers[t]=e.extras._pipeline.source})}function parseBufferViews(e){var i=e.gltf.bufferViews,r=e._loadResources.vertexBuffersToCreate;ForEach.bufferView(e.gltf,function(e,t){e.target===WebGLConstants$1.ARRAY_BUFFER&&r.enqueue(t)});var n=e._loadResources.indexBuffersToCreate,a={};ForEach.accessor(e.gltf,function(e){var t=e.bufferView;i[t].target!==WebGLConstants$1.ELEMENT_ARRAY_BUFFER||defined(a[t])||(a[t]=!0,n.enqueue({id:t,componentType:e.componentType}))})}function createVertexBuffer(e,t){var i=t._loadResources,r=t.gltf.bufferViews[e],n=i.getBuffer(r);t._buffers[e]=n,t._geometryByteLength+=n.byteLength}function createIndexBuffer(e,t,i){var r=i._loadResources,n=i.gltf.bufferViews[e],a={typedArray:r.getBuffer(n),indexDatatype:t};i._buffers[e]=a,i._geometryByteLength+=a.typedArray.byteLength}function createBuffers(e){var t=e._loadResources;if(0===t.pendingBufferLoads){for(var i=t.vertexBuffersToCreate,r=t.indexBuffersToCreate;0<i.length;)createVertexBuffer(i.dequeue(),e);for(;0<r.length;){var n=r.dequeue();createIndexBuffer(n.id,n.componentType,e)}}}function modifyShaderForQuantizedAttributes(e,t){var i=t.gltf.meshes[0].primitives[0],r=ModelUtility.modifyShaderForQuantizedAttributes(t.gltf,i,e);return t._quantizedUniforms=r.uniforms,r.shader}function modifyShader(e,t){return defined(t)&&(e=t(e)),e}function createProgram(e){var t=e.gltf,i=ModelUtility.getAttributeOrUniformBySemantic(t,"POSITION"),r=ModelUtility.getAttributeOrUniformBySemantic(t,"_BATCHID"),n={};n[i]=0,n[r]=1;var a,o,s=ModelUtility.getAttributeOrUniformBySemantic(t,"MODELVIEWPROJECTION");if(defined(s))a="uniform mat4 "+s+";\n",o=s+" * vec4("+i+", 1.0)";else{var l=ModelUtility.getAttributeOrUniformBySemantic(t,"PROJECTION"),u=ModelUtility.getAttributeOrUniformBySemantic(t,"MODELVIEW");defined(u)||(u=ModelUtility.getAttributeOrUniformBySemantic(t,"CESIUM_RTC_MODELVIEW")),a="uniform mat4 "+u+";\nuniform mat4 "+l+";\n",o=l+" * "+u+" * vec4("+i+", 1.0)"}var c="attribute vec3 "+i+";\nattribute float "+r+";\n"+a+"void main() {\n"+(" vec4 positionInClipCoords = "+o+";\n")+" gl_Position = czm_depthClampFarPlane(positionInClipCoords);\n}\n";e.extensionsUsed.WEB3D_quantized_attributes&&(c=modifyShaderForQuantizedAttributes(c,e));var d=modifyShader(c,e._vertexShaderLoaded),h=modifyShader("#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n#endif\nvoid main() \n{ \n gl_FragColor = vec4(1.0); \n czm_writeDepthClampedToFarPlane();\n}\n",e._classificationShaderLoaded);d=ModelUtility.modifyVertexShaderForLogDepth(d,o),h=ModelUtility.modifyFragmentShaderForLogDepth(h),e._shaderProgram={vertexShaderSource:d,fragmentShaderSource:h,attributeLocations:n}}function getAttributeLocations(){return{POSITION:0,_BATCHID:1}}function createVertexArray$3(e){if(e._loadResources.finishedBuffersCreation()&&!defined(e._vertexArray)){var t,n=e._buffers,a=e.gltf,o=a.accessors,i=a.meshes[0].primitives[0],s=getAttributeLocations(),l={};if(ForEach.meshPrimitiveAttribute(i,function(e,t){var i=s[t];if(defined(i)){var r=o[e];l[t]={index:i,vertexBuffer:n[r.bufferView],componentsPerAttribute:numberOfComponentsForType(r.type),componentDatatype:r.componentType,offsetInBytes:r.byteOffset,strideInBytes:getAccessorByteStride(a,r)}}}),defined(i.indices)){var r=o[i.indices];t=n[r.bufferView]}e._vertexArray={attributes:l,indexBuffer:t}}}Object.defineProperties(ClassificationModel.prototype,{gltf:{get:function(){return this._gltf}},boundingSphere:{get:function(){var e=this.modelMatrix,t=Matrix4.getScale(e,boundingSphereCartesian3Scratch),i=this._scaledBoundingSphere;return i.center=Cartesian3.multiplyComponents(this._boundingSphere.center,t,i.center),i.radius=Cartesian3.maximumComponent(t)*this._initialRadius,defined(this._rtcCenter)&&Cartesian3.add(this._rtcCenter,i.center,i.center),i}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},dirty:{get:function(){return this._dirty}},extensionsUsed:{get:function(){return defined(this._extensionsUsed)||(this._extensionsUsed=ModelUtility.getUsedExtensions(this.gltf)),this._extensionsUsed}},extensionsRequired:{get:function(){return defined(this._extensionsRequired)||(this._extensionsRequired=ModelUtility.getRequiredExtensions(this.gltf)),this._extensionsRequired}},upAxis:{get:function(){return this._upAxis}},trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},texturesByteLength:{get:function(){return 0}},classificationType:{get:function(){return this._classificationType}}});var gltfSemanticUniforms$1={PROJECTION:function(e,t){return ModelUtility.getGltfSemanticUniforms().PROJECTION(e,t)},MODELVIEW:function(e,t){return ModelUtility.getGltfSemanticUniforms().MODELVIEW(e,t)},CESIUM_RTC_MODELVIEW:function(e,t){return ModelUtility.getGltfSemanticUniforms().CESIUM_RTC_MODELVIEW(e,t)},MODELVIEWPROJECTION:function(e,t){return ModelUtility.getGltfSemanticUniforms().MODELVIEWPROJECTION(e,t)}};function createUniformMap$1(i,r){if(!defined(i._uniformMap)){var n={};ForEach.technique(i.gltf,function(e){ForEach.techniqueUniform(e,function(e,t){defined(e.semantic)&&defined(gltfSemanticUniforms$1[e.semantic])&&(n[t]=gltfSemanticUniforms$1[e.semantic](r.uniformState,i))})}),i._uniformMap=n}}function createUniformsForQuantizedAttributes(e,t){return ModelUtility.createUniformsForQuantizedAttributes(e.gltf,t,e._quantizedUniforms)}function triangleCountFromPrimitiveIndices(e,t){switch(e.mode){case PrimitiveType$1.TRIANGLES:return t/3;case PrimitiveType$1.TRIANGLE_STRIP:case PrimitiveType$1.TRIANGLE_FAN:return Math.max(t-2,0);default:return 0}}function createPrimitive(e){var t,i,r=e._batchTable,n=e._uniformMap,a=e._vertexArray,o=e.gltf,s=o.accessors,l=o.meshes[0].primitives[0],u=s[l.indices],c=l.attributes.POSITION,d=ModelUtility.getAccessorMinMax(o,c),h=BoundingSphere.fromCornerPoints(Cartesian3.fromArray(d.min),Cartesian3.fromArray(d.max));defined(u)?(i=u.count,t=u.byteOffset/IndexDatatype$1.getSizeInBytes(u.componentType)):(i=s[l.attributes.POSITION].count,t=0);e._trianglesLength+=triangleCountFromPrimitiveIndices(l,i),defined(e._uniformMapLoaded)&&(n=e._uniformMapLoaded(n)),e.extensionsUsed.WEB3D_quantized_attributes&&(n=combine(n,createUniformsForQuantizedAttributes(e,l)));var p=a.attributes.POSITION,f=p.componentDatatype,m=p.vertexBuffer,g=m.byteOffset,y=m.byteLength/ComponentDatatype$1.getSizeInBytes(f),v=ComponentDatatype$1.createArrayBufferView(f,m.buffer,g,y);f=(p=a.attributes._BATCHID).componentDatatype,g=(m=p.vertexBuffer).byteOffset,y=m.byteLength/ComponentDatatype$1.getSizeInBytes(f);var _,C=ComponentDatatype$1.createArrayBufferView(f,m.buffer,g,y),x=a.indexBuffer.typedArray;_=a.indexBuffer.indexDatatype===IndexDatatype$1.UNSIGNED_SHORT?new Uint16Array(x.buffer,x.byteOffset,x.byteLength/Uint16Array.BYTES_PER_ELEMENT):new Uint32Array(x.buffer,x.byteOffset,x.byteLength/Uint32Array.BYTES_PER_ELEMENT),v=arraySlice(v);var b,A,S,w=[],E=[],T=[],P=[],M=(C=arraySlice(C))[(_=arraySlice(_,t,t+i))[0]];w.push(M),T.push(0);for(var D=_.length,I=1;I<D;++I)(b=C[_[I]])!==M&&(S=I-(A=T[T.length-1]),w.push(b),E.push(S),T.push(I),P.push(new Vector3DTileBatch({offset:A,count:S,batchIds:[M],color:Color.WHITE})),M=b);S=D-(A=T[T.length-1]),E.push(S),P.push(new Vector3DTileBatch({offset:A,count:S,batchIds:[M],color:Color.WHITE}));var O=e._shaderProgram,R=O.vertexShaderSource,L=O.fragmentShaderSource,N=O.attributeLocations,k=defined(e._pickIdLoaded)?e._pickIdLoaded():void 0;e._primitive=new Vector3DTilePrimitive({classificationType:e._classificationType,positions:v,indices:_,indexOffsets:T,indexCounts:E,batchIds:w,vertexBatchIds:C,batchedIndices:P,batchTable:r,boundingVolume:new BoundingSphere,_vertexShaderSource:R,_fragmentShaderSource:L,_attributeLocations:N,_uniformMap:n,_pickId:k,_modelMatrix:new Matrix4,_boundingSphere:h}),e._buffers=void 0,e._vertexArray=void 0,e._shaderProgram=void 0,e._uniformMap=void 0}function createRuntimeNodes(e){if(e._loadResources.finished()&&!defined(e._primitive)){var t=e.gltf.nodes[0];e._nodeMatrix=ModelUtility.getTransform(t,e._nodeMatrix),createPrimitive(e)}}function createResources(e,t){var i=t.context;ModelUtility.checkSupportedGlExtensions(e.gltf.glExtensionsUsed,i),createBuffers(e),createProgram(e),createVertexArray$3(e),createUniformMap$1(e,i),createRuntimeNodes(e)}var scratchComputedTranslation=new Cartesian4,scratchComputedMatrixIn2D=new Matrix4;function updateNodeModelMatrix(e,t,i,r){var n=e._computedModelMatrix;if(e._mode!==SceneMode$1.SCENE3D&&!e._ignoreCommands){var a=Matrix4.getColumn(n,3,scratchComputedTranslation);if(Cartesian4.equals(a,Cartesian4.UNIT_W)){var o=e.boundingSphere.center,s=Transforms.wgs84To2DModelMatrix(r,o,scratchComputedMatrixIn2D);n=Matrix4.multiply(s,n,scratchComputedMatrixIn2D),defined(e._rtcCenter)&&(Matrix4.setTranslation(n,Cartesian4.UNIT_W,n),e._rtcCenter=e._rtcCenter2D)}else n=Transforms.basisTo2D(r,n,scratchComputedMatrixIn2D),e._rtcCenter=e._rtcCenter3D}var l=e._primitive;(t||i)&&(Matrix4.multiplyTransformation(n,e._nodeMatrix,l._modelMatrix),BoundingSphere.transform(l._boundingSphere,l._modelMatrix,l._boundingVolume),defined(e._rtcCenter)&&Cartesian3.add(e._rtcCenter,l._boundingVolume.center,l._boundingVolume.center))}function ClippingPlane(e,t){this._distance=t,this._normal=new UpdateChangedCartesian3(e,this),this.onChangeCallback=void 0,this.index=-1}function UpdateChangedCartesian3(e,t){this._clippingPlane=t,this._cartesian3=Cartesian3.clone(e)}function ClippingPlaneCollection(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this._planes=[],this._dirtyIndex=-1,this._multipleDirtyPlanes=!1,this._enabled=defaultValue(e.enabled,!0),this.modelMatrix=Matrix4.clone(defaultValue(e.modelMatrix,Matrix4.IDENTITY)),this.edgeColor=Color.clone(defaultValue(e.edgeColor,Color.WHITE)),this.edgeWidth=defaultValue(e.edgeWidth,0),this.planeAdded=new Event,this.planeRemoved=new Event,this._owner=void 0;var t=defaultValue(e.unionClippingRegions,!1);this._unionClippingRegions=t,this._testIntersection=t?unionIntersectFunction:defaultIntersectFunction,this._uint8View=void 0,this._float32View=void 0,this._clippingPlanesTexture=void 0;var i=e.planes;if(defined(i))for(var r=i.length,n=0;n<r;++n)this.add(i[n])}function unionIntersectFunction(e){return e===Intersect$1.OUTSIDE}function defaultIntersectFunction(e){return e===Intersect$1.INSIDE}function setIndexDirty(e,t){e._multipleDirtyPlanes=e._multipleDirtyPlanes||-1!==e._dirtyIndex&&e._dirtyIndex!==t,e._dirtyIndex=t}function indexOf(e,t){for(var i=e.length,r=0;r<i;++r)if(Plane.equals(e[r],t))return r;return-1}ClassificationModel.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)},ClassificationModel.prototype.update=function(e){if(e.mode!==SceneMode$1.MORPHING)if(FeatureDetection$1.supportsWebP.initialized){var t=FeatureDetection$1.supportsWebP();if(this._state===ModelState.NEEDS_LOAD&&defined(this.gltf)&&(this._state=ModelState.LOADING,this._state!==ModelState.FAILED)){var i=this.gltf.extensions;if(defined(i)&&defined(i.CESIUM_RTC)){var r=Cartesian3.fromArray(i.CESIUM_RTC.center);if(!Cartesian3.equals(r,Cartesian3.ZERO)){this._rtcCenter3D=r;var n=e.mapProjection,a=n.ellipsoid.cartesianToCartographic(this._rtcCenter3D),o=n.project(a);Cartesian3.fromElements(o.z,o.x,o.y,o),this._rtcCenter2D=o,this._rtcCenterEye=new Cartesian3,this._rtcCenter=this._rtcCenter3D}}this._loadResources=new ModelLoadResources,ModelUtility.parseBuffers(this)}var s=this._loadResources,l=!1;this._state===ModelState.LOADING&&(0===s.pendingBufferLoads&&(ModelUtility.checkSupportedExtensions(this.extensionsRequired,t),addBuffersToLoadResources(this),parseBufferViews(this),this._boundingSphere=ModelUtility.computeBoundingSphere(this),this._initialRadius=this._boundingSphere.radius,createResources(this,e)),s.finished()&&(this._state=ModelState.LOADED,l=!0)),defined(s)&&this._state===ModelState.LOADED&&(l||createResources(this,e),s.finished()&&(this._loadResources=void 0));var u=this.show;if(u&&this._state===ModelState.LOADED||l){this._dirty=!1;var c=this.modelMatrix,d=e.mode!==this._mode;this._mode=e.mode;var h=!Matrix4.equals(this._modelMatrix,c)||d;if(h||l){Matrix4.clone(c,this._modelMatrix);var p=this._computedModelMatrix;Matrix4.clone(c,p),this._upAxis===Axis$1.Y?Matrix4.multiplyTransformation(p,Axis$1.Y_UP_TO_Z_UP,p):this._upAxis===Axis$1.X&&Matrix4.multiplyTransformation(p,Axis$1.X_UP_TO_Z_UP,p)}(h||l)&&(updateNodeModelMatrix(this,h,l,e.mapProjection),this._dirty=!0)}if(l){var f=this;e.afterRender.push(function(){f._ready=!0,f._readyPromise.resolve(f)})}else u&&!this._ignoreCommands&&(this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.debugWireframe=this.debugWireframe,this._primitive.update(e))}else FeatureDetection$1.supportsWebP.initialize()},ClassificationModel.prototype.isDestroyed=function(){return!1},ClassificationModel.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),destroyObject(this)},Object.defineProperties(ClippingPlane.prototype,{distance:{get:function(){return this._distance},set:function(e){defined(this.onChangeCallback)&&e!==this._distance&&this.onChangeCallback(this.index),this._distance=e}},normal:{get:function(){return this._normal},set:function(e){defined(this.onChangeCallback)&&!Cartesian3.equals(this._normal._cartesian3,e)&&this.onChangeCallback(this.index),Cartesian3.clone(e,this._normal._cartesian3)}}}),ClippingPlane.fromPlane=function(e,t){return defined(t)?(t.normal=e.normal,t.distance=e.distance):t=new ClippingPlane(e.normal,e.distance),t},ClippingPlane.clone=function(e,t){return defined(t)?(t.normal=e.normal,t.distance=e.distance,t):new ClippingPlane(e.normal,e.distance)},Object.defineProperties(UpdateChangedCartesian3.prototype,{x:{get:function(){return this._cartesian3.x},set:function(e){defined(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.x&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.x=e}},y:{get:function(){return this._cartesian3.y},set:function(e){defined(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.y&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.y=e}},z:{get:function(){return this._cartesian3.z},set:function(e){defined(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.z&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.z=e}}}),Object.defineProperties(ClippingPlaneCollection.prototype,{length:{get:function(){return this._planes.length}},unionClippingRegions:{get:function(){return this._unionClippingRegions},set:function(e){this._unionClippingRegions!==e&&(this._unionClippingRegions=e,this._testIntersection=e?unionIntersectFunction:defaultIntersectFunction)}},enabled:{get:function(){return this._enabled},set:function(e){this._enabled!==e&&(this._enabled=e)}},texture:{get:function(){return this._clippingPlanesTexture}},owner:{get:function(){return this._owner}},clippingPlanesState:{get:function(){return this._unionClippingRegions?this._planes.length:-this._planes.length}}}),ClippingPlaneCollection.prototype.add=function(e){var t=this._planes.length,i=this;e.onChangeCallback=function(e){setIndexDirty(i,e)},setIndexDirty(this,e.index=t),this._planes.push(e),this.planeAdded.raiseEvent(e,t)},ClippingPlaneCollection.prototype.get=function(e){return this._planes[e]},ClippingPlaneCollection.prototype.contains=function(e){return-1!==indexOf(this._planes,e)},ClippingPlaneCollection.prototype.remove=function(e){var t=this._planes,i=indexOf(t,e);if(-1===i)return!1;e instanceof ClippingPlane&&(e.onChangeCallback=void 0,e.index=-1);for(var r=t.length-1,n=i;n<r;++n){var a=t[n+1];(t[n]=a)instanceof ClippingPlane&&(a.index=n)}return this._multipleDirtyPlanes=!0,t.length=r,this.planeRemoved.raiseEvent(e,i),!0},ClippingPlaneCollection.prototype.removeAll=function(){for(var e=this._planes,t=e.length,i=0;i<t;++i){var r=e[i];r instanceof ClippingPlane&&(r.onChangeCallback=void 0,r.index=-1),this.planeRemoved.raiseEvent(r,i)}this._multipleDirtyPlanes=!0,this._planes=[]};var distanceEncodeScratch=new Cartesian4,oct32EncodeScratch=new Cartesian4;function packPlanesAsUint8(e,t,i){for(var r=e._uint8View,n=e._planes,a=0,o=t;o<i;++o){var s=n[o],l=AttributeCompression.octEncodeToCartesian4(s.normal,oct32EncodeScratch);r[a]=l.x,r[a+1]=l.y,r[a+2]=l.z,r[a+3]=l.w;var u=Cartesian4.packFloat(s.distance,distanceEncodeScratch);r[a+4]=u.x,r[a+5]=u.y,r[a+6]=u.z,r[a+7]=u.w,a+=8}}function packPlanesAsFloats(e,t,i){for(var r=e._float32View,n=e._planes,a=0,o=t;o<i;++o){var s=n[o],l=s.normal;r[a]=l.x,r[a+1]=l.y,r[a+2]=l.z,r[a+3]=s.distance,a+=4}}function computeTextureResolution(e,t){var i=ContextLimits.maximumTextureSize;return t.x=Math.min(e,i),t.y=Math.ceil(e/t.x),t}var textureResolutionScratch=new Cartesian2;ClippingPlaneCollection.prototype.update=function(e){var t=this._clippingPlanesTexture,i=e.context,r=ClippingPlaneCollection.useFloatTexture(i),n=r?this.length:2*this.length;if(defined(t)){var a=t.width*t.height;(a<n||n<.25*a)&&(t.destroy(),t=void 0,this._clippingPlanesTexture=void 0)}if(0!==this.length){if(!defined(t)){var o=computeTextureResolution(n,textureResolutionScratch);o.y*=2,r?(t=new Texture({context:i,width:o.x,height:o.y,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:PixelDatatype$1.FLOAT,sampler:Sampler.NEAREST,flipY:!1}),this._float32View=new Float32Array(o.x*o.y*4)):(t=new Texture({context:i,width:o.x,height:o.y,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:PixelDatatype$1.UNSIGNED_BYTE,sampler:Sampler.NEAREST,flipY:!1}),this._uint8View=new Uint8Array(o.x*o.y*4)),this._clippingPlanesTexture=t,this._multipleDirtyPlanes=!0}var s=this._dirtyIndex;if(this._multipleDirtyPlanes||-1!==s){if(this._multipleDirtyPlanes)r?(packPlanesAsFloats(this,0,this._planes.length),t.copyFrom({width:t.width,height:t.height,arrayBufferView:this._float32View})):(packPlanesAsUint8(this,0,this._planes.length),t.copyFrom({width:t.width,height:t.height,arrayBufferView:this._uint8View}));else{var l=0,u=0;r?(u=Math.floor(s/t.width),l=Math.floor(s-u*t.width),packPlanesAsFloats(this,s,s+1),t.copyFrom({width:1,height:1,arrayBufferView:this._float32View},l,u)):(u=Math.floor(2*s/t.width),l=Math.floor(2*s-u*t.width),packPlanesAsUint8(this,s,s+1),t.copyFrom({width:2,height:1,arrayBufferView:this._uint8View},l,u))}this._multipleDirtyPlanes=!1,this._dirtyIndex=-1}}};var scratchMatrix$4=new Matrix4,scratchPlane$2=new Plane(Cartesian3.UNIT_X,0);ClippingPlaneCollection.prototype.computeIntersectionWithBoundingVolume=function(e,t){var i=this._planes,r=i.length,n=this.modelMatrix;defined(t)&&(n=Matrix4.multiply(t,n,scratchMatrix$4));var a=Intersect$1.INSIDE;!this.unionClippingRegions&&0<r&&(a=Intersect$1.OUTSIDE);for(var o=0;o<r;++o){var s=i[o];Plane.transform(s,n,scratchPlane$2);var l=e.intersectPlane(scratchPlane$2);if(l===Intersect$1.INTERSECTING)a=l;else if(this._testIntersection(l))return l}return a},ClippingPlaneCollection.setOwner=function(e,t,i){e!==t[i]&&(t[i]=t[i]&&t[i].destroy(),defined(e)&&((e._owner=t)[i]=e))},ClippingPlaneCollection.useFloatTexture=function(e){return e.floatingPointTexture},ClippingPlaneCollection.getTextureResolution=function(e,t,i){var r=e.texture;if(defined(r))return i.x=r.width,i.y=r.height,i;var n=computeTextureResolution(ClippingPlaneCollection.useFloatTexture(t)?e.length:2*e.length,i);return n.y*=2,n},ClippingPlaneCollection.prototype.isDestroyed=function(){return!1},ClippingPlaneCollection.prototype.destroy=function(){return this._clippingPlanesTexture=this._clippingPlanesTexture&&this._clippingPlanesTexture.destroy(),destroyObject(this)};var ColorBlendMode={HIGHLIGHT:0,REPLACE:1,MIX:2,getColorBlend:function(e,t){return e===ColorBlendMode.HIGHLIGHT?0:e===ColorBlendMode.REPLACE?1:e===ColorBlendMode.MIX?CesiumMath.clamp(t,CesiumMath.EPSILON4,1):void 0}},ColorBlendMode$1=Object.freeze(ColorBlendMode);function DracoLoader(){}function addBufferToLoadResources(e,t){var i="runtime."+Object.keys(e.createdBufferViews).length,r=e.buffers,n=Object.keys(r).length;return r[n]=t,e.createdBufferViews[i]={buffer:n,byteOffset:0,byteLength:t.byteLength},i}function addNewVertexBuffer(e,t,i){var r=t._loadResources,n=addBufferToLoadResources(r,e);return r.vertexBuffersToCreate.enqueue(n),n}function addNewIndexBuffer(e,t,i){var r=e.typedArray,n=t._loadResources,a=addBufferToLoadResources(n,r);return n.indexBuffersToCreate.enqueue({id:a,componentType:ComponentDatatype$1.fromTypedArray(r)}),{bufferViewId:a,numberOfIndices:e.numberOfIndices}}function scheduleDecodingTask(e,l,u,t){if(DracoLoader._taskProcessorReady){var c=u.primitivesToDecode.peek();if(defined(c)){var i=e.scheduleTask(c,[c.array.buffer]);if(defined(i))return u.activeDecodingTasks++,u.primitivesToDecode.dequeue(),i.then(function(e){u.activeDecodingTasks--;var t=addNewIndexBuffer(e.indexArray,l),i={},r=e.attributeData;for(var n in r)if(r.hasOwnProperty(n)){var a=r[n],o=addNewVertexBuffer(a.array,l),s=a.data;s.bufferView=o,i[n]=s}l._decodedData[c.mesh+".primitive."+c.primitive]={bufferView:t.bufferViewId,numberOfIndices:t.numberOfIndices,attributes:i}})}}}function getClipAndStyleCode(e,t,i){return" float clipDistance = clip(gl_FragCoord, "+e+", "+t+"); \n vec4 clippingPlanesEdgeColor = vec4(1.0); \n clippingPlanesEdgeColor.rgb = "+i+".rgb; \n float clippingPlanesEdgeWidth = "+i+".a; \n if (clipDistance > 0.0 && clipDistance < clippingPlanesEdgeWidth) \n { \n gl_FragColor = clippingPlanesEdgeColor;\n } \n"}DracoLoader._maxDecodingConcurrency=Math.max(FeatureDetection$1.hardwareConcurrency-1,1),DracoLoader._decoderTaskProcessor=void 0,DracoLoader._taskProcessorReady=!1,DracoLoader._getDecoderTaskProcessor=function(){if(!defined(DracoLoader._decoderTaskProcessor)){var e=new TaskProcessor("decodeDraco",DracoLoader._maxDecodingConcurrency);e.initWebAssemblyModule({modulePath:"ThirdParty/Workers/draco_wasm_wrapper.js",wasmBinaryFile:"ThirdParty/draco_decoder.wasm",fallbackModulePath:"ThirdParty/Workers/draco_decoder.js"}).then(function(){DracoLoader._taskProcessorReady=!0}),DracoLoader._decoderTaskProcessor=e}return DracoLoader._decoderTaskProcessor},DracoLoader.hasExtension=function(e){return defined(e.extensionsRequired.KHR_draco_mesh_compression)||defined(e.extensionsUsed.KHR_draco_mesh_compression)},DracoLoader._decodedModelResourceCache=void 0,DracoLoader.parse=function(e,t){if(DracoLoader.hasExtension(e)){var o=e._loadResources,i=e.cacheKey;if(defined(i)){defined(DracoLoader._decodedModelResourceCache)||(defined(t.cache.modelDecodingCache)||(t.cache.modelDecodingCache={}),DracoLoader._decodedModelResourceCache=t.cache.modelDecodingCache);var r=DracoLoader._decodedModelResourceCache[i];if(defined(r))return r.count++,void(o.pendingDecodingCache=!0)}var s=e._dequantizeInShader,l=e.gltf;ForEach.mesh(l,function(e,a){ForEach.meshPrimitive(e,function(e,t){if(defined(e.extensions)){var i=e.extensions.KHR_draco_mesh_compression;if(defined(i)){var r=l.bufferViews[i.bufferView],n=arraySlice(l.buffers[r.buffer].extras._pipeline.source,r.byteOffset,r.byteOffset+r.byteLength);o.primitivesToDecode.enqueue({mesh:a,primitive:t,array:n,bufferView:r,compressedAttributes:i.attributes,dequantizeInShader:s})}}})})}},DracoLoader.decodeModel=function(e,t){if(!DracoLoader.hasExtension(e))return when.resolve();var i=e._loadResources,r=e.cacheKey;if(defined(r)&&defined(DracoLoader._decodedModelResourceCache)){var n=DracoLoader._decodedModelResourceCache[r];if(defined(n)&&i.pendingDecodingCache)return when(n.ready,function(){e._decodedData=n.data,i.pendingDecodingCache=!1});DracoLoader._decodedModelResourceCache[r]={ready:!1,count:1,data:void 0}}if(0===i.primitivesToDecode.length)return when.resolve();for(var a=DracoLoader._getDecoderTaskProcessor(),o=[],s=scheduleDecodingTask(a,e,i);defined(s);)o.push(s),s=scheduleDecodingTask(a,e,i);return when.all(o)},DracoLoader.decodePointCloud=function(e){var t=DracoLoader._getDecoderTaskProcessor();if(DracoLoader._taskProcessorReady)return t.scheduleTask(e,[e.buffer.buffer])},DracoLoader.cacheDataForModel=function(e){var t=e.cacheKey;if(defined(t)&&defined(DracoLoader._decodedModelResourceCache)){var i=DracoLoader._decodedModelResourceCache[t];defined(i)&&(i.ready=!0,i.data=e._decodedData)}},DracoLoader.destroyCachedDataForModel=function(e){var t=e.cacheKey;if(defined(t)&&defined(DracoLoader._decodedModelResourceCache)){var i=DracoLoader._decodedModelResourceCache[t];defined(i)&&0==--i.count&&delete DracoLoader._decodedModelResourceCache[t]}};var textureResolutionScratch$1=new Cartesian2;function getClippingFunction(e,t){var i=e.unionClippingRegions,r=e.length,n=ClippingPlaneCollection.useFloatTexture(t),a=ClippingPlaneCollection.getTextureResolution(e,t,textureResolutionScratch$1),o=a.x,s=a.y,l=n?getClippingPlaneFloat(o,s):getClippingPlaneUint8(o,s);return l+="\n",l+=i?clippingFunctionUnion(r):clippingFunctionIntersect(r)}function clippingFunctionUnion(e){return"float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix)\n{\n vec4 position = czm_windowToEyeCoordinates(fragCoord);\n vec3 clipNormal = vec3(0.0);\n vec3 clipPosition = vec3(0.0);\n float clipAmount;\n float pixelWidth = czm_metersPerPixel(position);\n bool breakAndDiscard = false;\n for (int i = 0; i < "+e+"; ++i)\n {\n vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix);\n clipNormal = clippingPlane.xyz;\n clipPosition = -clippingPlane.w * clipNormal;\n float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth;\n clipAmount = czm_branchFreeTernary(i == 0, amount, min(amount, clipAmount));\n if (amount <= 0.0)\n {\n breakAndDiscard = true;\n break;\n }\n }\n if (breakAndDiscard) {\n discard;\n }\n return clipAmount;\n}\n"}function clippingFunctionIntersect(e){return"float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix)\n{\n bool clipped = true;\n vec4 position = czm_windowToEyeCoordinates(fragCoord);\n vec3 clipNormal = vec3(0.0);\n vec3 clipPosition = vec3(0.0);\n float clipAmount = 0.0;\n float pixelWidth = czm_metersPerPixel(position);\n for (int i = 0; i < "+e+"; ++i)\n {\n vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix);\n clipNormal = clippingPlane.xyz;\n clipPosition = -clippingPlane.w * clipNormal;\n float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth;\n clipAmount = max(amount, clipAmount);\n clipped = clipped && (amount <= 0.0);\n }\n if (clipped)\n {\n discard;\n }\n return clipAmount;\n}\n"}function getClippingPlaneFloat(e,t){var i=1/t,r=1/e+"";-1===r.indexOf(".")&&(r+=".0");var n=i+"";return-1===n.indexOf(".")&&(n+=".0"),"vec4 getClippingPlane(sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform)\n{\n int pixY = clippingPlaneNumber / "+e+";\n int pixX = clippingPlaneNumber - (pixY * "+e+");\n float u = (float(pixX) + 0.5) * "+r+";\n float v = (float(pixY) + 0.5) * "+n+";\n vec4 plane = texture2D(packedClippingPlanes, vec2(u, v));\n return czm_transformPlane(plane, transform);\n}\n"}function getClippingPlaneUint8(e,t){var i=1/t,r=1/e+"";-1===r.indexOf(".")&&(r+=".0");var n=i+"";return-1===n.indexOf(".")&&(n+=".0"),"vec4 getClippingPlane(sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform)\n{\n int clippingPlaneStartIndex = clippingPlaneNumber * 2;\n int pixY = clippingPlaneStartIndex / "+e+";\n int pixX = clippingPlaneStartIndex - (pixY * "+e+");\n float u = (float(pixX) + 0.5) * "+r+";\n float v = (float(pixY) + 0.5) * "+n+";\n vec4 oct32 = texture2D(packedClippingPlanes, vec2(u, v)) * 255.0;\n vec2 oct = vec2(oct32.x * 256.0 + oct32.y, oct32.z * 256.0 + oct32.w);\n vec4 plane;\n plane.xyz = czm_octDecode(oct, 65535.0);\n plane.w = czm_unpackFloat(texture2D(packedClippingPlanes, vec2(u + "+r+", v)));\n return czm_transformPlane(plane, transform);\n}\n"}var JobType={TEXTURE:0,PROGRAM:1,BUFFER:2,NUMBER_OF_JOB_TYPES:3},JobType$1=Object.freeze(JobType);function ModelAnimationCache(){}var dataUriRegex$2=/^data\:/i;function getAccessorKey(e,t){var i=e.gltf,r=i.buffers,n=i.bufferViews[t.bufferView],a=r[n.buffer],o=n.byteOffset+t.byteOffset,s=t.count*numberOfComponentsForType(t.type),l=dataUriRegex$2.test(a.uri)?"":a.uri;return e.cacheKey+"//"+l+"/"+o+"/"+s}var cachedAnimationParameters={};ModelAnimationCache.getAnimationParameterValues=function(e,t){var i=getAccessorKey(e,t),r=cachedAnimationParameters[i];if(!defined(r)){var n=e.gltf,a=n.buffers,o=n.bufferViews[t.bufferView],s=a[o.buffer].extras._pipeline.source,l=t.componentType,u=t.type,c=numberOfComponentsForType(u),d=t.count,h=getAccessorByteStride(n,t);r=new Array(d);for(var p=defaultValue(t.byteOffset,0),f=o.byteOffset+p,m=0;m<d;m++){var g=ComponentDatatype$1.createArrayBufferView(l,s.buffer,s.byteOffset+f,c);"SCALAR"===u?r[m]=g[0]:"VEC3"===u?r[m]=Cartesian3.fromArray(g):"VEC4"===u&&(r[m]=Quaternion.unpack(g)),f+=h}defined(e.cacheKey)&&(cachedAnimationParameters[i]=r)}return r};var cachedAnimationSplines={};function getAnimationSplineKey(e,t,i){return e.cacheKey+"//"+t+"/"+i}function ConstantSpline(e){this._value=e}ConstantSpline.prototype.evaluate=function(e,t){return this._value},ConstantSpline.prototype.wrapTime=function(e){return 0},ConstantSpline.prototype.clampTime=function(e){return 0},ModelAnimationCache.getAnimationSpline=function(e,t,i,r,n,a,o,s){var l=getAnimationSplineKey(e,t,r),u=cachedAnimationSplines[l];if(!defined(u)){var c=a,d=s;1===c.length&&1===d.length?u=new ConstantSpline(d[0]):"LINEAR"===n.interpolation&&("translation"===o||"scale"===o?u=new LinearSpline({times:c,points:d}):"rotation"===o?u=new QuaternionSpline({times:c,points:d}):"weights"===o&&(u=new WeightSpline({times:c,weights:d}))),defined(e.cacheKey)&&(cachedAnimationSplines[l]=u)}return u};var cachedSkinInverseBindMatrices={};ModelAnimationCache.getSkinInverseBindMatrices=function(e,t){var i=getAccessorKey(e,t),r=cachedSkinInverseBindMatrices[i];if(!defined(r)){var n=e.gltf,a=n.buffers,o=n.bufferViews[t.bufferView],s=a[o.buffer].extras._pipeline.source,l=t.componentType,u=t.type,c=t.count,d=getAccessorByteStride(n,t),h=o.byteOffset+t.byteOffset,p=numberOfComponentsForType(u);if(r=new Array(c),l===WebGLConstants$1.FLOAT&&u===AttributeType$1.MAT4)for(var f=0;f<c;++f){var m=ComponentDatatype$1.createArrayBufferView(l,s.buffer,s.byteOffset+h,p);r[f]=Matrix4.fromArray(m),h+=d}cachedSkinInverseBindMatrices[i]=r}return r};var ModelAnimationLoop={NONE:0,REPEAT:1,MIRRORED_REPEAT:2},ModelAnimationLoop$1=Object.freeze(ModelAnimationLoop),ModelAnimationState=Object.freeze({STOPPED:0,ANIMATING:1});function ModelAnimation(e,t,i){this._name=i.name,this._startTime=JulianDate.clone(e.startTime),this._delay=defaultValue(e.delay,0),this._stopTime=e.stopTime,this.removeOnStop=defaultValue(e.removeOnStop,!1),this._multiplier=defaultValue(e.multiplier,1),this._reverse=defaultValue(e.reverse,!1),this._loop=defaultValue(e.loop,ModelAnimationLoop$1.NONE),this.start=new Event,this.update=new Event,this.stop=new Event,this._state=ModelAnimationState.STOPPED,this._runtimeAnimation=i,this._computedStartTime=void 0,this._duration=void 0;var r=this;this._raiseStartEvent=function(){r.start.raiseEvent(t,r)},this._updateEventTime=0,this._raiseUpdateEvent=function(){r.update.raiseEvent(t,r,r._updateEventTime)},this._raiseStopEvent=function(){r.stop.raiseEvent(t,r)}}function ModelAnimationCollection(e){this.animationAdded=new Event,this.animationRemoved=new Event,this._model=e,this._scheduledAnimations=[],this._previousTime=void 0}function add(e,t,i){var r=e._model,n=new ModelAnimation(i,r,r._runtime.animations[t]);return e._scheduledAnimations.push(n),e.animationAdded.raiseEvent(r,n),n}function animateChannels(e,t){for(var i=e.channelEvaluators,r=i.length,n=0;n<r;++n)i[n](t)}Object.defineProperties(ModelAnimation.prototype,{name:{get:function(){return this._name}},startTime:{get:function(){return this._startTime}},delay:{get:function(){return this._delay}},stopTime:{get:function(){return this._stopTime}},multiplier:{get:function(){return this._multiplier}},reverse:{get:function(){return this._reverse}},loop:{get:function(){return this._loop}}}),Object.defineProperties(ModelAnimationCollection.prototype,{length:{get:function(){return this._scheduledAnimations.length}}}),ModelAnimationCollection.prototype.add=function(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT);var t,i=this._model._runtime.animations;if(defined(e.index))return add(this,e.index,e);for(var r=i.length,n=0;n<r;++n)if(i[n].name===e.name){t=n;break}return add(this,t,e)},ModelAnimationCollection.prototype.addAll=function(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT);for(var t=[],i=this._model._runtime.animations.length,r=0;r<i;++r)t.push(add(this,r,e));return t},ModelAnimationCollection.prototype.remove=function(e){if(defined(e)){var t=this._scheduledAnimations,i=t.indexOf(e);if(-1!==i)return t.splice(i,1),this.animationRemoved.raiseEvent(this._model,e),!0}return!1},ModelAnimationCollection.prototype.removeAll=function(){var e=this._model,t=this._scheduledAnimations,i=t.length;this._scheduledAnimations=[];for(var r=0;r<i;++r)this.animationRemoved.raiseEvent(e,t[r])},ModelAnimationCollection.prototype.contains=function(e){return!!defined(e)&&-1!==this._scheduledAnimations.indexOf(e)},ModelAnimationCollection.prototype.get=function(e){return this._scheduledAnimations[e]};var animationsToRemove=[];function createAnimationRemovedFunction(e,t,i){return function(){e.animationRemoved.raiseEvent(t,i)}}function ModelMaterial(e,t,i){this._name=t.name,this._id=i,this._uniformMap=e._uniformMaps[i],this._technique=void 0,this._program=void 0,this._values=void 0}function ModelMesh(e,t,i){for(var r=[],n=e.primitives,a=n.length,o=0;o<a;++o){var s=n[o];r[o]=t[s.material]}this._name=e.name,this._materials=r,this._id=i}function ModelNode(e,t,i,r,n){this._model=e,this._runtimeNode=i,this._name=t.name,this._id=r,this.useMatrix=!1,this._show=!0,this._matrix=Matrix4.clone(n),this._originalMatrix=Matrix4.clone(n)}function ComputeCommand(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this.vertexArray=e.vertexArray,this.fragmentShaderSource=e.fragmentShaderSource,this.shaderProgram=e.shaderProgram,this.uniformMap=e.uniformMap,this.outputTexture=e.outputTexture,this.preExecute=e.preExecute,this.postExecute=e.postExecute,this.persists=defaultValue(e.persists,!1),this.pass=Pass$1.COMPUTE,this.owner=e.owner}ModelAnimationCollection.prototype.update=function(e){var t=this._scheduledAnimations,i=t.length;if(0===i)return this._previousTime=void 0,!1;if(JulianDate.equals(e.time,this._previousTime))return!1;this._previousTime=JulianDate.clone(e.time,this._previousTime);for(var r=!1,n=e.time,a=this._model,o=0;o<i;++o){var s=t[o],l=s._runtimeAnimation;defined(s._computedStartTime)||(s._computedStartTime=JulianDate.addSeconds(defaultValue(s.startTime,n),s.delay,new JulianDate)),defined(s._duration)||(s._duration=l.stopTime*(1/s.multiplier));var u=s._computedStartTime,c=s._duration,d=s.stopTime,h=0!==c?JulianDate.secondsDifference(n,u)/c:0,p=0<=h,f=s.loop===ModelAnimationLoop$1.REPEAT||s.loop===ModelAnimationLoop$1.MIRRORED_REPEAT;if((p||f&&!defined(s.startTime))&&(h<=1||f)&&(!defined(d)||JulianDate.lessThanOrEquals(n,d))){if(s._state===ModelAnimationState.STOPPED&&(s._state=ModelAnimationState.ANIMATING,0<s.start.numberOfListeners&&e.afterRender.push(s._raiseStartEvent)),s.loop===ModelAnimationLoop$1.REPEAT)h-=Math.floor(h);else if(s.loop===ModelAnimationLoop$1.MIRRORED_REPEAT){var m=Math.floor(h),g=h-m;h=m%2==1?1-g:g}s.reverse&&(h=1-h);var y=h*c*s.multiplier;animateChannels(l,y=CesiumMath.clamp(y,l.startTime,l.stopTime)),0<s.update.numberOfListeners&&(s._updateEventTime=y,e.afterRender.push(s._raiseUpdateEvent)),r=!0}else p&&s._state===ModelAnimationState.ANIMATING&&(s._state=ModelAnimationState.STOPPED,0<s.stop.numberOfListeners&&e.afterRender.push(s._raiseStopEvent),s.removeOnStop&&animationsToRemove.push(s))}i=animationsToRemove.length;for(var v=0;v<i;++v){var _=animationsToRemove[v];t.splice(t.indexOf(_),1),e.afterRender.push(createAnimationRemovedFunction(this,a,_))}return animationsToRemove.length=0,r},Object.defineProperties(ModelMaterial.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}}}),ModelMaterial.prototype.setValue=function(e,t){var i="u_"+e,r=this._uniformMap.values[i];r.value=r.clone(t,r.value)},ModelMaterial.prototype.getValue=function(e){var t="u_"+e,i=this._uniformMap.values[t];if(defined(i))return i.value},Object.defineProperties(ModelMesh.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},materials:{get:function(){return this._materials}}}),Object.defineProperties(ModelNode.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,this._model._perNodeShowDirty=!0)}},matrix:{get:function(){return this._matrix},set:function(e){this._matrix=Matrix4.clone(e,this._matrix),this.useMatrix=!0;var t=this._model;t._cesiumAnimationsDirty=!0,this._runtimeNode.dirtyNumber=t._maxDirtyNumber}},originalMatrix:{get:function(){return this._originalMatrix}}}),ModelNode.prototype.setMatrix=function(e){Matrix4.clone(e,this._matrix)},ComputeCommand.prototype.execute=function(e){e.execute(this)};var OctahedralProjectionAtlasFS="varying vec2 v_textureCoordinates;\nuniform float originalSize;\nuniform sampler2D texture0;\nuniform sampler2D texture1;\nuniform sampler2D texture2;\nuniform sampler2D texture3;\nuniform sampler2D texture4;\nuniform sampler2D texture5;\nconst float yMipLevel1 = 1.0 - (1.0 / pow(2.0, 1.0));\nconst float yMipLevel2 = 1.0 - (1.0 / pow(2.0, 2.0));\nconst float yMipLevel3 = 1.0 - (1.0 / pow(2.0, 3.0));\nconst float yMipLevel4 = 1.0 - (1.0 / pow(2.0, 4.0));\nvoid main()\n{\nvec2 uv = v_textureCoordinates;\nvec2 textureSize = vec2(originalSize * 1.5 + 2.0, originalSize);\nvec2 pixel = 1.0 / textureSize;\nfloat mipLevel = 0.0;\nif (uv.x - pixel.x > (textureSize.y / textureSize.x))\n{\nmipLevel = 1.0;\nif (uv.y - pixel.y > yMipLevel1)\n{\nmipLevel = 2.0;\nif (uv.y - pixel.y * 3.0 > yMipLevel2)\n{\nmipLevel = 3.0;\nif (uv.y - pixel.y * 5.0 > yMipLevel3)\n{\nmipLevel = 4.0;\nif (uv.y - pixel.y * 7.0 > yMipLevel4)\n{\nmipLevel = 5.0;\n}\n}\n}\n}\n}\nif (mipLevel > 0.0)\n{\nfloat scale = pow(2.0, mipLevel);\nuv.y -= (pixel.y * (mipLevel - 1.0) * 2.0);\nuv.x *= ((textureSize.x - 2.0) / textureSize.y);\nuv.x -= 1.0 + pixel.x;\nuv.y -= (1.0 - (1.0 / pow(2.0, mipLevel - 1.0)));\nuv *= scale;\n}\nelse\n{\nuv.x *= (textureSize.x / textureSize.y);\n}\nif(mipLevel == 0.0)\n{\ngl_FragColor = texture2D(texture0, uv);\n}\nelse if(mipLevel == 1.0)\n{\ngl_FragColor = texture2D(texture1, uv);\n}\nelse if(mipLevel == 2.0)\n{\ngl_FragColor = texture2D(texture2, uv);\n}\nelse if(mipLevel == 3.0)\n{\ngl_FragColor = texture2D(texture3, uv);\n}\nelse if(mipLevel == 4.0)\n{\ngl_FragColor = texture2D(texture4, uv);\n}\nelse if(mipLevel == 5.0)\n{\ngl_FragColor = texture2D(texture5, uv);\n}\nelse\n{\ngl_FragColor = vec4(0.0);\n}\n}\n",OctahedralProjectionFS="varying vec3 v_cubeMapCoordinates;\nuniform samplerCube cubeMap;\nvoid main()\n{\nvec4 rgbm = textureCube(cubeMap, v_cubeMapCoordinates);\nfloat m = rgbm.a * 16.0;\nvec3 r = rgbm.rgb * m;\ngl_FragColor = vec4(r * r, 1.0);\n}\n",OctahedralProjectionVS="attribute vec4 position;\nattribute vec3 cubeMapCoordinates;\nvarying vec3 v_cubeMapCoordinates;\nvoid main()\n{\ngl_Position = position;\nv_cubeMapCoordinates = cubeMapCoordinates;\n}\n";function OctahedralProjectedCubeMap(e){this._url=e,this._cubeMapBuffers=void 0,this._cubeMaps=void 0,this._texture=void 0,this._mipTextures=void 0,this._va=void 0,this._sp=void 0,this._maximumMipmapLevel=void 0,this._loading=!1,this._ready=!1,this._readyPromise=when.defer()}Object.defineProperties(OctahedralProjectedCubeMap.prototype,{url:{get:function(){return this._url}},texture:{get:function(){return this._texture}},maximumMipmapLevel:{get:function(){return this._maximumMipmapLevel}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}}}),OctahedralProjectedCubeMap.isSupported=function(e){return e.colorBufferHalfFloat&&e.halfFloatingPointTexture||e.floatingPointTexture&&e.colorBufferFloat};for(var v1$1=new Cartesian3(1,0,0),v2$1=new Cartesian3(0,0,1),v3=new Cartesian3(-1,0,0),v4=new Cartesian3(0,0,-1),v5=new Cartesian3(0,1,0),v6=new Cartesian3(0,-1,0),cubeMapCoordinates=[v5,v3,v2$1,v6,v1$1,v5,v4,v5,v5],length$1=cubeMapCoordinates.length,flatCubeMapCoordinates=new Float32Array(3*length$1),offset=0,i$6=0;i$6<length$1;++i$6,offset+=3)Cartesian3.pack(cubeMapCoordinates[i$6],flatCubeMapCoordinates,offset);var flatPositions=new Float32Array([-1,1,-1,0,0,1,0,0,1,0,1,1,0,-1,-1,-1,1,-1]),indices=new Uint16Array([0,1,2,2,3,1,7,6,1,3,6,1,2,5,4,3,4,2,4,8,6,3,4,6]);function createVertexArray$4(e){var t=Buffer$1.createVertexBuffer({context:e,typedArray:flatPositions,usage:BufferUsage$1.STATIC_DRAW}),i=Buffer$1.createVertexBuffer({context:e,typedArray:flatCubeMapCoordinates,usage:BufferUsage$1.STATIC_DRAW}),r=Buffer$1.createIndexBuffer({context:e,typedArray:indices,usage:BufferUsage$1.STATIC_DRAW,indexDatatype:IndexDatatype$1.UNSIGNED_SHORT});return new VertexArray({context:e,attributes:[{index:0,vertexBuffer:t,componentsPerAttribute:2,componentDatatype:ComponentDatatype$1.FLOAT},{index:1,vertexBuffer:i,componentsPerAttribute:3,componentDatatype:ComponentDatatype$1.FLOAT}],indexBuffer:r})}function createUniformTexture(e){return function(){return e}}function cleanupResources(e){var t,i;e._va=e._va&&e._va.destroy(),e._sp=e._sp&&e._sp.destroy();var r=e._cubeMaps;if(defined(r))for(i=r.length,t=0;t<i;++t)r[t].destroy();var n=e._mipTextures;if(defined(n))for(i=n.length,t=0;t<i;++t)n[t].destroy();e._va=void 0,e._sp=void 0,e._cubeMaps=void 0,e._cubeMapBuffers=void 0,e._mipTextures=void 0}OctahedralProjectedCubeMap.prototype.update=function(e){var t=e.context;if(OctahedralProjectedCubeMap.isSupported(t)&&(defined(this._texture)&&defined(this._va)&&cleanupResources(this),!defined(this._texture))){if(!defined(this._texture)&&!this._loading){var i=t.textureCache.getTexture(this._url);if(defined(i))return cleanupResources(this),this._texture=i,this._maximumMipmapLevel=this._texture.maximumMipmapLevel,this._ready=!0,void this._readyPromise.resolve()}var r=this._cubeMapBuffers;if(!defined(r)&&!this._loading){var n=this;loadKTX(this._url).then(function(e){n._cubeMapBuffers=e,n._loading=!1}).otherwise(this._readyPromise.reject),this._loading=!0}if(defined(this._cubeMapBuffers)){this._va=createVertexArray$4(t),this._sp=ShaderProgram.fromCache({context:t,vertexShaderSource:OctahedralProjectionVS,fragmentShaderSource:OctahedralProjectionFS,attributeLocations:{position:0,cubeMapCoordinates:1}});var a=Math.min(r.length,6);this._maximumMipmapLevel=a-1;for(var o=this._cubeMaps=new Array(a),s=this._mipTextures=new Array(a),l=2*r[0].positiveX.width,u={originalSize:function(){return l}},c=t.halfFloatingPointTexture?PixelDatatype$1.HALF_FLOAT:PixelDatatype$1.FLOAT,d=PixelFormat$1.RGBA,h=0;h<a;++h){var p=r[h].positiveY;r[h].positiveY=r[h].negativeY,r[h].negativeY=p;var f=o[h]=new CubeMap({context:t,source:r[h]}),m=2*o[h].width,g=s[h]=new Texture({context:t,width:m,height:m,pixelDatatype:c,pixelFormat:d}),y=new ComputeCommand({vertexArray:this._va,shaderProgram:this._sp,uniformMap:{cubeMap:createUniformTexture(f)},outputTexture:g,persists:!0,owner:this});e.commandList.push(y),u["texture"+h]=createUniformTexture(g)}this._texture=new Texture({context:t,width:1.5*l+2,height:l,pixelDatatype:c,pixelFormat:d}),this._texture.maximumMipmapLevel=this._maximumMipmapLevel,t.textureCache.addTexture(this._url,this._texture);var v=new ComputeCommand({fragmentShaderSource:OctahedralProjectionAtlasFS,uniformMap:u,outputTexture:this._texture,persists:!1,owner:this});e.commandList.push(v),this._ready=!0,this._readyPromise.resolve()}}},OctahedralProjectedCubeMap.prototype.isDestroyed=function(){return!1},OctahedralProjectedCubeMap.prototype.destroy=function(){return cleanupResources(this),this._texture=this._texture&&this._texture.destroy(),destroyObject(this)};var boundingSphereCartesian3Scratch$1=new Cartesian3,ModelState$1=ModelUtility.ModelState,defaultModelAccept="model/gltf-binary,model/gltf+json;q=0.8,application/json;q=0.2,*/*;q=0.01",articulationEpsilon=CesiumMath.EPSILON16;function setCachedGltf(e,t){e._cachedGltf=t}function CachedGltf(e){this._gltf=e.gltf,this.ready=e.ready,this.modelsToLoad=[],this.count=0}Object.defineProperties(CachedGltf.prototype,{gltf:{set:function(e){this._gltf=e},get:function(){return this._gltf}}}),CachedGltf.prototype.makeReady=function(e){this.gltf=e;for(var t=this.modelsToLoad,i=t.length,r=0;r<i;++r){var n=t[r];n.isDestroyed()||setCachedGltf(n,this)}this.modelsToLoad=void 0,this.ready=!0};var gltfCache={},uriToGuid={};function Model(e){var t,i=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).cacheKey;if(this._cacheKey=i,this._cachedGltf=void 0,this._releaseGltfJson=defaultValue(e.releaseGltfJson,!1),defined(i)&&defined(gltfCache[i])&&gltfCache[i].ready)++(t=gltfCache[i]).count;else{var r=e.gltf;if(defined(r)){if(r instanceof ArrayBuffer&&(r=new Uint8Array(r)),r instanceof Uint8Array)t=new CachedGltf({gltf:parseGlb(r),ready:!0});else t=new CachedGltf({gltf:e.gltf,ready:!0});t.count=1,defined(i)&&(gltfCache[i]=t)}}setCachedGltf(this,t);var n=defaultValue(e.basePath,"");this._resource=Resource.createIfNeeded(n);var a=e.credit;"string"==typeof a&&(a=new Credit(a)),this._credit=a,this._resourceCredits=[],this.show=defaultValue(e.show,!0),this.silhouetteColor=defaultValue(e.silhouetteColor,Color.RED),this._silhouetteColor=new Color,this._silhouetteColorPreviousAlpha=1,this._normalAttributeName=void 0,this.silhouetteSize=defaultValue(e.silhouetteSize,0),this.modelMatrix=Matrix4.clone(defaultValue(e.modelMatrix,Matrix4.IDENTITY)),this._modelMatrix=Matrix4.clone(this.modelMatrix),this._clampedModelMatrix=void 0,this.scale=defaultValue(e.scale,1),this._scale=this.scale,this.minimumPixelSize=defaultValue(e.minimumPixelSize,0),this._minimumPixelSize=this.minimumPixelSize,this.maximumScale=e.maximumScale,this._maximumScale=this.maximumScale,this.id=e.id,this._id=e.id,this.heightReference=defaultValue(e.heightReference,HeightReference$1.NONE),this._heightReference=this.heightReference,this._heightChanged=!1,this._removeUpdateHeightCallback=void 0;var o=e.scene;defined(this._scene=o)&&defined(o.terrainProviderChanged)&&(this._terrainProviderChangedCallback=o.terrainProviderChanged.addEventListener(function(){this._heightChanged=!0},this)),this._pickObject=e.pickObject,this._allowPicking=defaultValue(e.allowPicking,!0),this._ready=!1,this._readyPromise=when.defer(),this.activeAnimations=new ModelAnimationCollection(this),this.clampAnimations=defaultValue(e.clampAnimations,!0),this._defaultTexture=void 0,this._incrementallyLoadTextures=defaultValue(e.incrementallyLoadTextures,!0),this._asynchronous=defaultValue(e.asynchronous,!0),this.shadows=defaultValue(e.shadows,ShadowMode$1.ENABLED),this._shadows=this.shadows,this.color=Color.clone(defaultValue(e.color,Color.WHITE)),this._colorPreviousAlpha=1,this.colorBlendMode=defaultValue(e.colorBlendMode,ColorBlendMode$1.HIGHLIGHT),this.colorBlendAmount=defaultValue(e.colorBlendAmount,.5),this._colorShadingEnabled=!1,this._clippingPlanes=void 0,this.clippingPlanes=e.clippingPlanes,this._clippingPlanesState=0,this.clippingPlanesOriginMatrix=void 0,this.backFaceCulling=defaultValue(e.backFaceCulling,!0),this.debugShowBoundingVolume=defaultValue(e.debugShowBoundingVolume,!1),this._debugShowBoundingVolume=!1,this.debugWireframe=defaultValue(e.debugWireframe,!1),this._debugWireframe=!1,this._distanceDisplayCondition=e.distanceDisplayCondition,this._addBatchIdToGeneratedShaders=e.addBatchIdToGeneratedShaders,this._precreatedAttributes=e.precreatedAttributes,this._vertexShaderLoaded=e.vertexShaderLoaded,this._fragmentShaderLoaded=e.fragmentShaderLoaded,this._uniformMapLoaded=e.uniformMapLoaded,this._pickIdLoaded=e.pickIdLoaded,this._ignoreCommands=defaultValue(e.ignoreCommands,!1),this._requestType=e.requestType,this._upAxis=defaultValue(e.upAxis,Axis$1.Y),this._gltfForwardAxis=Axis$1.Z,this._forwardAxis=e.forwardAxis,this.cull=defaultValue(e.cull,!0),this.opaquePass=defaultValue(e.opaquePass,Pass$1.OPAQUE),this._computedModelMatrix=new Matrix4,this._clippingPlaneModelViewMatrix=Matrix4.clone(Matrix4.IDENTITY),this._initialRadius=void 0,this._boundingSphere=void 0,this._scaledBoundingSphere=new BoundingSphere,this._state=ModelState$1.NEEDS_LOAD,this._loadResources=void 0,this._mode=void 0,this._perNodeShowDirty=!1,this._cesiumAnimationsDirty=!1,this._dirty=!1,this._maxDirtyNumber=0,this._runtime={animations:void 0,articulationsByName:void 0,articulationsByStageKey:void 0,stagesByKey:void 0,rootNodes:void 0,nodes:void 0,nodesByName:void 0,skinnedNodes:void 0,meshesByName:void 0,materialsByName:void 0,materialsById:void 0},this._uniformMaps={},this._extensionsUsed=void 0,this._extensionsRequired=void 0,this._quantizedUniforms={},this._programPrimitives={},this._rendererResources={buffers:{},vertexArrays:{},programs:{},sourceShaders:{},silhouettePrograms:{},textures:{},samplers:{},renderStates:{}},this._cachedRendererResources=void 0,this._loadRendererResourcesFromCache=!1,this._dequantizeInShader=defaultValue(e.dequantizeInShader,!0),this._decodedData={},this._cachedGeometryByteLength=0,this._cachedTexturesByteLength=0,this._geometryByteLength=0,this._texturesByteLength=0,this._trianglesLength=0,this._sourceTechniques={},this._sourcePrograms={},this._quantizedVertexShaders={},this._nodeCommands=[],this._pickIds=[],this._rtcCenter=void 0,this._rtcCenterEye=void 0,this._rtcCenter3D=void 0,this._rtcCenter2D=void 0,this._sourceVersion=void 0,this._sourceKHRTechniquesWebGL=void 0,this._imageBasedLightingFactor=new Cartesian2(1,1),Cartesian2.clone(e.imageBasedLightingFactor,this._imageBasedLightingFactor),this._lightColor=Cartesian3.clone(e.lightColor),this._luminanceAtZenith=void 0,this.luminanceAtZenith=defaultValue(e.luminanceAtZenith,.2),this._sphericalHarmonicCoefficients=e.sphericalHarmonicCoefficients,this._specularEnvironmentMaps=e.specularEnvironmentMaps,this._shouldUpdateSpecularMapAtlas=!0,this._specularEnvironmentMapAtlas=void 0,this._useDefaultSphericalHarmonics=!1,this._useDefaultSpecularMaps=!1,this._shouldRegenerateShaders=!1}function silhouetteSupported(e){return e.stencilBuffer}function isColorShadingEnabled(e){return!Color.equals(e.color,Color.WHITE)||e.colorBlendMode!==ColorBlendMode$1.HIGHLIGHT}function isClippingEnabled(e){var t=e._clippingPlanes;return defined(t)&&t.enabled&&0!==t.length}function containsGltfMagic(e){return"glTF"===getMagic(e)}function getRuntime(e,t,i){return e._runtime[t][i]}Object.defineProperties(Model.prototype,{gltf:{get:function(){return defined(this._cachedGltf)?this._cachedGltf.gltf:void 0}},releaseGltfJson:{get:function(){return this._releaseGltfJson}},cacheKey:{get:function(){return this._cacheKey}},basePath:{get:function(){return this._resource.url}},boundingSphere:{get:function(){var e=this.modelMatrix;this.heightReference!==HeightReference$1.NONE&&this._clampedModelMatrix&&(e=this._clampedModelMatrix);var t=Matrix4.getScale(e,boundingSphereCartesian3Scratch$1),i=defined(this.maximumScale)?Math.min(this.maximumScale,this.scale):this.scale;Cartesian3.multiplyByScalar(t,i,t);var r=this._scaledBoundingSphere;return r.center=Cartesian3.multiplyComponents(this._boundingSphere.center,t,r.center),r.radius=Cartesian3.maximumComponent(t)*this._initialRadius,defined(this._rtcCenter)&&Cartesian3.add(this._rtcCenter,r.center,r.center),r}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},asynchronous:{get:function(){return this._asynchronous}},allowPicking:{get:function(){return this._allowPicking}},incrementallyLoadTextures:{get:function(){return this._incrementallyLoadTextures}},pendingTextureLoads:{get:function(){return defined(this._loadResources)?this._loadResources.pendingTextureLoads:0}},dirty:{get:function(){return this._dirty}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=DistanceDisplayCondition.clone(e,this._distanceDisplayCondition)}},extensionsUsed:{get:function(){return defined(this._extensionsUsed)||(this._extensionsUsed=ModelUtility.getUsedExtensions(this.gltf)),this._extensionsUsed}},extensionsRequired:{get:function(){return defined(this._extensionsRequired)||(this._extensionsRequired=ModelUtility.getRequiredExtensions(this.gltf)),this._extensionsRequired}},upAxis:{get:function(){return this._upAxis}},forwardAxis:{get:function(){return defined(this._forwardAxis)?this._forwardAxis:this._gltfForwardAxis}},trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},texturesByteLength:{get:function(){return this._texturesByteLength}},cachedGeometryByteLength:{get:function(){return this._cachedGeometryByteLength}},cachedTexturesByteLength:{get:function(){return this._cachedTexturesByteLength}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){e!==this._clippingPlanes&&ClippingPlaneCollection.setOwner(e,this,"_clippingPlanes")}},pickIds:{get:function(){return this._pickIds}},imageBasedLightingFactor:{get:function(){return this._imageBasedLightingFactor},set:function(e){var t=this._imageBasedLightingFactor;e===t||Cartesian2.equals(e,t)||(this._shouldRegenerateShaders=this._shouldRegenerateShaders||0<this._imageBasedLightingFactor.x&&0===e.x||0===this._imageBasedLightingFactor.x&&0<e.x,this._shouldRegenerateShaders=this._shouldRegenerateShaders||0<this._imageBasedLightingFactor.y&&0===e.y||0===this._imageBasedLightingFactor.y&&0<e.y,Cartesian2.clone(e,this._imageBasedLightingFactor))}},lightColor:{get:function(){return this._lightColor},set:function(e){var t=this._lightColor;e===t||Cartesian3.equals(e,t)||(this._shouldRegenerateShaders=this._shouldRegenerateShaders||defined(t)&&!defined(e)||defined(e)&&!defined(t),this._lightColor=Cartesian3.clone(e,t))}},luminanceAtZenith:{get:function(){return this._luminanceAtZenith},set:function(e){var t=this._luminanceAtZenith;e!==t&&(this._shouldRegenerateShaders=this._shouldRegenerateShaders||defined(t)&&!defined(e)||defined(e)&&!defined(t),this._luminanceAtZenith=e)}},sphericalHarmonicCoefficients:{get:function(){return this._sphericalHarmonicCoefficients},set:function(e){e!==this._sphericalHarmonicCoefficients&&(this._sphericalHarmonicCoefficients=e,this._shouldRegenerateShaders=!0)}},specularEnvironmentMaps:{get:function(){return this._specularEnvironmentMaps},set:function(e){this._shouldUpdateSpecularMapAtlas=this._shouldUpdateSpecularMapAtlas||e!==this._specularEnvironmentMaps,this._specularEnvironmentMaps=e}},credit:{get:function(){return this._credit}}}),Model.silhouetteSupported=function(e){return silhouetteSupported(e.context)},Model.fromGltf=function(e){var t=e.url;e=clone(e);var l=Resource.createIfNeeded(t),i=defaultValue(e.basePath,l.clone()),r=Resource.createIfNeeded(i),n=defaultValue(e.cacheKey,uriToGuid[getAbsoluteUri(l.url)]);defined(n)||(n=createGuid(),uriToGuid[getAbsoluteUri(l.url)]=n),defined(e.basePath)&&!defined(e.cacheKey)&&(n+=r.url),e.cacheKey=n,e.basePath=r;var u=new Model(e),c=gltfCache[n];return defined(c)?c.ready||(++c.count,c.modelsToLoad.push(u)):((c=new CachedGltf({ready:!1})).count=1,c.modelsToLoad.push(u),setCachedGltf(u,c),gltfCache[n]=c,defined(l.headers.Accept)||(l.headers.Accept=defaultModelAccept),l.fetchArrayBuffer().then(function(e){var t=new Uint8Array(e);if(containsGltfMagic(t)){var i=parseGlb(t);c.makeReady(i)}else{var r=getStringFromTypedArray(t);c.makeReady(JSON.parse(r))}var n=u._resourceCredits,a=l.credits;if(defined(a))for(var o=a.length,s=0;s<o;s++)n.push(a[s])}).otherwise(ModelUtility.getFailedLoadFunction(u,"model",l.url))),u},Model._gltfCache=gltfCache,Model.prototype.getNode=function(e){var t=getRuntime(this,"nodesByName",e);return defined(t)?t.publicNode:void 0},Model.prototype.getMesh=function(e){return getRuntime(this,"meshesByName",e)},Model.prototype.getMaterial=function(e){return getRuntime(this,"materialsByName",e)},Model.prototype.setArticulationStage=function(e,t){var i=getRuntime(this,"stagesByKey",e),r=getRuntime(this,"articulationsByStageKey",e);defined(i)&&defined(r)&&(t=CesiumMath.clamp(t,i.minimumValue,i.maximumValue),CesiumMath.equalsEpsilon(i.currentValue,t,articulationEpsilon)||(i.currentValue=t,r.isDirty=!0))};var scratchArticulationCartesian=new Cartesian3,scratchArticulationRotation=new Matrix3;function applyArticulationStageMatrix(e,t){var i,r=e.currentValue,n=scratchArticulationCartesian;switch(e.type){case"xRotate":i=Matrix3.fromRotationX(CesiumMath.toRadians(r),scratchArticulationRotation),Matrix4.multiplyByMatrix3(t,i,t);break;case"yRotate":i=Matrix3.fromRotationY(CesiumMath.toRadians(r),scratchArticulationRotation),Matrix4.multiplyByMatrix3(t,i,t);break;case"zRotate":i=Matrix3.fromRotationZ(CesiumMath.toRadians(r),scratchArticulationRotation),Matrix4.multiplyByMatrix3(t,i,t);break;case"xTranslate":n.x=r,n.y=0,n.z=0,Matrix4.multiplyByTranslation(t,n,t);break;case"yTranslate":n.x=0,n.y=r,n.z=0,Matrix4.multiplyByTranslation(t,n,t);break;case"zTranslate":n.x=0,n.y=0,n.z=r,Matrix4.multiplyByTranslation(t,n,t);break;case"xScale":n.x=r,n.y=1,n.z=1,Matrix4.multiplyByScale(t,n,t);break;case"yScale":n.x=1,n.y=r,n.z=1,Matrix4.multiplyByScale(t,n,t);break;case"zScale":n.x=1,n.y=1,n.z=r,Matrix4.multiplyByScale(t,n,t);break;case"uniformScale":Matrix4.multiplyByUniformScale(t,r,t)}return t}var scratchApplyArticulationTransform=new Matrix4;function addBuffersToLoadResources$1(e){var t=e.gltf,i=e._loadResources;ForEach.buffer(t,function(e,t){i.buffers[t]=e.extras._pipeline.source})}function bufferLoad(r,n){return function(e){var t=r._loadResources,i=new Uint8Array(e);--t.pendingBufferLoads,r.gltf.buffers[n].extras._pipeline.source=i}}function parseBufferViews$1(e){var i=e.gltf.bufferViews,r=e._loadResources.vertexBuffersToCreate;ForEach.bufferView(e.gltf,function(e,t){e.target===WebGLConstants$1.ARRAY_BUFFER&&r.enqueue(t)});var n=e._loadResources.indexBuffersToCreate,a={};ForEach.accessor(e.gltf,function(e){var t=e.bufferView;defined(t)&&(i[t].target!==WebGLConstants$1.ELEMENT_ARRAY_BUFFER||defined(a[t])||(a[t]=!0,n.enqueue({id:t,componentType:e.componentType})))})}function parseTechniques(e){var t=e.gltf;if(hasExtension(t,"KHR_techniques_webgl")){var r=e._sourcePrograms,n=e._sourceTechniques,a=t.extensions.KHR_techniques_webgl.programs;ForEach.technique(t,function(e,t){n[t]=clone(e);var i=e.program;defined(r[i])||(r[i]=clone(a[i]))})}}function shaderLoad(i,r,n){return function(e){var t=i._loadResources;t.shaders[n]={source:e,type:r,bufferView:void 0},--t.pendingShaderLoads,i._rendererResources.sourceShaders[n]=e}}function parseShaders(s){var e=s.gltf,l=e.buffers,u=e.bufferViews,c=s._rendererResources.sourceShaders;ForEach.shader(e,function(e,t){if(defined(e.bufferView)){var i=e.bufferView,r=u[i],n=r.buffer,a=getStringFromTypedArray(l[n].extras._pipeline.source,r.byteOffset,r.byteLength);c[t]=a}else if(defined(e.extras._pipeline.source))c[t]=e.extras._pipeline.source;else{++s._loadResources.pendingShaderLoads;var o=s._resource.getDerivedResource({url:e.uri});o.fetchText().then(shaderLoad(s,e.type,t)).otherwise(ModelUtility.getFailedLoadFunction(s,"shader",o.url))}})}function parsePrograms(e){var t=e._sourceTechniques;for(var i in t)if(t.hasOwnProperty(i)){var r=t[i];e._loadResources.programsToCreate.enqueue({programId:r.program,techniqueId:i})}}function parseArticulations(e){var t={},i={},r={};e._runtime.articulationsByName=t,e._runtime.articulationsByStageKey=i,e._runtime.stagesByKey=r;var n=e.gltf;if(hasExtension(n,"AGI_articulations")&&defined(n.extensions)&&defined(n.extensions.AGI_articulations)){var a=n.extensions.AGI_articulations.articulations;if(defined(a))for(var o=a.length,s=0;s<o;++s){var l=clone(a[s]);l.nodes=[],l.isDirty=!0;for(var u=(t[l.name]=l).stages.length,c=0;c<u;++c){var d=l.stages[c];d.currentValue=d.initialValue;var h=l.name+" "+d.name;i[h]=l,r[h]=d}}}}function imageLoad(i,r){return function(e){var t=i._loadResources;--t.pendingTextureLoads,t.texturesToCreate.enqueue({id:r,image:e,bufferView:e.bufferView,width:e.width,height:e.height,internalFormat:e.internalFormat})}}Model.prototype.applyArticulations=function(){var e=this._runtime.articulationsByName;for(var t in e)if(e.hasOwnProperty(t)){var i=e[t];if(i.isDirty){i.isDirty=!1;for(var r=i.nodes.length,n=0;n<r;++n){for(var a=i.nodes[n],o=Matrix4.clone(a.originalMatrix,scratchApplyArticulationTransform),s=i.stages.length,l=0;l<s;++l){o=applyArticulationStageMatrix(i.stages[l],o)}a.matrix=o}}}};var ktxRegex$2=/(^data:image\/ktx)|(\.ktx$)/i,crnRegex$2=/(^data:image\/crn)|(\.crn$)/i,ddsRegex$2=/(^data:image\/dds)|(\.dds$)/i;function parseTextures(h,p,f){var m,e=h.gltf,g=e.images;ForEach.texture(e,function(e,t){var i=e.source;defined(e.extensions)&&defined(e.extensions.EXT_texture_webp)&&f&&(i=e.extensions.EXT_texture_webp.source);var r=g[i],n=r.extras,a=r.bufferView,o=r.mimeType;if(m=r.uri,defined(n)&&defined(n.compressedImage3DTiles)){var s=n.compressedImage3DTiles.crunch,l=n.compressedImage3DTiles.s3tc,u=n.compressedImage3DTiles.pvrtc1,c=n.compressedImage3DTiles.etc1;p.s3tc&&defined(s)?(o=s.mimeType,defined(s.bufferView)?a=s.bufferView:m=s.uri):p.s3tc&&defined(l)?(o=l.mimeType,defined(l.bufferView)?a=l.bufferView:m=l.uri):p.pvrtc&&defined(u)?(o=u.mimeType,defined(u.bufferView)?a=u.bufferView:m=u.uri):p.etc1&&defined(c)&&(o=c.mimeType,defined(c.bufferView)?a=c.bufferView:m=c.uri)}if(defined(a))h._loadResources.texturesToCreateFromBufferView.enqueue({id:t,image:void 0,bufferView:a,mimeType:o});else{++h._loadResources.pendingTextureLoads;var d=h._resource.getDerivedResource({url:m});(ktxRegex$2.test(m)?loadKTX(d):crnRegex$2.test(m)?loadCRN(d):ddsRegex$2.test(m)?loadDDS$1(d):d.fetchImage()).then(imageLoad(h,t)).otherwise(ModelUtility.getFailedLoadFunction(h,"image",d.url))}})}var scratchArticulationStageInitialTransform=new Matrix4;function parseNodes(l){var u={},c={},d=[],h=l._loadResources.skinnedNodesIds,p=l._runtime.articulationsByName;ForEach.node(l.gltf,function(e,t){var i={matrix:void 0,translation:void 0,rotation:void 0,scale:void 0,computedShow:!0,transformToRoot:new Matrix4,computedMatrix:new Matrix4,dirtyNumber:0,commands:[],inverseBindMatrices:void 0,bindShapeMatrix:void 0,joints:[],computedJointMatrices:[],jointName:e.jointName,weights:[],children:[],parents:[],publicNode:void 0};if(i.publicNode=new ModelNode(l,e,i,t,ModelUtility.getTransform(e)),u[t]=i,c[e.name]=i,defined(e.skin)&&(h.push(t),d.push(i)),defined(e.extensions)&&defined(e.extensions.AGI_articulations)){var r=e.extensions.AGI_articulations.articulationName;if(defined(r)){var n=Matrix4.clone(i.publicNode.originalMatrix,scratchArticulationStageInitialTransform),a=p[r];a.nodes.push(i.publicNode);for(var o=a.stages.length,s=0;s<o;++s){n=applyArticulationStageMatrix(a.stages[s],n)}i.publicNode.matrix=n}}}),l._runtime.nodes=u,l._runtime.nodesByName=c,l._runtime.skinnedNodes=d}function parseMaterials(n){var e=n.gltf,a=n._sourceTechniques,o={},s={},l=n._uniformMaps;ForEach.material(e,function(e,t){l[t]={uniformMap:void 0,values:void 0,jointMatrixUniformName:void 0,morphWeightsUniformName:void 0};var i=new ModelMaterial(n,e,t);if(defined(e.extensions)&&defined(e.extensions.KHR_techniques_webgl)){var r=e.extensions.KHR_techniques_webgl.technique;i._technique=r,i._program=a[r].program,ForEach.materialValue(e,function(e,t){defined(i._values)||(i._values={}),i._values[t]=clone(e)})}o[e.name]=i,s[t]=i}),n._runtime.materialsByName=o,n._runtime.materialsById=s}function parseMeshes(a){var t={},i=a._runtime.materialsById;ForEach.mesh(a.gltf,function(e,n){t[e.name]=new ModelMesh(e,i,n),(defined(a.extensionsUsed.WEB3D_quantized_attributes)||a._dequantizeInShader)&&ForEach.meshPrimitive(e,function(e,t){var i=getProgramForPrimitive(a,e),r=a._programPrimitives[i];defined(r)||(r={},a._programPrimitives[i]=r),r[n+".primitive."+t]=e})}),a._runtime.meshesByName=t}var CreateVertexBufferJob=function(){this.id=void 0,this.model=void 0,this.context=void 0};function createVertexBuffer$1(e,t,i){var r=t._loadResources,n=t.gltf.bufferViews[e];defined(n)||(n=r.createdBufferViews[e]);var a=Buffer$1.createVertexBuffer({context:i,typedArray:r.getBuffer(n),usage:BufferUsage$1.STATIC_DRAW});a.vertexArrayDestroyable=!1,t._rendererResources.buffers[e]=a,t._geometryByteLength+=a.sizeInBytes}CreateVertexBufferJob.prototype.set=function(e,t,i){this.id=e,this.model=t,this.context=i},CreateVertexBufferJob.prototype.execute=function(){createVertexBuffer$1(this.id,this.model,this.context)};var CreateIndexBufferJob=function(){this.id=void 0,this.componentType=void 0,this.model=void 0,this.context=void 0};function createIndexBuffer$1(e,t,i,r){var n=i._loadResources,a=i.gltf.bufferViews[e];defined(a)||(a=n.createdBufferViews[e]);var o=Buffer$1.createIndexBuffer({context:r,typedArray:n.getBuffer(a),usage:BufferUsage$1.STATIC_DRAW,indexDatatype:t});o.vertexArrayDestroyable=!1,i._rendererResources.buffers[e]=o,i._geometryByteLength+=o.sizeInBytes}CreateIndexBufferJob.prototype.set=function(e,t,i,r){this.id=e,this.componentType=t,this.model=i,this.context=r},CreateIndexBufferJob.prototype.execute=function(){createIndexBuffer$1(this.id,this.componentType,this.model,this.context)};var scratchVertexBufferJob=new CreateVertexBufferJob,scratchIndexBufferJob=new CreateIndexBufferJob;function createBuffers$1(e,t){var i=e._loadResources;if(0===i.pendingBufferLoads){var r,n=t.context,a=i.vertexBuffersToCreate,o=i.indexBuffersToCreate;if(e.asynchronous){for(;0<a.length&&(scratchVertexBufferJob.set(a.peek(),e,n),t.jobScheduler.execute(scratchVertexBufferJob,JobType$1.BUFFER));)a.dequeue();for(;0<o.length&&(r=o.peek(),scratchIndexBufferJob.set(r.id,r.componentType,e,n),t.jobScheduler.execute(scratchIndexBufferJob,JobType$1.BUFFER));)o.dequeue()}else{for(;0<a.length;)createVertexBuffer$1(a.dequeue(),e,n);for(;0<o.length;)createIndexBuffer$1((r=o.dequeue()).id,r.componentType,e,n)}}}function getProgramForPrimitive(e,t){var i=e._runtime.materialsById[t.material];if(defined(i))return i._program}function modifyShaderForQuantizedAttributes$1(e,t,i){var r,n,a,o=i._programPrimitives[t];if(!defined(o))return e;for(n in o)if(o.hasOwnProperty(n)&&getProgramForPrimitive(i,r=o[n])===t)break;if(i._programPrimitives[t]=void 0,i.extensionsUsed.WEB3D_quantized_attributes)a=ModelUtility.modifyShaderForQuantizedAttributes(i.gltf,r,e),i._quantizedUniforms[t]=a.uniforms;else{var s=i._decodedData[n];if(!defined(s))return e;a=ModelUtility.modifyShaderForDracoQuantizedAttributes(i.gltf,r,e,s.attributes)}return a.shader}function modifyShaderForColor(e){return e=ShaderSource.replaceMain(e,"gltf_blend_main"),e+="uniform vec4 gltf_color; \nuniform float gltf_colorBlend; \nvoid main() \n{ \n gltf_blend_main(); \n gl_FragColor.rgb = mix(gl_FragColor.rgb, gltf_color.rgb, gltf_colorBlend); \n float highlight = ceil(gltf_colorBlend); \n gl_FragColor.rgb *= mix(gltf_color.rgb, vec3(1.0), highlight); \n gl_FragColor.a *= gltf_color.a; \n} \n"}function modifyShader$1(e,t,i){return defined(i)&&(e=i(e,t)),e}var CreateProgramJob=function(){this.programToCreate=void 0,this.model=void 0,this.context=void 0};function createProgram$1(e,t,i){var r=e.programId,n=e.techniqueId,a=t._sourcePrograms[r],o=t._rendererResources.sourceShaders,s=o[a.vertexShader],l=o[a.fragmentShader],u=t._quantizedVertexShaders;if(t.extensionsUsed.WEB3D_quantized_attributes||t._dequantizeInShader){var c=u[r];defined(c)||(c=modifyShaderForQuantizedAttributes$1(s,r,t),u[r]=c),s=c}var d=modifyShader$1(s,r,t._vertexShaderLoaded),h=modifyShader$1(l,r,t._fragmentShaderLoaded);defined(t._uniformMapLoaded)||(h="uniform vec4 czm_pickColor;\n"+h);var p=0<t._imageBasedLightingFactor.x||0<t._imageBasedLightingFactor.y;if(p&&(h="#define USE_IBL_LIGHTING \n\n"+h),defined(t._lightColor)&&(h="#define USE_CUSTOM_LIGHT_COLOR \n\n"+h),"2.0"===t._sourceVersion&&!t._sourceKHRTechniquesWebGL||(h=ShaderSource.replaceMain(h,"non_gamma_corrected_main"),h+="\nvoid main() { \n non_gamma_corrected_main(); \n gl_FragColor = czm_gammaCorrect(gl_FragColor); \n} \n"),OctahedralProjectedCubeMap.isSupported(i)){var f=defined(t._sphericalHarmonicCoefficients)||t._useDefaultSphericalHarmonics,m=defined(t._specularEnvironmentMapAtlas)&&t._specularEnvironmentMapAtlas.ready||t._useDefaultSpecularMaps;(f||m||p)&&(h="uniform mat4 gltf_clippingPlanesMatrix; \n"+h),defined(t._sphericalHarmonicCoefficients)?h="#define DIFFUSE_IBL \n#define CUSTOM_SPHERICAL_HARMONICS \nuniform vec3 gltf_sphericalHarmonicCoefficients[9]; \n"+h:t._useDefaultSphericalHarmonics&&(h="#define DIFFUSE_IBL \n"+h),defined(t._specularEnvironmentMapAtlas)&&t._specularEnvironmentMapAtlas.ready?h="#define SPECULAR_IBL \n#define CUSTOM_SPECULAR_IBL \nuniform sampler2D gltf_specularMap; \nuniform vec2 gltf_specularMapSize; \nuniform float gltf_maxSpecularLOD; \n"+h:t._useDefaultSpecularMaps&&(h="#define SPECULAR_IBL \n"+h)}defined(t._luminanceAtZenith)&&(h="#define USE_SUN_LUMINANCE \nuniform float gltf_luminanceAtZenith;\n"+h),createAttributesAndProgram(r,n,h,d,t,i)}function recreateProgram(e,t,i){var r=e.programId,n=e.techniqueId,a=t._sourcePrograms[r],o=t._rendererResources.sourceShaders,s=t._quantizedVertexShaders,l=t.clippingPlanes,u=isClippingEnabled(t),c=o[a.vertexShader],d=o[a.fragmentShader];(t.extensionsUsed.WEB3D_quantized_attributes||t._dequantizeInShader)&&(c=s[r]);var h=d;isColorShadingEnabled(t)&&(h=Model._modifyShaderForColor(h)),u&&(h=modifyShaderForClippingPlanes(h,l,i));var p=modifyShader$1(c,r,t._vertexShaderLoaded),f=modifyShader$1(h,r,t._fragmentShaderLoaded);defined(t._uniformMapLoaded)||(f="uniform vec4 czm_pickColor;\n"+f);var m=0<t._imageBasedLightingFactor.x||0<t._imageBasedLightingFactor.y;if(m&&(f="#define USE_IBL_LIGHTING \n\n"+f),defined(t._lightColor)&&(f="#define USE_CUSTOM_LIGHT_COLOR \n\n"+f),"2.0"===t._sourceVersion&&!t._sourceKHRTechniquesWebGL||(f=ShaderSource.replaceMain(f,"non_gamma_corrected_main"),f+="\nvoid main() { \n non_gamma_corrected_main(); \n gl_FragColor = czm_gammaCorrect(gl_FragColor); \n} \n"),OctahedralProjectedCubeMap.isSupported(i)){var g=defined(t._sphericalHarmonicCoefficients)||t._useDefaultSphericalHarmonics,y=defined(t._specularEnvironmentMapAtlas)&&t._specularEnvironmentMapAtlas.ready||t._useDefaultSpecularMaps;!u&&(g||y||m)&&(f="uniform mat4 gltf_clippingPlanesMatrix; \n"+f),defined(t._sphericalHarmonicCoefficients)?f="#define DIFFUSE_IBL \n#define CUSTOM_SPHERICAL_HARMONICS \nuniform vec3 gltf_sphericalHarmonicCoefficients[9]; \n"+f:t._useDefaultSphericalHarmonics&&(f="#define DIFFUSE_IBL \n"+f),defined(t._specularEnvironmentMapAtlas)&&t._specularEnvironmentMapAtlas.ready?f="#define SPECULAR_IBL \n#define CUSTOM_SPECULAR_IBL \nuniform sampler2D gltf_specularMap; \nuniform vec2 gltf_specularMapSize; \nuniform float gltf_maxSpecularLOD; \n"+f:t._useDefaultSpecularMaps&&(f="#define SPECULAR_IBL \n"+f)}defined(t._luminanceAtZenith)&&(f="#define USE_SUN_LUMINANCE \nuniform float gltf_luminanceAtZenith;\n"+f),createAttributesAndProgram(r,n,f,p,t,i)}function createAttributesAndProgram(e,t,i,r,n,a){var o=n._sourceTechniques[t],s=ModelUtility.createAttributeLocations(o,n._precreatedAttributes);n._rendererResources.programs[e]=ShaderProgram.fromCache({context:a,vertexShaderSource:r,fragmentShaderSource:i,attributeLocations:s})}CreateProgramJob.prototype.set=function(e,t,i){this.programToCreate=e,this.model=t,this.context=i},CreateProgramJob.prototype.execute=function(){createProgram$1(this.programToCreate,this.model,this.context)};var scratchCreateProgramJob=new CreateProgramJob;function createPrograms(e,t){var i=e._loadResources,r=i.programsToCreate;if(0===i.pendingShaderLoads&&0===i.pendingBufferLoads){var n=t.context;if(e.asynchronous)for(;0<r.length&&(scratchCreateProgramJob.set(r.peek(),e,n),t.jobScheduler.execute(scratchCreateProgramJob,JobType$1.PROGRAM));)r.dequeue();else for(;0<r.length;)createProgram$1(r.dequeue(),e,n)}}function getOnImageCreatedFromTypedArray(t,i){return function(e){t.texturesToCreate.enqueue({id:i.id,image:e,bufferView:void 0}),--t.pendingBufferViewToImage}}function loadTexturesFromBufferViews(e){var t=e._loadResources;if(0===t.pendingBufferLoads)for(;0<t.texturesToCreateFromBufferView.length;){var i=t.texturesToCreateFromBufferView.dequeue(),r=e.gltf,n=r.bufferViews[i.bufferView],a=(r.textures[i.id].source,ModelUtility.getFailedLoadFunction(e,"image","id: "+i.id+", bufferView: "+i.bufferView));if("image/ktx"===i.mimeType)loadKTX(t.getBuffer(n)).then(imageLoad(e,i.id)).otherwise(a),++e._loadResources.pendingTextureLoads;else if("image/crn"===i.mimeType)loadCRN(t.getBuffer(n)).then(imageLoad(e,i.id)).otherwise(a),++e._loadResources.pendingTextureLoads;else{var o=getOnImageCreatedFromTypedArray(t,i);loadImageFromTypedArray({uint8Array:t.getBuffer(n),format:i.mimeType,flipY:!1}).then(o).otherwise(a),++t.pendingBufferViewToImage}}}function createSamplers(e){var t=e._loadResources;if(t.createSamplers){t.createSamplers=!1;var i=e._rendererResources.samplers;ForEach.sampler(e.gltf,function(e,t){i[t]=new Sampler({wrapS:e.wrapS,wrapT:e.wrapT,minificationFilter:e.minFilter,magnificationFilter:e.magFilter})})}}var CreateTextureJob=function(){this.gltfTexture=void 0,this.model=void 0,this.context=void 0};function createTexture$3(e,t,i){var r=t.gltf.textures[e.id],n=t._rendererResources.samplers[r.sampler];defined(n)||(n=new Sampler({wrapS:TextureWrap$1.REPEAT,wrapT:TextureWrap$1.REPEAT}));for(var a=!1,o=t.gltf.materials,s=o.length,l=0;l<s;++l){var u=o[l];if(defined(u.extensions)&&defined(u.extensions.KHR_techniques_webgl)){var c=u.extensions.KHR_techniques_webgl.values;for(var d in c)if(c.hasOwnProperty(d)&&-1!==d.indexOf("Texture")){var h=c[d];if(h.index===e.id&&defined(h.extensions)&&defined(h.extensions.KHR_texture_transform)){a=!0;break}}}if(a)break}var p=n.wrapS,f=n.wrapT,m=n.minificationFilter;a&&m!==TextureMinificationFilter$1.LINEAR&&m!==TextureMinificationFilter$1.NEAREST&&(m=m===TextureMinificationFilter$1.NEAREST_MIPMAP_NEAREST||m===TextureMinificationFilter$1.NEAREST_MIPMAP_LINEAR?TextureMinificationFilter$1.NEAREST:TextureMinificationFilter$1.LINEAR,n=new Sampler({wrapS:n.wrapS,wrapT:n.wrapT,textureMinificationFilter:m,textureMagnificationFilter:n.magnificationFilter}));var g,y=e.internalFormat,v=!(defined(y)&&PixelFormat$1.isCompressedFormat(y)||m!==TextureMinificationFilter$1.NEAREST_MIPMAP_NEAREST&&m!==TextureMinificationFilter$1.NEAREST_MIPMAP_LINEAR&&m!==TextureMinificationFilter$1.LINEAR_MIPMAP_NEAREST&&m!==TextureMinificationFilter$1.LINEAR_MIPMAP_LINEAR),_=v||p===TextureWrap$1.REPEAT||p===TextureWrap$1.MIRRORED_REPEAT||f===TextureWrap$1.REPEAT||f===TextureWrap$1.MIRRORED_REPEAT,C=e.image;if(defined(y))g=new Texture({context:i,source:{arrayBufferView:e.bufferView},width:e.width,height:e.height,pixelFormat:y,sampler:n});else if(defined(C)){var x=!CesiumMath.isPowerOfTwo(C.width)||!CesiumMath.isPowerOfTwo(C.height);if(_&&x){var b=document.createElement("canvas");b.width=CesiumMath.nextPowerOfTwo(C.width),b.height=CesiumMath.nextPowerOfTwo(C.height),b.getContext("2d").drawImage(C,0,0,C.width,C.height,0,0,b.width,b.height),C=b}g=new Texture({context:i,source:C,pixelFormat:r.internalFormat,pixelDatatype:r.type,sampler:n,flipY:!1}),v&&g.generateMipmap()}defined(g)&&(t._rendererResources.textures[e.id]=g,t._texturesByteLength+=g.sizeInBytes)}CreateTextureJob.prototype.set=function(e,t,i){this.gltfTexture=e,this.model=t,this.context=i},CreateTextureJob.prototype.execute=function(){createTexture$3(this.gltfTexture,this.model,this.context)};var scratchCreateTextureJob=new CreateTextureJob;function createTextures$2(e,t){var i=t.context,r=e._loadResources.texturesToCreate;if(e.asynchronous)for(;0<r.length&&(scratchCreateTextureJob.set(r.peek(),e,i),t.jobScheduler.execute(scratchCreateTextureJob,JobType$1.TEXTURE));)r.dequeue();else for(;0<r.length;)createTexture$3(r.dequeue(),e,i)}function getAttributeLocations$1(e,t){var i,r,n=e._sourceTechniques,a={},o=e._runtime.materialsById[t.material];if(!defined(o))return a;var s=n[o._technique];if(!defined(s))return a;var l=s.attributes,u=e._rendererResources.programs[s.program],c=u.vertexAttributes,d=u._attributeLocations;for(i in c)if(c.hasOwnProperty(i)){var h=l[i];defined(h)&&(r=d[i],a[h.semantic]=r)}var p=e._precreatedAttributes;if(defined(p))for(i in p)p.hasOwnProperty(i)&&(r=d[i],a[i]=r);return a}function mapJointNames(e,t){for(var i=e.length,r={},n=0;n<i;++n)for(var a=[e[n]];0<a.length;){var o=a.pop(),s=t[o];defined(s)&&(r[o]=o);var l=s.children;if(defined(l))for(var u=l.length,c=0;c<u;++c)a.push(l[c])}return r}function createJoints(e,t){for(var i=e.gltf,r=i.skins,n=i.nodes,a=e._runtime.nodes,o=e._loadResources.skinnedNodesIds,s=o.length,l=0;l<s;++l){var u=o[l],c=a[u],d=n[u],h=t[d.skin];c.inverseBindMatrices=h.inverseBindMatrices,c.bindShapeMatrix=h.bindShapeMatrix;var p=[],f=r[d.skin];defined(f.skeleton)&&p.push(f.skeleton);for(var m=mapJointNames(p,n),g=r[d.skin].joints,y=g.length,v=0;v<y;++v){var _=a[m[g[v]]];c.joints.push(_)}}}function createSkins(n){var e=n._loadResources;if(0===e.pendingBufferLoads&&e.createSkins){e.createSkins=!1;var t=n.gltf,a=t.accessors,o={};ForEach.skin(t,function(e,t){var i,r=a[e.inverseBindMatrices];Matrix4.equals(e.bindShapeMatrix,Matrix4.IDENTITY)||(i=Matrix4.clone(e.bindShapeMatrix)),o[t]={inverseBindMatrices:ModelAnimationCache.getSkinInverseBindMatrices(n,r),bindShapeMatrix:i}}),createJoints(n,o)}}function getChannelEvaluator(t,i,r,n){return function(e){defined(n)&&(e=t.clampAnimations?n.clampTime(e):n.wrapTime(e),i[r]=n.evaluate(e,i[r]),i.dirtyNumber=t._maxDirtyNumber)}}function createRuntimeAnimations(g){var e=g._loadResources;if(e.finishedPendingBufferLoads()&&e.createRuntimeAnimations){e.createRuntimeAnimations=!1,g._runtime.animations=[];var y=g._runtime.nodes,v=g.gltf.accessors;ForEach.animation(g.gltf,function(e,t){for(var i=e.channels,r=e.samplers,n=Number.MAX_VALUE,a=-Number.MAX_VALUE,o=i.length,s=new Array(o),l=0;l<o;++l){var u=i[l],c=u.target,d=c.path,h=r[u.sampler],p=ModelAnimationCache.getAnimationParameterValues(g,v[h.input]),f=ModelAnimationCache.getAnimationParameterValues(g,v[h.output]);n=Math.min(n,p[0]),a=Math.max(a,p[p.length-1]);var m=ModelAnimationCache.getAnimationSpline(g,t,e,u.sampler,h,p,d,f);s[l]=getChannelEvaluator(g,y[c.node],c.path,m)}g._runtime.animations[t]={name:e.name,startTime:n,stopTime:a,channelEvaluators:s}})}}function createVertexArrays$1(h,p){var e=h._loadResources;if(e.finishedBuffersCreation()&&e.finishedProgramCreation()&&e.createVertexArrays){e.createVertexArrays=!1;var f=h._rendererResources.buffers,m=h._rendererResources.vertexArrays,g=h.gltf,y=g.accessors;ForEach.mesh(g,function(e,d){ForEach.meshPrimitive(e,function(e,t){var o,i,r,s=[],l=getAttributeLocations$1(h,e),u=h._decodedData[d+".primitive."+t];ForEach.meshPrimitiveAttribute(e,function(e,t){if(defined(o=l[t])){if(defined(u)){var i=u.attributes;if(i.hasOwnProperty(t)){var r=i[t];return void s.push({index:o,vertexBuffer:f[r.bufferView],componentsPerAttribute:r.componentsPerAttribute,componentDatatype:r.componentDatatype,normalize:r.normalized,offsetInBytes:r.byteOffset,strideInBytes:r.byteStride})}}var n=y[e],a=defined(n.normalized)&&n.normalized;s.push({index:o,vertexBuffer:f[n.bufferView],componentsPerAttribute:numberOfComponentsForType(n.type),componentDatatype:n.componentType,normalize:a,offsetInBytes:n.byteOffset,strideInBytes:getAccessorByteStride(g,n)})}});var n,a=h._precreatedAttributes;if(defined(a))for(r in a)a.hasOwnProperty(r)&&defined(o=l[r])&&((i=a[r]).index=o,s.push(i));if(defined(e.indices)){var c=y[e.indices].bufferView;defined(u)&&(c=u.bufferView),n=f[c]}m[d+".primitive."+t]=new VertexArray({context:p,attributes:s,indexBuffer:n})})})}}function createRenderStates$8(i){var e=i._loadResources;e.createRenderStates&&(e.createRenderStates=!1,ForEach.material(i.gltf,function(e,t){createRenderStateForMaterial(i,e,t)}))}function createRenderStateForMaterial(e,t,i){var r=e._rendererResources.renderStates,n=[WebGLConstants$1.FUNC_ADD,WebGLConstants$1.FUNC_ADD],a=[WebGLConstants$1.ONE,WebGLConstants$1.ONE_MINUS_SRC_ALPHA,WebGLConstants$1.ONE,WebGLConstants$1.ONE_MINUS_SRC_ALPHA];defined(t.extensions)&&defined(t.extensions.KHR_blend)&&(n=t.extensions.KHR_blend.blendEquation,a=t.extensions.KHR_blend.blendFactors);var o=!t.doubleSided,s="BLEND"===t.alphaMode;r[i]=RenderState.fromCache({cull:{enabled:o},depthTest:{enabled:!0,func:DepthFunction$1.LESS_OR_EQUAL},depthMask:!s,blending:{enabled:s,equationRgb:n[0],equationAlpha:n[1],functionSourceRgb:a[0],functionDestinationRgb:a[1],functionSourceAlpha:a[2],functionDestinationAlpha:a[3]}})}var gltfUniformsFromNode={MODEL:function(e,t,i){return function(){return i.computedMatrix}},VIEW:function(e,t,i){return function(){return e.view}},PROJECTION:function(e,t,i){return function(){return e.projection}},MODELVIEW:function(e,t,i){var r=new Matrix4;return function(){return Matrix4.multiplyTransformation(e.view,i.computedMatrix,r)}},CESIUM_RTC_MODELVIEW:function(e,t,i){var r=new Matrix4;return function(){return Matrix4.multiplyTransformation(e.view,i.computedMatrix,r),Matrix4.setTranslation(r,t._rtcCenterEye,r)}},MODELVIEWPROJECTION:function(e,t,i){var r=new Matrix4;return function(){return Matrix4.multiplyTransformation(e.view,i.computedMatrix,r),Matrix4.multiply(e._projection,r,r)}},MODELINVERSE:function(e,t,i){var r=new Matrix4;return function(){return Matrix4.inverse(i.computedMatrix,r)}},VIEWINVERSE:function(e,t){return function(){return e.inverseView}},PROJECTIONINVERSE:function(e,t,i){return function(){return e.inverseProjection}},MODELVIEWINVERSE:function(e,t,i){var r=new Matrix4,n=new Matrix4;return function(){return Matrix4.multiplyTransformation(e.view,i.computedMatrix,r),Matrix4.inverse(r,n)}},MODELVIEWPROJECTIONINVERSE:function(e,t,i){var r=new Matrix4,n=new Matrix4;return function(){return Matrix4.multiplyTransformation(e.view,i.computedMatrix,r),Matrix4.multiply(e._projection,r,r),Matrix4.inverse(r,n)}},MODELINVERSETRANSPOSE:function(e,t,i){var r=new Matrix4,n=new Matrix3;return function(){return Matrix4.inverse(i.computedMatrix,r),Matrix4.getMatrix3(r,n),Matrix3.transpose(n,n)}},MODELVIEWINVERSETRANSPOSE:function(e,t,i){var r=new Matrix4,n=new Matrix4,a=new Matrix3;return function(){return Matrix4.multiplyTransformation(e.view,i.computedMatrix,r),Matrix4.inverse(r,n),Matrix4.getMatrix3(n,a),Matrix3.transpose(a,a)}},VIEWPORT:function(e,t,i){return function(){return e.viewportCartesian4}}};function getUniformFunctionFromSource(e,t,i,r){var n=t._runtime.nodes[e];return gltfUniformsFromNode[i](r,t,n)}function createUniformsForMaterial(o,s,e,l,u,c,d){var h,p,f={},m={};return ForEach.techniqueUniform(e,function(e,t){var i;if(defined(l)&&defined(l[t]))i=ModelUtility.createUniformFunction(e.type,l[t],c,d),f[t]=i.func,m[t]=i;else if(defined(e.node))f[t]=getUniformFunctionFromSource(e.node,o,e.semantic,u.uniformState);else if(defined(e.semantic))if("JOINTMATRIX"===e.semantic)h=t;else if("MORPHWEIGHTS"===e.semantic)p=t;else if("ALPHACUTOFF"===e.semantic){var r=s.alphaMode;if(defined(r)&&"MASK"===r){var n=defaultValue(s.alphaCutoff,.5);i=ModelUtility.createUniformFunction(e.type,n,c,d),f[t]=i.func,m[t]=i}}else f[t]=ModelUtility.getGltfSemanticUniforms()[e.semantic](u.uniformState,o);else if(defined(e.value)){var a=ModelUtility.createUniformFunction(e.type,e.value,c,d);f[t]=a.func,m[t]=a}}),{map:f,values:m,jointMatrixUniformName:h,morphWeightsUniformName:p}}function createUniformMaps(s,l){var e=s._loadResources;if(e.finishedProgramCreation()&&e.createUniformMaps){e.createUniformMaps=!1;var t=s.gltf,u=s._sourceTechniques,c=s._uniformMaps,d=s._rendererResources.textures,h=s._defaultTexture;ForEach.material(t,function(e,t){var i=s._runtime.materialsById[t],r=u[i._technique],n=i._values,a=createUniformsForMaterial(s,e,r,n,l,d,h),o=c[t];o.uniformMap=a.map,o.values=a.values,o.jointMatrixUniformName=a.jointMatrixUniformName,o.morphWeightsUniformName=a.morphWeightsUniformName})}}function createUniformsForDracoQuantizedAttributes(e){return ModelUtility.createUniformsForDracoQuantizedAttributes(e.attributes)}function createUniformsForQuantizedAttributes$1(e,t){var i=getProgramForPrimitive(e,t),r=e._quantizedUniforms[i];return ModelUtility.createUniformsForQuantizedAttributes(e.gltf,t,r)}function createPickColorFunction(e){return function(){return e}}function createJointMatricesFunction(e){return function(){return e.computedJointMatrices}}function createMorphWeightsFunction(e){return function(){return e.weights}}function createSilhouetteColorFunction(e){return function(){return e.silhouetteColor}}function createSilhouetteSizeFunction(e){return function(){return e.silhouetteSize}}function createColorFunction(e){return function(){return e.color}}var scratchClippingPlaneMatrix=new Matrix4;function createClippingPlanesMatrixFunction(i){return function(){var e=i.clippingPlanes;if(!defined(e)&&!defined(i._sphericalHarmonicCoefficients)&&!defined(i._specularEnvironmentMaps))return Matrix4.IDENTITY;var t=defined(e)?e.modelMatrix:Matrix4.IDENTITY;return Matrix4.multiply(i._clippingPlaneModelViewMatrix,t,scratchClippingPlaneMatrix)}}function createClippingPlanesFunction(t){return function(){var e=t.clippingPlanes;return defined(e)&&e.enabled?e.texture:t._defaultTexture}}function createClippingPlanesEdgeStyleFunction(i){return function(){var e=i.clippingPlanes;if(!defined(e))return Color.WHITE.withAlpha(0);var t=Color.clone(e.edgeColor);return t.alpha=e.edgeWidth,t}}function createColorBlendFunction(e){return function(){return ColorBlendMode$1.getColorBlend(e.colorBlendMode,e.colorBlendAmount)}}function createIBLFactorFunction(e){return function(){return e._imageBasedLightingFactor}}function createLightColorFunction(e){return function(){return e._lightColor}}function createLuminanceAtZenithFunction(e){return function(){return e.luminanceAtZenith}}function createSphericalHarmonicCoefficientsFunction(e){return function(){return e._sphericalHarmonicCoefficients}}function createSpecularEnvironmentMapFunction(e){return function(){return e._specularEnvironmentMapAtlas.texture}}function createSpecularEnvironmentMapSizeFunction(e){return function(){return e._specularEnvironmentMapAtlas.texture.dimensions}}function createSpecularEnvironmentMapLOD(e){return function(){return e._specularEnvironmentMapAtlas.maximumMipmapLevel}}function triangleCountFromPrimitiveIndices$1(e,t){switch(e.mode){case PrimitiveType$1.TRIANGLES:return t/3;case PrimitiveType$1.TRIANGLE_STRIP:case PrimitiveType$1.TRIANGLE_FAN:return Math.max(t-2,0);default:return 0}}function createCommand(e,t,i,r,n){for(var a=e._nodeCommands,o=e._pickIds,s=e.allowPicking,l=e._runtime.meshesByName,u=e._rendererResources,c=u.vertexArrays,d=u.programs,h=u.renderStates,p=e._uniformMaps,f=e.gltf,m=f.accessors,g=f.meshes,y=f.textures,v=t.mesh,_=g[v],C=_.primitives,x=C.length,b=0;b<x;++b){var A,S=C[b],w=m[S.indices],E=e._runtime.materialsById[S.material],T=E._program,P=e._decodedData[v+".primitive."+b],M=[];if(defined(y)&&defined(E._values.u_baseColorTexture)){var D=y[E._values.u_baseColorTexture.index];defined(D.name)&&0<=D.name.indexOf("_cam")&&M.push(D.name)}var I=S.attributes.POSITION;if(defined(I)){var O=ModelUtility.getAccessorMinMax(f,I);A=BoundingSphere.fromCornerPoints(Cartesian3.fromArray(O.min),Cartesian3.fromArray(O.max))}var R,L,N=c[v+".primitive."+b];if(defined(P))L=P.numberOfIndices,R=0;else if(defined(w))L=w.count,R=w.byteOffset/IndexDatatype$1.getSizeInBytes(w.componentType);else{L=m[S.attributes.POSITION].count,R=0}e._trianglesLength+=triangleCountFromPrimitiveIndices$1(S,L);var k=p[S.material],B=k.uniformMap;if(defined(k.jointMatrixUniformName)){var F={};F[k.jointMatrixUniformName]=createJointMatricesFunction(i),B=combine(B,F)}if(defined(k.morphWeightsUniformName)){var V={};V[k.morphWeightsUniformName]=createMorphWeightsFunction(i),B=combine(B,V)}B=combine(B,{gltf_color:createColorFunction(e),gltf_colorBlend:createColorBlendFunction(e),gltf_clippingPlanes:createClippingPlanesFunction(e),gltf_clippingPlanesEdgeStyle:createClippingPlanesEdgeStyleFunction(e),gltf_clippingPlanesMatrix:createClippingPlanesMatrixFunction(e),gltf_iblFactor:createIBLFactorFunction(e),gltf_lightColor:createLightColorFunction(e),gltf_sphericalHarmonicCoefficients:createSphericalHarmonicCoefficientsFunction(e),gltf_specularMap:createSpecularEnvironmentMapFunction(e),gltf_specularMapSize:createSpecularEnvironmentMapSizeFunction(e),gltf_maxSpecularLOD:createSpecularEnvironmentMapLOD(e),gltf_luminanceAtZenith:createLuminanceAtZenithFunction(e)}),defined(e._uniformMapLoaded)&&(B=e._uniformMapLoaded(B,T,i));var z={};e.extensionsUsed.WEB3D_quantized_attributes?z=createUniformsForQuantizedAttributes$1(e,S):e._dequantizeInShader&&defined(P)&&(z=createUniformsForDracoQuantizedAttributes(P)),B=combine(B,z);var U=h[S.material],G=U.blending.enabled,$=e._pickObject;defined($)||($={primitive:e,id:e.id,node:i.publicNode,mesh:l[_.name]});var H,W=ShadowMode$1.castShadows(e._shadows),j=ShadowMode$1.receiveShadows(e._shadows);if(s&&!defined(e._uniformMapLoaded))H=r.createPickId($),o.push(H),B=combine(B,{czm_pickColor:createPickColorFunction(H.color)});s&&(H=defined(e._pickIdLoaded)&&defined(e._uniformMapLoaded)?e._pickIdLoaded():"czm_pickColor");var q,Q=new DrawCommand({boundingVolume:new BoundingSphere,cull:e.cull,modelMatrix:new Matrix4,primitiveType:S.mode,vertexArray:N,count:L,offset:R,shaderProgram:d[T],castShadows:W,receiveShadows:j,receiveTextureProjectionList:M,uniformMap:B,renderState:U,owner:$,pass:G?Pass$1.TRANSLUCENT:e.opaquePass,pickId:H});n||((q=DrawCommand.shallowClone(Q)).boundingVolume=new BoundingSphere,q.modelMatrix=new Matrix4);var Y={show:!0,boundingSphere:A,command:Q,command2D:q,silhouetteModelCommand:void 0,silhouetteModelCommand2D:void 0,silhouetteColorCommand:void 0,silhouetteColorCommand2D:void 0,translucentCommand:void 0,translucentCommand2D:void 0,disableCullingCommand:void 0,disableCullingCommand2D:void 0,programId:T};i.commands.push(Y),a.push(Y)}}function createRuntimeNodes$1(e,t,i){var r=e._loadResources;if(r.finishedEverythingButTextureCreation()&&r.createRuntimeNodes){r.createRuntimeNodes=!1;for(var n=[],a=e._runtime.nodes,o=e.gltf,s=o.nodes,l=o.scenes[o.scene].nodes,u=l.length,c=[],d={},h=0;h<u;++h)for(c.push({parentRuntimeNode:void 0,gltfNode:s[l[h]],id:l[h]});0<c.length;){var p=c.pop();d[p.id]=!0;var f=p.parentRuntimeNode,m=p.gltfNode,g=a[p.id];if(0===g.parents.length)if(defined(m.matrix))g.matrix=Matrix4.fromColumnMajorArray(m.matrix);else{var y=m.rotation;g.translation=Cartesian3.fromArray(m.translation),g.rotation=Quaternion.unpack(y),g.scale=Cartesian3.fromArray(m.scale)}defined(f)?(f.children.push(g),g.parents.push(f)):n.push(g),defined(m.mesh)&&createCommand(e,m,g,t,i);var v=m.children;if(defined(v))for(var _=v.length,C=0;C<_;C++){var x=v[C];d[x]||c.push({parentRuntimeNode:g,gltfNode:s[x],id:v[C]})}}e._runtime.rootNodes=n,e._runtime.nodes=a}}function getGeometryByteLength(e){var t=0;for(var i in e)e.hasOwnProperty(i)&&(t+=e[i].sizeInBytes);return t}function getTexturesByteLength(e){var t=0;for(var i in e)e.hasOwnProperty(i)&&(t+=e[i].sizeInBytes);return t}function createResources$1(e,t){var i=t.context,r=t.scene3DOnly,n=e._quantizedVertexShaders,a=e._sourceTechniques,o=e._sourcePrograms,s=e._rendererResources,l=s.sourceShaders;for(var u in e._loadRendererResourcesFromCache&&(l=s.sourceShaders=e._cachedRendererResources.sourceShaders),a)if(a.hasOwnProperty(u)){var c=a[u].program,d=o[c],h=l[d.vertexShader];if(ModelUtility.checkSupportedGlExtensions(d.glExtensions,i),e.extensionsUsed.WEB3D_quantized_attributes||e._dequantizeInShader){var p=n[c];defined(p)||(p=modifyShaderForQuantizedAttributes$1(h,c,e),n[c]=p),h=p}h=modifyShader$1(h,c,e._vertexShaderLoaded)}if(e._loadRendererResourcesFromCache){var f=e._cachedRendererResources;s.buffers=f.buffers,s.vertexArrays=f.vertexArrays,s.programs=f.programs,s.silhouettePrograms=f.silhouettePrograms,s.textures=f.textures,s.samplers=f.samplers,s.renderStates=f.renderStates,defined(e._precreatedAttributes)&&createVertexArrays$1(e,i),e._cachedGeometryByteLength+=getGeometryByteLength(f.buffers),e._cachedTexturesByteLength+=getTexturesByteLength(f.textures)}else createBuffers$1(e,t),createPrograms(e,t),createSamplers(e),loadTexturesFromBufferViews(e),createTextures$2(e,t);createSkins(e),createRuntimeAnimations(e),e._loadRendererResourcesFromCache||(createVertexArrays$1(e,i),createRenderStates$8(e)),createUniformMaps(e,i),createRuntimeNodes$1(e,i,r)}function getNodeMatrix(e,t){var i=e.publicNode,r=i.matrix;i.useMatrix&&defined(r)?Matrix4.clone(r,t):defined(e.matrix)?Matrix4.clone(e.matrix,t):(Matrix4.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t),i.setMatrix(t))}var scratchNodeStack=[],scratchComputedTranslation$1=new Cartesian4,scratchComputedMatrixIn2D$1=new Matrix4;function updateNodeHierarchyModelMatrix(e,t,i,r){var n=e._maxDirtyNumber,a=e._runtime.rootNodes,o=a.length,s=scratchNodeStack,l=e._computedModelMatrix;if(e._mode!==SceneMode$1.SCENE3D&&!e._ignoreCommands){var u=Matrix4.getColumn(l,3,scratchComputedTranslation$1);if(Cartesian4.equals(u,Cartesian4.UNIT_W)){var c=e.boundingSphere.center,d=Transforms.wgs84To2DModelMatrix(r,c,scratchComputedMatrixIn2D$1);l=Matrix4.multiply(d,l,scratchComputedMatrixIn2D$1),defined(e._rtcCenter)&&(Matrix4.setTranslation(l,Cartesian4.UNIT_W,l),e._rtcCenter=e._rtcCenter2D)}else l=Transforms.basisTo2D(r,l,scratchComputedMatrixIn2D$1),e._rtcCenter=e._rtcCenter3D}for(var h=0;h<o;++h){var p=a[h];for(getNodeMatrix(p,p.transformToRoot),s.push(p);0<s.length;){var f=(p=s.pop()).transformToRoot,m=p.commands;if(p.dirtyNumber===n||t||i){var g=Matrix4.multiplyTransformation(l,f,p.computedMatrix),y=m.length;if(0<y)for(var v=0;v<y;++v){var _=m[v],C=_.command;Matrix4.clone(g,C.modelMatrix),BoundingSphere.transform(_.boundingSphere,C.modelMatrix,C.boundingVolume),defined(e._rtcCenter)&&Cartesian3.add(e._rtcCenter,C.boundingVolume.center,C.boundingVolume.center),defined(C=_.command2D)&&e._mode===SceneMode$1.SCENE2D&&(Matrix4.clone(g,C.modelMatrix),C.modelMatrix[13]-=2*CesiumMath.sign(C.modelMatrix[13])*CesiumMath.PI*r.ellipsoid.maximumRadius,BoundingSphere.transform(_.boundingSphere,C.modelMatrix,C.boundingVolume))}}var x=p.children;if(defined(x))for(var b=x.length,A=0;A<b;++A){var S=x[A];S.dirtyNumber=Math.max(S.dirtyNumber,p.dirtyNumber),S.dirtyNumber!==n&&!i||(getNodeMatrix(S,S.transformToRoot),Matrix4.multiplyTransformation(f,S.transformToRoot,S.transformToRoot)),s.push(S)}}}++e._maxDirtyNumber}var scratchObjectSpace=new Matrix4;function applySkins(e){for(var t=e._runtime.skinnedNodes,i=t.length,r=0;r<i;++r){var n=t[r];scratchObjectSpace=Matrix4.inverseTransformation(n.transformToRoot,scratchObjectSpace);for(var a=n.computedJointMatrices,o=n.joints,s=n.bindShapeMatrix,l=n.inverseBindMatrices,u=l.length,c=0;c<u;++c)defined(a[c])||(a[c]=new Matrix4),a[c]=Matrix4.multiplyTransformation(scratchObjectSpace,o[c].transformToRoot,a[c]),a[c]=Matrix4.multiplyTransformation(a[c],l[c],a[c]),defined(s)&&(a[c]=Matrix4.multiplyTransformation(a[c],s,a[c]))}}function updatePerNodeShow(e){for(var t=e._runtime.rootNodes,i=t.length,r=scratchNodeStack,n=0;n<i;++n){var a=t[n];for(a.computedShow=a.publicNode.show,r.push(a);0<r.length;){for(var o=(a=r.pop()).computedShow,s=a.commands,l=s.length,u=0;u<l;++u)s[u].show=o;var c=a.children;if(defined(c))for(var d=c.length,h=0;h<d;++h){var p=c[h];p.computedShow=o&&p.publicNode.show,r.push(p)}}}}function updatePickIds(e,t){var i=e.id;if(e._id!==i){e._id=i;for(var r=e._pickIds,n=r.length,a=0;a<n;++a)r[a].object.id=i}}function updateWireframe$1(e){if(e._debugWireframe!==e.debugWireframe){e._debugWireframe=e.debugWireframe;for(var t=e.debugWireframe?PrimitiveType$1.LINES:PrimitiveType$1.TRIANGLES,i=e._nodeCommands,r=i.length,n=0;n<r;++n)i[n].command.primitiveType=t}}function updateShowBoundingVolume(e){if(e.debugShowBoundingVolume!==e._debugShowBoundingVolume){e._debugShowBoundingVolume=e.debugShowBoundingVolume;for(var t=e.debugShowBoundingVolume,i=e._nodeCommands,r=i.length,n=0;n<r;++n)i[n].command.debugShowBoundingVolume=t}}function updateShadows(e){if(e.shadows!==e._shadows){e._shadows=e.shadows;for(var t=ShadowMode$1.castShadows(e.shadows),i=ShadowMode$1.receiveShadows(e.shadows),r=e._nodeCommands,n=r.length,a=0;a<n;a++){var o=r[a];o.command.castShadows=t,o.command.receiveShadows=i}}}function getTranslucentRenderState$1(e){var t=clone(e,!0);return t.cull.enabled=!1,t.depthTest.enabled=!0,t.depthMask=!1,t.blending=BlendingState$1.ALPHA_BLEND,RenderState.fromCache(t)}function deriveTranslucentCommand$1(e){var t=DrawCommand.shallowClone(e);return t.pass=Pass$1.TRANSLUCENT,t.renderState=getTranslucentRenderState$1(e.renderState),t}function updateColor(e,t,i){var r=t.scene3DOnly,n=e.color.alpha;if(0<n&&n<1){var a=e._nodeCommands,o=a.length;if(!defined(a[0].translucentCommand)||i)for(var s=0;s<o;++s){var l=a[s],u=l.command;if(l.translucentCommand=deriveTranslucentCommand$1(u),!r){var c=l.command2D;l.translucentCommand2D=deriveTranslucentCommand$1(c)}}}}function getDisableCullingRenderState(e){var t=clone(e,!0);return t.cull.enabled=!1,RenderState.fromCache(t)}function deriveDisableCullingCommand(e){var t=DrawCommand.shallowClone(e);return t.renderState=getDisableCullingRenderState(e.renderState),t}function updateBackFaceCulling(e,t,i){var r=t.scene3DOnly;if(!e.backFaceCulling){var n=e._nodeCommands,a=n.length;if(!defined(n[0].disableCullingCommand)||i)for(var o=0;o<a;++o){var s=n[o],l=s.command;if(s.disableCullingCommand=deriveDisableCullingCommand(l),!r){var u=s.command2D;s.disableCullingCommand2D=deriveDisableCullingCommand(u)}}}}function getProgramId(e,t){var i=e._rendererResources.programs;for(var r in i)if(i.hasOwnProperty(r)&&i[r]===t)return r}function createSilhouetteProgram(e,t,i){var r=t.vertexShaderSource.sources[0],n=t._attributeLocations,a=e._normalAttributeName;r=ShaderSource.replaceMain(r,"gltf_silhouette_main"),r+="uniform float gltf_silhouetteSize; \nvoid main() \n{ \n gltf_silhouette_main(); \n vec3 n = normalize(czm_normal3D * "+a+"); \n n.x *= czm_projection[0][0]; \n n.y *= czm_projection[1][1]; \n vec4 clip = gl_Position; \n clip.xy += n.xy * clip.w * gltf_silhouetteSize * czm_pixelRatio / czm_viewport.z; \n gl_Position = clip; \n}";return ShaderProgram.fromCache({context:i.context,vertexShaderSource:r,fragmentShaderSource:"uniform vec4 gltf_silhouetteColor; \nvoid main() \n{ \n gl_FragColor = czm_gammaCorrect(gltf_silhouetteColor); \n}",attributeLocations:n})}function hasSilhouette(e,t){return silhouetteSupported(t.context)&&0<e.silhouetteSize&&0<e.silhouetteColor.alpha&&defined(e._normalAttributeName)}function hasTranslucentCommands(e){for(var t=e._nodeCommands,i=t.length,r=0;r<i;++r){if(t[r].command.pass===Pass$1.TRANSLUCENT)return!0}return!1}function isTranslucent(e){return 0<e.color.alpha&&e.color.alpha<1}function isInvisible(e){return 0===e.color.alpha}function alphaDirty(e,t){return Math.floor(e)!==Math.floor(t)||Math.ceil(e)!==Math.ceil(t)}var silhouettesLength=0;function createSilhouetteCommands(e,t){for(var i=++silhouettesLength%255,r=hasTranslucentCommands(e)||isTranslucent(e)||e.silhouetteColor.alpha<1,n=e._rendererResources.silhouettePrograms,a=t.scene3DOnly,o=e._nodeCommands,s=o.length,l=0;l<s;++l){var u=o[l],c=u.command,d=isTranslucent(e)?u.translucentCommand:c,h=DrawCommand.shallowClone(d),p=clone(d.renderState);p.stencilTest={enabled:!0,frontFunction:WebGLConstants$1.ALWAYS,backFunction:WebGLConstants$1.ALWAYS,reference:i,mask:-1,frontOperation:{fail:WebGLConstants$1.KEEP,zFail:WebGLConstants$1.KEEP,zPass:WebGLConstants$1.REPLACE},backOperation:{fail:WebGLConstants$1.KEEP,zFail:WebGLConstants$1.KEEP,zPass:WebGLConstants$1.REPLACE}},isInvisible(e)&&(p.colorMask={red:!1,green:!1,blue:!1,alpha:!1},p.depthMask=!1),p=RenderState.fromCache(p),h.renderState=p,u.silhouetteModelCommand=h;var f=DrawCommand.shallowClone(c);(p=clone(c.renderState,!0)).depthTest.enabled=!0,p.cull.enabled=!1,r&&(f.pass=Pass$1.TRANSLUCENT,p.depthMask=!1,p.blending=BlendingState$1.ALPHA_BLEND),p.stencilTest={enabled:!0,frontFunction:WebGLConstants$1.NOTEQUAL,backFunction:WebGLConstants$1.NOTEQUAL,reference:i,mask:-1,frontOperation:{fail:WebGLConstants$1.KEEP,zFail:WebGLConstants$1.KEEP,zPass:WebGLConstants$1.KEEP},backOperation:{fail:WebGLConstants$1.KEEP,zFail:WebGLConstants$1.KEEP,zPass:WebGLConstants$1.KEEP}},p=RenderState.fromCache(p);var m=c.shaderProgram,g=getProgramId(e,m),y=n[g];defined(y)||(y=createSilhouetteProgram(e,m,t),n[g]=y);var v=combine(c.uniformMap,{gltf_silhouetteColor:createSilhouetteColorFunction(e),gltf_silhouetteSize:createSilhouetteSizeFunction(e)});if(f.renderState=p,f.shaderProgram=y,f.uniformMap=v,f.castShadows=!1,f.receiveShadows=!1,u.silhouetteColorCommand=f,!a){var _=u.command2D,C=DrawCommand.shallowClone(h);C.boundingVolume=_.boundingVolume,C.modelMatrix=_.modelMatrix,u.silhouetteModelCommand2D=C;var x=DrawCommand.shallowClone(f);C.boundingVolume=_.boundingVolume,C.modelMatrix=_.modelMatrix,u.silhouetteColorCommand2D=x}}}function modifyShaderForClippingPlanes(e,t,i){return e=ShaderSource.replaceMain(e,"gltf_clip_main"),e+=Model._getClippingFunction(t,i)+"\n",e+="uniform sampler2D gltf_clippingPlanes; \nuniform mat4 gltf_clippingPlanesMatrix; \nuniform vec4 gltf_clippingPlanesEdgeStyle; \nvoid main() \n{ \n gltf_clip_main(); \n"+getClipAndStyleCode("gltf_clippingPlanes","gltf_clippingPlanesMatrix","gltf_clippingPlanesEdgeStyle")+"} \n"}function updateSilhouette(e,t,i){if(hasSilhouette(e,t)){var r=e._nodeCommands,n=alphaDirty(e.color.alpha,e._colorPreviousAlpha)||alphaDirty(e.silhouetteColor.alpha,e._silhouetteColorPreviousAlpha)||!defined(r[0].silhouetteModelCommand);e._colorPreviousAlpha=e.color.alpha,e._silhouetteColorPreviousAlpha=e.silhouetteColor.alpha,(n||i)&&createSilhouetteCommands(e,t)}}function updateClippingPlanes(e,t){var i=e._clippingPlanes;defined(i)&&i.owner===e&&i.enabled&&i.update(t)}var scratchBoundingSphere$8=new BoundingSphere;function scaleInPixels(e,t,i){return scratchBoundingSphere$8.center=e,scratchBoundingSphere$8.radius=t,i.camera.getPixelSize(scratchBoundingSphere$8,i.context.drawingBufferWidth,i.context.drawingBufferHeight)}var scratchPosition$7=new Cartesian3,scratchCartographic$a=new Cartographic;function getScale(e,t){var i=e.scale;if(0!==e.minimumPixelSize){var r=t.context,n=Math.max(r.drawingBufferWidth,r.drawingBufferHeight),a=defined(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;if(scratchPosition$7.x=a[12],scratchPosition$7.y=a[13],scratchPosition$7.z=a[14],defined(e._rtcCenter)&&Cartesian3.add(e._rtcCenter,scratchPosition$7,scratchPosition$7),e._mode!==SceneMode$1.SCENE3D){var o=t.mapProjection,s=o.ellipsoid.cartesianToCartographic(scratchPosition$7,scratchCartographic$a);o.project(s,scratchPosition$7),Cartesian3.fromElements(scratchPosition$7.z,scratchPosition$7.x,scratchPosition$7.y,scratchPosition$7)}var l=e.boundingSphere.radius,u=scaleInPixels(scratchPosition$7,l,t),c=1/u;Math.min(2*l*c,n)<e.minimumPixelSize&&(i=e.minimumPixelSize*u/(2*e._initialRadius))}return defined(e.maximumScale)?Math.min(e.maximumScale,i):i}function releaseCachedGltf(e){defined(e._cacheKey)&&defined(e._cachedGltf)&&0==--e._cachedGltf.count&&delete gltfCache[e._cacheKey],e._cachedGltf=void 0}function CachedRendererResources(e,t){this.buffers=void 0,this.vertexArrays=void 0,this.programs=void 0,this.sourceShaders=void 0,this.silhouettePrograms=void 0,this.textures=void 0,this.samplers=void 0,this.renderStates=void 0,this.ready=!1,this.context=e,this.cacheKey=t,this.count=0}function destroy(e){for(var t in e)e.hasOwnProperty(t)&&e[t].destroy()}function destroyCachedRendererResources(e){destroy(e.buffers),destroy(e.vertexArrays),destroy(e.programs),destroy(e.silhouettePrograms),destroy(e.textures)}function getUpdateHeightCallback(r,n,a){return function(e){if(r.heightReference===HeightReference$1.RELATIVE_TO_GROUND){var t=n.cartesianToCartographic(e,scratchCartographic$a);t.height+=a.height,n.cartographicToCartesian(t,e)}var i=r._clampedModelMatrix;Matrix4.clone(r.modelMatrix,i),i[12]=e.x,i[13]=e.y,i[14]=e.z,r._heightChanged=!0}}function updateClamping(e){defined(e._removeUpdateHeightCallback)&&(e._removeUpdateHeightCallback(),e._removeUpdateHeightCallback=void 0);var t=e._scene;if(defined(t)&&defined(t.globe)&&e.heightReference!==HeightReference$1.NONE){var i=t.globe,r=i.ellipsoid,n=e.modelMatrix;scratchPosition$7.x=n[12],scratchPosition$7.y=n[13],scratchPosition$7.z=n[14];var a=r.cartesianToCartographic(scratchPosition$7);defined(e._clampedModelMatrix)||(e._clampedModelMatrix=Matrix4.clone(n,new Matrix4));var o=i._surface;e._removeUpdateHeightCallback=o.updateHeight(a,getUpdateHeightCallback(e,r,a));var s=i.getHeight(a);if(defined(s)){var l=getUpdateHeightCallback(e,r,a);Cartographic.clone(a,scratchCartographic$a),scratchCartographic$a.height=s,r.cartographicToCartesian(scratchCartographic$a,scratchPosition$7),l(scratchPosition$7)}}else e._clampedModelMatrix=void 0}CachedRendererResources.prototype.release=function(){if(0==--this.count)return defined(this.cacheKey)&&delete this.context.cache.modelRendererResourceCache[this.cacheKey],destroyCachedRendererResources(this),destroyObject(this)};var scratchDisplayConditionCartesian=new Cartesian3,scratchDistanceDisplayConditionCartographic=new Cartographic;function distanceDisplayConditionVisible(e,t){var i,r=e.distanceDisplayCondition,n=r.near*r.near,a=r.far*r.far;if(t.mode===SceneMode$1.SCENE2D){i=.5*(t.camera.frustum.right-t.camera.frustum.left),i*=i}else{var o=Matrix4.getTranslation(e.modelMatrix,scratchDisplayConditionCartesian);if(t.mode===SceneMode$1.COLUMBUS_VIEW){var s=t.mapProjection,l=s.ellipsoid.cartesianToCartographic(o,scratchDistanceDisplayConditionCartographic);o=s.project(l,o),Cartesian3.fromElements(o.z,o.x,o.y,o)}i=Cartesian3.distanceSquared(o,t.camera.positionWC)}return n<=i&&i<=a}function destroyIfNotCached(e,t){e.programs!==t.programs&&destroy(e.programs),e.silhouettePrograms!==t.silhouettePrograms&&destroy(e.silhouettePrograms)}function regenerateShaders(e,t){var i,r=e._rendererResources,n=e._cachedRendererResources;if(destroyIfNotCached(r,n),isClippingEnabled(e)||isColorShadingEnabled(e)||e._shouldRegenerateShaders){e._shouldRegenerateShaders=!1,r.programs={},r.silhouettePrograms={};var a={},o=e._sourceTechniques;for(var s in o)o.hasOwnProperty(s)&&(a[i=o[s].program]||(a[i]=!0,recreateProgram({programId:i,techniqueId:s},e,t.context)))}else r.programs=n.programs,r.silhouettePrograms=n.silhouettePrograms;for(var l=r.programs,u=e._nodeCommands,c=u.length,d=0;d<c;++d){var h=u[d],p=l[i=h.programId];h.command.shaderProgram=p,defined(h.command2D)&&(h.command2D.shaderProgram=p)}updateColor(e,t,!0),updateBackFaceCulling(e,t,!0),updateSilhouette(e,t,!0)}function Batched3DModel3DTileContent(e,t,i,r,n){this._tileset=e,this._tile=t,this._resource=i,this._model=void 0,this._batchTable=void 0,this._features=void 0,this._batchIdAttributeName=void 0,this._diffuseAttributeOrUniformName={},this._rtcCenterTransform=void 0,this._contentModelMatrix=void 0,this.featurePropertiesDirty=!1,initialize$2(this,r,n)}Model.prototype.update=function(e){if(e.mode!==SceneMode$1.MORPHING)if(FeatureDetection$1.supportsWebP.initialized){var t=FeatureDetection$1.supportsWebP(),i=e.context;if(this._defaultTexture=i.defaultTexture,this._state===ModelState$1.NEEDS_LOAD&&defined(this.gltf)){var r,n=this.cacheKey;if(defined(n)){i.cache.modelRendererResourceCache=defaultValue(i.cache.modelRendererResourceCache,{});var a=i.cache.modelRendererResourceCache;if(defined(r=a[this.cacheKey])){if(!r.ready)return;++r.count,this._loadRendererResourcesFromCache=!0}else(r=new CachedRendererResources(i,n)).count=1,a[this.cacheKey]=r;this._cachedRendererResources=r}else(r=new CachedRendererResources(i)).count=1,this._cachedRendererResources=r;if(this._state=ModelState$1.LOADING,this._state!==ModelState$1.FAILED){var o=this.gltf.extensions;if(defined(o)&&defined(o.CESIUM_RTC)){var s=Cartesian3.fromArray(o.CESIUM_RTC.center);if(!Cartesian3.equals(s,Cartesian3.ZERO)){this._rtcCenter3D=s;var l=e.mapProjection,u=l.ellipsoid.cartesianToCartographic(this._rtcCenter3D),c=l.project(u);Cartesian3.fromElements(c.z,c.x,c.y,c),this._rtcCenter2D=c,this._rtcCenterEye=new Cartesian3,this._rtcCenter=this._rtcCenter3D}}addPipelineExtras(this.gltf),this._loadResources=new ModelLoadResources,this._loadRendererResourcesFromCache||ModelUtility.parseBuffers(this,bufferLoad)}}var d=this._loadResources,h=this._incrementallyLoadTextures,p=!1;if(this._state===ModelState$1.LOADING){if(0===d.pendingBufferLoads){if(!d.initialized){if(e.brdfLutGenerator.update(e),ModelUtility.checkSupportedExtensions(this.extensionsRequired,t),ModelUtility.updateForwardAxis(this),!defined(this.gltf.extras.sourceVersion)){var f=this.gltf;f.extras.sourceVersion=ModelUtility.getAssetVersion(f),f.extras.sourceKHRTechniquesWebGL=defined(ModelUtility.getUsedExtensions(f).KHR_techniques_webgl),this._sourceVersion=f.extras.sourceVersion,this._sourceKHRTechniquesWebGL=f.extras.sourceKHRTechniquesWebGL,updateVersion(f),addDefaults(f);var m={addBatchIdToGeneratedShaders:this._addBatchIdToGeneratedShaders};processModelMaterialsCommon(f,m),processPbrMaterials(f,m)}this._sourceVersion=this.gltf.extras.sourceVersion,this._sourceKHRTechniquesWebGL=this.gltf.extras.sourceKHRTechniquesWebGL,this._dequantizeInShader=this._dequantizeInShader&&DracoLoader.hasExtension(this),addBuffersToLoadResources$1(this),parseArticulations(this),parseTechniques(this),this._loadRendererResourcesFromCache||(parseBufferViews$1(this),parseShaders(this),parsePrograms(this),parseTextures(this,i,t)),parseMaterials(this),parseMeshes(this),parseNodes(this),DracoLoader.parse(this,i),d.initialized=!0}d.finishedDecoding()||DracoLoader.decodeModel(this,i).otherwise(ModelUtility.getFailedLoadFunction(this,"model",this.basePath)),d.finishedDecoding()&&!d.resourcesParsed&&(this._boundingSphere=ModelUtility.computeBoundingSphere(this),this._initialRadius=this._boundingSphere.radius,DracoLoader.cacheDataForModel(this),d.resourcesParsed=!0),d.resourcesParsed&&0===d.pendingShaderLoads&&createResources$1(this,e)}(d.finished()||h&&d.finishedEverythingButTextureCreation())&&(this._state=ModelState$1.LOADED,p=!0)}if(defined(d)&&this._state===ModelState$1.LOADED&&(h&&!p&&createResources$1(this,e),d.finished())){this._loadResources=void 0;var g=this._rendererResources,y=this._cachedRendererResources;y.buffers=g.buffers,y.vertexArrays=g.vertexArrays,y.programs=g.programs,y.sourceShaders=g.sourceShaders,y.silhouettePrograms=g.silhouettePrograms,y.textures=g.textures,y.samplers=g.samplers,y.renderStates=g.renderStates,y.ready=!0,this._normalAttributeName=ModelUtility.getAttributeOrUniformBySemantic(this.gltf,"NORMAL"),defined(this._precreatedAttributes)&&(y.vertexArrays={}),this.releaseGltfJson&&releaseCachedGltf(this)}var v=OctahedralProjectedCubeMap.isSupported(i);if(this._shouldUpdateSpecularMapAtlas&&v){if(this._shouldUpdateSpecularMapAtlas=!1,this._specularEnvironmentMapAtlas=this._specularEnvironmentMapAtlas&&this._specularEnvironmentMapAtlas.destroy(),this._specularEnvironmentMapAtlas=void 0,defined(this._specularEnvironmentMaps)){this._specularEnvironmentMapAtlas=new OctahedralProjectedCubeMap(this._specularEnvironmentMaps);var _=this;this._specularEnvironmentMapAtlas.readyPromise.then(function(){_._shouldRegenerateShaders=!0}).otherwise(function(e){console.error("Error loading specularEnvironmentMaps: "+e)})}this._shouldRegenerateShaders=!0}defined(this._specularEnvironmentMapAtlas)&&this._specularEnvironmentMapAtlas.update(e);var C=!defined(this._specularEnvironmentMapAtlas)&&defined(e.specularEnvironmentMaps)&&!this._useDefaultSpecularMaps,x=!defined(e.specularEnvironmentMaps)&&this._useDefaultSpecularMaps,b=!defined(this._sphericalHarmonicCoefficients)&&defined(e.sphericalHarmonicCoefficients)&&!this._useDefaultSphericalHarmonics,A=!defined(e.sphericalHarmonicCoefficients)&&this._useDefaultSphericalHarmonics;this._shouldRegenerateShaders=this._shouldRegenerateShaders||C||x||b||A,this._useDefaultSpecularMaps=!defined(this._specularEnvironmentMapAtlas)&&defined(e.specularEnvironmentMaps),this._useDefaultSphericalHarmonics=!defined(this._sphericalHarmonicCoefficients)&&defined(e.sphericalHarmonicCoefficients);var S=hasSilhouette(this,e),w=isTranslucent(this),E=isInvisible(this),T=this.backFaceCulling,P=!defined(this.distanceDisplayCondition)||distanceDisplayConditionVisible(this,e),M=this.show&&P&&0!==this.scale&&(!E||S);if(M&&this._state===ModelState$1.LOADED||p){var D=this.activeAnimations.update(e)||this._cesiumAnimationsDirty;this._cesiumAnimationsDirty=!1,this._dirty=!1;var I=this.modelMatrix,O=e.mode!==this._mode;this._mode=e.mode;var R=!Matrix4.equals(this._modelMatrix,I)||this._scale!==this.scale||this._minimumPixelSize!==this.minimumPixelSize||0!==this.minimumPixelSize||this._maximumScale!==this.maximumScale||this._heightReference!==this.heightReference||this._heightChanged||O;if(R||p){Matrix4.clone(I,this._modelMatrix),updateClamping(this),defined(this._clampedModelMatrix)&&(I=this._clampedModelMatrix),this._scale=this.scale,this._minimumPixelSize=this.minimumPixelSize,this._maximumScale=this.maximumScale,this._heightReference=this.heightReference,this._heightChanged=!1;var L=getScale(this,e),N=this._computedModelMatrix;Matrix4.multiplyByUniformScale(I,L,N),this._upAxis===Axis$1.Y?Matrix4.multiplyTransformation(N,Axis$1.Y_UP_TO_Z_UP,N):this._upAxis===Axis$1.X&&Matrix4.multiplyTransformation(N,Axis$1.X_UP_TO_Z_UP,N),this.forwardAxis===Axis$1.Z&&Matrix4.multiplyTransformation(N,Axis$1.Z_UP_TO_X_UP,N)}(D||R||p)&&(updateNodeHierarchyModelMatrix(this,R,p,e.mapProjection),this._dirty=!0,(D||p)&&applySkins(this)),this._perNodeShowDirty&&(this._perNodeShowDirty=!1,updatePerNodeShow(this)),updatePickIds(this),updateWireframe$1(this),updateShowBoundingVolume(this),updateShadows(this),updateClippingPlanes(this,e);var k=this._clippingPlanes,B=0,F=defined(k)&&k.enabled&&0<k.length,V=defined(this._sphericalHarmonicCoefficients)||this._useDefaultSphericalHarmonics,z=defined(this._specularEnvironmentMapAtlas)&&this._specularEnvironmentMapAtlas.ready||this._useDefaultSpecularMaps;if(F||V||z){var U=defaultValue(this.clippingPlanesOriginMatrix,I);Matrix4.multiply(i.uniformState.view3D,U,this._clippingPlaneModelViewMatrix)}F&&(B=k.clippingPlanesState);var G=this._shouldRegenerateShaders;G=G||this._clippingPlanesState!==B,this._clippingPlanesState=B;var $=isColorShadingEnabled(this);$!==this._colorShadingEnabled&&(this._colorShadingEnabled=$,G=!0),G?regenerateShaders(this,e):(updateColor(this,e,!1),updateBackFaceCulling(this,e,!1),updateSilhouette(this,e,!1))}if(p){var H=this;e.afterRender.push(function(){H._ready=!0,H._readyPromise.resolve(H)})}else{if(M&&!this._ignoreCommands){var W,j,q,Q=e.commandList,Y=e.passes,X=this._nodeCommands,Z=X.length,J=e.mapProjection.ellipsoid.maximumRadius*CesiumMath.PI;if(Y.render||Y.pick&&this.allowPicking){for(W=0;W<Z;++W)if((j=X[W]).show){var K=j.command;if(S?K=j.silhouetteModelCommand:w?K=j.translucentCommand:T||(K=j.disableCullingCommand),Q.push(K),q=j.command.boundingVolume,e.mode===SceneMode$1.SCENE2D&&(q.center.y+q.radius>J||q.center.y-q.radius<J)){var ee=j.command2D;S?ee=j.silhouetteModelCommand2D:w?ee=j.translucentCommand2D:T||(ee=j.disableCullingCommand2D),Q.push(ee)}}if(S&&!Y.pick)for(W=0;W<Z;++W)(j=X[W]).show&&(Q.push(j.silhouetteColorCommand),q=j.command.boundingVolume,e.mode===SceneMode$1.SCENE2D&&(q.center.y+q.radius>J||q.center.y-q.radius<J)&&Q.push(j.silhouetteColorCommand2D))}}var te=this._credit;defined(te)&&e.creditDisplay.addCredit(te);for(var ie=this._resourceCredits,re=ie.length,ne=0;ne<re;ne++)e.creditDisplay.addCredit(ie[ne])}}else FeatureDetection$1.supportsWebP.initialize()},Model.prototype.isDestroyed=function(){return!1},Model.prototype.destroy=function(){defined(this._precreatedAttributes)&&destroy(this._rendererResources.vertexArrays),defined(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),defined(this._terrainProviderChangedCallback)&&(this._terrainProviderChangedCallback(),this._terrainProviderChangedCallback=void 0),defined(this._cachedRendererResources)&&destroyIfNotCached(this._rendererResources,this._cachedRendererResources),this._rendererResources=void 0,this._cachedRendererResources=this._cachedRendererResources&&this._cachedRendererResources.release(),DracoLoader.destroyCachedDataForModel(this);for(var e=this._pickIds,t=e.length,i=0;i<t;++i)e[i].destroy();releaseCachedGltf(this),this._quantizedVertexShaders=void 0;var r=this._clippingPlanes;return defined(r)&&!r.isDestroyed()&&r.owner===this&&r.destroy(),this._clippingPlanes=void 0,this._specularEnvironmentMapAtlas=this._specularEnvironmentMapAtlas&&this._specularEnvironmentMapAtlas.destroy(),destroyObject(this)},Model._getClippingFunction=getClippingFunction,Model._modifyShaderForColor=modifyShaderForColor,Batched3DModel3DTileContent._deprecationWarning=deprecationWarning,Object.defineProperties(Batched3DModel3DTileContent.prototype,{featuresLength:{get:function(){return this._batchTable.featuresLength}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return this._model.trianglesLength}},geometryByteLength:{get:function(){return this._model.geometryByteLength}},texturesByteLength:{get:function(){return this._model.texturesByteLength}},batchTableByteLength:{get:function(){return this._batchTable.memorySizeInBytes}},innerContents:{get:function(){}},readyPromise:{get:function(){return this._model.readyPromise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){return this._batchTable}}});var sizeOfUint32$4=Uint32Array.BYTES_PER_ELEMENT;function getBatchIdAttributeName(e){var t=ModelUtility.getAttributeOrUniformBySemantic(e,"_BATCHID");return defined(t)||defined(t=ModelUtility.getAttributeOrUniformBySemantic(e,"BATCHID"))&&Batched3DModel3DTileContent._deprecationWarning("b3dm-legacy-batchid","The glTF in this b3dm uses the semantic `BATCHID`. Application-specific semantics should be prefixed with an underscore: `_BATCHID`."),t}function getVertexShaderCallback(o){return function(e,t){var i=o._batchTable,r=!defined(o._tileset.classificationType),n=o._model.gltf;defined(n)&&(o._batchIdAttributeName=getBatchIdAttributeName(n),o._diffuseAttributeOrUniformName[t]=ModelUtility.getDiffuseAttributeOrUniform(n,t));var a=i.getVertexShaderCallback(r,o._batchIdAttributeName,o._diffuseAttributeOrUniformName[t]);return defined(a)?a(e):e}}function getFragmentShaderCallback(o){return function(e,t){var i=o._batchTable,r=!defined(o._tileset.classificationType),n=o._model.gltf;defined(n)&&(o._diffuseAttributeOrUniformName[t]=ModelUtility.getDiffuseAttributeOrUniform(n,t));var a=i.getFragmentShaderCallback(r,o._diffuseAttributeOrUniformName[t]);return defined(a)?a(e):e}}function getPickIdCallback(e){return function(){return e._batchTable.getPickId()}}function getClassificationFragmentShaderCallback(i){return function(e){var t=i._batchTable.getClassificationFragmentShaderCallback();return defined(t)?t(e):e}}function createColorChangedCallback(i){return function(e,t){i._model.updateCommands(e,t)}}function initialize$2(e,t,i){var r=e._tileset,n=e._tile,a=e._resource,o=defaultValue(i,0);i=o;var s=new Uint8Array(t),l=new DataView(t);i+=sizeOfUint32$4;var u=l.getUint32(i,!0);if(1!==u)throw new RuntimeError("Only Batched 3D Model version 1 is supported. Version "+u+" is not.");i+=sizeOfUint32$4;var c=l.getUint32(i,!0);i+=sizeOfUint32$4;var d=l.getUint32(i,!0);i+=sizeOfUint32$4;var h=l.getUint32(i,!0);i+=sizeOfUint32$4;var p=l.getUint32(i,!0);i+=sizeOfUint32$4;var f,m,g=l.getUint32(i,!0);if(i+=sizeOfUint32$4,570425344<=p?(i-=2*sizeOfUint32$4,f=d,p=h,h=d=g=0,Batched3DModel3DTileContent._deprecationWarning("b3dm-legacy-header","This b3dm header is using the legacy format [batchLength] [batchTableByteLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/CesiumGS/3d-tiles/tree/master/specification/TileFormats/Batched3DModel.")):570425344<=g&&(i-=sizeOfUint32$4,f=p,p=d,g=h,h=d=0,Batched3DModel3DTileContent._deprecationWarning("b3dm-legacy-header","This b3dm header is using the legacy format [batchTableJsonByteLength] [batchTableBinaryByteLength] [batchLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/CesiumGS/3d-tiles/tree/master/specification/TileFormats/Batched3DModel.")),0===d)m={BATCH_LENGTH:defaultValue(f,0)};else{var y=getStringFromTypedArray(s,i,d);m=JSON.parse(y),i+=d}var v=new Uint8Array(t,i,h);i+=h;var _,C,x,b=new Cesium3DTileFeatureTable(m,v);if(f=b.getGlobalProperty("BATCH_LENGTH"),b.featuresLength=f,0<p){var A=getStringFromTypedArray(s,i,p);_=JSON.parse(A),i+=p,0<g&&(C=new Uint8Array(t,i,g),C=new Uint8Array(C),i+=g)}defined(r.classificationType)&&(x=createColorChangedCallback(e));var S=new Cesium3DTileBatchTable(e,f,_,C,x);e._batchTable=S;var w,E=o+c-i;if(0==E)throw new RuntimeError("glTF byte length must be greater than 0.");w=i%4==0?new Uint8Array(t,i,E):(Batched3DModel3DTileContent._deprecationWarning("b3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),new Uint8Array(s.subarray(i,i+E)));var T={content:e,primitive:r};e._rtcCenterTransform=Matrix4.IDENTITY;var P=b.getGlobalProperty("RTC_CENTER",ComponentDatatype$1.FLOAT,3);defined(P)&&(e._rtcCenterTransform=Matrix4.fromTranslation(Cartesian3.fromArray(P))),e._contentModelMatrix=Matrix4.multiply(n.computedTransform,e._rtcCenterTransform,new Matrix4),defined(r.classificationType)?e._model=new ClassificationModel({gltf:w,cull:!1,basePath:a,requestType:RequestType$1.TILES3D,modelMatrix:e._contentModelMatrix,upAxis:r._gltfUpAxis,forwardAxis:Axis$1.X,debugWireframe:r.debugWireframe,vertexShaderLoaded:getVertexShaderCallback(e),classificationShaderLoaded:getClassificationFragmentShaderCallback(e),uniformMapLoaded:S.getUniformMapCallback(),pickIdLoaded:getPickIdCallback(e),classificationType:r._classificationType,batchTable:S}):(e._model=new Model({gltf:w,cull:!1,releaseGltfJson:!0,opaquePass:Pass$1.CESIUM_3D_TILE,basePath:a,requestType:RequestType$1.TILES3D,modelMatrix:e._contentModelMatrix,upAxis:r._gltfUpAxis,forwardAxis:Axis$1.X,shadows:r.shadows,debugWireframe:r.debugWireframe,incrementallyLoadTextures:!1,vertexShaderLoaded:getVertexShaderCallback(e),fragmentShaderLoaded:getFragmentShaderCallback(e),uniformMapLoaded:S.getUniformMapCallback(),pickIdLoaded:getPickIdCallback(e),addBatchIdToGeneratedShaders:0<f,pickObject:T,imageBasedLightingFactor:r.imageBasedLightingFactor,lightColor:r.lightColor,luminanceAtZenith:r.luminanceAtZenith,sphericalHarmonicCoefficients:r.sphericalHarmonicCoefficients,specularEnvironmentMaps:r.specularEnvironmentMaps,backFaceCulling:r.backFaceCulling}),e._model.readyPromise.then(function(e){e.activeAnimations.addAll({loop:ModelAnimationLoop$1.REPEAT})}))}function createFeatures(e){var t=e.featuresLength;if(!defined(e._features)&&0<t){for(var i=new Array(t),r=0;r<t;++r)i[r]=new Cesium3DTileFeature(e,r);e._features=i}}function Composite3DTileContent(e,t,i,r,n,a){this._tileset=e,this._tile=t,this._resource=i,this._contents=[],this._readyPromise=when.defer(),initialize$3(this,r,n,a)}Batched3DModel3DTileContent.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)},Batched3DModel3DTileContent.prototype.getFeature=function(e){return createFeatures(this),this._features[e]},Batched3DModel3DTileContent.prototype.applyDebugSettings=function(e,t){t=e?t:Color.WHITE,0===this.featuresLength?this._model.color=t:this._batchTable.setAllColor(t)},Batched3DModel3DTileContent.prototype.applyStyle=function(e){if(0===this.featuresLength){var t=defined(e)&&defined(e.color),i=defined(e)&&defined(e.show);this._model.color=t?e.color.evaluateColor(void 0,this._model.color):Color.clone(Color.WHITE,this._model.color),this._model.show=!i||e.show.evaluate(void 0)}else this._batchTable.applyStyle(e)},Batched3DModel3DTileContent.prototype.update=function(e,t){var i=t.commandList.length;this._batchTable.update(e,t),this._contentModelMatrix=Matrix4.multiply(this._tile.computedTransform,this._rtcCenterTransform,this._contentModelMatrix),this._model.modelMatrix=this._contentModelMatrix,this._model.shadows=this._tileset.shadows,this._model.imageBasedLightingFactor=this._tileset.imageBasedLightingFactor,this._model.lightColor=this._tileset.lightColor,this._model.luminanceAtZenith=this._tileset.luminanceAtZenith,this._model.sphericalHarmonicCoefficients=this._tileset.sphericalHarmonicCoefficients,this._model.specularEnvironmentMaps=this._tileset.specularEnvironmentMaps,this._model.backFaceCulling=this._tileset.backFaceCulling,this._model.debugWireframe=this._tileset.debugWireframe;var r=this._tileset.clippingPlanes;this._model.clippingPlanesOriginMatrix=this._tileset.clippingPlanesOriginMatrix,defined(r)&&this._tile.clippingPlanesDirty&&(this._model._clippingPlanes=r.enabled&&this._tile._isClipped?r:void 0),defined(r)&&defined(this._model._clippingPlanes)&&this._model._clippingPlanes!==r&&(this._model._clippingPlanes=r),this._model.update(t),i<t.commandList.length&&(t.passes.render||t.passes.pick)&&!defined(e.classificationType)&&this._batchTable.addDerivedCommands(t,i)},Batched3DModel3DTileContent.prototype.isDestroyed=function(){return!1},Batched3DModel3DTileContent.prototype.destroy=function(){return this._model=this._model&&this._model.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),destroyObject(this)},Object.defineProperties(Composite3DTileContent.prototype,{featurePropertiesDirty:{get:function(){for(var e=this._contents,t=e.length,i=0;i<t;++i)if(e[i].featurePropertiesDirty)return!0;return!1},set:function(e){for(var t=this._contents,i=t.length,r=0;r<i;++r)t[r].featurePropertiesDirty=e}},featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){return this._contents}},readyPromise:{get:function(){return this._readyPromise.promise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){}}});var sizeOfUint32$5=Uint32Array.BYTES_PER_ELEMENT;function initialize$3(t,e,i,r){i=defaultValue(i,0);var n=new Uint8Array(e),a=new DataView(e);i+=sizeOfUint32$5;var o=a.getUint32(i,!0);if(1!==o)throw new RuntimeError("Only Composite Tile version 1 is supported. Version "+o+" is not.");i+=sizeOfUint32$5,i+=sizeOfUint32$5;var s=a.getUint32(i,!0);i+=sizeOfUint32$5;for(var l=[],u=0;u<s;++u){var c=getMagic(n,i),d=a.getUint32(i+2*sizeOfUint32$5,!0),h=r[c];if(!defined(h))throw new RuntimeError("Unknown tile content type, "+c+", inside Composite tile");var p=h(t._tileset,t._tile,t._resource,e,i);t._contents.push(p),l.push(p.readyPromise),i+=d}when.all(l).then(function(){t._readyPromise.resolve(t)}).otherwise(function(e){t._readyPromise.reject(e)})}function Vector3DTileGeometry(e){this._boxes=e.boxes,this._boxBatchIds=e.boxBatchIds,this._cylinders=e.cylinders,this._cylinderBatchIds=e.cylinderBatchIds,this._ellipsoids=e.ellipsoids,this._ellipsoidBatchIds=e.ellipsoidBatchIds,this._spheres=e.spheres,this._sphereBatchIds=e.sphereBatchIds,this._modelMatrix=e.modelMatrix,this._batchTable=e.batchTable,this._boundingVolume=e.boundingVolume,this._center=e.center,defined(this._center)||(defined(this._boundingVolume)?this._center=Cartesian3.clone(this._boundingVolume.center):this._center=Cartesian3.clone(Cartesian3.ZERO)),this._boundingVolumes=void 0,this._batchedIndices=void 0,this._indices=void 0,this._indexOffsets=void 0,this._indexCounts=void 0,this._positions=void 0,this._vertexBatchIds=void 0,this._batchIds=void 0,this._batchTableColors=void 0,this._packedBuffer=void 0,this._ready=!1,this._readyPromise=when.defer(),this._verticesPromise=void 0,this._primitive=void 0,this.debugWireframe=!1,this.forceRebatch=!1,this.classificationType=ClassificationType$1.BOTH}function packBuffer(e){var t=new Float64Array(Matrix4.packedLength+Cartesian3.packedLength),i=0;return Cartesian3.pack(e._center,t,i),i+=Cartesian3.packedLength,Matrix4.pack(e._modelMatrix,t,i),t}function unpackBuffer(e,t){for(var i=0,r=t[i++],n=t[i++],a=e._boundingVolumes=new Array(n),o=0;o<n;++o)a[o]=BoundingSphere.unpack(t,i),i+=BoundingSphere.packedLength;for(var s=t[i++],l=e._batchedIndices=new Array(s),u=0;u<s;++u){var c=Color.unpack(t,i);i+=Color.packedLength;for(var d=t[i++],h=t[i++],p=t[i++],f=new Array(p),m=0;m<p;++m)f[m]=t[i++];l[u]=new Vector3DTileBatch({color:c,offset:d,count:h,batchIds:f})}return r}Composite3DTileContent.prototype.hasProperty=function(e,t){return!1},Composite3DTileContent.prototype.getFeature=function(e){},Composite3DTileContent.prototype.applyDebugSettings=function(e,t){for(var i=this._contents,r=i.length,n=0;n<r;++n)i[n].applyDebugSettings(e,t)},Composite3DTileContent.prototype.applyStyle=function(e){for(var t=this._contents,i=t.length,r=0;r<i;++r)t[r].applyStyle(e)},Composite3DTileContent.prototype.update=function(e,t){for(var i=this._contents,r=i.length,n=0;n<r;++n)i[n].update(e,t)},Composite3DTileContent.prototype.isDestroyed=function(){return!1},Composite3DTileContent.prototype.destroy=function(){for(var e=this._contents,t=e.length,i=0;i<t;++i)e[i].destroy();return destroyObject(this)},Object.defineProperties(Vector3DTileGeometry.prototype,{trianglesLength:{get:function(){return defined(this._primitive)?this._primitive.trianglesLength:0}},geometryByteLength:{get:function(){return defined(this._primitive)?this._primitive.geometryByteLength:0}},readyPromise:{get:function(){return this._readyPromise.promise}}}),Vector3DTileGeometry.packedBoxLength=Matrix4.packedLength+Cartesian3.packedLength,Vector3DTileGeometry.packedCylinderLength=Matrix4.packedLength+2,Vector3DTileGeometry.packedEllipsoidLength=Matrix4.packedLength+Cartesian3.packedLength,Vector3DTileGeometry.packedSphereLength=Cartesian3.packedLength+1;var createVerticesTaskProcessor=new TaskProcessor("createVectorTileGeometries"),scratchColor$6=new Color;function createPrimitive$1(r){if(!defined(r._primitive)){if(!defined(r._verticesPromise)){var e=r._boxes,t=r._boxBatchIds,i=r._cylinders,n=r._cylinderBatchIds,a=r._ellipsoids,o=r._ellipsoidBatchIds,s=r._spheres,l=r._sphereBatchIds,u=r._batchTableColors,c=r._packedBuffer;if(!defined(u)){var d=0;defined(r._boxes)&&(e=r._boxes=arraySlice(e),d+=(t=r._boxBatchIds=arraySlice(t)).length),defined(r._cylinders)&&(i=r._cylinders=arraySlice(i),d+=(n=r._cylinderBatchIds=arraySlice(n)).length),defined(r._ellipsoids)&&(a=r._ellipsoids=arraySlice(a),d+=(o=r._ellipsoidBatchIds=arraySlice(o)).length),defined(r._spheres)&&(s=r._sphere=arraySlice(s),d+=(l=r._sphereBatchIds=arraySlice(l)).length),u=r._batchTableColors=new Uint32Array(d);for(var h=r._batchTable,p=0;p<d;++p){var f=h.getColor(p,scratchColor$6);u[p]=f.toRgba()}c=r._packedBuffer=packBuffer(r)}var m=[];defined(e)&&m.push(e.buffer,t.buffer),defined(i)&&m.push(i.buffer,n.buffer),defined(a)&&m.push(a.buffer,o.buffer),defined(s)&&m.push(s.buffer,l.buffer),m.push(u.buffer,c.buffer);var g={boxes:defined(e)?e.buffer:void 0,boxBatchIds:defined(e)?t.buffer:void 0,cylinders:defined(i)?i.buffer:void 0,cylinderBatchIds:defined(i)?n.buffer:void 0,ellipsoids:defined(a)?a.buffer:void 0,ellipsoidBatchIds:defined(a)?o.buffer:void 0,spheres:defined(s)?s.buffer:void 0,sphereBatchIds:defined(s)?l.buffer:void 0,batchTableColors:u.buffer,packedBuffer:c.buffer},y=r._verticesPromise=createVerticesTaskProcessor.scheduleTask(g,m);if(!defined(y))return;y.then(function(e){var t=new Float64Array(e.packedBuffer),i=unpackBuffer(r,t);r._indices=2===i?new Uint16Array(e.indices):new Uint32Array(e.indices),r._indexOffsets=new Uint32Array(e.indexOffsets),r._indexCounts=new Uint32Array(e.indexCounts),r._positions=new Float32Array(e.positions),r._vertexBatchIds=new Uint16Array(e.vertexBatchIds),r._batchIds=new Uint16Array(e.batchIds),r._ready=!0})}r._ready&&!defined(r._primitive)&&(r._primitive=new Vector3DTilePrimitive({batchTable:r._batchTable,positions:r._positions,batchIds:r._batchIds,vertexBatchIds:r._vertexBatchIds,indices:r._indices,indexOffsets:r._indexOffsets,indexCounts:r._indexCounts,batchedIndices:r._batchedIndices,boundingVolume:r._boundingVolume,boundingVolumes:r._boundingVolumes,center:r._center,pickObject:defaultValue(r._pickObject,r)}),r._boxes=void 0,r._boxBatchIds=void 0,r._cylinders=void 0,r._cylinderBatchIds=void 0,r._ellipsoids=void 0,r._ellipsoidBatchIds=void 0,r._spheres=void 0,r._sphereBatchIds=void 0,r._center=void 0,r._modelMatrix=void 0,r._batchTable=void 0,r._boundingVolume=void 0,r._boundingVolumes=void 0,r._batchedIndices=void 0,r._indices=void 0,r._indexOffsets=void 0,r._indexCounts=void 0,r._positions=void 0,r._vertexBatchIds=void 0,r._batchIds=void 0,r._batchTableColors=void 0,r._packedBuffer=void 0,r._verticesPromise=void 0,r._readyPromise.resolve())}}function Geometry3DTileContent(e,t,i,r,n){this._tileset=e,this._tile=t,this._resource=i,this._geometries=void 0,this._contentReadyPromise=void 0,this._readyPromise=when.defer(),this._batchTable=void 0,this._features=void 0,this.featurePropertiesDirty=!1,initialize$4(this,r,n)}function createColorChangedCallback$1(i){return function(e,t){defined(i._geometries)&&i._geometries.updateCommands(e,t)}}function getBatchIds(e,t){var i,r,n,a,o,s=defaultValue(e.BOXES_LENGTH,0),l=defaultValue(e.CYLINDERS_LENGTH,0),u=defaultValue(e.ELLIPSOIDS_LENGTH,0),c=defaultValue(e.SPHERES_LENGTH,0);if(0<s&&defined(e.BOX_BATCH_IDS)){var d=t.byteOffset+e.BOX_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,d,s)}if(0<l&&defined(e.CYLINDER_BATCH_IDS)){var h=t.byteOffset+e.CYLINDER_BATCH_IDS.byteOffset;r=new Uint16Array(t.buffer,h,l)}if(0<u&&defined(e.ELLIPSOID_BATCH_IDS)){var p=t.byteOffset+e.ELLIPSOID_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,p,u)}if(0<c&&defined(e.SPHERE_BATCH_IDS)){var f=t.byteOffset+e.SPHERE_BATCH_IDS.byteOffset;a=new Uint16Array(t.buffer,f,c)}var m=defined(i)||defined(r)||defined(n)||defined(a),g=0<s&&!defined(i)||0<l&&!defined(r)||0<u&&!defined(n)||0<c&&!defined(a);if(m&&g)throw new RuntimeError("If one group of batch ids is defined, then all batch ids must be defined.");if(!(defined(i)||defined(r)||defined(n)||defined(a))){var y=0;if(!defined(i)&&0<s)for(i=new Uint16Array(s),o=0;o<s;++o)i[o]=y++;if(!defined(r)&&0<l)for(r=new Uint16Array(l),o=0;o<l;++o)r[o]=y++;if(!defined(n)&&0<u)for(n=new Uint16Array(u),o=0;o<u;++o)n[o]=y++;if(!defined(a)&&0<c)for(a=new Uint16Array(c),o=0;o<c;++o)a[o]=y++}return{boxes:i,cylinders:r,ellipsoids:n,spheres:a}}Vector3DTileGeometry.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)},Vector3DTileGeometry.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)},Vector3DTileGeometry.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)},Vector3DTileGeometry.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)},Vector3DTileGeometry.prototype.update=function(e){createPrimitive$1(this),this._ready&&(this._primitive.debugWireframe=this.debugWireframe,this._primitive.forceRebatch=this.forceRebatch,this._primitive.classificationType=this.classificationType,this._primitive.update(e))},Vector3DTileGeometry.prototype.isDestroyed=function(){return!1},Vector3DTileGeometry.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),destroyObject(this)},Object.defineProperties(Geometry3DTileContent.prototype,{featuresLength:{get:function(){return defined(this._batchTable)?this._batchTable.featuresLength:0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return defined(this._geometries)?this._geometries.trianglesLength:0}},geometryByteLength:{get:function(){return defined(this._geometries)?this._geometries.geometryByteLength:0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return defined(this._batchTable)?this._batchTable.memorySizeInBytes:0}},innerContents:{get:function(){}},readyPromise:{get:function(){return this._readyPromise.promise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){return this._batchTable}}});var sizeOfUint32$6=Uint32Array.BYTES_PER_ELEMENT;function initialize$4(e,t,i){i=defaultValue(i,0);var r=new Uint8Array(t),n=new DataView(t);i+=sizeOfUint32$6;var a=n.getUint32(i,!0);if(1!==a)throw new RuntimeError("Only Geometry tile version 1 is supported. Version "+a+" is not.");i+=sizeOfUint32$6;var o=n.getUint32(i,!0);if(i+=sizeOfUint32$6,0!==o){var s=n.getUint32(i,!0);if(i+=sizeOfUint32$6,0===s)throw new RuntimeError("Feature table must have a byte length greater than zero");var l=n.getUint32(i,!0);i+=sizeOfUint32$6;var u=n.getUint32(i,!0);i+=sizeOfUint32$6;var c=n.getUint32(i,!0),d=getStringFromTypedArray(r,i+=sizeOfUint32$6,s),h=JSON.parse(d);i+=s;var p,f,m=new Uint8Array(t,i,l);if(i+=l,0<u){var g=getStringFromTypedArray(r,i,u);p=JSON.parse(g),i+=u,0<c&&(f=new Uint8Array(t,i,c),f=new Uint8Array(f))}var y=defaultValue(h.BOXES_LENGTH,0),v=defaultValue(h.CYLINDERS_LENGTH,0),_=defaultValue(h.ELLIPSOIDS_LENGTH,0),C=defaultValue(h.SPHERES_LENGTH,0),x=y+v+_+C,b=new Cesium3DTileBatchTable(e,x,p,f,createColorChangedCallback$1(e));if(e._batchTable=b,0!==x){var A,S=e.tile.computedTransform;defined(h.RTC_CENTER)&&(A=Cartesian3.unpack(h.RTC_CENTER),Matrix4.multiplyByPoint(S,A,A));var w=getBatchIds(h,m);if(0<y||0<v||0<_||0<C){var E,T,P,M;if(0<y){var D=m.byteOffset+h.BOXES.byteOffset;E=new Float32Array(m.buffer,D,Vector3DTileGeometry.packedBoxLength*y)}if(0<v){var I=m.byteOffset+h.CYLINDERS.byteOffset;T=new Float32Array(m.buffer,I,Vector3DTileGeometry.packedCylinderLength*v)}if(0<_){var O=m.byteOffset+h.ELLIPSOIDS.byteOffset;P=new Float32Array(m.buffer,O,Vector3DTileGeometry.packedEllipsoidLength*_)}if(0<C){var R=m.byteOffset+h.SPHERES.byteOffset;M=new Float32Array(m.buffer,R,Vector3DTileGeometry.packedSphereLength*C)}e._geometries=new Vector3DTileGeometry({boxes:E,boxBatchIds:w.boxes,cylinders:T,cylinderBatchIds:w.cylinders,ellipsoids:P,ellipsoidBatchIds:w.ellipsoids,spheres:M,sphereBatchIds:w.spheres,center:A,modelMatrix:S,batchTable:b,boundingVolume:e.tile.boundingVolume.boundingVolume})}}}else e._readyPromise.resolve(e)}function createFeatures$1(e){var t=e.featuresLength;if(!defined(e._features)&&0<t){var i=new Array(t);defined(e._geometries)&&e._geometries.createFeatures(e,i),e._features=i}}function ModelInstance(e,t,i){this.primitive=e,this._modelMatrix=Matrix4.clone(t),this._instanceId=i}Geometry3DTileContent.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)},Geometry3DTileContent.prototype.getFeature=function(e){return createFeatures$1(this),this._features[e]},Geometry3DTileContent.prototype.applyDebugSettings=function(e,t){defined(this._geometries)&&this._geometries.applyDebugSettings(e,t)},Geometry3DTileContent.prototype.applyStyle=function(e){createFeatures$1(this),defined(this._geometries)&&this._geometries.applyStyle(e,this._features)},Geometry3DTileContent.prototype.update=function(e,t){if(defined(this._geometries)&&(this._geometries.classificationType=this._tileset.classificationType,this._geometries.debugWireframe=this._tileset.debugWireframe,this._geometries.update(t)),defined(this._batchTable)&&this._geometries._ready&&this._batchTable.update(e,t),!defined(this._contentReadyPromise)){var i=this;this._contentReadyPromise=this._geometries.readyPromise.then(function(){i._readyPromise.resolve(i)})}},Geometry3DTileContent.prototype.isDestroyed=function(){return!1},Geometry3DTileContent.prototype.destroy=function(){return this._geometries=this._geometries&&this._geometries.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),destroyObject(this)},Object.defineProperties(ModelInstance.prototype,{instanceId:{get:function(){return this._instanceId}},model:{get:function(){return this.primitive._model}},modelMatrix:{get:function(){return Matrix4.clone(this._modelMatrix)},set:function(e){Matrix4.clone(e,this._modelMatrix),this.primitive.expandBoundingSphere(this._modelMatrix),this.primitive._dirty=!0}}});var LoadState={NEEDS_LOAD:0,LOADING:1,LOADED:2,FAILED:3};function ModelInstanceCollection(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this.show=defaultValue(e.show,!0),this._instancingSupported=!1,this._dynamic=defaultValue(e.dynamic,!1),this._allowPicking=defaultValue(e.allowPicking,!0),this._ready=!1,this._readyPromise=when.defer(),this._state=LoadState.NEEDS_LOAD,this._dirty=!1,this._cull=defaultValue(e.cull,!0),this._opaquePass=defaultValue(e.opaquePass,Pass$1.OPAQUE),this._instances=createInstances(this,e.instances),this._batchTable=e.batchTable,this._model=void 0,this._vertexBufferTypedArray=void 0,this._vertexBuffer=void 0,this._batchIdBuffer=void 0,this._instancedUniformsByProgram=void 0,this._drawCommands=[],this._modelCommands=void 0,this._renderStates=void 0,this._disableCullingRenderStates=void 0,this._boundingSphere=createBoundingSphere(this),this._center=Cartesian3.clone(this._boundingSphere.center),this._rtcTransform=new Matrix4,this._rtcModelView=new Matrix4,this._mode=void 0,this.modelMatrix=Matrix4.clone(Matrix4.IDENTITY),this._modelMatrix=Matrix4.clone(this.modelMatrix),this._url=Resource.createIfNeeded(e.url),this._requestType=e.requestType,this._gltf=e.gltf,this._basePath=Resource.createIfNeeded(e.basePath),this._asynchronous=e.asynchronous,this._incrementallyLoadTextures=e.incrementallyLoadTextures,this._upAxis=e.upAxis,this._forwardAxis=e.forwardAxis,this.shadows=defaultValue(e.shadows,ShadowMode$1.ENABLED),this._shadows=this.shadows,this._pickIdLoaded=e.pickIdLoaded,this.debugShowBoundingVolume=defaultValue(e.debugShowBoundingVolume,!1),this._debugShowBoundingVolume=!1,this.debugWireframe=defaultValue(e.debugWireframe,!1),this._debugWireframe=!1,this._imageBasedLightingFactor=new Cartesian2(1,1),Cartesian2.clone(e.imageBasedLightingFactor,this._imageBasedLightingFactor),this.lightColor=e.lightColor,this.luminanceAtZenith=e.luminanceAtZenith,this.sphericalHarmonicCoefficients=e.sphericalHarmonicCoefficients,this.specularEnvironmentMaps=e.specularEnvironmentMaps,this.backFaceCulling=defaultValue(e.backFaceCulling,!0),this._backFaceCulling=this.backFaceCulling}function createInstances(e,t){for(var i=(t=defaultValue(t,[])).length,r=new Array(i),n=0;n<i;++n){var a=t[n],o=a.modelMatrix,s=defaultValue(a.batchId,n);r[n]=new ModelInstance(e,o,s)}return r}function createBoundingSphere(e){for(var t=e.length,i=new Array(t),r=0;r<t;++r)i[r]=Matrix4.getTranslation(e._instances[r]._modelMatrix,new Cartesian3);return BoundingSphere.fromPoints(i)}Object.defineProperties(ModelInstanceCollection.prototype,{allowPicking:{get:function(){return this._allowPicking}},length:{get:function(){return this._instances.length}},activeAnimations:{get:function(){return this._model.activeAnimations}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},imageBasedLightingFactor:{get:function(){return this._imageBasedLightingFactor},set:function(e){Cartesian2.clone(e,this._imageBasedLightingFactor)}}});var scratchCartesian$4=new Cartesian3,scratchMatrix$5=new Matrix4;function getCheckUniformSemanticFunction(r,n,a,o){return function(e,t){var i=e.semantic;if(defined(i)&&-1<r.indexOf(i)){if(!(-1<n.indexOf(i)))throw new RuntimeError('Shader program cannot be optimized for instancing. Uniform "'+t+'" in program "'+a+'" uses unsupported semantic "'+i+'"');o[t]=i}}}function getInstancedUniforms(e,t){if(defined(e._instancedUniformsByProgram))return e._instancedUniformsByProgram[t];var i={};e._instancedUniformsByProgram=i;var r=["MODEL","MODELVIEW","CESIUM_RTC_MODELVIEW","MODELVIEWPROJECTION","MODELINVERSE","MODELVIEWINVERSE","MODELVIEWPROJECTIONINVERSE","MODELINVERSETRANSPOSE","MODELVIEWINVERSETRANSPOSE"],n=["MODELVIEW","CESIUM_RTC_MODELVIEW","MODELVIEWPROJECTION","MODELVIEWINVERSETRANSPOSE"],a=e._model._sourceTechniques;for(var o in a)if(a.hasOwnProperty(o)){var s=a[o],l=s.program;if(!defined(i[l])){var u={};i[l]=u,ForEach.techniqueUniform(s,getCheckUniformSemanticFunction(r,n,t,u))}}return i[t]}function getVertexShaderCallback$1(y){return function(e,t){var i=getInstancedUniforms(y,t),r=defined(y._batchTable),n=ShaderSource.replaceMain(e,"czm_instancing_main"),a="",o="";for(var s in i)if(i.hasOwnProperty(s)){var l,u=i[s];"MODELVIEW"===u||"CESIUM_RTC_MODELVIEW"===u?l="czm_instanced_modelView":"MODELVIEWPROJECTION"===u?(l="czm_instanced_modelViewProjection",a+="mat4 czm_instanced_modelViewProjection;\n",o+="czm_instanced_modelViewProjection = czm_projection * czm_instanced_modelView;\n"):"MODELVIEWINVERSETRANSPOSE"===u&&(l="czm_instanced_modelViewInverseTranspose",a+="mat3 czm_instanced_modelViewInverseTranspose;\n",o+="czm_instanced_modelViewInverseTranspose = mat3(czm_instanced_modelView);\n");var c=new RegExp("uniform.*"+s+".*");n=n.replace(c,""),c=new RegExp(s+"\\b","g"),n=n.replace(c,l)}var d,h,p;p=r?(d="attribute float a_batchId;\n",h=""):(d="",h="attribute vec4 pickColor;\nvarying vec4 v_pickColor;\n"," v_pickColor = pickColor;\n");var f="uniform mat4 czm_instanced_modifiedModelView;\nuniform mat4 czm_instanced_nodeTransform;\n"+a+"mat4 czm_instanced_modelView;\nattribute vec4 czm_modelMatrixRow0;\nattribute vec4 czm_modelMatrixRow1;\nattribute vec4 czm_modelMatrixRow2;\n"+d+h+n+"void main()\n{\n mat4 czm_instanced_model = mat4(czm_modelMatrixRow0.x, czm_modelMatrixRow1.x, czm_modelMatrixRow2.x, 0.0, czm_modelMatrixRow0.y, czm_modelMatrixRow1.y, czm_modelMatrixRow2.y, 0.0, czm_modelMatrixRow0.z, czm_modelMatrixRow1.z, czm_modelMatrixRow2.z, 0.0, czm_modelMatrixRow0.w, czm_modelMatrixRow1.w, czm_modelMatrixRow2.w, 1.0);\n czm_instanced_modelView = czm_instanced_modifiedModelView * czm_instanced_model * czm_instanced_nodeTransform;\n"+o+" czm_instancing_main();\n"+p+"}\n";if(r){var m=y._model.gltf,g=ModelUtility.getDiffuseAttributeOrUniform(m,t);f=y._batchTable.getVertexShaderCallback(!0,"a_batchId",g)(f)}return f}}function getFragmentShaderCallback$1(a){return function(e,t){var i=a._batchTable;if(defined(i)){var r=a._model.gltf,n=ModelUtility.getDiffuseAttributeOrUniform(r,t);e=i.getFragmentShaderCallback(!0,n)(e)}else e="varying vec4 v_pickColor;\n"+e;return e}}function createModifiedModelView(e,t){return function(){return Matrix4.multiply(t.uniformState.view,e._rtcTransform,e._rtcModelView)}}function createNodeTransformFunction(e){return function(){return e.computedMatrix}}function getUniformMapCallback(a,o){return function(e,t,i){(e=clone(e)).czm_instanced_modifiedModelView=createModifiedModelView(a,o),e.czm_instanced_nodeTransform=createNodeTransformFunction(i);var r=getInstancedUniforms(a,t);for(var n in r)r.hasOwnProperty(n)&&delete e[n];return defined(a._batchTable)&&(e=a._batchTable.getUniformMapCallback()(e)),e}}function getVertexShaderNonInstancedCallback(n){return function(e,t){if(defined(n._batchTable)){var i=n._model.gltf,r=ModelUtility.getDiffuseAttributeOrUniform(i,t);e="uniform float a_batchId\n;"+(e=n._batchTable.getVertexShaderCallback(!0,"a_batchId",r)(e))}return e}}function getFragmentShaderNonInstancedCallback(a){return function(e,t){var i=a._batchTable;if(defined(i)){var r=a._model.gltf,n=ModelUtility.getDiffuseAttributeOrUniform(r,t);e=i.getFragmentShaderCallback(!0,n)(e)}else e="uniform vec4 czm_pickColor;\n"+e;return e}}function getUniformMapNonInstancedCallback(t){return function(e){return defined(t._batchTable)&&(e=t._batchTable.getUniformMapCallback()(e)),e}}function getVertexBufferTypedArray(e){var t=e._instances,i=e.length,r=e._center,n=e._vertexBufferTypedArray;defined(n)||(n=new Float32Array(12*i)),e._dynamic&&(e._vertexBufferTypedArray=n);for(var a=0;a<i;++a){var o=t[a]._modelMatrix,s=Matrix4.clone(o,scratchMatrix$5);s[12]-=r.x,s[13]-=r.y,s[14]-=r.z;var l=12*a;n[0+l]=s[0],n[1+l]=s[4],n[2+l]=s[8],n[3+l]=s[12],n[4+l]=s[1],n[5+l]=s[5],n[6+l]=s[9],n[7+l]=s[13],n[8+l]=s[2],n[9+l]=s[6],n[10+l]=s[10],n[11+l]=s[14]}return n}function createVertexBuffer$2(e,t){var i,r=e._instances,n=e.length,a=e._dynamic,o=defined(e._batchTable);if(o){var s=new Uint16Array(n);for(i=0;i<n;++i)s[i]=r[i]._instanceId;e._batchIdBuffer=Buffer$1.createVertexBuffer({context:t,typedArray:s,usage:BufferUsage$1.STATIC_DRAW})}if(!o){var l=new Uint8Array(4*n);for(i=0;i<n;++i){var u=e._pickIds[i].color,c=4*i;l[c]=Color.floatToByte(u.red),l[1+c]=Color.floatToByte(u.green),l[2+c]=Color.floatToByte(u.blue),l[3+c]=Color.floatToByte(u.alpha)}e._pickIdBuffer=Buffer$1.createVertexBuffer({context:t,typedArray:l,usage:BufferUsage$1.STATIC_DRAW})}var d=getVertexBufferTypedArray(e);e._vertexBuffer=Buffer$1.createVertexBuffer({context:t,typedArray:d,usage:a?BufferUsage$1.STREAM_DRAW:BufferUsage$1.STATIC_DRAW})}function updateVertexBuffer(e){var t=getVertexBufferTypedArray(e);e._vertexBuffer.copyFromArrayView(t)}function createPickIds(e,t){for(var i=e._instances,r=i.length,n=new Array(r),a=0;a<r;++a)n[a]=t.createPickId(i[a]);return n}function createModel(e,t){var i=e._instancingSupported,r=defined(e._batchTable),n=e._allowPicking,a={url:e._url,requestType:e._requestType,gltf:e._gltf,basePath:e._basePath,shadows:e._shadows,cacheKey:void 0,asynchronous:e._asynchronous,allowPicking:n,incrementallyLoadTextures:e._incrementallyLoadTextures,upAxis:e._upAxis,forwardAxis:e._forwardAxis,precreatedAttributes:void 0,vertexShaderLoaded:void 0,fragmentShaderLoaded:void 0,uniformMapLoaded:void 0,pickIdLoaded:e._pickIdLoaded,ignoreCommands:!0,opaquePass:e._opaquePass,imageBasedLightingFactor:e.imageBasedLightingFactor,lightColor:e.lightColor,luminanceAtZenith:e.luminanceAtZenith,sphericalHarmonicCoefficients:e.sphericalHarmonicCoefficients,specularEnvironmentMaps:e.specularEnvironmentMaps};if(r||(e._pickIds=createPickIds(e,t)),i){createVertexBuffer$2(e,t);var o=ComponentDatatype$1.getSizeInBytes(ComponentDatatype$1.FLOAT),s={czm_modelMatrixRow0:{index:0,vertexBuffer:e._vertexBuffer,componentsPerAttribute:4,componentDatatype:ComponentDatatype$1.FLOAT,normalize:!1,offsetInBytes:0,strideInBytes:12*o,instanceDivisor:1},czm_modelMatrixRow1:{index:0,vertexBuffer:e._vertexBuffer,componentsPerAttribute:4,componentDatatype:ComponentDatatype$1.FLOAT,normalize:!1,offsetInBytes:4*o,strideInBytes:12*o,instanceDivisor:1},czm_modelMatrixRow2:{index:0,vertexBuffer:e._vertexBuffer,componentsPerAttribute:4,componentDatatype:ComponentDatatype$1.FLOAT,normalize:!1,offsetInBytes:8*o,strideInBytes:12*o,instanceDivisor:1}};r&&(s.a_batchId={index:0,vertexBuffer:e._batchIdBuffer,componentsPerAttribute:1,componentDatatype:ComponentDatatype$1.UNSIGNED_SHORT,normalize:!1,offsetInBytes:0,strideInBytes:0,instanceDivisor:1}),r||(s.pickColor={index:0,vertexBuffer:e._pickIdBuffer,componentsPerAttribute:4,componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0,instanceDivisor:1}),a.precreatedAttributes=s,a.vertexShaderLoaded=getVertexShaderCallback$1(e),a.fragmentShaderLoaded=getFragmentShaderCallback$1(e),a.uniformMapLoaded=getUniformMapCallback(e,t),defined(e._url)&&(a.cacheKey=e._url.getUrlComponent()+"#instanced")}else a.vertexShaderLoaded=getVertexShaderNonInstancedCallback(e),a.fragmentShaderLoaded=getFragmentShaderNonInstancedCallback(e),a.uniformMapLoaded=getUniformMapNonInstancedCallback(e);defined(e._url)?e._model=Model.fromGltf(a):e._model=new Model(a)}function updateWireframe$2(e,t){if(e._debugWireframe!==e.debugWireframe||t){e._debugWireframe=e.debugWireframe;for(var i=e.debugWireframe?PrimitiveType$1.LINES:PrimitiveType$1.TRIANGLES,r=e._drawCommands,n=r.length,a=0;a<n;++a)r[a].primitiveType=i}}function getDisableCullingRenderState$1(e){var t=clone(e,!0);return t.cull.enabled=!1,RenderState.fromCache(t)}function updateBackFaceCulling$1(e,t){if(e._backFaceCulling!==e.backFaceCulling||t){e._backFaceCulling=e.backFaceCulling;var i,r=e._drawCommands,n=r.length;if(!defined(e._disableCullingRenderStates))for(e._disableCullingRenderStates=new Array(n),e._renderStates=new Array(n),i=0;i<n;++i){var a=r[i].renderState,o=getDisableCullingRenderState$1(a);e._disableCullingRenderStates[i]=o,e._renderStates[i]=a}for(i=0;i<n;++i)r[i].renderState=e._backFaceCulling?e._renderStates[i]:e._disableCullingRenderStates[i]}}function updateShowBoundingVolume$1(e,t){if(e.debugShowBoundingVolume!==e._debugShowBoundingVolume||t){e._debugShowBoundingVolume=e.debugShowBoundingVolume;for(var i=e._drawCommands,r=i.length,n=0;n<r;++n)i[n].debugShowBoundingVolume=e.debugShowBoundingVolume}}function createCommands$4(e,t){for(var i=t.length,r=e.length,n=e._boundingSphere,a=e._cull,o=0;o<i;++o){var s=DrawCommand.shallowClone(t[o]);s.instanceCount=r,s.boundingVolume=n,s.cull=a,defined(e._batchTable)?s.pickId=e._batchTable.getPickId():s.pickId="v_pickColor",e._drawCommands.push(s)}}function createBatchIdFunction(e){return function(){return e}}function createPickColorFunction$1(e){return function(){return e}}function createCommandsNonInstanced(e,t){for(var i=e._instances,r=t.length,n=e.length,a=defined(e._batchTable),o=e._cull,s=0;s<r;++s)for(var l=0;l<n;++l){var u=DrawCommand.shallowClone(t[s]);if(u.modelMatrix=new Matrix4,u.boundingVolume=new BoundingSphere,u.cull=o,u.uniformMap=clone(u.uniformMap),a)u.uniformMap.a_batchId=createBatchIdFunction(i[l]._instanceId);else{var c=e._pickIds[l];u.uniformMap.czm_pickColor=createPickColorFunction$1(c.color)}e._drawCommands.push(u)}}function updateCommandsNonInstanced(e){for(var t=e._modelCommands,i=t.length,r=e.length,n=e._rtcTransform,a=e._center,o=0;o<i;++o)for(var s=t[o],l=0;l<r;++l){var u=o*r+l,c=e._drawCommands[u],d=Matrix4.clone(e._instances[l]._modelMatrix,scratchMatrix$5);d[12]-=a.x,d[13]-=a.y,d[14]-=a.z,d=Matrix4.multiply(n,d,scratchMatrix$5);var h=s.modelMatrix,p=c.modelMatrix;Matrix4.multiply(d,h,p);var f=s.boundingVolume,m=c.boundingVolume;BoundingSphere.transform(f,d,m)}}function getModelCommands(e){for(var t=e._nodeCommands,i=t.length,r=[],n=0;n<i;++n){var a=t[n];a.show&&r.push(a.command)}return r}function commandsDirty(e){for(var t=e._nodeCommands,i=t.length,r=!1,n=0;n<i;n++){var a=t[n];a.command.dirty&&(r=!(a.command.dirty=!1))}return r}function generateModelCommands(e,t){e._drawCommands=[];var i=getModelCommands(e._model);t?createCommands$4(e,i):(createCommandsNonInstanced(e,i),updateCommandsNonInstanced(e))}function updateShadows$1(e,t){if(e.shadows!==e._shadows||t){e._shadows=e.shadows;for(var i=ShadowMode$1.castShadows(e.shadows),r=ShadowMode$1.receiveShadows(e.shadows),n=e._drawCommands,a=n.length,o=0;o<a;++o){var s=n[o];s.castShadows=i,s.receiveShadows=r}}}function Instanced3DModel3DTileContent(e,t,i,r,n){this._tileset=e,this._tile=t,this._resource=i,this._modelInstanceCollection=void 0,this._batchTable=void 0,this._features=void 0,this.featurePropertiesDirty=!1,initialize$5(this,r,n)}function getPickIdCallback$1(e){return function(){return e._batchTable.getPickId()}}ModelInstanceCollection.prototype.expandBoundingSphere=function(e){var t=Matrix4.getTranslation(e,scratchCartesian$4);BoundingSphere.expand(this._boundingSphere,t,this._boundingSphere)},ModelInstanceCollection.prototype.update=function(e){if(e.mode!==SceneMode$1.MORPHING&&this.show&&0!==this.length){var t=e.context;if(this._state===LoadState.NEEDS_LOAD){this._state=LoadState.LOADING,this._instancingSupported=t.instancedArrays,createModel(this,t);var i=this;this._model.readyPromise.otherwise(function(e){i._state=LoadState.FAILED,i._readyPromise.reject(e)})}var r=this._instancingSupported,n=this._model;if(n.imageBasedLightingFactor=this.imageBasedLightingFactor,n.lightColor=this.lightColor,n.luminanceAtZenith=this.luminanceAtZenith,n.sphericalHarmonicCoefficients=this.sphericalHarmonicCoefficients,n.specularEnvironmentMaps=this.specularEnvironmentMaps,n.update(e),n.ready&&this._state===LoadState.LOADING){this._state=LoadState.LOADED,this._ready=!0;var a=n.boundingSphere.radius+Cartesian3.magnitude(n.boundingSphere.center);return this._boundingSphere.radius+=a,this._modelCommands=getModelCommands(n),generateModelCommands(this,r),void this._readyPromise.resolve(this)}if(this._state===LoadState.LOADED){var o=e.mode!==this._mode,s=this.modelMatrix,l=!Matrix4.equals(this._modelMatrix,s);if(o||l){this._mode=e.mode,Matrix4.clone(s,this._modelMatrix);var u=Matrix4.multiplyByTranslation(this._modelMatrix,this._center,this._rtcTransform);this._mode!==SceneMode$1.SCENE3D&&(u=Transforms.basisTo2D(e.mapProjection,u,u)),Matrix4.getTranslation(u,this._boundingSphere.center)}r&&this._dirty&&(this._dynamic=!0,this._dirty=!1,updateVertexBuffer(this));var c=commandsDirty(n);c&&generateModelCommands(this,r),!r&&(n.dirty||this._dirty||o||l)&&updateCommandsNonInstanced(this),updateShadows$1(this,c),updateWireframe$2(this,c),updateBackFaceCulling$1(this,c),updateShowBoundingVolume$1(this,c);var d=e.passes;if(d.render||d.pick)for(var h=e.commandList,p=this._drawCommands,f=p.length,m=0;m<f;++m)h.push(p[m])}}},ModelInstanceCollection.prototype.isDestroyed=function(){return!1},ModelInstanceCollection.prototype.destroy=function(){this._model=this._model&&this._model.destroy();var e=this._pickIds;if(defined(e))for(var t=e.length,i=0;i<t;++i)e[i].destroy();return destroyObject(this)},Instanced3DModel3DTileContent._deprecationWarning=deprecationWarning,Object.defineProperties(Instanced3DModel3DTileContent.prototype,{featuresLength:{get:function(){return this._batchTable.featuresLength}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){var e=this._modelInstanceCollection._model;return defined(e)?e.trianglesLength:0}},geometryByteLength:{get:function(){var e=this._modelInstanceCollection._model;return defined(e)?e.geometryByteLength:0}},texturesByteLength:{get:function(){var e=this._modelInstanceCollection._model;return defined(e)?e.texturesByteLength:0}},batchTableByteLength:{get:function(){return this._batchTable.memorySizeInBytes}},innerContents:{get:function(){}},readyPromise:{get:function(){return this._modelInstanceCollection.readyPromise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){return this._batchTable}}});var sizeOfUint32$7=Uint32Array.BYTES_PER_ELEMENT,propertyScratch1=new Array(4),propertyScratch2=new Array(4);function initialize$5(e,t,i){var r=defaultValue(i,0);i=r;var n=new Uint8Array(t),a=new DataView(t);i+=sizeOfUint32$7;var o=a.getUint32(i,!0);if(1!==o)throw new RuntimeError("Only Instanced 3D Model version 1 is supported. Version "+o+" is not.");i+=sizeOfUint32$7;var s=a.getUint32(i,!0);i+=sizeOfUint32$7;var l=a.getUint32(i,!0);if(0===l)throw new RuntimeError("featureTableJsonByteLength is zero, the feature table must be defined.");i+=sizeOfUint32$7;var u=a.getUint32(i,!0);i+=sizeOfUint32$7;var c=a.getUint32(i,!0);i+=sizeOfUint32$7;var d=a.getUint32(i,!0);i+=sizeOfUint32$7;var h=a.getUint32(i,!0);if(1!==h&&0!==h)throw new RuntimeError("Only glTF format 0 (uri) or 1 (embedded) are supported. Format "+h+" is not.");var p=getStringFromTypedArray(n,i+=sizeOfUint32$7,l),f=JSON.parse(p);i+=l;var m=new Uint8Array(t,i,u);i+=u;var g,y,v=new Cesium3DTileFeatureTable(f,m),_=v.getGlobalProperty("INSTANCES_LENGTH");if(!defined(v.featuresLength=_))throw new RuntimeError("Feature table global property: INSTANCES_LENGTH must be defined");if(0<c){var C=getStringFromTypedArray(n,i,c);g=JSON.parse(C),i+=c,0<d&&(y=new Uint8Array(t,i,d),y=new Uint8Array(y),i+=d)}e._batchTable=new Cesium3DTileBatchTable(e,_,g,y);var x,b=r+s-i;if(0==b)throw new RuntimeError("glTF byte length is zero, i3dm must have a glTF to instance.");x=i%4==0?new Uint8Array(t,i,b):(Instanced3DModel3DTileContent._deprecationWarning("i3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),new Uint8Array(n.subarray(i,i+b)));var A=e._tileset,S={instances:new Array(_),batchTable:e._batchTable,cull:!1,url:void 0,requestType:RequestType$1.TILES3D,gltf:void 0,basePath:void 0,incrementallyLoadTextures:!1,upAxis:A._gltfUpAxis,forwardAxis:Axis$1.X,opaquePass:Pass$1.CESIUM_3D_TILE,pickIdLoaded:getPickIdCallback$1(e),imageBasedLightingFactor:A.imageBasedLightingFactor,lightColor:A.lightColor,luminanceAtZenith:A.luminanceAtZenith,sphericalHarmonicCoefficients:A.sphericalHarmonicCoefficients,specularEnvironmentMaps:A.specularEnvironmentMaps,backFaceCulling:A.backFaceCulling};if(0===h){var w=getStringFromTypedArray(x);w=w.replace(/[\s\0]+$/,""),S.url=e._resource.getDerivedResource({url:w})}else S.gltf=x,S.basePath=e._resource.clone();var E,T=v.getGlobalProperty("EAST_NORTH_UP"),P=v.getGlobalProperty("RTC_CENTER",ComponentDatatype$1.FLOAT,3);defined(P)&&(E=Cartesian3.unpack(P));for(var M=S.instances,D=new Cartesian3,I=new Array(3),O=new Cartesian3,R=new Cartesian3,L=new Cartesian3,N=new Matrix3,k=new Quaternion,B=new Cartesian3,F=new TranslationRotationScale,V=new Matrix4,z=0;z<_;z++){var U=v.getProperty("POSITION",ComponentDatatype$1.FLOAT,3,z,propertyScratch1);if(!defined(U)){U=I;var G=v.getProperty("POSITION_QUANTIZED",ComponentDatatype$1.UNSIGNED_SHORT,3,z,propertyScratch1);if(!defined(G))throw new RuntimeError("Either POSITION or POSITION_QUANTIZED must be defined for each instance.");var $=v.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",ComponentDatatype$1.FLOAT,3);if(!defined($))throw new RuntimeError("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");var H=v.getGlobalProperty("QUANTIZED_VOLUME_SCALE",ComponentDatatype$1.FLOAT,3);if(!defined(H))throw new RuntimeError("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");for(var W=0;W<3;W++)U[W]=G[W]/65535*H[W]+$[W]}Cartesian3.unpack(U,0,D),defined(E)&&Cartesian3.add(D,E,D),F.translation=D;var j=v.getProperty("NORMAL_UP",ComponentDatatype$1.FLOAT,3,z,propertyScratch1),q=v.getProperty("NORMAL_RIGHT",ComponentDatatype$1.FLOAT,3,z,propertyScratch2),Q=!1;if(defined(j)){if(!defined(q))throw new RuntimeError("To define a custom orientation, both NORMAL_UP and NORMAL_RIGHT must be defined.");Cartesian3.unpack(j,0,R),Cartesian3.unpack(q,0,O),Q=!0}else{var Y=v.getProperty("NORMAL_UP_OCT32P",ComponentDatatype$1.UNSIGNED_SHORT,2,z,propertyScratch1),X=v.getProperty("NORMAL_RIGHT_OCT32P",ComponentDatatype$1.UNSIGNED_SHORT,2,z,propertyScratch2);if(defined(Y)){if(!defined(X))throw new RuntimeError("To define a custom orientation with oct-encoded vectors, both NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P must be defined.");AttributeCompression.octDecodeInRange(Y[0],Y[1],65535,R),AttributeCompression.octDecodeInRange(X[0],X[1],65535,O),Q=!0}else T?(Transforms.eastNorthUpToFixedFrame(D,Ellipsoid.WGS84,V),Matrix4.getMatrix3(V,N)):Matrix3.clone(Matrix3.IDENTITY,N)}Q&&(Cartesian3.cross(O,R,L),Cartesian3.normalize(L,L),Matrix3.setColumn(N,0,O,N),Matrix3.setColumn(N,1,R,N),Matrix3.setColumn(N,2,L,N)),Quaternion.fromRotationMatrix(N,k),F.rotation=k,B=Cartesian3.fromElements(1,1,1,B);var Z=v.getProperty("SCALE",ComponentDatatype$1.FLOAT,1,z);defined(Z)&&Cartesian3.multiplyByScalar(B,Z,B);var J=v.getProperty("SCALE_NON_UNIFORM",ComponentDatatype$1.FLOAT,3,z,propertyScratch1);defined(J)&&(B.x*=J[0],B.y*=J[1],B.z*=J[2]),F.scale=B;var K=v.getProperty("BATCH_ID",ComponentDatatype$1.UNSIGNED_SHORT,1,z);defined(K)||(K=z),Matrix4.fromTranslationRotationScale(F,V);var ee=V.clone();M[z]={modelMatrix:ee,batchId:K}}e._modelInstanceCollection=new ModelInstanceCollection(S)}function createFeatures$2(e){var t=e.featuresLength;if(!defined(e._features)&&0<t){for(var i=new Array(t),r=0;r<t;++r)i[r]=new Cesium3DTileFeature(e,r);e._features=i}}Instanced3DModel3DTileContent.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)},Instanced3DModel3DTileContent.prototype.getFeature=function(e){this.featuresLength;return createFeatures$2(this),this._features[e]},Instanced3DModel3DTileContent.prototype.applyDebugSettings=function(e,t){t=e?t:Color.WHITE,this._batchTable.setAllColor(t)},Instanced3DModel3DTileContent.prototype.applyStyle=function(e){this._batchTable.applyStyle(e)},Instanced3DModel3DTileContent.prototype.update=function(e,t){var i=t.commandList.length;this._batchTable.update(e,t),this._modelInstanceCollection.modelMatrix=this._tile.computedTransform,this._modelInstanceCollection.shadows=this._tileset.shadows,this._modelInstanceCollection.lightColor=this._tileset.lightColor,this._modelInstanceCollection.luminanceAtZenith=this._tileset.luminanceAtZenith,this._modelInstanceCollection.sphericalHarmonicCoefficients=this._tileset.sphericalHarmonicCoefficients,this._modelInstanceCollection.specularEnvironmentMaps=this._tileset.specularEnvironmentMaps,this._modelInstanceCollection.backFaceCulling=this._tileset.backFaceCulling,this._modelInstanceCollection.debugWireframe=this._tileset.debugWireframe;var r=this._modelInstanceCollection._model;if(defined(r)){var n=this._tileset.clippingPlanes;r.clippingPlanesOriginMatrix=this._tileset.clippingPlanesOriginMatrix,defined(n)&&this._tile.clippingPlanesDirty&&(r._clippingPlanes=n.enabled&&this._tile._isClipped?n:void 0),defined(n)&&defined(r._clippingPlanes)&&r._clippingPlanes!==n&&(r._clippingPlanes=n)}this._modelInstanceCollection.update(t),i<t.commandList.length&&(t.passes.render||t.passes.pick)&&this._batchTable.addDerivedCommands(t,i,!1)},Instanced3DModel3DTileContent.prototype.isDestroyed=function(){return!1},Instanced3DModel3DTileContent.prototype.destroy=function(){return this._modelInstanceCollection=this._modelInstanceCollection&&this._modelInstanceCollection.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),destroyObject(this)};var Cesium3DTileRefine={ADD:0,REPLACE:1},Cesium3DTileRefine$1=Object.freeze(Cesium3DTileRefine),DecodingState={NEEDS_DECODE:0,DECODING:1,READY:2,FAILED:3};function PointCloud(e){this._parsedContent=void 0,this._drawCommand=void 0,this._isTranslucent=!1,this._styleTranslucent=!1,this._constantColor=Color.clone(Color.DARKGRAY),this._highlightColor=Color.clone(Color.WHITE),this._pointSize=1,this._rtcCenter=void 0,this._quantizedVolumeScale=void 0,this._quantizedVolumeOffset=void 0,this._styleableShaderAttributes=void 0,this._isQuantized=!1,this._isOctEncoded16P=!1,this._isRGB565=!1,this._hasColors=!1,this._hasNormals=!1,this._hasBatchIds=!1,this._decodingState=DecodingState.READY,this._dequantizeInShader=!0,this._isQuantizedDraco=!1,this._isOctEncodedDraco=!1,this._quantizedRange=0,this._octEncodedRange=0,this.backFaceCulling=!1,this._backFaceCulling=!1,this.normalShading=!0,this._normalShading=!0,this._opaqueRenderState=void 0,this._translucentRenderState=void 0,this._mode=void 0,this._ready=!1,this._readyPromise=when.defer(),this._pointsLength=0,this._geometryByteLength=0,this._vertexShaderLoaded=e.vertexShaderLoaded,this._fragmentShaderLoaded=e.fragmentShaderLoaded,this._uniformMapLoaded=e.uniformMapLoaded,this._batchTableLoaded=e.batchTableLoaded,this._pickIdLoaded=e.pickIdLoaded,this._opaquePass=defaultValue(e.opaquePass,Pass$1.OPAQUE),this._cull=defaultValue(e.cull,!0),this.style=void 0,this._style=void 0,this.styleDirty=!1,this.modelMatrix=Matrix4.clone(Matrix4.IDENTITY),this._modelMatrix=Matrix4.clone(Matrix4.IDENTITY),this.time=0,this.shadows=ShadowMode$1.ENABLED,this._boundingSphere=void 0,this.clippingPlanes=void 0,this.isClipped=!1,this.clippingPlanesDirty=!1,this.clippingPlanesOriginMatrix=void 0,this.attenuation=!1,this._attenuation=!1,this.geometricError=0,this.geometricErrorScale=1,this.maximumAttenuation=this._pointSize,initialize$6(this,e)}Object.defineProperties(PointCloud.prototype,{pointsLength:{get:function(){return this._pointsLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},color:{get:function(){return Color.clone(this._highlightColor)},set:function(e){this._highlightColor=Color.clone(e,this._highlightColor)}},boundingSphere:{get:function(){if(defined(this._drawCommand))return this._drawCommand.boundingVolume},set:function(e){this._boundingSphere=BoundingSphere.clone(e,this._boundingSphere)}}});var sizeOfUint32$8=Uint32Array.BYTES_PER_ELEMENT;function initialize$6(e,t){var i=t.arrayBuffer,r=defaultValue(t.byteOffset,0),n=new Uint8Array(i),a=new DataView(i);r+=sizeOfUint32$8;var o=a.getUint32(r,!0);if(1!==o)throw new RuntimeError("Only Point Cloud tile version 1 is supported. Version "+o+" is not.");r+=sizeOfUint32$8,r+=sizeOfUint32$8;var s=a.getUint32(r,!0);if(0===s)throw new RuntimeError("Feature table must have a byte length greater than zero");r+=sizeOfUint32$8;var l=a.getUint32(r,!0);r+=sizeOfUint32$8;var u=a.getUint32(r,!0);r+=sizeOfUint32$8;var c=a.getUint32(r,!0),d=getStringFromTypedArray(n,r+=sizeOfUint32$8,s),h=JSON.parse(d);r+=s;var p,f,m=new Uint8Array(i,r,l);if(r+=l,0<u){var g=getStringFromTypedArray(n,r,u);p=JSON.parse(g),r+=u,0<c&&(f=new Uint8Array(i,r,c),r+=c)}var y=new Cesium3DTileFeatureTable(h,m),v=y.getGlobalProperty("POINTS_LENGTH");if(!defined(y.featuresLength=v))throw new RuntimeError("Feature table global property: POINTS_LENGTH must be defined");var _,C,x,b,A=y.getGlobalProperty("RTC_CENTER",ComponentDatatype$1.FLOAT,3);defined(A)&&(e._rtcCenter=Cartesian3.unpack(A));var S,w,E,T,P,M=!1,D=!1,I=!1,O=!1,R=!1,L=!1,N=!1,k=!1,B=defined(h.extensions)?h.extensions["3DTILES_draco_point_compression"]:void 0,F=defined(p)&&defined(p.extensions)?p.extensions["3DTILES_draco_point_compression"]:void 0;if(defined(F)&&(E=F.properties),defined(B)){w=B.properties;var V=B.byteOffset,z=B.byteLength;if(!defined(w)||!defined(V)||!defined(z))throw new RuntimeError("Draco properties, byteOffset, and byteLength must be defined");S=arraySlice(m,V,V+z),M=defined(w.POSITION),D=defined(w.RGB)||defined(w.RGBA),I=defined(w.NORMAL),O=defined(w.BATCH_ID),L=defined(w.RGBA),e._decodingState=DecodingState.NEEDS_DECODE}if(defined(S)&&(T={buffer:S,featureTableProperties:w,batchTableProperties:E,properties:combine(w,E),dequantizeInShader:e._dequantizeInShader}),!M)if(defined(h.POSITION))_=y.getPropertyArray("POSITION",ComponentDatatype$1.FLOAT,3),M=!0;else if(defined(h.POSITION_QUANTIZED)){_=y.getPropertyArray("POSITION_QUANTIZED",ComponentDatatype$1.UNSIGNED_SHORT,3),M=R=!0;var U=y.getGlobalProperty("QUANTIZED_VOLUME_SCALE",ComponentDatatype$1.FLOAT,3);if(!defined(U))throw new RuntimeError("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");e._quantizedVolumeScale=Cartesian3.unpack(U),e._quantizedRange=65535;var G=y.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",ComponentDatatype$1.FLOAT,3);if(!defined(G))throw new RuntimeError("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");e._quantizedVolumeOffset=Cartesian3.unpack(G)}if(D||(defined(h.RGBA)?(C=y.getPropertyArray("RGBA",ComponentDatatype$1.UNSIGNED_BYTE,4),D=L=!0):defined(h.RGB)?(C=y.getPropertyArray("RGB",ComponentDatatype$1.UNSIGNED_BYTE,3),D=!0):defined(h.RGB565)&&(C=y.getPropertyArray("RGB565",ComponentDatatype$1.UNSIGNED_SHORT,1),D=N=!0)),I||(defined(h.NORMAL)?(x=y.getPropertyArray("NORMAL",ComponentDatatype$1.FLOAT,3),I=!0):defined(h.NORMAL_OCT16P)&&(x=y.getPropertyArray("NORMAL_OCT16P",ComponentDatatype$1.UNSIGNED_BYTE,2),I=k=!0)),O||defined(h.BATCH_ID)&&(b=y.getPropertyArray("BATCH_ID",ComponentDatatype$1.UNSIGNED_SHORT,1),O=!0),!M)throw new RuntimeError("Either POSITION or POSITION_QUANTIZED must be defined.");if(defined(h.CONSTANT_RGBA)){var $=y.getGlobalProperty("CONSTANT_RGBA",ComponentDatatype$1.UNSIGNED_BYTE,4);e._constantColor=Color.fromBytes($[0],$[1],$[2],$[3],e._constantColor)}if(O){var H=y.getGlobalProperty("BATCH_LENGTH");if(!defined(H))throw new RuntimeError("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");defined(f)&&(f=new Uint8Array(f)),defined(e._batchTableLoaded)&&e._batchTableLoaded(H,p,f)}!O&&defined(f)&&(P=Cesium3DTileBatchTable.getBinaryProperties(v,p,f)),e._parsedContent={positions:_,colors:C,normals:x,batchIds:b,styleableProperties:P,draco:T},e._pointsLength=v,e._isQuantized=R,e._isOctEncoded16P=k,e._isRGB565=N,e._isTranslucent=L,e._hasColors=D,e._hasNormals=I,e._hasBatchIds=O}var scratchMin$6=new Cartesian3,scratchMax$6=new Cartesian3,scratchPosition$8=new Cartesian3,randomValues;function getRandomValues(e){if(!defined(randomValues)){CesiumMath.setRandomNumberSeed(0),randomValues=new Array(e);for(var t=0;t<e;++t)randomValues[t]=CesiumMath.nextRandomNumber()}return randomValues}function computeApproximateBoundingSphereFromPositions(e){for(var t=e.length/3,i=Math.min(t,20),r=getRandomValues(20),n=Number.MAX_VALUE,a=-Number.MAX_VALUE,o=Cartesian3.fromElements(n,n,n,scratchMin$6),s=Cartesian3.fromElements(a,a,a,scratchMax$6),l=0;l<i;++l){var u=Math.floor(r[l]*t),c=Cartesian3.unpack(e,3*u,scratchPosition$8);Cartesian3.minimumByComponent(o,c,o),Cartesian3.maximumByComponent(s,c,s)}var d=BoundingSphere.fromCornerPoints(o,s);return d.radius+=CesiumMath.EPSILON2,d}function prepareVertexAttribute(e,t){var i=ComponentDatatype$1.fromTypedArray(e);return i===ComponentDatatype$1.INT||i===ComponentDatatype$1.UNSIGNED_INT||i===ComponentDatatype$1.DOUBLE?(oneTimeWarning("Cast pnts property to floats",'Point cloud property "'+t+'" will be casted to a float array because INT, UNSIGNED_INT, and DOUBLE are not valid WebGL vertex attribute types. Some precision may be lost.'),new Float32Array(e)):e}var scratchPointSizeAndTimeAndGeometricErrorAndDepthMultiplier=new Cartesian4,scratchQuantizedVolumeScaleAndOctEncodedRange=new Cartesian4,scratchColor$7=new Color,positionLocation=0,colorLocation=1,normalLocation=2,batchIdLocation=3,numberOfAttributes=4,scratchClippingPlaneMatrix$1=new Matrix4;function createResources$2(e,t){var i,r,n=t.context,a=e._parsedContent,o=e._pointsLength,s=a.positions,l=a.colors,u=a.normals,c=a.batchIds,d=a.styleableProperties,h=defined(d),p=e._isQuantized,f=e._isQuantizedDraco,m=e._isOctEncoded16P,g=e._isOctEncodedDraco,y=e._quantizedRange,v=e._octEncodedRange,_=e._isRGB565,C=e._isTranslucent,x=e._hasColors,b=e._hasNormals,A=e._hasBatchIds,S=[],w={};if(e._styleableShaderAttributes=w,h){var E=numberOfAttributes;for(var T in d)if(d.hasOwnProperty(T)){var P=d[T],M=prepareVertexAttribute(P.typedArray,T);i=P.componentCount,r=ComponentDatatype$1.fromTypedArray(M);var D=Buffer$1.createVertexBuffer({context:n,typedArray:M,usage:BufferUsage$1.STATIC_DRAW});e._geometryByteLength+=D.sizeInBytes;var I={index:E,vertexBuffer:D,componentsPerAttribute:i,componentDatatype:r,normalize:!1,offsetInBytes:0,strideInBytes:0};S.push(I),w[T]={location:E,componentCount:i},++E}}var O,R,L,N=Buffer$1.createVertexBuffer({context:n,typedArray:s,usage:BufferUsage$1.STATIC_DRAW});e._geometryByteLength+=N.sizeInBytes,x&&(O=Buffer$1.createVertexBuffer({context:n,typedArray:l,usage:BufferUsage$1.STATIC_DRAW}),e._geometryByteLength+=O.sizeInBytes),b&&(R=Buffer$1.createVertexBuffer({context:n,typedArray:u,usage:BufferUsage$1.STATIC_DRAW}),e._geometryByteLength+=R.sizeInBytes),A&&(c=prepareVertexAttribute(c,"batchIds"),L=Buffer$1.createVertexBuffer({context:n,typedArray:c,usage:BufferUsage$1.STATIC_DRAW}),e._geometryByteLength+=L.sizeInBytes);var k=[];if(r=p?ComponentDatatype$1.UNSIGNED_SHORT:f?y<=255?ComponentDatatype$1.UNSIGNED_BYTE:ComponentDatatype$1.UNSIGNED_SHORT:ComponentDatatype$1.FLOAT,k.push({index:positionLocation,vertexBuffer:N,componentsPerAttribute:3,componentDatatype:r,normalize:!1,offsetInBytes:0,strideInBytes:0}),e._cull&&(e._boundingSphere=p||f?BoundingSphere.fromCornerPoints(Cartesian3.ZERO,e._quantizedVolumeScale):computeApproximateBoundingSphereFromPositions(s)),x)if(_)k.push({index:colorLocation,vertexBuffer:O,componentsPerAttribute:1,componentDatatype:ComponentDatatype$1.UNSIGNED_SHORT,normalize:!1,offsetInBytes:0,strideInBytes:0});else{var B=C?4:3;k.push({index:colorLocation,vertexBuffer:O,componentsPerAttribute:B,componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0})}b&&(r=m?(i=2,ComponentDatatype$1.UNSIGNED_BYTE):g?(i=2,v<=255?ComponentDatatype$1.UNSIGNED_BYTE:ComponentDatatype$1.UNSIGNED_SHORT):(i=3,ComponentDatatype$1.FLOAT),k.push({index:normalLocation,vertexBuffer:R,componentsPerAttribute:i,componentDatatype:r,normalize:!1,offsetInBytes:0,strideInBytes:0})),A&&k.push({index:batchIdLocation,vertexBuffer:L,componentsPerAttribute:1,componentDatatype:ComponentDatatype$1.fromTypedArray(c),normalize:!1,offsetInBytes:0,strideInBytes:0}),h&&(k=k.concat(S));var F=new VertexArray({context:n,attributes:k}),V={depthTest:{enabled:!0}};e._opaquePass===Pass$1.CESIUM_3D_TILE&&(V.stencilTest=StencilConstants$1.setCesium3DTileBit(),V.stencilMask=StencilConstants$1.CESIUM_3D_TILE_MASK),e._opaqueRenderState=RenderState.fromCache(V),e._translucentRenderState=RenderState.fromCache({depthTest:{enabled:!0},depthMask:!1,blending:BlendingState$1.ALPHA_BLEND}),e._drawCommand=new DrawCommand({boundingVolume:new BoundingSphere,cull:e._cull,modelMatrix:new Matrix4,primitiveType:PrimitiveType$1.POINTS,vertexArray:F,count:o,shaderProgram:void 0,uniformMap:void 0,renderState:C?e._translucentRenderState:e._opaqueRenderState,pass:C?Pass$1.TRANSLUCENT:e._opaquePass,owner:e,castShadows:!1,receiveShadows:!1,pickId:e._pickIdLoaded()})}function createUniformMap$2(r,n){var a=n.context,e=r._isQuantized,t=r._isQuantizedDraco,i=r._isOctEncodedDraco,o={u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier:function(){var e=scratchPointSizeAndTimeAndGeometricErrorAndDepthMultiplier;if(e.x=r._attenuation?r.maximumAttenuation:r._pointSize,e.x*=n.pixelRatio,e.y=r.time,r._attenuation){var t,i=n.camera.frustum;t=n.mode===SceneMode$1.SCENE2D||i instanceof OrthographicFrustum?Number.POSITIVE_INFINITY:a.drawingBufferHeight/n.camera.frustum.sseDenominator,e.z=r.geometricError*r.geometricErrorScale,e.w=t}return e},u_highlightColor:function(){return r._highlightColor},u_constantColor:function(){return r._constantColor},u_clippingPlanes:function(){var e=r.clippingPlanes;return r.isClipped?e.texture:a.defaultTexture},u_clippingPlanesEdgeStyle:function(){var e=r.clippingPlanes;if(!defined(e))return Color.TRANSPARENT;var t=Color.clone(e.edgeColor,scratchColor$7);return t.alpha=e.edgeWidth,t},u_clippingPlanesMatrix:function(){var e=r.clippingPlanes;if(!defined(e))return Matrix4.IDENTITY;var t=defaultValue(r.clippingPlanesOriginMatrix,r._modelMatrix);return Matrix4.multiply(a.uniformState.view3D,t,scratchClippingPlaneMatrix$1),Matrix4.multiply(scratchClippingPlaneMatrix$1,e.modelMatrix,scratchClippingPlaneMatrix$1)}};(e||t||i)&&(o=combine(o,{u_quantizedVolumeScaleAndOctEncodedRange:function(){var e=scratchQuantizedVolumeScaleAndOctEncodedRange;if(defined(r._quantizedVolumeScale)){var t=Cartesian3.clone(r._quantizedVolumeScale,e);Cartesian3.divideByScalar(t,r._quantizedRange,e)}return e.w=r._octEncodedRange,e}})),defined(r._uniformMapLoaded)&&(o=r._uniformMapLoaded(o)),r._drawCommand.uniformMap=o}var defaultProperties=["POSITION","COLOR","NORMAL","POSITION_ABSOLUTE"];function getStyleableProperties(e,t){for(var i=/czm_tiles3d_style_(\w+)/g,r=i.exec(e);null!==r;){var n=r[1];-1===t.indexOf(n)&&t.push(n),r=i.exec(e)}}function getVertexAttribute(e,t){for(var i=e.numberOfAttributes,r=0;r<i;++r){var n=e.getAttribute(r);if(n.index===t)return n}}function modifyStyleFunction(e){for(var t=defaultProperties.length,i=0;i<t;++i){var r=defaultProperties[i],n="czm_tiles3d_style_"+r,a=r.toLowerCase();e=e.replace(new RegExp(n+"(\\W)","g"),a+"$1")}return e.replace("()","(vec3 position, vec3 position_absolute, vec4 color, vec3 normal)")}function createShaders$1(e,t,i){var r,n,a,o,s,l,u=t.context,c=defined(i),d=e._isQuantized,h=e._isQuantizedDraco,p=e._isOctEncoded16P,f=e._isOctEncodedDraco,m=e._isRGB565,g=e._isTranslucent,y=e._hasColors,v=e._hasNormals,_=e._hasBatchIds,C=e._backFaceCulling,x=e._normalShading,b=e._drawCommand.vertexArray,A=e.clippingPlanes,S=e._attenuation,w=g;if(c){var E={translucent:!1};o=i.getColorShaderFunction("getColorFromStyle","czm_tiles3d_style_",E),s=i.getShowShaderFunction("getShowFromStyle","czm_tiles3d_style_",E),l=i.getPointSizeShaderFunction("getPointSizeFromStyle","czm_tiles3d_style_",E),defined(o)&&E.translucent&&(w=!0)}e._styleTranslucent=w;var T=defined(o),P=defined(s),M=defined(l),D=e.isClipped,I=[];T&&(getStyleableProperties(o,I),o=modifyStyleFunction(o)),P&&(getStyleableProperties(s,I),s=modifyStyleFunction(s)),M&&(getStyleableProperties(l,I),l=modifyStyleFunction(l));var O=0<=I.indexOf("COLOR"),R=0<=I.indexOf("NORMAL"),L=I.filter(function(e){return-1===defaultProperties.indexOf(e)});if(R&&!v)throw new RuntimeError("Style references the NORMAL semantic but the point cloud does not have normals");var N=e._styleableShaderAttributes;for(n in N)if(N.hasOwnProperty(n)){a=N[n];var k=0<=L.indexOf(n);getVertexAttribute(b,a.location).enabled=k}var B=y&&(!T||O);y&&(getVertexAttribute(b,colorLocation).enabled=B);var F=v&&(x||C||R);v&&(getVertexAttribute(b,normalLocation).enabled=F);var V={a_position:positionLocation};B&&(V.a_color=colorLocation),F&&(V.a_normal=normalLocation),_&&(V.a_batchId=batchIdLocation);var z="",U=L.length;for(r=0;r<U;++r){if(!defined(a=N[n=L[r]]))throw new RuntimeError('Style references a property "'+n+'" that does not exist or is not styleable.');var G=a.componentCount,$="czm_tiles3d_style_"+n;z+="attribute "+(1===G?"float":"vec"+G)+" "+$+"; \n",V[$]=a.location}createUniformMap$2(e,t);var H="attribute vec3 a_position; \nvarying vec4 v_color; \nuniform vec4 u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier; \nuniform vec4 u_constantColor; \nuniform vec4 u_highlightColor; \n";H+="float u_pointSize; \nfloat u_time; \n",S&&(H+="float u_geometricError; \nfloat u_depthMultiplier; \n"),H+=z,B&&(H+=g?"attribute vec4 a_color; \n":m?"attribute float a_color; \nconst float SHIFT_RIGHT_11 = 1.0 / 2048.0; \nconst float SHIFT_RIGHT_5 = 1.0 / 32.0; \nconst float SHIFT_LEFT_11 = 2048.0; \nconst float SHIFT_LEFT_5 = 32.0; \nconst float NORMALIZE_6 = 1.0 / 64.0; \nconst float NORMALIZE_5 = 1.0 / 32.0; \n":"attribute vec3 a_color; \n"),F&&(H+=p||f?"attribute vec2 a_normal; \n":"attribute vec3 a_normal; \n"),_&&(H+="attribute float a_batchId; \n"),(d||h||f)&&(H+="uniform vec4 u_quantizedVolumeScaleAndOctEncodedRange; \n"),T&&(H+=o),P&&(H+=s),M&&(H+=l),H+="void main() \n{ \n u_pointSize = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.x; \n u_time = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.y; \n",S&&(H+=" u_geometricError = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.z; \n u_depthMultiplier = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.w; \n"),H+=B?g?" vec4 color = a_color; \n":m?" float compressed = a_color; \n float r = floor(compressed * SHIFT_RIGHT_11); \n compressed -= r * SHIFT_LEFT_11; \n float g = floor(compressed * SHIFT_RIGHT_5); \n compressed -= g * SHIFT_LEFT_5; \n float b = compressed; \n vec3 rgb = vec3(r * NORMALIZE_5, g * NORMALIZE_6, b * NORMALIZE_5); \n vec4 color = vec4(rgb, 1.0); \n":" vec4 color = vec4(a_color, 1.0); \n":" vec4 color = u_constantColor; \n",H+=d||h?" vec3 position = a_position * u_quantizedVolumeScaleAndOctEncodedRange.xyz; \n":" vec3 position = a_position; \n",H+=" vec3 position_absolute = vec3(czm_model * vec4(position, 1.0)); \n",F?(H+=p?" vec3 normal = czm_octDecode(a_normal); \n":f?" vec3 normal = czm_octDecode(a_normal, u_quantizedVolumeScaleAndOctEncodedRange.w).zxy; \n":" vec3 normal = a_normal; \n",H+=" vec3 normalEC = czm_normal * normal; \n"):H+=" vec3 normal = vec3(1.0); \n",T&&(H+=" color = getColorFromStyle(position, position_absolute, color, normal); \n"),P&&(H+=" float show = float(getShowFromStyle(position, position_absolute, color, normal)); \n"),H+=M?" gl_PointSize = getPointSizeFromStyle(position, position_absolute, color, normal) * czm_pixelRatio; \n":S?" vec4 positionEC = czm_modelView * vec4(position, 1.0); \n float depth = -positionEC.z; \n gl_PointSize = min((u_geometricError / depth) * u_depthMultiplier, u_pointSize); \n":" gl_PointSize = u_pointSize; \n",H+=" color = color * u_highlightColor; \n",F&&x&&(H+=" float diffuseStrength = czm_getLambertDiffuse(czm_lightDirectionEC, normalEC); \n diffuseStrength = max(diffuseStrength, 0.4); \n color.xyz *= diffuseStrength * czm_lightColor; \n"),H+=" v_color = color; \n gl_Position = czm_modelViewProjection * vec4(position, 1.0); \n",F&&C&&(H+=" float visible = step(-normalEC.z, 0.0); \n gl_Position *= visible; \n gl_PointSize *= visible; \n"),P&&(H+=" gl_Position.w *= float(show); \n gl_PointSize *= float(show); \n"),H+="} \n";var W="varying vec4 v_color; \n";D&&(W+="uniform sampler2D u_clippingPlanes; \nuniform mat4 u_clippingPlanesMatrix; \nuniform vec4 u_clippingPlanesEdgeStyle; \n",W+="\n",W+=getClippingFunction(A,u),W+="\n"),W+="void main() \n{ \n gl_FragColor = czm_gammaCorrect(v_color); \n",D&&(W+=getClipAndStyleCode("u_clippingPlanes","u_clippingPlanesMatrix","u_clippingPlanesEdgeStyle")),W+="} \n",defined(e._vertexShaderLoaded)&&(H=e._vertexShaderLoaded(H)),defined(e._fragmentShaderLoaded)&&(W=e._fragmentShaderLoaded(W));var j=e._drawCommand;defined(j.shaderProgram)&&j.shaderProgram.destroy(),j.shaderProgram=ShaderProgram.fromCache({context:u,vertexShaderSource:H,fragmentShaderSource:W,attributeLocations:V});try{j.shaderProgram._bind()}catch(e){throw new RuntimeError("Error generating style shader: this may be caused by a type mismatch, index out-of-bounds, or other syntax error.")}}function decodeDraco(f,e){if(f._decodingState===DecodingState.READY)return!1;if(f._decodingState===DecodingState.NEEDS_DECODE){var m=f._parsedContent,g=m.draco,t=DracoLoader.decodePointCloud(g,e);defined(t)&&(f._decodingState=DecodingState.DECODING,t.then(function(e){f._decodingState=DecodingState.READY;var t=defined(e.POSITION)?e.POSITION.array:void 0,i=defined(e.RGB)?e.RGB.array:void 0,r=defined(e.RGBA)?e.RGBA.array:void 0,n=defined(e.NORMAL)?e.NORMAL.array:void 0,a=defined(e.BATCH_ID)?e.BATCH_ID.array:void 0,o=defined(t)&&defined(e.POSITION.data.quantization),s=defined(n)&&defined(e.NORMAL.data.quantization);if(o){var l=e.POSITION.data.quantization,u=l.range;f._quantizedVolumeScale=Cartesian3.fromElements(u,u,u),f._quantizedVolumeOffset=Cartesian3.unpack(l.minValues),f._quantizedRange=(1<<l.quantizationBits)-1,f._isQuantizedDraco=!0}s&&(f._octEncodedRange=(1<<e.NORMAL.data.quantization.quantizationBits)-1,f._isOctEncodedDraco=!0);var c=m.styleableProperties,d=g.batchTableProperties;for(var h in d)if(d.hasOwnProperty(h)){var p=e[h];defined(c)||(c={}),c[h]={typedArray:p.array,componentCount:p.data.componentsPerAttribute}}m.positions=defaultValue(t,m.positions),m.colors=defaultValue(defaultValue(r,i),m.colors),m.normals=defaultValue(n,m.normals),m.batchIds=defaultValue(a,m.batchIds),m.styleableProperties=c}).otherwise(function(e){f._decodingState=DecodingState.FAILED,f._readyPromise.reject(e)}))}return!0}var scratchComputedTranslation$2=new Cartesian4,scratchScale$9=new Cartesian3;PointCloud.prototype.update=function(e){if(!decodeDraco(this,e.context)){var t=!1,i=!Matrix4.equals(this._modelMatrix,this.modelMatrix);if(this._mode!==e.mode&&(this._mode=e.mode,i=!0),defined(this._drawCommand)||(createResources$2(this,e),t=i=!0,this._ready=!0,this._readyPromise.resolve(this),this._parsedContent=void 0),i){Matrix4.clone(this.modelMatrix,this._modelMatrix);var r=this._drawCommand.modelMatrix;if(Matrix4.clone(this._modelMatrix,r),defined(this._rtcCenter)&&Matrix4.multiplyByTranslation(r,this._rtcCenter,r),defined(this._quantizedVolumeOffset)&&Matrix4.multiplyByTranslation(r,this._quantizedVolumeOffset,r),e.mode!==SceneMode$1.SCENE3D){var n=e.mapProjection,a=Matrix4.getColumn(r,3,scratchComputedTranslation$2);Cartesian4.equals(a,Cartesian4.UNIT_W)||Transforms.basisTo2D(n,r,r)}var o=this._drawCommand.boundingVolume;if(BoundingSphere.clone(this._boundingSphere,o),this._cull){var s=o.center;Matrix4.multiplyByPoint(r,s,s);var l=Matrix4.getScale(r,scratchScale$9);o.radius*=Cartesian3.maximumComponent(l)}}this.clippingPlanesDirty&&(t=!(this.clippingPlanesDirty=!1)),this._attenuation!==this.attenuation&&(this._attenuation=this.attenuation,t=!0),this.backFaceCulling!==this._backFaceCulling&&(this._backFaceCulling=this.backFaceCulling,t=!0),this.normalShading!==this._normalShading&&(this._normalShading=this.normalShading,t=!0),this._style===this.style&&!this.styleDirty||(this._style=this.style,t=!(this.styleDirty=!1)),t&&createShaders$1(this,e,this._style),this._drawCommand.castShadows=ShadowMode$1.castShadows(this.shadows),this._drawCommand.receiveShadows=ShadowMode$1.receiveShadows(this.shadows);var u=this._highlightColor.alpha<1||this._constantColor.alpha<1||this._styleTranslucent;this._drawCommand.renderState=u?this._translucentRenderState:this._opaqueRenderState,this._drawCommand.pass=u?Pass$1.TRANSLUCENT:this._opaquePass;var c=e.commandList,d=e.passes;(d.render||d.pick)&&c.push(this._drawCommand)}},PointCloud.prototype.isDestroyed=function(){return!1},PointCloud.prototype.destroy=function(){var e=this._drawCommand;return defined(e)&&(e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy()),destroyObject(this)};var PointCloudEyeDomeLightingShader="#extension GL_EXT_frag_depth : enable\nuniform sampler2D u_pointCloud_colorGBuffer;\nuniform sampler2D u_pointCloud_depthGBuffer;\nuniform vec2 u_distanceAndEdlStrength;\nvarying vec2 v_textureCoordinates;\nvec2 neighborContribution(float log2Depth, vec2 offset)\n{\nfloat dist = u_distanceAndEdlStrength.x;\nvec2 texCoordOrig = v_textureCoordinates + offset * dist;\nvec2 texCoord0 = v_textureCoordinates + offset * floor(dist);\nvec2 texCoord1 = v_textureCoordinates + offset * ceil(dist);\nfloat depthOrLogDepth0 = czm_unpackDepth(texture2D(u_pointCloud_depthGBuffer, texCoord0));\nfloat depthOrLogDepth1 = czm_unpackDepth(texture2D(u_pointCloud_depthGBuffer, texCoord1));\nif (depthOrLogDepth0 == 0.0 || depthOrLogDepth1 == 0.0) {\nreturn vec2(0.0);\n}\nfloat depthMix = mix(depthOrLogDepth0, depthOrLogDepth1, fract(dist));\nvec4 eyeCoordinate = czm_windowToEyeCoordinates(texCoordOrig, depthMix);\nreturn vec2(max(0.0, log2Depth - log2(-eyeCoordinate.z / eyeCoordinate.w)), 1.0);\n}\nvoid main()\n{\nfloat depthOrLogDepth = czm_unpackDepth(texture2D(u_pointCloud_depthGBuffer, v_textureCoordinates));\nvec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, depthOrLogDepth);\neyeCoordinate /= eyeCoordinate.w;\nfloat log2Depth = log2(-eyeCoordinate.z);\nif (depthOrLogDepth == 0.0)\n{\ndiscard;\n}\nvec4 color = texture2D(u_pointCloud_colorGBuffer, v_textureCoordinates);\nvec2 texelSize = 1.0 / czm_viewport.zw;\nvec2 responseAndCount = vec2(0.0);\nresponseAndCount += neighborContribution(log2Depth, vec2(-texelSize.x, 0.0));\nresponseAndCount += neighborContribution(log2Depth, vec2(+texelSize.x, 0.0));\nresponseAndCount += neighborContribution(log2Depth, vec2(0.0, -texelSize.y));\nresponseAndCount += neighborContribution(log2Depth, vec2(0.0, +texelSize.y));\nfloat response = responseAndCount.x / responseAndCount.y;\nfloat strength = u_distanceAndEdlStrength.y;\nfloat shade = exp(-response * 300.0 * strength);\ncolor.rgb *= shade;\ngl_FragColor = vec4(color);\n#ifdef LOG_DEPTH\nczm_writeLogDepth(1.0 + (czm_projection * vec4(eyeCoordinate.xyz, 1.0)).w);\n#else\ngl_FragDepthEXT = czm_eyeToWindowCoordinates(vec4(eyeCoordinate.xyz, 1.0)).z;\n#endif\n}\n";function PointCloudEyeDomeLighting(){this._framebuffer=void 0,this._colorGBuffer=void 0,this._depthGBuffer=void 0,this._depthTexture=void 0,this._drawCommand=void 0,this._clearCommand=void 0,this._strength=1,this._radius=1}function destroyFramebuffer$6(e){var t=e._framebuffer;defined(t)&&(e._colorGBuffer.destroy(),e._depthGBuffer.destroy(),e._depthTexture.destroy(),t.destroy(),e._framebuffer=void 0,e._colorGBuffer=void 0,e._depthGBuffer=void 0,e._depthTexture=void 0,e._drawCommand=void 0,e._clearCommand=void 0)}function createFramebuffer$4(e,t){var i=t.drawingBufferWidth,r=t.drawingBufferHeight,n=new Texture({context:t,width:i,height:r,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:PixelDatatype$1.UNSIGNED_BYTE,sampler:Sampler.NEAREST}),a=new Texture({context:t,width:i,height:r,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:PixelDatatype$1.UNSIGNED_BYTE,sampler:Sampler.NEAREST}),o=new Texture({context:t,width:i,height:r,pixelFormat:PixelFormat$1.DEPTH_COMPONENT,pixelDatatype:PixelDatatype$1.UNSIGNED_INT,sampler:Sampler.NEAREST});e._framebuffer=new Framebuffer({context:t,colorTextures:[n,a],depthTexture:o,destroyAttachments:!1}),e._colorGBuffer=n,e._depthGBuffer=a,e._depthTexture=o}var distanceAndEdlStrengthScratch=new Cartesian2;function createCommands$5(e,t){var i=PointCloudEyeDomeLightingShader,r={u_pointCloud_colorGBuffer:function(){return e._colorGBuffer},u_pointCloud_depthGBuffer:function(){return e._depthGBuffer},u_distanceAndEdlStrength:function(){return distanceAndEdlStrengthScratch.x=e._radius,distanceAndEdlStrengthScratch.y=e._strength,distanceAndEdlStrengthScratch}},n=RenderState.fromCache({blending:BlendingState$1.ALPHA_BLEND,depthMask:!0,depthTest:{enabled:!0},stencilTest:StencilConstants$1.setCesium3DTileBit(),stencilMask:StencilConstants$1.CESIUM_3D_TILE_MASK});e._drawCommand=t.createViewportQuadCommand(i,{uniformMap:r,renderState:n,pass:Pass$1.CESIUM_3D_TILE,owner:e}),e._clearCommand=new ClearCommand({framebuffer:e._framebuffer,color:new Color(0,0,0,0),depth:1,renderState:RenderState.fromCache(),pass:Pass$1.CESIUM_3D_TILE,owner:e})}function createResources$3(e,t){var i=t.drawingBufferWidth,r=t.drawingBufferHeight,n=e._colorGBuffer,a=!1,o=defined(n)&&(n.width!==i||n.height!==r);return defined(n)&&!o||(destroyFramebuffer$6(e),createFramebuffer$4(e,t),createCommands$5(e,t),a=!0),a}function isSupported(e){return e.drawBuffers&&e.fragmentDepth}function getECShaderProgram(e,t){var i=e.shaderCache.getDerivedShaderProgram(t,"EC");if(!defined(i)){var r=t._attributeLocations,n=t.fragmentShaderSource.clone();n.sources=n.sources.map(function(e){return e=(e=ShaderSource.replaceMain(e,"czm_point_cloud_post_process_main")).replace(/gl_FragColor/g,"gl_FragData[0]")}),n.sources.unshift("#extension GL_EXT_draw_buffers : enable \n"),n.sources.push("void main() \n{ \n czm_point_cloud_post_process_main(); \n#ifdef LOG_DEPTH\n czm_writeLogDepth();\n gl_FragData[1] = czm_packDepth(gl_FragDepthEXT); \n#else\n gl_FragData[1] = czm_packDepth(gl_FragCoord.z);\n#endif\n}"),i=e.shaderCache.createDerivedShaderProgram(t,"EC",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:n,attributeLocations:r})}return i}function PointCloudShading(e){var t=defaultValue(e,{});this.attenuation=defaultValue(t.attenuation,!1),this.geometricErrorScale=defaultValue(t.geometricErrorScale,1),this.maximumAttenuation=t.maximumAttenuation,this.baseResolution=t.baseResolution,this.eyeDomeLighting=defaultValue(t.eyeDomeLighting,!0),this.eyeDomeLightingStrength=defaultValue(t.eyeDomeLightingStrength,1),this.eyeDomeLightingRadius=defaultValue(t.eyeDomeLightingRadius,1),this.backFaceCulling=defaultValue(t.backFaceCulling,!1),this.normalShading=defaultValue(t.normalShading,!0)}function PointCloud3DTileContent(e,t,i,r,n){this._tileset=e,this._tile=t,this._resource=i,this._pickId=void 0,this._batchTable=void 0,this._styleDirty=!1,this._features=void 0,this.featurePropertiesDirty=!1,this._pointCloud=new PointCloud({arrayBuffer:r,byteOffset:n,cull:!1,opaquePass:Pass$1.CESIUM_3D_TILE,vertexShaderLoaded:getVertexShaderLoaded(this),fragmentShaderLoaded:getFragmentShaderLoaded(this),uniformMapLoaded:getUniformMapLoaded(this),batchTableLoaded:getBatchTableLoaded(this),pickIdLoaded:getPickIdLoaded(this)})}function getVertexShaderLoaded(t){return function(e){return defined(t._batchTable)?t._batchTable.getVertexShaderCallback(!1,"a_batchId",void 0)(e):e}}function getFragmentShaderLoaded(t){return function(e){return defined(t._batchTable)?t._batchTable.getFragmentShaderCallback(!1,void 0)(e):"uniform vec4 czm_pickColor;\n"+e}}function getUniformMapLoaded(t){return function(e){return defined(t._batchTable)?t._batchTable.getUniformMapCallback()(e):combine(e,{czm_pickColor:function(){return t._pickId.color}})}}function getBatchTableLoaded(r){return function(e,t,i){r._batchTable=new Cesium3DTileBatchTable(r,e,t,i)}}function getPickIdLoaded(e){return function(){return defined(e._batchTable)?e._batchTable.getPickId():"czm_pickColor"}}function getGeometricError(e){var t=e._tileset.pointCloudShading,i=e._tile.contentBoundingVolume.boundingSphere.volume(),r=CesiumMath.cbrt(i/e.pointsLength),n=e._tile.geometricError;return 0===n&&(n=defined(t)&&defined(t.baseResolution)?t.baseResolution:r),n}function createFeatures$3(e){var t=e.featuresLength;if(!defined(e._features)&&0<t){for(var i=new Array(t),r=0;r<t;++r)i[r]=new Cesium3DTileFeature(e,r);e._features=i}}PointCloudEyeDomeLighting.isSupported=isSupported,PointCloudEyeDomeLighting.prototype.update=function(e,t,i,r){if(isSupported(e.context)){this._strength=i.eyeDomeLightingStrength,this._radius=i.eyeDomeLightingRadius*e.pixelRatio;var n,a=createResources$3(this,e.context),o=e.commandList,s=o.length;for(n=t;n<s;++n){var l=o[n];if(l.primitiveType===PrimitiveType$1.POINTS&&l.pass!==Pass$1.TRANSLUCENT){var u=l.derivedCommands.pointCloudProcessor;defined(u)&&!l.dirty&&!a&&u.framebuffer===this._framebuffer||(u=DrawCommand.shallowClone(l),(l.derivedCommands.pointCloudProcessor=u).framebuffer=this._framebuffer,u.shaderProgram=getECShaderProgram(e.context,l.shaderProgram),u.castShadows=!1,u.receiveShadows=!1),o[n]=u}}var c=this._clearCommand,d=this._drawCommand;d.boundingVolume=r,o.push(d),o.push(c)}},PointCloudEyeDomeLighting.prototype.isDestroyed=function(){return!1},PointCloudEyeDomeLighting.prototype.destroy=function(){return destroyFramebuffer$6(this),destroyObject(this)},PointCloudShading.isSupported=function(e){return PointCloudEyeDomeLighting.isSupported(e.context)},Object.defineProperties(PointCloud3DTileContent.prototype,{featuresLength:{get:function(){return defined(this._batchTable)?this._batchTable.featuresLength:0}},pointsLength:{get:function(){return this._pointCloud.pointsLength}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return this._pointCloud.geometryByteLength}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return defined(this._batchTable)?this._batchTable.memorySizeInBytes:0}},innerContents:{get:function(){}},readyPromise:{get:function(){return this._pointCloud.readyPromise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){return this._batchTable}}}),PointCloud3DTileContent.prototype.hasProperty=function(e,t){return!!defined(this._batchTable)&&this._batchTable.hasProperty(e,t)},PointCloud3DTileContent.prototype.getFeature=function(e){if(defined(this._batchTable)){this.featuresLength;return createFeatures$3(this),this._features[e]}},PointCloud3DTileContent.prototype.applyDebugSettings=function(e,t){this._pointCloud.color=e?t:Color.WHITE},PointCloud3DTileContent.prototype.applyStyle=function(e){defined(this._batchTable)?this._batchTable.applyStyle(e):this._styleDirty=!0};var defaultShading=new PointCloudShading;function Tileset3DTileContent(e,t,i,r,n){this._tileset=e,this._tile=t,this._resource=i,this._readyPromise=when.defer(),this.featurePropertiesDirty=!1,initialize$7(this,r,n)}function initialize$7(t,e,i){i=defaultValue(i,0);var r,n=getStringFromTypedArray(new Uint8Array(e),i);try{r=JSON.parse(n)}catch(e){return void t._readyPromise.reject(new RuntimeError("Invalid tile content."))}t._tileset.loadTileset(t._resource,r,t._tile),t._readyPromise.resolve(t)}function createBillboardPointCallback(r,n,a,o,s){return function(){var e=document.createElement("canvas"),t=s+2*o;e.height=e.width=t;var i=e.getContext("2d");return i.clearRect(0,0,t,t),0!==o&&(i.beginPath(),i.arc(t/2,t/2,t/2,0,2*Math.PI,!0),i.closePath(),i.fillStyle=a,i.fill(),r<1&&(i.save(),i.globalCompositeOperation="destination-out",i.beginPath(),i.arc(t/2,t/2,s/2,0,2*Math.PI,!0),i.closePath(),i.fillStyle="black",i.fill(),i.restore())),i.beginPath(),i.arc(t/2,t/2,s/2,0,2*Math.PI,!0),i.closePath(),i.fillStyle=n,i.fill(),e}}function Cesium3DTilePointFeature(e,t,i,r,n){this._content=e,this._billboard=i,this._label=r,this._polyline=n,this._batchId=t,this._billboardImage=void 0,this._billboardColor=void 0,this._billboardOutlineColor=void 0,this._billboardOutlineWidth=void 0,this._billboardSize=void 0,this._pointSize=void 0,this._color=void 0,this._pointSize=void 0,this._pointOutlineColor=void 0,this._pointOutlineWidth=void 0,this._heightOffset=void 0,this._pickIds=new Array(3),setBillboardImage(this)}PointCloud3DTileContent.prototype.update=function(e,t){var i,r=this._pointCloud,n=defaultValue(e.pointCloudShading,defaultShading),a=this._tile,o=this._batchTable,s=t.mode,l=e.clippingPlanes;defined(this._pickId)||defined(o)||(this._pickId=t.context.createPickId({primitive:e,content:this})),defined(o)&&o.update(e,t),i=defined(a._contentBoundingVolume)?s===SceneMode$1.SCENE3D?a._contentBoundingVolume.boundingSphere:a._contentBoundingVolume2D.boundingSphere:s===SceneMode$1.SCENE3D?a._boundingVolume.boundingSphere:a._boundingVolume2D.boundingSphere;var u=this._styleDirty;this._styleDirty=!1,r.clippingPlanesOriginMatrix=e.clippingPlanesOriginMatrix,r.style=defined(o)?void 0:e.style,r.styleDirty=u,r.modelMatrix=a.computedTransform,r.time=e.timeSinceLoad,r.shadows=e.shadows,r.boundingSphere=i,r.clippingPlanes=l,r.isClipped=defined(l)&&l.enabled&&a._isClipped,r.clippingPlanesDirty=a.clippingPlanesDirty,r.attenuation=n.attenuation,r.backFaceCulling=n.backFaceCulling,r.normalShading=n.normalShading,r.geometricError=getGeometricError(this),r.geometricErrorScale=n.geometricErrorScale,defined(n)&&defined(n.maximumAttenuation)?r.maximumAttenuation=n.maximumAttenuation:a.refine===Cesium3DTileRefine$1.ADD?r.maximumAttenuation=5:r.maximumAttenuation=e.maximumScreenSpaceError,r.update(t)},PointCloud3DTileContent.prototype.isDestroyed=function(){return!1},PointCloud3DTileContent.prototype.destroy=function(){return this._pickId=this._pickId&&this._pickId.destroy(),this._pointCloud=this._pointCloud&&this._pointCloud.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),destroyObject(this)},Object.defineProperties(Tileset3DTileContent.prototype,{featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){}},readyPromise:{get:function(){return this._readyPromise.promise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){}}}),Tileset3DTileContent.prototype.hasProperty=function(e,t){return!1},Tileset3DTileContent.prototype.getFeature=function(e){},Tileset3DTileContent.prototype.applyDebugSettings=function(e,t){},Tileset3DTileContent.prototype.applyStyle=function(e){},Tileset3DTileContent.prototype.update=function(e,t){},Tileset3DTileContent.prototype.isDestroyed=function(){return!1},Tileset3DTileContent.prototype.destroy=function(){return destroyObject(this)};var scratchCartographic$b=new Cartographic;function setBillboardImage(e){var t=e._billboard;if(defined(e._billboardImage)&&e._billboardImage!==t.image)t.image=e._billboardImage;else if(!defined(e._billboardImage)){var i=defaultValue(e._color,Cesium3DTilePointFeature.defaultColor),r=defaultValue(e._pointOutlineColor,Cesium3DTilePointFeature.defaultPointOutlineColor),n=defaultValue(e._pointOutlineWidth,Cesium3DTilePointFeature.defaultPointOutlineWidth),a=defaultValue(e._pointSize,Cesium3DTilePointFeature.defaultPointSize),o=e._billboardColor,s=e._billboardOutlineColor,l=e._billboardOutlineWidth,u=e._billboardSize;if(!Color.equals(i,o)||!Color.equals(r,s)||n!==l||a!==u){e._billboardColor=Color.clone(i,e._billboardColor),e._billboardOutlineColor=Color.clone(r,e._billboardOutlineColor),e._billboardOutlineWidth=n,e._billboardSize=a;var c=i.alpha,d=i.toCssColorString(),h=r.toCssColorString(),p=JSON.stringify([d,a,h,n]);t.setImage(p,createBillboardPointCallback(c,d,h,n,a))}}}function Vector3DTilePoints(e){this._positions=e.positions,this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._rectangle=e.rectangle,this._minHeight=e.minimumHeight,this._maxHeight=e.maximumHeight,this._billboardCollection=void 0,this._labelCollection=void 0,this._polylineCollection=void 0,this._verticesPromise=void 0,this._packedBuffer=void 0,this._ready=!1,this._readyPromise=when.defer(),this._resolvedPromise=!1}function packBuffer$1(e,t){var i=e._rectangle,r=e._minHeight,n=e._maxHeight,a=2+Rectangle.packedLength+Ellipsoid.packedLength,o=new Float64Array(a),s=0;return o[s++]=r,o[s++]=n,Rectangle.pack(i,o,s),s+=Rectangle.packedLength,Ellipsoid.pack(t,o,s),o}Object.defineProperties(Cesium3DTilePointFeature.prototype,{show:{get:function(){return this._label.show},set:function(e){this._label.show=e,this._billboard.show=e,this._polyline.show=e}},color:{get:function(){return this._color},set:function(e){this._color=Color.clone(e,this._color),setBillboardImage(this)}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=e,setBillboardImage(this)}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=Color.clone(e,this._pointOutlineColor),setBillboardImage(this)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=e,setBillboardImage(this)}},labelColor:{get:function(){return this._label.fillColor},set:function(e){this._label.fillColor=e,this._polyline.show=this._label.show&&0<e.alpha}},labelOutlineColor:{get:function(){return this._label.outlineColor},set:function(e){this._label.outlineColor=e}},labelOutlineWidth:{get:function(){return this._label.outlineWidth},set:function(e){this._label.outlineWidth=e}},font:{get:function(){return this._label.font},set:function(e){this._label.font=e}},labelStyle:{get:function(){return this._label.style},set:function(e){this._label.style=e}},labelText:{get:function(){return this._label.text},set:function(e){defined(e)||(e=""),this._label.text=e}},backgroundColor:{get:function(){return this._label.backgroundColor},set:function(e){this._label.backgroundColor=e}},backgroundPadding:{get:function(){return this._label.backgroundPadding},set:function(e){this._label.backgroundPadding=e}},backgroundEnabled:{get:function(){return this._label.showBackground},set:function(e){this._label.showBackground=e}},scaleByDistance:{get:function(){return this._label.scaleByDistance},set:function(e){this._label.scaleByDistance=e,this._billboard.scaleByDistance=e}},translucencyByDistance:{get:function(){return this._label.translucencyByDistance},set:function(e){this._label.translucencyByDistance=e,this._billboard.translucencyByDistance=e}},distanceDisplayCondition:{get:function(){return this._label.distanceDisplayCondition},set:function(e){this._label.distanceDisplayCondition=e,this._polyline.distanceDisplayCondition=e,this._billboard.distanceDisplayCondition=e}},heightOffset:{get:function(){return this._heightOffset},set:function(e){var t=defaultValue(this._heightOffset,0),i=this._content.tileset.ellipsoid,r=i.cartesianToCartographic(this._billboard.position,scratchCartographic$b);r.height=r.height-t+e;var n=i.cartographicToCartesian(r);this._billboard.position=n,this._label.position=this._billboard.position,this._polyline.positions=[this._polyline.positions[0],n],this._heightOffset=e}},anchorLineEnabled:{get:function(){return this._polyline.show},set:function(e){this._polyline.show=e}},anchorLineColor:{get:function(){return this._polyline.material.uniforms.color},set:function(e){this._polyline.material.uniforms.color=Color.clone(e,this._polyline.material.uniforms.color)}},image:{get:function(){return this._billboardImage},set:function(e){var t=this._billboardImage!==e;this._billboardImage=e,t&&setBillboardImage(this)}},disableDepthTestDistance:{get:function(){return this._label.disableDepthTestDistance},set:function(e){this._label.disableDepthTestDistance=e,this._billboard.disableDepthTestDistance=e}},horizontalOrigin:{get:function(){return this._billboard.horizontalOrigin},set:function(e){this._billboard.horizontalOrigin=e}},verticalOrigin:{get:function(){return this._billboard.verticalOrigin},set:function(e){this._billboard.verticalOrigin=e}},labelHorizontalOrigin:{get:function(){return this._label.horizontalOrigin},set:function(e){this._label.horizontalOrigin=e}},labelVerticalOrigin:{get:function(){return this._label.verticalOrigin},set:function(e){this._label.verticalOrigin=e}},content:{get:function(){return this._content}},tileset:{get:function(){return this._content.tileset}},primitive:{get:function(){return this._content.tileset}},pickIds:{get:function(){var e=this._pickIds;return e[0]=this._billboard.pickId,e[1]=this._label.pickId,e[2]=this._polyline.pickId,e}}}),Cesium3DTilePointFeature.defaultColor=Color.WHITE,Cesium3DTilePointFeature.defaultPointOutlineColor=Color.BLACK,Cesium3DTilePointFeature.defaultPointOutlineWidth=0,Cesium3DTilePointFeature.defaultPointSize=8,Cesium3DTilePointFeature.prototype.hasProperty=function(e){return this._content.batchTable.hasProperty(this._batchId,e)},Cesium3DTilePointFeature.prototype.getPropertyNames=function(e){return this._content.batchTable.getPropertyNames(this._batchId,e)},Cesium3DTilePointFeature.prototype.getProperty=function(e){return this._content.batchTable.getProperty(this._batchId,e)},Cesium3DTilePointFeature.prototype.setProperty=function(e,t){this._content.batchTable.setProperty(this._batchId,e,t),this._content.featurePropertiesDirty=!0},Cesium3DTilePointFeature.prototype.isExactClass=function(e){return this._content.batchTable.isExactClass(this._batchId,e)},Cesium3DTilePointFeature.prototype.isClass=function(e){return this._content.batchTable.isClass(this._batchId,e)},Cesium3DTilePointFeature.prototype.getExactClassName=function(){return this._content.batchTable.getExactClassName(this._batchId)},Object.defineProperties(Vector3DTilePoints.prototype,{pointsLength:{get:function(){return this._billboardCollection.length}},texturesByteLength:{get:function(){return this._billboardCollection.textureAtlas.texture.sizeInBytes+this._labelCollection._textureAtlas.texture.sizeInBytes}},readyPromise:{get:function(){return this._readyPromise.promise}}});var createVerticesTaskProcessor$1=new TaskProcessor("createVectorTilePoints"),scratchPosition$9=new Cartesian3;function createPoints(t,e){if(!defined(t._billboardCollection)){var i;if(!defined(t._verticesPromise)){i=t._positions;var r=t._packedBuffer;defined(r)||(i=t._positions=arraySlice(i),t._batchIds=arraySlice(t._batchIds),r=t._packedBuffer=packBuffer$1(t,e));var n=[i.buffer,r.buffer],a={positions:i.buffer,packedBuffer:r.buffer},o=t._verticesPromise=createVerticesTaskProcessor$1.scheduleTask(a,n);if(!defined(o))return;o.then(function(e){t._positions=new Float64Array(e.positions),t._ready=!0})}if(t._ready&&!defined(t._billboardCollection)){i=t._positions;var s=t._batchTable,l=t._batchIds,u=t._billboardCollection=new BillboardCollection({batchTable:s}),c=t._labelCollection=new LabelCollection({batchTable:s}),d=t._polylineCollection=new PolylineCollection;d._useHighlightColor=!0;for(var h=i.length/3,p=0;p<h;++p){var f=l[p],m=Cartesian3.unpack(i,3*p,scratchPosition$9),g=u.add();g.position=m,g._batchIndex=f;var y=c.add();y.text=" ",y.position=m,y._batchIndex=f,d.add().positions=[Cartesian3.clone(m),Cartesian3.clone(m)]}t._positions=void 0,t._packedBuffer=void 0}}}function clearStyle$1(e,t){for(var i=e._batchIds,r=i.length,n=0;n<r;++n){var a=t[i[n]];a.show=!0,a.pointSize=Cesium3DTilePointFeature.defaultPointSize,a.color=Cesium3DTilePointFeature.defaultColor,a.pointOutlineColor=Cesium3DTilePointFeature.defaultPointOutlineColor,a.pointOutlineWidth=Cesium3DTilePointFeature.defaultPointOutlineWidth,a.labelColor=Color.WHITE,a.labelOutlineColor=Color.WHITE,a.labelOutlineWidth=1,a.font="30px sans-serif",a.labelStyle=LabelStyle$1.FILL,a.labelText=void 0,a.backgroundColor=new Color(.165,.165,.165,.8),a.backgroundPadding=new Cartesian2(7,5),a.backgroundEnabled=!1,a.scaleByDistance=void 0,a.translucencyByDistance=void 0,a.distanceDisplayCondition=void 0,a.heightOffset=0,a.anchorLineEnabled=!1,a.anchorLineColor=Color.WHITE,a.image=void 0,a.disableDepthTestDistance=0,a.horizontalOrigin=HorizontalOrigin$1.CENTER,a.verticalOrigin=VerticalOrigin$1.CENTER,a.labelHorizontalOrigin=HorizontalOrigin$1.RIGHT,a.labelVerticalOrigin=VerticalOrigin$1.BASELINE}}Vector3DTilePoints.prototype.createFeatures=function(e,t){for(var i=this._billboardCollection,r=this._labelCollection,n=this._polylineCollection,a=this._batchIds,o=a.length,s=0;s<o;++s){var l=a[s],u=i.get(s),c=r.get(s),d=n.get(s);t[l]=new Cesium3DTilePointFeature(e,l,u,c,d)}},Vector3DTilePoints.prototype.applyDebugSettings=function(e,t){e?(Color.clone(t,this._billboardCollection._highlightColor),Color.clone(t,this._labelCollection._highlightColor),Color.clone(t,this._polylineCollection._highlightColor)):(Color.clone(Color.WHITE,this._billboardCollection._highlightColor),Color.clone(Color.WHITE,this._labelCollection._highlightColor),Color.clone(Color.WHITE,this._polylineCollection._highlightColor))};var scratchColor$8=new Color,scratchColor2=new Color,scratchColor3=new Color,scratchColor4=new Color,scratchColor5=new Color,scratchColor6=new Color,scratchScaleByDistance=new NearFarScalar,scratchTranslucencyByDistance=new NearFarScalar,scratchDistanceDisplayCondition=new DistanceDisplayCondition;function Vector3DTilePolygons(e){this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._positions=e.positions,this._counts=e.counts,this._indices=e.indices,this._indexCounts=e.indexCounts,this._indexOffsets=void 0,this._batchTableColors=void 0,this._packedBuffer=void 0,this._batchedPositions=void 0,this._transferrableBatchIds=void 0,this._vertexBatchIds=void 0,this._ellipsoid=defaultValue(e.ellipsoid,Ellipsoid.WGS84),this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._polygonMinimumHeights=e.polygonMinimumHeights,this._polygonMaximumHeights=e.polygonMaximumHeights,this._center=defaultValue(e.center,Cartesian3.ZERO),this._rectangle=e.rectangle,this._center=void 0,this._boundingVolume=e.boundingVolume,this._boundingVolumes=void 0,this._batchedIndices=void 0,this._ready=!1,this._readyPromise=when.defer(),this._verticesPromise=void 0,this._primitive=void 0,this.debugWireframe=!1,this.forceRebatch=!1,this.classificationType=ClassificationType$1.BOTH}function packBuffer$2(e){var t=new Float64Array(3+Cartesian3.packedLength+Ellipsoid.packedLength+Rectangle.packedLength),i=0;return t[i++]=e._indices.BYTES_PER_ELEMENT,t[i++]=e._minimumHeight,t[i++]=e._maximumHeight,Cartesian3.pack(e._center,t,i),i+=Cartesian3.packedLength,Ellipsoid.pack(e._ellipsoid,t,i),i+=Ellipsoid.packedLength,Rectangle.pack(e._rectangle,t,i),t}function unpackBuffer$1(e,t){for(var i=1,r=t[i++],n=e._boundingVolumes=new Array(r),a=0;a<r;++a)n[a]=OrientedBoundingBox.unpack(t,i),i+=OrientedBoundingBox.packedLength;for(var o=t[i++],s=e._batchedIndices=new Array(o),l=0;l<o;++l){var u=Color.unpack(t,i);i+=Color.packedLength;for(var c=t[i++],d=t[i++],h=t[i++],p=new Array(h),f=0;f<h;++f)p[f]=t[i++];s[l]=new Vector3DTileBatch({color:u,offset:c,count:d,batchIds:p})}}Vector3DTilePoints.prototype.applyStyle=function(e,t){if(defined(e))for(var i=this._batchIds,r=i.length,n=0;n<r;++n){var a=t[i[n]];if(defined(e.show)&&(a.show=e.show.evaluate(a)),defined(e.pointSize)&&(a.pointSize=e.pointSize.evaluate(a)),defined(e.color)&&(a.color=e.color.evaluateColor(a,scratchColor$8)),defined(e.pointOutlineColor)&&(a.pointOutlineColor=e.pointOutlineColor.evaluateColor(a,scratchColor2)),defined(e.pointOutlineWidth)&&(a.pointOutlineWidth=e.pointOutlineWidth.evaluate(a)),defined(e.labelColor)&&(a.labelColor=e.labelColor.evaluateColor(a,scratchColor3)),defined(e.labelOutlineColor)&&(a.labelOutlineColor=e.labelOutlineColor.evaluateColor(a,scratchColor4)),defined(e.labelOutlineWidth)&&(a.labelOutlineWidth=e.labelOutlineWidth.evaluate(a)),defined(e.font)&&(a.font=e.font.evaluate(a)),defined(e.labelStyle)&&(a.labelStyle=e.labelStyle.evaluate(a)),defined(e.labelText)?a.labelText=e.labelText.evaluate(a):a.labelText=void 0,defined(e.backgroundColor)&&(a.backgroundColor=e.backgroundColor.evaluateColor(a,scratchColor5)),defined(e.backgroundPadding)&&(a.backgroundPadding=e.backgroundPadding.evaluate(a)),defined(e.backgroundEnabled)&&(a.backgroundEnabled=e.backgroundEnabled.evaluate(a)),defined(e.scaleByDistance)){var o=e.scaleByDistance.evaluate(a);scratchScaleByDistance.near=o.x,scratchScaleByDistance.nearValue=o.y,scratchScaleByDistance.far=o.z,scratchScaleByDistance.farValue=o.w,a.scaleByDistance=scratchScaleByDistance}else a.scaleByDistance=void 0;if(defined(e.translucencyByDistance)){var s=e.translucencyByDistance.evaluate(a);scratchTranslucencyByDistance.near=s.x,scratchTranslucencyByDistance.nearValue=s.y,scratchTranslucencyByDistance.far=s.z,scratchTranslucencyByDistance.farValue=s.w,a.translucencyByDistance=scratchTranslucencyByDistance}else a.translucencyByDistance=void 0;if(defined(e.distanceDisplayCondition)){var l=e.distanceDisplayCondition.evaluate(a);scratchDistanceDisplayCondition.near=l.x,scratchDistanceDisplayCondition.far=l.y,a.distanceDisplayCondition=scratchDistanceDisplayCondition}else a.distanceDisplayCondition=void 0;defined(e.heightOffset)&&(a.heightOffset=e.heightOffset.evaluate(a)),defined(e.anchorLineEnabled)&&(a.anchorLineEnabled=e.anchorLineEnabled.evaluate(a)),defined(e.anchorLineColor)&&(a.anchorLineColor=e.anchorLineColor.evaluateColor(a,scratchColor6)),defined(e.image)?a.image=e.image.evaluate(a):a.image=void 0,defined(e.disableDepthTestDistance)&&(a.disableDepthTestDistance=e.disableDepthTestDistance.evaluate(a)),defined(e.horizontalOrigin)&&(a.horizontalOrigin=e.horizontalOrigin.evaluate(a)),defined(e.verticalOrigin)&&(a.verticalOrigin=e.verticalOrigin.evaluate(a)),defined(e.labelHorizontalOrigin)&&(a.labelHorizontalOrigin=e.labelHorizontalOrigin.evaluate(a)),defined(e.labelVerticalOrigin)&&(a.labelVerticalOrigin=e.labelVerticalOrigin.evaluate(a))}else clearStyle$1(this,t)},Vector3DTilePoints.prototype.update=function(e){createPoints(this,e.mapProjection.ellipsoid),this._ready&&(this._polylineCollection.update(e),this._billboardCollection.update(e),this._labelCollection.update(e),this._resolvedPromise||(this._readyPromise.resolve(),this._resolvedPromise=!0))},Vector3DTilePoints.prototype.isDestroyed=function(){return!1},Vector3DTilePoints.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),this._labelCollection=this._labelCollection&&this._labelCollection.destroy(),this._polylineCollection=this._polylineCollection&&this._polylineCollection.destroy(),destroyObject(this)},Object.defineProperties(Vector3DTilePolygons.prototype,{trianglesLength:{get:function(){return defined(this._primitive)?this._primitive.trianglesLength:0}},geometryByteLength:{get:function(){return defined(this._primitive)?this._primitive.geometryByteLength:0}},readyPromise:{get:function(){return this._readyPromise.promise}}});var createVerticesTaskProcessor$2=new TaskProcessor("createVectorTilePolygons"),scratchColor$9=new Color;function createPrimitive$2(r){if(!defined(r._primitive)){if(!defined(r._verticesPromise)){var e=r._positions,t=r._counts,i=r._indexCounts,n=r._indices,a=r._transferrableBatchIds,o=r._batchTableColors,s=r._packedBuffer;if(!defined(o)){e=r._positions=arraySlice(r._positions),t=r._counts=arraySlice(r._counts),i=r._indexCounts=arraySlice(r._indexCounts),n=r._indices=arraySlice(r._indices),r._center=r._ellipsoid.cartographicToCartesian(Rectangle.center(r._rectangle)),a=r._transferrableBatchIds=new Uint32Array(r._batchIds),o=r._batchTableColors=new Uint32Array(a.length);for(var l=r._batchTable,u=o.length,c=0;c<u;++c){var d=l.getColor(c,scratchColor$9);o[c]=d.toRgba()}s=r._packedBuffer=packBuffer$2(r)}var h=[e.buffer,t.buffer,i.buffer,n.buffer,a.buffer,o.buffer,s.buffer],p={packedBuffer:s.buffer,positions:e.buffer,counts:t.buffer,indexCounts:i.buffer,indices:n.buffer,batchIds:a.buffer,batchTableColors:o.buffer},f=r._polygonMinimumHeights,m=r._polygonMaximumHeights;defined(f)&&defined(m)&&(f=arraySlice(f),m=arraySlice(m),h.push(f.buffer,m.buffer),p.minimumHeights=f,p.maximumHeights=m);var g=r._verticesPromise=createVerticesTaskProcessor$2.scheduleTask(p,h);if(!defined(g))return;when(g,function(e){r._positions=void 0,r._counts=void 0,r._polygonMinimumHeights=void 0,r._polygonMaximumHeights=void 0;var t=new Float64Array(e.packedBuffer),i=t[0];unpackBuffer$1(r,t),r._indices=2===IndexDatatype$1.getSizeInBytes(i)?new Uint16Array(e.indices):new Uint32Array(e.indices),r._indexOffsets=new Uint32Array(e.indexOffsets),r._indexCounts=new Uint32Array(e.indexCounts),r._batchedPositions=new Float32Array(e.positions),r._vertexBatchIds=new Uint16Array(e.batchIds),r._ready=!0})}r._ready&&!defined(r._primitive)&&(r._primitive=new Vector3DTilePrimitive({batchTable:r._batchTable,positions:r._batchedPositions,batchIds:r._batchIds,vertexBatchIds:r._vertexBatchIds,indices:r._indices,indexOffsets:r._indexOffsets,indexCounts:r._indexCounts,batchedIndices:r._batchedIndices,boundingVolume:r._boundingVolume,boundingVolumes:r._boundingVolumes,center:r._center}),r._batchTable=void 0,r._batchIds=void 0,r._positions=void 0,r._counts=void 0,r._indices=void 0,r._indexCounts=void 0,r._indexOffsets=void 0,r._batchTableColors=void 0,r._packedBuffer=void 0,r._batchedPositions=void 0,r._transferrableBatchIds=void 0,r._vertexBatchIds=void 0,r._ellipsoid=void 0,r._minimumHeight=void 0,r._maximumHeight=void 0,r._polygonMinimumHeights=void 0,r._polygonMaximumHeights=void 0,r._center=void 0,r._rectangle=void 0,r._boundingVolume=void 0,r._boundingVolumes=void 0,r._batchedIndices=void 0,r._verticesPromise=void 0,r._readyPromise.resolve())}}Vector3DTilePolygons.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)},Vector3DTilePolygons.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)},Vector3DTilePolygons.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)},Vector3DTilePolygons.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)},Vector3DTilePolygons.prototype.update=function(e){createPrimitive$2(this),this._ready&&(this._primitive.debugWireframe=this.debugWireframe,this._primitive.forceRebatch=this.forceRebatch,this._primitive.classificationType=this.classificationType,this._primitive.update(e))},Vector3DTilePolygons.prototype.isDestroyed=function(){return!1},Vector3DTilePolygons.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),destroyObject(this)};var Vector3DTilePolylinesVS="attribute vec4 currentPosition;\nattribute vec4 previousPosition;\nattribute vec4 nextPosition;\nattribute vec2 expandAndWidth;\nattribute float a_batchId;\nuniform mat4 u_modifiedModelView;\nvoid main()\n{\nfloat expandDir = expandAndWidth.x;\nfloat width = abs(expandAndWidth.y) + 0.5;\nbool usePrev = expandAndWidth.y < 0.0;\nvec4 p = u_modifiedModelView * currentPosition;\nvec4 prev = u_modifiedModelView * previousPosition;\nvec4 next = u_modifiedModelView * nextPosition;\nfloat angle;\nvec4 positionWC = getPolylineWindowCoordinatesEC(p, prev, next, expandDir, width, usePrev, angle);\ngl_Position = czm_viewportOrthographic * positionWC;\n#ifdef LOG_DEPTH\nczm_vertexLogDepth(czm_projection * p);\n#endif\n}\n";function Vector3DTilePolylines(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=defaultValue(e.ellipsoid,Ellipsoid.WGS84),this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._center=e.center,this._rectangle=e.rectangle,this._boundingVolume=e.boundingVolume,this._batchTable=e.batchTable,this._va=void 0,this._sp=void 0,this._rs=void 0,this._uniformMap=void 0,this._command=void 0,this._transferrableBatchIds=void 0,this._packedBuffer=void 0,this._currentPositions=void 0,this._previousPositions=void 0,this._nextPositions=void 0,this._expandAndWidth=void 0,this._vertexBatchIds=void 0,this._indices=void 0,this._constantColor=Color.clone(Color.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._readyPromise=when.defer(),this._verticesPromise=void 0}function packBuffer$3(e){var t=e._rectangle,i=e._minimumHeight,r=e._maximumHeight,n=e._ellipsoid,a=e._center,o=2+Rectangle.packedLength+Ellipsoid.packedLength+Cartesian3.packedLength,s=new Float64Array(o),l=0;return s[l++]=i,s[l++]=r,Rectangle.pack(t,s,l),l+=Rectangle.packedLength,Ellipsoid.pack(n,s,l),l+=Ellipsoid.packedLength,Cartesian3.pack(a,s,l),s}Object.defineProperties(Vector3DTilePolylines.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},readyPromise:{get:function(){return this._readyPromise.promise}}});var createVerticesTaskProcessor$3=new TaskProcessor("createVectorTilePolylines"),attributeLocations$3={previousPosition:0,currentPosition:1,nextPosition:2,expandAndWidth:3,a_batchId:4};function createVertexArray$5(i,e){if(!defined(i._va)){if(!defined(i._verticesPromise)){var t=i._positions,r=i._widths,n=i._counts,a=i._transferrableBatchIds,o=i._packedBuffer;defined(o)||(t=i._positions=arraySlice(t),r=i._widths=arraySlice(r),n=i._counts=arraySlice(n),a=i._transferrableBatchIds=arraySlice(i._batchIds),o=i._packedBuffer=packBuffer$3(i));var s=[t.buffer,r.buffer,n.buffer,a.buffer,o.buffer],l={positions:t.buffer,widths:r.buffer,counts:n.buffer,batchIds:a.buffer,packedBuffer:o.buffer},u=i._verticesPromise=createVerticesTaskProcessor$3.scheduleTask(l,s);if(!defined(u))return;when(u,function(e){i._currentPositions=new Float32Array(e.currentPositions),i._previousPositions=new Float32Array(e.previousPositions),i._nextPositions=new Float32Array(e.nextPositions),i._expandAndWidth=new Float32Array(e.expandAndWidth),i._vertexBatchIds=new Uint16Array(e.batchIds);var t=e.indexDatatype;i._indices=t===IndexDatatype$1.UNSIGNED_SHORT?new Uint16Array(e.indices):new Uint32Array(e.indices),i._ready=!0})}if(i._ready&&!defined(i._va)){var c=i._currentPositions,d=i._previousPositions,h=i._nextPositions,p=i._expandAndWidth,f=i._vertexBatchIds,m=i._indices,g=d.byteLength+c.byteLength+h.byteLength;g+=p.byteLength+f.byteLength+m.byteLength,i._trianglesLength=m.length/3,i._geometryByteLength=g;var y=Buffer$1.createVertexBuffer({context:e,typedArray:d,usage:BufferUsage$1.STATIC_DRAW}),v=Buffer$1.createVertexBuffer({context:e,typedArray:c,usage:BufferUsage$1.STATIC_DRAW}),_=Buffer$1.createVertexBuffer({context:e,typedArray:h,usage:BufferUsage$1.STATIC_DRAW}),C=Buffer$1.createVertexBuffer({context:e,typedArray:p,usage:BufferUsage$1.STATIC_DRAW}),x=Buffer$1.createVertexBuffer({context:e,typedArray:f,usage:BufferUsage$1.STATIC_DRAW}),b=Buffer$1.createIndexBuffer({context:e,typedArray:m,usage:BufferUsage$1.STATIC_DRAW,indexDatatype:2===m.BYTES_PER_ELEMENT?IndexDatatype$1.UNSIGNED_SHORT:IndexDatatype$1.UNSIGNED_INT}),A=[{index:attributeLocations$3.previousPosition,vertexBuffer:y,componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3},{index:attributeLocations$3.currentPosition,vertexBuffer:v,componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3},{index:attributeLocations$3.nextPosition,vertexBuffer:_,componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3},{index:attributeLocations$3.expandAndWidth,vertexBuffer:C,componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:2},{index:attributeLocations$3.a_batchId,vertexBuffer:x,componentDatatype:ComponentDatatype$1.UNSIGNED_SHORT,componentsPerAttribute:1}];i._va=new VertexArray({context:e,attributes:A,indexBuffer:b}),i._positions=void 0,i._widths=void 0,i._counts=void 0,i._ellipsoid=void 0,i._minimumHeight=void 0,i._maximumHeight=void 0,i._rectangle=void 0,i._transferrableBatchIds=void 0,i._packedBuffer=void 0,i._currentPositions=void 0,i._previousPositions=void 0,i._nextPositions=void 0,i._expandAndWidth=void 0,i._vertexBatchIds=void 0,i._indices=void 0,i._readyPromise.resolve()}}}var modifiedModelViewScratch$3=new Matrix4,rtcScratch$3=new Cartesian3;function createUniformMap$3(t,i){defined(t._uniformMap)||(t._uniformMap={u_modifiedModelView:function(){var e=i.uniformState.view;return Matrix4.clone(e,modifiedModelViewScratch$3),Matrix4.multiplyByPoint(modifiedModelViewScratch$3,t._center,rtcScratch$3),Matrix4.setTranslation(modifiedModelViewScratch$3,rtcScratch$3,modifiedModelViewScratch$3),modifiedModelViewScratch$3},u_highlightColor:function(){return t._highlightColor}})}function createRenderStates$9(e){if(!defined(e._rs)){e._rs=RenderState.fromCache({blending:BlendingState$1.ALPHA_BLEND,depthMask:!1,depthTest:{enabled:!0},polygonOffset:{enabled:!0,factor:-5,units:-5}})}}var PolylineFS$1="uniform vec4 u_highlightColor; \nvoid main()\n{\n gl_FragColor = u_highlightColor;\n}\n";function createShaders$2(e,t){if(!defined(e._sp)){var i=e._batchTable,r=i.getVertexShaderCallback(!1,"a_batchId",void 0)(Vector3DTilePolylinesVS),n=i.getFragmentShaderCallback()(PolylineFS$1,!1,void 0),a=new ShaderSource({defines:["VECTOR_TILE",FeatureDetection$1.isInternetExplorer()?"":"CLIP_POLYLINE"],sources:[PolylineCommon,r]}),o=new ShaderSource({defines:["VECTOR_TILE"],sources:[n]});e._sp=ShaderProgram.fromCache({context:t,vertexShaderSource:a,fragmentShaderSource:o,attributeLocations:attributeLocations$3})}}function queueCommands$1(e,t){if(!defined(e._command)){var i=e._batchTable.getUniformMapCallback()(e._uniformMap);e._command=new DrawCommand({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:i,boundingVolume:e._boundingVolume,pass:Pass$1.TRANSLUCENT,pickId:e._batchTable.getPickId()})}t.commandList.push(e._command)}function clearStyle$2(e,t){for(var i=e._batchIds,r=i.length,n=0;n<r;++n){var a=t[i[n]];a.show=!0,a.color=Color.WHITE}}Vector3DTilePolylines.prototype.createFeatures=function(e,t){for(var i=this._batchIds,r=i.length,n=0;n<r;++n){var a=i[n];t[a]=new Cesium3DTileFeature(e,a)}},Vector3DTilePolylines.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};var scratchColor$a=new Color,DEFAULT_COLOR_VALUE$2=Color.WHITE,DEFAULT_SHOW_VALUE$2=!0;function Vector3DTileContent(e,t,i,r,n){this._tileset=e,this._tile=t,this._resource=i,this._polygons=void 0,this._polylines=void 0,this._points=void 0,this._contentReadyPromise=void 0,this._readyPromise=when.defer(),this._batchTable=void 0,this._features=void 0,this.featurePropertiesDirty=!1,initialize$8(this,r,n)}function createColorChangedCallback$2(i){return function(e,t){defined(i._polygons)&&i._polygons.updateCommands(e,t)}}function getBatchIds$1(e,t){var i,r,n,a,o=defaultValue(e.POLYGONS_LENGTH,0),s=defaultValue(e.POLYLINES_LENGTH,0),l=defaultValue(e.POINTS_LENGTH,0);if(0<o&&defined(e.POLYGON_BATCH_IDS)){var u=t.byteOffset+e.POLYGON_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,u,o)}if(0<s&&defined(e.POLYLINE_BATCH_IDS)){var c=t.byteOffset+e.POLYLINE_BATCH_IDS.byteOffset;r=new Uint16Array(t.buffer,c,s)}if(0<l&&defined(e.POINT_BATCH_IDS)){var d=t.byteOffset+e.POINT_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,d,l)}var h=defined(i)||defined(r)||defined(n),p=0<o&&!defined(i)||0<s&&!defined(r)||0<l&&!defined(n);if(h&&p)throw new RuntimeError("If one group of batch ids is defined, then all batch ids must be defined.");if(!defined(i)&&!defined(r)&&!defined(n)){var f=0;if(!defined(i)&&0<o)for(i=new Uint16Array(o),a=0;a<o;++a)i[a]=f++;if(!defined(r)&&0<s)for(r=new Uint16Array(s),a=0;a<s;++a)r[a]=f++;if(!defined(n)&&0<l)for(n=new Uint16Array(l),a=0;a<l;++a)n[a]=f++}return{polygons:i,polylines:r,points:n}}Vector3DTilePolylines.prototype.applyStyle=function(e,t){if(defined(e))for(var i=this._batchIds,r=i.length,n=0;n<r;++n){var a=t[i[n]];a.color=defined(e.color)?e.color.evaluateColor(a,scratchColor$a):DEFAULT_COLOR_VALUE$2,a.show=defined(e.show)?e.show.evaluate(a):DEFAULT_SHOW_VALUE$2}else clearStyle$2(this,t)},Vector3DTilePolylines.prototype.update=function(e){var t=e.context;if(createVertexArray$5(this,t),createUniformMap$3(this,t),createShaders$2(this,t),createRenderStates$9(this),this._ready){var i=e.passes;(i.render||i.pick)&&queueCommands$1(this,e)}},Vector3DTilePolylines.prototype.isDestroyed=function(){return!1},Vector3DTilePolylines.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),destroyObject(this)},Object.defineProperties(Vector3DTileContent.prototype,{featuresLength:{get:function(){return defined(this._batchTable)?this._batchTable.featuresLength:0}},pointsLength:{get:function(){return defined(this._points)?this._points.pointsLength:0}},trianglesLength:{get:function(){var e=0;return defined(this._polygons)&&(e+=this._polygons.trianglesLength),defined(this._polylines)&&(e+=this._polylines.trianglesLength),e}},geometryByteLength:{get:function(){var e=0;return defined(this._polygons)&&(e+=this._polygons.geometryByteLength),defined(this._polylines)&&(e+=this._polylines.geometryByteLength),e}},texturesByteLength:{get:function(){return defined(this._points)?this._points.texturesByteLength:0}},batchTableByteLength:{get:function(){return defined(this._batchTable)?this._batchTable.memorySizeInBytes:0}},innerContents:{get:function(){}},readyPromise:{get:function(){return this._readyPromise.promise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){return this._batchTable}}});var sizeOfUint32$9=Uint32Array.BYTES_PER_ELEMENT;function initialize$8(e,t,i){i=defaultValue(i,0);var r=new Uint8Array(t),n=new DataView(t);i+=sizeOfUint32$9;var a=n.getUint32(i,!0);if(1!==a)throw new RuntimeError("Only Vector tile version 1 is supported. Version "+a+" is not.");i+=sizeOfUint32$9;var o=n.getUint32(i,!0);if(i+=sizeOfUint32$9,0!==o){var s=n.getUint32(i,!0);if(i+=sizeOfUint32$9,0===s)throw new RuntimeError("Feature table must have a byte length greater than zero");var l=n.getUint32(i,!0);i+=sizeOfUint32$9;var u=n.getUint32(i,!0);i+=sizeOfUint32$9;var c=n.getUint32(i,!0);i+=sizeOfUint32$9;var d=n.getUint32(i,!0);i+=sizeOfUint32$9;var h=n.getUint32(i,!0);i+=sizeOfUint32$9;var p=n.getUint32(i,!0);i+=sizeOfUint32$9;var f=n.getUint32(i,!0),m=getStringFromTypedArray(r,i+=sizeOfUint32$9,s),g=JSON.parse(m);i+=s;var y,v,_=new Uint8Array(t,i,l);if(i+=l,0<u){var C=getStringFromTypedArray(r,i,u);y=JSON.parse(C),i+=u,0<c&&(v=new Uint8Array(t,i,c),v=new Uint8Array(v),i+=c)}var x=defaultValue(g.POLYGONS_LENGTH,0),b=defaultValue(g.POLYLINES_LENGTH,0),A=defaultValue(g.POINTS_LENGTH,0),S=x+b+A,w=new Cesium3DTileBatchTable(e,S,y,v,createColorChangedCallback$2(e));if(e._batchTable=w,0!==S){var E=new Cesium3DTileFeatureTable(g,_),T=E.getGlobalProperty("REGION");if(!defined(T))throw new RuntimeError("Feature table global property: REGION must be defined");var P=Rectangle.unpack(T),M=T[4],D=T[5],I=e._tile.computedTransform,O=E.getGlobalProperty("RTC_CENTER",ComponentDatatype$1.FLOAT,3);defined(O)?(O=Cartesian3.unpack(O),Matrix4.multiplyByPoint(I,O,O)):((O=Rectangle.center(P)).height=CesiumMath.lerp(M,D,.5),O=Ellipsoid.WGS84.cartographicToCartesian(O));var R=getBatchIds$1(g,_);if(i+=i%4,0<x){E.featuresLength=x;var L=defaultValue(E.getPropertyArray("POLYGON_COUNTS",ComponentDatatype$1.UNSIGNED_INT,1),E.getPropertyArray("POLYGON_COUNT",ComponentDatatype$1.UNSIGNED_INT,1));if(!defined(L))throw new RuntimeError("Feature table property: POLYGON_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");var N=defaultValue(E.getPropertyArray("POLYGON_INDEX_COUNTS",ComponentDatatype$1.UNSIGNED_INT,1),E.getPropertyArray("POLYGON_INDEX_COUNT",ComponentDatatype$1.UNSIGNED_INT,1));if(!defined(N))throw new RuntimeError("Feature table property: POLYGON_INDEX_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");var k=L.reduce(function(e,t){return e+2*t},0),B=N.reduce(function(e,t){return e+t},0),F=new Uint32Array(t,i,B);i+=d;var V,z,U=new Uint16Array(t,i,k);i+=h,defined(g.POLYGON_MINIMUM_HEIGHTS)&&defined(g.POLYGON_MAXIMUM_HEIGHTS)&&(V=E.getPropertyArray("POLYGON_MINIMUM_HEIGHTS",ComponentDatatype$1.FLOAT,1),z=E.getPropertyArray("POLYGON_MAXIMUM_HEIGHTS",ComponentDatatype$1.FLOAT,1)),e._polygons=new Vector3DTilePolygons({positions:U,counts:L,indexCounts:N,indices:F,minimumHeight:M,maximumHeight:D,polygonMinimumHeights:V,polygonMaximumHeights:z,center:O,rectangle:P,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:w,batchIds:R.polygons,modelMatrix:I})}if(0<b){E.featuresLength=b;var G=defaultValue(E.getPropertyArray("POLYLINE_COUNTS",ComponentDatatype$1.UNSIGNED_INT,1),E.getPropertyArray("POLYLINE_COUNT",ComponentDatatype$1.UNSIGNED_INT,1));if(!defined(G))throw new RuntimeError("Feature table property: POLYLINE_COUNTS must be defined when POLYLINES_LENGTH is greater than 0");var $=E.getPropertyArray("POLYLINE_WIDTHS",ComponentDatatype$1.UNSIGNED_SHORT,1);if(!defined($)){$=new Uint16Array(b);for(var H=0;H<b;++H)$[H]=2}var W=G.reduce(function(e,t){return e+3*t},0),j=new Uint16Array(t,i,W);i+=p,e._polylines=new Vector3DTilePolylines({positions:j,widths:$,counts:G,batchIds:R.polylines,minimumHeight:M,maximumHeight:D,center:O,rectangle:P,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:w})}if(0<A){var q=new Uint16Array(t,i,3*A);i+=f,e._points=new Vector3DTilePoints({positions:q,batchIds:R.points,minimumHeight:M,maximumHeight:D,rectangle:P,batchTable:w})}}}else e._readyPromise.resolve(e)}function createFeatures$4(e){var t=e.featuresLength;if(!defined(e._features)&&0<t){var i=new Array(t);defined(e._polygons)&&e._polygons.createFeatures(e,i),defined(e._polylines)&&e._polylines.createFeatures(e,i),defined(e._points)&&e._points.createFeatures(e,i),e._features=i}}Vector3DTileContent.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)},Vector3DTileContent.prototype.getFeature=function(e){return createFeatures$4(this),this._features[e]},Vector3DTileContent.prototype.applyDebugSettings=function(e,t){defined(this._polygons)&&this._polygons.applyDebugSettings(e,t),defined(this._polylines)&&this._polylines.applyDebugSettings(e,t),defined(this._points)&&this._points.applyDebugSettings(e,t)},Vector3DTileContent.prototype.applyStyle=function(e){createFeatures$4(this),defined(this._polygons)&&this._polygons.applyStyle(e,this._features),defined(this._polylines)&&this._polylines.applyStyle(e,this._features),defined(this._points)&&this._points.applyStyle(e,this._features)},Vector3DTileContent.prototype.update=function(e,t){var i=!0;if(defined(this._polygons)&&(this._polygons.classificationType=this._tileset.classificationType,this._polygons.debugWireframe=this._tileset.debugWireframe,this._polygons.update(t),i=i&&this._polygons._ready),defined(this._polylines)&&(this._polylines.update(t),i=i&&this._polylines._ready),defined(this._points)&&(this._points.update(t),i=i&&this._points._ready),defined(this._batchTable)&&i&&this._batchTable.update(e,t),!defined(this._contentReadyPromise)){var r=defined(this._points)?this._points.readyPromise:void 0,n=defined(this._polygons)?this._polygons.readyPromise:void 0,a=defined(this._polylines)?this._polylines.readyPromise:void 0,o=this;this._contentReadyPromise=when.all([r,n,a]).then(function(){o._readyPromise.resolve(o)})}},Vector3DTileContent.prototype.isDestroyed=function(){return!1},Vector3DTileContent.prototype.destroy=function(){return this._polygons=this._polygons&&this._polygons.destroy(),this._polylines=this._polylines&&this._polylines.destroy(),this._points=this._points&&this._points.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),destroyObject(this)};var Cesium3DTileContentFactory={b3dm:function(e,t,i,r,n){return new Batched3DModel3DTileContent(e,t,i,r,n)},pnts:function(e,t,i,r,n){return new PointCloud3DTileContent(e,t,i,r,n)},i3dm:function(e,t,i,r,n){return new Instanced3DModel3DTileContent(e,t,i,r,n)},cmpt:function(e,t,i,r,n){return new Composite3DTileContent(e,t,i,r,n,Cesium3DTileContentFactory)},json:function(e,t,i,r,n){return new Tileset3DTileContent(e,t,i,r,n)},geom:function(e,t,i,r,n){return new Geometry3DTileContent(e,t,i,r,n)},vctr:function(e,t,i,r,n){return new Vector3DTileContent(e,t,i,r,n)}},Cesium3DTileContentState={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,EXPIRED:4,FAILED:5},Cesium3DTileContentState$1=Object.freeze(Cesium3DTileContentState),Cesium3DTileOptimizationHint={NOT_COMPUTED:-1,USE_OPTIMIZATION:1,SKIP_OPTIMIZATION:0},Cesium3DTileOptimizationHint$1=Object.freeze(Cesium3DTileOptimizationHint);function Cesium3DTilesetMostDetailedTraversal(){}var traversal={stack:new ManagedArray,stackMaximumLength:0};function isVisible(e){return e._visible&&e._inRequestVolume}function hasEmptyContent(e){return e.hasEmptyContent||e.hasTilesetContent}function hasUnloadedContent(e){return!hasEmptyContent(e)&&e.contentUnloaded}function canTraverse(e,t){return 0!==t.children.length&&(t.hasTilesetContent?!t.contentExpired:(t.hasEmptyContent,!0))}function updateAndPushChildren(e,t,i,r){for(var n=t.children,a=n.length,o=0;o<a;++o){var s=n[o];s.updateVisibility(r),isVisible(s)&&i.push(s)}}function loadTile(e,t){(hasUnloadedContent(t)||t.contentExpired)&&(t._priority=0,e._requestedTiles.push(t))}function touchTile(e,t,i){t._touchedFrame!==i.frameNumber&&(e._cache.touch(t),t._touchedFrame=i.frameNumber)}function visitTile(e){++e.statistics.visited}function selectDesiredTile(e,t,i){t.contentAvailable&&t.contentVisibility(i)!==Intersect$1.OUTSIDE&&e._selectedTiles.push(t)}function Cesium3DTilesetTraversal(){}function isVisible$1(e){return e._visible&&e._inRequestVolume}Cesium3DTilesetMostDetailedTraversal.selectTiles=function(e,t){e._selectedTiles.length=0,e._requestedTiles.length=0;var i=!(e._hasMixedContent=!1),r=e.root;if(r.updateVisibility(t),!isVisible(r))return i;var n=traversal.stack;for(n.push(e.root);0<n.length;){traversal.stackMaximumLength=Math.max(traversal.stackMaximumLength,n.length);var a=n.pop(),o=a.refine===Cesium3DTileRefine$1.ADD,s=a.refine===Cesium3DTileRefine$1.REPLACE,l=canTraverse(e,a);l&&updateAndPushChildren(e,a,n,t),(o||s&&!l)&&(loadTile(e,a),touchTile(e,a,t),selectDesiredTile(e,a,t),hasEmptyContent(a)||a.contentAvailable||(i=!1)),visitTile(e)}return traversal.stack.trim(traversal.stackMaximumLength),i};var traversal$1={stack:new ManagedArray,stackMaximumLength:0},emptyTraversal={stack:new ManagedArray,stackMaximumLength:0},descendantTraversal={stack:new ManagedArray,stackMaximumLength:0},selectionTraversal={stack:new ManagedArray,stackMaximumLength:0,ancestorStack:new ManagedArray,ancestorStackMaximumLength:0},descendantSelectionDepth=2;function executeBaseTraversal(e,t,i){executeTraversal(e,t,e._maximumScreenSpaceError,e._maximumScreenSpaceError,i)}function executeSkipTraversal(e,t,i){executeTraversal(e,t,Number.MAX_VALUE,e._maximumScreenSpaceError,i),traverseAndSelect(e,t,i)}function executeBaseAndSkipTraversal(e,t,i){executeTraversal(e,t,Math.max(e.baseScreenSpaceError,e.maximumScreenSpaceError),e.maximumScreenSpaceError,i),traverseAndSelect(e,t,i)}function skipLevelOfDetail(e){return e._skipLevelOfDetail}function addEmptyTile(e,t){e._emptyTiles.push(t)}function selectTile(e,t,i){if(t.contentVisibility(i)!==Intersect$1.OUTSIDE){var r=t.content;r.featurePropertiesDirty?(r.featurePropertiesDirty=!1,t.lastStyleTime=0,e._selectedTilesToStyle.push(t)):t._selectedFrame<i.frameNumber-1&&e._selectedTilesToStyle.push(t),t._selectedFrame=i.frameNumber,e._selectedTiles.push(t)}}function selectDescendants(e,t,i){var r=descendantTraversal.stack;for(r.push(t);0<r.length;){descendantTraversal.stackMaximumLength=Math.max(descendantTraversal.stackMaximumLength,r.length);for(var n=r.pop().children,a=n.length,o=0;o<a;++o){var s=n[o];isVisible$1(s)&&(s.contentAvailable?(updateTile(e,s,i),touchTile$1(e,s,i),selectTile(e,s,i)):s._depth-t._depth<descendantSelectionDepth&&r.push(s))}}}function selectDesiredTile$1(e,t,i){if(skipLevelOfDetail(e)){var r=t.contentAvailable?t:t._ancestorWithContentAvailable;defined(r)?r._shouldSelect=!0:selectDescendants(e,t,i)}else t.contentAvailable&&selectTile(e,t,i)}function visitTile$1(e,t,i){++e._statistics.visited,t._visitedFrame=i.frameNumber}function touchTile$1(e,t,i){t._touchedFrame!==i.frameNumber&&(e._cache.touch(t),t._touchedFrame=i.frameNumber)}function updateMinimumMaximumPriority(e,t){e._maximumPriority.distance=Math.max(t._priorityHolder._distanceToCamera,e._maximumPriority.distance),e._minimumPriority.distance=Math.min(t._priorityHolder._distanceToCamera,e._minimumPriority.distance),e._maximumPriority.depth=Math.max(t._depth,e._maximumPriority.depth),e._minimumPriority.depth=Math.min(t._depth,e._minimumPriority.depth),e._maximumPriority.foveatedFactor=Math.max(t._priorityHolder._foveatedFactor,e._maximumPriority.foveatedFactor),e._minimumPriority.foveatedFactor=Math.min(t._priorityHolder._foveatedFactor,e._minimumPriority.foveatedFactor),e._maximumPriority.reverseScreenSpaceError=Math.max(t._priorityReverseScreenSpaceError,e._maximumPriority.reverseScreenSpaceError),e._minimumPriority.reverseScreenSpaceError=Math.min(t._priorityReverseScreenSpaceError,e._minimumPriority.reverseScreenSpaceError)}function isOnScreenLongEnough(e,t,i){if(!e._cullRequestsWhileMoving)return!0;var r=t.boundingSphere,n=Math.max(2*r.radius,1),a=i.camera,o=0!==a.positionWCDeltaMagnitude?a.positionWCDeltaMagnitude:a.positionWCDeltaMagnitudeLastFrame;return e.cullRequestsWhileMovingMultiplier*o/n<1}function loadTile$1(e,t,i){if(t._requestedFrame!==i.frameNumber&&(hasUnloadedContent$1(t)||t.contentExpired)&&isOnScreenLongEnough(e,t,i)){var r=i.camera.timeSinceMoved<e.foveatedTimeDelay;t.priorityDeferred&&r||(t._requestedFrame=i.frameNumber,e._requestedTiles.push(t))}}function updateVisibility(e,t,i){t._updatedVisibilityFrame!==e._updatedVisibilityFrame&&(t.updateVisibility(i),t._updatedVisibilityFrame=e._updatedVisibilityFrame)}function anyChildrenVisible(e,t,i){for(var r=!1,n=t.children,a=n.length,o=0;o<a;++o){var s=n[o];updateVisibility(e,s,i),r=r||isVisible$1(s)}return r}function meetsScreenSpaceErrorEarly(e,t,i){var r=t.parent;return!(!defined(r)||r.hasTilesetContent||r.refine!==Cesium3DTileRefine$1.ADD)&&t.getScreenSpaceError(i,!0)<=e._maximumScreenSpaceError}function updateTileVisibility(e,t,i){if(updateVisibility(e,t,i),isVisible$1(t)){var r=0<t.children.length;if(t.hasTilesetContent&&r){var n=t.children[0];return updateTileVisibility(e,n,i),void(t._visible=n._visible)}if(!meetsScreenSpaceErrorEarly(e,t,i)){var a=t.refine===Cesium3DTileRefine$1.REPLACE,o=t._optimChildrenWithinParent===Cesium3DTileOptimizationHint$1.USE_OPTIMIZATION;return a&&o&&r&&!anyChildrenVisible(e,t,i)?(++e._statistics.numberOfTilesCulledWithChildrenUnion,void(t._visible=!1)):void 0}t._visible=!1}}function updateTile(e,t,i){updateTileVisibility(e,t,i),t.updateExpiration(),t._wasMinPriorityChild=!1,updateMinimumMaximumPriority(e,t._priorityHolder=t),t._shouldSelect=!1,t._finalResolution=!0}function updateTileAncestorContentLinks(e,t){e._ancestorWithContent=void 0,e._ancestorWithContentAvailable=void 0;var i=e.parent;if(defined(i)){var r=!hasUnloadedContent$1(i)||i._requestedFrame===t.frameNumber;e._ancestorWithContent=r?i:i._ancestorWithContent,e._ancestorWithContentAvailable=i.contentAvailable?i:i._ancestorWithContentAvailable}}function hasEmptyContent$1(e){return e.hasEmptyContent||e.hasTilesetContent}function hasUnloadedContent$1(e){return!hasEmptyContent$1(e)&&e.contentUnloaded}function reachedSkippingThreshold(e,t){var i=t._ancestorWithContent;return!e.immediatelyLoadDesiredLevelOfDetail&&(t._priorityProgressiveResolutionScreenSpaceErrorLeaf||defined(i)&&t._screenSpaceError<i._screenSpaceError/e.skipScreenSpaceErrorFactor&&t._depth>i._depth+e.skipLevels)}function sortChildrenByDistanceToCamera(e,t){return 0===t._distanceToCamera&&0===e._distanceToCamera?t._centerZDepth-e._centerZDepth:t._distanceToCamera-e._distanceToCamera}function updateAndPushChildren$1(e,t,i,r){var n,a=t.refine===Cesium3DTileRefine$1.REPLACE,o=t.children,s=o.length;for(n=0;n<s;++n)updateTile(e,o[n],r);o.sort(sortChildrenByDistanceToCamera);var l,u=!skipLevelOfDetail(e)&&a&&!hasEmptyContent$1(t),c=!0,d=!1,h=-1,p=Number.MAX_VALUE;for(n=0;n<s;++n){var f;if(isVisible$1(l=o[n])?(i.push(l),l._foveatedFactor<p&&(h=n,p=l._foveatedFactor),d=!0):(u||e.loadSiblings)&&(l._foveatedFactor<p&&(h=n,p=l._foveatedFactor),loadTile$1(e,l,r),touchTile$1(e,l,r)),u)f=!!l._inRequestVolume&&(hasEmptyContent$1(l)?executeEmptyTraversal(e,l,r):l.contentAvailable),c=c&&f}if(d||(c=!1),-1!==h&&!skipLevelOfDetail(e)&&a){var m=o[h];m._wasMinPriorityChild=!0;var g=(t._wasMinPriorityChild||t===e.root)&&p<=t._priorityHolder._foveatedFactor?t._priorityHolder:t;for(g._foveatedFactor=Math.min(m._foveatedFactor,g._foveatedFactor),g._distanceToCamera=Math.min(m._distanceToCamera,g._distanceToCamera),n=0;n<s;++n)(l=o[n])._priorityHolder=g}return c}function inBaseTraversal(e,t,i){return!skipLevelOfDetail(e)||!e.immediatelyLoadDesiredLevelOfDetail&&(!defined(t._ancestorWithContent)||(0===t._screenSpaceError?t.parent._screenSpaceError>i:t._screenSpaceError>i))}function canTraverse$1(e,t){return 0!==t.children.length&&(t.hasTilesetContent?!t.contentExpired:t._screenSpaceError>e._maximumScreenSpaceError)}function executeTraversal(e,t,i,r,n){var a=traversal$1.stack;for(a.push(t);0<a.length;){traversal$1.stackMaximumLength=Math.max(traversal$1.stackMaximumLength,a.length);var o=a.pop();updateTileAncestorContentLinks(o,n);var s=inBaseTraversal(e,o,i),l=o.refine===Cesium3DTileRefine$1.ADD,u=o.refine===Cesium3DTileRefine$1.REPLACE,c=o.parent,d=!defined(c)||c._refines,h=!1;canTraverse$1(e,o)&&(h=updateAndPushChildren$1(e,o,a,n)&&d);var p=!h&&d;hasEmptyContent$1(o)?(addEmptyTile(e,o),loadTile$1(e,o,n),p&&selectDesiredTile$1(e,o,n)):l?(selectDesiredTile$1(e,o,n),loadTile$1(e,o,n)):u&&(s?(loadTile$1(e,o,n),p&&selectDesiredTile$1(e,o,n)):p?(selectDesiredTile$1(e,o,n),loadTile$1(e,o,n)):reachedSkippingThreshold(e,o)&&loadTile$1(e,o,n)),visitTile$1(e,o,n),touchTile$1(e,o,n),o._refines=h}}function executeEmptyTraversal(e,t,i){var r=!0,n=emptyTraversal.stack;for(n.push(t);0<n.length;){emptyTraversal.stackMaximumLength=Math.max(emptyTraversal.stackMaximumLength,n.length);var a=n.pop(),o=a.children,s=o.length,l=hasEmptyContent$1(a)&&canTraverse$1(e,a);if(l||a.contentAvailable||(r=!1),updateTile(e,a,i),isVisible$1(a)||(loadTile$1(e,a,i),touchTile$1(e,a,i)),l)for(var u=0;u<s;++u){var c=o[u];n.push(c)}}return r}function traverseAndSelect(e,t,i){var r,n=selectionTraversal.stack,a=selectionTraversal.ancestorStack;for(n.push(t);0<n.length||0<a.length;){if(selectionTraversal.stackMaximumLength=Math.max(selectionTraversal.stackMaximumLength,n.length),selectionTraversal.ancestorStackMaximumLength=Math.max(selectionTraversal.ancestorStackMaximumLength,a.length),0<a.length){var o=a.peek();if(o._stackLength===n.length){a.pop(),o!==r&&(o._finalResolution=!1),selectTile(e,o,i);continue}}var s=n.pop();if(defined(s)){var l=s.refine===Cesium3DTileRefine$1.ADD,u=s._shouldSelect,c=s.children,d=c.length,h=canTraverse$1(e,s);if(u)if(l)selectTile(e,s,i);else{if(s._selectionDepth=a.length,0<s._selectionDepth&&(e._hasMixedContent=!0),r=s,!h){selectTile(e,s,i);continue}a.push(s),s._stackLength=n.length}if(h)for(var p=0;p<d;++p){var f=c[p];isVisible$1(f)&&n.push(f)}}}}Cesium3DTilesetTraversal.selectTiles=function(e,t){if(e._requestedTiles.length=0,!e.debugFreezeFrame){e._selectedTiles.length=0,e._selectedTilesToStyle.length=0,e._emptyTiles.length=0,e._hasMixedContent=!1;var i=e.root;if(updateTile(e,i,t),isVisible$1(i)&&!(i.getScreenSpaceError(t,!0)<=e._maximumScreenSpaceError)){skipLevelOfDetail(e)?e.immediatelyLoadDesiredLevelOfDetail?executeSkipTraversal(e,i,t):executeBaseAndSkipTraversal(e,i,t):executeBaseTraversal(e,i,t),traversal$1.stack.trim(traversal$1.stackMaximumLength),emptyTraversal.stack.trim(emptyTraversal.stackMaximumLength),descendantTraversal.stack.trim(descendantTraversal.stackMaximumLength),selectionTraversal.stack.trim(selectionTraversal.stackMaximumLength),selectionTraversal.ancestorStack.trim(selectionTraversal.ancestorStackMaximumLength);for(var r=e._requestedTiles,n=r.length,a=0;a<n;++a)r[a].updatePriority()}}};var Cesium3DTilePass={RENDER:0,PICK:1,SHADOW:2,PRELOAD:3,PRELOAD_FLIGHT:4,REQUEST_RENDER_MODE_DEFER_CHECK:5,MOST_DETAILED_PRELOAD:6,MOST_DETAILED_PICK:7,NUMBER_OF_PASSES:8},passOptions=new Array(Cesium3DTilePass.NUMBER_OF_PASSES);passOptions[Cesium3DTilePass.RENDER]=Object.freeze({traversal:Cesium3DTilesetTraversal,isRender:!0,requestTiles:!0,ignoreCommands:!1}),passOptions[Cesium3DTilePass.PICK]=Object.freeze({traversal:Cesium3DTilesetTraversal,isRender:!1,requestTiles:!1,ignoreCommands:!1}),passOptions[Cesium3DTilePass.SHADOW]=Object.freeze({traversal:Cesium3DTilesetTraversal,isRender:!1,requestTiles:!0,ignoreCommands:!1}),passOptions[Cesium3DTilePass.PRELOAD]=Object.freeze({traversal:Cesium3DTilesetTraversal,isRender:!1,requestTiles:!0,ignoreCommands:!0}),passOptions[Cesium3DTilePass.PRELOAD_FLIGHT]=Object.freeze({traversal:Cesium3DTilesetTraversal,isRender:!1,requestTiles:!0,ignoreCommands:!0}),passOptions[Cesium3DTilePass.REQUEST_RENDER_MODE_DEFER_CHECK]=Object.freeze({traversal:Cesium3DTilesetTraversal,isRender:!1,requestTiles:!0,ignoreCommands:!0}),passOptions[Cesium3DTilePass.MOST_DETAILED_PRELOAD]=Object.freeze({traversal:Cesium3DTilesetMostDetailedTraversal,isRender:!1,requestTiles:!0,ignoreCommands:!0}),passOptions[Cesium3DTilePass.MOST_DETAILED_PICK]=Object.freeze({traversal:Cesium3DTilesetMostDetailedTraversal,isRender:!1,requestTiles:!1,ignoreCommands:!1}),Cesium3DTilePass.getPassOptions=function(e){return passOptions[e]};var Cesium3DTilePass$1=Object.freeze(Cesium3DTilePass);function Empty3DTileContent(e,t){this._tileset=e,this._tile=t,this.featurePropertiesDirty=!1}Object.defineProperties(Empty3DTileContent.prototype,{featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){}},readyPromise:{get:function(){}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){}},batchTable:{get:function(){}}}),Empty3DTileContent.prototype.hasProperty=function(e,t){return!1},Empty3DTileContent.prototype.getFeature=function(e){},Empty3DTileContent.prototype.applyDebugSettings=function(e,t){},Empty3DTileContent.prototype.applyStyle=function(e){},Empty3DTileContent.prototype.update=function(e,t){},Empty3DTileContent.prototype.isDestroyed=function(){return!1},Empty3DTileContent.prototype.destroy=function(){return destroyObject(this)};var Module=(KKu="undefined"==typeof document?new(require("url").URL)("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("Geoworld.js",document.baseURI).href,function(a){var i,o;(a=a=a||{}).ready=new Promise(function(e,t){i=e,o=t});var e,t={};for(e in a)a.hasOwnProperty(e)&&(t[e]=a[e]);var r,s,n,l,u,c="object"==typeof window,d="function"==typeof importScripts,h="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,p="";h?(p=d?require("path").dirname(p)+"/":__dirname+"/",r=function(e,t){return l=l||require("fs"),e=(u=u||require("path")).normalize(e),l.readFileSync(e,t?null:"utf8")},n=function(e){var t=r(e,!0);return t.buffer||(t=new Uint8Array(t)),function(e,t){e||P("Assertion failed: "+t)}(t.buffer),t},s=function(e,i,r){l=l||require("fs"),e=(u=u||require("path")).normalize(e),l.readFile(e,function(e,t){e?r(e):i(t.buffer)})},1<process.argv.length&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),process.on("uncaughtException",function(e){if(!(e instanceof z))throw e}),process.on("unhandledRejection",function(e){throw e}),a.inspect=function(){return"[Emscripten Module object]"}):(c||d)&&(d?p=self.location.href:"undefined"!=typeof document&&document.currentScript&&(p=document.currentScript.src),KKu&&(p=KKu),p=0!==p.indexOf("blob:")?p.substr(0,p.replace(/[?#].*/,"").lastIndexOf("/")+1):"",r=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},d&&(n=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),s=function(e,t,i){var r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="arraybuffer",r.onload=function(){200==r.status||0==r.status&&r.response?t(r.response):i()},r.onerror=i,r.send(null)});var f,m=a.print||console.log.bind(console),g=a.printErr||console.warn.bind(console);for(e in t)t.hasOwnProperty(e)&&(a[e]=t[e]);t=null,a.arguments&&a.arguments,a.thisProgram&&a.thisProgram,a.quit&&a.quit,a.wasmBinary&&(f=a.wasmBinary);a.noExitRuntime;"object"!=typeof WebAssembly&&P("no native wasm support detected");var y,v,_=!1,C="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function x(e,t,i){for(var r=t+i,n=t;e[n]&&!(r<=n);)++n;if(16<n-t&&e.subarray&&C)return C.decode(e.subarray(t,n));for(var a="";t<n;){var o=e[t++];if(128&o){var s=63&e[t++];if(192!=(224&o)){var l=63&e[t++];if((o=224==(240&o)?(15&o)<<12|s<<6|l:(7&o)<<18|s<<12|l<<6|63&e[t++])<65536)a+=String.fromCharCode(o);else{var u=o-65536;a+=String.fromCharCode(55296|u>>10,56320|1023&u)}}else a+=String.fromCharCode((31&o)<<6|s)}else a+=String.fromCharCode(o)}return a}a.INITIAL_MEMORY;var b,A=[],S=[],w=[],E=0,T=null;function P(e){a.onAbort&&a.onAbort(e),g(e="Aborted("+e+")"),_=!0,e+=". Build with -s ASSERTIONS=1 for more info.";var t=new WebAssembly.RuntimeError(e);throw o(t),t}a.preloadedImages={},a.preloadedAudios={};var M,D,I="data:application/octet-stream;base64,";function O(e){return e.startsWith(I)}function R(e){return e.startsWith("file://")}function L(e){try{if(e==M&&f)return new Uint8Array(f);if(n)return n(e);throw"both async and sync fetching of the wasm failed"}catch(e){P(e)}}function N(e){for(;0<e.length;){var t=e.shift();if("function"!=typeof t){var i=t.func;"number"==typeof i?void 0===t.arg?k(i)():k(i)(t.arg):i(void 0===t.arg?null:t.arg)}else t(a)}}function k(e){return b.get(e)}a.locateFile?O(M="ComputeRegionBox.wasm")||(D=M,M=a.locateFile?a.locateFile(D,p):p+D):M=new URL("data:application/wasm;base64,AGFzbQEAAAABqgEZYAF/AX9gA39/fwF/YAN/f38AYAR/f39/AX9gAn9/AGACfHwBfGACf38Bf2ABfwBgA398fwF/YAJ/fwF8YAF8AXxgBHx8fHwBf2AFf39/f38AYAR/fHx8AX9gA3x8fwF8YAV8fHx/fwBgBHx8fH8AYAJ8fwF8YAF/AXxgBn98f39/fwF/YAR/f39/AGAAAGACfH8Bf2ALf39/f3x8fHx8fH8AYAN/fn8BfgINAgFhAWEAAwFhAWIAAAM8OwAECAkCCwwAAg0ADgUGDwIAEAIBEQUKChIJBwMBAQAUAgEVAAcGAgAABgAFFgABAQEIFwICBBgAAQMHBAUBcAEEBAUGAQGAAoACBgkBfwFBkLXAAgsHGQYBYwIAAWQAJAFlADwBZgAwAWcAOwFoAQAJCQEAQQELAzk6OAqytAE7GQAgAEIANwMAIABCADcDECAAQgA3AwggAAsgACABIAArAwA5AwAgASAAKwMIOQMIIAEgACsDEDkDEAsrACACIAArAwAgAaI5AwAgAiAAKwMIIAGiOQMIIAIgACsDECABojkDECACCyUAIAArAwAgASsDAKIgACsDCCABKwMIoqAgACsDECABKwMQoqALiwECA38CfCMAQTBrIgUkACAFQRhqEAIhAyAFEAIhBCABKwMAIQcgAyABKwMIIgYQGDkDECADIAYQGSIGIAcQGKI5AwggAyAGIAcQGaI5AwAgAyADEA8aIABBGGogAyAEECMaIAQgAyAEEAWfIAQQMxogAyABKwMQIAMQBBogBCADIAIQFCAFQTBqJAALJwEBf0EBIQQgAyAAIAGhmSIDZgR/QQEFIAMgAJkgAZkQLSAComULC20BAX8jAEGAAmsiBSQAIARBgMAEcSACIANMckUEQCAFIAFB/wFxIAIgA2siAkGAAiACQYACSSIBGxAVGiABRQRAA0AgACAFQYACEAogAkGAAmsiAkH/AUsNAAsLIAAgBSACEAoLIAVBgAJqJAALTwECf0GgJSgCACIBIABBA2pBfHEiAmohAAJAIAJBACAAIAFNGw0AIAA/AEEQdEsEQCAAEAFFDQELQaAlIAA2AgAgAQ8LQeAmQTA2AgBBfwsXACAALQAAQSBxRQRAIAEgAiAAEB4aCwsZACAAIAM5AxAgACACOQMIIAAgATkDACAACwoAIABBMGtBCkkLmQEBA3wgACAAoiIDIAMgA6KiIANEfNXPWjrZ5T2iROucK4rm5Vq+oKIgAyADRH3+sVfjHcc+okTVYcEZoAEqv6CiRKb4EBEREYE/oKAhBSADIACiIQQgAkUEQCAEIAMgBaJESVVVVVVVxb+goiAAoA8LIAAgAyABRAAAAAAAAOA/oiAEIAWioaIgAaEgBERJVVVVVVXFP6KgoQuSAQEDfEQAAAAAAADwPyAAIACiIgJEAAAAAAAA4D+iIgOhIgREAAAAAAAA8D8gBKEgA6EgAiACIAIgAkSQFcsZoAH6PqJEd1HBFmzBVr+gokRMVVVVVVWlP6CiIAIgAqIiAyADoiACIAJE1DiIvun6qL2iRMSxtL2e7iE+oKJErVKcgE9+kr6goqCiIAAgAaKhoKALMwEBfCAAEBohAiABIAArAwAgAqM5AwAgASAAKwMIIAKjOQMIIAEgACsDECACozkDECABC/kBAgN/AXwjAEHQAGsiBSQAIAUgAykDKDcDSCAFQUBrIAMpAyA3AwAgBSADKQMYNwM4IAEQGCEIIAVBIGoQAiIDIAg5AxAgAyABEBkiASAAEBiiOQMIIAMgASAAEBmiOQMAIAUgAyADEA8iBikDEDcDMCAFIAYpAwg3AyggBSAGKQMANwMgIAVBOGogAyAFQQhqEAIiBhAjGiAFIAYgAyAGEAWfIAYQMyIHKQMQNwMYIAUgBykDCDcDECAFIAcpAwA3AwggBSADIAIgAxAEIgcpAxA3AzAgBSAHKQMINwMoIAUgBykDADcDICAGIAMgBBAUIAVB0ABqJAAL5QECBH8BfCMAQeAAayIDJAAgA0EwaiIEEAIaIARBGGoQAhogA0FAayABKQMQNwMAIAMgASkDCDcDOCADIAEpAwA3AzAgAEHgAWoiBiAEQRhqIgEQAyAEIAYgA0EYahACIgUQMkUEQCABIAErAwCaOQMAIAEgASsDCJo5AwggASABKwMQmjkDECAEIAYgBRAyGgsgAyAFIABBmAFqIAUQMSIBKQMQNwMQIAMgASkDCDcDCCADIAEpAwA3AwAgAEGwAWogAxAFIQcgAiAAQcgBaiADEAU5AwggAiAHOQMAIANB4ABqJAALEgAgAEIANwMAIABCADcDCCAACxcAIAMgAjkDECADIAE5AwggAyAAOQMACzIAIAIgACsDACABKwMAoDkDACACIAArAwggASsDCKA5AwggAiAAKwMQIAErAxCgOQMQCykBAX8gAgRAIAAhAwNAIAMgAToAACADQQFqIQMgAkEBayICDQALCyAAC6gBAAJAIAFBgAhOBEAgAEQAAAAAAADgf6IhACABQf8PSARAIAFB/wdrIQEMAgsgAEQAAAAAAADgf6IhACABQf0XIAFB/RdIG0H+D2shAQwBCyABQYF4Sg0AIABEAAAAAAAAEACiIQAgAUGDcEoEQCABQf4HaiEBDAELIABEAAAAAAAAEACiIQAgAUGGaCABQYZoShtB/A9qIQELIAAgAUH/B2qtQjSGv6ILQwAgACAAIAGkIAG9Qv///////////wCDQoCAgICAgID4/wBWGyABIAC9Qv///////////wCDQoCAgICAgID4/wBYGwvFAQECfyMAQRBrIgEkAAJAIAC9QiCIp0H/////B3EiAkH7w6T/A00EQCACQYCAwPIDSQ0BIABEAAAAAAAAAABBABANIQAMAQsgAkGAgMD/B08EQCAAIAChIQAMAQsCQAJAAkACQCAAIAEQLkEDcQ4DAAECAwsgASsDACABKwMIQQEQDSEADAMLIAErAwAgASsDCBAOIQAMAgsgASsDACABKwMIQQEQDZohAAwBCyABKwMAIAErAwgQDpohAAsgAUEQaiQAIAALwQEBAn8jAEEQayIBJAACfCAAvUIgiKdB/////wdxIgJB+8Ok/wNNBEBEAAAAAAAA8D8gAkGewZryA0kNARogAEQAAAAAAAAAABAODAELIAAgAKEgAkGAgMD/B08NABoCQAJAAkACQCAAIAEQLkEDcQ4DAAECAwsgASsDACABKwMIEA4MAwsgASsDACABKwMIQQEQDZoMAgsgASsDACABKwMIEA6aDAELIAErAwAgASsDCEEBEA0LIQAgAUEQaiQAIAALJQEBfCAAKwMAIgEgAaIgACsDCCIBIAGioCAAKwMQIgEgAaKgnwsOACAAIAEQBSAAKwMYoAv1AgEFf0GAISgCACIBKAJMGgJAQX9BAAJ/An8CQCAAIgUiA0EDcQRAA0AgAy0AAEUNAiADQQFqIgNBA3ENAAsLA0AgAyICQQRqIQMgAigCACIEQX9zIARBgYKECGtxQYCBgoR4cUUNAAsgAiAAayAEQf8BcUUNARoDQCACLQABIQQgAkEBaiIDIQIgBA0ACwsgAyAAawsiAiIDIAMCfyABKAJMQX9MBEAgBSADIAEQHgwBCyAFIAMgARAeCyIARg0AGiAACyACRxtBAEgNAAJAIAEtAEtBCkYNACABKAIUIgAgASgCEE8NACABIABBAWo2AhQgAEEKOgAADAELIwBBEGsiAiQAIAJBCjoADwJAAkAgASgCECIABH8gAAUgARAqDQIgASgCEAsgASgCFCIATQ0AIAEsAEtBCkYNACABIABBAWo2AhQgAEEKOgAADAELIAEgAkEPakEBIAEoAiQRAQBBAUcNACACLQAPGgsgAkEQaiQACwuUFAIQfwJ+IwBB0ABrIgUkACAFQYoINgJMIAVBN2ohEyAFQThqIRECQANAAkAgDkEASA0AQf////8HIA5rIARIBEBB4CZBPTYCAEF/IQ4MAQsgBCAOaiEOCyAFKAJMIgshBAJAAkACQCALLQAAIgYEQANAAkACQCAGQf8BcSIGRQRAIAQhBgwBCyAGQSVHDQEgBCEGA0AgBC0AAUElRw0BIAUgBEECaiIHNgJMIAZBAWohBiAELQACIQggByEEIAhBJUYNAAsLIAYgC2shBCAABEAgACALIAQQCgsgBA0GQX8hEEEBIQYgBSgCTCwAARAMIQQgBSgCTCEHAkAgBEUNACAHLQACQSRHDQAgBywAAUEwayEQQQEhEkEDIQYLIAUgBiAHaiIENgJMQQAhDwJAIAQsAAAiCUEgayIHQR9LBEAgBCEGDAELIAQhBkEBIAd0IghBidEEcUUNAANAIAUgBEEBaiIGNgJMIAggD3IhDyAELAABIglBIGsiB0EgTw0BIAYhBEEBIAd0IghBidEEcQ0ACwsCQCAJQSpGBEAgBQJ/AkAgBiwAARAMRQ0AIAUoAkwiBC0AAkEkRw0AIAQsAAFBAnQgA2pBwAFrQQo2AgAgBCwAAUEDdCACakGAA2soAgAhDEEBIRIgBEEDagwBCyASDQZBACESQQAhDCAABEAgASABKAIAIgRBBGo2AgAgBCgCACEMCyAFKAJMQQFqCyIENgJMIAxBf0oNAUEAIAxrIQwgD0GAwAByIQ8MAQsgBUHMAGoQKSIMQQBIDQQgBSgCTCEEC0F/IQoCQCAELQAAQS5HDQAgBC0AAUEqRgRAAkAgBCwAAhAMRQ0AIAUoAkwiBC0AA0EkRw0AIAQsAAJBAnQgA2pBwAFrQQo2AgAgBCwAAkEDdCACakGAA2soAgAhCiAFIARBBGoiBDYCTAwCCyASDQUgAAR/IAEgASgCACIEQQRqNgIAIAQoAgAFQQALIQogBSAFKAJMQQJqIgQ2AkwMAQsgBSAEQQFqNgJMIAVBzABqECkhCiAFKAJMIQQLQQAhBgNAIAYhCEF/IQ0gBCwAAEHBAGtBOUsNCCAFIARBAWoiCTYCTCAELAAAIQYgCSEEIAYgCEE6bGpBzyBqLQAAIgZBAWtBCEkNAAsCQAJAIAZBE0cEQCAGRQ0KIBBBAE4EQCADIBBBAnRqIAY2AgAgBSACIBBBA3RqKQMANwNADAILIABFDQggBUFAayAGIAEQKCAFKAJMIQkMAgsgEEF/Sg0JC0EAIQQgAEUNBwsgD0H//3txIgcgDyAPQYDAAHEbIQZBACENQYAIIRAgESEPAkACQAJAAn8CQAJAAkACQAJ/AkACQAJAAkACQAJAAkAgCUEBaywAACIEQV9xIAQgBEEPcUEDRhsgBCAIGyIEQdgAaw4hBBQUFBQUFBQUDhQPBg4ODhQGFBQUFAIFAxQUCRQBFBQEAAsCQCAEQcEAaw4HDhQLFA4ODgALIARB0wBGDQkMEwsgBSkDQCEUQYAIDAULQQAhBAJAAkACQAJAAkACQAJAIAhB/wFxDggAAQIDBBoFBhoLIAUoAkAgDjYCAAwZCyAFKAJAIA42AgAMGAsgBSgCQCAOrDcDAAwXCyAFKAJAIA47AQAMFgsgBSgCQCAOOgAADBULIAUoAkAgDjYCAAwUCyAFKAJAIA6sNwMADBMLIApBCCAKQQhLGyEKIAZBCHIhBkH4ACEECyARIQcgBEEgcSEIIAUpA0AiFFBFBEADQCAHQQFrIgcgFKdBD3FB4CRqLQAAIAhyOgAAIBRCD1YhCyAUQgSIIRQgCw0ACwsgByELIAZBCHFFIAUpA0BQcg0DIARBBHZBgAhqIRBBAiENDAMLIBEhBCAFKQNAIhRQRQRAA0AgBEEBayIEIBSnQQdxQTByOgAAIBRCB1YhByAUQgOIIRQgBw0ACwsgBCELIAZBCHFFDQIgCiARIAtrIgRBAWogBCAKSBshCgwCCyAFKQNAIhRCf1cEQCAFQgAgFH0iFDcDQEEBIQ1BgAgMAQsgBkGAEHEEQEEBIQ1BgQgMAQtBgghBgAggBkEBcSINGwshECARIQsCQCAUQoCAgIAQVARAIBQhFQwBCwNAIAtBAWsiCyAUIBRCCoAiFUIKfn2nQTByOgAAIBRC/////58BViEEIBUhFCAEDQALCyAVpyIHBEADQCALQQFrIgsgByAHQQpuIgRBCmxrQTByOgAAIAdBCUshCCAEIQcgCA0ACwsLIAZB//97cSAGIApBf0obIQYgBSkDQCIUQgBSIApyRQRAQQAhCiARIQsMDAsgCiAUUCARIAtraiIEIAQgCkgbIQoMCwsCfyAKIgRBAEchCAJAAkACQCAFKAJAIgZBvQggBhsiCyIJQQNxRSAERXINAANAIAktAABFDQIgBEEBayIEQQBHIQggCUEBaiIJQQNxRQ0BIAQNAAsLIAhFDQELAkAgCS0AAEUgBEEESXINAANAIAkoAgAiBkF/cyAGQYGChAhrcUGAgYKEeHENASAJQQRqIQkgBEEEayIEQQNLDQALCyAERQ0AA0AgCSAJLQAARQ0CGiAJQQFqIQkgBEEBayIEDQALC0EACyIEIAogC2ogBBshDyAHIQYgBCALayAKIAQbIQoMCgsgCgRAIAUoAkAMAgtBACEEIABBICAMQQAgBhAIDAILIAVBADYCDCAFIAUpA0A+AgggBSAFQQhqIgQ2AkBBfyEKIAQLIQhBACEEAkADQCAIKAIAIgdFDQEgBUEEaiAHECsiC0EASCIHIAsgCiAEa0tyRQRAIAhBBGohCCAKIAQgC2oiBEsNAQwCCwtBfyENIAcNCwsgAEEgIAwgBCAGEAggBEUEQEEAIQQMAQtBACEIIAUoAkAhCQNAIAkoAgAiB0UNASAFQQRqIAcQKyIHIAhqIgggBEoNASAAIAVBBGogBxAKIAlBBGohCSAEIAhLDQALCyAAQSAgDCAEIAZBgMAAcxAIIAwgBCAEIAxIGyEEDAgLIAAgBSsDQCAMIAogBiAEQQAREwAhBAwHCyAFIAUpA0A8ADdBASEKIBMhCyAHIQYMBAsgBSAEQQFqIgc2AkwgBC0AASEGIAchBAwACwALIA4hDSAADQQgEkUNAkEBIQQDQCADIARBAnRqKAIAIgAEQCACIARBA3RqIAAgARAoQQEhDSAEQQFqIgRBCkcNAQwGCwtBASENIARBCk8NBANAIAMgBEECdGooAgANASAEQQFqIgRBCkcNAAsMBAtBfyENDAMLIABBICANIA8gC2siCCAKIAggCkobIgdqIgkgDCAJIAxKGyIEIAkgBhAIIAAgECANEAogAEEwIAQgCSAGQYCABHMQCCAAQTAgByAIQQAQCCAAIAsgCBAKIABBICAEIAkgBkGAwABzEAgMAQsLQQAhDQsgBUHQAGokACANC8ABAQN/AkAgASACKAIQIgMEfyADBSACECoNASACKAIQCyACKAIUIgVrSwRAIAIgACABIAIoAiQRAQAPCwJAIAIsAEtBAEgEQEEAIQMMAQsgASEEA0AgBCIDRQRAQQAhAwwCCyAAIANBAWsiBGotAABBCkcNAAsgAiAAIAMgAigCJBEBACIEIANJDQEgACADaiEAIAEgA2shASACKAIUIQULIAUgACABEB8aIAIgAigCFCABajYCFCABIANqIQQLIAQLMwEBfyACBEAgACEDA0AgAyABLQAAOgAAIANBAWohAyABQQFqIQEgAkEBayICDQALCyAACxEAQX9BASAAQQFIG0EAIAAbCzMAIAMgACADECdByAAQHyABQRhsaiIAIAIrAwA5AwAgACACKwMIOQMIIAAgAisDEDkDEAtAAQN8IAAgAUEFdGoiACsDACEDIAArAwghBCAAKwMQIQUgAiAAKwMYOQMYIAIgBTkDECACIAQ5AwggAiADOQMACzQAIAIgACsDACABKwMAojkDACACIAArAwggASsDCKI5AwggAiAAKwMQIAErAxCiOQMQIAILEwBB0DRBkDM2AgBBzDNBKjYCAAsQACAAEAIaIABCADcDGCAAC+8CAQd/IwBBMGsiAyQAIAMgADYCACMAQRBrIgQkACAEIAM2AgxBgCEoAgAhACMAQdABayIBJAAgASADNgLMASABQaABaiICQQBBKBAVGiABIAEoAswBNgLIAQJAQQAgAUHIAWogAUHQAGogAhAdQQBIDQAgACgCTEEATiEFIAAoAgAhAiAALABKQQBMBEAgACACQV9xNgIACyACQSBxIQYCfyAAKAIwBEAgACABQcgBaiABQdAAaiABQaABahAdDAELIABB0AA2AjAgACABQdAAaiIHNgIQIAAgATYCHCAAIAE2AhQgACgCLCECIAAgATYCLCAAIAFByAFqIAcgAUGgAWoQHSACRQ0AGiAAQQBBACAAKAIkEQEAGiAAQQA2AjAgACACNgIsIABBADYCHCAAQQA2AhAgACgCFBogAEEANgIUQQALGiAAIAAoAgAgBnI2AgAgBUUNAAsgAUHQAWokACAEQRBqJAAgA0EwaiQAC14AIAEgACsDADkDACABIAArAwg5AwggASAAKwMQOQMQIAEgACsDGDkDGCABIAArAyA5AyAgASAAKwMoOQMoIAEgACsDMDkDMCABIAArAzg5AzggASAAKwNAOQNAIAELuwIAAkAgAUEUSw0AAkACQAJAAkACQAJAAkACQAJAAkAgAUEJaw4KAAECAwQFBgcICQoLIAIgAigCACIBQQRqNgIAIAAgASgCADYCAA8LIAIgAigCACIBQQRqNgIAIAAgATQCADcDAA8LIAIgAigCACIBQQRqNgIAIAAgATUCADcDAA8LIAIgAigCAEEHakF4cSIBQQhqNgIAIAAgASkDADcDAA8LIAIgAigCACIBQQRqNgIAIAAgATIBADcDAA8LIAIgAigCACIBQQRqNgIAIAAgATMBADcDAA8LIAIgAigCACIBQQRqNgIAIAAgATAAADcDAA8LIAIgAigCACIBQQRqNgIAIAAgATEAADcDAA8LIAIgAigCAEEHakF4cSIBQQhqNgIAIAAgASsDADkDAA8LIAAgAkEAEQQACwtCAQN/IAAoAgAsAAAQDARAA0AgACgCACICLAAAIQMgACACQQFqNgIAIAMgAUEKbGpBMGshASACLAABEAwNAAsLIAELWQEBfyAAIAAtAEoiAUEBayABcjoASiAAKAIAIgFBCHEEQCAAIAFBIHI2AgBBfw8LIABCADcCBCAAIAAoAiwiATYCHCAAIAE2AhQgACABIAAoAjBqNgIQQQALlwIAIABFBEBBAA8LAn8CQCAABH8gAUH/AE0NAQJAQdA0KAIAKAIARQRAIAFBgH9xQYC/A0YNAwwBCyABQf8PTQRAIAAgAUE/cUGAAXI6AAEgACABQQZ2QcABcjoAAEECDAQLIAFBgEBxQYDAA0cgAUGAsANPcUUEQCAAIAFBP3FBgAFyOgACIAAgAUEMdkHgAXI6AAAgACABQQZ2QT9xQYABcjoAAUEDDAQLIAFBgIAEa0H//z9NBEAgACABQT9xQYABcjoAAyAAIAFBEnZB8AFyOgAAIAAgAUEGdkE/cUGAAXI6AAIgACABQQx2QT9xQYABcjoAAUEEDAQLC0HgJkEZNgIAQX8FQQELDAELIAAgAToAAEEBCwsVACAARQRAQQAPC0HgJiAANgIAQX8LQwAgACAAIAGlIAG9Qv///////////wCDQoCAgICAgID4/wBWGyABIAC9Qv///////////wCDQoCAgICAgID4/wBYGwuvFwMUfwR8AX4jAEEwayIJJAACQAJAAkAgAL0iGkIgiKciA0H/////B3EiBEH61L2ABE0EQCADQf//P3FB+8MkRg0BIARB/LKLgARNBEAgGkIAWQRAIAEgAEQAAEBU+yH5v6AiAEQxY2IaYbTQvaAiFjkDACABIAAgFqFEMWNiGmG00L2gOQMIQQEhAwwFCyABIABEAABAVPsh+T+gIgBEMWNiGmG00D2gIhY5AwAgASAAIBahRDFjYhphtNA9oDkDCEF/IQMMBAsgGkIAWQRAIAEgAEQAAEBU+yEJwKAiAEQxY2IaYbTgvaAiFjkDACABIAAgFqFEMWNiGmG04L2gOQMIQQIhAwwECyABIABEAABAVPshCUCgIgBEMWNiGmG04D2gIhY5AwAgASAAIBahRDFjYhphtOA9oDkDCEF+IQMMAwsgBEG7jPGABE0EQCAEQbz714AETQRAIARB/LLLgARGDQIgGkIAWQRAIAEgAEQAADB/fNkSwKAiAETKlJOnkQ7pvaAiFjkDACABIAAgFqFEypSTp5EO6b2gOQMIQQMhAwwFCyABIABEAAAwf3zZEkCgIgBEypSTp5EO6T2gIhY5AwAgASAAIBahRMqUk6eRDuk9oDkDCEF9IQMMBAsgBEH7w+SABEYNASAaQgBZBEAgASAARAAAQFT7IRnAoCIARDFjYhphtPC9oCIWOQMAIAEgACAWoUQxY2IaYbTwvaA5AwhBBCEDDAQLIAEgAEQAAEBU+yEZQKAiAEQxY2IaYbTwPaAiFjkDACABIAAgFqFEMWNiGmG08D2gOQMIQXwhAwwDCyAEQfrD5IkESw0BCyABIAAgAESDyMltMF/kP6JEAAAAAAAAOEOgRAAAAAAAADjDoCIXRAAAQFT7Ifm/oqAiFiAXRDFjYhphtNA9oiIZoSIAOQMAIARBFHYiAiAAvUI0iKdB/w9xa0ERSCEEAn8gF5lEAAAAAAAA4EFjBEAgF6oMAQtBgICAgHgLIQMCQCAEDQAgASAWIBdEAABgGmG00D2iIgChIhggF0RzcAMuihmjO6IgFiAYoSAAoaEiGaEiADkDACACIAC9QjSIp0H/D3FrQTJIBEAgGCEWDAELIAEgGCAXRAAAAC6KGaM7oiIAoSIWIBdEwUkgJZqDezmiIBggFqEgAKGhIhmhIgA5AwALIAEgFiAAoSAZoTkDCAwBCyAEQYCAwP8HTwRAIAEgACAAoSIAOQMAIAEgADkDCEEAIQMMAQsgGkL/////////B4NCgICAgICAgLDBAIS/IQBBACEDQQEhAgNAIAlBEGogA0EDdGoCfyAAmUQAAAAAAADgQWMEQCAAqgwBC0GAgICAeAu3IhY5AwAgACAWoUQAAAAAAABwQaIhAEEBIQMgAkEBcSEHQQAhAiAHDQALIAkgADkDIAJAIABEAAAAAAAAAABiBEBBAiEDDAELQQEhAgNAIAIiA0EBayECIAlBEGogA0EDdGorAwBEAAAAAAAAAABhDQALCyMAQbAEayIFJAAgBEEUdkGWCGsiAkEDa0EYbSIEQQAgBEEAShsiDkFobCACaiEEQeQKKAIAIgogA0EBaiIMQQFrIghqQQBOBEAgCiAMaiEDIA4gCGshAgNAIAVBwAJqIAZBA3RqIAJBAEgEfEQAAAAAAAAAAAUgAkECdEHwCmooAgC3CzkDACACQQFqIQIgBkEBaiIGIANHDQALCyAJQRBqIQ8gBEEYayEHIApBACAKQQBKGyEGQQAhAwNARAAAAAAAAAAAIQAgDEEASgRAIAMgCGohC0EAIQIDQCAAIA8gAkEDdGorAwAgBUHAAmogCyACa0EDdGorAwCioCEAIAJBAWoiAiAMRw0ACwsgBSADQQN0aiAAOQMAIAMgBkYhAiADQQFqIQMgAkUNAAtBLyAEayESQTAgBGshECAEQRlrIRMgCiEDAkADQCAFIANBA3RqKwMAIQBBACECIAMhBiADQQFIIg1FBEADQCAFQeADaiACQQJ0agJ/IAACfyAARAAAAAAAAHA+oiIAmUQAAAAAAADgQWMEQCAAqgwBC0GAgICAeAu3IgBEAAAAAAAAcMGioCIWmUQAAAAAAADgQWMEQCAWqgwBC0GAgICAeAs2AgAgBSAGQQFrIgZBA3RqKwMAIACgIQAgAkEBaiICIANHDQALCwJ/IAAgBxAWIgAgAEQAAAAAAADAP6KcRAAAAAAAACDAoqAiAJlEAAAAAAAA4EFjBEAgAKoMAQtBgICAgHgLIQggACAIt6EhAAJAAkACQAJ/IAdBAUgiFEUEQCADQQJ0IAVqIgIgAigC3AMiAiACIBB1IgIgEHRrIgY2AtwDIAIgCGohCCAGIBJ1DAELIAcNASADQQJ0IAVqKALcA0EXdQsiC0EBSA0CDAELQQIhCyAARAAAAAAAAOA/Zg0AQQAhCwwBC0EAIQJBACEGIA1FBEADQCAFQeADaiACQQJ0aiIVKAIAIQ1B////ByERAn8CQCAGDQBBgICACCERIA0NAEEADAELIBUgESANazYCAEEBCyEGIAJBAWoiAiADRw0ACwsCQCAUDQBB////AyECAkACQCATDgIBAAILQf///wEhAgsgA0ECdCAFaiINIA0oAtwDIAJxNgLcAwsgCEEBaiEIIAtBAkcNAEQAAAAAAADwPyAAoSEAQQIhCyAGRQ0AIABEAAAAAAAA8D8gBxAWoSEACyAARAAAAAAAAAAAYQRAQQAhBgJAIAMiAiAKTA0AA0AgBUHgA2ogAkEBayICQQJ0aigCACAGciEGIAIgCkoNAAsgBkUNACAHIQQDQCAEQRhrIQQgBUHgA2ogA0EBayIDQQJ0aigCAEUNAAsMAwtBASECA0AgAiIGQQFqIQIgBUHgA2ogCiAGa0ECdGooAgBFDQALIAMgBmohBgNAIAVBwAJqIAMgDGoiCEEDdGogA0EBaiIDIA5qQQJ0QfAKaigCALc5AwBBACECRAAAAAAAAAAAIQAgDEEBTgRAA0AgACAPIAJBA3RqKwMAIAVBwAJqIAggAmtBA3RqKwMAoqAhACACQQFqIgIgDEcNAAsLIAUgA0EDdGogADkDACADIAZIDQALIAYhAwwBCwsCQCAAQRggBGsQFiIARAAAAAAAAHBBZgRAIAVB4ANqIANBAnRqAn8gAAJ/IABEAAAAAAAAcD6iIgCZRAAAAAAAAOBBYwRAIACqDAELQYCAgIB4CyICt0QAAAAAAABwwaKgIgCZRAAAAAAAAOBBYwRAIACqDAELQYCAgIB4CzYCACADQQFqIQMMAQsCfyAAmUQAAAAAAADgQWMEQCAAqgwBC0GAgICAeAshAiAHIQQLIAVB4ANqIANBAnRqIAI2AgALRAAAAAAAAPA/IAQQFiEAAkAgA0F/TA0AIAMhAgNAIAUgAkEDdGogACAFQeADaiACQQJ0aigCALeiOQMAIABEAAAAAAAAcD6iIQAgAkEASiEEIAJBAWshAiAEDQALIANBf0wNACADIQIDQCADIAIiBGshB0QAAAAAAAAAACEAQQAhAgNAAkAgACACQQN0QcAgaisDACAFIAIgBGpBA3RqKwMAoqAhACACIApODQAgAiAHSSEGIAJBAWohAiAGDQELCyAFQaABaiAHQQN0aiAAOQMAIARBAWshAiAEQQBKDQALC0QAAAAAAAAAACEAIANBAE4EQCADIQIDQCAAIAVBoAFqIAJBA3RqKwMAoCEAIAJBAEohBCACQQFrIQIgBA0ACwsgCSAAmiAAIAsbOQMAIAUrA6ABIAChIQBBASECIANBAU4EQANAIAAgBUGgAWogAkEDdGorAwCgIQAgAiADRyEEIAJBAWohAiAEDQALCyAJIACaIAAgCxs5AwggBUGwBGokACAIQQdxIQMgCSsDACEAIBpCf1cEQCABIACaOQMAIAEgCSsDCJo5AwhBACADayEDDAELIAEgADkDACABIAkrAwg5AwgLIAlBMGokACADC9ABAQF/QQEhAQJAAn8CQCAAKwMAQcAmKwMAoZlEAAAAoPfGsD5jRQ0AIAArAwhByCYrAwChmUQAAACg98awPmNFDQBBASAAKwMQQdAmKwMAoZlEAAAAoPfGsD5jDQEaC0EACw0AQQAhASAAKwMAQcAmKwMARAAAAICbhAY9RAAAAICbhAY9EAdFDQAgACsDCEHIJisDAEQAAACAm4QGPUQAAACAm4QGPRAHRQ0AIAArAxBB0CYrAwBEAAAAgJuEBj1EAAAAgJuEBj0QByEBCyABC70tAQt/QdgmKAIAIgxFIAJBAUdyRQRAIAwPCyAAQQFIIAFBAUhyRQRAIwBBEGsiDSQAAkACQAJAAkACQAJAAkACQAJAAkACQCAAQQR0IgBB9AFNBEBB5CYoAgAiB0EQIABBC2pBeHEgAEELSRsiCEEDdiIDdiIBQQNxBEAgAUF/c0EBcSADaiIEQQN0IgFBlCdqKAIAIgVBCGohAAJAIAUoAggiAyABQYwnaiIBRgRAQeQmIAdBfiAEd3E2AgAMAQsgAyABNgIMIAEgAzYCCAsgBSAEQQN0IgFBA3I2AgQgASAFaiIBIAEoAgRBAXI2AgQMDAsgCEHsJigCACILTQ0BIAEEQAJAQQIgA3QiAEEAIABrciABIAN0cSIAQQAgAGtxQQFrIgAgAEEMdkEQcSIDdiIBQQV2QQhxIgAgA3IgASAAdiIBQQJ2QQRxIgByIAEgAHYiAUEBdkECcSIAciABIAB2IgFBAXZBAXEiAHIgASAAdmoiBEEDdCIAQZQnaigCACIFKAIIIgEgAEGMJ2oiAEYEQEHkJiAHQX4gBHdxIgc2AgAMAQsgASAANgIMIAAgATYCCAsgBUEIaiEAIAUgCEEDcjYCBCAFIAhqIgMgBEEDdCIBIAhrIgRBAXI2AgQgASAFaiAENgIAIAsEQCALQQN2IgFBA3RBjCdqIQZB+CYoAgAhBQJ/IAdBASABdCIBcUUEQEHkJiABIAdyNgIAIAYMAQsgBigCCAshASAGIAU2AgggASAFNgIMIAUgBjYCDCAFIAE2AggLQfgmIAM2AgBB7CYgBDYCAAwMC0HoJigCACIKRQ0BIApBACAKa3FBAWsiACAAQQx2QRBxIgN2IgFBBXZBCHEiACADciABIAB2IgFBAnZBBHEiAHIgASAAdiIBQQF2QQJxIgByIAEgAHYiAUEBdkEBcSIAciABIAB2akECdEGUKWooAgAiASgCBEF4cSAIayEEIAEhAwNAAkAgAygCECIARQRAIAMoAhQiAEUNAQsgACgCBEF4cSAIayIDIAQgAyAESSIDGyEEIAAgASADGyEBIAAhAwwBCwsgASgCGCEJIAEgASgCDCIFRwRAIAEoAggiAEH0JigCAEkaIAAgBTYCDCAFIAA2AggMCwsgAUEUaiIDKAIAIgBFBEAgASgCECIARQ0DIAFBEGohAwsDQCADIQYgACIFQRRqIgMoAgAiAA0AIAVBEGohAyAFKAIQIgANAAsgBkEANgIADAoLQX8hCCAAQb9/Sw0AIABBC2oiAEF4cSEIQegmKAIAIgpFDQBBACAIayEEAkACQAJAAn9BACAIQYACSQ0AGkEfIAhB////B0sNABogAEEIdiIAIABBgP4/akEQdkEIcSIDdCIAIABBgOAfakEQdkEEcSIBdCIAIABBgIAPakEQdkECcSIAdEEPdiABIANyIAByayIAQQF0IAggAEEVanZBAXFyQRxqCyIHQQJ0QZQpaigCACIDRQRAQQAhAAwBC0EAIQAgCEEAQRkgB0EBdmsgB0EfRht0IQEDQAJAIAMoAgRBeHEgCGsiBiAETw0AIAMhBSAGIgQNAEEAIQQgAyEADAMLIAAgAygCFCIGIAYgAyABQR12QQRxaigCECIDRhsgACAGGyEAIAFBAXQhASADDQALCyAAIAVyRQRAQQAhBUECIAd0IgBBACAAa3IgCnEiAEUNAyAAQQAgAGtxQQFrIgAgAEEMdkEQcSIDdiIBQQV2QQhxIgAgA3IgASAAdiIBQQJ2QQRxIgByIAEgAHYiAUEBdkECcSIAciABIAB2IgFBAXZBAXEiAHIgASAAdmpBAnRBlClqKAIAIQALIABFDQELA0AgACgCBEF4cSAIayIBIARJIQMgASAEIAMbIQQgACAFIAMbIQUgACgCECIBBH8gAQUgACgCFAsiAA0ACwsgBUUNACAEQewmKAIAIAhrTw0AIAUoAhghByAFIAUoAgwiAUcEQCAFKAIIIgBB9CYoAgBJGiAAIAE2AgwgASAANgIIDAkLIAVBFGoiAygCACIARQRAIAUoAhAiAEUNAyAFQRBqIQMLA0AgAyEGIAAiAUEUaiIDKAIAIgANACABQRBqIQMgASgCECIADQALIAZBADYCAAwICyAIQewmKAIAIgNNBEBB+CYoAgAhBAJAIAMgCGsiAUEQTwRAQewmIAE2AgBB+CYgBCAIaiIANgIAIAAgAUEBcjYCBCADIARqIAE2AgAgBCAIQQNyNgIEDAELQfgmQQA2AgBB7CZBADYCACAEIANBA3I2AgQgAyAEaiIAIAAoAgRBAXI2AgQLIARBCGohAAwKCyAIQfAmKAIAIglJBEBB8CYgCSAIayIBNgIAQfwmQfwmKAIAIgMgCGoiADYCACAAIAFBAXI2AgQgAyAIQQNyNgIEIANBCGohAAwKC0EAIQAgCEEvaiIKAn9BvCooAgAEQEHEKigCAAwBC0HIKkJ/NwIAQcAqQoCggICAgAQ3AgBBvCogDUEMakFwcUHYqtWqBXM2AgBB0CpBADYCAEGgKkEANgIAQYAgCyIBaiIHQQAgAWsiBnEiAyAITQ0JQZwqKAIAIgUEQEGUKigCACIEIANqIgEgBE0gASAFS3INCgtBoCotAABBBHENBAJAAkBB/CYoAgAiBARAQaQqIQADQCAEIAAoAgAiAU8EQCABIAAoAgRqIARLDQMLIAAoAggiAA0ACwtBABAJIgFBf0YNBSADIQdBwCooAgAiBEEBayIAIAFxBEAgAyABayAAIAFqQQAgBGtxaiEHCyAHIAhNIAdB/v///wdLcg0FQZwqKAIAIgUEQEGUKigCACIEIAdqIgAgBE0gACAFS3INBgsgBxAJIgAgAUcNAQwHCyAHIAlrIAZxIgdB/v///wdLDQQgBxAJIgEgACgCACAAKAIEakYNAyABIQALIABBf0YgCEEwaiAHTXJFBEBBxCooAgAiASAKIAdrakEAIAFrcSIBQf7///8HSwRAIAAhAQwHCyABEAlBf0cEQCABIAdqIQcgACEBDAcLQQAgB2sQCRoMBAsgACIBQX9HDQUMAwtBACEFDAcLQQAhAQwFCyABQX9HDQILQaAqQaAqKAIAQQRyNgIACyADQf7///8HSw0BIAMQCSIBQX9GQQAQCSIAQX9GciAAIAFNcg0BIAAgAWsiByAIQShqTQ0BC0GUKkGUKigCACAHaiIANgIAQZgqKAIAIABJBEBBmCogADYCAAsCQAJAAkBB/CYoAgAiBgRAQaQqIQADQCABIAAoAgAiBCAAKAIEIgNqRg0CIAAoAggiAA0ACwwCC0H0JigCACIAQQAgACABTRtFBEBB9CYgATYCAAtBACEAQagqIAc2AgBBpCogATYCAEGEJ0F/NgIAQYgnQbwqKAIANgIAQbAqQQA2AgADQCAAQQN0IgRBlCdqIARBjCdqIgM2AgAgBEGYJ2ogAzYCACAAQQFqIgBBIEcNAAtB8CYgB0EoayIEQXggAWtBB3FBACABQQhqQQdxGyIAayIDNgIAQfwmIAAgAWoiADYCACAAIANBAXI2AgQgASAEakEoNgIEQYAnQcwqKAIANgIADAILIAAtAAxBCHEgBCAGS3IgASAGTXINACAAIAMgB2o2AgRB/CYgBkF4IAZrQQdxQQAgBkEIakEHcRsiAGoiAzYCAEHwJkHwJigCACAHaiIBIABrIgA2AgAgAyAAQQFyNgIEIAEgBmpBKDYCBEGAJ0HMKigCADYCAAwBC0H0JigCACABSwRAQfQmIAE2AgALIAEgB2ohA0GkKiEAAkACQAJAAkACQAJAA0AgAyAAKAIARwRAIAAoAggiAA0BDAILCyAALQAMQQhxRQ0BC0GkKiEAA0AgBiAAKAIAIgNPBEAgAyAAKAIEaiIFIAZLDQMLIAAoAgghAAwACwALIAAgATYCACAAIAAoAgQgB2o2AgQgAUF4IAFrQQdxQQAgAUEIakEHcRtqIgogCEEDcjYCBCADQXggA2tBB3FBACADQQhqQQdxG2oiByAIIApqIglrIQMgBiAHRgRAQfwmIAk2AgBB8CZB8CYoAgAgA2oiADYCACAJIABBAXI2AgQMAwsgB0H4JigCAEYEQEH4JiAJNgIAQewmQewmKAIAIANqIgA2AgAgCSAAQQFyNgIEIAAgCWogADYCAAwDCyAHKAIEIgBBA3FBAUYEQCAAQXhxIQYCQCAAQf8BTQRAIAcoAggiBCAAQQN2IgBBA3RBjCdqRhogBCAHKAIMIgFGBEBB5CZB5CYoAgBBfiAAd3E2AgAMAgsgBCABNgIMIAEgBDYCCAwBCyAHKAIYIQgCQCAHIAcoAgwiAUcEQCAHKAIIIgAgATYCDCABIAA2AggMAQsCQCAHQRRqIgAoAgAiBA0AIAdBEGoiACgCACIEDQBBACEBDAELA0AgACEFIAQiAUEUaiIAKAIAIgQNACABQRBqIQAgASgCECIEDQALIAVBADYCAAsgCEUNAAJAIAcgBygCHCIEQQJ0QZQpaiIAKAIARgRAIAAgATYCACABDQFB6CZB6CYoAgBBfiAEd3E2AgAMAgsgCEEQQRQgCCgCECAHRhtqIAE2AgAgAUUNAQsgASAINgIYIAcoAhAiAARAIAEgADYCECAAIAE2AhgLIAcoAhQiAEUNACABIAA2AhQgACABNgIYCyAGIAdqIQcgAyAGaiEDCyAHIAcoAgRBfnE2AgQgCSADQQFyNgIEIAMgCWogAzYCACADQf8BTQRAIANBA3YiAEEDdEGMJ2ohAwJ/QeQmKAIAIgFBASAAdCIAcUUEQEHkJiAAIAFyNgIAIAMMAQsgAygCCAshACADIAk2AgggACAJNgIMIAkgAzYCDCAJIAA2AggMAwtBHyEAIANB////B00EQCADQQh2IgAgAEGA/j9qQRB2QQhxIgR0IgAgAEGA4B9qQRB2QQRxIgF0IgAgAEGAgA9qQRB2QQJxIgB0QQ92IAEgBHIgAHJrIgBBAXQgAyAAQRVqdkEBcXJBHGohAAsgCSAANgIcIAlCADcCECAAQQJ0QZQpaiEFAkBB6CYoAgAiBEEBIAB0IgFxRQRAQegmIAEgBHI2AgAgBSAJNgIAIAkgBTYCGAwBCyADQQBBGSAAQQF2ayAAQR9GG3QhACAFKAIAIQEDQCABIgQoAgRBeHEgA0YNAyAAQR12IQEgAEEBdCEAIAQgAUEEcWoiBSgCECIBDQALIAUgCTYCECAJIAQ2AhgLIAkgCTYCDCAJIAk2AggMAgtB8CYgB0EoayIEQXggAWtBB3FBACABQQhqQQdxGyIAayIDNgIAQfwmIAAgAWoiADYCACAAIANBAXI2AgQgASAEakEoNgIEQYAnQcwqKAIANgIAIAYgBUEnIAVrQQdxQQAgBUEna0EHcRtqQS9rIgAgACAGQRBqSRsiA0EbNgIEIANBrCopAgA3AhAgA0GkKikCADcCCEGsKiADQQhqNgIAQagqIAc2AgBBpCogATYCAEGwKkEANgIAIANBGGohAANAIABBBzYCBCAAQQhqIQEgAEEEaiEAIAEgBUkNAAsgAyAGRg0DIAMgAygCBEF+cTYCBCAGIAMgBmsiBUEBcjYCBCADIAU2AgAgBUH/AU0EQCAFQQN2IgBBA3RBjCdqIQMCf0HkJigCACIBQQEgAHQiAHFFBEBB5CYgACABcjYCACADDAELIAMoAggLIQAgAyAGNgIIIAAgBjYCDCAGIAM2AgwgBiAANgIIDAQLQR8hACAGQgA3AhAgBUH///8HTQRAIAVBCHYiACAAQYD+P2pBEHZBCHEiA3QiACAAQYDgH2pBEHZBBHEiAXQiACAAQYCAD2pBEHZBAnEiAHRBD3YgASADciAAcmsiAEEBdCAFIABBFWp2QQFxckEcaiEACyAGIAA2AhwgAEECdEGUKWohBAJAQegmKAIAIgNBASAAdCIBcUUEQEHoJiABIANyNgIAIAQgBjYCACAGIAQ2AhgMAQsgBUEAQRkgAEEBdmsgAEEfRht0IQAgBCgCACEBA0AgASIDKAIEQXhxIAVGDQQgAEEddiEBIABBAXQhACADIAFBBHFqIgQoAhAiAQ0ACyAEIAY2AhAgBiADNgIYCyAGIAY2AgwgBiAGNgIIDAMLIAQoAggiACAJNgIMIAQgCTYCCCAJQQA2AhggCSAENgIMIAkgADYCCAsgCkEIaiEADAULIAMoAggiACAGNgIMIAMgBjYCCCAGQQA2AhggBiADNgIMIAYgADYCCAtB8CYoAgAiACAITQ0AQfAmIAAgCGsiATYCAEH8JkH8JigCACIDIAhqIgA2AgAgACABQQFyNgIEIAMgCEEDcjYCBCADQQhqIQAMAwtB4CZBMDYCAEEAIQAMAgsCQCAHRQ0AAkAgBSgCHCIDQQJ0QZQpaiIAKAIAIAVGBEAgACABNgIAIAENAUHoJiAKQX4gA3dxIgo2AgAMAgsgB0EQQRQgBygCECAFRhtqIAE2AgAgAUUNAQsgASAHNgIYIAUoAhAiAARAIAEgADYCECAAIAE2AhgLIAUoAhQiAEUNACABIAA2AhQgACABNgIYCwJAIARBD00EQCAFIAQgCGoiAEEDcjYCBCAAIAVqIgAgACgCBEEBcjYCBAwBCyAFIAhBA3I2AgQgBSAIaiIGIARBAXI2AgQgBCAGaiAENgIAIARB/wFNBEAgBEEDdiIAQQN0QYwnaiEDAn9B5CYoAgAiAUEBIAB0IgBxRQRAQeQmIAAgAXI2AgAgAwwBCyADKAIICyEAIAMgBjYCCCAAIAY2AgwgBiADNgIMIAYgADYCCAwBC0EfIQAgBEH///8HTQRAIARBCHYiACAAQYD+P2pBEHZBCHEiA3QiACAAQYDgH2pBEHZBBHEiAXQiACAAQYCAD2pBEHZBAnEiAHRBD3YgASADciAAcmsiAEEBdCAEIABBFWp2QQFxckEcaiEACyAGIAA2AhwgBkIANwIQIABBAnRBlClqIQECQAJAIApBASAAdCIDcUUEQEHoJiADIApyNgIAIAEgBjYCAAwBCyAEQQBBGSAAQQF2ayAAQR9GG3QhACABKAIAIQgDQCAIIgEoAgRBeHEgBEYNAiAAQR12IQMgAEEBdCEAIAEgA0EEcWoiAygCECIIDQALIAMgBjYCEAsgBiABNgIYIAYgBjYCDCAGIAY2AggMAQsgASgCCCIAIAY2AgwgASAGNgIIIAZBADYCGCAGIAE2AgwgBiAANgIICyAFQQhqIQAMAQsCQCAJRQ0AAkAgASgCHCIDQQJ0QZQpaiIAKAIAIAFGBEAgACAFNgIAIAUNAUHoJiAKQX4gA3dxNgIADAILIAlBEEEUIAkoAhAgAUYbaiAFNgIAIAVFDQELIAUgCTYCGCABKAIQIgAEQCAFIAA2AhAgACAFNgIYCyABKAIUIgBFDQAgBSAANgIUIAAgBTYCGAsCQCAEQQ9NBEAgASAEIAhqIgBBA3I2AgQgACABaiIAIAAoAgRBAXI2AgQMAQsgASAIQQNyNgIEIAEgCGoiAyAEQQFyNgIEIAMgBGogBDYCACALBEAgC0EDdiIAQQN0QYwnaiEGQfgmKAIAIQUCf0EBIAB0IgAgB3FFBEBB5CYgACAHcjYCACAGDAELIAYoAggLIQAgBiAFNgIIIAAgBTYCDCAFIAY2AgwgBSAANgIIC0H4JiADNgIAQewmIAQ2AgALIAFBCGohAAsgDUEQaiQAIAAhAwsgAkEBRyAMckUEQEHYJiADNgIACyADCzQAIAIgACsDACABKwMAoTkDACACIAArAwggASsDCKE5AwggAiAAKwMQIAErAxChOQMQIAIL+QECAX8BfCMAQdAAayIDJAAgAyAAKQMQNwNIIANBQGsgACkDCDcDACADIAApAwA3AzggAyAAKQMoNwMwIAMgACkDIDcDKCADIAApAxg3AyAgAyABKQMQNwMYIAMgASkDCDcDECADIAEpAwA3AwhBACEAIANBCGogA0EgahAFIgSZRAAAAKCvA9I8Y0UEQCABKwMYmiADQQhqIANBOGoQBaEgBKMiBEQAAAAAAAAAAGMiAUUEQCACIANBIGogBCACEAQiACkDADcDACACIAApAxA3AxAgAiAAKQMINwMIIANBOGogAiACEBQLIAFFIQALIANB0ABqJAAgAAsrACACIAArAwAgAaM5AwAgAiAAKwMIIAGjOQMIIAIgACsDECABozkDECACC98DAgJ/A3wjAEEwayIMJAAgCkEYaiILQQAgASALECEgC0EBIAIgCxAhIAtBAiADIAsQISAMQRhqEAIiAiAIIAmgRAAAAAAAAOA/ojkDECACIAYgB6BEAAAAAAAA4D+iOQMIIAIgBCAFoEQAAAAAAADgP6I5AwAgDBACIgEgCSAIoUQAAAAAAADgP6I5AxAgASAHIAahRAAAAAAAAOA/ojkDCCABIAUgBKFEAAAAAAAA4D+iOQMAIAsrAzAhCSALKwMAIQggCysDGCEHIAsrAzghBiALKwMIIQUgCysDICEEIAIgAisDACINIAsrAxCiIAIrAwgiDiALKwMooqAgAisDECIPIAsrA0CioDkDECACIA0gBaIgDiAEoqAgDyAGoqA5AwggAiANIAiiIA4gB6KgIA8gCaKgOQMAIAAgAiAKEBQgCyALKwMAIAErAwCiOQMAIAsgCysDCCABKwMAojkDCCALIAsrAxAgASsDAKI5AxAgCyALKwMYIAErAwiiOQMYIAsgCysDICABKwMIojkDICALIAsrAyggASsDCKI5AyggCyALKwMwIAErAxCiOQMwIAsgCysDOCABKwMQojkDOCALIAsrA0AgASsDEKI5A0AgCyALECcaIAxBMGokAAtEAQF8IAEQGkQAAAAAAADwP0QAAACg98awPkQAAACg98awPhAHRQRAQaIIEBwLIAEgABAFIQMgASACEAMgAiADmjkDGAtWAQZ8IAArAxAhAyABKwMQIQQgAiAAKwMAIgUgASsDCCIGoiAAKwMIIgcgASsDACIIoqE5AxAgAiADIAiiIAUgBKKhOQMIIAIgByAEoiADIAaioTkDAAubAgEDfCAAKwMAIgMgACsDECICRErYEk37IRlAoCACIAIgA2MboEQAAAAAAADgP6IiAkRK2BJN+yEJQGUgAkRK2BJN+yEJwGZxRQRAAnwgAkRK2BJN+yEJQKAiAiACRAAAAAAAAAAAZkUgAkRK2BJN+yEZQGVFckUNABoCfyACmUQAAAAAAADgQWMEQCACqgwBC0GAgICAeAsQIEEGECBGIAKZRErYEk37IRlAY3FFBEBBhwkQHAtEStgSTfshGUAgAiACmUQAAACAm4QGPWMgAplEAAAAgJuEBj1kcRsLRErYEk37IQnAoCECCyAAKwMYIQMgACsDCCEEIAFCADcDECABIAI5AwAgASAEIAOgRAAAAAAAAOA/ojkDCAsEAEIACwQAQQAL0QIBB38jAEEgayIDJAAgAyAAKAIcIgQ2AhAgACgCFCEFIAMgAjYCHCADIAE2AhggAyAFIARrIgE2AhQgASACaiEEQQIhByADQRBqIgUhAQJ/AkACQCAAKAI8IAVBAiADQQxqEAAQLEUEQANAIAQgAygCDCIFRg0CIAVBf0wNAyABIAUgASgCBCIISyIGQQN0aiIJIAUgCEEAIAYbayIIIAkoAgBqNgIAIAFBDEEEIAYbaiIJIAkoAgAgCGs2AgAgBCAFayEEIAAoAjwgAUEIaiABIAYbIgEgByAGayIHIANBDGoQABAsRQ0ACwsgBEF/Rw0BCyAAIAAoAiwiATYCHCAAIAE2AhQgACABIAAoAjBqNgIQIAIMAQsgAEEANgIcIABCADcDECAAIAAoAgBBIHI2AgBBACAHQQJGDQAaIAIgASgCBGsLIQQgA0EgaiQAIAQLsh4DHn8TfAF+IwBBsAJrIgMkAEHcJigCACITRQRAQdwmIAEgAkEAEDAiEzYCAAsgA0GYAWoiBhACGiAGQRhqEAIaIAZBMGoQAhogBkHIAGoQAhogBkHgAGoQAhojAEEgayIEJAAgBEEIaiIFRAAAAECmVFhBRAAAAECmVFhBRNCXHBTEP1hBEAsaIAYgBCkDGDcDECAGIAQpAxA3AwggBiAEKQMINwMAIAVEgLgvTNl/wkJEgLgvTNl/wkJEuYrrLiVgwkIQCxogBiAEKQMYNwMoIAYgBCkDEDcDICAGIAQpAwg3AxggBUSq+IuApmOVRUSq+IuApmOVRUQrbBtolRqVRRALGiAGQUBrIAQpAxg3AwAgBiAEKQMQNwM4IAYgBCkDCDcDMCAFRLoGAqwcC4U+RLoGAqwcC4U+RDn4Jhc8HYU+EAsaIAYgBCkDGDcDWCAGIAQpAxA3A1AgBiAEKQMINwNIIAVEszUl+zKtGz1EszUl+zKtGz1EneZ7J/PcGz0QCxogBiAEKQMYNwNwIAYgBCkDEDcDaCAGIAQpAwg3A2AgBkKAgICAmrPm3D83A4gBIAZEAAAAQKZUWEE5A4ABIAZE0JccFMQ/WEE5A3ggBisDKCIlRAAAAAAAAAAAYgRAIAYgBisDGCAlozkDkAELIARBIGokAAJAIABFIAFBAUhyIAJBAUhyDQADQCACIBRGDQEgACsDKCElIAArAyAhKCAAKwMYISIgACsDECEjIAArAwAhJCAAKwMIIScgA0HoAGoiBEIANwMgIAQgJzkDGCAEICQ5AxAgBCAjOQMIIAQgIjkDACAEQgA3AyggBCAEKwMQIiJEStgSTfshGUCgICIgIiAEKwMAIiNjGyAjoTkDICAEIAQrAxggBCsDCKE5AyggBCELIANBCGoiFRACGiAVQRhqQQBByAAQFRogFSEYRAAAAAAAAAAAISsjAEHABWsiBCQAAn8gCysDICIiRAAAAAAAAAAAYyAiRErYEk37IRlAZHIEQEGkCRAmQQAMAQsgCysDKCIjRAAAAAAAAAAAYyAjRErYEk37IQlAZHIEQEHRCRAmQQAMAQsgBisDACAGKwMIRAAAAKCvA9I8RAAAAKCvA9I8EAdFBEBBxAgQHEEADAELIARBoAVqECUhEQJAICJEStgSTfshCUBlBEAgCyAEQYgFahACIhIQNyAGIBIgBEHwBGpEAAAAAAAAAABEAAAAAAAAAABEAAAAAAAAAAAQCyIIEAYjAEHwAWsiCSQAIARB8AJqIg8iBRACGiAFQRhqEAIaIAVBMGoQAhogBUHIAGoQAhogBUHgAGoQAhogD0GYAWoQAiEWIA9BsAFqEAIhHCAPQcgBahACIR0gD0HgAWoQJSEeIAYrA4gBGiMAQTBrIgUkACAIRAAAAAAAAPA/IAYrA0giIiAiIAgrAwAiLCAsoqKiIi0gBisDUCIiICIgCCsDCCIuIC6ioqIiL6AgBisDWCIiICIgCCsDECIwIDCioqIiMaCjnyIiIAVBGGoQAiIHEAQaIAYrA3AhIyAGKwNoISQgBisDYCEnIAUQAiIKICcgBysDAKIiJiAmoDkDACAKICQgBysDCKIiJiAmoDkDCCAKICMgBysDEKIiJiAmoDkDEEQAAAAAAADwPyAioSAIEBqiIAoQGkQAAAAAAADgP6KjISIDQCAxRAAAAAAAAPA/ICMgIiAroSIiokQAAAAAAADwP6CjIiYgJqIiK6IgLUQAAAAAAADwPyAnICKiRAAAAAAAAPA/oKMiKSApoiIyoiAvRAAAAAAAAPA/ICQgIqJEAAAAAAAA8D+goyIqICqiIjOioKBEAAAAAAAA8L+gIjQgIyAxICYgK6KioiAnIC0gKSAyoqKiICQgLyAqIDOioqKgoEQAAAAAAAAAwKKjISsgNJlEAAAAgJmXcT1kDQALIAggMCAmojkDECAIIC4gKqI5AwggCCAsICmiOQMAIAVBMGokACAJQfAAakEAQYABEBUiFyEHIwBBwAJrIgUkACAFQZAKKQMANwOwAiAFQYgKKQMANwOoAiAFQYAKKQMANwOgAiAFQbAKKQMANwOQAiAFQagKKQMANwOIAiAFQaAKKQMANwOAAiAFQdAKKQMANwPwASAFQcgKKQMANwPoASAFQcAKKQMANwPgASAFQcgBahACIRAgBUGwAWoQAiEKIAVBmAFqEAIhDAJAIAgQLwRAIAVBoAJqIBAQAyAFQYACaiAKEAMgBUHgAWogDBADDAELAkAgCCsDAEQAAAAAAAAAAEQAAACAm4QGPUQAAACAm4QGPRAHRQ0AIAgrAwhEAAAAAAAAAABEAAAAgJuEBj1EAAAAgJuEBj0QB0UNAAJ/IAgrAxAiIplEAAAAAAAA4EFjBEAgIqoMAQtBgICAgHgLECAhDSAFQaACaiAQEAMgBUGAAmogChADIAogDbciIiAKEAQaIAVB4AFqIAwQAyAMICIgDBAEGgwBCyAFQYABahACIQ0gBUHoAGoQAiEZIAVB0ABqEAIhHyAFQThqEAIhICAFQSBqEAIhISAFQQhqEAIiGiEOIAgQL0UEQCAOIAggBkHgAGogDhAjIhspAwA3AwAgDiAbKQMQNwMQIA4gGykDCDcDCCAOIA4QDxoLIA0gCCsDCJo5AwAgCCsDACEiIA1CADcDECANICI5AwggDSANEA8aIBogDSAZEDYgGkQAAAAAAADwvyAfEAQaIA1EAAAAAAAA8L8gIBAEGiAZRAAAAAAAAPC/ICEQBBogBSAFKQOQATcD2AEgBSAFKQOIATcD0AEgBSAFKQNwNwO4ASAFIAUpA3g3A8ABIAUgBSkDEDcDoAEgBSAFKQMYNwOoASAFIAUpA4ABNwPIASAFIAUpA2g3A7ABIAUgBSkDCDcDmAELIAcgECsDADkDACAHIBArAwg5AwggECsDECEiIAdCADcDGCAHICI5AxAgByAKKwMAOQMgIAcgCisDCDkDKCAKKwMQISIgB0IANwM4IAcgIjkDMCAHIAwrAwA5A0AgByAMKwMIOQNIIAwrAxAhIiAHQgA3A1ggByAiOQNQIAcgCCsDADkDYCAHIAgrAwg5A2ggCCsDECEiIAdCgICAgICAgPg/NwN4IAcgIjkDcCAFQcACaiQAIA8gBkGYARAfIQUgFiAIKQMQNwMQIBYgCCkDCDcDCCAWIAgpAwA3AwAgF0EAAn8gCUHQAGoiB0IANwMAIAdCADcDGCAHQgA3AxAgB0IANwMIIAcLECIgByAcEAMgF0EBIAcQIiAHIB0QAyAJQThqEAIhCiAXQQIgBxAiIAcgChADIAkgCCkDEDcDMCAJIAgpAwg3AyggCSAIKQMANwMgIAkgCikDCDcDECAJIAopAxA3AxggCSAKKQMANwMIIAlBIGogCUEIaiAeEDUgCUHwAWokACAEIAUpA/gBNwO4BSAEIAUpA/ABNwOwBSAEIAUpA+gBNwOoBSAEIAUpA+ABNwOgBSALKwMIISQgEisDCCEiIAsrAxghJyASKwMAISMgBEHYAmoQAiEJICMgCysDGCAlIAkQEyAEQcACahACIQggCysDACALKwMYICUgCBATIARBqAJqEAIhCiALKwMARAAAAAAAAAAAICIgJ0QAAAAAAAAAAGQbICIgJEQAAAAAAAAAAGMbICUgChATIARBkAJqEAIhByALKwMAIAsrAwggJSAHEBMgBEH4AWoQAiEMICMgCysDCCAlIAwQEyAGIAkgBEHgAWoQAiINEAYgBiAIIARByAFqEAIiCxAGIAYgCiAEQbABahACIg4QBiAGIAcgBEGYAWoQAiIJEAYgBiAMIARBgAFqEAIiDxAGIAUgDSAEQfAAahASIg0QESAFIAsgBEHgAGoQEiIKEBEgBSAOIARB0ABqEBIiDhARIAUgCSAEQUBrEBIiDBARIAUgDyAEQTBqEBIiDxARIA8rAwghIiAMKwMIISMgDSsDCCEkIAorAwghJyAMKwMAISYgDisDACEpIAorAwAhKiAHICg5AxAgCCAoOQMQIAYgCCALEAYgBiAHIAkQBiAqICkQFyAmEBchKCARIAsQGyARIAkQGxAXISYgJyAkEC0hJCAFQZgBaiAFQbABaiAFQcgBaiAFQeABaiAoICiaICMgIhAXICQgJiAlIBgQNAwBCyALKwMYISIgCysDCCEjIAsgBEHwAmoQAiIFEDcgBSsDACIkRAAAAAAAAPA/RAAAAAAAAAAAICNEAAAAAAAAAAAgI0QAAAAAAAAAAGQiCBsiIyAiICMgIkQAAAAAAAAAAGMiDBsgCBtEAAAAAAAAAABiGyIiICUgBiAEQYgFahACIgUQECAFQgA3AxAgBSsDCCEjIAUrAwAhJyAFIARB8ARqIgcQAhAPGiAEQfAkIAcgI5lEAAAA4N982z1jGyAHICeZRAAAAODffNs9YxsiBykDEDcD6AIgBCAHKQMINwPgAiAEIAcpAwA3A9gCIARBmCUpAwA3A9ACIARBkCUpAwA3A8gCIARBiCUpAwA3A8ACIARB2AJqIg0gBEHAAmoiDiAEQagCahACIgcQNiAEIAUpAxA3AyggBCAFKQMINwMgIAUpAwAhNSAEIAQpA+ACNwMIIAQgBCkD6AI3AxAgBCA1NwMYIAQgBCkD2AI3AwAgBEEYaiAEIBEQNSAkRErYEk37Ifk/oCAiICUgBiAEQZACahACIgkQECAEQfgBahACIg8hECMAQSBrIgokACARIBEgCRAbIApBCGoQAiISEAQaIAkgEiAQEDEaIApBIGokACAPIAcQBSEjIARB4AFqEAIhCUQAAAAAAAAAACALKwMYICggJSAMGyAGIAkQECAJKwMQISQgBEHIAWoQAiEJRAAAAAAAAAAAIAsrAwggKCAlIAgbIAYgCRAQIAkrAxAhKCAEQbABahACIQggCysDECAiICUgBiAIEBAgBSAHIA4gDSAjmiAjICggJCARIAgQG0QAAAAAAAAAACAYEDQLQQELIQUgBEHABWokACAFBEAgASAUbCEFQQAhBANAIARBCUcEQCATIAQgBWpBA3RqIBUgBEEDdGorAxg5AwAgBEEBaiEEDAELCyAFQQN0IBNqIgQgAysDCDkDSCAEIAMrAxA5A1AgBCADKwMYOQNYCyAAQTBqIQAgFEEBaiEUDAALAAsgA0GwAmokACATC64MAQd/IAAEQAJAIABFDQAgAEEIayICIABBBGsoAgAiAEF4cSIEaiEFAkAgAEEBcQ0AIABBA3FFDQEgAiACKAIAIgBrIgJB9CYoAgBJDQEgACAEaiEEIAJB+CYoAgBHBEAgAEH/AU0EQCACKAIIIgEgAEEDdiIDQQN0QYwnakYaIAEgAigCDCIARgRAQeQmQeQmKAIAQX4gA3dxNgIADAMLIAEgADYCDCAAIAE2AggMAgsgAigCGCEGAkAgAiACKAIMIgBHBEAgAigCCCIBIAA2AgwgACABNgIIDAELAkAgAkEUaiIBKAIAIgMNACACQRBqIgEoAgAiAw0AQQAhAAwBCwNAIAEhByADIgBBFGoiASgCACIDDQAgAEEQaiEBIAAoAhAiAw0ACyAHQQA2AgALIAZFDQECQCACIAIoAhwiAUECdEGUKWoiAygCAEYEQCADIAA2AgAgAA0BQegmQegmKAIAQX4gAXdxNgIADAMLIAZBEEEUIAYoAhAgAkYbaiAANgIAIABFDQILIAAgBjYCGCACKAIQIgEEQCAAIAE2AhAgASAANgIYCyACKAIUIgFFDQEgACABNgIUIAEgADYCGAwBCyAFKAIEIgBBA3FBA0cNAEHsJiAENgIAIAUgAEF+cTYCBCACIARBAXI2AgQgAiAEaiAENgIADAELIAIgBU8NACAFKAIEIgBBAXFFDQACQCAAQQJxRQRAIAVB/CYoAgBGBEBB/CYgAjYCAEHwJkHwJigCACAEaiIANgIAIAIgAEEBcjYCBCACQfgmKAIARw0DQewmQQA2AgBB+CZBADYCAAwDCyAFQfgmKAIARgRAQfgmIAI2AgBB7CZB7CYoAgAgBGoiADYCACACIABBAXI2AgQgACACaiAANgIADAMLIABBeHEgBGohBAJAIABB/wFNBEAgBSgCCCIBIABBA3YiA0EDdEGMJ2pGGiABIAUoAgwiAEYEQEHkJkHkJigCAEF+IAN3cTYCAAwCCyABIAA2AgwgACABNgIIDAELIAUoAhghBgJAIAUgBSgCDCIARwRAIAUoAggiAUH0JigCAEkaIAEgADYCDCAAIAE2AggMAQsCQCAFQRRqIgEoAgAiAw0AIAVBEGoiASgCACIDDQBBACEADAELA0AgASEHIAMiAEEUaiIBKAIAIgMNACAAQRBqIQEgACgCECIDDQALIAdBADYCAAsgBkUNAAJAIAUgBSgCHCIBQQJ0QZQpaiIDKAIARgRAIAMgADYCACAADQFB6CZB6CYoAgBBfiABd3E2AgAMAgsgBkEQQRQgBigCECAFRhtqIAA2AgAgAEUNAQsgACAGNgIYIAUoAhAiAQRAIAAgATYCECABIAA2AhgLIAUoAhQiAUUNACAAIAE2AhQgASAANgIYCyACIARBAXI2AgQgAiAEaiAENgIAIAJB+CYoAgBHDQFB7CYgBDYCAAwCCyAFIABBfnE2AgQgAiAEQQFyNgIEIAIgBGogBDYCAAsgBEH/AU0EQCAEQQN2IgFBA3RBjCdqIQACf0HkJigCACIDQQEgAXQiAXFFBEBB5CYgASADcjYCACAADAELIAAoAggLIQEgACACNgIIIAEgAjYCDCACIAA2AgwgAiABNgIIDAELQR8hASACQgA3AhAgBEH///8HTQRAIARBCHYiACAAQYD+P2pBEHZBCHEiAHQiASABQYDgH2pBEHZBBHEiAXQiAyADQYCAD2pBEHZBAnEiA3RBD3YgACABciADcmsiAEEBdCAEIABBFWp2QQFxckEcaiEBCyACIAE2AhwgAUECdEGUKWohAAJAAkACQEHoJigCACIDQQEgAXQiB3FFBEBB6CYgAyAHcjYCACAAIAI2AgAgAiAANgIYDAELIARBAEEZIAFBAXZrIAFBH0YbdCEBIAAoAgAhAANAIAAiAygCBEF4cSAERg0CIAFBHXYhACABQQF0IQEgAyAAQQRxaiIHKAIQIgANAAsgByACNgIQIAIgAzYCGAsgAiACNgIMIAIgAjYCCAwBCyADKAIIIgAgAjYCDCADIAI2AgggAkEANgIYIAIgAzYCDCACIAA2AggLQYQnQYQnKAIAQQFrIgBBfyAAGzYCAAsLCwvOGxgAQYAIC/wBLSsgICAwWDB4ACVzAG5vbmUARWxsaXBzb2lkIEVSUk9SAG5vcm1hbCBtdXN0IGJlIG5vcm1hbGl6ZWQuAChudWxsKQBFbGxpcHNvaWQgbXVzdCBiZSBhbiBlbGxpcHNvaWQgb2YgcmV2b2x1dGlvbiAocmFkaWkueCA9PSByYWRpaS55KSAAIGdldCBkb3VibGUgbW9kIG5lZWQgZGVhbC4gIABSZWN0YW5nbGUgd2lkdGggbXVzdCBiZSBiZXR3ZWVuIDAgYW5kIDIqcGkgCgBSZWN0YW5nbGUgaGVpZ2h0IG11c3QgYmUgYmV0d2VlbiAwIGFuZCBwaSAKAEGOCgsC8D8AQaYKCwLwvwBB1goL4RXwPwAAAAAAAAAAAwAAAAQAAAAEAAAABgAAAIP5ogBETm4A/CkVANFXJwDdNPUAYtvAADyZlQBBkEMAY1H+ALveqwC3YcUAOm4kANJNQgBJBuAACeouAByS0QDrHf4AKbEcAOg+pwD1NYIARLsuAJzphAC0JnAAQX5fANaROQBTgzkAnPQ5AItfhAAo+b0A+B87AN7/lwAPmAUAES/vAApaiwBtH20Az342AAnLJwBGT7cAnmY/AC3qXwC6J3UA5evHAD178QD3OQcAklKKAPtr6gAfsV8ACF2NADADVgB7/EYA8KtrACC8zwA29JoA46kdAF5hkQAIG+YAhZllAKAUXwCNQGgAgNj/ACdzTQAGBjEAylYVAMmocwB74mAAa4zAABnERwDNZ8MACejcAFmDKgCLdsQAphyWAESv3QAZV9EApT4FAAUH/wAzfj8AwjLoAJhP3gC7fTIAJj3DAB5r7wCf+F4ANR86AH/yygDxhx0AfJAhAGokfADVbvoAMC13ABU7QwC1FMYAwxmdAK3EwgAsTUEADABdAIZ9RgDjcS0Am8aaADNiAAC00nwAtKeXADdV1QDXPvYAoxAYAE12/ABknSoAcNerAGN8+AB6sFcAFxXnAMBJVgA71tkAp4Q4ACQjywDWincAWlQjAAAfuQDxChsAGc7fAJ8x/wBmHmoAmVdhAKz7RwB+f9gAImW3ADLoiQDmv2AA78TNAGw2CQBdP9QAFt7XAFg73gDem5IA0iIoACiG6ADiWE0AxsoyAAjjFgDgfcsAF8BQAPMdpwAY4FsALhM0AIMSYgCDSAEA9Y5bAK2wfwAe6fIASEpDABBn0wCq3dgArl9CAGphzgAKKKQA05m0AAam8gBcd38Ao8KDAGE8iACKc3gAr4xaAG/XvQAtpmMA9L/LAI2B7wAmwWcAVcpFAMrZNgAoqNIAwmGNABLJdwAEJhQAEkabAMRZxADIxUQATbKRAAAX8wDUQ60AKUnlAP3VEAAAvvwAHpTMAHDO7gATPvUA7PGAALPnwwDH+CgAkwWUAMFxPgAuCbMAC0XzAIgSnACrIHsALrWfAEeSwgB7Mi8ADFVtAHKnkABr5x8AMcuWAHkWSgBBeeIA9N+JAOiUlwDi5oQAmTGXAIjtawBfXzYAu/0OAEiatABnpGwAcXJCAI1dMgCfFbgAvOUJAI0xJQD3dDkAMAUcAA0MAQBLCGgALO5YAEeqkAB05wIAvdYkAPd9pgBuSHIAnxbvAI6UpgC0kfYA0VNRAM8K8gAgmDMA9Ut+ALJjaADdPl8AQF0DAIWJfwBVUikAN2TAAG3YEAAySDIAW0x1AE5x1ABFVG4ACwnBACr1aQAUZtUAJwedAF0EUAC0O9sA6nbFAIf5FwBJa30AHSe6AJZpKQDGzKwArRRUAJDiagCI2YkALHJQAASkvgB3B5QA8zBwAAD8JwDqcagAZsJJAGTgPQCX3YMAoz+XAEOU/QANhowAMUHeAJI5nQDdcIwAF7fnAAjfOwAVNysAXICgAFqAkwAQEZIAD+jYAGyArwDb/0sAOJAPAFkYdgBipRUAYcu7AMeJuQAQQL0A0vIEAEl1JwDrtvYA2yK7AAoUqgCJJi8AZIN2AAk7MwAOlBoAUTqqAB2jwgCv7a4AXCYSAG3CTQAtepwAwFaXAAM/gwAJ8PYAK0CMAG0xmQA5tAcADCAVANjDWwD1ksQAxq1LAE7KpQCnN80A5qk2AKuSlADdQmgAGWPeAHaM7wBoi1IA/Ns3AK6hqwDfFTEAAK6hAAz72gBkTWYA7QW3ACllMABXVr8AR/86AGr5uQB1vvMAKJPfAKuAMABmjPYABMsVAPoiBgDZ5B0APbOkAFcbjwA2zQkATkLpABO+pAAzI7UA8KoaAE9lqADSwaUACz8PAFt4zQAj+XYAe4sEAIkXcgDGplMAb27iAO/rAACbSlgAxNq3AKpmugB2z88A0QIdALHxLQCMmcEAw613AIZI2gD3XaAAxoD0AKzwLwDd7JoAP1y8ANDebQCQxx8AKtu2AKMlOgAAr5oArVOTALZXBAApLbQAS4B+ANoHpwB2qg4Ae1mhABYSKgDcty0A+uX9AInb/gCJvv0A5HZsAAap/AA+gHAAhW4VAP2H/wAoPgcAYWczACoYhgBNveoAs+evAI9tbgCVZzkAMb9bAITXSAAw3xYAxy1DACVhNQDJcM4AMMu4AL9s/QCkAKIABWzkAFrdoAAhb0cAYhLSALlchABwYUkAa1bgAJlSAQBQVTcAHtW3ADPxxAATbl8AXTDkAIUuqQAdssMAoTI2AAi3pADqsdQAFvchAI9p5AAn/3cADAOAAI1ALQBPzaAAIKWZALOi0wAvXQoAtPlCABHaywB9vtAAm9vBAKsXvQDKooEACGpcAC5VFwAnAFUAfxTwAOEHhgAUC2QAlkGNAIe+3gDa/SoAayW2AHuJNAAF8/4Aub+eAGhqTwBKKqgAT8RaAC34vADXWpgA9MeVAA1NjQAgOqYApFdfABQ/sQCAOJUAzCABAHHdhgDJ3rYAv2D1AE1lEQABB2sAjLCsALLA0ABRVUgAHvsOAJVywwCjBjsAwEA1AAbcewDgRcwATin6ANbKyADo80EAfGTeAJtk2ADZvjEApJfDAHdY1ABp48UA8NoTALo6PABGGEYAVXVfANK99QBuksYArC5dAA5E7QAcPkIAYcSHACn96QDn1vMAInzKAG+RNQAI4MUA/9eNAG5q4gCw/cYAkwjBAHxddABrrbIAzW6dAD5yewDGEWoA98+pAClz3wC1yboAtwBRAOKyDQB0uiQA5X1gAHTYigANFSwAgRgMAH5mlAABKRYAn3p2AP39vgBWRe8A2X42AOzZEwCLurkAxJf8ADGoJwDxbsMAlMU2ANioVgC0qLUAz8wOABKJLQBvVzQALFaJAJnO4wDWILkAa16qAD4qnAARX8wA/QtKAOH0+wCOO20A4oYsAOnUhAD8tKkA7+7RAC41yQAvOWEAOCFEABvZyACB/AoA+0pqAC8c2ABTtIQATpmMAFQizAAqVdwAwMbWAAsZlgAacLgAaZVkACZaYAA/Uu4AfxEPAPS1EQD8y/UANLwtADS87gDoXcwA3V5gAGeOmwCSM+8AyRe4AGFYmwDhV7wAUYPGANg+EADdcUgALRzdAK8YoQAhLEYAWfPXANl6mACeVMAAT4b6AFYG/ADlea4AiSI2ADitIgBnk9wAVeiqAIImOADK55sAUQ2kAJkzsQCp1w4AaQVIAGWy8AB/iKcAiEyXAPnRNgAhkrMAe4JKAJjPIQBAn9wA3EdVAOF0OgBn60IA/p3fAF7UXwB7Z6QAuqx6AFX2ogAriCMAQbpVAFluCAAhKoYAOUeDAInj5gDlntQASftAAP9W6QAcD8oAxVmKAJT6KwDTwcUAD8XPANtargBHxYYAhUNiACGGOwAseZQAEGGHACpMewCALBoAQ78SAIgmkAB4PIkAqMTkAOXbewDEOsIAJvTqAPdnigANkr8AZaMrAD2TsQC9fAsApFHcACfdYwBp4d0AmpQZAKgplQBozigACe20AESfIABOmMoAcIJjAH58IwAPuTIAp/WOABRW5wAh8QgAtZ0qAG9+TQClGVEAtfmrAILf1gCW3WEAFjYCAMQ6nwCDoqEAcu1tADmNegCCuKkAazJcAEYnWwAANO0A0gB3APz0VQABWU0A4HGAAEHDIAs/QPsh+T8AAAAALUR0PgAAAICYRvg8AAAAYFHMeDsAAACAgxvwOQAAAEAgJXo4AAAAgCKC4zYAAAAAHfNpNagSAEGQIQtBEQAKABEREQAAAAAFAAAAAAAACQAAAAALAAAAAAAAAAARAA8KERERAwoHAAEACQsLAAAJBgsAAAsABhEAAAAREREAQeEhCyELAAAAAAAAAAARAAoKERERAAoAAAIACQsAAAAJAAsAAAsAQZsiCwEMAEGnIgsVDAAAAAAMAAAAAAkMAAAAAAAMAAAMAEHVIgsBDgBB4SILFQ0AAAAEDQAAAAAJDgAAAAAADgAADgBBjyMLARAAQZsjCx4PAAAAAA8AAAAACRAAAAAAABAAABAAABIAAAASEhIAQdIjCw4SAAAAEhISAAAAAAAACQBBgyQLAQsAQY8kCxUKAAAAAAoAAAAACQsAAAAAAAsAAAsAQb0kCwEMAEHJJAsnDAAAAAAMAAAAAAkMAAAAAAAMAAAMAAAwMTIzNDU2Nzg5QUJDREVGAEH2JAsC8D8AQZ4lCwvwP5AaUAAAAAAABQBBtCULAQEAQcwlCw4CAAAAAwAAAGgVAAAABABB5CULAQEAQfMlCwUK/////w==","undefined"==typeof document?new(require("url").URL)("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("Geoworld.js",document.baseURI).href).toString();var B,F={mappings:{},buffers:[null,[],[]],printChar:function(e,t){var i=F.buffers[e];0===t||10===t?((1===e?m:g)(x(i,0)),i.length=0):i.push(t)},varargs:void 0,get:function(){return F.varargs+=4,v[F.varargs-4>>2]},getStr:function(e){return function(e,t){return e?x(y,e,t):""}(e)},get64:function(e,t){return e}},V={b:function(e){y.length,P("OOM")},a:function(e,t,i,r){for(var n=0,a=0;a<i;a++){var o=v[t>>2],s=v[t+4>>2];t+=8;for(var l=0;l<s;l++)F.printChar(e,y[o+l]);n+=s}return v[r>>2]=n,0}};function z(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function U(e){function t(){B||(B=!0,a.calledRun=!0,_||(N(S),i(a),a.onRuntimeInitialized&&a.onRuntimeInitialized(),function(){if(a.postRun)for("function"==typeof a.postRun&&(a.postRun=[a.postRun]);a.postRun.length;)e=a.postRun.shift(),w.unshift(e);var e;N(w)}()))}0<E||(function(){if(a.preRun)for("function"==typeof a.preRun&&(a.preRun=[a.preRun]);a.preRun.length;)e=a.preRun.shift(),A.unshift(e);var e;N(A)}(),0<E||(a.setStatus?(a.setStatus("Running..."),setTimeout(function(){setTimeout(function(){a.setStatus("")},1),t()},1)):t()))}if(function(){var t={a:V};function i(e,t){var i=e.exports;a.asm=i,function(e){a.HEAP8=new Int8Array(e),a.HEAP16=new Int16Array(e),a.HEAP32=v=new Int32Array(e),a.HEAPU8=y=new Uint8Array(e),a.HEAPU16=new Uint16Array(e),a.HEAPU32=new Uint32Array(e),a.HEAPF32=new Float32Array(e),a.HEAPF64=new Float64Array(e)}(a.asm.c.buffer),b=a.asm.h,function(e){S.unshift(e)}(a.asm.d),function(){if(E--,a.monitorRunDependencies&&a.monitorRunDependencies(E),0==E&&T){var e=T;T=null,e()}}()}function r(e){i(e.instance)}function n(e){return function(){if(!f&&(c||d)){if("function"==typeof fetch&&!R(M))return fetch(M,{credentials:"same-origin"}).then(function(e){if(!e.ok)throw"failed to load wasm binary file at '"+M+"'";return e.arrayBuffer()}).catch(function(){return L(M)});if(s)return new Promise(function(t,e){s(M,function(e){t(new Uint8Array(e))},e)})}return Promise.resolve().then(function(){return L(M)})}().then(function(e){return WebAssembly.instantiate(e,t)}).then(function(e){return e}).then(e,function(e){g("failed to asynchronously prepare wasm: "+e),P(e)})}if(E++,a.monitorRunDependencies&&a.monitorRunDependencies(E),a.instantiateWasm)try{return a.instantiateWasm(t,i)}catch(e){return g("Module.instantiateWasm callback failed with error: "+e)}(f||"function"!=typeof WebAssembly.instantiateStreaming||O(M)||R(M)||"function"!=typeof fetch?n(r):fetch(M,{credentials:"same-origin"}).then(function(e){return WebAssembly.instantiateStreaming(e,t).then(r,function(e){return g("wasm streaming compile failed: "+e),g("falling back to ArrayBuffer instantiation"),n(r)})})).catch(o)}(),a.___wasm_call_ctors=function(){return(a.___wasm_call_ctors=a.asm.d).apply(null,arguments)},a._deleteDoubleMalloc=function(){return(a._deleteDoubleMalloc=a.asm.e).apply(null,arguments)},a._createDoubleMalloc=function(){return(a._createDoubleMalloc=a.asm.f).apply(null,arguments)},a._fromRectangles=function(){return(a._fromRectangles=a.asm.g).apply(null,arguments)},T=function e(){B||U(),B||(T=e)},a.run=U,a.preInit)for("function"==typeof a.preInit&&(a.preInit=[a.preInit]);0<a.preInit.length;)a.preInit.pop()();return U(),a.ready}),KKu,computeRegionBoundingBox={};function TileBoundingRegion(e){if(defined(e)){this.rectangle=Rectangle.clone(e.rectangle),this.minimumHeight=defaultValue(e.minimumHeight,0),this.maximumHeight=defaultValue(e.maximumHeight,0),this.southwestCornerCartesian=new Cartesian3,this.northeastCornerCartesian=new Cartesian3,this.westNormal=new Cartesian3,this.southNormal=new Cartesian3,this.eastNormal=new Cartesian3,this.northNormal=new Cartesian3;var t=defaultValue(e.ellipsoid,Ellipsoid.WGS84);computeBox(this,e.rectangle,t),defaultValue(e.computeBoundingVolumes,!0)&&(this._orientedBoundingBox=TileBoundingRegion.fromRectangleByWasm(this.rectangle,this.minimumHeight,this.maximumHeight,t),this._boundingSphere=BoundingSphere.fromOrientedBoundingBox(this._orientedBoundingBox))}}computeRegionBoundingBox.onRuntimeInitialized||(computeRegionBoundingBox.onRuntimeInitialized=function(){console.log("wasm ready!")},Module(computeRegionBoundingBox)),TileBoundingRegion.fromRectangle=function(e,t,i,r,n){return FeatureDetection.supportsWebAssembly()?TileBoundingRegion.fromRectangleByWasm(e,t,i,r,n):OrientedBoundingBox.fromRectangle(this.rectangle,this.minimumHeight,this.maximumHeight,r)},TileBoundingRegion.fromRectangleByWasm=function(e,t,i,r,n){var a=computeRegionBoundingBox._createDoubleMalloc(6,1,1);computeRegionBoundingBox.HEAPF64[a>>3]=e.east,computeRegionBoundingBox.HEAPF64[1+(a>>3)]=e.north,computeRegionBoundingBox.HEAPF64[2+(a>>3)]=e.south,computeRegionBoundingBox.HEAPF64[3+(a>>3)]=e.west,computeRegionBoundingBox.HEAPF64[4+(a>>3)]=t,computeRegionBoundingBox.HEAPF64[5+(a>>3)]=i;var o=computeRegionBoundingBox._fromRectangles(a,12,1,1),s=new Matrix3(computeRegionBoundingBox.HEAPF64[0+(o>>3)],computeRegionBoundingBox.HEAPF64[1+(o>>3)],computeRegionBoundingBox.HEAPF64[2+(o>>3)],computeRegionBoundingBox.HEAPF64[3+(o>>3)],computeRegionBoundingBox.HEAPF64[4+(o>>3)],computeRegionBoundingBox.HEAPF64[5+(o>>3)],computeRegionBoundingBox.HEAPF64[6+(o>>3)],computeRegionBoundingBox.HEAPF64[7+(o>>3)],computeRegionBoundingBox.HEAPF64[8+(o>>3)]),l=new Cartesian3(computeRegionBoundingBox.HEAPF64[9+(o>>3)],computeRegionBoundingBox.HEAPF64[10+(o>>3)],computeRegionBoundingBox.HEAPF64[11+(o>>3)]);return defined(n)||(n=new OrientedBoundingBox(l,s)),n.center=l,n.halfAxes=s,n},Object.defineProperties(TileBoundingRegion.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});var cartesian3Scratch$2=new Cartesian3,cartesian3Scratch2$1=new Cartesian3,cartesian3Scratch3$1=new Cartesian3,eastWestNormalScratch=new Cartesian3,westernMidpointScratch=new Cartesian3,easternMidpointScratch=new Cartesian3,cartographicScratch$2=new Cartographic,planeScratch=new Plane(Cartesian3.UNIT_X,0),rayScratch=new Ray;function computeBox(e,t,i){i.cartographicToCartesian(Rectangle.southwest(t),e.southwestCornerCartesian),i.cartographicToCartesian(Rectangle.northeast(t),e.northeastCornerCartesian),cartographicScratch$2.longitude=t.west,cartographicScratch$2.latitude=.5*(t.south+t.north),cartographicScratch$2.height=0;var r=i.cartographicToCartesian(cartographicScratch$2,westernMidpointScratch),n=Cartesian3.cross(r,Cartesian3.UNIT_Z,cartesian3Scratch$2);Cartesian3.normalize(n,e.westNormal),cartographicScratch$2.longitude=t.east;var a=i.cartographicToCartesian(cartographicScratch$2,easternMidpointScratch),o=Cartesian3.cross(Cartesian3.UNIT_Z,a,cartesian3Scratch$2);Cartesian3.normalize(o,e.eastNormal);var s,l=Cartesian3.subtract(r,a,cartesian3Scratch$2),u=Cartesian3.normalize(l,eastWestNormalScratch),c=t.south;if(0<c){cartographicScratch$2.longitude=.5*(t.west+t.east),cartographicScratch$2.latitude=c;var d=i.cartographicToCartesian(cartographicScratch$2,rayScratch.origin);Cartesian3.clone(u,rayScratch.direction);var h=Plane.fromPointNormal(e.southwestCornerCartesian,e.westNormal,planeScratch);IntersectionTests.rayPlane(rayScratch,h,e.southwestCornerCartesian),s=i.geodeticSurfaceNormal(d,cartesian3Scratch2$1)}else s=i.geodeticSurfaceNormalCartographic(Rectangle.southeast(t),cartesian3Scratch2$1);var p=Cartesian3.cross(s,l,cartesian3Scratch3$1);Cartesian3.normalize(p,e.southNormal);var f,m=t.north;if(m<0){cartographicScratch$2.longitude=.5*(t.west+t.east),cartographicScratch$2.latitude=m;var g=i.cartographicToCartesian(cartographicScratch$2,rayScratch.origin);Cartesian3.negate(u,rayScratch.direction);var y=Plane.fromPointNormal(e.northeastCornerCartesian,e.eastNormal,planeScratch);IntersectionTests.rayPlane(rayScratch,y,e.northeastCornerCartesian),f=i.geodeticSurfaceNormal(g,cartesian3Scratch2$1)}else f=i.geodeticSurfaceNormalCartographic(Rectangle.northwest(t),cartesian3Scratch2$1);var v=Cartesian3.cross(l,f,cartesian3Scratch3$1);Cartesian3.normalize(v,e.northNormal)}var southwestCornerScratch=new Cartesian3,northeastCornerScratch=new Cartesian3,negativeUnitY=new Cartesian3(0,-1,0),negativeUnitZ=new Cartesian3(0,0,-1),vectorScratch=new Cartesian3;function TileBoundingSphere(e,t){0===t&&(t=CesiumMath.EPSILON7),this._boundingSphere=new BoundingSphere(e,t)}TileBoundingRegion.prototype.distanceToCamera=function(e){var t,i,r,n=e.camera,a=n.positionWC,o=n.positionCartographic,s=0;if(!Rectangle.contains(this.rectangle,o)){var l=this.southwestCornerCartesian,u=this.northeastCornerCartesian,c=this.westNormal,d=this.southNormal,h=this.eastNormal,p=this.northNormal;e.mode!==SceneMode$1.SCENE3D&&((l=e.mapProjection.project(Rectangle.southwest(this.rectangle),southwestCornerScratch)).z=l.y,l.y=l.x,l.x=0,(u=e.mapProjection.project(Rectangle.northeast(this.rectangle),northeastCornerScratch)).z=u.y,u.y=u.x,u.x=0,c=negativeUnitY,h=Cartesian3.UNIT_Y,d=negativeUnitZ,p=Cartesian3.UNIT_Z);var f=Cartesian3.subtract(a,l,vectorScratch),m=Cartesian3.dot(f,c),g=Cartesian3.dot(f,d),y=Cartesian3.subtract(a,u,vectorScratch),v=Cartesian3.dot(y,h),_=Cartesian3.dot(y,p);0<m?s+=m*m:0<v&&(s+=v*v),0<g?s+=g*g:0<_&&(s+=_*_)}if((r=e.mode===SceneMode$1.SCENE3D?(t=o.height,i=this.minimumHeight,this.maximumHeight):(t=a.x,i=0))<t){var C=t-r;s+=C*C}else if(t<i){var x=i-t;s+=x*x}return Math.sqrt(s)},TileBoundingRegion.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)},TileBoundingRegion.prototype.createDebugVolume=function(e){var t=new Matrix4.clone(Matrix4.IDENTITY);return new Primitive({geometryInstances:new GeometryInstance({geometry:new RectangleOutlineGeometry({rectangle:this.rectangle,height:this.minimumHeight,extrudedHeight:this.maximumHeight}),id:"outline",modelMatrix:t,attributes:{color:ColorGeometryInstanceAttribute.fromColor(e)}}),appearance:new PerInstanceColorAppearance({translucent:!1,flat:!0}),asynchronous:!1})},TileBoundingRegion.clone=function(e){var t=new TileBoundingRegion;return t.rectangle=Rectangle.clone(e.rectangle),t.minimumHeight=e.minimumHeight,t.maximumHeight=e.maximumHeight,t.southwestCornerCartesian=Cartesian3.clone(e.southwestCornerCartesian),t.northeastCornerCartesian=Cartesian3.clone(e.northeastCornerCartesian),t.westNormal=Cartesian3.clone(e.westNormal),t.southNormal=Cartesian3.clone(e.southNormal),t.eastNormal=Cartesian3.clone(e.eastNormal),t.northNormal=Cartesian3.clone(e.northNormal),t._orientedBoundingBox=e._orientedBoundingBox.clone(),t._boundingSphere=e._boundingSphere.clone(),t},Object.defineProperties(TileBoundingSphere.prototype,{center:{get:function(){return this._boundingSphere.center}},radius:{get:function(){return this._boundingSphere.radius}},boundingVolume:{get:function(){return this._boundingSphere}},boundingSphere:{get:function(){return this._boundingSphere}}}),TileBoundingSphere.prototype.distanceToCamera=function(e){var t=this._boundingSphere;return Math.max(0,Cartesian3.distance(t.center,e.camera.positionWC)-t.radius)},TileBoundingSphere.prototype.intersectPlane=function(e){return BoundingSphere.intersectPlane(this._boundingSphere,e)},TileBoundingSphere.prototype.update=function(e,t){Cartesian3.clone(e,this._boundingSphere.center),this._boundingSphere.radius=t},TileBoundingSphere.prototype.createDebugVolume=function(e){return new Primitive({geometryInstances:new GeometryInstance({geometry:new SphereOutlineGeometry({radius:this.radius}),id:"outline",modelMatrix:Matrix4.fromTranslation(this.center,new Matrix4.clone(Matrix4.IDENTITY)),attributes:{color:ColorGeometryInstanceAttribute.fromColor(e)}}),appearance:new PerInstanceColorAppearance({translucent:!1,flat:!0}),asynchronous:!1})};var scratchU=new Cartesian3,scratchV=new Cartesian3,scratchW$1=new Cartesian3,scratchCartesian$5=new Cartesian3;function computeMissingVector(e,t,i){i=Cartesian3.cross(e,t,i);var r=Cartesian3.magnitude(i);return Cartesian3.multiplyByScalar(i,CesiumMath.EPSILON7/r,i)}function findOrthogonalVector(e,t){var i=Cartesian3.normalize(e,scratchCartesian$5);return computeMissingVector(e,Cartesian3.equalsEpsilon(i,Cartesian3.UNIT_X,CesiumMath.EPSILON6)?Cartesian3.UNIT_Y:Cartesian3.UNIT_X,t)}function checkHalfAxes(e){var t=Matrix3.getColumn(e,0,scratchU),i=Matrix3.getColumn(e,1,scratchV),r=Matrix3.getColumn(e,2,scratchW$1),n=Cartesian3.equals(t,Cartesian3.ZERO),a=Cartesian3.equals(i,Cartesian3.ZERO),o=Cartesian3.equals(r,Cartesian3.ZERO);return(n||a||o)&&(n&&a&&o?(e[0]=CesiumMath.EPSILON7,e[4]=CesiumMath.EPSILON7,e[8]=CesiumMath.EPSILON7):(!n||a||o?n||!a||o?n||a||!o?n?a?o||(i=computeMissingVector(r,t=findOrthogonalVector(r,t),i)):r=computeMissingVector(i,t=findOrthogonalVector(i,t),r):r=computeMissingVector(i=findOrthogonalVector(t,i),t,r):r=computeMissingVector(i,t,r):i=computeMissingVector(t,r,i):t=computeMissingVector(i,r,t),Matrix3.setColumn(e,0,t,e),Matrix3.setColumn(e,1,i,e),Matrix3.setColumn(e,2,r,e))),e}function TileOrientedBoundingBox(e,t){t=checkHalfAxes(t),this._orientedBoundingBox=new OrientedBoundingBox(e,t),this._boundingSphere=BoundingSphere.fromOrientedBoundingBox(this._orientedBoundingBox)}function Cesium3DTile(e,t,i,r){this._tileset=e;var n=(this._header=i).content;this.parent=r,this.transform=defined(i.transform)?Matrix4.unpack(i.transform):Matrix4.clone(Matrix4.IDENTITY);var a,o,s,l,u,c,d,h,p=defined(r)?r.computedTransform:e.modelMatrix,f=Matrix4.multiply(p,this.transform,new Matrix4),m=defined(r)?r._initialTransform:Matrix4.IDENTITY;if(this._initialTransform=Matrix4.multiply(m,this.transform,new Matrix4),this.computedTransform=f,this._rectangleRegion=void 0,this._boundingVolume=this.createBoundingVolume(i.boundingVolume,f),this._boundingVolume2D=void 0,defined(n)&&defined(n.boundingVolume),this._contentBoundingVolume=a,this._contentBoundingVolume2D=void 0,defined(i.viewerRequestVolume)&&(o=this.createBoundingVolume(i.viewerRequestVolume,f)),this._viewerRequestVolume=o,this.geometricError=i.geometricError,this._geometricError=i.geometricError,defined(this._geometricError)||(this._geometricError=defined(r)?r.geometricError:e._geometricError,Cesium3DTile._deprecationWarning("geometricErrorUndefined","Required property geometricError is undefined for this tile. Using parent's geometric error instead.")),this.updateGeometricErrorScale(),s=defined(i.refine)?("replace"!==i.refine&&"add"!==i.refine||Cesium3DTile._deprecationWarning("lowercase-refine",'This tile uses a lowercase refine "'+i.refine+'". Instead use "'+i.refine.toUpperCase()+'".'),"REPLACE"===i.refine.toUpperCase()?Cesium3DTileRefine$1.REPLACE:Cesium3DTileRefine$1.ADD):defined(r)?r.refine:Cesium3DTileRefine$1.REPLACE,this.refine=s,this.children=[],t=Resource.createIfNeeded(t,!0),defined(n)){var g=n.uri;defined(n.url)&&(Cesium3DTile._deprecationWarning("contentUrl",'This tileset JSON uses the "content.url" property which has been deprecated. Use "content.uri" instead.'),g=n.url),u=!1,c=Cesium3DTileContentState$1.UNLOADED,d=t.getDerivedResource({url:g,tilesetType:!0}),h=RequestScheduler.getServerKey(d.getUrlComponent())}else l=new Empty3DTileContent(e,this),u=!0,c=Cesium3DTileContentState$1.READY;this._content=l,this._contentResource=d,this._contentState=c,this._contentReadyToProcessPromise=void 0,this._contentReadyPromise=void 0,this._expiredContent=void 0,this._serverKey=h,this.hasEmptyContent=u,this.hasTilesetContent=!1,this.cacheNode=void 0;var y,v,_=i.expire;defined(_)&&(y=_.duration,defined(_.date)&&(v=JulianDate.fromIso8601(_.date))),this.expireDuration=y,this.expireDate=v,this.lastStyleTime=0,this._optimChildrenWithinParent=Cesium3DTileOptimizationHint$1.NOT_COMPUTED,this.clippingPlanesDirty=!1,this.priorityDeferred=!1,this._distanceToCamera=0,this._centerZDepth=0,this._screenSpaceError=0,this._screenSpaceErrorProgressiveResolution=0,this._visibilityPlaneMask=0,this._visible=!1,this._inRequestVolume=!1,this._finalResolution=!0,this._depth=0,this._stackLength=0,this._selectionDepth=0,this._updatedVisibilityFrame=0,this._touchedFrame=0,this._visitedFrame=0,this._selectedFrame=0,this._requestedFrame=0,this._ancestorWithContent=void 0,this._ancestorWithContentAvailable=void 0,this._refines=!1,this._shouldSelect=!1,this._isClipped=!0,this._clippingPlanesState=0,this._debugBoundingVolume=void 0,this._debugContentBoundingVolume=void 0,this._debugViewerRequestVolume=void 0,this._debugColor=Color.fromRandom({alpha:1}),this._debugColorizeTiles=!1,this._priority=0,(this._priorityHolder=this)._priorityProgressiveResolution=!1,this._priorityProgressiveResolutionScreenSpaceErrorLeaf=!1,this._priorityReverseScreenSpaceError=0,this._foveatedFactor=0,this._wasMinPriorityChild=!1,this._loadTimestamp=new JulianDate,this._commandsLength=0,this._color=void 0,this._colorDirty=!1,this._request=void 0}Object.defineProperties(TileOrientedBoundingBox.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}}),TileOrientedBoundingBox.prototype.distanceToCamera=function(e){return Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC))},TileOrientedBoundingBox.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)},TileOrientedBoundingBox.prototype.update=function(e,t){Cartesian3.clone(e,this._orientedBoundingBox.center),t=checkHalfAxes(t),Matrix3.clone(t,this._orientedBoundingBox.halfAxes),BoundingSphere.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere)},TileOrientedBoundingBox.prototype.createDebugVolume=function(e){return new Primitive({geometryInstances:new GeometryInstance({geometry:new BoxOutlineGeometry({minimum:new Cartesian3(-1,-1,-1),maximum:new Cartesian3(1,1,1)}),id:"outline",modelMatrix:Matrix4.fromRotationTranslation(this.boundingVolume.halfAxes,this.boundingVolume.center),attributes:{color:ColorGeometryInstanceAttribute.fromColor(e)}}),appearance:new PerInstanceColorAppearance({translucent:!1,flat:!0}),asynchronous:!1})},Cesium3DTile._deprecationWarning=deprecationWarning,Object.defineProperties(Cesium3DTile.prototype,{tileset:{get:function(){return this._tileset}},content:{get:function(){return this._content}},boundingVolume:{get:function(){return this._boundingVolume}},contentBoundingVolume:{get:function(){return defaultValue(this._contentBoundingVolume,this._boundingVolume)}},boundingSphere:{get:function(){return this._boundingVolume.boundingSphere}},extras:{get:function(){return this._header.extras}},color:{get:function(){return defined(this._color)||(this._color=new Color),Color.clone(this._color)},set:function(e){this._color=Color.clone(e,this._color),this._colorDirty=!0}},contentAvailable:{get:function(){return this.contentReady&&!this.hasEmptyContent&&!this.hasTilesetContent||defined(this._expiredContent)&&!this.contentFailed}},contentReady:{get:function(){return this._contentState===Cesium3DTileContentState$1.READY}},contentUnloaded:{get:function(){return this._contentState===Cesium3DTileContentState$1.UNLOADED}},contentExpired:{get:function(){return this._contentState===Cesium3DTileContentState$1.EXPIRED}},contentFailed:{get:function(){return this._contentState===Cesium3DTileContentState$1.FAILED}},contentReadyToProcessPromise:{get:function(){if(defined(this._contentReadyToProcessPromise))return this._contentReadyToProcessPromise.promise}},contentReadyPromise:{get:function(){if(defined(this._contentReadyPromise))return this._contentReadyPromise.promise}},commandsLength:{get:function(){return this._commandsLength}}});var scratchCartesian$6=new Cartesian3;function isPriorityDeferred(e,t){var i=e._tileset,r=t.camera,n=e.boundingSphere,a=n.radius,o=Cartesian3.multiplyByScalar(r.directionWC,e._centerZDepth,scratchCartesian$6),s=Cartesian3.add(r.positionWC,o,scratchCartesian$6),l=Cartesian3.subtract(s,n.center,scratchCartesian$6);if(a<Cartesian3.magnitude(l)){var u=Cartesian3.normalize(l,scratchCartesian$6),c=Cartesian3.multiplyByScalar(u,a,scratchCartesian$6),d=Cartesian3.add(n.center,c,scratchCartesian$6),h=Cartesian3.subtract(d,r.positionWC,scratchCartesian$6),p=Cartesian3.normalize(h,scratchCartesian$6);e._foveatedFactor=1-Math.abs(Cartesian3.dot(r.directionWC,p))}else e._foveatedFactor=0;var f=e.refine===Cesium3DTileRefine$1.REPLACE,m=i._skipLevelOfDetail;if(f&&!m||!i.foveatedScreenSpaceError||1===i.foveatedConeSize||e._priorityProgressiveResolution&&f&&m||i._pass===Cesium3DTilePass$1.PRELOAD_FLIGHT||i._pass===Cesium3DTilePass$1.PRELOAD)return!1;var g=1-Math.cos(.5*r.frustum.fov),y=i.foveatedConeSize*g;if(e._foveatedFactor<=y)return!1;var v=g-y,_=CesiumMath.clamp((e._foveatedFactor-y)/v,0,1),C=i.foveatedInterpolationCallback(i.foveatedMinimumScreenSpaceErrorRelaxation,i.maximumScreenSpaceError,_),x=0===e._screenSpaceError&&defined(e.parent)?.5*e.parent._screenSpaceError:e._screenSpaceError;return i.maximumScreenSpaceError-C<=x}var scratchJulianDate$1=new JulianDate;function isPriorityProgressiveResolution(e,t){if(e.progressiveResolutionHeightFraction<=0||.5<e.progressiveResolutionHeightFraction)return!1;var i=t._screenSpaceErrorProgressiveResolution>e._maximumScreenSpaceError;t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!1;var r=t.parent,n=e._maximumScreenSpaceError,a=t._screenSpaceErrorProgressiveResolution<=n,o=defined(r)&&r._screenSpaceErrorProgressiveResolution>n;return a&&o&&(i=t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!0),i}function getPriorityReverseScreenSpaceError(e,t){var i=t.parent,r=defined(i)&&(!e._skipLevelOfDetail||0===t._screenSpaceError||i.hasTilesetContent)?i._screenSpaceError:t._screenSpaceError;return e.root._screenSpaceError-r}function updateExpireDate(e){if(defined(e.expireDuration)){var t=JulianDate.now(scratchJulianDate$1);JulianDate.addSeconds(t,e.expireDuration,t),defined(e.expireDate)?JulianDate.lessThan(e.expireDate,t)&&JulianDate.clone(t,e.expireDate):e.expireDate=JulianDate.clone(t)}}function getContentFailedFunction(t,i){return function(e){t._contentState===Cesium3DTileContentState$1.PROCESSING?--i.statistics.numberOfTilesProcessing:--i.statistics.numberOfPendingRequests,t._contentState=Cesium3DTileContentState$1.FAILED,t._contentReadyPromise.reject(e),t._contentReadyToProcessPromise.reject(e)}}function createPriorityFunction(e){return function(){return e._priority}}Cesium3DTile.prototype.getScreenSpaceError=function(e,t,i){var r=this._tileset,n=defaultValue(i,1),a=defined(this.parent)?this.parent.geometricError:r._geometricError,o=t?a:this.geometricError;if(0===o)return 0;var s,l=e.camera,u=l.frustum,c=e.context,d=c.drawingBufferWidth,h=c.drawingBufferHeight*n;if(e.mode===SceneMode$1.SCENE2D||u instanceof OrthographicFrustum){defined(u._offCenterFrustum)&&(u=u._offCenterFrustum),s=o/(Math.max(u.top-u.bottom,u.right-u.left)/Math.max(d,h))}else{var p=Math.max(this._distanceToCamera,CesiumMath.EPSILON7);if(s=o*h/(p*l.frustum.sseDenominator),r.dynamicScreenSpaceError){var f=r._dynamicScreenSpaceErrorComputedDensity,m=r.dynamicScreenSpaceErrorFactor;s-=CesiumMath.fog(p,f)*m}}return s/=e.pixelRatio},Cesium3DTile.prototype.updateVisibility=function(e){var t=this.parent,i=this._tileset,r=defined(t)?t.computedTransform:i.modelMatrix,n=defined(t)?t._visibilityPlaneMask:CullingVolume.MASK_INDETERMINATE;this.updateTransform(r),this._distanceToCamera=this.distanceToTile(e),this._centerZDepth=this.distanceToTileCenter(e),this._screenSpaceError=this.getScreenSpaceError(e,!1),this._screenSpaceErrorProgressiveResolution=this.getScreenSpaceError(e,!1,i.progressiveResolutionHeightFraction),this._visibilityPlaneMask=this.visibility(e,n),this._visible=this._visibilityPlaneMask!==CullingVolume.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(e),this._priorityReverseScreenSpaceError=getPriorityReverseScreenSpaceError(i,this),this._priorityProgressiveResolution=isPriorityProgressiveResolution(i,this),this.priorityDeferred=isPriorityDeferred(this,e)},Cesium3DTile.prototype.updateExpiration=function(){if(defined(this.expireDate)&&this.contentReady&&!this.hasEmptyContent){var e=JulianDate.now(scratchJulianDate$1);JulianDate.lessThan(this.expireDate,e)&&(this._contentState=Cesium3DTileContentState$1.EXPIRED,this._expiredContent=this._content)}},Cesium3DTile.prototype.requestContent=function(){var n=this,a=this._tileset;if(this.hasEmptyContent)return!1;var e=this._contentResource.clone(),o=this.contentExpired;o&&e.setQueryParameters({expired:this.expireDate.toString()});var t=new Request({throttle:!0,throttleByServer:!0,type:RequestType$1.TILES3D,priorityFunction:createPriorityFunction(this),serverKey:this._serverKey});this._request=t,e.request=t;var i=e.fetchArrayBuffer();if(!defined(i))return!1;var r=this._contentState;this._contentState=Cesium3DTileContentState$1.LOADING,this._contentReadyToProcessPromise=when.defer(),this._contentReadyPromise=when.defer();var s=getContentFailedFunction(this,a);return i.then(function(e){if(!n.isDestroyed()){var t,i=getMagic(new Uint8Array(e)),r=Cesium3DTileContentFactory[i];return a._disableSkipLevelOfDetail=a._disableSkipLevelOfDetail||"vctr"===i||"geom"===i,defined(r)?t=r(a,n,n._contentResource,e,0):(t=Cesium3DTileContentFactory.json(a,n,n._contentResource,e,0),n.hasTilesetContent=!0),o&&(n.expireDate=void 0),n._content=t,n._contentState=Cesium3DTileContentState$1.PROCESSING,n._contentReadyToProcessPromise.resolve(t),t.readyPromise.then(function(e){n.isDestroyed()?s():(updateExpireDate(n),n._selectedFrame=0,n.lastStyleTime=0,JulianDate.now(n._loadTimestamp),n._contentState=Cesium3DTileContentState$1.READY,n._contentReadyPromise.resolve(e))})}s()}).otherwise(function(e){if(t.state===RequestState$1.CANCELLED)return n._contentState=r,--a.statistics.numberOfPendingRequests,void++a.statistics.numberOfAttemptedRequests;s(e)}),!0},Cesium3DTile.prototype.unloadContent=function(){this.hasEmptyContent||this.hasTilesetContent||(this._content=this._content&&this._content.destroy(),this._contentState=Cesium3DTileContentState$1.UNLOADED,this._contentReadyToProcessPromise=void 0,this._contentReadyPromise=void 0,this.lastStyleTime=0,this.clippingPlanesDirty=0===this._clippingPlanesState,this._clippingPlanesState=0,this._debugColorizeTiles=!1,this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy())};var scratchProjectedBoundingSphere=new BoundingSphere;function getBoundingVolume(e,t){if(t.mode!==SceneMode$1.SCENE3D&&!defined(e._boundingVolume2D)){var i=e._boundingVolume.boundingSphere,r=BoundingSphere.projectTo2D(i,t.mapProjection,scratchProjectedBoundingSphere);e._boundingVolume2D=new TileBoundingSphere(r.center,r.radius)}return t.mode!==SceneMode$1.SCENE3D?e._boundingVolume2D:e._boundingVolume}function getContentBoundingVolume(e,t){if(t.mode!==SceneMode$1.SCENE3D&&!defined(e._contentBoundingVolume2D)){var i=e._contentBoundingVolume.boundingSphere,r=BoundingSphere.projectTo2D(i,t.mapProjection,scratchProjectedBoundingSphere);e._contentBoundingVolume2D=new TileBoundingSphere(r.center,r.radius)}return t.mode!==SceneMode$1.SCENE3D?e._contentBoundingVolume2D:e._contentBoundingVolume}Cesium3DTile.prototype.visibility=function(e,t){var i=e.cullingVolume,r=getBoundingVolume(this,e),n=this._tileset,a=n.clippingPlanes;if(defined(a)&&a.enabled){var o=a.computeIntersectionWithBoundingVolume(r,n.clippingPlanesOriginMatrix);if(this._isClipped=o!==Intersect$1.INSIDE,o===Intersect$1.OUTSIDE)return CullingVolume.MASK_OUTSIDE}return i.computeVisibilityWithPlaneMask(r,t)},Cesium3DTile.prototype.contentVisibility=function(e){if(!defined(this._contentBoundingVolume))return Intersect$1.INSIDE;if(this._visibilityPlaneMask===CullingVolume.MASK_INSIDE)return Intersect$1.INSIDE;var t=e.cullingVolume,i=getContentBoundingVolume(this,e),r=this._tileset,n=r.clippingPlanes;if(defined(n)&&n.enabled){var a=n.computeIntersectionWithBoundingVolume(i,r.clippingPlanesOriginMatrix);if(this._isClipped=a!==Intersect$1.INSIDE,a===Intersect$1.OUTSIDE)return Intersect$1.OUTSIDE}return t.computeVisibility(i)},Cesium3DTile.prototype.distanceToTile=function(e){return getBoundingVolume(this,e).distanceToCamera(e)};var scratchToTileCenter=new Cartesian3;Cesium3DTile.prototype.distanceToTileCenter=function(e){var t=getBoundingVolume(this,e).boundingVolume,i=Cartesian3.subtract(t.center,e.camera.positionWC,scratchToTileCenter);return Cartesian3.dot(e.camera.directionWC,i)},Cesium3DTile.prototype.insideViewerRequestVolume=function(e){var t=this._viewerRequestVolume;return!defined(t)||0===t.distanceToCamera(e)};var scratchMatrix$6=new Matrix3,scratchScale$a=new Cartesian3,scratchHalfAxes=new Matrix3,scratchCenter$7=new Cartesian3,scratchRectangle$2=new Rectangle,scratchOrientedBoundingBox=new OrientedBoundingBox,scratchTransform=new Matrix4;function createBox(e,t,i){var r=Cartesian3.fromElements(e[0],e[1],e[2],scratchCenter$7),n=Matrix3.fromArray(e,3,scratchHalfAxes);r=Matrix4.multiplyByPoint(t,r,r);var a=Matrix4.getMatrix3(t,scratchMatrix$6);return n=Matrix3.multiply(a,n,n),defined(i)?(i.update(r,n),i):new TileOrientedBoundingBox(r,n)}function createBoxFromTransformedRegion(e,t,i,r){var n=Rectangle.unpack(e,0,scratchRectangle$2),a=e[4],o=e[5],s=OrientedBoundingBox.fromRectangle(n,a,o,Ellipsoid.WGS84,scratchOrientedBoundingBox),l=s.center,u=s.halfAxes;t=Matrix4.multiplyTransformation(t,Matrix4.inverseTransformation(i,scratchTransform),scratchTransform),l=Matrix4.multiplyByPoint(t,l,l);var c=Matrix4.getMatrix3(t,scratchMatrix$6);return u=Matrix3.multiply(c,u,u),defined(r)&&r instanceof TileOrientedBoundingBox?(r.update(l,u),r):new TileOrientedBoundingBox(l,u)}function createRegion(e,t,i,r){return Matrix4.equalsEpsilon(t,i,CesiumMath.EPSILON8)?defined(r)?r:new TileBoundingRegion({rectangle:Rectangle.unpack(e,0,scratchRectangle$2),minimumHeight:e[4],maximumHeight:e[5]}):createBoxFromTransformedRegion(e,t,i,r)}function createSphere(e,t,i){var r=Cartesian3.fromElements(e[0],e[1],e[2],scratchCenter$7),n=e[3];r=Matrix4.multiplyByPoint(t,r,r);var a=Matrix4.getScale(t,scratchScale$a);return n*=Cartesian3.maximumComponent(a),defined(i)?(i.update(r,n),i):new TileBoundingSphere(r,n)}function applyDebugSettings$4(e,t,i,r){if(r.isRender){var n=defined(e._header.content)&&defined(e._header.content.boundingVolume),a=e.hasEmptyContent||e.hasTilesetContent,o=t.debugShowBoundingVolume||t.debugShowContentBoundingVolume&&!n;if(o){var s;s=e._finalResolution?a?Color.DARKGRAY:Color.WHITE:Color.YELLOW,defined(e._debugBoundingVolume)||(e._debugBoundingVolume=e._boundingVolume.createDebugVolume(s)),e._debugBoundingVolume.update(i);var l=e._debugBoundingVolume.getGeometryInstanceAttributes("outline");l.color=ColorGeometryInstanceAttribute.toValue(s,l.color)}else!o&&defined(e._debugBoundingVolume)&&(e._debugBoundingVolume=e._debugBoundingVolume.destroy());t.debugShowContentBoundingVolume&&n?(defined(e._debugContentBoundingVolume)||(e._debugContentBoundingVolume=e._contentBoundingVolume.createDebugVolume(Color.BLUE)),e._debugContentBoundingVolume.update(i)):!t.debugShowContentBoundingVolume&&defined(e._debugContentBoundingVolume)&&(e._debugContentBoundingVolume=e._debugContentBoundingVolume.destroy()),t.debugShowViewerRequestVolume&&defined(e._viewerRequestVolume)?(defined(e._debugViewerRequestVolume)||(e._debugViewerRequestVolume=e._viewerRequestVolume.createDebugVolume(Color.YELLOW)),e._debugViewerRequestVolume.update(i)):!t.debugShowViewerRequestVolume&&defined(e._debugViewerRequestVolume)&&(e._debugViewerRequestVolume=e._debugViewerRequestVolume.destroy());var u=t.debugColorizeTiles&&!e._debugColorizeTiles||defined(t._heatmap.tilePropertyName),c=!t.debugColorizeTiles&&e._debugColorizeTiles;u?(t._heatmap.colorize(e,i),e._debugColorizeTiles=!0,e.color=e._debugColor):c&&(e._debugColorizeTiles=!1,e.color=Color.WHITE),e._colorDirty&&(e._colorDirty=!1,e._content.applyDebugSettings(!0,e._color)),c&&t.makeStyleDirty()}}function updateContent(e,t,i){var r=e._content,n=e._expiredContent;if(defined(n)){if(!e.contentReady)return void n.update(t,i);e._expiredContent.destroy(),e._expiredContent=void 0}r.update(t,i)}function updateClippingPlanes$1(e,t){var i=t.clippingPlanes,r=0;defined(i)&&e._isClipped&&i.enabled&&(r=i.clippingPlanesState),r!==e._clippingPlanesState&&(e._clippingPlanesState=r,e.clippingPlanesDirty=!0)}Cesium3DTile.prototype.createBoundingVolume=function(e,t,i){if(!defined(e))throw new RuntimeError("boundingVolume must be defined");if(defined(e.box))return createBox(e.box,t,i);if(defined(e.region))return createRegion(e.region,t,this._initialTransform,i);if(defined(e.sphere))return createSphere(e.sphere,t,i);throw new RuntimeError("boundingVolume must contain a sphere, region, or box")},Cesium3DTile.prototype.updateTransform=function(e){e=defaultValue(e,Matrix4.IDENTITY);var t=Matrix4.multiply(e,this.transform,scratchTransform);if(!Matrix4.equals(t,this.computedTransform)){Matrix4.clone(t,this.computedTransform);var i=this._header,r=this._header.content;this._boundingVolume=this.createBoundingVolume(i.boundingVolume,this.computedTransform,this._boundingVolume),defined(this._contentBoundingVolume)&&(this._contentBoundingVolume=this.createBoundingVolume(r.boundingVolume,this.computedTransform,this._contentBoundingVolume)),defined(this._viewerRequestVolume)&&(this._viewerRequestVolume=this.createBoundingVolume(i.viewerRequestVolume,this.computedTransform,this._viewerRequestVolume)),this.updateGeometricErrorScale(),this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy()}},Cesium3DTile.prototype.updateGeometricErrorScale=function(){var e=Matrix4.getScale(this.computedTransform,scratchScale$a),t=Cartesian3.maximumComponent(e);this.geometricError=this._geometricError*t},Cesium3DTile.prototype.update=function(e,t,i){var r=t.commandList.length;updateClippingPlanes$1(this,e),applyDebugSettings$4(this,e,t,i),updateContent(this,e,t),this._commandsLength=t.commandList.length-r,this.clippingPlanesDirty=!1};var scratchCommandList=[];function isolateDigits(e,t,i){var r=e*Math.pow(10,t);return parseInt(r)*Math.pow(10,i)}function priorityNormalizeAndClamp(e,t,i){return Math.max(CesiumMath.normalize(e,t,i)-CesiumMath.EPSILON7,0)}Cesium3DTile.prototype.process=function(e,t){var i=t.commandList;t.commandList=scratchCommandList,this._content.update(e,t),scratchCommandList.length=0,t.commandList=i},Cesium3DTile.prototype.updatePriority=function(){var e=this.tileset,t=e.preferLeaves,i=e._minimumPriority,r=e._maximumPriority,n=Math.pow(10,8),a=Math.pow(10,9),o=Math.pow(10,10),s=priorityNormalizeAndClamp(this._depth,i.depth,r.depth);s=t?1-s:s;var l=isolateDigits(!e._skipLevelOfDetail&&this.refine===Cesium3DTileRefine$1.REPLACE?priorityNormalizeAndClamp(this._priorityHolder._distanceToCamera,i.distance,r.distance):priorityNormalizeAndClamp(this._priorityReverseScreenSpaceError,i.reverseScreenSpaceError,r.reverseScreenSpaceError),4,0),u=this._priorityProgressiveResolution?0:n,c=isolateDigits(priorityNormalizeAndClamp(this._priorityHolder._foveatedFactor,i.foveatedFactor,r.foveatedFactor),4,4),d=this.priorityDeferred?a:0,h=e._pass===Cesium3DTilePass$1.PRELOAD_FLIGHT?0:o;this._priority=s+l+u+c+d+h},Cesium3DTile.prototype.isDestroyed=function(){return!1},Cesium3DTile.prototype.destroy=function(){return this._content=this._content&&this._content.destroy(),this._expiredContent=this._expiredContent&&!this._expiredContent.isDestroyed()&&this._expiredContent.destroy(),this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy(),destroyObject(this)};var Cesium3DTileOptimizations={},scratchAxis=new Cartesian3;function Cesium3DTilesetCache(){this._list=new DoublyLinkedList,this._sentinel=this._list.add(),this._trimTiles=!1}function Cesium3DTilesetHeatmap(e){this.tilePropertyName=e,this._minimum=Number.MAX_VALUE,this._maximum=-Number.MAX_VALUE,this._previousMinimum=Number.MAX_VALUE,this._previousMaximum=-Number.MAX_VALUE,this._referenceMinimum={},this._referenceMaximum={}}function getHeatmapValue(e,t){return"_loadTimestamp"===t?JulianDate.toDate(e).getTime():e}function getHeatmapValueAndUpdateMinimumMaximum(e,t){var i=e.tilePropertyName;if(defined(i)){var r=getHeatmapValue(t[i],i);return defined(r)?(e._maximum=Math.max(r,e._maximum),e._minimum=Math.min(r,e._minimum)):e.tilePropertyName=void 0,r}}Cesium3DTileOptimizations.checkChildrenWithinParent=function(e){var t=e.children,i=t.length,r=e.boundingVolume;if(r instanceof TileOrientedBoundingBox||r instanceof TileBoundingRegion){var n=r._orientedBoundingBox;e._optimChildrenWithinParent=Cesium3DTileOptimizationHint$1.USE_OPTIMIZATION;for(var a=0;a<i;++a){var o=t[a].boundingVolume;if(!(o instanceof TileOrientedBoundingBox||o instanceof TileBoundingRegion)){e._optimChildrenWithinParent=Cesium3DTileOptimizationHint$1.SKIP_OPTIMIZATION;break}var s=o._orientedBoundingBox,l=Cartesian3.subtract(s.center,n.center,scratchAxis),u=Cartesian3.magnitude(l);if(Cartesian3.divideByScalar(l,u,l),Math.abs(n.halfAxes[0]*l.x)+Math.abs(n.halfAxes[1]*l.y)+Math.abs(n.halfAxes[2]*l.z)+Math.abs(n.halfAxes[3]*l.x)+Math.abs(n.halfAxes[4]*l.y)+Math.abs(n.halfAxes[5]*l.z)+Math.abs(n.halfAxes[6]*l.x)+Math.abs(n.halfAxes[7]*l.y)+Math.abs(n.halfAxes[8]*l.z)<=Math.abs(s.halfAxes[0]*l.x)+Math.abs(s.halfAxes[1]*l.y)+Math.abs(s.halfAxes[2]*l.z)+Math.abs(s.halfAxes[3]*l.x)+Math.abs(s.halfAxes[4]*l.y)+Math.abs(s.halfAxes[5]*l.z)+Math.abs(s.halfAxes[6]*l.x)+Math.abs(s.halfAxes[7]*l.y)+Math.abs(s.halfAxes[8]*l.z)+u){e._optimChildrenWithinParent=Cesium3DTileOptimizationHint$1.SKIP_OPTIMIZATION;break}}}return e._optimChildrenWithinParent===Cesium3DTileOptimizationHint$1.USE_OPTIMIZATION},Cesium3DTilesetCache.prototype.reset=function(){this._list.splice(this._list.tail,this._sentinel)},Cesium3DTilesetCache.prototype.touch=function(e){var t=e.cacheNode;defined(t)&&this._list.splice(this._sentinel,t)},Cesium3DTilesetCache.prototype.add=function(e){defined(e.cacheNode)||(e.cacheNode=this._list.add(e))},Cesium3DTilesetCache.prototype.unloadTile=function(e,t,i){var r=t.cacheNode;defined(r)&&(this._list.remove(r),t.cacheNode=void 0,i(e,t))},Cesium3DTilesetCache.prototype.unloadTiles=function(e,t){var i=this._trimTiles;this._trimTiles=!1;for(var r=this._list,n=1024*e.maximumMemoryUsage*1024,a=this._sentinel,o=r.head;o!==a&&(e.totalMemoryUsageInBytes>n||i);){var s=o.item;o=o.next,this.unloadTile(e,s,t)}},Cesium3DTilesetCache.prototype.trim=function(){this._trimTiles=!0},Cesium3DTilesetHeatmap.prototype.setReferenceMinimumMaximum=function(e,t,i){this._referenceMinimum[i]=getHeatmapValue(e,i),this._referenceMaximum[i]=getHeatmapValue(t,i)};var heatmapColors=[new Color(.1,.1,.1,1),new Color(.153,.278,.878,1),new Color(.827,.231,.49,1),new Color(.827,.188,.22,1),new Color(1,.592,.259,1),new Color(1,.843,0,1)];function Cesium3DTilesetStatistics(){this.selected=0,this.visited=0,this.numberOfCommands=0,this.numberOfAttemptedRequests=0,this.numberOfPendingRequests=0,this.numberOfTilesProcessing=0,this.numberOfTilesWithContentReady=0,this.numberOfTilesTotal=0,this.numberOfLoadedTilesTotal=0,this.numberOfFeaturesSelected=0,this.numberOfFeaturesLoaded=0,this.numberOfPointsSelected=0,this.numberOfPointsLoaded=0,this.numberOfTrianglesSelected=0,this.numberOfTilesStyled=0,this.numberOfFeaturesStyled=0,this.numberOfTilesCulledWithChildrenUnion=0,this.geometryByteLength=0,this.texturesByteLength=0,this.batchTableByteLength=0}function updatePointAndFeatureCounts(e,t,i,r){var n=t.innerContents,a=t.pointsLength,o=t.trianglesLength,s=t.featuresLength,l=t.geometryByteLength,u=t.texturesByteLength,c=t.batchTableByteLength;if(r?(e.numberOfFeaturesLoaded+=i?-s:s,e.numberOfPointsLoaded+=i?-a:a,e.geometryByteLength+=i?-l:l,e.texturesByteLength+=i?-u:u,e.batchTableByteLength+=i?-c:c):(e.numberOfFeaturesSelected+=i?-s:s,e.numberOfPointsSelected+=i?-a:a,e.numberOfTrianglesSelected+=i?-o:o),defined(n))for(var d=n.length,h=0;h<d;++h)updatePointAndFeatureCounts(e,n[h],i,r)}function Cesium3DTileStyleEngine(){this._style=void 0,this._styleDirty=!1,this._lastStyleTime=0}function Cesium3DTileset(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this._url=void 0,this._basePath=void 0,this._root=void 0,this._asset=void 0,this._properties=void 0,this._geometricError=void 0,this._extensionsUsed=void 0,this._gltfUpAxis=void 0,this._cache=new Cesium3DTilesetCache,this._processingQueue=[],this._selectedTiles=[],this._emptyTiles=[],this._requestedTiles=[],this._selectedTilesToStyle=[],this._loadTimestamp=void 0,this._timeSinceLoad=0,this._updatedVisibilityFrame=0,this._updatedModelMatrixFrame=0,this._modelMatrixChanged=!1,this._previousModelMatrix=void 0,this._extras=void 0,this._credits=void 0,this._cullWithChildrenBounds=defaultValue(e.cullWithChildrenBounds,!0),this._allTilesAdditive=!0,this._hasMixedContent=!1,this._stencilClearCommand=void 0,this._backfaceCommands=new ManagedArray,this._maximumScreenSpaceError=defaultValue(e.maximumScreenSpaceError,16),this._maximumMemoryUsage=defaultValue(e.maximumMemoryUsage,512),this._styleEngine=new Cesium3DTileStyleEngine,this._modelMatrix=defined(e.modelMatrix)?Matrix4.clone(e.modelMatrix):Matrix4.clone(Matrix4.IDENTITY),this._statistics=new Cesium3DTilesetStatistics,this._statisticsLast=new Cesium3DTilesetStatistics,this._statisticsPerPass=new Array(Cesium3DTilePass$1.NUMBER_OF_PASSES);for(var t=0;t<Cesium3DTilePass$1.NUMBER_OF_PASSES;++t)this._statisticsPerPass[t]=new Cesium3DTilesetStatistics;this._requestedTilesInFlight=[],this._maximumPriority={foveatedFactor:-Number.MAX_VALUE,depth:-Number.MAX_VALUE,distance:-Number.MAX_VALUE,reverseScreenSpaceError:-Number.MAX_VALUE},this._minimumPriority={foveatedFactor:Number.MAX_VALUE,depth:Number.MAX_VALUE,distance:Number.MAX_VALUE,reverseScreenSpaceError:Number.MAX_VALUE},this._heatmap=new Cesium3DTilesetHeatmap(e.debugHeatmapTilePropertyName),this.cullRequestsWhileMoving=defaultValue(e.cullRequestsWhileMoving,!0),this._cullRequestsWhileMoving=!1,this.cullRequestsWhileMovingMultiplier=defaultValue(e.cullRequestsWhileMovingMultiplier,60),this.progressiveResolutionHeightFraction=CesiumMath.clamp(defaultValue(e.progressiveResolutionHeightFraction,.3),0,.5),this.preferLeaves=defaultValue(e.preferLeaves,!1),this._tilesLoaded=!1,this._initialTilesLoaded=!1,this._tileDebugLabels=void 0,this._readyPromise=when.defer(),this._classificationType=e.classificationType,this._ellipsoid=defaultValue(e.ellipsoid,Ellipsoid.WGS84),this._initialClippingPlanesOriginMatrix=Matrix4.IDENTITY,this._clippingPlanesOriginMatrix=void 0,this._clippingPlanesOriginMatrixDirty=!0,this.preloadWhenHidden=defaultValue(e.preloadWhenHidden,!1),this.preloadFlightDestinations=defaultValue(e.preloadFlightDestinations,!0),this._pass=void 0,this.dynamicScreenSpaceError=defaultValue(e.dynamicScreenSpaceError,!1),this.foveatedScreenSpaceError=defaultValue(e.foveatedScreenSpaceError,!0),this._foveatedConeSize=defaultValue(e.foveatedConeSize,.1),this._foveatedMinimumScreenSpaceErrorRelaxation=defaultValue(e.foveatedMinimumScreenSpaceErrorRelaxation,0),this.foveatedInterpolationCallback=defaultValue(e.foveatedInterpolationCallback,CesiumMath.lerp),this.foveatedTimeDelay=defaultValue(e.foveatedTimeDelay,.2),this.dynamicScreenSpaceErrorDensity=.00278,this.dynamicScreenSpaceErrorFactor=4,this.dynamicScreenSpaceErrorHeightFalloff=.25,this._dynamicScreenSpaceErrorComputedDensity=0,this.shadows=defaultValue(e.shadows,ShadowMode$1.ENABLED),this.show=defaultValue(e.show,!0),this.colorBlendMode=Cesium3DTileColorBlendMode$1.HIGHLIGHT,this.colorBlendAmount=.5,this.pointCloudShading=new PointCloudShading(e.pointCloudShading),this._pointCloudEyeDomeLighting=new PointCloudEyeDomeLighting,this.loadProgress=new Event,this.allTilesLoaded=new Event,this.initialTilesLoaded=new Event,this.tileLoad=new Event,this.tileUnload=new Event,this.tileFailed=new Event,this.tileVisible=new Event,this.skipLevelOfDetail=defaultValue(e.skipLevelOfDetail,!1),this._skipLevelOfDetail=this.skipLevelOfDetail,this._disableSkipLevelOfDetail=!1,this.baseScreenSpaceError=defaultValue(e.baseScreenSpaceError,1024),this.skipScreenSpaceErrorFactor=defaultValue(e.skipScreenSpaceErrorFactor,16),this.skipLevels=defaultValue(e.skipLevels,1),this.immediatelyLoadDesiredLevelOfDetail=defaultValue(e.immediatelyLoadDesiredLevelOfDetail,!1),this.loadSiblings=defaultValue(e.loadSiblings,!1),this._clippingPlanes=void 0,this.clippingPlanes=e.clippingPlanes,this._imageBasedLightingFactor=new Cartesian2(1,1),Cartesian2.clone(e.imageBasedLightingFactor,this._imageBasedLightingFactor),this.lightColor=e.lightColor,this.luminanceAtZenith=defaultValue(e.luminanceAtZenith,.2),this.sphericalHarmonicCoefficients=e.sphericalHarmonicCoefficients,this.specularEnvironmentMaps=e.specularEnvironmentMaps,this.backFaceCulling=defaultValue(e.backFaceCulling,!0),this.debugFreezeFrame=defaultValue(e.debugFreezeFrame,!1),this.debugColorizeTiles=defaultValue(e.debugColorizeTiles,!1),this.debugWireframe=defaultValue(e.debugWireframe,!1),this.debugShowBoundingVolume=defaultValue(e.debugShowBoundingVolume,!1),this.debugShowContentBoundingVolume=defaultValue(e.debugShowContentBoundingVolume,!1),this.debugShowViewerRequestVolume=defaultValue(e.debugShowViewerRequestVolume,!1),this._tileDebugLabels=void 0,this.debugPickedTileLabelOnly=!1,this.debugPickedTile=void 0,this.debugPickPosition=void 0,this.debugShowGeometricError=defaultValue(e.debugShowGeometricError,!1),this.debugShowRenderingStatistics=defaultValue(e.debugShowRenderingStatistics,!1),this.debugShowMemoryUsage=defaultValue(e.debugShowMemoryUsage,!1),this.debugShowUrl=defaultValue(e.debugShowUrl,!1);var c,d=this;when(e.url).then(function(e){var t;return c=Resource.createIfNeeded(e,!0),d._credits=c.credits,"json"===c.extension?t=c.getBaseUri(!0):c.isDataUri&&(t=""),d._url=c.url,d._basePath=t,Cesium3DTileset.loadJson(c)}).then(function(e){d._root=d.loadTileset(c,e);var t=defined(e.asset.gltfUpAxis)?Axis$1.fromName(e.asset.gltfUpAxis):Axis$1.Y,i=e.asset;d._asset=i,d._properties=e.properties,d._geometricError=e.geometricError,d._extensionsUsed=e.extensionsUsed,d._gltfUpAxis=t,d._extras=e.extras;var r=i.extras;if(defined(r)&&defined(r.cesium)&&defined(r.cesium.credits)){var n=r.cesium.credits,a=d._credits;defined(a)||(a=[],d._credits=a);for(var o=0;o<n.length;++o){var s=n[o];a.push(new Credit(s.html,s.showOnScreen))}}var l=d._root.createBoundingVolume(e.root.boundingVolume,Matrix4.IDENTITY).boundingSphere.center,u=d._ellipsoid.cartesianToCartographic(l);defined(u)&&u.height>ApproximateTerrainHeights._defaultMinTerrainHeight&&(d._initialClippingPlanesOriginMatrix=Transforms.eastNorthUpToFixedFrame(l)),d._clippingPlanesOriginMatrix=Matrix4.clone(d._initialClippingPlanesOriginMatrix),d._readyPromise.resolve(d)}).otherwise(function(e){d._readyPromise.reject(e)})}Cesium3DTilesetHeatmap.prototype.colorize=function(e,t){if(defined(this.tilePropertyName)&&e.contentAvailable&&e._selectedFrame===t.frameNumber){var i=getHeatmapValueAndUpdateMinimumMaximum(this,e),r=this._previousMinimum,n=this._previousMaximum;if(r!==Number.MAX_VALUE&&n!==-Number.MAX_VALUE){var a=n-r+CesiumMath.EPSILON7,o=CesiumMath.clamp(i-r,0,a)/a*(heatmapColors.length-1),s=Math.floor(o),l=Math.ceil(o),u=o-s,c=heatmapColors[s],d=heatmapColors[l],h=Color.clone(Color.WHITE);h.red=CesiumMath.lerp(c.red,d.red,u),h.green=CesiumMath.lerp(c.green,d.green,u),h.blue=CesiumMath.lerp(c.blue,d.blue,u),e._debugColor=h}}},Cesium3DTilesetHeatmap.prototype.resetMinimumMaximum=function(){var e=this.tilePropertyName;if(defined(e)){var t=this._referenceMinimum[e],i=this._referenceMaximum[e],r=defined(t)&&defined(i);this._previousMinimum=r?t:this._minimum,this._previousMaximum=r?i:this._maximum,this._minimum=Number.MAX_VALUE,this._maximum=-Number.MAX_VALUE}},Cesium3DTilesetStatistics.prototype.clear=function(){this.selected=0,this.visited=0,this.numberOfCommands=0,this.numberOfAttemptedRequests=0,this.numberOfFeaturesSelected=0,this.numberOfPointsSelected=0,this.numberOfTrianglesSelected=0,this.numberOfTilesStyled=0,this.numberOfFeaturesStyled=0,this.numberOfTilesCulledWithChildrenUnion=0},Cesium3DTilesetStatistics.prototype.incrementSelectionCounts=function(e){updatePointAndFeatureCounts(this,e,!1,!1)},Cesium3DTilesetStatistics.prototype.incrementLoadCounts=function(e){updatePointAndFeatureCounts(this,e,!1,!0)},Cesium3DTilesetStatistics.prototype.decrementLoadCounts=function(e){updatePointAndFeatureCounts(this,e,!0,!0)},Cesium3DTilesetStatistics.clone=function(e,t){t.selected=e.selected,t.visited=e.visited,t.numberOfCommands=e.numberOfCommands,t.selected=e.selected,t.numberOfAttemptedRequests=e.numberOfAttemptedRequests,t.numberOfPendingRequests=e.numberOfPendingRequests,t.numberOfTilesProcessing=e.numberOfTilesProcessing,t.numberOfTilesWithContentReady=e.numberOfTilesWithContentReady,t.numberOfTilesTotal=e.numberOfTilesTotal,t.numberOfFeaturesSelected=e.numberOfFeaturesSelected,t.numberOfFeaturesLoaded=e.numberOfFeaturesLoaded,t.numberOfPointsSelected=e.numberOfPointsSelected,t.numberOfPointsLoaded=e.numberOfPointsLoaded,t.numberOfTrianglesSelected=e.numberOfTrianglesSelected,t.numberOfTilesStyled=e.numberOfTilesStyled,t.numberOfFeaturesStyled=e.numberOfFeaturesStyled,t.numberOfTilesCulledWithChildrenUnion=e.numberOfTilesCulledWithChildrenUnion,t.geometryByteLength=e.geometryByteLength,t.texturesByteLength=e.texturesByteLength,t.batchTableByteLength=e.batchTableByteLength},Object.defineProperties(Cesium3DTileStyleEngine.prototype,{style:{get:function(){return this._style},set:function(e){this._style=e,this._styleDirty=!0}}}),Cesium3DTileStyleEngine.prototype.makeDirty=function(){this._styleDirty=!0},Cesium3DTileStyleEngine.prototype.applyStyle=function(e,t){if(e.ready&&(!defined(this._style)||this._style.ready)){var i=this._styleDirty;t.isRender&&(this._styleDirty=!1),i&&++this._lastStyleTime;for(var r=this._lastStyleTime,n=e._statistics,a=i?e._selectedTiles:e._selectedTilesToStyle,o=a.length,s=0;s<o;++s){var l=a[s];if(l.lastStyleTime!==r){var u=l.content;l.lastStyleTime=r,u.applyStyle(this._style),n.numberOfFeaturesStyled+=u.featuresLength,++n.numberOfTilesStyled}}}},Object.defineProperties(Cesium3DTileset.prototype,{isCesium3DTileset:{get:function(){return!0}},asset:{get:function(){return this._asset}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){ClippingPlaneCollection.setOwner(e,this,"_clippingPlanes")}},properties:{get:function(){return this._properties}},ready:{get:function(){return defined(this._root)}},readyPromise:{get:function(){return this._readyPromise.promise}},tilesLoaded:{get:function(){return this._tilesLoaded}},url:{get:function(){return this._url}},basePath:{get:function(){return deprecationWarning("Cesium3DTileset.basePath","Cesium3DTileset.basePath has been deprecated. All tiles are relative to the url of the tileset JSON file that contains them. Use the url property instead."),this._basePath}},style:{get:function(){return this._styleEngine.style},set:function(e){this._styleEngine.style=e}},maximumScreenSpaceError:{get:function(){return this._maximumScreenSpaceError},set:function(e){this._maximumScreenSpaceError=e}},maximumMemoryUsage:{get:function(){return this._maximumMemoryUsage},set:function(e){this._maximumMemoryUsage=e}},root:{get:function(){return this._root}},boundingSphere:{get:function(){return this._root.updateTransform(this._modelMatrix),this._root.boundingSphere}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=Matrix4.clone(e,this._modelMatrix)}},timeSinceLoad:{get:function(){return this._timeSinceLoad}},totalMemoryUsageInBytes:{get:function(){var e=this._statistics;return e.texturesByteLength+e.geometryByteLength+e.batchTableByteLength}},clippingPlanesOriginMatrix:{get:function(){return defined(this._clippingPlanesOriginMatrix)?(this._clippingPlanesOriginMatrixDirty&&(Matrix4.multiply(this.root.computedTransform,this._initialClippingPlanesOriginMatrix,this._clippingPlanesOriginMatrix),this._clippingPlanesOriginMatrixDirty=!1),this._clippingPlanesOriginMatrix):Matrix4.IDENTITY}},styleEngine:{get:function(){return this._styleEngine}},statistics:{get:function(){return this._statistics}},classificationType:{get:function(){return this._classificationType}},ellipsoid:{get:function(){return this._ellipsoid}},foveatedConeSize:{get:function(){return this._foveatedConeSize},set:function(e){this._foveatedConeSize=e}},foveatedMinimumScreenSpaceErrorRelaxation:{get:function(){return this._foveatedMinimumScreenSpaceErrorRelaxation},set:function(e){this._foveatedMinimumScreenSpaceErrorRelaxation=e}},extras:{get:function(){return this._extras}},imageBasedLightingFactor:{get:function(){return this._imageBasedLightingFactor},set:function(e){Cartesian2.clone(e,this._imageBasedLightingFactor)}}}),Cesium3DTileset.loadJson=function(e){return Resource.createIfNeeded(e,!0).fetchJson()},Cesium3DTileset.prototype.makeStyleDirty=function(){this._styleEngine.makeDirty()},Cesium3DTileset.prototype.loadTileset=function(e,t,i){var r=t.asset;if(!defined(r))throw new RuntimeError("Tileset must have an asset property.");if("0.0"!==r.version&&"1.0"!==r.version)throw new RuntimeError("The tileset must be 3D Tiles version 0.0 or 1.0.");var n=this._statistics,a=r.tilesetVersion;defined(a)&&(this._basePath+="?v="+a,e.setQueryParameters({v:a}));var o=new Cesium3DTile(this,e,t.root,i);defined(i)&&(i.children.push(o),o._depth=i._depth+1);var s=[];for(s.push(o);0<s.length;){var l=s.pop();++n.numberOfTilesTotal,this._allTilesAdditive=this._allTilesAdditive&&l.refine===Cesium3DTileRefine$1.ADD;var u=l._header.children;if(defined(u))for(var c=u.length,d=0;d<c;++d){var h=new Cesium3DTile(this,e,u[d],l);l.children.push(h),h._depth=l._depth+1,s.push(h)}this._cullWithChildrenBounds&&Cesium3DTileOptimizations.checkChildrenWithinParent(l)}return o};var scratchPositionNormal=new Cartesian3,scratchCartographic$c=new Cartographic,scratchMatrix$7=new Matrix4,scratchCenter$8=new Cartesian3,scratchPosition$a=new Cartesian3,scratchDirection$2=new Cartesian3;function updateDynamicScreenSpaceError(e,t){var i,r,n,a,o,s=t.camera,l=e._root,u=l.contentBoundingVolume;if(u instanceof TileBoundingRegion)i=Cartesian3.normalize(s.positionWC,scratchPositionNormal),r=s.directionWC,n=s.positionCartographic.height,a=u.minimumHeight,o=u.maximumHeight;else{var c=Matrix4.inverseTransformation(l.computedTransform,scratchMatrix$7),d=t.mapProjection.ellipsoid,h=u.boundingVolume,p=Matrix4.multiplyByPoint(c,h.center,scratchCenter$8);if(Cartesian3.magnitude(p)>d.minimumRadius){var f=Cartographic.fromCartesian(p,d,scratchCartographic$c);i=Cartesian3.normalize(s.positionWC,scratchPositionNormal),r=s.directionWC,n=s.positionCartographic.height,a=0,o=2*f.height}else{var m=Matrix4.multiplyByPoint(c,s.positionWC,scratchPosition$a);if(i=Cartesian3.UNIT_Z,r=Matrix4.multiplyByPointAsVector(c,s.directionWC,scratchDirection$2),r=Cartesian3.normalize(r,r),n=m.z,u instanceof TileOrientedBoundingBox){var g=l._header.boundingVolume.box[11];a=p.z-g,o=p.z+g}else if(u instanceof TileBoundingSphere){var y=h.radius;a=p.z-y,o=p.z+y}}}var v=a+(o-a)*e.dynamicScreenSpaceErrorHeightFalloff,_=o,C=CesiumMath.clamp((n-v)/(_-v),0,1),x=1-Math.abs(Cartesian3.dot(r,i));x*=1-C;var b=e.dynamicScreenSpaceErrorDensity;b*=x,e._dynamicScreenSpaceErrorComputedDensity=b}function requestContent(e,t){if(!t.hasEmptyContent){var i=e._statistics,r=t.contentExpired;t.requestContent()?(r&&(t.hasTilesetContent?destroySubtree(e,t):(i.decrementLoadCounts(t.content),--i.numberOfTilesWithContentReady)),++i.numberOfPendingRequests,e._requestedTilesInFlight.push(t),t.contentReadyToProcessPromise.then(addToProcessingQueue(e,t)),t.contentReadyPromise.then(handleTileSuccess(e,t)).otherwise(handleTileFailure(e,t))):++i.numberOfAttemptedRequests}}function sortRequestByPriority(e,t){return e._priority-t._priority}function cancelOutOfViewRequests(e,t){for(var i=e._requestedTilesInFlight,r=0,n=i.length,a=0;a<n;++a){var o=i[a],s=1<=t.frameNumber-o._touchedFrame;o._contentState===Cesium3DTileContentState$1.LOADING?s?(o._request.cancel(),++r):0<r&&(i[a-r]=o):++r}i.length-=r}function requestTiles(e,t){var i=e._requestedTiles,r=i.length;i.sort(sortRequestByPriority);for(var n=0;n<r;++n)requestContent(e,i[n])}function addToProcessingQueue(e,t){return function(){e._processingQueue.push(t),--e._statistics.numberOfPendingRequests,++e._statistics.numberOfTilesProcessing}}function handleTileFailure(r,n){return function(e){var t=n._contentResource.url,i=defined(e.message)?e.message:e.toString();0<r.tileFailed.numberOfListeners?r.tileFailed.raiseEvent({url:t,message:i}):(console.log("A 3D tile failed to load: "+t),console.log("Error: "+i))}}function handleTileSuccess(e,t){return function(){--e._statistics.numberOfTilesProcessing,t.hasTilesetContent||(e._statistics.incrementLoadCounts(t.content),++e._statistics.numberOfTilesWithContentReady,++e._statistics.numberOfLoadedTilesTotal,e._cache.add(t)),e.tileLoad.raiseEvent(t)}}function filterProcessingQueue(e){for(var t=e._processingQueue,i=t.length,r=0,n=0;n<i;++n){var a=t[n];a._contentState===Cesium3DTileContentState$1.PROCESSING?0<r&&(t[n-r]=a):++r}t.length-=r}function processTiles(e,t){filterProcessingQueue(e);for(var i=e._processingQueue,r=i.length,n=0;n<r;++n)i[n].process(e,t)}Cesium3DTileset.prototype.postPassesUpdate=function(e){this.ready&&(cancelOutOfViewRequests(this,e),raiseLoadProgressEvent(this,e),this._cache.unloadTiles(this,unloadTile))},Cesium3DTileset.prototype.prePassesUpdate=function(e){if(this.ready){processTiles(this,e);var t=this._clippingPlanes;this._clippingPlanesOriginMatrixDirty=!0,defined(t)&&t.enabled&&t.update(e),defined(this._loadTimestamp)||(this._loadTimestamp=JulianDate.clone(e.time)),this._timeSinceLoad=Math.max(1e3*JulianDate.secondsDifference(e.time,this._loadTimestamp),0),this._skipLevelOfDetail=this.skipLevelOfDetail&&!defined(this._classificationType)&&!this._disableSkipLevelOfDetail&&!this._allTilesAdditive,this.dynamicScreenSpaceError&&updateDynamicScreenSpaceError(this,e),e.newFrame&&this._cache.reset()}};var scratchCartesian$7=new Cartesian3,stringOptions={maximumFractionDigits:3};function formatMemoryString(e){var t=e/1048576;return t<1?t.toLocaleString(void 0,stringOptions):Math.round(t).toLocaleString()}function computeTileLabelPosition(e){var t=e.boundingVolume.boundingVolume,i=t.halfAxes,r=t.radius,n=Cartesian3.clone(t.center,scratchCartesian$7);if(defined(i))n.x+=.75*(i[0]+i[3]+i[6]),n.y+=.75*(i[1]+i[4]+i[7]),n.z+=.75*(i[2]+i[5]+i[8]);else if(defined(r)){var a=Cartesian3.normalize(t.center,scratchCartesian$7);a=Cartesian3.multiplyByScalar(a,.75*r,scratchCartesian$7),n=Cartesian3.add(a,t.center,scratchCartesian$7)}return n}function addTileDebugLabel(e,t,i){var r="",n=0;t.debugShowGeometricError&&(r+="\nGeometric error: "+e.geometricError,n++),t.debugShowRenderingStatistics&&(r+="\nCommands: "+e.commandsLength,n++,0<e.content.pointsLength&&(r+="\nPoints: "+e.content.pointsLength,n++),0<e.content.trianglesLength&&(r+="\nTriangles: "+e.content.trianglesLength,n++),r+="\nFeatures: "+e.content.featuresLength,n++);if(t.debugShowMemoryUsage&&(r+="\nTexture Memory: "+formatMemoryString(e.content.texturesByteLength),r+="\nGeometry Memory: "+formatMemoryString(e.content.geometryByteLength),n+=2),t.debugShowUrl){var a=e._header.content.uri;defined(a)||(a=e._header.content.url),r+="\nUrl: "+a,n++}var o={text:r.substring(1),position:i,font:19-n+"px sans-serif",showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY};return t._tileDebugLabels.add(o)}function updateTileDebugLabels(e,t){var i,r,n=e._selectedTiles,a=n.length,o=e._emptyTiles,s=o.length;if(e._tileDebugLabels.removeAll(),e.debugPickedTileLabelOnly){if(defined(e.debugPickedTile)){var l=defined(e.debugPickPosition)?e.debugPickPosition:computeTileLabelPosition(e.debugPickedTile);addTileDebugLabel(e.debugPickedTile,e,l).pixelOffset=new Cartesian2(15,-15)}}else{for(i=0;i<a;++i)addTileDebugLabel(r=n[i],e,computeTileLabelPosition(r));for(i=0;i<s;++i)(r=o[i]).hasTilesetContent&&addTileDebugLabel(r,e,computeTileLabelPosition(r))}e._tileDebugLabels.update(t)}function updateTiles(e,t,i){e._styleEngine.applyStyle(e,i);var r,n,a=i.isRender,o=e._statistics,s=t.commandList,l=s.length,u=e._selectedTiles,c=u.length,d=e._emptyTiles,h=d.length,p=e.tileVisible,f=e._skipLevelOfDetail&&e._hasMixedContent&&t.context.stencilBuffer&&0<c;e._backfaceCommands.length=0,f&&(defined(e._stencilClearCommand)||(e._stencilClearCommand=new ClearCommand({stencil:0,pass:Pass$1.CESIUM_3D_TILE,renderState:RenderState.fromCache({stencilMask:StencilConstants$1.SKIP_LOD_MASK})})),s.push(e._stencilClearCommand));var m=s.length;for(r=0;r<c;++r)n=u[r],a&&p.raiseEvent(n),n.update(e,t,i),o.incrementSelectionCounts(n.content),++o.selected;for(r=0;r<h;++r)(n=d[r]).update(e,t,i);var g=s.length-m;if(e._backfaceCommands.trim(),f){var y=e._backfaceCommands.values,v=y.length;for(s.length+=v,r=g-1;0<=r;--r)s[m+v+r]=s[m+r];for(r=0;r<v;++r)s[m+r]=y[r]}g=s.length-l,o.numberOfCommands=g,a&&e.pointCloudShading.attenuation&&e.pointCloudShading.eyeDomeLighting&&0<g&&e._pointCloudEyeDomeLighting.update(t,l,e.pointCloudShading,e.boundingSphere),a&&(e.debugShowGeometricError||e.debugShowRenderingStatistics||e.debugShowMemoryUsage||e.debugShowUrl?(defined(e._tileDebugLabels)||(e._tileDebugLabels=new LabelCollection),updateTileDebugLabels(e,t)):e._tileDebugLabels=e._tileDebugLabels&&e._tileDebugLabels.destroy())}var scratchStack$1=[];function destroySubtree(e,t){var i=t,r=scratchStack$1;for(r.push(t);0<r.length;){for(var n=(t=r.pop()).children,a=n.length,o=0;o<a;++o)r.push(n[o]);t!==i&&(destroyTile(e,t),--e._statistics.numberOfTilesTotal)}i.children=[]}function unloadTile(e,t){e.tileUnload.raiseEvent(t),e._statistics.decrementLoadCounts(t.content),--e._statistics.numberOfTilesWithContentReady,t.unloadContent()}function destroyTile(e,t){e._cache.unloadTile(e,t,unloadTile),t.destroy()}function raiseLoadProgressEvent(e,t){var i=e._statistics,r=e._statisticsLast,n=i.numberOfPendingRequests,a=i.numberOfTilesProcessing,o=r.numberOfPendingRequests,s=r.numberOfTilesProcessing;Cesium3DTilesetStatistics.clone(i,r);var l=n!==o||a!==s;l&&t.afterRender.push(function(){e.loadProgress.raiseEvent(n,a)}),e._tilesLoaded=0===i.numberOfPendingRequests&&0===i.numberOfTilesProcessing&&0===i.numberOfAttemptedRequests,l&&e._tilesLoaded&&(t.afterRender.push(function(){e.allTilesLoaded.raiseEvent()}),e._initialTilesLoaded||(e._initialTilesLoaded=!0,t.afterRender.push(function(){e.initialTilesLoaded.raiseEvent()})))}function resetMinimumMaximum(e){e._heatmap.resetMinimumMaximum(),e._minimumPriority.depth=Number.MAX_VALUE,e._maximumPriority.depth=-Number.MAX_VALUE,e._minimumPriority.foveatedFactor=Number.MAX_VALUE,e._maximumPriority.foveatedFactor=-Number.MAX_VALUE,e._minimumPriority.distance=Number.MAX_VALUE,e._maximumPriority.distance=-Number.MAX_VALUE,e._minimumPriority.reverseScreenSpaceError=Number.MAX_VALUE,e._maximumPriority.reverseScreenSpaceError=-Number.MAX_VALUE}function detectModelMatrixChanged(e,t){t.frameNumber===e._updatedModelMatrixFrame&&defined(e._previousModelMatrix)||(e._updatedModelMatrixFrame=t.frameNumber,e._modelMatrixChanged=!Matrix4.equals(e.modelMatrix,e._previousModelMatrix),e._previousModelMatrix=Matrix4.clone(e.modelMatrix,e._previousModelMatrix))}function update$4(e,t,i,r){if(t.mode===SceneMode$1.MORPHING)return!1;if(!e.ready)return!1;var n=e._statistics;n.clear();var a=r.isRender;++e._updatedVisibilityFrame,resetMinimumMaximum(e),detectModelMatrixChanged(e,t),e._cullRequestsWhileMoving=e.cullRequestsWhileMoving&&!e._modelMatrixChanged;var o=r.traversal.selectTiles(e,t);if(r.requestTiles&&requestTiles(e),updateTiles(e,t,r),Cesium3DTilesetStatistics.clone(n,i),a){var s=e._credits;if(defined(s)&&0!==n.selected)for(var l=s.length,u=0;u<l;++u)t.creditDisplay.addCredit(s[u])}return o}Cesium3DTileset.prototype.trimLoadedTiles=function(){this._cache.trim()},Cesium3DTileset.prototype.update=function(e){this.updateForPass(e,e.tilesetPassState)},Cesium3DTileset.prototype.updateForPass=function(e,t){var i=t.pass;if((i!==Cesium3DTilePass$1.PRELOAD||this.preloadWhenHidden&&!this.show)&&(i!==Cesium3DTilePass$1.PRELOAD_FLIGHT||this.preloadFlightDestinations&&(this.show||this.preloadWhenHidden))&&(i!==Cesium3DTilePass$1.REQUEST_RENDER_MODE_DEFER_CHECK||!(!this._cullRequestsWhileMoving&&this.foveatedTimeDelay<=0||!this.show))){var r=e.commandList,n=e.camera,a=e.cullingVolume;t.ready=!1;var o=Cesium3DTilePass$1.getPassOptions(i),s=o.ignoreCommands,l=defaultValue(t.commandList,r),u=l.length;e.commandList=l,e.camera=defaultValue(t.camera,n),e.cullingVolume=defaultValue(t.cullingVolume,a);var c=this._statisticsPerPass[i];(this.show||s)&&(this._pass=i,t.ready=update$4(this,e,c,o)),s&&(l.length=u),e.commandList=r,e.camera=n,e.cullingVolume=a}},Cesium3DTileset.prototype.hasExtension=function(e){return!!defined(this._extensionsUsed)&&-1<this._extensionsUsed.indexOf(e)},Cesium3DTileset.prototype.isDestroyed=function(){return!1},Cesium3DTileset.prototype.destroy=function(){if(this._tileDebugLabels=this._tileDebugLabels&&this._tileDebugLabels.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),defined(this._root)){var e=scratchStack$1;for(e.push(this._root);0<e.length;){var t=e.pop();t.destroy();for(var i=t.children,r=i.length,n=0;n<r;++n)e.push(i[n])}}return this._root=void 0,destroyObject(this)};var modelMatrixScratch=new Matrix4;function Cesium3DTilesetVisualizer(e,t){t.collectionChanged.addEventListener(Cesium3DTilesetVisualizer.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._tilesetHash={},this._entitiesToVisualize=new AssociativeArray,this._onCollectionChanged(t,t.values,[],[])}function removeTileset(e,t,i,r){var n=i[t.id];defined(n)&&(r.removeAndDestroy(n.tilesetPrimitive),delete i[t.id])}function checkLoad(e,t,i){e.readyPromise.otherwise(function(e){console.error(e),i[t.id].loadFail=!0})}Cesium3DTilesetVisualizer.prototype.update=function(e){for(var t=this._entitiesToVisualize.values,i=this._tilesetHash,r=this._primitives,n=0,a=t.length;n<a;n++){var o,s,l=t[n],u=l._tileset,c=i[l.id],d=l.isShowing&&l.isAvailable(e)&&Property.getValueOrDefault(u._show,e,!0);if(d&&(s=l.computeModelMatrix(e,modelMatrixScratch),o=Resource.createIfNeeded(Property.getValueOrUndefined(u._uri,e))),d){var h=defined(c)?c.tilesetPrimitive:void 0;defined(h)&&o.url===c.url||(defined(h)&&(r.removeAndDestroy(h),delete i[l.id]),(h=new Cesium3DTileset({url:o})).id=l,r.add(h),c={tilesetPrimitive:h,url:o.url,loadFail:!1},i[l.id]=c,checkLoad(h,l,i)),h.show=!0,defined(s)&&(h.modelMatrix=s),h.maximumScreenSpaceError=Property.getValueOrDefault(u.maximumScreenSpaceError,e,h.maximumScreenSpaceError)}else defined(c)&&(c.tilesetPrimitive.show=!1)}return!0},Cesium3DTilesetVisualizer.prototype.isDestroyed=function(){return!1},Cesium3DTilesetVisualizer.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Cesium3DTilesetVisualizer.prototype._onCollectionChanged,this);for(var e=this._entitiesToVisualize.values,t=this._tilesetHash,i=this._primitives,r=e.length-1;-1<r;r--)removeTileset(this,e[r],t,i);return destroyObject(this)},Cesium3DTilesetVisualizer.prototype.getBoundingSphere=function(e,t){var i=this._tilesetHash[e.id];if(!defined(i)||i.loadFail)return BoundingSphereState$1.FAILED;var r=i.tilesetPrimitive;return defined(r)&&r.show?r.ready?(BoundingSphere.clone(r.boundingSphere,t),BoundingSphereState$1.DONE):BoundingSphereState$1.PENDING:BoundingSphereState$1.FAILED},Cesium3DTilesetVisualizer.prototype._onCollectionChanged=function(e,t,i,r){var n,a,o=this._entitiesToVisualize,s=this._tilesetHash,l=this._primitives;for(n=t.length-1;-1<n;n--)defined((a=t[n])._tileset)&&o.set(a.id,a);for(n=r.length-1;-1<n;n--)defined((a=r[n])._tileset)?o.set(a.id,a):(removeTileset(this,a,s,l),o.remove(a.id));for(n=i.length-1;-1<n;n--)removeTileset(this,a=i[n],s,l),o.remove(a.id)};var defaultEvenColor=Color.WHITE,defaultOddColor=Color.BLACK,defaultRepeat$1=new Cartesian2(2,2);function CheckerboardMaterialProperty(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this._definitionChanged=new Event,this._evenColor=void 0,this._evenColorSubscription=void 0,this._oddColor=void 0,this._oddColorSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this.evenColor=e.evenColor,this.oddColor=e.oddColor,this.repeat=e.repeat}Object.defineProperties(CheckerboardMaterialProperty.prototype,{isConstant:{get:function(){return Property.isConstant(this._evenColor)&&Property.isConstant(this._oddColor)&&Property.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},evenColor:createPropertyDescriptor("evenColor"),oddColor:createPropertyDescriptor("oddColor"),repeat:createPropertyDescriptor("repeat")}),CheckerboardMaterialProperty.prototype.getType=function(e){return"Checkerboard"},CheckerboardMaterialProperty.prototype.getValue=function(e,t){return defined(t)||(t={}),t.lightColor=Property.getValueOrClonedDefault(this._evenColor,e,defaultEvenColor,t.lightColor),t.darkColor=Property.getValueOrClonedDefault(this._oddColor,e,defaultOddColor,t.darkColor),t.repeat=Property.getValueOrDefault(this._repeat,e,defaultRepeat$1),t},CheckerboardMaterialProperty.prototype.equals=function(e){return this===e||e instanceof CheckerboardMaterialProperty&&Property.equals(this._evenColor,e._evenColor)&&Property.equals(this._oddColor,e._oddColor)&&Property.equals(this._repeat,e._repeat)};var entityOptionsScratch$1={id:void 0},entityIdScratch=new Array(2);function clean(e){for(var t=e.propertyNames,i=t.length,r=0;r<i;r++)e[t[r]]=void 0;e._name=void 0,e._availability=void 0}function subscribeToEntity(e,t,i,r){entityIdScratch[0]=i,entityIdScratch[1]=r.id,t[JSON.stringify(entityIdScratch)]=r.definitionChanged.addEventListener(CompositeEntityCollection.prototype._onDefinitionChanged,e)}function unsubscribeFromEntity(e,t,i,r){entityIdScratch[0]=i,entityIdScratch[1]=r.id;var n=JSON.stringify(entityIdScratch);t[n](),t[n]=void 0}function recomposite(e){if(e._shouldRecomposite=!0,0===e._suspendCount){var t,i,r,n,a,o,s=e._collections,l=s.length,u=e._collectionsCopy,c=u.length,d=e._composite,h=new EntityCollection(e),p=e._eventHash;for(t=0;t<c;t++)for((a=u[t]).collectionChanged.removeEventListener(CompositeEntityCollection.prototype._onCollectionChanged,e),r=a.values,o=a.id,n=r.length-1;-1<n;n--)unsubscribeFromEntity(e,p,o,i=r[n]);for(t=l-1;0<=t;t--)for((a=s[t]).collectionChanged.addEventListener(CompositeEntityCollection.prototype._onCollectionChanged,e),r=a.values,o=a.id,n=r.length-1;-1<n;n--){subscribeToEntity(e,p,o,i=r[n]);var f=h.getById(i.id);defined(f)||(defined(f=d.getById(i.id))?clean(f):(entityOptionsScratch$1.id=i.id,f=new Entity(entityOptionsScratch$1)),h.add(f)),f.merge(i)}e._collectionsCopy=s.slice(0),d.suspendEvents(),d.removeAll();var m=h.values;for(t=0;t<m.length;t++)d.add(m[t]);d.resumeEvents()}}function CompositeEntityCollection(e,t){this._owner=t,this._composite=new EntityCollection(this),this._suspendCount=0,this._collections=defined(e)?e.slice():[],this._collectionsCopy=[],this._id=createGuid(),this._eventHash={},recomposite(this),this._shouldRecomposite=!1}function getCollectionIndex(e,t){return e.indexOf(t)}function swapCollections(e,t,i){var r=e._collections;if((t=CesiumMath.clamp(t,0,r.length-1))!==(i=CesiumMath.clamp(i,0,r.length-1))){var n=r[t];r[t]=r[i],r[i]=n,recomposite(e)}}function CompositeMaterialProperty(){this._definitionChanged=new Event,this._composite=new CompositeProperty,this._composite.definitionChanged.addEventListener(CompositeMaterialProperty.prototype._raiseDefinitionChanged,this)}Object.defineProperties(CompositeEntityCollection.prototype,{collectionChanged:{get:function(){return this._composite._collectionChanged}},id:{get:function(){return this._id}},values:{get:function(){return this._composite.values}},owner:{get:function(){return this._owner}}}),CompositeEntityCollection.prototype.addCollection=function(e,t){defined(t)?this._collections.splice(t,0,e):(t=this._collections.length,this._collections.push(e)),recomposite(this)},CompositeEntityCollection.prototype.removeCollection=function(e){var t=this._collections.indexOf(e);return-1!==t&&(this._collections.splice(t,1),recomposite(this),!0)},CompositeEntityCollection.prototype.removeAllCollections=function(){this._collections.length=0,recomposite(this)},CompositeEntityCollection.prototype.containsCollection=function(e){return-1!==this._collections.indexOf(e)},CompositeEntityCollection.prototype.contains=function(e){return this._composite.contains(e)},CompositeEntityCollection.prototype.indexOfCollection=function(e){return this._collections.indexOf(e)},CompositeEntityCollection.prototype.getCollection=function(e){return this._collections[e]},CompositeEntityCollection.prototype.getCollectionsLength=function(){return this._collections.length},CompositeEntityCollection.prototype.raiseCollection=function(e){var t=getCollectionIndex(this._collections,e);swapCollections(this,t,t+1)},CompositeEntityCollection.prototype.lowerCollection=function(e){var t=getCollectionIndex(this._collections,e);swapCollections(this,t,t-1)},CompositeEntityCollection.prototype.raiseCollectionToTop=function(e){var t=getCollectionIndex(this._collections,e);t!==this._collections.length-1&&(this._collections.splice(t,1),this._collections.push(e),recomposite(this))},CompositeEntityCollection.prototype.lowerCollectionToBottom=function(e){var t=getCollectionIndex(this._collections,e);0!==t&&(this._collections.splice(t,1),this._collections.splice(0,0,e),recomposite(this))},CompositeEntityCollection.prototype.suspendEvents=function(){this._suspendCount++,this._composite.suspendEvents()},CompositeEntityCollection.prototype.resumeEvents=function(){this._suspendCount--,this._shouldRecomposite&&0===this._suspendCount&&(recomposite(this),this._shouldRecomposite=!1),this._composite.resumeEvents()},CompositeEntityCollection.prototype.computeAvailability=function(){return this._composite.computeAvailability()},CompositeEntityCollection.prototype.getById=function(e){return this._composite.getById(e)},CompositeEntityCollection.prototype._onCollectionChanged=function(e,t,i){var r,n,a,o,s=this._collectionsCopy,l=s.length,u=this._composite;u.suspendEvents();var c=i.length,d=this._eventHash,h=e.id;for(r=0;r<c;r++){var p=i[r];unsubscribeFromEntity(this,d,h,p);var f=p.id;for(n=l-1;0<=n;n--)defined(a=s[n].getById(f))&&(defined(o)||clean(o=u.getById(f)),o.merge(a));defined(o)||u.removeById(f),o=void 0}var m=t.length;for(r=0;r<m;r++){var g=t[r];subscribeToEntity(this,d,h,g);var y=g.id;for(n=l-1;0<=n;n--)defined(a=s[n].getById(y))&&(defined(o)||(defined(o=u.getById(y))?clean(o):(entityOptionsScratch$1.id=y,o=new Entity(entityOptionsScratch$1),u.add(o))),o.merge(a));o=void 0}u.resumeEvents()},CompositeEntityCollection.prototype._onDefinitionChanged=function(e,t,i,r){for(var n=this._collections,a=this._composite,o=n.length,s=e.id,l=a.getById(s),u=l[t],c=!defined(u),d=!0,h=o-1;0<=h;h--){var p=n[h].getById(e.id);if(defined(p)){var f=p[t];if(defined(f)){if(d){if(d=!1,!defined(f.merge)||!defined(f.clone)){u=f;break}u=f.clone(u)}u.merge(f)}}}c&&-1===l.propertyNames.indexOf(t)&&l.addProperty(t),l[t]=u},Object.defineProperties(CompositeMaterialProperty.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite._intervals}}}),CompositeMaterialProperty.prototype.getType=function(e){var t=this._composite._intervals.findDataForIntervalContainingDate(e);if(defined(t))return t.getType(e)},CompositeMaterialProperty.prototype.getValue=function(e,t){var i=this._composite._intervals.findDataForIntervalContainingDate(e);if(defined(i))return i.getValue(e,t)},CompositeMaterialProperty.prototype.equals=function(e){return this===e||e instanceof CompositeMaterialProperty&&this._composite.equals(e._composite,Property.equals)},CompositeMaterialProperty.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var defaultZIndex=new ConstantProperty(0);function GroundGeometryUpdater(e){GeometryUpdater.call(this,e),this._zIndex=0,this._terrainOffsetProperty=void 0}defined(Object.create)&&(GroundGeometryUpdater.prototype=Object.create(GeometryUpdater.prototype),GroundGeometryUpdater.prototype.constructor=GroundGeometryUpdater),Object.defineProperties(GroundGeometryUpdater.prototype,{zIndex:{get:function(){return this._zIndex}},terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}}),GroundGeometryUpdater.prototype._isOnTerrain=function(e,t){return this._fillEnabled&&!defined(t.height)&&!defined(t.extrudedHeight)&&GroundPrimitive.isSupported(this._scene)},GroundGeometryUpdater.prototype._getIsClosed=function(e){var t=e.height,i=e.extrudedHeight;return 0===t||defined(i)&&i!==t},GroundGeometryUpdater.prototype._computeCenter=DeveloperError.throwInstantiationError,GroundGeometryUpdater.prototype._onEntityPropertyChanged=function(e,t,i,r){if(GeometryUpdater.prototype._onEntityPropertyChanged.call(this,e,t,i,r),-1!==this._observedPropertyNames.indexOf(t)){var n=this._entity[this._geometryPropertyName];if(defined(n)){defined(n.zIndex)&&(defined(n.height)||defined(n.extrudedHeight))&&oneTimeWarning(oneTimeWarning.geometryZIndex),this._zIndex=defaultValue(n.zIndex,defaultZIndex),defined(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0);var a=n.heightReference,o=n.extrudedHeightReference;if(defined(a)||defined(o)){var s=new CallbackProperty(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new TerrainOffsetProperty(this._scene,s,a,o)}}}},GroundGeometryUpdater.prototype.destroy=function(){defined(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0),GeometryUpdater.prototype.destroy.call(this)},GroundGeometryUpdater.getGeometryHeight=function(e,t){if(defined(e))return t!==HeightReference$1.CLAMP_TO_GROUND?e:0;t!==HeightReference$1.NONE&&oneTimeWarning(oneTimeWarning.geometryHeightReference)},GroundGeometryUpdater.getGeometryExtrudedHeight=function(e,t){if(defined(e))return t!==HeightReference$1.CLAMP_TO_GROUND?e:GroundGeometryUpdater.CLAMP_TO_GROUND;t!==HeightReference$1.NONE&&oneTimeWarning(oneTimeWarning.geometryExtrudedHeightReference)},GroundGeometryUpdater.CLAMP_TO_GROUND="clamp",GroundGeometryUpdater.computeGeometryOffsetAttribute=function(e,t,i,r){defined(e)&&defined(t)||(t=HeightReference$1.NONE),defined(i)&&defined(r)||(r=HeightReference$1.NONE);var n=0;return t!==HeightReference$1.NONE&&n++,r===HeightReference$1.RELATIVE_TO_GROUND&&n++,2===n?GeometryOffsetAttribute$1.ALL:1===n?GeometryOffsetAttribute$1.TOP:void 0};var scratchColor$b=new Color,defaultOffset$1=Cartesian3.ZERO,offsetScratch$5=new Cartesian3,scratchRectangle$3=new Rectangle;function CorridorGeometryOptions(e){this.id=e,this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.cornerType=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.offsetAttribute=void 0}function CorridorGeometryUpdater(e,t){GroundGeometryUpdater.call(this,{entity:e,scene:t,geometryOptions:new CorridorGeometryOptions(e),geometryPropertyName:"corridor",observedPropertyNames:["availability","corridor"]}),this._onEntityPropertyChanged(e,"corridor",e.corridor,void 0)}function DynamicCorridorGeometryUpdater(e,t,i){DynamicGeometryUpdater.call(this,e,t,i)}defined(Object.create)&&(CorridorGeometryUpdater.prototype=Object.create(GroundGeometryUpdater.prototype),CorridorGeometryUpdater.prototype.constructor=CorridorGeometryUpdater),CorridorGeometryUpdater.prototype.createFillGeometryInstance=function(e){var t,i=this._entity,r=i.isAvailable(e),n={show:new ShowGeometryInstanceAttribute(r&&i.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};this._materialProperty instanceof ColorMaterialProperty&&(defined(this._materialProperty.color)&&(this._materialProperty.color.isConstant||r)&&(t=this._materialProperty.color.getValue(e,scratchColor$b)),defined(t)||(t=Color.WHITE),n.color=ColorGeometryInstanceAttribute.fromColor(t));return defined(this._options.offsetAttribute)&&(n.offset=OffsetGeometryInstanceAttribute.fromCartesian3(Property.getValueOrDefault(this._terrainOffsetProperty,e,defaultOffset$1,offsetScratch$5))),new GeometryInstance({id:i,geometry:new CorridorGeometry(this._options),attributes:n})},CorridorGeometryUpdater.prototype.createOutlineGeometryInstance=function(e){var t=this._entity,i=t.isAvailable(e),r=Property.getValueOrDefault(this._outlineColorProperty,e,Color.BLACK,scratchColor$b),n={show:new ShowGeometryInstanceAttribute(i&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:ColorGeometryInstanceAttribute.fromColor(r),distanceDisplayCondition:DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0};return defined(this._options.offsetAttribute)&&(n.offset=OffsetGeometryInstanceAttribute.fromCartesian3(Property.getValueOrDefault(this._terrainOffsetProperty,e,defaultOffset$1,offsetScratch$5))),new GeometryInstance({id:t,geometry:new CorridorOutlineGeometry(this._options),attributes:n})},CorridorGeometryUpdater.prototype._computeCenter=function(e,t){var i=Property.getValueOrUndefined(this._entity.corridor.positions,e);if(defined(i)&&0!==i.length)return Cartesian3.clone(i[Math.floor(i.length/2)],t)},CorridorGeometryUpdater.prototype._isHidden=function(e,t){return!defined(t.positions)||!defined(t.width)||GeometryUpdater.prototype._isHidden.call(this,e,t)},CorridorGeometryUpdater.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!Property.isConstant(t.height)||!Property.isConstant(t.extrudedHeight)||!Property.isConstant(t.granularity)||!Property.isConstant(t.width)||!Property.isConstant(t.outlineWidth)||!Property.isConstant(t.cornerType)||!Property.isConstant(t.zIndex)||this._onTerrain&&!Property.isConstant(this._materialProperty)&&!(this._materialProperty instanceof ColorMaterialProperty)},CorridorGeometryUpdater.prototype._setStaticOptions=function(e,t){var i=Property.getValueOrUndefined(t.height,Iso8601.MINIMUM_VALUE),r=Property.getValueOrDefault(t.heightReference,Iso8601.MINIMUM_VALUE,HeightReference$1.NONE),n=Property.getValueOrUndefined(t.extrudedHeight,Iso8601.MINIMUM_VALUE),a=Property.getValueOrDefault(t.extrudedHeightReference,Iso8601.MINIMUM_VALUE,HeightReference$1.NONE);defined(n)&&!defined(i)&&(i=0);var o=this._options;o.vertexFormat=this._materialProperty instanceof ColorMaterialProperty?PerInstanceColorAppearance.VERTEX_FORMAT:MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat,o.positions=t.positions.getValue(Iso8601.MINIMUM_VALUE,o.positions),o.width=t.width.getValue(Iso8601.MINIMUM_VALUE),o.granularity=Property.getValueOrUndefined(t.granularity,Iso8601.MINIMUM_VALUE),o.cornerType=Property.getValueOrUndefined(t.cornerType,Iso8601.MINIMUM_VALUE),o.offsetAttribute=GroundGeometryUpdater.computeGeometryOffsetAttribute(i,r,n,a),o.height=GroundGeometryUpdater.getGeometryHeight(i,r),(n=GroundGeometryUpdater.getGeometryExtrudedHeight(n,a))===GroundGeometryUpdater.CLAMP_TO_GROUND&&(n=ApproximateTerrainHeights.getMinimumMaximumHeights(CorridorGeometry.computeRectangle(o,scratchRectangle$3)).minimumTerrainHeight),o.extrudedHeight=n},CorridorGeometryUpdater.DynamicGeometryUpdater=DynamicCorridorGeometryUpdater,defined(Object.create)&&(DynamicCorridorGeometryUpdater.prototype=Object.create(DynamicGeometryUpdater.prototype),DynamicCorridorGeometryUpdater.prototype.constructor=DynamicCorridorGeometryUpdater),DynamicCorridorGeometryUpdater.prototype._isHidden=function(e,t,i){var r=this._options;return!defined(r.positions)||!defined(r.width)||DynamicGeometryUpdater.prototype._isHidden.call(this,e,t,i)},DynamicCorridorGeometryUpdater.prototype._setOptions=function(e,t,i){var r=this._options,n=Property.getValueOrUndefined(t.height,i),a=Property.getValueOrDefault(t.heightReference,i,HeightReference$1.NONE),o=Property.getValueOrUndefined(t.extrudedHeight,i),s=Property.getValueOrDefault(t.extrudedHeightReference,i,HeightReference$1.NONE);defined(o)&&!defined(n)&&(n=0),r.positions=Property.getValueOrUndefined(t.positions,i),r.width=Property.getValueOrUndefined(t.width,i),r.granularity=Property.getValueOrUndefined(t.granularity,i),r.cornerType=Property.getValueOrUndefined(t.cornerType,i),r.offsetAttribute=GroundGeometryUpdater.computeGeometryOffsetAttribute(n,a,o,s),r.height=GroundGeometryUpdater.getGeometryHeight(n,a),(o=GroundGeometryUpdater.getGeometryExtrudedHeight(o,s))===GroundGeometryUpdater.CLAMP_TO_GROUND&&(o=ApproximateTerrainHeights.getMinimumMaximumHeights(CorridorGeometry.computeRectangle(r,scratchRectangle$3)).minimumTerrainHeight),r.extrudedHeight=o};var defaultOffset$2=Cartesian3.ZERO,offsetScratch$6=new Cartesian3,positionScratch$8=new Cartesian3,scratchColor$c=new Color;function CylinderGeometryOptions(e){this.id=e,this.vertexFormat=void 0,this.length=void 0,this.topRadius=void 0,this.bottomRadius=void 0,this.slices=void 0,this.numberOfVerticalLines=void 0,this.offsetAttribute=void 0}function CylinderGeometryUpdater(e,t){GeometryUpdater.call(this,{entity:e,scene:t,geometryOptions:new CylinderGeometryOptions(e),geometryPropertyName:"cylinder",observedPropertyNames:["availability","position","orientation","cylinder"]}),this._onEntityPropertyChanged(e,"cylinder",e.cylinder,void 0)}function DynamicCylinderGeometryUpdater(e,t,i){DynamicGeometryUpdater.call(this,e,t,i)}defined(Object.create)&&(CylinderGeometryUpdater.prototype=Object.create(GeometryUpdater.prototype),CylinderGeometryUpdater.prototype.constructor=CylinderGeometryUpdater),Object.defineProperties(CylinderGeometryUpdater.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}}),CylinderGeometryUpdater.prototype.createFillGeometryInstance=function(e){var t,i=this._entity,r=i.isAvailable(e),n=new ShowGeometryInstanceAttribute(r&&i.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),a=this._distanceDisplayConditionProperty.getValue(e),o={show:n,distanceDisplayCondition:DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(a),color:void 0,offset:void 0};this._materialProperty instanceof ColorMaterialProperty&&(defined(this._materialProperty.color)&&(this._materialProperty.color.isConstant||r)&&(t=this._materialProperty.color.getValue(e,scratchColor$c)),defined(t)||(t=Color.WHITE),o.color=ColorGeometryInstanceAttribute.fromColor(t));return defined(this._options.offsetAttribute)&&(o.offset=OffsetGeometryInstanceAttribute.fromCartesian3(Property.getValueOrDefault(this._terrainOffsetProperty,e,defaultOffset$2,offsetScratch$6))),new GeometryInstance({id:i,geometry:new CylinderGeometry(this._options),modelMatrix:i.computeModelMatrixForHeightReference(e,i.cylinder.heightReference,.5*this._options.length,this._scene.mapProjection.ellipsoid),attributes:o})},CylinderGeometryUpdater.prototype.createOutlineGeometryInstance=function(e){var t=this._entity,i=t.isAvailable(e),r=Property.getValueOrDefault(this._outlineColorProperty,e,Color.BLACK,scratchColor$c),n=this._distanceDisplayConditionProperty.getValue(e),a={show:new ShowGeometryInstanceAttribute(i&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:ColorGeometryInstanceAttribute.fromColor(r),distanceDisplayCondition:DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(n),offset:void 0};return defined(this._options.offsetAttribute)&&(a.offset=OffsetGeometryInstanceAttribute.fromCartesian3(Property.getValueOrDefault(this._terrainOffsetProperty,e,defaultOffset$2,offsetScratch$6))),new GeometryInstance({id:t,geometry:new CylinderOutlineGeometry(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,.5*this._options.length,this._scene.mapProjection.ellipsoid),attributes:a})},CylinderGeometryUpdater.prototype._computeCenter=function(e,t){return Property.getValueOrUndefined(this._entity.position,e,t)},CylinderGeometryUpdater.prototype._isHidden=function(e,t){return!defined(e.position)||!defined(t.length)||!defined(t.topRadius)||!defined(t.bottomRadius)||GeometryUpdater.prototype._isHidden.call(this,e,t)},CylinderGeometryUpdater.prototype._isDynamic=function(e,t){return!(e.position.isConstant&&Property.isConstant(e.orientation)&&t.length.isConstant&&t.topRadius.isConstant&&t.bottomRadius.isConstant&&Property.isConstant(t.slices)&&Property.isConstant(t.outlineWidth)&&Property.isConstant(t.numberOfVerticalLines))},CylinderGeometryUpdater.prototype._setStaticOptions=function(e,t){var i=Property.getValueOrDefault(t.heightReference,Iso8601.MINIMUM_VALUE,HeightReference$1.NONE),r=this._options;r.vertexFormat=this._materialProperty instanceof ColorMaterialProperty?PerInstanceColorAppearance.VERTEX_FORMAT:MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat,r.length=t.length.getValue(Iso8601.MINIMUM_VALUE),r.topRadius=t.topRadius.getValue(Iso8601.MINIMUM_VALUE),r.bottomRadius=t.bottomRadius.getValue(Iso8601.MINIMUM_VALUE),r.slices=Property.getValueOrUndefined(t.slices,Iso8601.MINIMUM_VALUE),r.numberOfVerticalLines=Property.getValueOrUndefined(t.numberOfVerticalLines,Iso8601.MINIMUM_VALUE),r.offsetAttribute=i!==HeightReference$1.NONE?GeometryOffsetAttribute$1.ALL:void 0},CylinderGeometryUpdater.prototype._onEntityPropertyChanged=heightReferenceOnEntityPropertyChanged,CylinderGeometryUpdater.DynamicGeometryUpdater=DynamicCylinderGeometryUpdater,defined(Object.create)&&(DynamicCylinderGeometryUpdater.prototype=Object.create(DynamicGeometryUpdater.prototype),DynamicCylinderGeometryUpdater.prototype.constructor=DynamicCylinderGeometryUpdater),DynamicCylinderGeometryUpdater.prototype._isHidden=function(e,t,i){var r=this._options;return!defined(Property.getValueOrUndefined(e.position,i,positionScratch$8))||!defined(r.length)||!defined(r.topRadius)||!defined(r.bottomRadius)||DynamicGeometryUpdater.prototype._isHidden.call(this,e,t,i)},DynamicCylinderGeometryUpdater.prototype._setOptions=function(e,t,i){var r=Property.getValueOrDefault(t.heightReference,i,HeightReference$1.NONE),n=this._options;n.length=Property.getValueOrUndefined(t.length,i),n.topRadius=Property.getValueOrUndefined(t.topRadius,i),n.bottomRadius=Property.getValueOrUndefined(t.bottomRadius,i),n.slices=Property.getValueOrUndefined(t.slices,i),n.numberOfVerticalLines=Property.getValueOrUndefined(t.numberOfVerticalLines,i),n.offsetAttribute=r!==HeightReference$1.NONE?GeometryOffsetAttribute$1.ALL:void 0};var defaultColor$4=Color.WHITE,defaultCellAlpha=.1,defaultLineCount=new Cartesian2(8,8),defaultLineOffset=new Cartesian2(0,0),defaultLineThickness=new Cartesian2(1,1);function GridMaterialProperty(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this._definitionChanged=new Event,this._color=void 0,this._colorSubscription=void 0,this._cellAlpha=void 0,this._cellAlphaSubscription=void 0,this._lineCount=void 0,this._lineCountSubscription=void 0,this._lineThickness=void 0,this._lineThicknessSubscription=void 0,this._lineOffset=void 0,this._lineOffsetSubscription=void 0,this.color=e.color,this.cellAlpha=e.cellAlpha,this.lineCount=e.lineCount,this.lineThickness=e.lineThickness,this.lineOffset=e.lineOffset}function PolylineArrowMaterialProperty(e){this._definitionChanged=new Event,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(GridMaterialProperty.prototype,{isConstant:{get:function(){return Property.isConstant(this._color)&&Property.isConstant(this._cellAlpha)&&Property.isConstant(this._lineCount)&&Property.isConstant(this._lineThickness)&&Property.isConstant(this._lineOffset)}},definitionChanged:{get:function(){return this._definitionChanged}},color:createPropertyDescriptor("color"),cellAlpha:createPropertyDescriptor("cellAlpha"),lineCount:createPropertyDescriptor("lineCount"),lineThickness:createPropertyDescriptor("lineThickness"),lineOffset:createPropertyDescriptor("lineOffset")}),GridMaterialProperty.prototype.getType=function(e){return"Grid"},GridMaterialProperty.prototype.getValue=function(e,t){return defined(t)||(t={}),t.color=Property.getValueOrClonedDefault(this._color,e,defaultColor$4,t.color),t.cellAlpha=Property.getValueOrDefault(this._cellAlpha,e,defaultCellAlpha),t.lineCount=Property.getValueOrClonedDefault(this._lineCount,e,defaultLineCount,t.lineCount),t.lineThickness=Property.getValueOrClonedDefault(this._lineThickness,e,defaultLineThickness,t.lineThickness),t.lineOffset=Property.getValueOrClonedDefault(this._lineOffset,e,defaultLineOffset,t.lineOffset),t},GridMaterialProperty.prototype.equals=function(e){return this===e||e instanceof GridMaterialProperty&&Property.equals(this._color,e._color)&&Property.equals(this._cellAlpha,e._cellAlpha)&&Property.equals(this._lineCount,e._lineCount)&&Property.equals(this._lineThickness,e._lineThickness)&&Property.equals(this._lineOffset,e._lineOffset)},Object.defineProperties(PolylineArrowMaterialProperty.prototype,{isConstant:{get:function(){return Property.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:createPropertyDescriptor("color")}),PolylineArrowMaterialProperty.prototype.getType=function(e){return"PolylineArrow"},PolylineArrowMaterialProperty.prototype.getValue=function(e,t){return defined(t)||(t={}),t.color=Property.getValueOrClonedDefault(this._color,e,Color.WHITE,t.color),t},PolylineArrowMaterialProperty.prototype.equals=function(e){return this===e||e instanceof PolylineArrowMaterialProperty&&Property.equals(this._color,e._color)};var defaultColor$5=Color.WHITE,defaultGapColor=Color.TRANSPARENT,defaultDashLength=16,defaultDashPattern=255;function PolylineDashMaterialProperty(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this._definitionChanged=new Event,this._color=void 0,this._colorSubscription=void 0,this._gapColor=void 0,this._gapColorSubscription=void 0,this._dashLength=void 0,this._dashLengthSubscription=void 0,this._dashPattern=void 0,this._dashPatternSubscription=void 0,this.color=e.color,this.gapColor=e.gapColor,this.dashLength=e.dashLength,this.dashPattern=e.dashPattern}Object.defineProperties(PolylineDashMaterialProperty.prototype,{isConstant:{get:function(){return Property.isConstant(this._color)&&Property.isConstant(this._gapColor)&&Property.isConstant(this._dashLength)&&Property.isConstant(this._dashPattern)}},definitionChanged:{get:function(){return this._definitionChanged}},color:createPropertyDescriptor("color"),gapColor:createPropertyDescriptor("gapColor"),dashLength:createPropertyDescriptor("dashLength"),dashPattern:createPropertyDescriptor("dashPattern")}),PolylineDashMaterialProperty.prototype.getType=function(e){return"PolylineDash"},PolylineDashMaterialProperty.prototype.getValue=function(e,t){return defined(t)||(t={}),t.color=Property.getValueOrClonedDefault(this._color,e,defaultColor$5,t.color),t.gapColor=Property.getValueOrClonedDefault(this._gapColor,e,defaultGapColor,t.gapColor),t.dashLength=Property.getValueOrDefault(this._dashLength,e,defaultDashLength,t.dashLength),t.dashPattern=Property.getValueOrDefault(this._dashPattern,e,defaultDashPattern,t.dashPattern),t},PolylineDashMaterialProperty.prototype.equals=function(e){return this===e||e instanceof PolylineDashMaterialProperty&&Property.equals(this._color,e._color)&&Property.equals(this._gapColor,e._gapColor)&&Property.equals(this._dashLength,e._dashLength)&&Property.equals(this._dashPattern,e._dashPattern)};var defaultColor$6=Color.WHITE,defaultGlowPower=.25,defaultTaperPower=1;function PolylineGlowMaterialProperty(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this._definitionChanged=new Event,this._color=void 0,this._colorSubscription=void 0,this._glowPower=void 0,this._glowPowerSubscription=void 0,this._taperPower=void 0,this._taperPowerSubscription=void 0,this.color=e.color,this.glowPower=e.glowPower,this.taperPower=e.taperPower}function PropertyArray(e){this._value=void 0,this._definitionChanged=new Event,this._eventHelper=new EventHelper,this.setValue(e)}Object.defineProperties(PolylineGlowMaterialProperty.prototype,{isConstant:{get:function(){return Property.isConstant(this._color)&&Property.isConstant(this._glow)}},definitionChanged:{get:function(){return this._definitionChanged}},color:createPropertyDescriptor("color"),glowPower:createPropertyDescriptor("glowPower"),taperPower:createPropertyDescriptor("taperPower")}),PolylineGlowMaterialProperty.prototype.getType=function(e){return"PolylineGlow"},PolylineGlowMaterialProperty.prototype.getValue=function(e,t){return defined(t)||(t={}),t.color=Property.getValueOrClonedDefault(this._color,e,defaultColor$6,t.color),t.glowPower=Property.getValueOrDefault(this._glowPower,e,defaultGlowPower,t.glowPower),t.taperPower=Property.getValueOrDefault(this._taperPower,e,defaultTaperPower,t.taperPower),t},PolylineGlowMaterialProperty.prototype.equals=function(e){return this===e||e instanceof PolylineGlowMaterialProperty&&Property.equals(this._color,e._color)&&Property.equals(this._glowPower,e._glowPower)&&Property.equals(this._taperPower,e._taperPower)},Object.defineProperties(PropertyArray.prototype,{isConstant:{get:function(){var e=this._value;if(!defined(e))return!0;for(var t=e.length,i=0;i<t;i++)if(!Property.isConstant(e[i]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}}),PropertyArray.prototype.getValue=function(e,t){var i=this._value;if(defined(i)){var r=i.length;defined(t)||(t=new Array(r));for(var n=0,a=0;n<r;){var o=this._value[n].getValue(e,t[n]);defined(o)&&(t[a]=o,a++),n++}return t.length=a,t}},PropertyArray.prototype.setValue=function(e){var t=this._eventHelper;if(t.removeAll(),defined(e)){this._value=e.slice();for(var i=e.length,r=0;r<i;r++){var n=e[r];defined(n)&&t.add(n.definitionChanged,PropertyArray.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)},PropertyArray.prototype.equals=function(e){return this===e||e instanceof PropertyArray&&Property.arrayEquals(this._value,e._value)},PropertyArray.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var Rotation={packedLength:1,pack:function(e,t,i){return t[i=defaultValue(i,0)]=e,t},unpack:function(e,t,i){return e[t=defaultValue(t,0)]},convertPackedArrayForInterpolation:function(e,t,i,r){var n;t=defaultValue(t,0);for(var a=0,o=(i=defaultValue(i,e.length))-t+1;a<o;a++){var s=e[t+a];0===a||Math.abs(n-s)<Math.PI?r[a]=s:r[a]=s-CesiumMath.TWO_PI,n=s}},unpackInterpolationResult:function(e,t,i,r,n){return(n=e[0])<0?n+CesiumMath.TWO_PI:n}},StripeOrientation={HORIZONTAL:0,VERTICAL:1},StripeOrientation$1=Object.freeze(StripeOrientation),defaultOrientation=StripeOrientation$1.HORIZONTAL,defaultEvenColor$1=Color.WHITE,defaultOddColor$1=Color.BLACK,defaultOffset$3=0,defaultRepeat$2=1;function StripeMaterialProperty(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this._definitionChanged=new Event,this._orientation=void 0,this._orientationSubscription=void 0,this._evenColor=void 0,this._evenColorSubscription=void 0,this._oddColor=void 0,this._oddColorSubscription=void 0,this._offset=void 0,this._offsetSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this.orientation=e.orientation,this.evenColor=e.evenColor,this.oddColor=e.oddColor,this.offset=e.offset,this.repeat=e.repeat}function TimeIntervalCollectionPositionProperty(e){this._definitionChanged=new Event,this._intervals=new TimeIntervalCollection,this._intervals.changedEvent.addEventListener(TimeIntervalCollectionPositionProperty.prototype._intervalsChanged,this),this._referenceFrame=defaultValue(e,ReferenceFrame$1.FIXED)}function VelocityVectorProperty(e,t){this._position=void 0,this._subscription=void 0,this._definitionChanged=new Event,this._normalize=defaultValue(t,!0),this.position=e}Object.defineProperties(StripeMaterialProperty.prototype,{isConstant:{get:function(){return Property.isConstant(this._orientation)&&Property.isConstant(this._evenColor)&&Property.isConstant(this._oddColor)&&Property.isConstant(this._offset)&&Property.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},orientation:createPropertyDescriptor("orientation"),evenColor:createPropertyDescriptor("evenColor"),oddColor:createPropertyDescriptor("oddColor"),offset:createPropertyDescriptor("offset"),repeat:createPropertyDescriptor("repeat")}),StripeMaterialProperty.prototype.getType=function(e){return"Stripe"},StripeMaterialProperty.prototype.getValue=function(e,t){return defined(t)||(t={}),t.horizontal=Property.getValueOrDefault(this._orientation,e,defaultOrientation)===StripeOrientation$1.HORIZONTAL,t.evenColor=Property.getValueOrClonedDefault(this._evenColor,e,defaultEvenColor$1,t.evenColor),t.oddColor=Property.getValueOrClonedDefault(this._oddColor,e,defaultOddColor$1,t.oddColor),t.offset=Property.getValueOrDefault(this._offset,e,defaultOffset$3),t.repeat=Property.getValueOrDefault(this._repeat,e,defaultRepeat$2),t},StripeMaterialProperty.prototype.equals=function(e){return this===e||e instanceof StripeMaterialProperty&&Property.equals(this._orientation,e._orientation)&&Property.equals(this._evenColor,e._evenColor)&&Property.equals(this._oddColor,e._oddColor)&&Property.equals(this._offset,e._offset)&&Property.equals(this._repeat,e._repeat)},Object.defineProperties(TimeIntervalCollectionPositionProperty.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}},referenceFrame:{get:function(){return this._referenceFrame}}}),TimeIntervalCollectionPositionProperty.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,ReferenceFrame$1.FIXED,t)},TimeIntervalCollectionPositionProperty.prototype.getValueInReferenceFrame=function(e,t,i){var r=this._intervals.findDataForIntervalContainingDate(e);if(defined(r))return PositionProperty.convertToReferenceFrame(e,r,this._referenceFrame,t,i)},TimeIntervalCollectionPositionProperty.prototype.equals=function(e){return this===e||e instanceof TimeIntervalCollectionPositionProperty&&this._intervals.equals(e._intervals,Property.equals)&&this._referenceFrame===e._referenceFrame},TimeIntervalCollectionPositionProperty.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)},Object.defineProperties(VelocityVectorProperty.prototype,{isConstant:{get:function(){return Property.isConstant(this._position)}},definitionChanged:{get:function(){return this._definitionChanged}},position:{get:function(){return this._position},set:function(e){var t=this._position;t!==e&&(defined(t)&&this._subscription(),defined(this._position=e)&&(this._subscription=e._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)),this._definitionChanged.raiseEvent(this))}},normalize:{get:function(){return this._normalize},set:function(e){this._normalize!==e&&(this._normalize=e,this._definitionChanged.raiseEvent(this))}}});var position1Scratch=new Cartesian3,position2Scratch=new Cartesian3,timeScratch=new JulianDate,step=1/60;function VelocityOrientationProperty(e,t){this._velocityVectorProperty=new VelocityVectorProperty(e,!0),this._subscription=void 0,this._ellipsoid=void 0,this._definitionChanged=new Event,this.ellipsoid=defaultValue(t,Ellipsoid.WGS84);var i=this;this._velocityVectorProperty.definitionChanged.addEventListener(function(){i._definitionChanged.raiseEvent(i)})}VelocityVectorProperty.prototype.getValue=function(e,t){return this._getValue(e,t)},VelocityVectorProperty.prototype._getValue=function(e,t,i){defined(t)||(t=new Cartesian3);var r=this._position;if(Property.isConstant(r))return this._normalize?void 0:Cartesian3.clone(Cartesian3.ZERO,t);var n=r.getValue(e,position1Scratch),a=r.getValue(JulianDate.addSeconds(e,step,timeScratch),position2Scratch);if(defined(n)&&(defined(a)||(a=n,defined(n=r.getValue(JulianDate.addSeconds(e,-step,timeScratch),position2Scratch))))){if(Cartesian3.equals(n,a))return this._normalize?void 0:Cartesian3.clone(Cartesian3.ZERO,t);defined(i)&&n.clone(i);var o=Cartesian3.subtract(a,n,t);return this._normalize?Cartesian3.normalize(o,t):Cartesian3.divideByScalar(o,step,t)}},VelocityVectorProperty.prototype.equals=function(e){return this===e||e instanceof VelocityVectorProperty&&Property.equals(this._position,e._position)},Object.defineProperties(VelocityOrientationProperty.prototype,{isConstant:{get:function(){return Property.isConstant(this._velocityVectorProperty)}},definitionChanged:{get:function(){return this._definitionChanged}},position:{get:function(){return this._velocityVectorProperty.position},set:function(e){this._velocityVectorProperty.position=e}},ellipsoid:{get:function(){return this._ellipsoid},set:function(e){this._ellipsoid!==e&&(this._ellipsoid=e,this._definitionChanged.raiseEvent(this))}}});var positionScratch$9=new Cartesian3,velocityScratch=new Cartesian3,rotationScratch=new Matrix3,currentId;function UnitCartesian3(){}function createReferenceProperty(e,t){return"#"===t[0]&&(t=currentId+t),ReferenceProperty.fromString(e,t)}function createSpecializedProperty(e,t,i){if(defined(i.reference))return createReferenceProperty(t,i.reference);if(defined(i.velocityReference)){var r=createReferenceProperty(t,i.velocityReference);switch(e){case Cartesian3:case UnitCartesian3:return new VelocityVectorProperty(r,e===UnitCartesian3);case Quaternion:return new VelocityOrientationProperty(r)}}throw new RuntimeError(JSON.stringify(i)+" is not valid CZML.")}function createAdapterProperty(i,r){return new CallbackProperty(function(e,t){return r(i.getValue(e,t))},i.isConstant)}VelocityOrientationProperty.prototype.getValue=function(e,t){var i=this._velocityVectorProperty._getValue(e,velocityScratch,positionScratch$9);if(defined(i))return Transforms.rotationMatrixFromPositionVelocity(positionScratch$9,i,this._ellipsoid,rotationScratch),Quaternion.fromRotationMatrix(rotationScratch,t)},VelocityOrientationProperty.prototype.equals=function(e){return this===e||e instanceof VelocityOrientationProperty&&Property.equals(this._velocityVectorProperty,e._velocityVectorProperty)&&(this._ellipsoid===e._ellipsoid||this._ellipsoid.equals(e._ellipsoid))},UnitCartesian3.packedLength=Cartesian3.packedLength,UnitCartesian3.unpack=Cartesian3.unpack,UnitCartesian3.pack=Cartesian3.pack;var scratchCartesian$8=new Cartesian3,scratchSpherical=new Spherical,scratchCartographic$d=new Cartographic,scratchTimeInterval=new TimeInterval,scratchQuaternion=new Quaternion;function unwrapColorInterval(e){var t=e.rgbaf;if(defined(t))return t;var i=e.rgba;if(defined(i)){var r=i.length;if(r===Color.packedLength)return[Color.byteToFloat(i[0]),Color.byteToFloat(i[1]),Color.byteToFloat(i[2]),Color.byteToFloat(i[3])];t=new Array(r);for(var n=0;n<r;n+=5)t[n]=i[n],t[n+1]=Color.byteToFloat(i[n+1]),t[n+2]=Color.byteToFloat(i[n+2]),t[n+3]=Color.byteToFloat(i[n+3]),t[n+4]=Color.byteToFloat(i[n+4]);return t}}function unwrapUriInterval(e,t){var i=defaultValue(e.uri,e);return defined(t)?t.getDerivedResource({url:i}):Resource.createIfNeeded(i)}function unwrapRectangleInterval(e){var t=e.wsen;if(defined(t))return t;var i=e.wsenDegrees;if(defined(i)){var r=i.length;if(r===Rectangle.packedLength)return[CesiumMath.toRadians(i[0]),CesiumMath.toRadians(i[1]),CesiumMath.toRadians(i[2]),CesiumMath.toRadians(i[3])];t=new Array(r);for(var n=0;n<r;n+=5)t[n]=i[n],t[n+1]=CesiumMath.toRadians(i[n+1]),t[n+2]=CesiumMath.toRadians(i[n+2]),t[n+3]=CesiumMath.toRadians(i[n+3]),t[n+4]=CesiumMath.toRadians(i[n+4]);return t}}function convertUnitSphericalToCartesian(e){var t=e.length;if(scratchSpherical.magnitude=1,2===t)return scratchSpherical.clock=e[0],scratchSpherical.cone=e[1],Cartesian3.fromSpherical(scratchSpherical,scratchCartesian$8),[scratchCartesian$8.x,scratchCartesian$8.y,scratchCartesian$8.z];for(var i=new Array(t/3*4),r=0,n=0;r<t;r+=3,n+=4)i[n]=e[r],scratchSpherical.clock=e[r+1],scratchSpherical.cone=e[r+2],Cartesian3.fromSpherical(scratchSpherical,scratchCartesian$8),i[n+1]=scratchCartesian$8.x,i[n+2]=scratchCartesian$8.y,i[n+3]=scratchCartesian$8.z;return i}function convertSphericalToCartesian(e){var t=e.length;if(3===t)return scratchSpherical.clock=e[0],scratchSpherical.cone=e[1],scratchSpherical.magnitude=e[2],Cartesian3.fromSpherical(scratchSpherical,scratchCartesian$8),[scratchCartesian$8.x,scratchCartesian$8.y,scratchCartesian$8.z];for(var i=new Array(t),r=0;r<t;r+=4)i[r]=e[r],scratchSpherical.clock=e[r+1],scratchSpherical.cone=e[r+2],scratchSpherical.magnitude=e[r+3],Cartesian3.fromSpherical(scratchSpherical,scratchCartesian$8),i[r+1]=scratchCartesian$8.x,i[r+2]=scratchCartesian$8.y,i[r+3]=scratchCartesian$8.z;return i}function convertCartographicRadiansToCartesian(e){var t=e.length;if(3===t)return scratchCartographic$d.longitude=e[0],scratchCartographic$d.latitude=e[1],scratchCartographic$d.height=e[2],Ellipsoid.WGS84.cartographicToCartesian(scratchCartographic$d,scratchCartesian$8),[scratchCartesian$8.x,scratchCartesian$8.y,scratchCartesian$8.z];for(var i=new Array(t),r=0;r<t;r+=4)i[r]=e[r],scratchCartographic$d.longitude=e[r+1],scratchCartographic$d.latitude=e[r+2],scratchCartographic$d.height=e[r+3],Ellipsoid.WGS84.cartographicToCartesian(scratchCartographic$d,scratchCartesian$8),i[r+1]=scratchCartesian$8.x,i[r+2]=scratchCartesian$8.y,i[r+3]=scratchCartesian$8.z;return i}function convertCartographicDegreesToCartesian(e){var t=e.length;if(3===t)return scratchCartographic$d.longitude=CesiumMath.toRadians(e[0]),scratchCartographic$d.latitude=CesiumMath.toRadians(e[1]),scratchCartographic$d.height=e[2],Ellipsoid.WGS84.cartographicToCartesian(scratchCartographic$d,scratchCartesian$8),[scratchCartesian$8.x,scratchCartesian$8.y,scratchCartesian$8.z];for(var i=new Array(t),r=0;r<t;r+=4)i[r]=e[r],scratchCartographic$d.longitude=CesiumMath.toRadians(e[r+1]),scratchCartographic$d.latitude=CesiumMath.toRadians(e[r+2]),scratchCartographic$d.height=e[r+3],Ellipsoid.WGS84.cartographicToCartesian(scratchCartographic$d,scratchCartesian$8),i[r+1]=scratchCartesian$8.x,i[r+2]=scratchCartesian$8.y,i[r+3]=scratchCartesian$8.z;return i}function unwrapCartesianInterval(e){var t=e.cartesian;if(defined(t))return t;var i=e.cartesianVelocity;if(defined(i))return i;var r=e.unitCartesian;if(defined(r))return r;var n=e.unitSpherical;if(defined(n))return convertUnitSphericalToCartesian(n);var a=e.spherical;if(defined(a))return convertSphericalToCartesian(a);var o=e.cartographicRadians;if(defined(o))return convertCartographicRadiansToCartesian(o);var s=e.cartographicDegrees;if(defined(s))return convertCartographicDegreesToCartesian(s);throw new RuntimeError(JSON.stringify(e)+" is not a valid CZML interval.")}function normalizePackedCartesianArray(e,t){Cartesian3.unpack(e,t,scratchCartesian$8),Cartesian3.normalize(scratchCartesian$8,scratchCartesian$8),Cartesian3.pack(scratchCartesian$8,e,t)}function unwrapUnitCartesianInterval(e){var t=unwrapCartesianInterval(e);if(3===t.length)return normalizePackedCartesianArray(t,0),t;for(var i=1;i<t.length;i+=4)normalizePackedCartesianArray(t,i);return t}function normalizePackedQuaternionArray(e,t){Quaternion.unpack(e,t,scratchQuaternion),Quaternion.normalize(scratchQuaternion,scratchQuaternion),Quaternion.pack(scratchQuaternion,e,t)}function unwrapQuaternionInterval(e){var t=e.unitQuaternion;if(defined(t)){if(4===t.length)return normalizePackedQuaternionArray(t,0),t;for(var i=1;i<t.length;i+=5)normalizePackedQuaternionArray(t,i)}return t}function getPropertyType(e){return"boolean"==typeof e?Boolean:"number"==typeof e?Number:"string"==typeof e?String:e.hasOwnProperty("array")?Array:e.hasOwnProperty("boolean")?Boolean:e.hasOwnProperty("boundingRectangle")?BoundingRectangle:e.hasOwnProperty("cartesian2")?Cartesian2:e.hasOwnProperty("cartesian")||e.hasOwnProperty("spherical")||e.hasOwnProperty("cartographicRadians")||e.hasOwnProperty("cartographicDegrees")?Cartesian3:e.hasOwnProperty("unitCartesian")||e.hasOwnProperty("unitSpherical")?UnitCartesian3:e.hasOwnProperty("rgba")||e.hasOwnProperty("rgbaf")?Color:e.hasOwnProperty("arcType")?ArcType$1:e.hasOwnProperty("classificationType")?ClassificationType$1:e.hasOwnProperty("colorBlendMode")?ColorBlendMode$1:e.hasOwnProperty("cornerType")?CornerType$1:e.hasOwnProperty("heightReference")?HeightReference$1:e.hasOwnProperty("horizontalOrigin")?HorizontalOrigin$1:e.hasOwnProperty("date")?JulianDate:e.hasOwnProperty("labelStyle")?LabelStyle$1:e.hasOwnProperty("number")?Number:e.hasOwnProperty("nearFarScalar")?NearFarScalar:e.hasOwnProperty("distanceDisplayCondition")?DistanceDisplayCondition:e.hasOwnProperty("object")||e.hasOwnProperty("value")?Object:e.hasOwnProperty("unitQuaternion")?Quaternion:e.hasOwnProperty("shadowMode")?ShadowMode$1:e.hasOwnProperty("string")?String:e.hasOwnProperty("stripeOrientation")?StripeOrientation$1:e.hasOwnProperty("wsen")||e.hasOwnProperty("wsenDegrees")?Rectangle:e.hasOwnProperty("uri")?URI:e.hasOwnProperty("verticalOrigin")?VerticalOrigin$1:Object}function unwrapInterval(e,t,i){switch(e){case ArcType$1:return ArcType$1[defaultValue(t.arcType,t)];case Array:return t.array;case Boolean:return defaultValue(t.boolean,t);case BoundingRectangle:return t.boundingRectangle;case Cartesian2:return t.cartesian2;case Cartesian3:return unwrapCartesianInterval(t);case UnitCartesian3:return unwrapUnitCartesianInterval(t);case Color:return unwrapColorInterval(t);case ClassificationType$1:return ClassificationType$1[defaultValue(t.classificationType,t)];case ColorBlendMode$1:return ColorBlendMode$1[defaultValue(t.colorBlendMode,t)];case CornerType$1:return CornerType$1[defaultValue(t.cornerType,t)];case HeightReference$1:return HeightReference$1[defaultValue(t.heightReference,t)];case HorizontalOrigin$1:return HorizontalOrigin$1[defaultValue(t.horizontalOrigin,t)];case Image:return unwrapUriInterval(t,i);case JulianDate:return JulianDate.fromIso8601(defaultValue(t.date,t));case LabelStyle$1:return LabelStyle$1[defaultValue(t.labelStyle,t)];case Number:return defaultValue(t.number,t);case NearFarScalar:return t.nearFarScalar;case DistanceDisplayCondition:return t.distanceDisplayCondition;case Object:return defaultValue(defaultValue(t.object,t.value),t);case Quaternion:return unwrapQuaternionInterval(t);case Rotation:return defaultValue(t.number,t);case ShadowMode$1:return ShadowMode$1[defaultValue(defaultValue(t.shadowMode,t.shadows),t)];case String:return defaultValue(t.string,t);case StripeOrientation$1:return StripeOrientation$1[defaultValue(t.stripeOrientation,t)];case Rectangle:return unwrapRectangleInterval(t);case URI:return unwrapUriInterval(t,i);case VerticalOrigin$1:return VerticalOrigin$1[defaultValue(t.verticalOrigin,t)];default:throw new RuntimeError(e)}}var interpolators={HERMITE:HermitePolynomialApproximation,LAGRANGE:LagrangePolynomialApproximation,LINEAR:LinearApproximation};function updateInterpolationSettings(e,t){var i=e.interpolationAlgorithm,r=e.interpolationDegree;(defined(i)||defined(r))&&t.setInterpolationOptions({interpolationAlgorithm:interpolators[i],interpolationDegree:r});var n=e.forwardExtrapolationType;defined(n)&&(t.forwardExtrapolationType=ExtrapolationType$1[n]);var a=e.forwardExtrapolationDuration;defined(a)&&(t.forwardExtrapolationDuration=a);var o=e.backwardExtrapolationType;defined(o)&&(t.backwardExtrapolationType=ExtrapolationType$1[o]);var s=e.backwardExtrapolationDuration;defined(s)&&(t.backwardExtrapolationDuration=s)}var iso8601Scratch={iso8601:void 0};function intervalFromString(e){if(defined(e))return iso8601Scratch.iso8601=e,TimeInterval.fromIso8601(iso8601Scratch)}function wrapPropertyInInfiniteInterval(e){var t=Iso8601.MAXIMUM_INTERVAL.clone();return t.data=e,t}function convertPropertyToComposite(e){var t=new CompositeProperty;return t.intervals.addInterval(wrapPropertyInInfiniteInterval(e)),t}function convertPositionPropertyToComposite(e){var t=new CompositePositionProperty(e.referenceFrame);return t.intervals.addInterval(wrapPropertyInInfiniteInterval(e)),t}function processProperty(e,t,i,r,n,a,o){var s,l,u,c=intervalFromString(r.interval);defined(n)&&(c=defined(c)?TimeInterval.intersect(c,n,scratchTimeInterval):n);var d=!defined(r.reference)&&!defined(r.velocityReference),h=defined(c)&&!c.equals(Iso8601.MAXIMUM_INTERVAL);if(!0===r.delete)return h?removePropertyData(t[i],c):void(t[i]=void 0);var p=!1;if(d){if(!defined(l=unwrapInterval(e,r,a)))return;s=defaultValue(e.packedLength,1),u=defaultValue(l.length,1),p=!defined(r.array)&&"string"!=typeof l&&s<u&&e!==Object}var f="function"==typeof e.unpack&&e!==Rotation;if(p||h){var m,g,y=t[i],v=r.epoch;if(defined(v)&&(m=JulianDate.fromIso8601(v)),p&&!h)return y instanceof SampledProperty||(t[i]=y=new SampledProperty(e)),y.addSamplesPackedArray(l,m),void updateInterpolationSettings(r,y);if(!p&&h)return(c=c.clone()).data=d?f?e.unpack(l,0):l:createSpecializedProperty(e,o,r),defined(y)||(t[i]=y=d?new TimeIntervalCollectionProperty:new CompositeProperty),d&&y instanceof TimeIntervalCollectionProperty||(y instanceof CompositeProperty||(t[i]=y=convertPropertyToComposite(y)),d&&(c.data=new ConstantProperty(c.data))),void y.intervals.addInterval(c);defined(y)||(t[i]=y=new CompositeProperty),y instanceof CompositeProperty||(t[i]=y=convertPropertyToComposite(y));var _=y.intervals;defined(g=_.findInterval(c))&&g.data instanceof SampledProperty||((g=c.clone()).data=new SampledProperty(e),_.addInterval(g)),g.data.addSamplesPackedArray(l,m),updateInterpolationSettings(r,g.data)}else t[i]=d?new ConstantProperty(f?e.unpack(l,0):l):createSpecializedProperty(e,o,r)}function removePropertyData(e,t){if(e instanceof SampledProperty)e.removeSamples(t);else if(e instanceof TimeIntervalCollectionProperty)e.intervals.removeInterval(t);else if(e instanceof CompositeProperty){for(var i=e.intervals,r=0;r<i.length;++r){var n=TimeInterval.intersect(i.get(r),t,scratchTimeInterval);n.isEmpty||removePropertyData(n.data,t)}i.removeInterval(t)}else;}function processPacketData(e,t,i,r,n,a,o){if(defined(r))if(Array.isArray(r))for(var s=0,l=r.length;s<l;++s)processProperty(e,t,i,r[s],n,a,o);else processProperty(e,t,i,r,n,a,o)}function processPositionProperty(e,t,i,r,n,a){var o=intervalFromString(i.interval);defined(r)&&(o=defined(o)?TimeInterval.intersect(o,r,scratchTimeInterval):r);var s,l,u=defined(i.cartesianVelocity)?1:0,c=Cartesian3.packedLength*(1+u),d=!defined(i.reference),h=defined(o)&&!o.equals(Iso8601.MAXIMUM_INTERVAL);if(!0===i.delete)return h?removePositionPropertyData(e[t],o):void(e[t]=void 0);var p=!1;if(d&&(defined(i.referenceFrame)&&(l=ReferenceFrame$1[i.referenceFrame]),l=defaultValue(l,ReferenceFrame$1.FIXED),p=c<defaultValue((s=unwrapCartesianInterval(i)).length,1)),p||h){var f,m,g=e[t],y=i.epoch;if(defined(y)&&(f=JulianDate.fromIso8601(y)),p&&!h)return g instanceof SampledPositionProperty&&(!defined(l)||g.referenceFrame===l)||(e[t]=g=new SampledPositionProperty(l,u)),g.addSamplesPackedArray(s,f),void updateInterpolationSettings(i,g);if(!p&&h)return(o=o.clone()).data=d?Cartesian3.unpack(s):createReferenceProperty(a,i.reference),defined(g)||(g=d?new TimeIntervalCollectionPositionProperty(l):new CompositePositionProperty(l),e[t]=g),d&&g instanceof TimeIntervalCollectionPositionProperty&&defined(l)&&g.referenceFrame===l||(g instanceof CompositePositionProperty||(e[t]=g=convertPositionPropertyToComposite(g)),d&&(o.data=new ConstantPositionProperty(o.data,l))),void g.intervals.addInterval(o);defined(g)?g instanceof CompositePositionProperty||(e[t]=g=convertPositionPropertyToComposite(g)):e[t]=g=new CompositePositionProperty(l);var v=g.intervals;defined(m=v.findInterval(o))&&m.data instanceof SampledPositionProperty&&(!defined(l)||m.data.referenceFrame===l)||((m=o.clone()).data=new SampledPositionProperty(l,u),v.addInterval(m)),m.data.addSamplesPackedArray(s,f),updateInterpolationSettings(i,m.data)}else e[t]=d?new ConstantPositionProperty(Cartesian3.unpack(s),l):createReferenceProperty(a,i.reference)}function removePositionPropertyData(e,t){if(e instanceof SampledPositionProperty)e.removeSamples(t);else if(e instanceof TimeIntervalCollectionPositionProperty)e.intervals.removeInterval(t);else if(e instanceof CompositePositionProperty){for(var i=e.intervals,r=0;r<i.length;++r){var n=TimeInterval.intersect(i.get(r),t,scratchTimeInterval);n.isEmpty||removePositionPropertyData(n.data,t)}i.removeInterval(t)}else;}function processPositionPacketData(e,t,i,r,n,a){if(defined(i))if(Array.isArray(i))for(var o=0,s=i.length;o<s;++o)processPositionProperty(e,t,i[o],r,n,a);else processPositionProperty(e,t,i,r,n,a)}function processMaterialProperty(e,t,i,r,n,a){var o=intervalFromString(i.interval);defined(r)&&(o=defined(o)?TimeInterval.intersect(o,r,scratchTimeInterval):r);var s,l,u,c=e[t];if(defined(o)){c instanceof CompositeMaterialProperty||(c=new CompositeMaterialProperty,e[t]=c);var d=c.intervals;defined(l=d.findInterval({start:o.start,stop:o.stop}))?s=l.data:(l=o.clone(),d.addInterval(l))}else s=c;defined(i.solidColor)?(s instanceof ColorMaterialProperty||(s=new ColorMaterialProperty),processPacketData(Color,s,"color",(u=i.solidColor).color,void 0,void 0,a)):defined(i.grid)?(s instanceof GridMaterialProperty||(s=new GridMaterialProperty),processPacketData(Color,s,"color",(u=i.grid).color,void 0,n,a),processPacketData(Number,s,"cellAlpha",u.cellAlpha,void 0,n,a),processPacketData(Cartesian2,s,"lineCount",u.lineCount,void 0,n,a),processPacketData(Cartesian2,s,"lineThickness",u.lineThickness,void 0,n,a),processPacketData(Cartesian2,s,"lineOffset",u.lineOffset,void 0,n,a)):defined(i.image)?(s instanceof ImageMaterialProperty||(s=new ImageMaterialProperty),u=i.image,processPacketData(Image,s,"image",u.image,void 0,n,a),processPacketData(Cartesian2,s,"repeat",u.repeat,void 0,n,a),processPacketData(Color,s,"color",u.color,void 0,n,a),processPacketData(Boolean,s,"transparent",u.transparent,void 0,n,a)):defined(i.stripe)?(s instanceof StripeMaterialProperty||(s=new StripeMaterialProperty),u=i.stripe,processPacketData(StripeOrientation$1,s,"orientation",u.orientation,void 0,n,a),processPacketData(Color,s,"evenColor",u.evenColor,void 0,n,a),processPacketData(Color,s,"oddColor",u.oddColor,void 0,n,a),processPacketData(Number,s,"offset",u.offset,void 0,n,a),processPacketData(Number,s,"repeat",u.repeat,void 0,n,a)):defined(i.polylineOutline)?(s instanceof PolylineOutlineMaterialProperty||(s=new PolylineOutlineMaterialProperty),processPacketData(Color,s,"color",(u=i.polylineOutline).color,void 0,n,a),processPacketData(Color,s,"outlineColor",u.outlineColor,void 0,n,a),processPacketData(Number,s,"outlineWidth",u.outlineWidth,void 0,n,a)):defined(i.polylineGlow)?(s instanceof PolylineGlowMaterialProperty||(s=new PolylineGlowMaterialProperty),processPacketData(Color,s,"color",(u=i.polylineGlow).color,void 0,n,a),processPacketData(Number,s,"glowPower",u.glowPower,void 0,n,a),processPacketData(Number,s,"taperPower",u.taperPower,void 0,n,a)):defined(i.polylineArrow)?(s instanceof PolylineArrowMaterialProperty||(s=new PolylineArrowMaterialProperty),processPacketData(Color,s,"color",(u=i.polylineArrow).color,void 0,void 0,a)):defined(i.polylineDash)?(s instanceof PolylineDashMaterialProperty||(s=new PolylineDashMaterialProperty),processPacketData(Color,s,"color",(u=i.polylineDash).color,void 0,void 0,a),processPacketData(Color,s,"gapColor",u.gapColor,void 0,void 0,a),processPacketData(Number,s,"dashLength",u.dashLength,void 0,n,a),processPacketData(Number,s,"dashPattern",u.dashPattern,void 0,n,a)):defined(i.checkerboard)&&(s instanceof CheckerboardMaterialProperty||(s=new CheckerboardMaterialProperty),processPacketData(Color,s,"evenColor",(u=i.checkerboard).evenColor,void 0,n,a),processPacketData(Color,s,"oddColor",u.oddColor,void 0,n,a),processPacketData(Cartesian2,s,"repeat",u.repeat,void 0,n,a)),defined(l)?l.data=s:e[t]=s}function processMaterialPacketData(e,t,i,r,n,a){if(defined(i))if(Array.isArray(i))for(var o=0,s=i.length;o<s;++o)processMaterialProperty(e,t,i[o],r,n,a);else processMaterialProperty(e,t,i,r,n,a)}function processName(e,t,i,r){defined(t.name)&&(e.name=t.name)}function processDescription$1(e,t,i,r){var n=t.description;defined(n)&&processPacketData(String,e,"description",n,void 0,r,i)}function processPosition(e,t,i,r){var n=t.position;defined(n)&&processPositionPacketData(e,"position",n,void 0,r,i)}function processViewFrom(e,t,i,r){var n=t.viewFrom;defined(n)&&processPacketData(Cartesian3,e,"viewFrom",n,void 0,r,i)}function processOrientation(e,t,i,r){var n=t.orientation;defined(n)&&processPacketData(Quaternion,e,"orientation",n,void 0,r,i)}function processProperties(e,t,i,r){var n=t.properties;if(defined(n))for(var a in defined(e.properties)||(e.properties=new PropertyBag),n)if(n.hasOwnProperty(a)){e.properties.hasProperty(a)||e.properties.addProperty(a);var o=n[a];if(Array.isArray(o))for(var s=0,l=o.length;s<l;++s)processProperty(getPropertyType(o[s]),e.properties,a,o[s],void 0,r,i);else processProperty(getPropertyType(o),e.properties,a,o,void 0,r,i)}}function processReferencesArrayPacketData(e,t,i,r,n,a,o){var s=i.map(function(e){return createReferenceProperty(n,e)});if(defined(r)){r=intervalFromString(r);var l=e[t];if(!(l instanceof o)){var u=new o;u.intervals.addInterval(wrapPropertyInInfiniteInterval(l)),e[t]=l=u}r.data=new a(s),l.intervals.addInterval(r)}else e[t]=new a(s)}function processArrayPacketData(e,t,i,r){var n=i.references;defined(n)?processReferencesArrayPacketData(e,t,n,i.interval,r,PropertyArray,CompositeProperty):processPacketData(Array,e,t,i,void 0,void 0,r)}function processArray(e,t,i,r){if(defined(i))if(Array.isArray(i))for(var n=0,a=i.length;n<a;++n)processArrayPacketData(e,t,i[n],r);else processArrayPacketData(e,t,i,r)}function processPositionArrayPacketData(e,t,i,r){var n=i.references;defined(n)?processReferencesArrayPacketData(e,t,n,i.interval,r,PositionPropertyArray,CompositePositionProperty):(defined(i.cartesian)?i.array=Cartesian3.unpackArray(i.cartesian):defined(i.cartographicRadians)?i.array=Cartesian3.fromRadiansArrayHeights(i.cartographicRadians):defined(i.cartographicDegrees)&&(i.array=Cartesian3.fromDegreesArrayHeights(i.cartographicDegrees)),defined(i.array)&&processPacketData(Array,e,t,i,void 0,void 0,r))}function processPositionArray(e,t,i,r){if(defined(i))if(Array.isArray(i))for(var n=0,a=i.length;n<a;++n)processPositionArrayPacketData(e,t,i[n],r);else processPositionArrayPacketData(e,t,i,r)}function unpackCartesianArray(e){return Cartesian3.unpackArray(e)}function unpackCartographicRadiansArray(e){return Cartesian3.fromRadiansArrayHeights(e)}function unpackCartographicDegreesArray(e){return Cartesian3.fromDegreesArrayHeights(e)}function processPositionArrayOfArraysPacketData(e,t,i,r){var n=i.references;if(defined(n)){var a=n.map(function(e){var t={};return processReferencesArrayPacketData(t,"positions",e,i.interval,r,PositionPropertyArray,CompositePositionProperty),t.positions});e[t]=new PositionPropertyArray(a)}else defined(i.cartesian)?i.array=i.cartesian.map(unpackCartesianArray):defined(i.cartographicRadians)?i.array=i.cartographicRadians.map(unpackCartographicRadiansArray):defined(i.cartographicDegrees)&&(i.array=i.cartographicDegrees.map(unpackCartographicDegreesArray)),defined(i.array)&&processPacketData(Array,e,t,i,void 0,void 0,r)}function processPositionArrayOfArrays(e,t,i,r){if(defined(i))if(Array.isArray(i))for(var n=0,a=i.length;n<a;++n)processPositionArrayOfArraysPacketData(e,t,i[n],r);else processPositionArrayOfArraysPacketData(e,t,i,r)}function processAvailability(e,t,i,r){var n=t.availability;if(defined(n)){var a;if(Array.isArray(n))for(var o=0,s=n.length;o<s;++o)defined(a)||(a=new TimeIntervalCollection),a.addInterval(intervalFromString(n[o]));else(a=new TimeIntervalCollection).addInterval(intervalFromString(n));e.availability=a}}function processAlignedAxis(e,t,i,r,n){defined(t)&&processPacketData(UnitCartesian3,e,"alignedAxis",t,i,r,n)}function processBillboard(e,t,i,r){var n=t.billboard;if(defined(n)){var a=intervalFromString(n.interval),o=e.billboard;defined(o)||(e.billboard=o=new BillboardGraphics),processPacketData(Boolean,o,"show",n.show,a,r,i),processPacketData(Image,o,"image",n.image,a,r,i),processPacketData(Number,o,"scale",n.scale,a,r,i),processPacketData(Cartesian2,o,"pixelOffset",n.pixelOffset,a,r,i),processPacketData(Cartesian3,o,"eyeOffset",n.eyeOffset,a,r,i),processPacketData(HorizontalOrigin$1,o,"horizontalOrigin",n.horizontalOrigin,a,r,i),processPacketData(VerticalOrigin$1,o,"verticalOrigin",n.verticalOrigin,a,r,i),processPacketData(HeightReference$1,o,"heightReference",n.heightReference,a,r,i),processPacketData(Color,o,"color",n.color,a,r,i),processPacketData(Rotation,o,"rotation",n.rotation,a,r,i),processAlignedAxis(o,n.alignedAxis,a,r,i),processPacketData(Boolean,o,"sizeInMeters",n.sizeInMeters,a,r,i),processPacketData(Number,o,"width",n.width,a,r,i),processPacketData(Number,o,"height",n.height,a,r,i),processPacketData(NearFarScalar,o,"scaleByDistance",n.scaleByDistance,a,r,i),processPacketData(NearFarScalar,o,"translucencyByDistance",n.translucencyByDistance,a,r,i),processPacketData(NearFarScalar,o,"pixelOffsetScaleByDistance",n.pixelOffsetScaleByDistance,a,r,i),processPacketData(BoundingRectangle,o,"imageSubRegion",n.imageSubRegion,a,r,i),processPacketData(DistanceDisplayCondition,o,"distanceDisplayCondition",n.distanceDisplayCondition,a,r,i),processPacketData(Number,o,"disableDepthTestDistance",n.disableDepthTestDistance,a,r,i)}}function processBox(e,t,i,r){var n=t.box;if(defined(n)){var a=intervalFromString(n.interval),o=e.box;defined(o)||(e.box=o=new BoxGraphics),processPacketData(Boolean,o,"show",n.show,a,r,i),processPacketData(Cartesian3,o,"dimensions",n.dimensions,a,r,i),processPacketData(HeightReference$1,o,"heightReference",n.heightReference,a,r,i),processPacketData(Boolean,o,"fill",n.fill,a,r,i),processMaterialPacketData(o,"material",n.material,a,r,i),processPacketData(Boolean,o,"outline",n.outline,a,r,i),processPacketData(Color,o,"outlineColor",n.outlineColor,a,r,i),processPacketData(Number,o,"outlineWidth",n.outlineWidth,a,r,i),processPacketData(ShadowMode$1,o,"shadows",n.shadows,a,r,i),processPacketData(DistanceDisplayCondition,o,"distanceDisplayCondition",n.distanceDisplayCondition,a,r,i)}}function processCorridor(e,t,i,r){var n=t.corridor;if(defined(n)){var a=intervalFromString(n.interval),o=e.corridor;defined(o)||(e.corridor=o=new CorridorGraphics),processPacketData(Boolean,o,"show",n.show,a,r,i),processPositionArray(o,"positions",n.positions,i),processPacketData(Number,o,"width",n.width,a,r,i),processPacketData(Number,o,"height",n.height,a,r,i),processPacketData(HeightReference$1,o,"heightReference",n.heightReference,a,r,i),processPacketData(Number,o,"extrudedHeight",n.extrudedHeight,a,r,i),processPacketData(HeightReference$1,o,"extrudedHeightReference",n.extrudedHeightReference,a,r,i),processPacketData(CornerType$1,o,"cornerType",n.cornerType,a,r,i),processPacketData(Number,o,"granularity",n.granularity,a,r,i),processPacketData(Boolean,o,"fill",n.fill,a,r,i),processMaterialPacketData(o,"material",n.material,a,r,i),processPacketData(Boolean,o,"outline",n.outline,a,r,i),processPacketData(Color,o,"outlineColor",n.outlineColor,a,r,i),processPacketData(Number,o,"outlineWidth",n.outlineWidth,a,r,i),processPacketData(ShadowMode$1,o,"shadows",n.shadows,a,r,i),processPacketData(DistanceDisplayCondition,o,"distanceDisplayCondition",n.distanceDisplayCondition,a,r,i),processPacketData(ClassificationType$1,o,"classificationType",n.classificationType,a,r,i),processPacketData(Number,o,"zIndex",n.zIndex,a,r,i)}}function processCylinder(e,t,i,r){var n=t.cylinder;if(defined(n)){var a=intervalFromString(n.interval),o=e.cylinder;defined(o)||(e.cylinder=o=new CylinderGraphics),processPacketData(Boolean,o,"show",n.show,a,r,i),processPacketData(Number,o,"length",n.length,a,r,i),processPacketData(Number,o,"topRadius",n.topRadius,a,r,i),processPacketData(Number,o,"bottomRadius",n.bottomRadius,a,r,i),processPacketData(HeightReference$1,o,"heightReference",n.heightReference,a,r,i),processPacketData(Boolean,o,"fill",n.fill,a,r,i),processMaterialPacketData(o,"material",n.material,a,r,i),processPacketData(Boolean,o,"outline",n.outline,a,r,i),processPacketData(Color,o,"outlineColor",n.outlineColor,a,r,i),processPacketData(Number,o,"outlineWidth",n.outlineWidth,a,r,i),processPacketData(Number,o,"numberOfVerticalLines",n.numberOfVerticalLines,a,r,i),processPacketData(Number,o,"slices",n.slices,a,r,i),processPacketData(ShadowMode$1,o,"shadows",n.shadows,a,r,i),processPacketData(DistanceDisplayCondition,o,"distanceDisplayCondition",n.distanceDisplayCondition,a,r,i)}}function processDocument$1(e,t){var i=e.version;if(defined(i)&&"string"==typeof i){var r=i.split(".");if(2===r.length){if("1"!==r[0])throw new RuntimeError("Cesium only supports CZML version 1.");t._version=i}}if(!defined(t._version))throw new RuntimeError("CZML version information invalid. It is expected to be a property on the document object in the <Major>.<Minor> version format.");var n=t._documentPacket;defined(e.name)&&(n.name=e.name);var a=e.clock;if(defined(a)){var o=n.clock;defined(o)?(o.interval=defaultValue(a.interval,o.interval),o.currentTime=defaultValue(a.currentTime,o.currentTime),o.range=defaultValue(a.range,o.range),o.step=defaultValue(a.step,o.step),o.multiplier=defaultValue(a.multiplier,o.multiplier)):n.clock={interval:a.interval,currentTime:a.currentTime,range:a.range,step:a.step,multiplier:a.multiplier}}}function processEllipse(e,t,i,r){var n=t.ellipse;if(defined(n)){var a=intervalFromString(n.interval),o=e.ellipse;defined(o)||(e.ellipse=o=new EllipseGraphics),processPacketData(Boolean,o,"show",n.show,a,r,i),processPacketData(Number,o,"semiMajorAxis",n.semiMajorAxis,a,r,i),processPacketData(Number,o,"semiMinorAxis",n.semiMinorAxis,a,r,i),processPacketData(Number,o,"height",n.height,a,r,i),processPacketData(HeightReference$1,o,"heightReference",n.heightReference,a,r,i),processPacketData(Number,o,"extrudedHeight",n.extrudedHeight,a,r,i),processPacketData(HeightReference$1,o,"extrudedHeightReference",n.extrudedHeightReference,a,r,i),processPacketData(Rotation,o,"rotation",n.rotation,a,r,i),processPacketData(Rotation,o,"stRotation",n.stRotation,a,r,i),processPacketData(Number,o,"granularity",n.granularity,a,r,i),processPacketData(Boolean,o,"fill",n.fill,a,r,i),processMaterialPacketData(o,"material",n.material,a,r,i),processPacketData(Boolean,o,"outline",n.outline,a,r,i),processPacketData(Color,o,"outlineColor",n.outlineColor,a,r,i),processPacketData(Number,o,"outlineWidth",n.outlineWidth,a,r,i),processPacketData(Number,o,"numberOfVerticalLines",n.numberOfVerticalLines,a,r,i),processPacketData(ShadowMode$1,o,"shadows",n.shadows,a,r,i),processPacketData(DistanceDisplayCondition,o,"distanceDisplayCondition",n.distanceDisplayCondition,a,r,i),processPacketData(ClassificationType$1,o,"classificationType",n.classificationType,a,r,i),processPacketData(Number,o,"zIndex",n.zIndex,a,r,i)}}function processEllipsoid(e,t,i,r){var n=t.ellipsoid;if(defined(n)){var a=intervalFromString(n.interval),o=e.ellipsoid;defined(o)||(e.ellipsoid=o=new EllipsoidGraphics),processPacketData(Boolean,o,"show",n.show,a,r,i),processPacketData(Cartesian3,o,"radii",n.radii,a,r,i),processPacketData(Cartesian3,o,"innerRadii",n.innerRadii,a,r,i),processPacketData(Number,o,"minimumClock",n.minimumClock,a,r,i),processPacketData(Number,o,"maximumClock",n.maximumClock,a,r,i),processPacketData(Number,o,"minimumCone",n.minimumCone,a,r,i),processPacketData(Number,o,"maximumCone",n.maximumCone,a,r,i),processPacketData(HeightReference$1,o,"heightReference",n.heightReference,a,r,i),processPacketData(Boolean,o,"fill",n.fill,a,r,i),processMaterialPacketData(o,"material",n.material,a,r,i),processPacketData(Boolean,o,"outline",n.outline,a,r,i),processPacketData(Color,o,"outlineColor",n.outlineColor,a,r,i),processPacketData(Number,o,"outlineWidth",n.outlineWidth,a,r,i),processPacketData(Number,o,"stackPartitions",n.stackPartitions,a,r,i),processPacketData(Number,o,"slicePartitions",n.slicePartitions,a,r,i),processPacketData(Number,o,"subdivisions",n.subdivisions,a,r,i),processPacketData(ShadowMode$1,o,"shadows",n.shadows,a,r,i),processPacketData(DistanceDisplayCondition,o,"distanceDisplayCondition",n.distanceDisplayCondition,a,r,i)}}function processLabel(e,t,i,r){var n=t.label;if(defined(n)){var a=intervalFromString(n.interval),o=e.label;defined(o)||(e.label=o=new LabelGraphics),processPacketData(Boolean,o,"show",n.show,a,r,i),processPacketData(String,o,"text",n.text,a,r,i),processPacketData(String,o,"font",n.font,a,r,i),processPacketData(LabelStyle$1,o,"style",n.style,a,r,i),processPacketData(Number,o,"scale",n.scale,a,r,i),processPacketData(Boolean,o,"showBackground",n.showBackground,a,r,i),processPacketData(Color,o,"backgroundColor",n.backgroundColor,a,r,i),processPacketData(Cartesian2,o,"backgroundPadding",n.backgroundPadding,a,r,i),processPacketData(Cartesian2,o,"pixelOffset",n.pixelOffset,a,r,i),processPacketData(Cartesian3,o,"eyeOffset",n.eyeOffset,a,r,i),processPacketData(HorizontalOrigin$1,o,"horizontalOrigin",n.horizontalOrigin,a,r,i),processPacketData(VerticalOrigin$1,o,"verticalOrigin",n.verticalOrigin,a,r,i),processPacketData(HeightReference$1,o,"heightReference",n.heightReference,a,r,i),processPacketData(Color,o,"fillColor",n.fillColor,a,r,i),processPacketData(Color,o,"outlineColor",n.outlineColor,a,r,i),processPacketData(Number,o,"outlineWidth",n.outlineWidth,a,r,i),processPacketData(NearFarScalar,o,"translucencyByDistance",n.translucencyByDistance,a,r,i),processPacketData(NearFarScalar,o,"pixelOffsetScaleByDistance",n.pixelOffsetScaleByDistance,a,r,i),processPacketData(NearFarScalar,o,"scaleByDistance",n.scaleByDistance,a,r,i),processPacketData(DistanceDisplayCondition,o,"distanceDisplayCondition",n.distanceDisplayCondition,a,r,i),processPacketData(Number,o,"disableDepthTestDistance",n.disableDepthTestDistance,a,r,i)}}function processModel(e,t,i,r){var n=t.model;if(defined(n)){var a,o,s=intervalFromString(n.interval),l=e.model;defined(l)||(e.model=l=new ModelGraphics),processPacketData(Boolean,l,"show",n.show,s,r,i),processPacketData(URI,l,"uri",n.gltf,s,r,i),processPacketData(Number,l,"scale",n.scale,s,r,i),processPacketData(Number,l,"minimumPixelSize",n.minimumPixelSize,s,r,i),processPacketData(Number,l,"maximumScale",n.maximumScale,s,r,i),processPacketData(Boolean,l,"incrementallyLoadTextures",n.incrementallyLoadTextures,s,r,i),processPacketData(Boolean,l,"runAnimations",n.runAnimations,s,r,i),processPacketData(Boolean,l,"clampAnimations",n.clampAnimations,s,r,i),processPacketData(ShadowMode$1,l,"shadows",n.shadows,s,r,i),processPacketData(HeightReference$1,l,"heightReference",n.heightReference,s,r,i),processPacketData(Color,l,"silhouetteColor",n.silhouetteColor,s,r,i),processPacketData(Number,l,"silhouetteSize",n.silhouetteSize,s,r,i),processPacketData(Color,l,"color",n.color,s,r,i),processPacketData(ColorBlendMode$1,l,"colorBlendMode",n.colorBlendMode,s,r,i),processPacketData(Number,l,"colorBlendAmount",n.colorBlendAmount,s,r,i),processPacketData(DistanceDisplayCondition,l,"distanceDisplayCondition",n.distanceDisplayCondition,s,r,i);var u=n.nodeTransformations;if(defined(u))if(Array.isArray(u))for(a=0,o=u.length;a<o;++a)processNodeTransformations(l,u[a],s,r,i);else processNodeTransformations(l,u,s,r,i);var c=n.articulations;if(defined(c))if(Array.isArray(c))for(a=0,o=c.length;a<o;++a)processArticulations(l,c[a],s,r,i);else processArticulations(l,c,s,r,i)}}function processNodeTransformations(e,t,i,r,n){var a=intervalFromString(t.interval);defined(i)&&(a=defined(a)?TimeInterval.intersect(a,i,scratchTimeInterval):i);for(var o=e.nodeTransformations,s=Object.keys(t),l=0,u=s.length;l<u;++l){var c=s[l];if("interval"!==c){var d=t[c];if(defined(d)){defined(o)||(e.nodeTransformations=o=new PropertyBag),o.hasProperty(c)||o.addProperty(c);var h=o[c];defined(h)||(o[c]=h=new NodeTransformationProperty),processPacketData(Cartesian3,h,"translation",d.translation,a,r,n),processPacketData(Quaternion,h,"rotation",d.rotation,a,r,n),processPacketData(Cartesian3,h,"scale",d.scale,a,r,n)}}}}function processArticulations(e,t,i,r,n){var a=intervalFromString(t.interval);defined(i)&&(a=defined(a)?TimeInterval.intersect(a,i,scratchTimeInterval):i);for(var o=e.articulations,s=Object.keys(t),l=0,u=s.length;l<u;++l){var c=s[l];if("interval"!==c){var d=t[c];defined(d)&&(defined(o)||(e.articulations=o=new PropertyBag),o.hasProperty(c)||o.addProperty(c),processPacketData(Number,o,c,d,a,r,n))}}}function processPath(e,t,i,r){var n=t.path;if(defined(n)){var a=intervalFromString(n.interval),o=e.path;defined(o)||(e.path=o=new PathGraphics),processPacketData(Boolean,o,"show",n.show,a,r,i),processPacketData(Number,o,"leadTime",n.leadTime,a,r,i),processPacketData(Number,o,"trailTime",n.trailTime,a,r,i),processPacketData(Number,o,"width",n.width,a,r,i),processPacketData(Number,o,"resolution",n.resolution,a,r,i),processMaterialPacketData(o,"material",n.material,a,r,i),processPacketData(DistanceDisplayCondition,o,"distanceDisplayCondition",n.distanceDisplayCondition,a,r,i)}}function processPoint$2(e,t,i,r){var n=t.point;if(defined(n)){var a=intervalFromString(n.interval),o=e.point;defined(o)||(e.point=o=new PointGraphics),processPacketData(Boolean,o,"show",n.show,a,r,i),processPacketData(Number,o,"pixelSize",n.pixelSize,a,r,i),processPacketData(HeightReference$1,o,"heightReference",n.heightReference,a,r,i),processPacketData(Color,o,"color",n.color,a,r,i),processPacketData(Color,o,"outlineColor",n.outlineColor,a,r,i),processPacketData(Number,o,"outlineWidth",n.outlineWidth,a,r,i),processPacketData(NearFarScalar,o,"scaleByDistance",n.scaleByDistance,a,r,i),processPacketData(NearFarScalar,o,"translucencyByDistance",n.translucencyByDistance,a,r,i),processPacketData(DistanceDisplayCondition,o,"distanceDisplayCondition",n.distanceDisplayCondition,a,r,i),processPacketData(Number,o,"disableDepthTestDistance",n.disableDepthTestDistance,a,r,i)}}function PolygonHierarchyProperty(e){this.polygon=e,this._definitionChanged=new Event}function processPolygon$2(e,t,i,r){var n=t.polygon;if(defined(n)){var a=intervalFromString(n.interval),o=e.polygon;defined(o)||(e.polygon=o=new PolygonGraphics),processPacketData(Boolean,o,"show",n.show,a,r,i),processPositionArray(o,"_positions",n.positions,i),processPositionArrayOfArrays(o,"_holes",n.holes,i),(defined(o._positions)||defined(o._holes))&&(o.hierarchy=new PolygonHierarchyProperty(o)),processPacketData(Number,o,"height",n.height,a,r,i),processPacketData(HeightReference$1,o,"heightReference",n.heightReference,a,r,i),processPacketData(Number,o,"extrudedHeight",n.extrudedHeight,a,r,i),processPacketData(HeightReference$1,o,"extrudedHeightReference",n.extrudedHeightReference,a,r,i),processPacketData(Rotation,o,"stRotation",n.stRotation,a,r,i),processPacketData(Number,o,"granularity",n.granularity,a,r,i),processPacketData(Boolean,o,"fill",n.fill,a,r,i),processMaterialPacketData(o,"material",n.material,a,r,i),processPacketData(Boolean,o,"outline",n.outline,a,r,i),processPacketData(Color,o,"outlineColor",n.outlineColor,a,r,i),processPacketData(Number,o,"outlineWidth",n.outlineWidth,a,r,i),processPacketData(Boolean,o,"perPositionHeight",n.perPositionHeight,a,r,i),processPacketData(Boolean,o,"closeTop",n.closeTop,a,r,i),processPacketData(Boolean,o,"closeBottom",n.closeBottom,a,r,i),processPacketData(ArcType$1,o,"arcType",n.arcType,a,r,i),processPacketData(ShadowMode$1,o,"shadows",n.shadows,a,r,i),processPacketData(DistanceDisplayCondition,o,"distanceDisplayCondition",n.distanceDisplayCondition,a,r,i),processPacketData(ClassificationType$1,o,"classificationType",n.classificationType,a,r,i),processPacketData(Number,o,"zIndex",n.zIndex,a,r,i)}}function adaptFollowSurfaceToArcType(e){return e?ArcType$1.GEODESIC:ArcType$1.NONE}function processPolyline(e,t,i,r){var n=t.polyline;if(defined(n)){var a=intervalFromString(n.interval),o=e.polyline;if(defined(o)||(e.polyline=o=new PolylineGraphics),processPacketData(Boolean,o,"show",n.show,a,r,i),processPositionArray(o,"positions",n.positions,i),processPacketData(Number,o,"width",n.width,a,r,i),processPacketData(Number,o,"granularity",n.granularity,a,r,i),processMaterialPacketData(o,"material",n.material,a,r,i),processMaterialPacketData(o,"depthFailMaterial",n.depthFailMaterial,a,r,i),processPacketData(ArcType$1,o,"arcType",n.arcType,a,r,i),processPacketData(Boolean,o,"clampToGround",n.clampToGround,a,r,i),processPacketData(ShadowMode$1,o,"shadows",n.shadows,a,r,i),processPacketData(DistanceDisplayCondition,o,"distanceDisplayCondition",n.distanceDisplayCondition,a,r,i),processPacketData(ClassificationType$1,o,"classificationType",n.classificationType,a,r,i),processPacketData(Number,o,"zIndex",n.zIndex,a,r,i),defined(n.followSurface)&&!defined(n.arcType)){var s={};processPacketData(Boolean,s,"followSurface",n.followSurface,a,r,i),o.arcType=createAdapterProperty(s.followSurface,adaptFollowSurfaceToArcType)}}}function processRectangle(e,t,i,r){var n=t.rectangle;if(defined(n)){var a=intervalFromString(n.interval),o=e.rectangle;defined(o)||(e.rectangle=o=new RectangleGraphics),processPacketData(Boolean,o,"show",n.show,a,r,i),processPacketData(Rectangle,o,"coordinates",n.coordinates,a,r,i),processPacketData(Number,o,"height",n.height,a,r,i),processPacketData(HeightReference$1,o,"heightReference",n.heightReference,a,r,i),processPacketData(Number,o,"extrudedHeight",n.extrudedHeight,a,r,i),processPacketData(HeightReference$1,o,"extrudedHeightReference",n.extrudedHeightReference,a,r,i),processPacketData(Rotation,o,"rotation",n.rotation,a,r,i),processPacketData(Rotation,o,"stRotation",n.stRotation,a,r,i),processPacketData(Number,o,"granularity",n.granularity,a,r,i),processPacketData(Boolean,o,"fill",n.fill,a,r,i),processMaterialPacketData(o,"material",n.material,a,r,i),processPacketData(Boolean,o,"outline",n.outline,a,r,i),processPacketData(Color,o,"outlineColor",n.outlineColor,a,r,i),processPacketData(Number,o,"outlineWidth",n.outlineWidth,a,r,i),processPacketData(ShadowMode$1,o,"shadows",n.shadows,a,r,i),processPacketData(DistanceDisplayCondition,o,"distanceDisplayCondition",n.distanceDisplayCondition,a,r,i),processPacketData(ClassificationType$1,o,"classificationType",n.classificationType,a,r,i),processPacketData(Number,o,"zIndex",n.zIndex,a,r,i)}}function processTileset(e,t,i,r){var n=t.tileset;if(defined(n)){var a=intervalFromString(n.interval),o=e.tileset;defined(o)||(e.tileset=o=new Cesium3DTilesetGraphics),processPacketData(Boolean,o,"show",n.show,a,r,i),processPacketData(URI,o,"uri",n.uri,a,r,i),processPacketData(Number,o,"maximumScreenSpaceError",n.maximumScreenSpaceError,a,r,i)}}function processWall(e,t,i,r){var n=t.wall;if(defined(n)){var a=intervalFromString(n.interval),o=e.wall;defined(o)||(e.wall=o=new WallGraphics),processPacketData(Boolean,o,"show",n.show,a,r,i),processPositionArray(o,"positions",n.positions,i),processArray(o,"minimumHeights",n.minimumHeights,i),processArray(o,"maximumHeights",n.maximumHeights,i),processPacketData(Number,o,"granularity",n.granularity,a,r,i),processPacketData(Boolean,o,"fill",n.fill,a,r,i),processMaterialPacketData(o,"material",n.material,a,r,i),processPacketData(Boolean,o,"outline",n.outline,a,r,i),processPacketData(Color,o,"outlineColor",n.outlineColor,a,r,i),processPacketData(Number,o,"outlineWidth",n.outlineWidth,a,r,i),processPacketData(ShadowMode$1,o,"shadows",n.shadows,a,r,i),processPacketData(DistanceDisplayCondition,o,"distanceDisplayCondition",n.distanceDisplayCondition,a,r,i)}}function processCzmlPacket(e,t,i,r,n){var a=e.id;if(defined(a)||(a=createGuid()),currentId=a,!defined(n._version)&&"document"!==a)throw new RuntimeError("The first CZML packet is required to be the document object.");if(!0===e.delete)t.removeById(a);else if("document"===a)processDocument$1(e,n);else{var o=t.getOrCreateEntity(a),s=e.parent;defined(s)&&(o.parent=t.getOrCreateEntity(s));for(var l=i.length-1;-1<l;l--)i[l](o,e,t,r)}currentId=void 0}function updateClock(e){var t,i=e._documentPacket.clock;if(!defined(i)){if(!defined(e._clock)){var r=e._entityCollection.computeAvailability();if(!r.start.equals(Iso8601.MINIMUM_VALUE)){var n=r.start,a=r.stop,o=JulianDate.secondsDifference(a,n),s=Math.round(o/120);return(t=new DataSourceClock).startTime=JulianDate.clone(n),t.stopTime=JulianDate.clone(a),t.clockRange=ClockRange$1.LOOP_STOP,t.multiplier=s,t.currentTime=JulianDate.clone(n),t.clockStep=ClockStep$1.SYSTEM_CLOCK_MULTIPLIER,e._clock=t,!0}}return!1}defined(e._clock)?t=e._clock.clone():((t=new DataSourceClock).startTime=Iso8601.MINIMUM_VALUE.clone(),t.stopTime=Iso8601.MAXIMUM_VALUE.clone(),t.currentTime=Iso8601.MINIMUM_VALUE.clone(),t.clockRange=ClockRange$1.LOOP_STOP,t.clockStep=ClockStep$1.SYSTEM_CLOCK_MULTIPLIER,t.multiplier=1);var l=intervalFromString(i.interval);return defined(l)&&(t.startTime=l.start,t.stopTime=l.stop),defined(i.currentTime)&&(t.currentTime=JulianDate.fromIso8601(i.currentTime)),defined(i.range)&&(t.clockRange=defaultValue(ClockRange$1[i.range],ClockRange$1.LOOP_STOP)),defined(i.step)&&(t.clockStep=defaultValue(ClockStep$1[i.step],ClockStep$1.SYSTEM_CLOCK_MULTIPLIER)),defined(i.multiplier)&&(t.multiplier=i.multiplier),!t.equals(e._clock)&&(e._clock=t.clone(e._clock),!0)}function load$2(t,e,i,r){var n=e,a=(i=defaultValue(i,defaultValue.EMPTY_OBJECT)).sourceUri,o=i.credit;if("string"==typeof o&&(o=new Credit(o)),t._credit=o,"string"==typeof e||e instanceof Resource){n=(e=Resource.createIfNeeded(e)).fetchJson(),a=defaultValue(a,e.clone());var s=t._resourceCredits,l=e.credits;if(defined(l))for(var u=l.length,c=0;c<u;c++)s.push(l[c])}return a=Resource.createIfNeeded(a),DataSource.setLoading(t,!0),when(n,function(e){return loadCzml(t,e,a,r)}).otherwise(function(e){return DataSource.setLoading(t,!1),t._error.raiseEvent(t,e),console.log(e),when.reject(e)})}function loadCzml(e,t,i,r){DataSource.setLoading(e,!0);var n=e._entityCollection;r&&(e._version=void 0,e._documentPacket=new DocumentPacket,n.removeAll()),CzmlDataSource._processCzml(t,n,i,void 0,e);var a=updateClock(e),o=e._documentPacket;return defined(o.name)&&e._name!==o.name?(e._name=o.name,a=!0):!defined(e._name)&&defined(i)&&(e._name=getFilenameFromUri(i.getUrlComponent()),a=!0),DataSource.setLoading(e,!1),a&&e._changed.raiseEvent(e),e}function DocumentPacket(){this.name=void 0,this.clock=void 0}function CzmlDataSource(e){this._name=e,this._changed=new Event,this._error=new Event,this._isLoading=!1,this._loading=new Event,this._clock=void 0,this._documentPacket=new DocumentPacket,this._version=void 0,this._entityCollection=new EntityCollection(this),this._entityCluster=new EntityCluster,this._credit=void 0,this._resourceCredits=[]}function DataSourceCollection(){this._dataSources=[],this._dataSourceAdded=new Event,this._dataSourceRemoved=new Event,this._dataSourceMoved=new Event}function getIndex(e,t){return e.indexOf(t)}function swapDataSources(e,t,i){var r=e._dataSources,n=r.length-1;if((t=CesiumMath.clamp(t,0,n))!==(i=CesiumMath.clamp(i,0,n))){var a=r[t];r[t]=r[i],r[i]=a,e.dataSourceMoved.raiseEvent(a,i,t)}}function OrderedGroundPrimitiveCollection(){this._length=0,this._collections={},this._collectionsArray=[],this.show=!0}function DynamicGeometryBatch(e,t){this._primitives=e,this._orderedGroundPrimitives=t,this._dynamicUpdaters=new AssociativeArray}Object.defineProperties(PolygonHierarchyProperty.prototype,{isConstant:{get:function(){var e=this.polygon._positions,t=this.polygon._holes;return(!defined(e)||e.isConstant)&&(!defined(t)||t.isConstant)}},definitionChanged:{get:function(){return this._definitionChanged}}}),PolygonHierarchyProperty.prototype.getValue=function(e,t){var i,r;return defined(this.polygon._positions)&&(i=this.polygon._positions.getValue(e)),defined(this.polygon._holes)&&defined(r=this.polygon._holes.getValue(e))&&(r=r.map(function(e){return new PolygonHierarchy(e)})),defined(t)?(t.positions=i,t.holes=r,t):new PolygonHierarchy(i,r)},PolygonHierarchyProperty.prototype.equals=function(e){return this===e||e instanceof PolygonHierarchyProperty&&Property.equals(this.polygon._positions,e.polygon._positions)&&Property.equals(this.polygon._holes,e.polygon._holes)},CzmlDataSource.load=function(e,t){return(new CzmlDataSource).load(e,t)},Object.defineProperties(CzmlDataSource.prototype,{name:{get:function(){return this._name}},clock:{get:function(){return this._clock}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}},credit:{get:function(){return this._credit}}}),CzmlDataSource.updaters=[processBillboard,processBox,processCorridor,processCylinder,processEllipse,processEllipsoid,processLabel,processModel,processName,processDescription$1,processPath,processPoint$2,processPolygon$2,processPolyline,processProperties,processRectangle,processPosition,processTileset,processViewFrom,processWall,processOrientation,processAvailability],CzmlDataSource.prototype.process=function(e,t){return load$2(this,e,t,!1)},CzmlDataSource.prototype.load=function(e,t){return load$2(this,e,t,!0)},CzmlDataSource.processPacketData=processPacketData,CzmlDataSource.processPositionPacketData=processPositionPacketData,CzmlDataSource.processMaterialPacketData=processMaterialPacketData,CzmlDataSource._processCzml=function(e,t,i,r,n){if(r=defaultValue(r,CzmlDataSource.updaters),Array.isArray(e))for(var a=0,o=e.length;a<o;++a)processCzmlPacket(e[a],t,r,i,n);else processCzmlPacket(e,t,r,i,n)},Object.defineProperties(DataSourceCollection.prototype,{length:{get:function(){return this._dataSources.length}},dataSourceAdded:{get:function(){return this._dataSourceAdded}},dataSourceRemoved:{get:function(){return this._dataSourceRemoved}},dataSourceMoved:{get:function(){return this._dataSourceMoved}}}),DataSourceCollection.prototype.add=function(e){var t=this,i=this._dataSources;return when(e,function(e){return i===t._dataSources&&(t._dataSources.push(e),t._dataSourceAdded.raiseEvent(t,e)),e})},DataSourceCollection.prototype.remove=function(e,t){t=defaultValue(t,!1);var i=this._dataSources.indexOf(e);return-1!==i&&(this._dataSources.splice(i,1),this._dataSourceRemoved.raiseEvent(this,e),t&&"function"==typeof e.destroy&&e.destroy(),!0)},DataSourceCollection.prototype.removeAll=function(e){e=defaultValue(e,!1);for(var t=this._dataSources,i=0,r=t.length;i<r;++i){var n=t[i];this._dataSourceRemoved.raiseEvent(this,n),e&&"function"==typeof n.destroy&&n.destroy()}this._dataSources=[]},DataSourceCollection.prototype.contains=function(e){return-1!==this.indexOf(e)},DataSourceCollection.prototype.indexOf=function(e){return this._dataSources.indexOf(e)},DataSourceCollection.prototype.get=function(e){return this._dataSources[e]},DataSourceCollection.prototype.getByName=function(t){return this._dataSources.filter(function(e){return e.name===t})},DataSourceCollection.prototype.raise=function(e){var t=getIndex(this._dataSources,e);swapDataSources(this,t,t+1)},DataSourceCollection.prototype.lower=function(e){var t=getIndex(this._dataSources,e);swapDataSources(this,t,t-1)},DataSourceCollection.prototype.raiseToTop=function(e){var t=getIndex(this._dataSources,e);t!==this._dataSources.length-1&&(this._dataSources.splice(t,1),this._dataSources.push(e),this.dataSourceMoved.raiseEvent(e,this._dataSources.length-1,t))},DataSourceCollection.prototype.lowerToBottom=function(e){var t=getIndex(this._dataSources,e);0!==t&&(this._dataSources.splice(t,1),this._dataSources.splice(0,0,e),this.dataSourceMoved.raiseEvent(e,0,t))},DataSourceCollection.prototype.isDestroyed=function(){return!1},DataSourceCollection.prototype.destroy=function(){return this.removeAll(!0),destroyObject(this)},Object.defineProperties(OrderedGroundPrimitiveCollection.prototype,{length:{get:function(){return this._length}}}),OrderedGroundPrimitiveCollection.prototype.add=function(e,t){t=defaultValue(t,0);var i=this._collections[t];if(!defined(i)){(i=new PrimitiveCollection({destroyPrimitives:!1}))._zIndex=t,this._collections[t]=i;for(var r=this._collectionsArray,n=0;n<r.length&&r[n]._zIndex<t;)n++;r.splice(n,0,i)}return i.add(e),this._length++,e._zIndex=t,e},OrderedGroundPrimitiveCollection.prototype.set=function(e,t){return t===e._zIndex||(this.remove(e,!0),this.add(e,t)),e},OrderedGroundPrimitiveCollection.prototype.remove=function(e,t){if(this.contains(e)){var i,r=e._zIndex,n=this._collections[r];return(i=t?n.remove(e):n.removeAndDestroy(e))&&this._length--,0===n.length&&(this._collectionsArray.splice(this._collectionsArray.indexOf(n),1),this._collections[r]=void 0,n.destroy()),i}return!1},OrderedGroundPrimitiveCollection.prototype.removeAll=function(){for(var e=this._collectionsArray,t=0;t<e.length;t++){var i=e[t];i.destroyPrimitives=!0,i.destroy()}this._collections={},this._collectionsArray=[],this._length=0},OrderedGroundPrimitiveCollection.prototype.contains=function(e){if(!defined(e))return!1;var t=this._collections[e._zIndex];return defined(t)&&t.contains(e)},OrderedGroundPrimitiveCollection.prototype.update=function(e){if(this.show)for(var t=this._collectionsArray,i=0;i<t.length;i++)t[i].update(e)},OrderedGroundPrimitiveCollection.prototype.isDestroyed=function(){return!1},OrderedGroundPrimitiveCollection.prototype.destroy=function(){return this.removeAll(),destroyObject(this)},DynamicGeometryBatch.prototype.add=function(e,t){this._dynamicUpdaters.set(t.id,t.createDynamicUpdater(this._primitives,this._orderedGroundPrimitives))},DynamicGeometryBatch.prototype.remove=function(e){var t=e.id,i=this._dynamicUpdaters.get(t);defined(i)&&(this._dynamicUpdaters.remove(t),i.destroy())},DynamicGeometryBatch.prototype.update=function(e){for(var t=this._dynamicUpdaters.values,i=0,r=t.length;i<r;i++)t[i].update(e);return!0},DynamicGeometryBatch.prototype.removeAllPrimitives=function(){for(var e=this._dynamicUpdaters.values,t=0,i=e.length;t<i;t++)e[t].destroy();this._dynamicUpdaters.removeAll()},DynamicGeometryBatch.prototype.getBoundingSphere=function(e,t){return defined(e=this._dynamicUpdaters.get(e.id))&&defined(e.getBoundingSphere)?e.getBoundingSphere(t):BoundingSphereState$1.FAILED};var scratchColor$d=new Color,defaultOffset$4=Cartesian3.ZERO,offsetScratch$7=new Cartesian3,scratchRectangle$4=new Rectangle;function EllipseGeometryOptions(e){this.id=e,this.vertexFormat=void 0,this.center=void 0,this.semiMajorAxis=void 0,this.semiMinorAxis=void 0,this.rotation=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.numberOfVerticalLines=void 0,this.offsetAttribute=void 0}function EllipseGeometryUpdater(e,t){GroundGeometryUpdater.call(this,{entity:e,scene:t,geometryOptions:new EllipseGeometryOptions(e),geometryPropertyName:"ellipse",observedPropertyNames:["availability","position","ellipse"]}),this._onEntityPropertyChanged(e,"ellipse",e.ellipse,void 0)}function DynamicEllipseGeometryUpdater(e,t,i){DynamicGeometryUpdater.call(this,e,t,i)}defined(Object.create)&&(EllipseGeometryUpdater.prototype=Object.create(GroundGeometryUpdater.prototype),EllipseGeometryUpdater.prototype.constructor=EllipseGeometryUpdater),EllipseGeometryUpdater.prototype.createFillGeometryInstance=function(e){var t,i=this._entity,r=i.isAvailable(e),n={show:new ShowGeometryInstanceAttribute(r&&i.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};this._materialProperty instanceof ColorMaterialProperty&&(defined(this._materialProperty.color)&&(this._materialProperty.color.isConstant||r)&&(t=this._materialProperty.color.getValue(e,scratchColor$d)),defined(t)||(t=Color.WHITE),n.color=ColorGeometryInstanceAttribute.fromColor(t));return defined(this._options.offsetAttribute)&&(n.offset=OffsetGeometryInstanceAttribute.fromCartesian3(Property.getValueOrDefault(this._terrainOffsetProperty,e,defaultOffset$4,offsetScratch$7))),new GeometryInstance({id:i,geometry:new EllipseGeometry(this._options),attributes:n})},EllipseGeometryUpdater.prototype.createOutlineGeometryInstance=function(e){var t=this._entity,i=t.isAvailable(e),r=Property.getValueOrDefault(this._outlineColorProperty,e,Color.BLACK,scratchColor$d),n=this._distanceDisplayConditionProperty.getValue(e),a={show:new ShowGeometryInstanceAttribute(i&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:ColorGeometryInstanceAttribute.fromColor(r),distanceDisplayCondition:DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(n),offset:void 0};return defined(this._options.offsetAttribute)&&(a.offset=OffsetGeometryInstanceAttribute.fromCartesian3(Property.getValueOrDefault(this._terrainOffsetProperty,e,defaultOffset$4,offsetScratch$7))),new GeometryInstance({id:t,geometry:new EllipseOutlineGeometry(this._options),attributes:a})},EllipseGeometryUpdater.prototype._computeCenter=function(e,t){return Property.getValueOrUndefined(this._entity.position,e,t)},EllipseGeometryUpdater.prototype._isHidden=function(e,t){return!defined(e.position)||!defined(t.semiMajorAxis)||!defined(t.semiMinorAxis)||GeometryUpdater.prototype._isHidden.call(this,e,t)},EllipseGeometryUpdater.prototype._isDynamic=function(e,t){return!e.position.isConstant||!t.semiMajorAxis.isConstant||!t.semiMinorAxis.isConstant||!Property.isConstant(t.rotation)||!Property.isConstant(t.height)||!Property.isConstant(t.extrudedHeight)||!Property.isConstant(t.granularity)||!Property.isConstant(t.stRotation)||!Property.isConstant(t.outlineWidth)||!Property.isConstant(t.numberOfVerticalLines)||!Property.isConstant(t.zIndex)||this._onTerrain&&!Property.isConstant(this._materialProperty)&&!(this._materialProperty instanceof ColorMaterialProperty)},EllipseGeometryUpdater.prototype._setStaticOptions=function(e,t){var i=Property.getValueOrUndefined(t.height,Iso8601.MINIMUM_VALUE),r=Property.getValueOrDefault(t.heightReference,Iso8601.MINIMUM_VALUE,HeightReference$1.NONE),n=Property.getValueOrUndefined(t.extrudedHeight,Iso8601.MINIMUM_VALUE),a=Property.getValueOrDefault(t.extrudedHeightReference,Iso8601.MINIMUM_VALUE,HeightReference$1.NONE);defined(n)&&!defined(i)&&(i=0);var o=this._options;o.vertexFormat=this._materialProperty instanceof ColorMaterialProperty?PerInstanceColorAppearance.VERTEX_FORMAT:MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat,o.center=e.position.getValue(Iso8601.MINIMUM_VALUE,o.center),o.semiMajorAxis=t.semiMajorAxis.getValue(Iso8601.MINIMUM_VALUE,o.semiMajorAxis),o.semiMinorAxis=t.semiMinorAxis.getValue(Iso8601.MINIMUM_VALUE,o.semiMinorAxis),o.rotation=Property.getValueOrUndefined(t.rotation,Iso8601.MINIMUM_VALUE),o.granularity=Property.getValueOrUndefined(t.granularity,Iso8601.MINIMUM_VALUE),o.stRotation=Property.getValueOrUndefined(t.stRotation,Iso8601.MINIMUM_VALUE),o.numberOfVerticalLines=Property.getValueOrUndefined(t.numberOfVerticalLines,Iso8601.MINIMUM_VALUE),o.offsetAttribute=GroundGeometryUpdater.computeGeometryOffsetAttribute(i,r,n,a),o.height=GroundGeometryUpdater.getGeometryHeight(i,r),(n=GroundGeometryUpdater.getGeometryExtrudedHeight(n,a))===GroundGeometryUpdater.CLAMP_TO_GROUND&&(n=ApproximateTerrainHeights.getMinimumMaximumHeights(EllipseGeometry.computeRectangle(o,scratchRectangle$4)).minimumTerrainHeight),o.extrudedHeight=n},EllipseGeometryUpdater.DynamicGeometryUpdater=DynamicEllipseGeometryUpdater,defined(Object.create)&&(DynamicEllipseGeometryUpdater.prototype=Object.create(DynamicGeometryUpdater.prototype),DynamicEllipseGeometryUpdater.prototype.constructor=DynamicEllipseGeometryUpdater),DynamicEllipseGeometryUpdater.prototype._isHidden=function(e,t,i){var r=this._options;return!defined(r.center)||!defined(r.semiMajorAxis)||!defined(r.semiMinorAxis)||DynamicGeometryUpdater.prototype._isHidden.call(this,e,t,i)},DynamicEllipseGeometryUpdater.prototype._setOptions=function(e,t,i){var r=this._options,n=Property.getValueOrUndefined(t.height,i),a=Property.getValueOrDefault(t.heightReference,i,HeightReference$1.NONE),o=Property.getValueOrUndefined(t.extrudedHeight,i),s=Property.getValueOrDefault(t.extrudedHeightReference,i,HeightReference$1.NONE);defined(o)&&!defined(n)&&(n=0),r.center=Property.getValueOrUndefined(e.position,i,r.center),r.semiMajorAxis=Property.getValueOrUndefined(t.semiMajorAxis,i),r.semiMinorAxis=Property.getValueOrUndefined(t.semiMinorAxis,i),r.rotation=Property.getValueOrUndefined(t.rotation,i),r.granularity=Property.getValueOrUndefined(t.granularity,i),r.stRotation=Property.getValueOrUndefined(t.stRotation,i),r.numberOfVerticalLines=Property.getValueOrUndefined(t.numberOfVerticalLines,i),r.offsetAttribute=GroundGeometryUpdater.computeGeometryOffsetAttribute(n,a,o,s),r.height=GroundGeometryUpdater.getGeometryHeight(n,a),(o=GroundGeometryUpdater.getGeometryExtrudedHeight(o,s))===GroundGeometryUpdater.CLAMP_TO_GROUND&&(o=ApproximateTerrainHeights.getMinimumMaximumHeights(EllipseGeometry.computeRectangle(r,scratchRectangle$4)).minimumTerrainHeight),r.extrudedHeight=o};var defaultMaterial$1=new ColorMaterialProperty(Color.WHITE),defaultOffset$5=Cartesian3.ZERO,offsetScratch$8=new Cartesian3,radiiScratch=new Cartesian3,innerRadiiScratch=new Cartesian3,scratchColor$e=new Color,unitSphere=new Cartesian3(1,1,1);function EllipsoidGeometryOptions(e){this.id=e,this.vertexFormat=void 0,this.radii=void 0,this.innerRadii=void 0,this.minimumClock=void 0,this.maximumClock=void 0,this.minimumCone=void 0,this.maximumCone=void 0,this.stackPartitions=void 0,this.slicePartitions=void 0,this.subdivisions=void 0,this.offsetAttribute=void 0}function EllipsoidGeometryUpdater(e,t){GeometryUpdater.call(this,{entity:e,scene:t,geometryOptions:new EllipsoidGeometryOptions(e),geometryPropertyName:"ellipsoid",observedPropertyNames:["availability","position","orientation","ellipsoid"]}),this._onEntityPropertyChanged(e,"ellipsoid",e.ellipsoid,void 0)}function DynamicEllipsoidGeometryUpdater(e,t,i){DynamicGeometryUpdater.call(this,e,t,i),this._scene=e._scene,this._modelMatrix=new Matrix4,this._attributes=void 0,this._outlineAttributes=void 0,this._lastSceneMode=void 0,this._lastShow=void 0,this._lastOutlineShow=void 0,this._lastOutlineWidth=void 0,this._lastOutlineColor=void 0,this._lastOffset=new Cartesian3,this._material={}}defined(Object.create)&&(EllipsoidGeometryUpdater.prototype=Object.create(GeometryUpdater.prototype),EllipsoidGeometryUpdater.prototype.constructor=EllipsoidGeometryUpdater),Object.defineProperties(EllipsoidGeometryUpdater.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}}),EllipsoidGeometryUpdater.prototype.createFillGeometryInstance=function(e,t,i){var r,n,a=this._entity,o=a.isAvailable(e),s=new ShowGeometryInstanceAttribute(o&&a.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),l=this._distanceDisplayConditionProperty.getValue(e),u={show:s,distanceDisplayCondition:DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(l),color:void 0,offset:void 0};this._materialProperty instanceof ColorMaterialProperty&&(defined(this._materialProperty.color)&&(this._materialProperty.color.isConstant||o)&&(n=this._materialProperty.color.getValue(e,scratchColor$e)),defined(n)||(n=Color.WHITE),r=ColorGeometryInstanceAttribute.fromColor(n),u.color=r);return defined(this._options.offsetAttribute)&&(u.offset=OffsetGeometryInstanceAttribute.fromCartesian3(Property.getValueOrDefault(this._terrainOffsetProperty,e,defaultOffset$5,offsetScratch$8))),new GeometryInstance({id:a,geometry:new EllipsoidGeometry(this._options),modelMatrix:t?void 0:a.computeModelMatrixForHeightReference(e,a.ellipsoid.heightReference,.5*this._options.radii.z,this._scene.mapProjection.ellipsoid,i),attributes:u})},EllipsoidGeometryUpdater.prototype.createOutlineGeometryInstance=function(e,t,i){var r=this._entity,n=r.isAvailable(e),a=Property.getValueOrDefault(this._outlineColorProperty,e,Color.BLACK,scratchColor$e),o=this._distanceDisplayConditionProperty.getValue(e),s={show:new ShowGeometryInstanceAttribute(n&&r.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:ColorGeometryInstanceAttribute.fromColor(a),distanceDisplayCondition:DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(o),offset:void 0};return defined(this._options.offsetAttribute)&&(s.offset=OffsetGeometryInstanceAttribute.fromCartesian3(Property.getValueOrDefault(this._terrainOffsetProperty,e,defaultOffset$5,offsetScratch$8))),new GeometryInstance({id:r,geometry:new EllipsoidOutlineGeometry(this._options),modelMatrix:t?void 0:r.computeModelMatrixForHeightReference(e,r.ellipsoid.heightReference,.5*this._options.radii.z,this._scene.mapProjection.ellipsoid,i),attributes:s})},EllipsoidGeometryUpdater.prototype._computeCenter=function(e,t){return Property.getValueOrUndefined(this._entity.position,e,t)},EllipsoidGeometryUpdater.prototype._isHidden=function(e,t){return!defined(e.position)||!defined(t.radii)||GeometryUpdater.prototype._isHidden.call(this,e,t)},EllipsoidGeometryUpdater.prototype._isDynamic=function(e,t){return!(e.position.isConstant&&Property.isConstant(e.orientation)&&t.radii.isConstant&&Property.isConstant(t.innerRadii)&&Property.isConstant(t.stackPartitions)&&Property.isConstant(t.slicePartitions)&&Property.isConstant(t.outlineWidth)&&Property.isConstant(t.minimumClock)&&Property.isConstant(t.maximumClock)&&Property.isConstant(t.minimumCone)&&Property.isConstant(t.maximumCone)&&Property.isConstant(t.subdivisions))},EllipsoidGeometryUpdater.prototype._setStaticOptions=function(e,t){var i=Property.getValueOrDefault(t.heightReference,Iso8601.MINIMUM_VALUE,HeightReference$1.NONE),r=this._options;r.vertexFormat=this._materialProperty instanceof ColorMaterialProperty?PerInstanceColorAppearance.VERTEX_FORMAT:MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat,r.radii=t.radii.getValue(Iso8601.MINIMUM_VALUE,r.radii),r.innerRadii=Property.getValueOrUndefined(t.innerRadii,r.radii),r.minimumClock=Property.getValueOrUndefined(t.minimumClock,Iso8601.MINIMUM_VALUE),r.maximumClock=Property.getValueOrUndefined(t.maximumClock,Iso8601.MINIMUM_VALUE),r.minimumCone=Property.getValueOrUndefined(t.minimumCone,Iso8601.MINIMUM_VALUE),r.maximumCone=Property.getValueOrUndefined(t.maximumCone,Iso8601.MINIMUM_VALUE),r.stackPartitions=Property.getValueOrUndefined(t.stackPartitions,Iso8601.MINIMUM_VALUE),r.slicePartitions=Property.getValueOrUndefined(t.slicePartitions,Iso8601.MINIMUM_VALUE),r.subdivisions=Property.getValueOrUndefined(t.subdivisions,Iso8601.MINIMUM_VALUE),r.offsetAttribute=i!==HeightReference$1.NONE?GeometryOffsetAttribute$1.ALL:void 0},EllipsoidGeometryUpdater.prototype._onEntityPropertyChanged=heightReferenceOnEntityPropertyChanged,EllipsoidGeometryUpdater.DynamicGeometryUpdater=DynamicEllipsoidGeometryUpdater,defined(Object.create)&&(DynamicEllipsoidGeometryUpdater.prototype=Object.create(DynamicGeometryUpdater.prototype),DynamicEllipsoidGeometryUpdater.prototype.constructor=DynamicEllipsoidGeometryUpdater),DynamicEllipsoidGeometryUpdater.prototype.update=function(e){var t=this._entity,i=t.ellipsoid;if(!t.isShowing||!t.isAvailable(e)||!Property.getValueOrDefault(i.show,e,!0))return defined(this._primitive)&&(this._primitive.show=!1),void(defined(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1));var r=Property.getValueOrUndefined(i.radii,e,radiiScratch),n=defined(r)?t.computeModelMatrixForHeightReference(e,i.heightReference,.5*r.z,this._scene.mapProjection.ellipsoid,this._modelMatrix):void 0;if(!defined(n)||!defined(r))return defined(this._primitive)&&(this._primitive.show=!1),void(defined(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1));var a=Property.getValueOrDefault(i.fill,e,!0),o=Property.getValueOrDefault(i.outline,e,!1),s=Property.getValueOrClonedDefault(i.outlineColor,e,Color.BLACK,scratchColor$e),l=MaterialProperty.getValue(e,defaultValue(i.material,defaultMaterial$1),this._material),u=Property.getValueOrUndefined(i.innerRadii,e,innerRadiiScratch),c=Property.getValueOrUndefined(i.minimumClock,e),d=Property.getValueOrUndefined(i.maximumClock,e),h=Property.getValueOrUndefined(i.minimumCone,e),p=Property.getValueOrUndefined(i.maximumCone,e),f=Property.getValueOrUndefined(i.stackPartitions,e),m=Property.getValueOrUndefined(i.slicePartitions,e),g=Property.getValueOrUndefined(i.subdivisions,e),y=Property.getValueOrDefault(i.outlineWidth,e,1),v=Property.getValueOrDefault(i.heightReference,e,HeightReference$1.NONE),_=v!==HeightReference$1.NONE?GeometryOffsetAttribute$1.ALL:void 0,C=this._scene.mode,x=C===SceneMode$1.SCENE3D&&v===HeightReference$1.NONE,b=this._options,A=this._geometryUpdater.shadowsProperty.getValue(e),S=this._geometryUpdater.distanceDisplayConditionProperty.getValue(e),w=Property.getValueOrDefault(this._geometryUpdater.terrainOffsetProperty,e,defaultOffset$5,offsetScratch$8);if(!x||this._lastSceneMode!==C||!defined(this._primitive)||b.stackPartitions!==f||b.slicePartitions!==m||defined(u)&&!Cartesian3.equals(b.innerRadii!==u)||b.minimumClock!==c||b.maximumClock!==d||b.minimumCone!==h||b.maximumCone!==p||b.subdivisions!==g||this._lastOutlineWidth!==y||b.offsetAttribute!==_){var E=this._primitives;if(E.removeAndDestroy(this._primitive),E.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0,this._lastSceneMode=C,this._lastOutlineWidth=y,b.stackPartitions=f,b.slicePartitions=m,b.subdivisions=g,b.offsetAttribute=_,b.radii=Cartesian3.clone(x?unitSphere:r,b.radii),defined(u))if(x){var T=Cartesian3.magnitude(r);b.innerRadii=Cartesian3.fromElements(u.x/T,u.y/T,u.z/T,b.innerRadii)}else b.innerRadii=Cartesian3.clone(u,b.innerRadii);else b.innerRadii=void 0;b.minimumClock=c,b.maximumClock=d,b.minimumCone=h,b.maximumCone=p;var P=new MaterialAppearance({material:l,translucent:l.isTranslucent(),closed:!0});b.vertexFormat=P.vertexFormat;var M=this._geometryUpdater.createFillGeometryInstance(e,x,this._modelMatrix);this._primitive=E.add(new Primitive({geometryInstances:M,appearance:P,asynchronous:!1,shadows:A}));var D=this._geometryUpdater.createOutlineGeometryInstance(e,x,this._modelMatrix);this._outlinePrimitive=E.add(new Primitive({geometryInstances:D,appearance:new PerInstanceColorAppearance({flat:!0,translucent:255!==D.attributes.color.value[3],renderState:{lineWidth:this._geometryUpdater._scene.clampLineWidth(y)}}),asynchronous:!1,shadows:A})),this._lastShow=a,this._lastOutlineShow=o,this._lastOutlineColor=Color.clone(s,this._lastOutlineColor),this._lastDistanceDisplayCondition=S,this._lastOffset=Cartesian3.clone(w,this._lastOffset)}else if(this._primitive.ready){var I=this._primitive,O=this._outlinePrimitive;I.show=!0,O.show=!0,I.appearance.material=l;var R=this._attributes;defined(R)||(R=I.getGeometryInstanceAttributes(t),this._attributes=R),a!==this._lastShow&&(R.show=ShowGeometryInstanceAttribute.toValue(a,R.show),this._lastShow=a);var L=this._outlineAttributes;defined(L)||(L=O.getGeometryInstanceAttributes(t),this._outlineAttributes=L),o!==this._lastOutlineShow&&(L.show=ShowGeometryInstanceAttribute.toValue(o,L.show),this._lastOutlineShow=o),Color.equals(s,this._lastOutlineColor)||(L.color=ColorGeometryInstanceAttribute.toValue(s,L.color),Color.clone(s,this._lastOutlineColor)),DistanceDisplayCondition.equals(S,this._lastDistanceDisplayCondition)||(R.distanceDisplayCondition=DistanceDisplayConditionGeometryInstanceAttribute.toValue(S,R.distanceDisplayCondition),L.distanceDisplayCondition=DistanceDisplayConditionGeometryInstanceAttribute.toValue(S,L.distanceDisplayCondition),DistanceDisplayCondition.clone(S,this._lastDistanceDisplayCondition)),Cartesian3.equals(w,this._lastOffset)||(R.offset=OffsetGeometryInstanceAttribute.toValue(w,R.offset),L.offset=OffsetGeometryInstanceAttribute.toValue(w,R.offset),Cartesian3.clone(w,this._lastOffset))}x&&(r.x=Math.max(r.x,.001),r.y=Math.max(r.y,.001),r.z=Math.max(r.z,.001),n=Matrix4.multiplyByScale(n,r,n),this._primitive.modelMatrix=n,this._outlinePrimitive.modelMatrix=n)};var positionScratch$a=new Cartesian3,scratchColor$f=new Color;function PlaneGeometryOptions(e){this.id=e,this.vertexFormat=void 0,this.plane=void 0,this.dimensions=void 0}function PlaneGeometryUpdater(e,t){GeometryUpdater.call(this,{entity:e,scene:t,geometryOptions:new PlaneGeometryOptions(e),geometryPropertyName:"plane",observedPropertyNames:["availability","position","orientation","plane"]}),this._onEntityPropertyChanged(e,"plane",e.plane,void 0)}function DynamicPlaneGeometryUpdater(e,t,i){DynamicGeometryUpdater.call(this,e,t,i)}defined(Object.create)&&(PlaneGeometryUpdater.prototype=Object.create(GeometryUpdater.prototype),PlaneGeometryUpdater.prototype.constructor=PlaneGeometryUpdater),PlaneGeometryUpdater.prototype.createFillGeometryInstance=function(e){var t,i,r=this._entity,n=r.isAvailable(e),a=new ShowGeometryInstanceAttribute(n&&r.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),s=DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(o);this._materialProperty instanceof ColorMaterialProperty?(defined(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(i=this._materialProperty.color.getValue(e,scratchColor$f)),defined(i)||(i=Color.WHITE),t={show:a,distanceDisplayCondition:s,color:ColorGeometryInstanceAttribute.fromColor(i)}):t={show:a,distanceDisplayCondition:s};var l=r.plane,u=this._options,c=r.computeModelMatrix(e),d=Property.getValueOrDefault(l.plane,e,u.plane),h=Property.getValueOrUndefined(l.dimensions,e,u.dimensions);return c=createPrimitiveMatrix(u.plane=d,u.dimensions=h,c,this._scene.mapProjection.ellipsoid,c),new GeometryInstance({id:r,geometry:new PlaneGeometry(this._options),modelMatrix:c,attributes:t})},PlaneGeometryUpdater.prototype.createOutlineGeometryInstance=function(e){var t=this._entity,i=t.isAvailable(e),r=Property.getValueOrDefault(this._outlineColorProperty,e,Color.BLACK,scratchColor$f),n=this._distanceDisplayConditionProperty.getValue(e),a=t.plane,o=this._options,s=t.computeModelMatrix(e),l=Property.getValueOrDefault(a.plane,e,o.plane),u=Property.getValueOrUndefined(a.dimensions,e,o.dimensions);return s=createPrimitiveMatrix(o.plane=l,o.dimensions=u,s,this._scene.mapProjection.ellipsoid,s),new GeometryInstance({id:t,geometry:new PlaneOutlineGeometry,modelMatrix:s,attributes:{show:new ShowGeometryInstanceAttribute(i&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:ColorGeometryInstanceAttribute.fromColor(r),distanceDisplayCondition:DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(n)}})},PlaneGeometryUpdater.prototype._isHidden=function(e,t){return!defined(t.plane)||!defined(t.dimensions)||!defined(e.position)||GeometryUpdater.prototype._isHidden.call(this,e,t)},PlaneGeometryUpdater.prototype._getIsClosed=function(e){return!1},PlaneGeometryUpdater.prototype._isDynamic=function(e,t){return!(e.position.isConstant&&Property.isConstant(e.orientation)&&t.plane.isConstant&&t.dimensions.isConstant&&Property.isConstant(t.outlineWidth))},PlaneGeometryUpdater.prototype._setStaticOptions=function(e,t){var i=this._materialProperty instanceof ColorMaterialProperty,r=this._options;r.vertexFormat=i?PerInstanceColorAppearance.VERTEX_FORMAT:MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat,r.plane=t.plane.getValue(Iso8601.MINIMUM_VALUE,r.plane),r.dimensions=t.dimensions.getValue(Iso8601.MINIMUM_VALUE,r.dimensions)},PlaneGeometryUpdater.DynamicGeometryUpdater=DynamicPlaneGeometryUpdater,defined(Object.create)&&(DynamicPlaneGeometryUpdater.prototype=Object.create(DynamicGeometryUpdater.prototype),DynamicPlaneGeometryUpdater.prototype.constructor=DynamicPlaneGeometryUpdater),DynamicPlaneGeometryUpdater.prototype._isHidden=function(e,t,i){var r=this._options;return!defined(Property.getValueOrUndefined(e.position,i,positionScratch$a))||!defined(r.plane)||!defined(r.dimensions)||DynamicGeometryUpdater.prototype._isHidden.call(this,e,t,i)},DynamicPlaneGeometryUpdater.prototype._setOptions=function(e,t,i){var r=this._options;r.plane=Property.getValueOrDefault(t.plane,i,r.plane),r.dimensions=Property.getValueOrUndefined(t.dimensions,i,r.dimensions)};var scratchAxis$1=new Cartesian3,scratchAxis2=new Cartesian3,scratchTranslation$4=new Cartesian3,scratchNormal$7=new Cartesian3,scratchScale$b=new Cartesian3,scratchQuaternion$1=new Quaternion,scratchMatrix3$1=new Matrix3;function createPrimitiveMatrix(e,t,i,r,n){var a=e.normal,o=e.distance,s=Cartesian3.multiplyByScalar(a,-o,scratchTranslation$4);s=Matrix4.multiplyByPoint(i,s,s);var l=Matrix4.multiplyByPointAsVector(i,a,scratchNormal$7);Cartesian3.normalize(l,l);var u=r.geodeticSurfaceNormal(s,scratchAxis2);CesiumMath.equalsEpsilon(Math.abs(Cartesian3.dot(u,l)),1,CesiumMath.EPSILON8)&&(u=Cartesian3.clone(Cartesian3.UNIT_Z,u),CesiumMath.equalsEpsilon(Math.abs(Cartesian3.dot(u,l)),1,CesiumMath.EPSILON8)&&(u=Cartesian3.clone(Cartesian3.UNIT_X,u)));var c=Cartesian3.cross(u,l,scratchAxis$1);u=Cartesian3.cross(l,c,u),Cartesian3.normalize(c,c),Cartesian3.normalize(u,u);var d=scratchMatrix3$1;Matrix3.setColumn(d,0,c,d),Matrix3.setColumn(d,1,u,d),Matrix3.setColumn(d,2,l,d);var h=Quaternion.fromRotationMatrix(d,scratchQuaternion$1),p=Cartesian2.clone(t,scratchScale$b);return p.z=1,Matrix4.fromTranslationQuaternionRotationScale(s,h,p,n)}PlaneGeometryUpdater.createPrimitiveMatrix=createPrimitiveMatrix;var heightAndPerPositionHeightWarning="Entity polygons cannot have both height and perPositionHeight. height will be ignored",heightReferenceAndPerPositionHeightWarning="heightReference is not supported for entity polygons with perPositionHeight. heightReference will be ignored",scratchColor$g=new Color,defaultOffset$6=Cartesian3.ZERO,offsetScratch$9=new Cartesian3,scratchRectangle$5=new Rectangle,scratch2DPositions=[],cart2Scratch=new Cartesian2;function PolygonGeometryOptions(e){this.id=e,this.vertexFormat=void 0,this.polygonHierarchy=void 0,this.perPositionHeight=void 0,this.closeTop=void 0,this.closeBottom=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.offsetAttribute=void 0,this.arcType=void 0}function PolygonGeometryUpdater(e,t){GroundGeometryUpdater.call(this,{entity:e,scene:t,geometryOptions:new PolygonGeometryOptions(e),geometryPropertyName:"polygon",observedPropertyNames:["availability","polygon"]}),this._onEntityPropertyChanged(e,"polygon",e.polygon,void 0)}function DyanmicPolygonGeometryUpdater(e,t,i){DynamicGeometryUpdater.call(this,e,t,i)}defined(Object.create)&&(PolygonGeometryUpdater.prototype=Object.create(GroundGeometryUpdater.prototype),PolygonGeometryUpdater.prototype.constructor=PolygonGeometryUpdater),PolygonGeometryUpdater.prototype.createFillGeometryInstance=function(e){var t,i=this._entity,r=i.isAvailable(e),n=this._options,a={show:new ShowGeometryInstanceAttribute(r&&i.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};this._materialProperty instanceof ColorMaterialProperty&&(defined(this._materialProperty.color)&&(this._materialProperty.color.isConstant||r)&&(t=this._materialProperty.color.getValue(e,scratchColor$g)),defined(t)||(t=Color.WHITE),a.color=ColorGeometryInstanceAttribute.fromColor(t));return defined(n.offsetAttribute)&&(a.offset=OffsetGeometryInstanceAttribute.fromCartesian3(Property.getValueOrDefault(this._terrainOffsetProperty,e,defaultOffset$6,offsetScratch$9))),new GeometryInstance({id:i,geometry:n.perPositionHeight&&!defined(n.extrudedHeight)?new CoplanarPolygonGeometry(n):new PolygonGeometry(n),attributes:a})},PolygonGeometryUpdater.prototype.createOutlineGeometryInstance=function(e){var t=this._entity,i=t.isAvailable(e),r=this._options,n=Property.getValueOrDefault(this._outlineColorProperty,e,Color.BLACK,scratchColor$g),a=this._distanceDisplayConditionProperty.getValue(e),o={show:new ShowGeometryInstanceAttribute(i&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:ColorGeometryInstanceAttribute.fromColor(n),distanceDisplayCondition:DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(a),offset:void 0};return defined(r.offsetAttribute)&&(o.offset=OffsetGeometryInstanceAttribute.fromCartesian3(Property.getValueOrDefault(this._terrainOffsetProperty,e,defaultOffset$6,offsetScratch$9))),new GeometryInstance({id:t,geometry:r.perPositionHeight&&!defined(r.extrudedHeight)?new CoplanarPolygonOutlineGeometry(r):new PolygonOutlineGeometry(r),attributes:o})},PolygonGeometryUpdater.prototype._computeCenter=function(e,t){var i=Property.getValueOrUndefined(this._entity.polygon.hierarchy,e);if(defined(i)){var r=i.positions;if(0!==r.length){for(var n=this._scene.mapProjection.ellipsoid,a=EllipsoidTangentPlane.fromPoints(r,n),o=a.projectPointsOntoPlane(r,scratch2DPositions),s=o.length,l=0,u=s-1,c=new Cartesian2,d=0;d<s;u=d++){var h=o[d],p=o[u],f=h.x*p.y-p.x*h.y,m=Cartesian2.add(h,p,cart2Scratch);m=Cartesian2.multiplyByScalar(m,f,m),c=Cartesian2.add(c,m,c),l+=f}var g=1/(3*l);return c=Cartesian2.multiplyByScalar(c,g,c),a.projectPointOntoEllipsoid(c,t)}}},PolygonGeometryUpdater.prototype._isHidden=function(e,t){return!defined(t.hierarchy)||GeometryUpdater.prototype._isHidden.call(this,e,t)},PolygonGeometryUpdater.prototype._isOnTerrain=function(e,t){var i=GroundGeometryUpdater.prototype._isOnTerrain.call(this,e,t),r=t.perPositionHeight,n=defined(r)&&(!r.isConstant||r.getValue(Iso8601.MINIMUM_VALUE));return i&&!n},PolygonGeometryUpdater.prototype._isDynamic=function(e,t){return!t.hierarchy.isConstant||!Property.isConstant(t.height)||!Property.isConstant(t.extrudedHeight)||!Property.isConstant(t.granularity)||!Property.isConstant(t.stRotation)||!Property.isConstant(t.outlineWidth)||!Property.isConstant(t.perPositionHeight)||!Property.isConstant(t.closeTop)||!Property.isConstant(t.closeBottom)||!Property.isConstant(t.zIndex)||!Property.isConstant(t.arcType)||this._onTerrain&&!Property.isConstant(this._materialProperty)&&!(this._materialProperty instanceof ColorMaterialProperty)},PolygonGeometryUpdater.prototype._setStaticOptions=function(e,t){var i=this._materialProperty instanceof ColorMaterialProperty,r=this._options;r.vertexFormat=i?PerInstanceColorAppearance.VERTEX_FORMAT:MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat;var n,a=t.hierarchy.getValue(Iso8601.MINIMUM_VALUE),o=Property.getValueOrUndefined(t.height,Iso8601.MINIMUM_VALUE),s=Property.getValueOrDefault(t.heightReference,Iso8601.MINIMUM_VALUE,HeightReference$1.NONE),l=Property.getValueOrUndefined(t.extrudedHeight,Iso8601.MINIMUM_VALUE),u=Property.getValueOrDefault(t.extrudedHeightReference,Iso8601.MINIMUM_VALUE,HeightReference$1.NONE),c=Property.getValueOrDefault(t.perPositionHeight,Iso8601.MINIMUM_VALUE,!1);o=GroundGeometryUpdater.getGeometryHeight(o,s),c?(defined(o)&&(o=void 0,oneTimeWarning(heightAndPerPositionHeightWarning)),s!==HeightReference$1.NONE&&c&&(o=void 0,oneTimeWarning(heightReferenceAndPerPositionHeightWarning))):(defined(l)&&!defined(o)&&(o=0),n=GroundGeometryUpdater.computeGeometryOffsetAttribute(o,s,l,u)),r.polygonHierarchy=a,r.granularity=Property.getValueOrUndefined(t.granularity,Iso8601.MINIMUM_VALUE),r.stRotation=Property.getValueOrUndefined(t.stRotation,Iso8601.MINIMUM_VALUE),r.perPositionHeight=c,r.closeTop=Property.getValueOrDefault(t.closeTop,Iso8601.MINIMUM_VALUE,!0),r.closeBottom=Property.getValueOrDefault(t.closeBottom,Iso8601.MINIMUM_VALUE,!0),r.offsetAttribute=n,r.height=o,r.arcType=Property.getValueOrDefault(t.arcType,Iso8601.MINIMUM_VALUE,ArcType$1.GEODESIC),(l=GroundGeometryUpdater.getGeometryExtrudedHeight(l,u))===GroundGeometryUpdater.CLAMP_TO_GROUND&&(l=ApproximateTerrainHeights.getMinimumMaximumHeights(PolygonGeometry.computeRectangle(r,scratchRectangle$5)).minimumTerrainHeight),r.extrudedHeight=l},PolygonGeometryUpdater.prototype._getIsClosed=function(e){var t=e.height,i=e.extrudedHeight,r=defined(i)&&i!==t;return!e.perPositionHeight&&(!r&&0===t||r&&e.closeTop&&e.closeBottom)},PolygonGeometryUpdater.DynamicGeometryUpdater=DyanmicPolygonGeometryUpdater,defined(Object.create)&&(DyanmicPolygonGeometryUpdater.prototype=Object.create(DynamicGeometryUpdater.prototype),DyanmicPolygonGeometryUpdater.prototype.constructor=DyanmicPolygonGeometryUpdater),DyanmicPolygonGeometryUpdater.prototype._isHidden=function(e,t,i){return!defined(this._options.polygonHierarchy)||DynamicGeometryUpdater.prototype._isHidden.call(this,e,t,i)},DyanmicPolygonGeometryUpdater.prototype._setOptions=function(e,t,i){var r=this._options;r.polygonHierarchy=Property.getValueOrUndefined(t.hierarchy,i);var n,a=Property.getValueOrUndefined(t.height,i),o=Property.getValueOrDefault(t.heightReference,i,HeightReference$1.NONE),s=Property.getValueOrDefault(t.extrudedHeightReference,i,HeightReference$1.NONE),l=Property.getValueOrUndefined(t.extrudedHeight,i),u=Property.getValueOrUndefined(t.perPositionHeight,i);a=GroundGeometryUpdater.getGeometryHeight(a,s),u?(defined(a)&&(a=void 0,oneTimeWarning(heightAndPerPositionHeightWarning)),o!==HeightReference$1.NONE&&u&&(a=void 0,oneTimeWarning(heightReferenceAndPerPositionHeightWarning))):(defined(l)&&!defined(a)&&(a=0),n=GroundGeometryUpdater.computeGeometryOffsetAttribute(a,o,l,s)),r.granularity=Property.getValueOrUndefined(t.granularity,i),r.stRotation=Property.getValueOrUndefined(t.stRotation,i),r.perPositionHeight=Property.getValueOrUndefined(t.perPositionHeight,i),r.closeTop=Property.getValueOrDefault(t.closeTop,i,!0),r.closeBottom=Property.getValueOrDefault(t.closeBottom,i,!0),r.offsetAttribute=n,r.height=a,r.arcType=Property.getValueOrDefault(t.arcType,i,ArcType$1.GEODESIC),(l=GroundGeometryUpdater.getGeometryExtrudedHeight(l,s))===GroundGeometryUpdater.CLAMP_TO_GROUND&&(l=ApproximateTerrainHeights.getMinimumMaximumHeights(PolygonGeometry.computeRectangle(r,scratchRectangle$5)).minimumTerrainHeight),r.extrudedHeight=l};var scratchColor$h=new Color;function PolylineVolumeGeometryOptions(e){this.id=e,this.vertexFormat=void 0,this.polylinePositions=void 0,this.shapePositions=void 0,this.cornerType=void 0,this.granularity=void 0}function PolylineVolumeGeometryUpdater(e,t){GeometryUpdater.call(this,{entity:e,scene:t,geometryOptions:new PolylineVolumeGeometryOptions(e),geometryPropertyName:"polylineVolume",observedPropertyNames:["availability","polylineVolume"]}),this._onEntityPropertyChanged(e,"polylineVolume",e.polylineVolume,void 0)}function DynamicPolylineVolumeGeometryUpdater(e,t,i){DynamicGeometryUpdater.call(this,e,t,i)}defined(Object.create)&&(PolylineVolumeGeometryUpdater.prototype=Object.create(GeometryUpdater.prototype),PolylineVolumeGeometryUpdater.prototype.constructor=PolylineVolumeGeometryUpdater),PolylineVolumeGeometryUpdater.prototype.createFillGeometryInstance=function(e){var t,i,r=this._entity,n=r.isAvailable(e),a=new ShowGeometryInstanceAttribute(n&&r.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),s=DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(o);this._materialProperty instanceof ColorMaterialProperty?(defined(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(i=this._materialProperty.color.getValue(e,scratchColor$h)),defined(i)||(i=Color.WHITE),t={show:a,distanceDisplayCondition:s,color:ColorGeometryInstanceAttribute.fromColor(i)}):t={show:a,distanceDisplayCondition:s};return new GeometryInstance({id:r,geometry:new PolylineVolumeGeometry(this._options),attributes:t})},PolylineVolumeGeometryUpdater.prototype.createOutlineGeometryInstance=function(e){var t=this._entity,i=t.isAvailable(e),r=Property.getValueOrDefault(this._outlineColorProperty,e,Color.BLACK,scratchColor$h),n=this._distanceDisplayConditionProperty.getValue(e);return new GeometryInstance({id:t,geometry:new PolylineVolumeOutlineGeometry(this._options),attributes:{show:new ShowGeometryInstanceAttribute(i&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:ColorGeometryInstanceAttribute.fromColor(r),distanceDisplayCondition:DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(n)}})},PolylineVolumeGeometryUpdater.prototype._isHidden=function(e,t){return!defined(t.positions)||!defined(t.shape)||GeometryUpdater.prototype._isHidden.call(this,e,t)},PolylineVolumeGeometryUpdater.prototype._isDynamic=function(e,t){return!(t.positions.isConstant&&t.shape.isConstant&&Property.isConstant(t.granularity)&&Property.isConstant(t.outlineWidth)&&Property.isConstant(t.cornerType))},PolylineVolumeGeometryUpdater.prototype._setStaticOptions=function(e,t){var i=t.granularity,r=t.cornerType,n=this._options,a=this._materialProperty instanceof ColorMaterialProperty;n.vertexFormat=a?PerInstanceColorAppearance.VERTEX_FORMAT:MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat,n.polylinePositions=t.positions.getValue(Iso8601.MINIMUM_VALUE,n.polylinePositions),n.shapePositions=t.shape.getValue(Iso8601.MINIMUM_VALUE,n.shape),n.granularity=defined(i)?i.getValue(Iso8601.MINIMUM_VALUE):void 0,n.cornerType=defined(r)?r.getValue(Iso8601.MINIMUM_VALUE):void 0},PolylineVolumeGeometryUpdater.DynamicGeometryUpdater=DynamicPolylineVolumeGeometryUpdater,defined(Object.create)&&(DynamicPolylineVolumeGeometryUpdater.prototype=Object.create(DynamicGeometryUpdater.prototype),DynamicPolylineVolumeGeometryUpdater.prototype.constructor=DynamicPolylineVolumeGeometryUpdater),DynamicPolylineVolumeGeometryUpdater.prototype._isHidden=function(e,t,i){var r=this._options;return!defined(r.polylinePositions)||!defined(r.shapePositions)||DynamicGeometryUpdater.prototype._isHidden.call(this,e,t,i)},DynamicPolylineVolumeGeometryUpdater.prototype._setOptions=function(e,t,i){var r=this._options;r.polylinePositions=Property.getValueOrUndefined(t.positions,i,r.polylinePositions),r.shapePositions=Property.getValueOrUndefined(t.shape,i),r.granularity=Property.getValueOrUndefined(t.granularity,i),r.cornerType=Property.getValueOrUndefined(t.cornerType,i)};var scratchColor$i=new Color,defaultOffset$7=Cartesian3.ZERO,offsetScratch$a=new Cartesian3,scratchRectangle$6=new Rectangle,scratchCenterRect=new Rectangle,scratchCarto$1=new Cartographic;function RectangleGeometryOptions(e){this.id=e,this.vertexFormat=void 0,this.rectangle=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.rotation=void 0,this.offsetAttribute=void 0}function RectangleGeometryUpdater(e,t){GroundGeometryUpdater.call(this,{entity:e,scene:t,geometryOptions:new RectangleGeometryOptions(e),geometryPropertyName:"rectangle",observedPropertyNames:["availability","rectangle"]}),this._onEntityPropertyChanged(e,"rectangle",e.rectangle,void 0)}function DynamicRectangleGeometryUpdater(e,t,i){DynamicGeometryUpdater.call(this,e,t,i)}defined(Object.create)&&(RectangleGeometryUpdater.prototype=Object.create(GroundGeometryUpdater.prototype),RectangleGeometryUpdater.prototype.constructor=RectangleGeometryUpdater),RectangleGeometryUpdater.prototype.createFillGeometryInstance=function(e){var t,i=this._entity,r=i.isAvailable(e),n={show:new ShowGeometryInstanceAttribute(r&&i.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};this._materialProperty instanceof ColorMaterialProperty&&(defined(this._materialProperty.color)&&(this._materialProperty.color.isConstant||r)&&(t=this._materialProperty.color.getValue(e,scratchColor$i)),defined(t)||(t=Color.WHITE),n.color=ColorGeometryInstanceAttribute.fromColor(t));return defined(this._options.offsetAttribute)&&(n.offset=OffsetGeometryInstanceAttribute.fromCartesian3(Property.getValueOrDefault(this._terrainOffsetProperty,e,defaultOffset$7,offsetScratch$a))),new GeometryInstance({id:i,geometry:new RectangleGeometry(this._options),attributes:n})},RectangleGeometryUpdater.prototype.createOutlineGeometryInstance=function(e){var t=this._entity,i=t.isAvailable(e),r=Property.getValueOrDefault(this._outlineColorProperty,e,Color.BLACK,scratchColor$i),n=this._distanceDisplayConditionProperty.getValue(e),a={show:new ShowGeometryInstanceAttribute(i&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:ColorGeometryInstanceAttribute.fromColor(r),distanceDisplayCondition:DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(n),offset:void 0};return defined(this._options.offsetAttribute)&&(a.offset=OffsetGeometryInstanceAttribute.fromCartesian3(Property.getValueOrDefault(this._terrainOffsetProperty,e,defaultOffset$7,offsetScratch$a))),new GeometryInstance({id:t,geometry:new RectangleOutlineGeometry(this._options),attributes:a})},RectangleGeometryUpdater.prototype._computeCenter=function(e,t){var i=Property.getValueOrUndefined(this._entity.rectangle.coordinates,e,scratchCenterRect);if(defined(i)){var r=Rectangle.center(i,scratchCarto$1);return Cartographic.toCartesian(r,Ellipsoid.WGS84,t)}},RectangleGeometryUpdater.prototype._isHidden=function(e,t){return!defined(t.coordinates)||GeometryUpdater.prototype._isHidden.call(this,e,t)},RectangleGeometryUpdater.prototype._isDynamic=function(e,t){return!t.coordinates.isConstant||!Property.isConstant(t.height)||!Property.isConstant(t.extrudedHeight)||!Property.isConstant(t.granularity)||!Property.isConstant(t.stRotation)||!Property.isConstant(t.rotation)||!Property.isConstant(t.outlineWidth)||!Property.isConstant(t.zIndex)||this._onTerrain&&!Property.isConstant(this._materialProperty)&&!(this._materialProperty instanceof ColorMaterialProperty)},RectangleGeometryUpdater.prototype._setStaticOptions=function(e,t){var i=this._materialProperty instanceof ColorMaterialProperty,r=Property.getValueOrUndefined(t.height,Iso8601.MINIMUM_VALUE),n=Property.getValueOrDefault(t.heightReference,Iso8601.MINIMUM_VALUE,HeightReference$1.NONE),a=Property.getValueOrUndefined(t.extrudedHeight,Iso8601.MINIMUM_VALUE),o=Property.getValueOrDefault(t.extrudedHeightReference,Iso8601.MINIMUM_VALUE,HeightReference$1.NONE);defined(a)&&!defined(r)&&(r=0);var s=this._options;s.vertexFormat=i?PerInstanceColorAppearance.VERTEX_FORMAT:MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat,s.rectangle=t.coordinates.getValue(Iso8601.MINIMUM_VALUE,s.rectangle),s.granularity=Property.getValueOrUndefined(t.granularity,Iso8601.MINIMUM_VALUE),s.stRotation=Property.getValueOrUndefined(t.stRotation,Iso8601.MINIMUM_VALUE),s.rotation=Property.getValueOrUndefined(t.rotation,Iso8601.MINIMUM_VALUE),s.offsetAttribute=GroundGeometryUpdater.computeGeometryOffsetAttribute(r,n,a,o),s.height=GroundGeometryUpdater.getGeometryHeight(r,n),(a=GroundGeometryUpdater.getGeometryExtrudedHeight(a,o))===GroundGeometryUpdater.CLAMP_TO_GROUND&&(a=ApproximateTerrainHeights.getMinimumMaximumHeights(RectangleGeometry.computeRectangle(s,scratchRectangle$6)).minimumTerrainHeight),s.extrudedHeight=a},RectangleGeometryUpdater.DynamicGeometryUpdater=DynamicRectangleGeometryUpdater,defined(Object.create)&&(DynamicRectangleGeometryUpdater.prototype=Object.create(DynamicGeometryUpdater.prototype),DynamicRectangleGeometryUpdater.prototype.constructor=DynamicRectangleGeometryUpdater),DynamicRectangleGeometryUpdater.prototype._isHidden=function(e,t,i){return!defined(this._options.rectangle)||DynamicGeometryUpdater.prototype._isHidden.call(this,e,t,i)},DynamicRectangleGeometryUpdater.prototype._setOptions=function(e,t,i){var r=this._options,n=Property.getValueOrUndefined(t.height,i),a=Property.getValueOrDefault(t.heightReference,i,HeightReference$1.NONE),o=Property.getValueOrUndefined(t.extrudedHeight,i),s=Property.getValueOrDefault(t.extrudedHeightReference,i,HeightReference$1.NONE);defined(o)&&!defined(n)&&(n=0),r.rectangle=Property.getValueOrUndefined(t.coordinates,i,r.rectangle),r.granularity=Property.getValueOrUndefined(t.granularity,i),r.stRotation=Property.getValueOrUndefined(t.stRotation,i),r.rotation=Property.getValueOrUndefined(t.rotation,i),r.offsetAttribute=GroundGeometryUpdater.computeGeometryOffsetAttribute(n,a,o,s),r.height=GroundGeometryUpdater.getGeometryHeight(n,a),(o=GroundGeometryUpdater.getGeometryExtrudedHeight(o,s))===GroundGeometryUpdater.CLAMP_TO_GROUND&&(o=ApproximateTerrainHeights.getMinimumMaximumHeights(RectangleGeometry.computeRectangle(r,scratchRectangle$6)).minimumTerrainHeight),r.extrudedHeight=o};var colorScratch$2=new Color,distanceDisplayConditionScratch$2=new DistanceDisplayCondition,defaultDistanceDisplayCondition$1=new DistanceDisplayCondition,defaultOffset$8=Cartesian3.ZERO,offsetScratch$b=new Cartesian3;function Batch(e,t,i,r,n,a,o){var s;this.translucent=t,this.appearanceType=i,this.depthFailAppearanceType=r,this.depthFailMaterialProperty=n,this.depthFailMaterial=void 0,this.closed=a,this.shadows=o,this.primitives=e,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new AssociativeArray,this.updaters=new AssociativeArray,this.updatersWithAttributes=new AssociativeArray,this.attributes=new AssociativeArray,this.subscriptions=new AssociativeArray,this.showsUpdated=new AssociativeArray,this.itemsToRemove=[],this.invalidated=!1,defined(n)&&(s=n.definitionChanged.addEventListener(Batch.prototype.onMaterialChanged,this)),this.removeMaterialSubscription=s}function StaticGeometryColorBatch(e,t,i,r,n){this._solidItems=[],this._translucentItems=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=i,this._closed=r,this._shadows=n}function removeItem(e,t){for(var i=e.length-1;0<=i;i--){var r=e[i];if(r.remove(t))return 0===r.updaters.length&&(e.splice(i,1),r.destroy()),!0}return!1}function moveItems(e,t,i){for(var r=!1,n=t.length,a=0;a<n;++a){var o=t[a],s=o.itemsToRemove,l=s.length;if(0<l)for(a=0;a<l;a++){var u=s[a];o.remove(u),e.add(i,u),r=!0}}return r}function updateItems(e,t,i,r){var n,a=t.length;for(n=a-1;0<=n;n--){var o=t[n];if(o.invalidated){t.splice(n,1);for(var s=o.updaters.values,l=s.length,u=0;u<l;u++)e.add(i,s[u]);o.destroy()}}for(a=t.length,n=0;n<a;++n)r=t[n].update(i)&&r;return r}function getBoundingSphere(e,t,i){for(var r=e.length,n=0;n<r;n++){var a=e[n];if(a.contains(t))return a.getBoundingSphere(t,i)}return BoundingSphereState$1.FAILED}function removeAllPrimitives(e){for(var t=e.length,i=0;i<t;i++)e[i].destroy();e.length=0}Batch.prototype.onMaterialChanged=function(){this.invalidated=!0},Batch.prototype.isMaterial=function(e){var t=this.depthFailMaterialProperty,i=e.depthFailMaterialProperty;return i===t||!!defined(t)&&t.equals(i)},Batch.prototype.add=function(n,e){var t=n.id;if(this.createPrimitive=!0,this.geometry.set(t,e),this.updaters.set(t,n),n.hasConstantFill&&n.fillMaterialProperty.isConstant&&Property.isConstant(n.distanceDisplayConditionProperty)&&Property.isConstant(n.terrainOffsetProperty)){var a=this;this.subscriptions.set(t,n.entity.definitionChanged.addEventListener(function(e,t,i,r){"isShowing"===t&&a.showsUpdated.set(n.id,n)}))}else this.updatersWithAttributes.set(t,n)},Batch.prototype.remove=function(e){var t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);var i=this.subscriptions.get(t);return defined(i)&&(i(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1},Batch.prototype.update=function(e){var t,i=!0,r=0,n=this.primitive,a=this.primitives;if(this.createPrimitive){var o=this.geometry.values;if(0<o.length){var s;defined(n)&&(defined(this.oldPrimitive)?a.remove(n):this.oldPrimitive=n),defined(this.depthFailAppearanceType)&&(defined(this.depthFailMaterialProperty)&&(this.depthFailMaterial=MaterialProperty.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial)),s=new this.depthFailAppearanceType({material:this.depthFailMaterial,translucent:this.translucent,closed:this.closed})),n=new Primitive({show:!1,asynchronous:!0,geometryInstances:o.slice(),appearance:new this.appearanceType({translucent:this.translucent,closed:this.closed}),depthFailAppearance:s,shadows:this.shadows}),a.add(n),i=!1}else{defined(n)&&(a.remove(n),n=void 0);var l=this.oldPrimitive;defined(l)&&(a.remove(l),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(defined(n)&&n.ready){n.show=!0,defined(this.oldPrimitive)&&(a.remove(this.oldPrimitive),this.oldPrimitive=void 0),!defined(this.depthFailAppearanceType)||this.depthFailMaterialProperty instanceof ColorMaterialProperty||(this.depthFailMaterial=MaterialProperty.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);var u=this.updatersWithAttributes.values,c=u.length,d=this.waitingOnCreate;for(t=0;t<c;t++){var h=u[t],p=this.geometry.get(h.id),f=this.attributes.get(p.id.id);if(defined(f)||(f=n.getGeometryInstanceAttributes(p.id),this.attributes.set(p.id.id,f)),!h.fillMaterialProperty.isConstant||d){var m=h.fillMaterialProperty.color,g=Property.getValueOrDefault(m,e,Color.WHITE,colorScratch$2);Color.equals(f._lastColor,g)||(f._lastColor=Color.clone(g,f._lastColor),f.color=ColorGeometryInstanceAttribute.toValue(g,f.color),(this.translucent&&255===f.color[3]||!this.translucent&&255!==f.color[3])&&(this.itemsToRemove[r++]=h))}if(defined(this.depthFailAppearanceType)&&h.depthFailMaterialProperty instanceof ColorMaterialProperty&&(!h.depthFailMaterialProperty.isConstant||d)){var y=h.depthFailMaterialProperty.color,v=Property.getValueOrDefault(y,e,Color.WHITE,colorScratch$2);Color.equals(f._lastDepthFailColor,v)||(f._lastDepthFailColor=Color.clone(v,f._lastDepthFailColor),f.depthFailColor=ColorGeometryInstanceAttribute.toValue(v,f.depthFailColor))}var _=h.entity.isShowing&&(h.hasConstantFill||h.isFilled(e));_!==(1===f.show[0])&&(f.show=ShowGeometryInstanceAttribute.toValue(_,f.show));var C=h.distanceDisplayConditionProperty;if(!Property.isConstant(C)){var x=Property.getValueOrDefault(C,e,defaultDistanceDisplayCondition$1,distanceDisplayConditionScratch$2);DistanceDisplayCondition.equals(x,f._lastDistanceDisplayCondition)||(f._lastDistanceDisplayCondition=DistanceDisplayCondition.clone(x,f._lastDistanceDisplayCondition),f.distanceDisplayCondition=DistanceDisplayConditionGeometryInstanceAttribute.toValue(x,f.distanceDisplayCondition))}var b=h.terrainOffsetProperty;if(!Property.isConstant(b)){var A=Property.getValueOrDefault(b,e,defaultOffset$8,offsetScratch$b);Cartesian3.equals(A,f._lastOffset)||(f._lastOffset=Cartesian3.clone(A,f._lastOffset),f.offset=OffsetGeometryInstanceAttribute.toValue(A,f.offset))}}this.updateShows(n),this.waitingOnCreate=!1}else defined(n)&&!n.ready&&(i=!1);return this.itemsToRemove.length=r,i},Batch.prototype.updateShows=function(e){for(var t=this.showsUpdated.values,i=t.length,r=0;r<i;r++){var n=t[r],a=this.geometry.get(n.id),o=this.attributes.get(a.id.id);defined(o)||(o=e.getGeometryInstanceAttributes(a.id),this.attributes.set(a.id.id,o));var s=n.entity.isShowing;s!==(1===o.show[0])&&(o.show=ShowGeometryInstanceAttribute.toValue(s,o.show),a.attributes.show.value[0]=o.show[0])}this.showsUpdated.removeAll()},Batch.prototype.contains=function(e){return this.updaters.contains(e.id)},Batch.prototype.getBoundingSphere=function(e,t){var i=this.primitive;if(!i.ready)return BoundingSphereState$1.PENDING;var r=i.getGeometryInstanceAttributes(e.entity);return!defined(r)||!defined(r.boundingSphere)||defined(r.show)&&0===r.show[0]?BoundingSphereState$1.FAILED:(r.boundingSphere.clone(t),BoundingSphereState$1.DONE)},Batch.prototype.destroy=function(){var e=this.primitive,t=this.primitives;defined(e)&&t.remove(e);var i=this.oldPrimitive;defined(i)&&t.remove(i),defined(this.removeMaterialSubscription)&&this.removeMaterialSubscription()},StaticGeometryColorBatch.prototype.add=function(e,t){var i,r,n=t.createFillGeometryInstance(e);r=255===n.attributes.color.value[3]?(i=this._solidItems,!1):(i=this._translucentItems,!0);for(var a=i.length,o=0;o<a;o++){var s=i[o];if(s.isMaterial(t))return void s.add(t,n)}var l=new Batch(this._primitives,r,this._appearanceType,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);l.add(t,n),i.push(l)},StaticGeometryColorBatch.prototype.remove=function(e){removeItem(this._solidItems,e)||removeItem(this._translucentItems,e)},StaticGeometryColorBatch.prototype.update=function(e){var t=updateItems(this,this._solidItems,e,!0);t=updateItems(this,this._translucentItems,e,t)&&t;var i=moveItems(this,this._solidItems,e),r=moveItems(this,this._translucentItems,e);return(i||r)&&(t=updateItems(this,this._solidItems,e,t)&&t,t=updateItems(this,this._translucentItems,e,t)&&t),t},StaticGeometryColorBatch.prototype.getBoundingSphere=function(e,t){var i=getBoundingSphere(this._solidItems,e,t);return i===BoundingSphereState$1.FAILED?getBoundingSphere(this._translucentItems,e,t):i},StaticGeometryColorBatch.prototype.removeAllPrimitives=function(){removeAllPrimitives(this._solidItems),removeAllPrimitives(this._translucentItems)};var distanceDisplayConditionScratch$3=new DistanceDisplayCondition,defaultDistanceDisplayCondition$2=new DistanceDisplayCondition,defaultOffset$9=Cartesian3.ZERO,offsetScratch$c=new Cartesian3;function Batch$1(e,t,i,r,n,a,o){this.primitives=e,this.appearanceType=t,this.materialProperty=i,this.depthFailAppearanceType=r,this.depthFailMaterialProperty=n,this.closed=a,this.shadows=o,this.updaters=new AssociativeArray,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new AssociativeArray,this.material=void 0,this.depthFailMaterial=void 0,this.updatersWithAttributes=new AssociativeArray,this.attributes=new AssociativeArray,this.invalidated=!1,this.removeMaterialSubscription=i.definitionChanged.addEventListener(Batch$1.prototype.onMaterialChanged,this),this.subscriptions=new AssociativeArray,this.showsUpdated=new AssociativeArray}Batch$1.prototype.onMaterialChanged=function(){this.invalidated=!0},Batch$1.prototype.isMaterial=function(e){var t=this.materialProperty,i=e.fillMaterialProperty,r=this.depthFailMaterialProperty,n=e.depthFailMaterialProperty;if(i===t&&n===r)return!0;var a=defined(t)&&t.equals(i);return a=(!defined(r)&&!defined(n)||defined(r)&&r.equals(n))&&a},Batch$1.prototype.add=function(e,n){var t=n.id;if(this.updaters.set(t,n),this.geometry.set(t,n.createFillGeometryInstance(e)),n.hasConstantFill&&n.fillMaterialProperty.isConstant&&Property.isConstant(n.distanceDisplayConditionProperty)&&Property.isConstant(n.terrainOffsetProperty)){var a=this;this.subscriptions.set(t,n.entity.definitionChanged.addEventListener(function(e,t,i,r){"isShowing"===t&&a.showsUpdated.set(n.id,n)}))}else this.updatersWithAttributes.set(t,n);this.createPrimitive=!0},Batch$1.prototype.remove=function(e){var t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);var i=this.subscriptions.get(t);return defined(i)&&(i(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};var colorScratch$3=new Color;function StaticGeometryPerMaterialBatch(e,t,i,r,n){this._items=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=i,this._closed=r,this._shadows=n}Batch$1.prototype.update=function(e){var t,i=!0,r=this.primitive,n=this.primitives,a=this.geometry.values;if(this.createPrimitive){if(0<a.length){var o;defined(r)&&(defined(this.oldPrimitive)?n.remove(r):this.oldPrimitive=r),this.material=MaterialProperty.getValue(e,this.materialProperty,this.material),defined(this.depthFailMaterialProperty)&&(this.depthFailMaterial=MaterialProperty.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),o=new this.depthFailAppearanceType({material:this.depthFailMaterial,translucent:this.depthFailMaterial.isTranslucent(),closed:this.closed})),r=new Primitive({show:!1,asynchronous:!0,geometryInstances:a.slice(),appearance:new this.appearanceType({material:this.material,translucent:this.material.isTranslucent(),closed:this.closed}),depthFailAppearance:o,shadows:this.shadows}),n.add(r),i=!1}else{defined(r)&&(n.remove(r),r=void 0);var s=this.oldPrimitive;defined(s)&&(n.remove(s),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=r,this.createPrimitive=!1}else if(defined(r)&&r.ready){r.show=!0,defined(this.oldPrimitive)&&(n.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=MaterialProperty.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material,!defined(this.depthFailAppearanceType)||this.depthFailMaterialProperty instanceof ColorMaterialProperty||(this.depthFailMaterial=MaterialProperty.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);var l=this.updatersWithAttributes.values,u=l.length;for(t=0;t<u;t++){var c=l[t],d=c.entity,h=this.geometry.get(c.id),p=this.attributes.get(h.id.id);if(defined(p)||(p=r.getGeometryInstanceAttributes(h.id),this.attributes.set(h.id.id,p)),defined(this.depthFailAppearanceType)&&this.depthFailMaterialProperty instanceof ColorMaterialProperty&&!c.depthFailMaterialProperty.isConstant){var f=c.depthFailMaterialProperty.color,m=Property.getValueOrDefault(f,e,Color.WHITE,colorScratch$3);Color.equals(p._lastDepthFailColor,m)||(p._lastDepthFailColor=Color.clone(m,p._lastDepthFailColor),p.depthFailColor=ColorGeometryInstanceAttribute.toValue(m,p.depthFailColor))}var g=d.isShowing&&(c.hasConstantFill||c.isFilled(e));g!==(1===p.show[0])&&(p.show=ShowGeometryInstanceAttribute.toValue(g,p.show));var y=c.distanceDisplayConditionProperty;if(!Property.isConstant(y)){var v=Property.getValueOrDefault(y,e,defaultDistanceDisplayCondition$2,distanceDisplayConditionScratch$3);DistanceDisplayCondition.equals(v,p._lastDistanceDisplayCondition)||(p._lastDistanceDisplayCondition=DistanceDisplayCondition.clone(v,p._lastDistanceDisplayCondition),p.distanceDisplayCondition=DistanceDisplayConditionGeometryInstanceAttribute.toValue(v,p.distanceDisplayCondition))}var _=c.terrainOffsetProperty;if(!Property.isConstant(_)){var C=Property.getValueOrDefault(_,e,defaultOffset$9,offsetScratch$c);Cartesian3.equals(C,p._lastOffset)||(p._lastOffset=Cartesian3.clone(C,p._lastOffset),p.offset=OffsetGeometryInstanceAttribute.toValue(C,p.offset))}}this.updateShows(r)}else defined(r)&&!r.ready&&(i=!1);return i},Batch$1.prototype.updateShows=function(e){for(var t=this.showsUpdated.values,i=t.length,r=0;r<i;r++){var n=t[r],a=n.entity,o=this.geometry.get(n.id),s=this.attributes.get(o.id.id);defined(s)||(s=e.getGeometryInstanceAttributes(o.id),this.attributes.set(o.id.id,s));var l=a.isShowing;l!==(1===s.show[0])&&(s.show=ShowGeometryInstanceAttribute.toValue(l,s.show),o.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()},Batch$1.prototype.contains=function(e){return this.updaters.contains(e.id)},Batch$1.prototype.getBoundingSphere=function(e,t){var i=this.primitive;if(!i.ready)return BoundingSphereState$1.PENDING;var r=i.getGeometryInstanceAttributes(e.entity);return!defined(r)||!defined(r.boundingSphere)||defined(r.show)&&0===r.show[0]?BoundingSphereState$1.FAILED:(r.boundingSphere.clone(t),BoundingSphereState$1.DONE)},Batch$1.prototype.destroy=function(){var e=this.primitive,t=this.primitives;defined(e)&&t.remove(e);var i=this.oldPrimitive;defined(i)&&t.remove(i),this.removeMaterialSubscription()},StaticGeometryPerMaterialBatch.prototype.add=function(e,t){for(var i=this._items,r=i.length,n=0;n<r;n++){var a=i[n];if(a.isMaterial(t))return void a.add(e,t)}var o=new Batch$1(this._primitives,this._appearanceType,t.fillMaterialProperty,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);o.add(e,t),i.push(o)},StaticGeometryPerMaterialBatch.prototype.remove=function(e){for(var t=this._items,i=t.length-1;0<=i;i--){var r=t[i];if(r.remove(e)){0===r.updaters.length&&(t.splice(i,1),r.destroy());break}}},StaticGeometryPerMaterialBatch.prototype.update=function(e){var t,i=this._items;for(t=i.length-1;0<=t;t--){var r=i[t];if(r.invalidated){i.splice(t,1);for(var n=r.updaters.values,a=n.length,o=0;o<a;o++)this.add(e,n[o]);r.destroy()}}var s=!0;for(t=0;t<i.length;t++)s=i[t].update(e)&&s;return s},StaticGeometryPerMaterialBatch.prototype.getBoundingSphere=function(e,t){for(var i=this._items,r=i.length,n=0;n<r;n++){var a=i[n];if(a.contains(e))return a.getBoundingSphere(e,t)}return BoundingSphereState$1.FAILED},StaticGeometryPerMaterialBatch.prototype.removeAllPrimitives=function(){for(var e=this._items,t=e.length,i=0;i<t;i++)e[i].destroy();this._items.length=0};var colorScratch$4=new Color,distanceDisplayConditionScratch$4=new DistanceDisplayCondition,defaultDistanceDisplayCondition$3=new DistanceDisplayCondition;function Batch$2(e,t,i,r){this.primitives=e,this.zIndex=r,this.classificationType=t,this.color=i,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new AssociativeArray,this.updaters=new AssociativeArray,this.updatersWithAttributes=new AssociativeArray,this.attributes=new AssociativeArray,this.subscriptions=new AssociativeArray,this.showsUpdated=new AssociativeArray,this.itemsToRemove=[],this.isDirty=!1,this.rectangleCollisionCheck=new RectangleCollisionChecker}function StaticGroundGeometryColorBatch(e,t){this._batches=[],this._primitives=e,this._classificationType=t}Batch$2.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)},Batch$2.prototype.add=function(n,e){var t=n.id;if(this.createPrimitive=!0,this.geometry.set(t,e),this.updaters.set(t,n),this.rectangleCollisionCheck.insert(t,e.geometry.rectangle),n.hasConstantFill&&n.fillMaterialProperty.isConstant&&Property.isConstant(n.distanceDisplayConditionProperty)){var a=this;this.subscriptions.set(t,n.entity.definitionChanged.addEventListener(function(e,t,i,r){"isShowing"===t&&a.showsUpdated.set(n.id,n)}))}else this.updatersWithAttributes.set(t,n)},Batch$2.prototype.remove=function(e){var t=e.id,i=this.geometry.get(t);if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.rectangleCollisionCheck.remove(t,i.geometry.rectangle),this.updatersWithAttributes.remove(t);var r=this.subscriptions.get(t);return defined(r)&&(r(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1},Batch$2.prototype.update=function(e){var t,i=!0,r=this.primitive,n=this.primitives;if(this.createPrimitive){var a=this.geometry.values;if(0<a.length)defined(r)&&(defined(this.oldPrimitive)?n.remove(r):this.oldPrimitive=r),r=new GroundPrimitive({show:!1,asynchronous:!0,geometryInstances:a.slice(),classificationType:this.classificationType}),n.add(r,this.zIndex),i=!1;else{defined(r)&&(n.remove(r),r=void 0);var o=this.oldPrimitive;defined(o)&&(n.remove(o),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=r,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(defined(r)&&r.ready){r.show=!0,defined(this.oldPrimitive)&&(n.remove(this.oldPrimitive),this.oldPrimitive=void 0);var s=this.updatersWithAttributes.values,l=s.length,u=this.waitingOnCreate;for(t=0;t<l;t++){var c=s[t],d=this.geometry.get(c.id),h=this.attributes.get(d.id.id);if(defined(h)||(h=r.getGeometryInstanceAttributes(d.id),this.attributes.set(d.id.id,h)),!c.fillMaterialProperty.isConstant||u){var p=c.fillMaterialProperty.color,f=Property.getValueOrDefault(p,e,Color.WHITE,colorScratch$4);Color.equals(h._lastColor,f)||(h._lastColor=Color.clone(f,h._lastColor),h.color=ColorGeometryInstanceAttribute.toValue(f,h.color))}var m=c.entity.isShowing&&(c.hasConstantFill||c.isFilled(e));m!==(1===h.show[0])&&(h.show=ShowGeometryInstanceAttribute.toValue(m,h.show));var g=c.distanceDisplayConditionProperty;if(!Property.isConstant(g)){var y=Property.getValueOrDefault(g,e,defaultDistanceDisplayCondition$3,distanceDisplayConditionScratch$4);DistanceDisplayCondition.equals(y,h._lastDistanceDisplayCondition)||(h._lastDistanceDisplayCondition=DistanceDisplayCondition.clone(y,h._lastDistanceDisplayCondition),h.distanceDisplayCondition=DistanceDisplayConditionGeometryInstanceAttribute.toValue(y,h.distanceDisplayCondition))}}this.updateShows(r),this.waitingOnCreate=!1}else defined(r)&&!r.ready&&(i=!1);return this.itemsToRemove.length=0,i},Batch$2.prototype.updateShows=function(e){for(var t=this.showsUpdated.values,i=t.length,r=0;r<i;r++){var n=t[r],a=this.geometry.get(n.id),o=this.attributes.get(a.id.id);defined(o)||(o=e.getGeometryInstanceAttributes(a.id),this.attributes.set(a.id.id,o));var s=n.entity.isShowing;s!==(1===o.show[0])&&(o.show=ShowGeometryInstanceAttribute.toValue(s,o.show),a.attributes.show.value[0]=o.show[0])}this.showsUpdated.removeAll()},Batch$2.prototype.contains=function(e){return this.updaters.contains(e.id)},Batch$2.prototype.getBoundingSphere=function(e,t){var i=this.primitive;if(!i.ready)return BoundingSphereState$1.PENDING;var r=i.getBoundingSphere(e.entity);return defined(r)?(r.clone(t),BoundingSphereState$1.DONE):BoundingSphereState$1.FAILED},Batch$2.prototype.removeAllPrimitives=function(){var e=this.primitives,t=this.primitive;defined(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());var i=this.oldPrimitive;defined(i)&&(e.remove(i),this.oldPrimitive=void 0)},StaticGroundGeometryColorBatch.prototype.add=function(e,t){for(var i,r=t.createFillGeometryInstance(e),n=this._batches,a=Property.getValueOrDefault(t.zIndex,0),o=n.length,s=0;s<o;++s){var l=n[s];if(l.zIndex===a&&!l.overlapping(r.geometry.rectangle)){i=l;break}}return defined(i)||(i=new Batch$2(this._primitives,this._classificationType,r.attributes.color.value,a),n.push(i)),i.add(t,r),i},StaticGroundGeometryColorBatch.prototype.remove=function(e){for(var t=this._batches,i=t.length,r=0;r<i;++r)if(t[r].remove(e))return},StaticGroundGeometryColorBatch.prototype.update=function(e){var t,i,r=!0,n=this._batches,a=n.length;for(t=0;t<a;++t)r=n[t].update(e)&&r;for(t=0;t<a;++t)for(var o=n[t],s=o.itemsToRemove,l=s.length,u=0;u<l;u++){i=s[u],o.remove(i);var c=this.add(e,i);o.isDirty=!0,c.isDirty=!0}for(t=a-1;0<=t;--t){var d=n[t];d.isDirty&&(r=n[t].update(e)&&r,d.isDirty=!1),0===d.geometry.length&&n.splice(t,1)}return r},StaticGroundGeometryColorBatch.prototype.getBoundingSphere=function(e,t){for(var i=this._batches,r=i.length,n=0;n<r;++n){var a=i[n];if(a.contains(e))return a.getBoundingSphere(e,t)}return BoundingSphereState$1.FAILED},StaticGroundGeometryColorBatch.prototype.removeAllPrimitives=function(){for(var e=this._batches,t=e.length,i=0;i<t;++i)e[i].removeAllPrimitives()};var distanceDisplayConditionScratch$5=new DistanceDisplayCondition,defaultDistanceDisplayCondition$4=new DistanceDisplayCondition;function Batch$3(e,t,i,r,n,a){this.primitives=e,this.classificationType=t,this.appearanceType=i,this.materialProperty=r,this.updaters=new AssociativeArray,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new AssociativeArray,this.material=void 0,this.updatersWithAttributes=new AssociativeArray,this.attributes=new AssociativeArray,this.invalidated=!1,this.removeMaterialSubscription=r.definitionChanged.addEventListener(Batch$3.prototype.onMaterialChanged,this),this.subscriptions=new AssociativeArray,this.showsUpdated=new AssociativeArray,this.usingSphericalTextureCoordinates=n,this.zIndex=a,this.rectangleCollisionCheck=new RectangleCollisionChecker}function StaticGroundGeometryPerMaterialBatch(e,t,i){this._items=[],this._primitives=e,this._classificationType=t,this._appearanceType=i}Batch$3.prototype.onMaterialChanged=function(){this.invalidated=!0},Batch$3.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)},Batch$3.prototype.isMaterial=function(e){var t=this.materialProperty,i=e.fillMaterialProperty;return i===t||i instanceof ColorMaterialProperty&&t instanceof ColorMaterialProperty||defined(t)&&t.equals(i)},Batch$3.prototype.add=function(e,n,t){var i=n.id;if(this.updaters.set(i,n),this.geometry.set(i,t),this.rectangleCollisionCheck.insert(i,t.geometry.rectangle),n.hasConstantFill&&n.fillMaterialProperty.isConstant&&Property.isConstant(n.distanceDisplayConditionProperty)){var a=this;this.subscriptions.set(i,n.entity.definitionChanged.addEventListener(function(e,t,i,r){"isShowing"===t&&a.showsUpdated.set(n.id,n)}))}else this.updatersWithAttributes.set(i,n);this.createPrimitive=!0},Batch$3.prototype.remove=function(e){var t=e.id,i=this.geometry.get(t);if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.rectangleCollisionCheck.remove(t,i.geometry.rectangle),this.updatersWithAttributes.remove(t);var r=this.subscriptions.get(t);return defined(r)&&(r(),this.subscriptions.remove(t)),!0}return!1},Batch$3.prototype.update=function(e){var t,i=!0,r=this.primitive,n=this.primitives,a=this.geometry.values;if(this.createPrimitive){if(0<a.length)defined(r)&&(defined(this.oldPrimitive)?n.remove(r):this.oldPrimitive=r),this.material=MaterialProperty.getValue(e,this.materialProperty,this.material),r=new GroundPrimitive({show:!1,asynchronous:!0,geometryInstances:a.slice(),appearance:new this.appearanceType({material:this.material}),classificationType:this.classificationType}),n.add(r,this.zIndex),i=!1;else{defined(r)&&(n.remove(r),r=void 0);var o=this.oldPrimitive;defined(o)&&(n.remove(o),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=r,this.createPrimitive=!1}else if(defined(r)&&r.ready){r.show=!0,defined(this.oldPrimitive)&&(n.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=MaterialProperty.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material;var s=this.updatersWithAttributes.values,l=s.length;for(t=0;t<l;t++){var u=s[t],c=u.entity,d=this.geometry.get(u.id),h=this.attributes.get(d.id.id);defined(h)||(h=r.getGeometryInstanceAttributes(d.id),this.attributes.set(d.id.id,h));var p=c.isShowing&&(u.hasConstantFill||u.isFilled(e));p!==(1===h.show[0])&&(h.show=ShowGeometryInstanceAttribute.toValue(p,h.show));var f=u.distanceDisplayConditionProperty;if(!Property.isConstant(f)){var m=Property.getValueOrDefault(f,e,defaultDistanceDisplayCondition$4,distanceDisplayConditionScratch$5);DistanceDisplayCondition.equals(m,h._lastDistanceDisplayCondition)||(h._lastDistanceDisplayCondition=DistanceDisplayCondition.clone(m,h._lastDistanceDisplayCondition),h.distanceDisplayCondition=DistanceDisplayConditionGeometryInstanceAttribute.toValue(m,h.distanceDisplayCondition))}}this.updateShows(r)}else defined(r)&&!r.ready&&(i=!1);return i},Batch$3.prototype.updateShows=function(e){for(var t=this.showsUpdated.values,i=t.length,r=0;r<i;r++){var n=t[r],a=n.entity,o=this.geometry.get(n.id),s=this.attributes.get(o.id.id);defined(s)||(s=e.getGeometryInstanceAttributes(o.id),this.attributes.set(o.id.id,s));var l=a.isShowing;l!==(1===s.show[0])&&(s.show=ShowGeometryInstanceAttribute.toValue(l,s.show),o.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()},Batch$3.prototype.contains=function(e){return this.updaters.contains(e.id)},Batch$3.prototype.getBoundingSphere=function(e,t){var i=this.primitive;if(!i.ready)return BoundingSphereState$1.PENDING;var r=i.getGeometryInstanceAttributes(e.entity);return!defined(r)||!defined(r.boundingSphere)||defined(r.show)&&0===r.show[0]?BoundingSphereState$1.FAILED:(r.boundingSphere.clone(t),BoundingSphereState$1.DONE)},Batch$3.prototype.destroy=function(){var e=this.primitive,t=this.primitives;defined(e)&&t.remove(e);var i=this.oldPrimitive;defined(i)&&t.remove(i),this.removeMaterialSubscription()},StaticGroundGeometryPerMaterialBatch.prototype.add=function(e,t){for(var i=this._items,r=i.length,n=t.createFillGeometryInstance(e),a=ShadowVolumeAppearance.shouldUseSphericalCoordinates(n.geometry.rectangle),o=Property.getValueOrDefault(t.zIndex,0),s=0;s<r;++s){var l=i[s];if(l.isMaterial(t)&&l.usingSphericalTextureCoordinates===a&&l.zIndex===o&&!l.overlapping(n.geometry.rectangle))return void l.add(e,t,n)}var u=new Batch$3(this._primitives,this._classificationType,this._appearanceType,t.fillMaterialProperty,a,o);u.add(e,t,n),i.push(u)},StaticGroundGeometryPerMaterialBatch.prototype.remove=function(e){for(var t=this._items,i=t.length-1;0<=i;i--){var r=t[i];if(r.remove(e)){0===r.updaters.length&&(t.splice(i,1),r.destroy());break}}},StaticGroundGeometryPerMaterialBatch.prototype.update=function(e){var t,i=this._items;for(t=i.length-1;0<=t;t--){var r=i[t];if(r.invalidated){i.splice(t,1);for(var n=r.updaters.values,a=n.length,o=0;o<a;o++)this.add(e,n[o]);r.destroy()}}var s=!0;for(t=0;t<i.length;t++)s=i[t].update(e)&&s;return s},StaticGroundGeometryPerMaterialBatch.prototype.getBoundingSphere=function(e,t){for(var i=this._items,r=i.length,n=0;n<r;n++){var a=i[n];if(a.contains(e))return a.getBoundingSphere(e,t)}return BoundingSphereState$1.FAILED},StaticGroundGeometryPerMaterialBatch.prototype.removeAllPrimitives=function(){for(var e=this._items,t=e.length,i=0;i<t;i++)e[i].destroy();this._items.length=0};var colorScratch$5=new Color,distanceDisplayConditionScratch$6=new DistanceDisplayCondition,defaultDistanceDisplayCondition$5=new DistanceDisplayCondition,defaultOffset$a=Cartesian3.ZERO,offsetScratch$d=new Cartesian3;function Batch$4(e,t,i,r){this.translucent=t,this.width=i,this.shadows=r,this.primitives=e,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new AssociativeArray,this.updaters=new AssociativeArray,this.updatersWithAttributes=new AssociativeArray,this.attributes=new AssociativeArray,this.itemsToRemove=[],this.subscriptions=new AssociativeArray,this.showsUpdated=new AssociativeArray}function StaticOutlineGeometryBatch(e,t,i){this._primitives=e,this._scene=t,this._shadows=i,this._solidBatches=new AssociativeArray,this._translucentBatches=new AssociativeArray}Batch$4.prototype.add=function(n,e){var t=n.id;if(this.createPrimitive=!0,this.geometry.set(t,e),this.updaters.set(t,n),n.hasConstantOutline&&n.outlineColorProperty.isConstant&&Property.isConstant(n.distanceDisplayConditionProperty)&&Property.isConstant(n.terrainOffsetProperty)){var a=this;this.subscriptions.set(t,n.entity.definitionChanged.addEventListener(function(e,t,i,r){"isShowing"===t&&a.showsUpdated.set(n.id,n)}))}else this.updatersWithAttributes.set(t,n)},Batch$4.prototype.remove=function(e){var t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);var i=this.subscriptions.get(t);return defined(i)&&(i(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1},Batch$4.prototype.update=function(e){var t,i=!0,r=0,n=this.primitive,a=this.primitives;if(this.createPrimitive){var o=this.geometry.values;if(0<o.length)defined(n)&&(defined(this.oldPrimitive)?a.remove(n):this.oldPrimitive=n),n=new Primitive({show:!1,asynchronous:!0,geometryInstances:o.slice(),appearance:new PerInstanceColorAppearance({flat:!0,translucent:this.translucent,renderState:{lineWidth:this.width}}),shadows:this.shadows}),a.add(n),i=!1;else{defined(n)&&(a.remove(n),n=void 0);var s=this.oldPrimitive;defined(s)&&(a.remove(s),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(defined(n)&&n.ready){n.show=!0,defined(this.oldPrimitive)&&(a.remove(this.oldPrimitive),this.oldPrimitive=void 0);var l=this.updatersWithAttributes.values,u=l.length,c=this.waitingOnCreate;for(t=0;t<u;t++){var d=l[t],h=this.geometry.get(d.id),p=this.attributes.get(h.id.id);if(defined(p)||(p=n.getGeometryInstanceAttributes(h.id),this.attributes.set(h.id.id,p)),!d.outlineColorProperty.isConstant||c){var f=d.outlineColorProperty,m=Property.getValueOrDefault(f,e,Color.WHITE,colorScratch$5);Color.equals(p._lastColor,m)||(p._lastColor=Color.clone(m,p._lastColor),p.color=ColorGeometryInstanceAttribute.toValue(m,p.color),(this.translucent&&255===p.color[3]||!this.translucent&&255!==p.color[3])&&(this.itemsToRemove[r++]=d))}var g=d.entity.isShowing&&(d.hasConstantOutline||d.isOutlineVisible(e));g!==(1===p.show[0])&&(p.show=ShowGeometryInstanceAttribute.toValue(g,p.show));var y=d.distanceDisplayConditionProperty;if(!Property.isConstant(y)){var v=Property.getValueOrDefault(y,e,defaultDistanceDisplayCondition$5,distanceDisplayConditionScratch$6);DistanceDisplayCondition.equals(v,p._lastDistanceDisplayCondition)||(p._lastDistanceDisplayCondition=DistanceDisplayCondition.clone(v,p._lastDistanceDisplayCondition),p.distanceDisplayCondition=DistanceDisplayConditionGeometryInstanceAttribute.toValue(v,p.distanceDisplayCondition))}var _=d.terrainOffsetProperty;if(!Property.isConstant(_)){var C=Property.getValueOrDefault(_,e,defaultOffset$a,offsetScratch$d);Cartesian3.equals(C,p._lastOffset)||(p._lastOffset=Cartesian3.clone(C,p._lastOffset),p.offset=OffsetGeometryInstanceAttribute.toValue(C,p.offset))}}this.updateShows(n),this.waitingOnCreate=!1}else defined(n)&&!n.ready&&(i=!1);return this.itemsToRemove.length=r,i},Batch$4.prototype.updateShows=function(e){for(var t=this.showsUpdated.values,i=t.length,r=0;r<i;r++){var n=t[r],a=this.geometry.get(n.id),o=this.attributes.get(a.id.id);defined(o)||(o=e.getGeometryInstanceAttributes(a.id),this.attributes.set(a.id.id,o));var s=n.entity.isShowing;s!==(1===o.show[0])&&(o.show=ShowGeometryInstanceAttribute.toValue(s,o.show),a.attributes.show.value[0]=o.show[0])}this.showsUpdated.removeAll()},Batch$4.prototype.contains=function(e){return this.updaters.contains(e.id)},Batch$4.prototype.getBoundingSphere=function(e,t){var i=this.primitive;if(!i.ready)return BoundingSphereState$1.PENDING;var r=i.getGeometryInstanceAttributes(e.entity);return!defined(r)||!defined(r.boundingSphere)||defined(r.show)&&0===r.show[0]?BoundingSphereState$1.FAILED:(r.boundingSphere.clone(t),BoundingSphereState$1.DONE)},Batch$4.prototype.removeAllPrimitives=function(){var e=this.primitives,t=this.primitive;defined(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());var i=this.oldPrimitive;defined(i)&&(e.remove(i),this.oldPrimitive=void 0)},StaticOutlineGeometryBatch.prototype.add=function(e,t){var i,r,n=t.createOutlineGeometryInstance(e),a=this._scene.clampLineWidth(t.outlineWidth);255===n.attributes.color.value[3]?defined(r=(i=this._solidBatches).get(a))||(r=new Batch$4(this._primitives,!1,a,this._shadows),i.set(a,r)):defined(r=(i=this._translucentBatches).get(a))||(r=new Batch$4(this._primitives,!0,a,this._shadows),i.set(a,r)),r.add(t,n)},StaticOutlineGeometryBatch.prototype.remove=function(e){var t,i=this._solidBatches.values,r=i.length;for(t=0;t<r;t++)if(i[t].remove(e))return;var n=this._translucentBatches.values,a=n.length;for(t=0;t<a;t++)if(n[t].remove(e))return},StaticOutlineGeometryBatch.prototype.update=function(e){var t,i,r,n,a,o=this._solidBatches.values,s=o.length,l=this._translucentBatches.values,u=l.length,c=!0,d=!1;do{for(d=!1,i=0;i<s;i++){c=(n=o[i]).update(e);var h=(a=n.itemsToRemove).length;if(0<h)for(d=!0,t=0;t<h;t++)r=a[t],n.remove(r),this.add(e,r)}for(i=0;i<u;i++){c=(n=l[i]).update(e);var p=(a=n.itemsToRemove).length;if(0<p)for(d=!0,t=0;t<p;t++)r=a[t],n.remove(r),this.add(e,r)}}while(d);return c},StaticOutlineGeometryBatch.prototype.getBoundingSphere=function(e,t){var i,r=this._solidBatches.values,n=r.length;for(i=0;i<n;i++){var a=r[i];if(a.contains(e))return a.getBoundingSphere(e,t)}var o=this._translucentBatches.values,s=o.length;for(i=0;i<s;i++){var l=o[i];if(l.contains(e))return l.getBoundingSphere(e,t)}return BoundingSphereState$1.FAILED},StaticOutlineGeometryBatch.prototype.removeAllPrimitives=function(){var e,t=this._solidBatches.values,i=t.length;for(e=0;e<i;e++)t[e].removeAllPrimitives();var r=this._translucentBatches.values,n=r.length;for(e=0;e<n;e++)r[e].removeAllPrimitives()};var scratchColor$j=new Color;function WallGeometryOptions(e){this.id=e,this.vertexFormat=void 0,this.positions=void 0,this.minimumHeights=void 0,this.maximumHeights=void 0,this.granularity=void 0}function WallGeometryUpdater(e,t){GeometryUpdater.call(this,{entity:e,scene:t,geometryOptions:new WallGeometryOptions(e),geometryPropertyName:"wall",observedPropertyNames:["availability","wall"]}),this._onEntityPropertyChanged(e,"wall",e.wall,void 0)}function DynamicWallGeometryUpdater(e,t,i){DynamicGeometryUpdater.call(this,e,t,i)}defined(Object.create)&&(WallGeometryUpdater.prototype=Object.create(GeometryUpdater.prototype),WallGeometryUpdater.prototype.constructor=WallGeometryUpdater),WallGeometryUpdater.prototype.createFillGeometryInstance=function(e){var t,i,r=this._entity,n=r.isAvailable(e),a=new ShowGeometryInstanceAttribute(n&&r.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),s=DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(o);this._materialProperty instanceof ColorMaterialProperty?(defined(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(i=this._materialProperty.color.getValue(e,scratchColor$j)),defined(i)||(i=Color.WHITE),t={show:a,distanceDisplayCondition:s,color:ColorGeometryInstanceAttribute.fromColor(i)}):t={show:a,distanceDisplayCondition:s};return new GeometryInstance({id:r,geometry:new WallGeometry(this._options),attributes:t})},WallGeometryUpdater.prototype.createOutlineGeometryInstance=function(e){var t=this._entity,i=t.isAvailable(e),r=Property.getValueOrDefault(this._outlineColorProperty,e,Color.BLACK,scratchColor$j),n=this._distanceDisplayConditionProperty.getValue(e);return new GeometryInstance({id:t,geometry:new WallOutlineGeometry(this._options),attributes:{show:new ShowGeometryInstanceAttribute(i&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:ColorGeometryInstanceAttribute.fromColor(r),distanceDisplayCondition:DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(n)}})},WallGeometryUpdater.prototype._isHidden=function(e,t){return!defined(t.positions)||GeometryUpdater.prototype._isHidden.call(this,e,t)},WallGeometryUpdater.prototype._getIsClosed=function(e){return!1},WallGeometryUpdater.prototype._isDynamic=function(e,t){return!(t.positions.isConstant&&Property.isConstant(t.minimumHeights)&&Property.isConstant(t.maximumHeights)&&Property.isConstant(t.outlineWidth)&&Property.isConstant(t.granularity))},WallGeometryUpdater.prototype._setStaticOptions=function(e,t){var i=t.minimumHeights,r=t.maximumHeights,n=t.granularity,a=this._materialProperty instanceof ColorMaterialProperty,o=this._options;o.vertexFormat=a?PerInstanceColorAppearance.VERTEX_FORMAT:MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat,o.positions=t.positions.getValue(Iso8601.MINIMUM_VALUE,o.positions),o.minimumHeights=defined(i)?i.getValue(Iso8601.MINIMUM_VALUE,o.minimumHeights):void 0,o.maximumHeights=defined(r)?r.getValue(Iso8601.MINIMUM_VALUE,o.maximumHeights):void 0,o.granularity=defined(n)?n.getValue(Iso8601.MINIMUM_VALUE):void 0},WallGeometryUpdater.DynamicGeometryUpdater=DynamicWallGeometryUpdater,defined(Object.create)&&(DynamicWallGeometryUpdater.prototype=Object.create(DynamicGeometryUpdater.prototype),DynamicWallGeometryUpdater.prototype.constructor=DynamicWallGeometryUpdater),DynamicWallGeometryUpdater.prototype._isHidden=function(e,t,i){return!defined(this._options.positions)||DynamicGeometryUpdater.prototype._isHidden.call(this,e,t,i)},DynamicWallGeometryUpdater.prototype._setOptions=function(e,t,i){var r=this._options;r.positions=Property.getValueOrUndefined(t.positions,i,r.positions),r.minimumHeights=Property.getValueOrUndefined(t.minimumHeights,i,r.minimumHeights),r.maximumHeights=Property.getValueOrUndefined(t.maximumHeights,i,r.maximumHeights),r.granularity=Property.getValueOrUndefined(t.granularity,i)};var emptyArray=[],geometryUpdaters=[BoxGeometryUpdater,CylinderGeometryUpdater,CorridorGeometryUpdater,EllipseGeometryUpdater,EllipsoidGeometryUpdater,PlaneGeometryUpdater,PolygonGeometryUpdater,PolylineVolumeGeometryUpdater,RectangleGeometryUpdater,WallGeometryUpdater];function GeometryUpdaterSet(e,t){this.entity=e,this.scene=t;var i=new Array(geometryUpdaters.length),r=new Event;function n(e){r.raiseEvent(e)}for(var a=new EventHelper,o=0;o<i.length;o++){var s=new geometryUpdaters[o](e,t);a.add(s.geometryChanged,n),i[o]=s}this.updaters=i,this.geometryChanged=r,this.eventHelper=a,this._removeEntitySubscription=e.definitionChanged.addEventListener(GeometryUpdaterSet.prototype._onEntityPropertyChanged,this)}function GeometryVisualizer(e,t,i,r){i=defaultValue(i,e.primitives),r=defaultValue(r,e.groundPrimitives),this._scene=e,this._primitives=i,this._groundPrimitives=r,this._entityCollection=void 0,this._addedObjects=new AssociativeArray,this._removedObjects=new AssociativeArray,this._changedObjects=new AssociativeArray;var n=ShadowMode$1.NUMBER_OF_SHADOW_MODES;this._outlineBatches=new Array(2*n),this._closedColorBatches=new Array(2*n),this._closedMaterialBatches=new Array(2*n),this._openColorBatches=new Array(2*n),this._openMaterialBatches=new Array(2*n);var a,o=Entity.supportsMaterialsforEntitiesOnTerrain(e);for(this._supportsMaterialsforEntitiesOnTerrain=o,a=0;a<n;++a)this._outlineBatches[a]=new StaticOutlineGeometryBatch(i,e,a,!1),this._outlineBatches[n+a]=new StaticOutlineGeometryBatch(i,e,a,!0),this._closedColorBatches[a]=new StaticGeometryColorBatch(i,PerInstanceColorAppearance,void 0,!0,a,!0),this._closedColorBatches[n+a]=new StaticGeometryColorBatch(i,PerInstanceColorAppearance,void 0,!0,a,!1),this._closedMaterialBatches[a]=new StaticGeometryPerMaterialBatch(i,MaterialAppearance,void 0,!0,a,!0),this._closedMaterialBatches[n+a]=new StaticGeometryPerMaterialBatch(i,MaterialAppearance,void 0,!0,a,!1),this._openColorBatches[a]=new StaticGeometryColorBatch(i,PerInstanceColorAppearance,void 0,!1,a,!0),this._openColorBatches[n+a]=new StaticGeometryColorBatch(i,PerInstanceColorAppearance,void 0,!1,a,!1),this._openMaterialBatches[a]=new StaticGeometryPerMaterialBatch(i,MaterialAppearance,void 0,!1,a,!0),this._openMaterialBatches[n+a]=new StaticGeometryPerMaterialBatch(i,MaterialAppearance,void 0,!1,a,!1);var s=ClassificationType$1.NUMBER_OF_CLASSIFICATION_TYPES,l=new Array(s),u=[];if(o)for(a=0;a<s;++a)u.push(new StaticGroundGeometryPerMaterialBatch(r,a,MaterialAppearance)),l[a]=new StaticGroundGeometryColorBatch(r,a);else for(a=0;a<s;++a)l[a]=new StaticGroundGeometryColorBatch(r,a);this._groundColorBatches=l,this._groundMaterialBatches=u,this._dynamicBatch=new DynamicGeometryBatch(i,r),this._batches=this._outlineBatches.concat(this._closedColorBatches,this._closedMaterialBatches,this._openColorBatches,this._openMaterialBatches,this._groundColorBatches,this._groundMaterialBatches,this._dynamicBatch),this._subscriptions=new AssociativeArray,this._updaterSets=new AssociativeArray,(this._entityCollection=t).collectionChanged.addEventListener(GeometryVisualizer.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,emptyArray)}GeometryUpdaterSet.prototype._onEntityPropertyChanged=function(e,t,i,r){for(var n=this.updaters,a=0;a<n.length;a++)n[a]._onEntityPropertyChanged(e,t,i,r)},GeometryUpdaterSet.prototype.forEach=function(e){for(var t=this.updaters,i=0;i<t.length;i++)e(t[i])},GeometryUpdaterSet.prototype.destroy=function(){this.eventHelper.removeAll();for(var e=this.updaters,t=0;t<e.length;t++)e[t].destroy();this._removeEntitySubscription(),destroyObject(this)},GeometryVisualizer.prototype.update=function(t){var e,i,r,n,a=this._addedObjects,o=a.values,s=this._removedObjects,l=s.values,u=this._changedObjects,c=u.values,d=this;for(e=c.length-1;-1<e;e--)r=(i=c[e]).id,(n=this._updaterSets.get(r)).entity===i?n.forEach(function(e){d._removeUpdater(e),d._insertUpdaterIntoBatch(t,e)}):(l.push(i),o.push(i));for(e=l.length-1;-1<e;e--)r=(i=l[e]).id,(n=this._updaterSets.get(r)).forEach(this._removeUpdater.bind(this)),n.destroy(),this._updaterSets.remove(r),this._subscriptions.get(r)(),this._subscriptions.remove(r);for(e=o.length-1;-1<e;e--)r=(i=o[e]).id,n=new GeometryUpdaterSet(i,this._scene),this._updaterSets.set(r,n),n.forEach(function(e){d._insertUpdaterIntoBatch(t,e)}),this._subscriptions.set(r,n.geometryChanged.addEventListener(GeometryVisualizer._onGeometryChanged,this));a.removeAll(),s.removeAll(),u.removeAll();var h=!0,p=this._batches,f=p.length;for(e=0;e<f;e++)h=p[e].update(t)&&h;return h};var getBoundingSphereArrayScratch=[],getBoundingSphereBoundingSphereScratch=new BoundingSphere;GeometryVisualizer.prototype.getBoundingSphere=function(e,t){for(var i=getBoundingSphereArrayScratch,r=getBoundingSphereBoundingSphereScratch,n=0,a=BoundingSphereState$1.DONE,o=this._batches,s=o.length,l=e.id,u=this._updaterSets.get(l).updaters,c=0;c<u.length;c++)for(var d=u[c],h=0;h<s;h++){if((a=o[h].getBoundingSphere(d,r))===BoundingSphereState$1.PENDING)return BoundingSphereState$1.PENDING;a===BoundingSphereState$1.DONE&&(i[n]=BoundingSphere.clone(r,i[n]),n++)}return 0===n?BoundingSphereState$1.FAILED:(i.length=n,BoundingSphere.fromBoundingSpheres(i,t),BoundingSphereState$1.DONE)},GeometryVisualizer.prototype.isDestroyed=function(){return!1},GeometryVisualizer.prototype.destroy=function(){var e;this._entityCollection.collectionChanged.removeEventListener(GeometryVisualizer.prototype._onCollectionChanged,this),this._addedObjects.removeAll(),this._removedObjects.removeAll();var t=this._batches,i=t.length;for(e=0;e<i;e++)t[e].removeAllPrimitives();var r=this._subscriptions.values;for(i=r.length,e=0;e<i;e++)r[e]();this._subscriptions.removeAll();var n=this._updaterSets.values;for(i=n.length,e=0;e<i;e++)n[e].destroy();return this._updaterSets.removeAll(),destroyObject(this)},GeometryVisualizer.prototype._removeUpdater=function(e){for(var t=this._batches,i=t.length,r=0;r<i;r++)t[r].remove(e)},GeometryVisualizer.prototype._insertUpdaterIntoBatch=function(e,t){if(t.isDynamic)this._dynamicBatch.add(e,t);else{var i;(t.outlineEnabled||t.fillEnabled)&&(i=t.shadowsProperty.getValue(e));var r=ShadowMode$1.NUMBER_OF_SHADOW_MODES;if(t.outlineEnabled&&(defined(t.terrainOffsetProperty)?this._outlineBatches[r+i].add(e,t):this._outlineBatches[i].add(e,t)),t.fillEnabled)if(t.onTerrain){var n=t.classificationTypeProperty.getValue(e);t.fillMaterialProperty instanceof ColorMaterialProperty?this._groundColorBatches[n].add(e,t):this._groundMaterialBatches[n].add(e,t)}else t.isClosed?t.fillMaterialProperty instanceof ColorMaterialProperty?defined(t.terrainOffsetProperty)?this._closedColorBatches[r+i].add(e,t):this._closedColorBatches[i].add(e,t):defined(t.terrainOffsetProperty)?this._closedMaterialBatches[r+i].add(e,t):this._closedMaterialBatches[i].add(e,t):t.fillMaterialProperty instanceof ColorMaterialProperty?defined(t.terrainOffsetProperty)?this._openColorBatches[r+i].add(e,t):this._openColorBatches[i].add(e,t):defined(t.terrainOffsetProperty)?this._openMaterialBatches[r+i].add(e,t):this._openMaterialBatches[i].add(e,t)}},GeometryVisualizer._onGeometryChanged=function(e){var t=this._removedObjects,i=this._changedObjects,r=e.entity,n=r.id;defined(t.get(n))||defined(i.get(n))||i.set(n,r)},GeometryVisualizer.prototype._onCollectionChanged=function(e,t,i){var r,n,a,o=this._addedObjects,s=this._removedObjects,l=this._changedObjects;for(r=i.length-1;-1<r;r--)n=(a=i[r]).id,o.remove(n)||(s.set(n,a),l.remove(n));for(r=t.length-1;-1<r;r--)n=(a=t[r]).id,s.remove(n)?l.set(n,a):o.set(n,a)};var defaultScale$3=1,defaultFont="30px sans-serif",defaultStyle=LabelStyle$1.FILL,defaultFillColor=Color.WHITE,defaultOutlineColor$2=Color.BLACK,defaultOutlineWidth$1=1,defaultShowBackground=!1,defaultBackgroundColor=new Color(.165,.165,.165,.8),defaultBackgroundPadding=new Cartesian2(7,5),defaultPixelOffset$2=Cartesian2.ZERO,defaultEyeOffset$2=Cartesian3.ZERO,defaultHeightReference$2=HeightReference$1.NONE,defaultHorizontalOrigin$2=HorizontalOrigin$1.CENTER,defaultVerticalOrigin$2=VerticalOrigin$1.CENTER,positionScratch$b=new Cartesian3,fillColorScratch=new Color,outlineColorScratch=new Color,backgroundColorScratch=new Color,backgroundPaddingScratch=new Cartesian2,eyeOffsetScratch$1=new Cartesian3,pixelOffsetScratch$1=new Cartesian2,translucencyByDistanceScratch$2=new NearFarScalar,pixelOffsetScaleByDistanceScratch$2=new NearFarScalar,scaleByDistanceScratch$2=new NearFarScalar,distanceDisplayConditionScratch$7=new DistanceDisplayCondition;function EntityData$2(e){this.entity=e,this.label=void 0,this.index=void 0}function LabelVisualizer(e,t){t.collectionChanged.addEventListener(LabelVisualizer.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new AssociativeArray,this._onCollectionChanged(t,t.values,[],[])}function returnPrimitive$2(e,t,i){defined(e)&&(e.label=void 0,i.removeLabel(t))}LabelVisualizer.prototype.update=function(e){for(var t=this._items.values,i=this._cluster,r=0,n=t.length;r<n;r++){var a,o,s=t[r],l=s.entity,u=l._label,c=s.label,d=l.isShowing&&l.isAvailable(e)&&Property.getValueOrDefault(u._show,e,!0);if(d&&(o=Property.getValueOrUndefined(l._position,e,positionScratch$b),a=Property.getValueOrUndefined(u._text,e),d=defined(o)&&defined(a)),d){Property.isConstant(l._position)||(i._clusterDirty=!0);var h=!1,p=Property.getValueOrDefault(u._heightReference,e,defaultHeightReference$2);defined(c)||((c=i.getLabel(l)).id=l,s.label=c,h=Cartesian3.equals(c.position,o)&&c.heightReference===p),c.show=!0,c.position=o,c.text=a,c.scale=Property.getValueOrDefault(u._scale,e,defaultScale$3),c.font=Property.getValueOrDefault(u._font,e,defaultFont),c.style=Property.getValueOrDefault(u._style,e,defaultStyle),c.fillColor=Property.getValueOrDefault(u._fillColor,e,defaultFillColor,fillColorScratch),c.outlineColor=Property.getValueOrDefault(u._outlineColor,e,defaultOutlineColor$2,outlineColorScratch),c.outlineWidth=Property.getValueOrDefault(u._outlineWidth,e,defaultOutlineWidth$1),c.showBackground=Property.getValueOrDefault(u._showBackground,e,defaultShowBackground),c.backgroundColor=Property.getValueOrDefault(u._backgroundColor,e,defaultBackgroundColor,backgroundColorScratch),c.backgroundPadding=Property.getValueOrDefault(u._backgroundPadding,e,defaultBackgroundPadding,backgroundPaddingScratch),c.pixelOffset=Property.getValueOrDefault(u._pixelOffset,e,defaultPixelOffset$2,pixelOffsetScratch$1),c.eyeOffset=Property.getValueOrDefault(u._eyeOffset,e,defaultEyeOffset$2,eyeOffsetScratch$1),c.heightReference=p,c.horizontalOrigin=Property.getValueOrDefault(u._horizontalOrigin,e,defaultHorizontalOrigin$2),c.verticalOrigin=Property.getValueOrDefault(u._verticalOrigin,e,defaultVerticalOrigin$2),c.translucencyByDistance=Property.getValueOrUndefined(u._translucencyByDistance,e,translucencyByDistanceScratch$2),c.pixelOffsetScaleByDistance=Property.getValueOrUndefined(u._pixelOffsetScaleByDistance,e,pixelOffsetScaleByDistanceScratch$2),c.scaleByDistance=Property.getValueOrUndefined(u._scaleByDistance,e,scaleByDistanceScratch$2),c.distanceDisplayCondition=Property.getValueOrUndefined(u._distanceDisplayCondition,e,distanceDisplayConditionScratch$7),c.disableDepthTestDistance=Property.getValueOrUndefined(u._disableDepthTestDistance,e),h&&c._updateClamping()}else returnPrimitive$2(s,l,i)}return!0},LabelVisualizer.prototype.getBoundingSphere=function(e,t){var i=this._items.get(e.id);if(!defined(i)||!defined(i.label))return BoundingSphereState$1.FAILED;var r=i.label;return t.center=Cartesian3.clone(defaultValue(r._clampedPosition,r.position),t.center),t.radius=0,BoundingSphereState$1.DONE},LabelVisualizer.prototype.isDestroyed=function(){return!1},LabelVisualizer.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(LabelVisualizer.prototype._onCollectionChanged,this);for(var e=this._entityCollection.values,t=0;t<e.length;t++)this._cluster.removeLabel(e[t]);return destroyObject(this)},LabelVisualizer.prototype._onCollectionChanged=function(e,t,i,r){var n,a,o=this._items,s=this._cluster;for(n=t.length-1;-1<n;n--)defined((a=t[n])._label)&&defined(a._position)&&o.set(a.id,new EntityData$2(a));for(n=r.length-1;-1<n;n--)defined((a=r[n])._label)&&defined(a._position)?o.contains(a.id)||o.set(a.id,new EntityData$2(a)):(returnPrimitive$2(o.get(a.id),a,s),o.remove(a.id));for(n=i.length-1;-1<n;n--)a=i[n],returnPrimitive$2(o.get(a.id),a,s),o.remove(a.id)};var defaultScale$4=1,defaultMinimumPixelSize=0,defaultIncrementallyLoadTextures=!0,defaultClampAnimations=!0,defaultShadows$1=ShadowMode$1.ENABLED,defaultHeightReference$3=HeightReference$1.NONE,defaultSilhouetteColor=Color.RED,defaultSilhouetteSize=0,defaultColor$7=Color.WHITE,defaultColorBlendMode=ColorBlendMode$1.HIGHLIGHT,defaultColorBlendAmount=.5,defaultImageBasedLightingFactor=new Cartesian2(1,1),modelMatrixScratch$1=new Matrix4,nodeMatrixScratch=new Matrix4;function ModelVisualizer(e,t){t.collectionChanged.addEventListener(ModelVisualizer.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._modelHash={},this._entitiesToVisualize=new AssociativeArray,this._onCollectionChanged(t,t.values,[],[])}function removeModel(e,t,i,r){var n=i[t.id];defined(n)&&(r.removeAndDestroy(n.modelPrimitive),delete i[t.id])}function clearNodeTransformationsArticulationsScratch(e,t){var i=t[e.id];defined(i)&&(i.nodeTransformationsScratch={},i.articulationsScratch={})}function checkModelLoad(e,t,i){e.readyPromise.otherwise(function(e){console.error(e),i[t.id].loadFail=!0})}ModelVisualizer.prototype.update=function(e){for(var t=this._entitiesToVisualize.values,i=this._modelHash,r=this._primitives,n=0,a=t.length;n<a;n++){var o,s,l=t[n],u=l._model,c=i[l.id],d=l.isShowing&&l.isAvailable(e)&&Property.getValueOrDefault(u._show,e,!0);if(d&&(s=l.computeModelMatrix(e,modelMatrixScratch$1),o=Resource.createIfNeeded(Property.getValueOrUndefined(u._uri,e)),d=defined(s)&&defined(o)),d){var h=defined(c)?c.modelPrimitive:void 0;if(defined(h)&&o.url===c.url||(defined(h)&&(r.removeAndDestroy(h),delete i[l.id]),(h=Model.fromGltf({url:o,incrementallyLoadTextures:Property.getValueOrDefault(u._incrementallyLoadTextures,e,defaultIncrementallyLoadTextures),scene:this._scene})).id=l,r.add(h),c={modelPrimitive:h,url:o.url,animationsRunning:!1,nodeTransformationsScratch:{},articulationsScratch:{},loadFail:!1},i[l.id]=c,checkModelLoad(h,l,i)),h.show=!0,h.scale=Property.getValueOrDefault(u._scale,e,defaultScale$4),h.minimumPixelSize=Property.getValueOrDefault(u._minimumPixelSize,e,defaultMinimumPixelSize),h.maximumScale=Property.getValueOrUndefined(u._maximumScale,e),h.modelMatrix=Matrix4.clone(s,h.modelMatrix),h.shadows=Property.getValueOrDefault(u._shadows,e,defaultShadows$1),h.heightReference=Property.getValueOrDefault(u._heightReference,e,defaultHeightReference$3),h.distanceDisplayCondition=Property.getValueOrUndefined(u._distanceDisplayCondition,e),h.silhouetteColor=Property.getValueOrDefault(u._silhouetteColor,e,defaultSilhouetteColor,h._silhouetteColor),h.silhouetteSize=Property.getValueOrDefault(u._silhouetteSize,e,defaultSilhouetteSize),h.color=Property.getValueOrDefault(u._color,e,defaultColor$7,h._color),h.colorBlendMode=Property.getValueOrDefault(u._colorBlendMode,e,defaultColorBlendMode),h.colorBlendAmount=Property.getValueOrDefault(u._colorBlendAmount,e,defaultColorBlendAmount),h.clippingPlanes=Property.getValueOrUndefined(u._clippingPlanes,e),h.clampAnimations=Property.getValueOrDefault(u._clampAnimations,e,defaultClampAnimations),h.imageBasedLightingFactor=Property.getValueOrDefault(u._imageBasedLightingFactor,e,defaultImageBasedLightingFactor),h.lightColor=Property.getValueOrUndefined(u._lightColor,e),h.ready){var p=Property.getValueOrDefault(u._runAnimations,e,!0);c.animationsRunning!==p&&(p?h.activeAnimations.addAll({loop:ModelAnimationLoop$1.REPEAT}):h.activeAnimations.removeAll(),c.animationsRunning=p);var f=Property.getValueOrUndefined(u._nodeTransformations,e,c.nodeTransformationsScratch);if(defined(f))for(var m=Object.keys(f),g=0,y=m.length;g<y;++g){var v=m[g],_=f[v];if(defined(_)){var C=h.getNode(v);if(defined(C)){var x=Matrix4.fromTranslationRotationScale(_,nodeMatrixScratch);C.matrix=Matrix4.multiply(C.originalMatrix,x,x)}}}var b=!1,A=Property.getValueOrUndefined(u._articulations,e,c.articulationsScratch);if(defined(A))for(var S=Object.keys(A),w=0,E=S.length;w<E;++w){var T=S[w],P=A[T];defined(P)&&(b=!0,h.setArticulationStage(T,P))}b&&h.applyArticulations()}}else defined(c)&&(c.modelPrimitive.show=!1)}return!0},ModelVisualizer.prototype.isDestroyed=function(){return!1},ModelVisualizer.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(ModelVisualizer.prototype._onCollectionChanged,this);for(var e=this._entitiesToVisualize.values,t=this._modelHash,i=this._primitives,r=e.length-1;-1<r;r--)removeModel(this,e[r],t,i);return destroyObject(this)},ModelVisualizer.prototype.getBoundingSphere=function(e,t){var i=this._modelHash[e.id];if(!defined(i)||i.loadFail)return BoundingSphereState$1.FAILED;var r=i.modelPrimitive;if(!defined(r)||!r.show)return BoundingSphereState$1.FAILED;if(!r.ready)return BoundingSphereState$1.PENDING;if(r.heightReference===HeightReference$1.NONE)BoundingSphere.transform(r.boundingSphere,r.modelMatrix,t);else{if(!defined(r._clampedModelMatrix))return BoundingSphereState$1.PENDING;BoundingSphere.transform(r.boundingSphere,r._clampedModelMatrix,t)}return BoundingSphereState$1.DONE},ModelVisualizer.prototype._onCollectionChanged=function(e,t,i,r){var n,a,o=this._entitiesToVisualize,s=this._modelHash,l=this._primitives;for(n=t.length-1;-1<n;n--)defined((a=t[n])._model)&&defined(a._position)&&o.set(a.id,a);for(n=r.length-1;-1<n;n--)defined((a=r[n])._model)&&defined(a._position)?(clearNodeTransformationsArticulationsScratch(a,s),o.set(a.id,a)):(removeModel(this,a,s,l),o.remove(a.id));for(n=i.length-1;-1<n;n--)removeModel(this,a=i[n],s,l),o.remove(a.id)};var defaultResolution=60,defaultWidth=1,scratchTimeInterval$1=new TimeInterval,subSampleCompositePropertyScratch=new TimeInterval,subSampleIntervalPropertyScratch=new TimeInterval;function EntityData$3(e){this.entity=e,this.polyline=void 0,this.index=void 0,this.updater=void 0}function subSampleSampledProperty(e,t,i,r,n,a,o,s,l){var u,c=s;defined(u=e.getValueInReferenceFrame(t,a,l[c]))&&(l[c++]=u);for(var d,h,p,f=!defined(n)||JulianDate.lessThanOrEquals(n,t)||JulianDate.greaterThanOrEquals(n,i),m=0,g=r.length,y=r[m],v=i,_=!1;m<g;){if(!f&&JulianDate.greaterThanOrEquals(y,n)&&(defined(u=e.getValueInReferenceFrame(n,a,l[c]))&&(l[c++]=u),f=!0),JulianDate.greaterThan(y,t)&&JulianDate.lessThan(y,v)&&!y.equals(n)&&defined(u=e.getValueInReferenceFrame(y,a,l[c]))&&(l[c++]=u),m<g-1){if(0<o&&!_){var C=r[m+1],x=JulianDate.secondsDifference(C,y);(_=o<x)&&(d=Math.ceil(x/o),h=0,p=x/Math.max(d,2),d=Math.max(d-1,1))}if(_&&h<d){y=JulianDate.addSeconds(y,p,new JulianDate),h++;continue}}_=!1,y=r[++m]}return defined(u=e.getValueInReferenceFrame(i,a,l[c]))&&(l[c++]=u),c}function subSampleGenericProperty(e,t,i,r,n,a,o,s){for(var l,u=0,c=o,d=t,h=Math.max(a,60),p=!defined(r)||JulianDate.lessThanOrEquals(r,t)||JulianDate.greaterThanOrEquals(r,i);JulianDate.lessThan(d,i);)!p&&JulianDate.greaterThanOrEquals(d,r)&&(p=!0,defined(l=e.getValueInReferenceFrame(r,n,s[c]))&&(s[c]=l,c++)),defined(l=e.getValueInReferenceFrame(d,n,s[c]))&&(s[c]=l,c++),u++,d=JulianDate.addSeconds(t,h*u,new JulianDate);return defined(l=e.getValueInReferenceFrame(i,n,s[c]))&&(s[c]=l,c++),c}function subSampleIntervalProperty(e,t,i,r,n,a,o,s){subSampleIntervalPropertyScratch.start=t,subSampleIntervalPropertyScratch.stop=i;for(var l=o,u=e.intervals,c=0;c<u.length;c++){var d=u.get(c);if(!TimeInterval.intersect(d,subSampleIntervalPropertyScratch,scratchTimeInterval$1).isEmpty){var h=d.start;d.isStartIncluded||(h=d.isStopIncluded?d.stop:JulianDate.addSeconds(d.start,JulianDate.secondsDifference(d.stop,d.start)/2,new JulianDate));var p=e.getValueInReferenceFrame(h,n,s[l]);defined(p)&&(s[l]=p,l++)}}return l}function subSampleConstantProperty(e,t,i,r,n,a,o,s){var l=e.getValueInReferenceFrame(t,n,s[o]);return defined(l)&&(s[o++]=l),o}function subSampleCompositeProperty(e,t,i,r,n,a,o,s){subSampleCompositePropertyScratch.start=t,subSampleCompositePropertyScratch.stop=i;for(var l=o,u=e.intervals,c=0;c<u.length;c++){var d=u.get(c);if(!TimeInterval.intersect(d,subSampleCompositePropertyScratch,scratchTimeInterval$1).isEmpty){var h=d.start,p=d.stop,f=t;JulianDate.greaterThan(h,f)&&(f=h);var m=i;JulianDate.lessThan(p,m)&&(m=p),l=reallySubSample(d.data,f,m,r,n,a,l,s)}}return l}function reallySubSample(e,t,i,r,n,a,o,s){for(;e instanceof ReferenceProperty;)e=e.resolvedProperty;e instanceof SampledPositionProperty?o=subSampleSampledProperty(e,t,i,e._property._times,r,n,a,o,s):o=e instanceof CompositePositionProperty?subSampleCompositeProperty(e,t,i,r,n,a,o,s):e instanceof TimeIntervalCollectionPositionProperty?subSampleIntervalProperty(e,t,i,r,n,a,o,s):e instanceof ConstantPositionProperty||e instanceof ScaledPositionProperty&&Property.isConstant(e)?subSampleConstantProperty(e,t,i,r,n,a,o,s):subSampleGenericProperty(e,t,i,r,n,a,o,s);return o}function subSample(e,t,i,r,n,a,o){defined(o)||(o=[]);var s=reallySubSample(e,t,i,r,n,a,0,o);return o.length=s,o}var toFixedScratch=new Matrix3;function PolylineUpdater(e,t){this._unusedIndexes=[],this._polylineCollection=new PolylineCollection,this._scene=e,this._referenceFrame=t,e.primitives.add(this._polylineCollection)}function PathVisualizer(e,t){t.collectionChanged.addEventListener(PathVisualizer.prototype._onCollectionChanged,this),this._scene=e,this._updaters={},this._entityCollection=t,this._items=new AssociativeArray,this._onCollectionChanged(t,t.values,[],[])}PolylineUpdater.prototype.update=function(e){if(this._referenceFrame===ReferenceFrame$1.INERTIAL){var t=Transforms.computeIcrfToFixedMatrix(e,toFixedScratch);defined(t)||(t=Transforms.computeTemeToPseudoFixedMatrix(e,toFixedScratch)),Matrix4.fromRotationTranslation(t,Cartesian3.ZERO,this._polylineCollection.modelMatrix)}},PolylineUpdater.prototype.updateObject=function(e,t){var i,r,n=t.entity,a=n._path,o=n._position,s=a._show,l=t.polyline,u=n.isShowing&&(!defined(s)||s.getValue(e));if(u){var c=Property.getValueOrUndefined(a._leadTime,e),d=Property.getValueOrUndefined(a._trailTime,e),h=n._availability,p=defined(h),f=defined(c),m=defined(d);if(u=p||f&&m){if(m&&(i=JulianDate.addSeconds(e,-d,new JulianDate)),f&&(r=JulianDate.addSeconds(e,c,new JulianDate)),p){var g=h.start,y=h.stop;m&&!JulianDate.greaterThan(g,i)||(i=g),f&&!JulianDate.lessThan(y,r)||(r=y)}u=JulianDate.lessThan(i,r)}}if(u){if(!defined(l)){var v=this._unusedIndexes;if(0<v.length){var _=v.pop();l=this._polylineCollection.get(_),t.index=_}else t.index=this._polylineCollection.length,l=this._polylineCollection.add();l.id=n,t.polyline=l}var C=Property.getValueOrDefault(a._resolution,e,defaultResolution);l.show=!0,l.positions=subSample(o,i,r,e,this._referenceFrame,C,l.positions.slice()),l.material=MaterialProperty.getValue(e,a._material,l.material),l.width=Property.getValueOrDefault(a._width,e,defaultWidth),l.distanceDisplayCondition=Property.getValueOrUndefined(a._distanceDisplayCondition,e,l.distanceDisplayCondition)}else defined(l)&&(this._unusedIndexes.push(t.index),t.polyline=void 0,l.show=!1,t.index=void 0)},PolylineUpdater.prototype.removeObject=function(e){var t=e.polyline;defined(t)&&(this._unusedIndexes.push(e.index),e.polyline=void 0,t.show=!1,t.id=void 0,e.index=void 0)},PolylineUpdater.prototype.destroy=function(){return this._scene.primitives.remove(this._polylineCollection),destroyObject(this)},PathVisualizer.prototype.update=function(e){var t=this._updaters;for(var i in t)t.hasOwnProperty(i)&&t[i].update(e);var r=this._items.values;if(0===r.length&&defined(this._updaters)&&0<Object.keys(this._updaters).length){for(var n in t)t.hasOwnProperty(n)&&t[n].destroy();this._updaters={}}for(var a=0,o=r.length;a<o;a++){var s=r[a],l=s.entity._position,u=s.updater,c=ReferenceFrame$1.FIXED;this._scene.mode===SceneMode$1.SCENE3D&&(c=l.referenceFrame);var d=this._updaters[c];u===d&&defined(d)?d.updateObject(e,s):(defined(u)&&u.removeObject(s),defined(d)||((d=new PolylineUpdater(this._scene,c)).update(e),this._updaters[c]=d),defined(s.updater=d)&&d.updateObject(e,s))}return!0},PathVisualizer.prototype.isDestroyed=function(){return!1},PathVisualizer.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(PathVisualizer.prototype._onCollectionChanged,this);var e=this._updaters;for(var t in e)e.hasOwnProperty(t)&&e[t].destroy();return destroyObject(this)},PathVisualizer.prototype._onCollectionChanged=function(e,t,i,r){var n,a,o,s=this._items;for(n=t.length-1;-1<n;n--)defined((a=t[n])._path)&&defined(a._position)&&s.set(a.id,new EntityData$3(a));for(n=r.length-1;-1<n;n--)defined((a=r[n])._path)&&defined(a._position)?s.contains(a.id)||s.set(a.id,new EntityData$3(a)):defined(o=s.get(a.id))&&(defined(o.updater)&&o.updater.removeObject(o),s.remove(a.id));for(n=i.length-1;-1<n;n--)a=i[n],defined(o=s.get(a.id))&&(defined(o.updater)&&o.updater.removeObject(o),s.remove(a.id))},PathVisualizer._subSample=subSample;var defaultColor$8=Color.WHITE,defaultOutlineColor$3=Color.BLACK,defaultOutlineWidth$2=0,defaultPixelSize=1,defaultDisableDepthTestDistance=0,colorScratch$6=new Color,positionScratch$c=new Cartesian3,outlineColorScratch$1=new Color,scaleByDistanceScratch$3=new NearFarScalar,translucencyByDistanceScratch$3=new NearFarScalar,distanceDisplayConditionScratch$8=new DistanceDisplayCondition;function EntityData$4(e){this.entity=e,this.pointPrimitive=void 0,this.billboard=void 0,this.color=void 0,this.outlineColor=void 0,this.pixelSize=void 0,this.outlineWidth=void 0}function PointVisualizer(e,t){t.collectionChanged.addEventListener(PointVisualizer.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new AssociativeArray,this._onCollectionChanged(t,t.values,[],[])}function returnPrimitive$3(e,t,i){if(defined(e)){if(defined(e.pointPrimitive))return e.pointPrimitive=void 0,void i.removePoint(t);defined(e.billboard)&&(e.billboard=void 0,i.removeBillboard(t))}}PointVisualizer.prototype.update=function(e){for(var t=this._items.values,i=this._cluster,r=0,n=t.length;r<n;r++){var a,o=t[r],s=o.entity,l=s._point,u=o.pointPrimitive,c=o.billboard,d=Property.getValueOrDefault(l._heightReference,e,HeightReference$1.NONE),h=s.isShowing&&s.isAvailable(e)&&Property.getValueOrDefault(l._show,e,!0);if(h=h&&defined(a=Property.getValueOrUndefined(s._position,e,positionScratch$c))){Property.isConstant(s._position)||(i._clusterDirty=!0);var p=!1,f=!1;if(d===HeightReference$1.NONE||defined(c)?d!==HeightReference$1.NONE||defined(u)||(defined(c)&&(returnPrimitive$3(o,s,i),c=void 0),(u=i.getPoint(s)).id=s,o.pointPrimitive=u):(defined(u)&&(returnPrimitive$3(o,s,i),u=void 0),(c=i.getBillboard(s)).id=s,c.image=void 0,o.billboard=c,p=!0,f=Cartesian3.equals(c.position,a)&&c.heightReference===d),defined(u))u.show=!0,u.position=a,u.scaleByDistance=Property.getValueOrUndefined(l._scaleByDistance,e,scaleByDistanceScratch$3),u.translucencyByDistance=Property.getValueOrUndefined(l._translucencyByDistance,e,translucencyByDistanceScratch$3),u.color=Property.getValueOrDefault(l._color,e,defaultColor$8,colorScratch$6),u.outlineColor=Property.getValueOrDefault(l._outlineColor,e,defaultOutlineColor$3,outlineColorScratch$1),u.outlineWidth=Property.getValueOrDefault(l._outlineWidth,e,defaultOutlineWidth$2),u.pixelSize=Property.getValueOrDefault(l._pixelSize,e,defaultPixelSize),u.distanceDisplayCondition=Property.getValueOrUndefined(l._distanceDisplayCondition,e,distanceDisplayConditionScratch$8),u.disableDepthTestDistance=Property.getValueOrDefault(l._disableDepthTestDistance,e,defaultDisableDepthTestDistance);else if(defined(c)){c.show=!0,c.position=a,c.scaleByDistance=Property.getValueOrUndefined(l._scaleByDistance,e,scaleByDistanceScratch$3),c.translucencyByDistance=Property.getValueOrUndefined(l._translucencyByDistance,e,translucencyByDistanceScratch$3),c.distanceDisplayCondition=Property.getValueOrUndefined(l._distanceDisplayCondition,e,distanceDisplayConditionScratch$8),c.disableDepthTestDistance=Property.getValueOrDefault(l._disableDepthTestDistance,e,defaultDisableDepthTestDistance),c.heightReference=d;var m=Property.getValueOrDefault(l._color,e,defaultColor$8,colorScratch$6),g=Property.getValueOrDefault(l._outlineColor,e,defaultOutlineColor$3,outlineColorScratch$1),y=Math.round(Property.getValueOrDefault(l._outlineWidth,e,defaultOutlineWidth$2)),v=Math.max(1,Math.round(Property.getValueOrDefault(l._pixelSize,e,defaultPixelSize)));if(p=0<y?(c.scale=1,p||y!==o.outlineWidth||v!==o.pixelSize||!Color.equals(m,o.color)||!Color.equals(g,o.outlineColor)):(c.scale=v/50,v=50,p||y!==o.outlineWidth||!Color.equals(m,o.color)||!Color.equals(g,o.outlineColor))){o.color=Color.clone(m,o.color),o.outlineColor=Color.clone(g,o.outlineColor),o.pixelSize=v,o.outlineWidth=y;var _=m.alpha,C=m.toCssColorString(),x=g.toCssColorString(),b=JSON.stringify([C,v,x,y]);c.setImage(b,createBillboardPointCallback(_,C,x,y,v))}f&&c._updateClamping()}}else returnPrimitive$3(o,s,i)}return!0},PointVisualizer.prototype.getBoundingSphere=function(e,t){var i=this._items.get(e.id);if(!defined(i)||!defined(i.pointPrimitive)&&!defined(i.billboard))return BoundingSphereState$1.FAILED;if(defined(i.pointPrimitive))t.center=Cartesian3.clone(i.pointPrimitive.position,t.center);else{var r=i.billboard;if(!defined(r._clampedPosition))return BoundingSphereState$1.PENDING;t.center=Cartesian3.clone(r._clampedPosition,t.center)}return t.radius=0,BoundingSphereState$1.DONE},PointVisualizer.prototype.isDestroyed=function(){return!1},PointVisualizer.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(PointVisualizer.prototype._onCollectionChanged,this);for(var e=this._entityCollection.values,t=0;t<e.length;t++)this._cluster.removePoint(e[t]);return destroyObject(this)},PointVisualizer.prototype._onCollectionChanged=function(e,t,i,r){var n,a,o=this._items,s=this._cluster;for(n=t.length-1;-1<n;n--)defined((a=t[n])._point)&&defined(a._position)&&o.set(a.id,new EntityData$4(a));for(n=r.length-1;-1<n;n--)defined((a=r[n])._point)&&defined(a._position)?o.contains(a.id)||o.set(a.id,new EntityData$4(a)):(returnPrimitive$3(o.get(a.id),a,s),o.remove(a.id));for(n=i.length-1;-1<n;n--)a=i[n],returnPrimitive$3(o.get(a.id),a,s),o.remove(a.id)};var defaultZIndex$1=new ConstantProperty(0),polylineCollections={},scratchColor$k=new Color,defaultMaterial$2=new ColorMaterialProperty(Color.WHITE),defaultShow$1=new ConstantProperty(!0),defaultShadows$2=new ConstantProperty(ShadowMode$1.DISABLED),defaultDistanceDisplayCondition$6=new ConstantProperty(new DistanceDisplayCondition),defaultClassificationType$1=new ConstantProperty(ClassificationType$1.BOTH);function GeometryOptions(){this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function GroundGeometryOptions(){this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function PolylineGeometryUpdater(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(PolylineGeometryUpdater.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._geometryChanged=new Event,this._showProperty=void 0,this._materialProperty=void 0,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._classificationTypeProperty=void 0,this._depthFailMaterialProperty=void 0,this._geometryOptions=new GeometryOptions,this._groundGeometryOptions=new GroundGeometryOptions,this._id="polyline-"+e.id,this._clampToGround=!1,this._supportsPolylinesOnTerrain=Entity.supportsPolylinesOnTerrain(t),this._zIndex=0,this._onEntityPropertyChanged(e,"polyline",e.polyline,void 0)}Object.defineProperties(PolylineGeometryUpdater.prototype,{id:{get:function(){return this._id}},entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!defined(this._entity.availability)&&Property.isConstant(this._showProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},depthFailMaterialProperty:{get:function(){return this._depthFailMaterialProperty}},outlineEnabled:{value:!1},hasConstantOutline:{value:!0},outlineColorProperty:{value:void 0},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},classificationTypeProperty:{get:function(){return this._classificationTypeProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!1},geometryChanged:{get:function(){return this._geometryChanged}},arcType:{get:function(){return this._arcType}},clampToGround:{get:function(){return this._clampToGround&&this._supportsPolylinesOnTerrain}},zIndex:{get:function(){return this._zIndex}}}),PolylineGeometryUpdater.prototype.isOutlineVisible=function(e){return!1},PolylineGeometryUpdater.prototype.isFilled=function(e){var t=this._entity;return defaultValue(this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e),!1)},PolylineGeometryUpdater.prototype.createFillGeometryInstance=function(e){var t,i=this._entity,r=i.isAvailable(e),n=new ShowGeometryInstanceAttribute(r&&i.isShowing&&this._showProperty.getValue(e)),a=this._distanceDisplayConditionProperty.getValue(e),o={show:n,distanceDisplayCondition:DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(a)};return this._materialProperty instanceof ColorMaterialProperty&&(defined(this._materialProperty.color)&&(this._materialProperty.color.isConstant||r)&&(t=this._materialProperty.color.getValue(e,scratchColor$k)),defined(t)||(t=Color.WHITE),o.color=ColorGeometryInstanceAttribute.fromColor(t)),this.clampToGround?new GeometryInstance({id:i,geometry:new GroundPolylineGeometry(this._groundGeometryOptions),attributes:o}):(defined(this._depthFailMaterialProperty)&&this._depthFailMaterialProperty instanceof ColorMaterialProperty&&(defined(this._depthFailMaterialProperty.color)&&(this._depthFailMaterialProperty.color.isConstant||r)&&(t=this._depthFailMaterialProperty.color.getValue(e,scratchColor$k)),defined(t)||(t=Color.WHITE),o.depthFailColor=ColorGeometryInstanceAttribute.fromColor(t)),new GeometryInstance({id:i,geometry:new PolylineGeometry(this._geometryOptions),attributes:o}))},PolylineGeometryUpdater.prototype.createOutlineGeometryInstance=function(e){},PolylineGeometryUpdater.prototype.isDestroyed=function(){return!1},PolylineGeometryUpdater.prototype.destroy=function(){this._entitySubscription(),destroyObject(this)},PolylineGeometryUpdater.prototype._onEntityPropertyChanged=function(e,t,i,r){if("availability"===t||"polyline"===t){var n=this._entity.polyline;if(defined(n)){var a=n.positions,o=n.show;if(defined(o)&&o.isConstant&&!o.getValue(Iso8601.MINIMUM_VALUE)||!defined(a))this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));else{var s=n.zIndex,l=defaultValue(n.material,defaultMaterial$2),u=l instanceof ColorMaterialProperty;this._materialProperty=l,this._depthFailMaterialProperty=n.depthFailMaterial,this._showProperty=defaultValue(o,defaultShow$1),this._shadowsProperty=defaultValue(n.shadows,defaultShadows$2),this._distanceDisplayConditionProperty=defaultValue(n.distanceDisplayCondition,defaultDistanceDisplayCondition$6),this._classificationTypeProperty=defaultValue(n.classificationType,defaultClassificationType$1),this._fillEnabled=!0,this._zIndex=defaultValue(s,defaultZIndex$1);var c=n.width,d=n.arcType,h=n.clampToGround,p=n.granularity;if(a.isConstant&&Property.isConstant(c)&&Property.isConstant(d)&&Property.isConstant(p)&&Property.isConstant(h)&&Property.isConstant(s)){var f,m=this._geometryOptions,g=a.getValue(Iso8601.MINIMUM_VALUE,m.positions);if(!defined(g)||g.length<2)return void(this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this)));f=u&&(!defined(this._depthFailMaterialProperty)||this._depthFailMaterialProperty instanceof ColorMaterialProperty)?PolylineColorAppearance.VERTEX_FORMAT:PolylineMaterialAppearance.VERTEX_FORMAT,m.vertexFormat=f,m.positions=g,m.width=defined(c)?c.getValue(Iso8601.MINIMUM_VALUE):void 0,m.arcType=defined(d)?d.getValue(Iso8601.MINIMUM_VALUE):void 0,m.granularity=defined(p)?p.getValue(Iso8601.MINIMUM_VALUE):void 0;var y=this._groundGeometryOptions;y.positions=g,y.width=m.width,y.arcType=m.arcType,y.granularity=m.granularity,this._clampToGround=!!defined(h)&&h.getValue(Iso8601.MINIMUM_VALUE),!this._clampToGround&&defined(s)&&oneTimeWarning("Entity polylines must have clampToGround: true when using zIndex. zIndex will be ignored."),this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}}else this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this))}},PolylineGeometryUpdater.prototype.createDynamicUpdater=function(e,t){return new DynamicGeometryUpdater$1(e,t,this)};var generateCartesianArcOptions={positions:void 0,granularity:void 0,height:void 0,ellipsoid:void 0};function DynamicGeometryUpdater$1(e,t,i){this._line=void 0,this._primitives=e,this._groundPrimitives=t,this._groundPolylinePrimitive=void 0,this._material=void 0,this._geometryUpdater=i,this._positions=[]}function getLine(e){if(defined(e._line))return e._line;var t=e._geometryUpdater._scene.id,i=polylineCollections[t],r=e._primitives;!defined(i)||i.isDestroyed()?(i=new PolylineCollection,polylineCollections[t]=i,r.add(i)):r.contains(i)||r.add(i);var n=i.add();return n.id=e._geometryUpdater._entity,e._line=n}DynamicGeometryUpdater$1.prototype.update=function(e){var t=this._geometryUpdater,i=t._entity,r=i.polyline,n=r.positions,a=Property.getValueOrUndefined(n,e,this._positions);t._clampToGround=Property.getValueOrDefault(r._clampToGround,e,!1),t._groundGeometryOptions.positions=a,t._groundGeometryOptions.width=Property.getValueOrDefault(r._width,e,1),t._groundGeometryOptions.arcType=Property.getValueOrDefault(r._arcType,e,ArcType$1.GEODESIC),t._groundGeometryOptions.granularity=Property.getValueOrDefault(r._granularity,e,9999);var o=this._groundPrimitives;if(defined(this._groundPolylinePrimitive)&&(o.remove(this._groundPolylinePrimitive),this._groundPolylinePrimitive=void 0),t.clampToGround){if(!i.isShowing||!i.isAvailable(e)||!Property.getValueOrDefault(r._show,e,!0))return;if(!defined(a)||a.length<2)return;var s,l=t.fillMaterialProperty;if(l instanceof ColorMaterialProperty)s=new PolylineColorAppearance;else{var u=MaterialProperty.getValue(e,l,this._material);s=new PolylineMaterialAppearance({material:u,translucent:u.isTranslucent()}),this._material=u}return this._groundPolylinePrimitive=o.add(new GroundPolylinePrimitive({geometryInstances:t.createFillGeometryInstance(e),appearance:s,classificationType:t.classificationTypeProperty.getValue(e),asynchronous:!1}),Property.getValueOrUndefined(t.zIndex,e)),void(defined(this._line)&&(this._line.show=!1))}var c=getLine(this);if(i.isShowing&&i.isAvailable(e)&&Property.getValueOrDefault(r._show,e,!0))if(!defined(a)||a.length<2)c.show=!1;else{var d=ArcType$1.GEODESIC;d=Property.getValueOrDefault(r._arcType,e,d);var h=t._scene.globe;d!==ArcType$1.NONE&&defined(h)&&(generateCartesianArcOptions.ellipsoid=h.ellipsoid,generateCartesianArcOptions.positions=a,generateCartesianArcOptions.granularity=Property.getValueOrUndefined(r._granularity,e),generateCartesianArcOptions.height=PolylinePipeline.extractHeights(a,h.ellipsoid),a=d===ArcType$1.GEODESIC?PolylinePipeline.generateCartesianArc(generateCartesianArcOptions):PolylinePipeline.generateCartesianRhumbArc(generateCartesianArcOptions)),c.show=!0,c.positions=a.slice(),c.material=MaterialProperty.getValue(e,t.fillMaterialProperty,c.material),c.width=Property.getValueOrDefault(r._width,e,1),c.distanceDisplayCondition=Property.getValueOrUndefined(r._distanceDisplayCondition,e,c.distanceDisplayCondition)}else c.show=!1},DynamicGeometryUpdater$1.prototype.getBoundingSphere=function(e){if(this._geometryUpdater.clampToGround){var t=this._groundPolylinePrimitive;if(defined(t)&&t.show&&t.ready){var i=t.getGeometryInstanceAttributes(this._geometryUpdater._entity);if(defined(i)&&defined(i.boundingSphere))return BoundingSphere.clone(i.boundingSphere,e),BoundingSphereState$1.DONE}return defined(t)&&!t.ready?BoundingSphereState$1.PENDING:BoundingSphereState$1.DONE}var r=getLine(this);return r.show&&0<r.positions.length?(BoundingSphere.fromPoints(r.positions,e),BoundingSphereState$1.DONE):BoundingSphereState$1.FAILED},DynamicGeometryUpdater$1.prototype.isDestroyed=function(){return!1},DynamicGeometryUpdater$1.prototype.destroy=function(){var e=this._geometryUpdater._scene.id,t=polylineCollections[e];defined(t)&&(t.remove(this._line),0===t.length&&(this._primitives.removeAndDestroy(t),delete polylineCollections[e])),defined(this._groundPolylinePrimitive)&&this._groundPrimitives.remove(this._groundPolylinePrimitive),destroyObject(this)};var scratchColor$l=new Color,distanceDisplayConditionScratch$9=new DistanceDisplayCondition,defaultDistanceDisplayCondition$7=new DistanceDisplayCondition;function Batch$5(e,t,i,r,n){var a;a=i instanceof ColorMaterialProperty?PolylineColorAppearance:PolylineMaterialAppearance,this.orderedGroundPrimitives=e,this.classificationType=t,this.appearanceType=a,this.materialProperty=i,this.updaters=new AssociativeArray,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new AssociativeArray,this.material=void 0,this.updatersWithAttributes=new AssociativeArray,this.attributes=new AssociativeArray,this.invalidated=!1,this.removeMaterialSubscription=i.definitionChanged.addEventListener(Batch$5.prototype.onMaterialChanged,this),this.subscriptions=new AssociativeArray,this.showsUpdated=new AssociativeArray,this.zIndex=r,this._asynchronous=n}function StaticGroundPolylinePerMaterialBatch(e,t,i){this._items=[],this._orderedGroundPrimitives=e,this._classificationType=t,this._asynchronous=defaultValue(i,!0)}Batch$5.prototype.onMaterialChanged=function(){this.invalidated=!0},Batch$5.prototype.isMaterial=function(e){var t=this.materialProperty,i=e.fillMaterialProperty;return i===t||i instanceof ColorMaterialProperty&&t instanceof ColorMaterialProperty||defined(t)&&t.equals(i)},Batch$5.prototype.add=function(e,n,t){var i=n.id;if(this.updaters.set(i,n),this.geometry.set(i,t),n.hasConstantFill&&n.fillMaterialProperty.isConstant&&Property.isConstant(n.distanceDisplayConditionProperty)){var a=this;this.subscriptions.set(i,n.entity.definitionChanged.addEventListener(function(e,t,i,r){"isShowing"===t&&a.showsUpdated.set(n.id,n)}))}else this.updatersWithAttributes.set(i,n);this.createPrimitive=!0},Batch$5.prototype.remove=function(e){var t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);var i=this.subscriptions.get(t);return defined(i)&&(i(),this.subscriptions.remove(t)),!0}return!1},Batch$5.prototype.update=function(e){var t,i=!0,r=this.primitive,n=this.orderedGroundPrimitives,a=this.geometry.values;if(this.createPrimitive){if(0<a.length)defined(r)&&(defined(this.oldPrimitive)?n.remove(r):this.oldPrimitive=r),r=new GroundPolylinePrimitive({show:!1,asynchronous:this._asynchronous,geometryInstances:a.slice(),appearance:new this.appearanceType,classificationType:this.classificationType}),this.appearanceType===PolylineMaterialAppearance&&(this.material=MaterialProperty.getValue(e,this.materialProperty,this.material),r.appearance.material=this.material),n.add(r,this.zIndex),i=!1;else{defined(r)&&(n.remove(r),r=void 0);var o=this.oldPrimitive;defined(o)&&(n.remove(o),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=r,this.createPrimitive=!1}else if(defined(r)&&r.ready){r.show=!0,defined(this.oldPrimitive)&&(n.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.appearanceType===PolylineMaterialAppearance&&(this.material=MaterialProperty.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material);var s=this.updatersWithAttributes.values,l=s.length;for(t=0;t<l;t++){var u=s[t],c=u.entity,d=this.geometry.get(u.id),h=this.attributes.get(d.id.id);if(defined(h)||(h=r.getGeometryInstanceAttributes(d.id),this.attributes.set(d.id.id,h)),!u.fillMaterialProperty.isConstant){var p=u.fillMaterialProperty.color,f=Property.getValueOrDefault(p,e,Color.WHITE,scratchColor$l);Color.equals(h._lastColor,f)||(h._lastColor=Color.clone(f,h._lastColor),h.color=ColorGeometryInstanceAttribute.toValue(f,h.color))}var m=c.isShowing&&(u.hasConstantFill||u.isFilled(e));m!==(1===h.show[0])&&(h.show=ShowGeometryInstanceAttribute.toValue(m,h.show));var g=u.distanceDisplayConditionProperty;if(!Property.isConstant(g)){var y=Property.getValueOrDefault(g,e,defaultDistanceDisplayCondition$7,distanceDisplayConditionScratch$9);DistanceDisplayCondition.equals(y,h._lastDistanceDisplayCondition)||(h._lastDistanceDisplayCondition=DistanceDisplayCondition.clone(y,h._lastDistanceDisplayCondition),h.distanceDisplayCondition=DistanceDisplayConditionGeometryInstanceAttribute.toValue(y,h.distanceDisplayCondition))}}this.updateShows(r)}else defined(r)&&!r.ready&&(i=!1);return i},Batch$5.prototype.updateShows=function(e){for(var t=this.showsUpdated.values,i=t.length,r=0;r<i;r++){var n=t[r],a=n.entity,o=this.geometry.get(n.id),s=this.attributes.get(o.id.id);defined(s)||(s=e.getGeometryInstanceAttributes(o.id),this.attributes.set(o.id.id,s));var l=a.isShowing;l!==(1===s.show[0])&&(s.show=ShowGeometryInstanceAttribute.toValue(l,s.show),o.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()},Batch$5.prototype.contains=function(e){return this.updaters.contains(e.id)},Batch$5.prototype.getBoundingSphere=function(e,t){var i=this.primitive;if(!i.ready)return BoundingSphereState$1.PENDING;var r=i.getGeometryInstanceAttributes(e.entity);return!defined(r)||!defined(r.boundingSphere)||defined(r.show)&&0===r.show[0]?BoundingSphereState$1.FAILED:(r.boundingSphere.clone(t),BoundingSphereState$1.DONE)},Batch$5.prototype.destroy=function(){var e=this.primitive,t=this.orderedGroundPrimitives;defined(e)&&t.remove(e);var i=this.oldPrimitive;defined(i)&&t.remove(i),this.removeMaterialSubscription()},StaticGroundPolylinePerMaterialBatch.prototype.add=function(e,t){for(var i=this._items,r=i.length,n=t.createFillGeometryInstance(e),a=Property.getValueOrDefault(t.zIndex,0),o=0;o<r;++o){var s=i[o];if(s.isMaterial(t)&&s.zIndex===a)return void s.add(e,t,n)}var l=new Batch$5(this._orderedGroundPrimitives,this._classificationType,t.fillMaterialProperty,a,this._asynchronous);l.add(e,t,n),i.push(l)},StaticGroundPolylinePerMaterialBatch.prototype.remove=function(e){for(var t=this._items,i=t.length-1;0<=i;i--){var r=t[i];if(r.remove(e)){0===r.updaters.length&&(t.splice(i,1),r.destroy());break}}},StaticGroundPolylinePerMaterialBatch.prototype.update=function(e){var t,i=this._items;for(t=i.length-1;0<=t;t--){var r=i[t];if(r.invalidated){i.splice(t,1);for(var n=r.updaters.values,a=n.length,o=0;o<a;o++)this.add(e,n[o]);r.destroy()}}var s=!0;for(t=0;t<i.length;t++)s=i[t].update(e)&&s;return s},StaticGroundPolylinePerMaterialBatch.prototype.getBoundingSphere=function(e,t){for(var i=this._items,r=i.length,n=0;n<r;n++){var a=i[n];if(a.contains(e))return a.getBoundingSphere(e,t)}return BoundingSphereState$1.FAILED},StaticGroundPolylinePerMaterialBatch.prototype.removeAllPrimitives=function(){for(var e=this._items,t=e.length,i=0;i<t;i++)e[i].destroy();this._items.length=0};var emptyArray$1=[];function removeUpdater(e,t){for(var i=e._batches,r=i.length,n=0;n<r;n++)i[n].remove(t)}function insertUpdaterIntoBatch(e,t,i){if(i.isDynamic)e._dynamicBatch.add(t,i);else if(i.clampToGround&&i.fillEnabled){var r=i.classificationTypeProperty.getValue(t);e._groundBatches[r].add(t,i)}else{var n;i.fillEnabled&&(n=i.shadowsProperty.getValue(t));var a,o=0;defined(i.depthFailMaterialProperty)&&(o=i.depthFailMaterialProperty instanceof ColorMaterialProperty?1:2),defined(n)&&(a=n+o*ShadowMode$1.NUMBER_OF_SHADOW_MODES),i.fillEnabled&&(i.fillMaterialProperty instanceof ColorMaterialProperty?e._colorBatches[a].add(t,i):e._materialBatches[a].add(t,i))}}function PolylineVisualizer(e,t,i,r){var n;r=defaultValue(r,e.groundPrimitives),i=defaultValue(i,e.primitives),this._scene=e,this._primitives=i,this._entityCollection=void 0,this._addedObjects=new AssociativeArray,this._removedObjects=new AssociativeArray,this._changedObjects=new AssociativeArray;var a=ShadowMode$1.NUMBER_OF_SHADOW_MODES;for(this._colorBatches=new Array(3*a),this._materialBatches=new Array(3*a),n=0;n<a;++n)this._colorBatches[n]=new StaticGeometryColorBatch(i,PolylineColorAppearance,void 0,!1,n),this._materialBatches[n]=new StaticGeometryPerMaterialBatch(i,PolylineMaterialAppearance,void 0,!1,n),this._colorBatches[n+a]=new StaticGeometryColorBatch(i,PolylineColorAppearance,PolylineColorAppearance,!1,n),this._materialBatches[n+a]=new StaticGeometryPerMaterialBatch(i,PolylineMaterialAppearance,PolylineColorAppearance,!1,n),this._colorBatches[n+2*a]=new StaticGeometryColorBatch(i,PolylineColorAppearance,PolylineMaterialAppearance,!1,n),this._materialBatches[n+2*a]=new StaticGeometryPerMaterialBatch(i,PolylineMaterialAppearance,PolylineMaterialAppearance,!1,n);this._dynamicBatch=new DynamicGeometryBatch(i,r);var o=ClassificationType$1.NUMBER_OF_CLASSIFICATION_TYPES;for(this._groundBatches=new Array(o),n=0;n<o;++n)this._groundBatches[n]=new StaticGroundPolylinePerMaterialBatch(r,n);this._batches=this._colorBatches.concat(this._materialBatches,this._dynamicBatch,this._groundBatches),this._subscriptions=new AssociativeArray,this._updaters=new AssociativeArray,(this._entityCollection=t).collectionChanged.addEventListener(PolylineVisualizer.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,emptyArray$1)}PolylineVisualizer.prototype.update=function(e){var t,i,r,n,a=this._addedObjects,o=a.values,s=this._removedObjects,l=s.values,u=this._changedObjects,c=u.values;for(t=c.length-1;-1<t;t--)r=(i=c[t]).id,(n=this._updaters.get(r)).entity===i?(removeUpdater(this,n),insertUpdaterIntoBatch(this,e,n)):(l.push(i),o.push(i));for(t=l.length-1;-1<t;t--)r=(i=l[t]).id,n=this._updaters.get(r),removeUpdater(this,n),n.destroy(),this._updaters.remove(r),this._subscriptions.get(r)(),this._subscriptions.remove(r);for(t=o.length-1;-1<t;t--)r=(i=o[t]).id,n=new PolylineGeometryUpdater(i,this._scene),this._updaters.set(r,n),insertUpdaterIntoBatch(this,e,n),this._subscriptions.set(r,n.geometryChanged.addEventListener(PolylineVisualizer._onGeometryChanged,this));a.removeAll(),s.removeAll(),u.removeAll();var d=!0,h=this._batches,p=h.length;for(t=0;t<p;t++)d=h[t].update(e)&&d;return d};var getBoundingSphereArrayScratch$1=[],getBoundingSphereBoundingSphereScratch$1=new BoundingSphere;function DataSourceDisplay(e){GroundPrimitive.initializeTerrainHeights(),GroundPolylinePrimitive.initializeTerrainHeights();var t=e.scene,i=e.dataSourceCollection;this._eventHelper=new EventHelper,this._eventHelper.add(i.dataSourceAdded,this._onDataSourceAdded,this),this._eventHelper.add(i.dataSourceRemoved,this._onDataSourceRemoved,this),this._eventHelper.add(i.dataSourceMoved,this._onDataSourceMoved,this),this._eventHelper.add(t.postRender,this._postRender,this),this._dataSourceCollection=i,this._scene=t,this._visualizersCallback=defaultValue(e.visualizersCallback,DataSourceDisplay.defaultVisualizersCallback);var r=!1,n=new PrimitiveCollection,a=new PrimitiveCollection;0<i.length&&(t.primitives.add(n),t.groundPrimitives.add(a),r=!0),this._primitives=n,this._groundPrimitives=a;for(var o=0,s=i.length;o<s;o++)this._onDataSourceAdded(i,i.get(o));var l,u,c=new CustomDataSource;if(this._onDataSourceAdded(void 0,c),this._defaultDataSource=c,!r){var d=this,h=function(){t.primitives.add(n),t.groundPrimitives.add(a),l(),u(),d._removeDefaultDataSourceListener=void 0,d._removeDataSourceCollectionListener=void 0};l=c.entities.collectionChanged.addEventListener(h),u=i.dataSourceAdded.addEventListener(h)}this._removeDefaultDataSourceListener=l,this._removeDataSourceCollectionListener=u,this._ready=!1}PolylineVisualizer.prototype.getBoundingSphere=function(e,t){for(var i=getBoundingSphereArrayScratch$1,r=getBoundingSphereBoundingSphereScratch$1,n=0,a=BoundingSphereState$1.DONE,o=this._batches,s=o.length,l=this._updaters.get(e.id),u=0;u<s;u++){if((a=o[u].getBoundingSphere(l,r))===BoundingSphereState$1.PENDING)return BoundingSphereState$1.PENDING;a===BoundingSphereState$1.DONE&&(i[n]=BoundingSphere.clone(r,i[n]),n++)}return 0===n?BoundingSphereState$1.FAILED:(i.length=n,BoundingSphere.fromBoundingSpheres(i,t),BoundingSphereState$1.DONE)},PolylineVisualizer.prototype.isDestroyed=function(){return!1},PolylineVisualizer.prototype.destroy=function(){var e;this._entityCollection.collectionChanged.removeEventListener(PolylineVisualizer.prototype._onCollectionChanged,this),this._addedObjects.removeAll(),this._removedObjects.removeAll();var t=this._batches,i=t.length;for(e=0;e<i;e++)t[e].removeAllPrimitives();var r=this._subscriptions.values;for(i=r.length,e=0;e<i;e++)r[e]();return this._subscriptions.removeAll(),destroyObject(this)},PolylineVisualizer._onGeometryChanged=function(e){var t=this._removedObjects,i=this._changedObjects,r=e.entity,n=r.id;defined(t.get(n))||defined(i.get(n))||i.set(n,r)},PolylineVisualizer.prototype._onCollectionChanged=function(e,t,i){var r,n,a,o=this._addedObjects,s=this._removedObjects,l=this._changedObjects;for(r=i.length-1;-1<r;r--)n=(a=i[r]).id,o.remove(n)||(s.set(n,a),l.remove(n));for(r=t.length-1;-1<r;r--)n=(a=t[r]).id,s.remove(n)?l.set(n,a):o.set(n,a)},DataSourceDisplay.defaultVisualizersCallback=function(e,t,i){var r=i.entities;return[new BillboardVisualizer(t,r),new GeometryVisualizer(e,r,i._primitives,i._groundPrimitives),new LabelVisualizer(t,r),new ModelVisualizer(e,r),new Cesium3DTilesetVisualizer(e,r),new PointVisualizer(t,r),new PathVisualizer(e,r),new PolylineVisualizer(e,r,i._primitives,i._groundPrimitives)]},Object.defineProperties(DataSourceDisplay.prototype,{scene:{get:function(){return this._scene}},dataSources:{get:function(){return this._dataSourceCollection}},defaultDataSource:{get:function(){return this._defaultDataSource}},ready:{get:function(){return this._ready}}}),DataSourceDisplay.prototype.isDestroyed=function(){return!1},DataSourceDisplay.prototype.destroy=function(){this._eventHelper.removeAll();for(var e=this._dataSourceCollection,t=0,i=e.length;t<i;++t)this._onDataSourceRemoved(this._dataSourceCollection,e.get(t));return this._onDataSourceRemoved(void 0,this._defaultDataSource),defined(this._removeDefaultDataSourceListener)?(this._removeDefaultDataSourceListener(),this._removeDataSourceCollectionListener()):(this._scene.primitives.remove(this._primitives),this._scene.groundPrimitives.remove(this._groundPrimitives)),destroyObject(this)},DataSourceDisplay.prototype.update=function(e){if(!ApproximateTerrainHeights.initialized)return this._ready=!1;var t,i,r,n,a=!0,o=this._dataSourceCollection,s=o.length;for(t=0;t<s;t++){var l=o.get(t);for(defined(l.update)&&(a=l.update(e)&&a),n=(r=l._visualizers).length,i=0;i<n;i++)a=r[i].update(e)&&a}for(n=(r=this._defaultDataSource._visualizers).length,i=0;i<n;i++)a=r[i].update(e)&&a;return this._ready=a},DataSourceDisplay.prototype._postRender=function(){for(var e=this._scene.frameState,t=this._dataSourceCollection,i=t.length,r=0;r<i;r++){var n=t.get(r),a=n.credit;defined(a)&&e.creditDisplay.addCredit(a);var o=n._resourceCredits;if(defined(o))for(var s=o.length,l=0;l<s;l++)e.creditDisplay.addCredit(o[l])}};var getBoundingSphereArrayScratch$2=[],getBoundingSphereBoundingSphereScratch$2=new BoundingSphere;DataSourceDisplay.prototype.getBoundingSphere=function(e,t,i){if(!this._ready)return BoundingSphereState$1.PENDING;var r,n,a=this._defaultDataSource;if(!a.entities.contains(e)){a=void 0;var o=this._dataSourceCollection;for(n=o.length,r=0;r<n;r++){var s=o.get(r);if(s.entities.contains(e)){a=s;break}}}if(!defined(a))return BoundingSphereState$1.FAILED;var l=getBoundingSphereArrayScratch$2,u=getBoundingSphereBoundingSphereScratch$2,c=0,d=BoundingSphereState$1.DONE,h=a._visualizers,p=h.length;for(r=0;r<p;r++){if(defined(h[r].getBoundingSphere)){if(d=h[r].getBoundingSphere(e,u),!t&&d===BoundingSphereState$1.PENDING)return BoundingSphereState$1.PENDING;d===BoundingSphereState$1.DONE&&(l[c]=BoundingSphere.clone(u,l[c]),c++)}}return 0===c?BoundingSphereState$1.FAILED:(l.length=c,BoundingSphere.fromBoundingSpheres(l,i),BoundingSphereState$1.DONE)},DataSourceDisplay.prototype._onDataSourceAdded=function(e,t){var i=this._scene,r=this._primitives,n=this._groundPrimitives,a=r.add(new PrimitiveCollection),o=n.add(new OrderedGroundPrimitiveCollection);t._primitives=a,t._groundPrimitives=o;var s=t.clustering;s._initialize(i),a.add(s),t._visualizers=this._visualizersCallback(i,s,t)},DataSourceDisplay.prototype._onDataSourceRemoved=function(e,t){var i=this._primitives,r=this._groundPrimitives,n=t._primitives,a=t._groundPrimitives,o=t.clustering;n.remove(o);for(var s=t._visualizers,l=s.length,u=0;u<l;u++)s[u].destroy();i.remove(n),r.remove(a),t._visualizers=void 0},DataSourceDisplay.prototype._onDataSourceMoved=function(e,t,i){var r=this._primitives,n=this._groundPrimitives,a=e._primitives,o=e._groundPrimitives;t===i+1?(r.raise(a),n.raise(o)):t===i-1?(r.lower(a),n.lower(o)):0===t?(r.lowerToBottom(a),n.lowerToBottom(o),r.raise(a),n.raise(o)):(r.raiseToTop(a),n.raiseToTop(o))};var updateTransformMatrix3Scratch1=new Matrix3,updateTransformMatrix3Scratch2=new Matrix3,updateTransformMatrix3Scratch3=new Matrix3,updateTransformMatrix4Scratch=new Matrix4,updateTransformCartesian3Scratch1=new Cartesian3,updateTransformCartesian3Scratch2=new Cartesian3,updateTransformCartesian3Scratch3=new Cartesian3,updateTransformCartesian3Scratch4=new Cartesian3,updateTransformCartesian3Scratch5=new Cartesian3,updateTransformCartesian3Scratch6=new Cartesian3,deltaTime=new JulianDate,northUpAxisFactor=1.25;function updateTransform(e,t,i,r,n,a,o){var s=e.scene.mode,l=n.getValue(a,e._lastCartesian);if(defined(l)){var u,c,d,h,p,f,m=!1,g=!1;if(s===SceneMode$1.SCENE3D){JulianDate.addSeconds(a,.001,deltaTime);var y=n.getValue(deltaTime,updateTransformCartesian3Scratch1);if(defined(y)||(JulianDate.addSeconds(a,-.001,deltaTime),y=n.getValue(deltaTime,updateTransformCartesian3Scratch1),g=!0),defined(y)){var v,_=Transforms.computeFixedToIcrfMatrix(a,updateTransformMatrix3Scratch1),C=Transforms.computeFixedToIcrfMatrix(deltaTime,updateTransformMatrix3Scratch2);defined(_)&&defined(C)?v=Matrix3.transpose(_,updateTransformMatrix3Scratch3):(v=Transforms.computeTemeToPseudoFixedMatrix(a,updateTransformMatrix3Scratch3),_=Matrix3.transpose(v,updateTransformMatrix3Scratch1),C=Transforms.computeTemeToPseudoFixedMatrix(deltaTime,updateTransformMatrix3Scratch2),Matrix3.transpose(C,C));var x=Matrix3.multiplyByVector(_,l,updateTransformCartesian3Scratch5),b=Matrix3.multiplyByVector(C,y,updateTransformCartesian3Scratch6);Cartesian3.subtract(x,b,updateTransformCartesian3Scratch4);var A=1e3*Cartesian3.magnitude(updateTransformCartesian3Scratch4),S=CesiumMath.GRAVITATIONALPARAMETER,w=-S/(A*A-2*S/Cartesian3.magnitude(x));w<0||w>northUpAxisFactor*o.maximumRadius?(u=updateTransformCartesian3Scratch2,Cartesian3.normalize(l,u),Cartesian3.negate(u,u),d=Cartesian3.clone(Cartesian3.UNIT_Z,updateTransformCartesian3Scratch3),c=Cartesian3.cross(d,u,updateTransformCartesian3Scratch1),Cartesian3.magnitude(c)>CesiumMath.EPSILON7&&(Cartesian3.normalize(u,u),Cartesian3.normalize(c,c),d=Cartesian3.cross(u,c,updateTransformCartesian3Scratch3),Cartesian3.normalize(d,d),m=!0)):Cartesian3.equalsEpsilon(l,y,CesiumMath.EPSILON7)||(d=updateTransformCartesian3Scratch2,Cartesian3.normalize(x,d),Cartesian3.normalize(b,b),c=Cartesian3.cross(d,b,updateTransformCartesian3Scratch3),g&&(c=Cartesian3.multiplyByScalar(c,-1,c)),Cartesian3.equalsEpsilon(c,Cartesian3.ZERO,CesiumMath.EPSILON7)||(u=Cartesian3.cross(c,d,updateTransformCartesian3Scratch1),Matrix3.multiplyByVector(v,u,u),Matrix3.multiplyByVector(v,c,c),Matrix3.multiplyByVector(v,d,d),Cartesian3.normalize(u,u),Cartesian3.normalize(c,c),Cartesian3.normalize(d,d),m=!0))}}defined(e.boundingSphere)&&(l=e.boundingSphere.center),r&&(h=Cartesian3.clone(t.position,updateTransformCartesian3Scratch4),p=Cartesian3.clone(t.direction,updateTransformCartesian3Scratch5),f=Cartesian3.clone(t.up,updateTransformCartesian3Scratch6));var E=updateTransformMatrix4Scratch;m?(E[0]=u.x,E[1]=u.y,E[2]=u.z,E[3]=0,E[4]=c.x,E[5]=c.y,E[6]=c.z,E[7]=0,E[8]=d.x,E[9]=d.y,E[10]=d.z,E[11]=0,E[12]=l.x,E[13]=l.y,E[14]=l.z,E[15]=0):Transforms.eastNorthUpToFixedFrame(l,o,E),t._setTransform(E),r&&(Cartesian3.clone(h,t.position),Cartesian3.clone(p,t.direction),Cartesian3.clone(f,t.up),Cartesian3.cross(p,f,t.right))}if(i){var T=s===SceneMode$1.SCENE2D||Cartesian3.equals(e._offset3D,Cartesian3.ZERO)?void 0:e._offset3D;t.lookAtTransform(t.transform,T)}}function EntityView(e,t,i){this.entity=e,this.scene=t,this.ellipsoid=defaultValue(i,Ellipsoid.WGS84),this.boundingSphere=void 0,this._lastEntity=void 0,this._mode=void 0,this._lastCartesian=new Cartesian3,this._defaultOffset3D=void 0,this._offset3D=new Cartesian3}Object.defineProperties(EntityView,{defaultOffset3D:{get:function(){return this._defaultOffset3D},set:function(e){this._defaultOffset3D=Cartesian3.clone(e,new Cartesian3)}}}),EntityView.defaultOffset3D=new Cartesian3(-14e3,3500,3500);var scratchHeadingPitchRange=new HeadingPitchRange,scratchCartesian$9=new Cartesian3;EntityView.prototype.update=function(e,t){var i=this.scene,r=this.ellipsoid,n=i.mode;if(n!==SceneMode$1.MORPHING){var a=this.entity,o=a.position;if(defined(o)){var s=a!==this._lastEntity,l=n!==this._mode,u=i.camera,c=s||l,d=!0;if(s){var h=a.viewFrom,p=defined(h);if(!p&&defined(t)){scratchHeadingPitchRange.pitch=-CesiumMath.PI_OVER_FOUR,scratchHeadingPitchRange.range=0;var f=o.getValue(e,scratchCartesian$9);if(defined(f)){var m=2-1/Math.max(1,Cartesian3.magnitude(f)/r.maximumRadius);scratchHeadingPitchRange.pitch*=m}u.viewBoundingSphere(t,scratchHeadingPitchRange),this.boundingSphere=t,d=c=!1}else p&&defined(h.getValue(e,this._offset3D))||Cartesian3.clone(EntityView._defaultOffset3D,this._offset3D)}else l||this._mode===SceneMode$1.SCENE2D||Cartesian3.clone(u.position,this._offset3D);this._lastEntity=a,this._mode=n,updateTransform(this,u,c,d,o,e,r)}}};var BILLBOARD_SIZE$1=32,kmlNamespace="http://www.opengis.net/kml/2.2",gxNamespace="http://www.google.com/kml/ext/2.2",xmlnsNamespace="http://www.w3.org/2000/xmlns/";function ExternalFileHandler(e){this._files={},this._promises=[],this._count=0,this._modelCallback=e}var imageTypeRegex=/^data:image\/([^,;]+)/;function getModelBlobHander(t,i){return function(e){t._files[i]=e}}function ValueGetter(e){this._time=e}function StyleCache(){this._ids={},this._styles={},this._count=0}function IdManager(){this._ids={}}function exportKml(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).entities,i=defaultValue(e.kmz,!1),r=exportKml._createState(e),n=t.values.filter(function(e){return!defined(e.parent)}),a=r.kmlDoc,o=a.documentElement;o.setAttributeNS(xmlnsNamespace,"xmlns:gx",gxNamespace);var s=a.createElement("Document");o.appendChild(s),recurseEntities(r,s,n),r.styleCache.save(s);var l=r.externalFileHandler;return l.promise.then(function(){var e=(new XMLSerializer).serializeToString(r.kmlDoc);return i?createKmz(e,l.files):{kml:e,externalFiles:l.files}})}function createKmz(e,i){var r=when.defer();return zip.createWriter(new zip.BlobWriter,function(t){addKmlToZip(t,e).then(function(){var e=Object.keys(i);return addExternalFilesToZip(t,e,i,0)}).then(function(){t.close(function(e){r.resolve({kmz:e})})})}),r.promise}function addKmlToZip(e,t){var i=when.defer();return e.add("doc.kml",new zip.TextReader(t),function(){i.resolve()}),i.promise}function addExternalFilesToZip(e,t,i,r){if(t.length!==r){var n=t[r],a=when.defer();return e.add(n,new zip.BlobReader(i[n]),function(){a.resolve()}),a.promise.then(function(){return addExternalFilesToZip(e,t,i,r+1)})}}function recurseEntities(e,t,i){for(var r,n,a,o=e.kmlDoc,s=e.styleCache,l=e.valueGetter,u=e.idManager,c=i.length,d=0;d<c;++d){var h,p=i[d];r=[],createPoint$1(e,p,n=[],a=[]),createLineString$1(e,p.polyline,n,a),createPolygon$1(e,p.rectangle,n,a,r),createPolygon$1(e,p.polygon,n,a,r),createModel$1(e,p,p.model,n,a);var f=p.availability;defined(f)&&(h=o.createElement("TimeSpan"),JulianDate.equals(f.start,Iso8601.MINIMUM_VALUE)||h.appendChild(createBasicElementWithText(o,"begin",JulianDate.toIso8601(f.start))),JulianDate.equals(f.stop,Iso8601.MAXIMUM_VALUE)||h.appendChild(createBasicElementWithText(o,"end",JulianDate.toIso8601(f.stop))));for(var m=0;m<r.length;++m){var g=r[m];g.setAttribute("id",u.get(p.id)),g.appendChild(createBasicElementWithText(o,"name",p.name)),g.appendChild(createBasicElementWithText(o,"visibility",p.show)),g.appendChild(createBasicElementWithText(o,"description",p.description)),defined(h)&&g.appendChild(h),t.appendChild(g)}var y=n.length;if(0<y){var v=o.createElement("Placemark");v.setAttribute("id",u.get(p.id));var _=p.name,C=p.label;if(defined(C)){var x=o.createElement("LabelStyle"),b=l.get(C.text);_=defined(b)&&0<b.length?b:_;var A=l.getColor(C.fillColor);defined(A)&&(x.appendChild(createBasicElementWithText(o,"color",A)),x.appendChild(createBasicElementWithText(o,"colorMode","normal")));var S=l.get(C.scale);defined(S)&&x.appendChild(createBasicElementWithText(o,"scale",S)),a.push(x)}v.appendChild(createBasicElementWithText(o,"name",_)),v.appendChild(createBasicElementWithText(o,"visibility",p.show)),v.appendChild(createBasicElementWithText(o,"description",p.description)),defined(h)&&v.appendChild(h),t.appendChild(v);var w=a.length;if(0<w){for(var E=o.createElement("Style"),T=0;T<w;++T)E.appendChild(a[T]);v.appendChild(createBasicElementWithText(o,"styleUrl",s.get(E)))}if(1===n.length)v.appendChild(n[0]);else if(1<n.length){for(var P=o.createElement("MultiGeometry"),M=0;M<y;++M)P.appendChild(n[M]);v.appendChild(P)}}var D=p._children;if(0<D.length){var I=o.createElement("Folder");I.setAttribute("id",u.get(p.id)),I.appendChild(createBasicElementWithText(o,"name",p.name)),I.appendChild(createBasicElementWithText(o,"visibility",p.show)),I.appendChild(createBasicElementWithText(o,"description",p.description)),t.appendChild(I),recurseEntities(e,I,D)}}}ExternalFileHandler.prototype.texture=function(e){var t,i=this;if("string"==typeof e||e instanceof Resource){if(!(e=Resource.createIfNeeded(e)).isDataUri)return e.url;var r=e.url.match(imageTypeRegex);t="texture_"+ ++this._count,defined(r)&&(t+="."+r[1]);var n=e.fetchBlob().then(function(e){i._files[t]=e});return this._promises.push(n),t}if(e instanceof HTMLCanvasElement){var a=when.defer();return this._promises.push(a.promise),t="texture_"+ ++this._count+".png",e.toBlob(function(e){i._files[t]=e,a.resolve()}),t}return""},ExternalFileHandler.prototype.model=function(e,t){var i=this._modelCallback;if(!defined(i))throw new RuntimeError("Encountered a model entity while exporting to KML, but no model callback was supplied.");var r={},n=i(e,t,r);for(var a in r)if(r.hasOwnProperty(a)){var o=when(r[a]);this._promises.push(o),o.then(getModelBlobHander(this,a))}return n},Object.defineProperties(ExternalFileHandler.prototype,{promise:{get:function(){return when.all(this._promises)}},files:{get:function(){return this._files}}}),ValueGetter.prototype.get=function(e,t,i){var r;return defined(e)&&(r=defined(e.getValue)?e.getValue(this._time,i):e),defaultValue(r,t)},ValueGetter.prototype.getColor=function(e,t){var i=this.get(e,t);if(defined(i))return colorToString(i)},ValueGetter.prototype.getMaterialType=function(e){if(defined(e))return e.getType(this._time)},StyleCache.prototype.get=function(e){var t=this._ids,i=e.innerHTML;if(defined(t[i]))return t[i];var r="style-"+ ++this._count;return e.setAttribute("id",r),r="#"+r,t[i]=r,this._styles[i]=e,r},StyleCache.prototype.save=function(e){var t=this._styles,i=e.childNodes[0];for(var r in t)t.hasOwnProperty(r)&&e.insertBefore(t[r],i)},IdManager.prototype.get=function(e){if(!defined(e))return this.get(createGuid());var t=this._ids;return defined(t[e])?e.toString()+"-"+ ++t[e]:(t[e]=0,e)},exportKml._createState=function(e){var t=e.entities,i=new StyleCache,r=t.computeAvailability(),n=defined(e.time)?e.time:r.start,a=defaultValue(e.defaultAvailability,r),o=defaultValue(e.sampleDuration,60);a.start===Iso8601.MINIMUM_VALUE?a.stop===Iso8601.MAXIMUM_VALUE?a=new TimeInterval:JulianDate.addSeconds(a.stop,-10*o,a.start):a.stop===Iso8601.MAXIMUM_VALUE&&JulianDate.addSeconds(a.start,10*o,a.stop);var s=new ExternalFileHandler(e.modelCallback);return{kmlDoc:document.implementation.createDocument(kmlNamespace,"kml"),ellipsoid:defaultValue(e.ellipsoid,Ellipsoid.WGS84),idManager:new IdManager,styleCache:i,externalFileHandler:s,time:n,valueGetter:new ValueGetter(n),sampleDuration:o,defaultAvailability:new TimeIntervalCollection([a])}};var scratchCartesian3$d=new Cartesian3,scratchCartographic$e=new Cartographic,scratchJulianDate$2=new JulianDate;function createPoint$1(e,t,i,r){var n=e.kmlDoc,a=e.ellipsoid,o=e.valueGetter,s=defaultValue(t.billboard,t.point);if(defined(s)||defined(t.path)){var l=t.position;if(l.isConstant){o.get(l,void 0,scratchCartesian3$d);var u=createBasicElementWithText(n,"coordinates",getCoordinates(scratchCartesian3$d,a)),c=n.createElement("Point"),d=n.createElement("altitudeMode");d.appendChild(getAltitudeMode(e,s.heightReference)),c.appendChild(d),c.appendChild(u),i.push(c);var h=s instanceof BillboardGraphics?createIconStyleFromBillboard(e,s):createIconStyleFromPoint(e,s);r.push(h)}else createTracks(e,t,s,i,r)}}function createTracks(e,t,i,r,n){var a,o=e.kmlDoc,s=e.ellipsoid,l=e.valueGetter,u=t.position,c=!0;u instanceof CompositePositionProperty?(a=u.intervals,c=!1):a=defaultValue(t.availability,e.defaultAvailability);var d,h,p,f=i instanceof ModelGraphics,m=[];for(d=0;d<a.length;++d){var g=a.get(d),y=c?u:g.data,v=o.createElement("altitudeMode");y instanceof ScaledPositionProperty?(y=y._value,v.appendChild(getAltitudeMode(e,HeightReference$1.CLAMP_TO_GROUND))):defined(i)?v.appendChild(getAltitudeMode(e,i.heightReference)):v.appendChild(getAltitudeMode(e,HeightReference$1.NONE));var _=[],C=[];if(y.isConstant){l.get(y,void 0,scratchCartesian3$d);var x=createBasicElementWithText(o,"coordinates",getCoordinates(scratchCartesian3$d,s));_.push(JulianDate.toIso8601(g.start)),C.push(x),_.push(JulianDate.toIso8601(g.stop)),C.push(x)}else if(y instanceof SampledPositionProperty)for(p=y._property._times,h=0;h<p.length;++h)_.push(JulianDate.toIso8601(p[h])),y.getValueInReferenceFrame(p[h],ReferenceFrame$1.FIXED,scratchCartesian3$d),C.push(getCoordinates(scratchCartesian3$d,s));else if(y instanceof SampledProperty){p=y._times;var b=y._values;for(h=0;h<p.length;++h)_.push(JulianDate.toIso8601(p[h])),Cartesian3.fromArray(b,3*h,scratchCartesian3$d),C.push(getCoordinates(scratchCartesian3$d,s))}else{var A=e.sampleDuration;g.start.clone(scratchJulianDate$2),g.isStartIncluded||JulianDate.addSeconds(scratchJulianDate$2,A,scratchJulianDate$2);for(var S=g.stop;JulianDate.lessThan(scratchJulianDate$2,S);)y.getValue(scratchJulianDate$2,scratchCartesian3$d),_.push(JulianDate.toIso8601(scratchJulianDate$2)),C.push(getCoordinates(scratchCartesian3$d,s)),JulianDate.addSeconds(scratchJulianDate$2,A,scratchJulianDate$2);g.isStopIncluded&&JulianDate.equals(scratchJulianDate$2,S)&&(y.getValue(scratchJulianDate$2,scratchCartesian3$d),_.push(JulianDate.toIso8601(scratchJulianDate$2)),C.push(getCoordinates(scratchCartesian3$d,s)))}var w=o.createElementNS(gxNamespace,"Track");w.appendChild(v);for(var E=0;E<_.length;++E){var T=createBasicElementWithText(o,"when",_[E]),P=createBasicElementWithText(o,"coord",C[E],gxNamespace);w.appendChild(T),w.appendChild(P)}f&&w.appendChild(createModelGeometry(e,i)),m.push(w)}if(1===m.length)r.push(m[0]);else if(1<m.length){var M=o.createElementNS(gxNamespace,"MultiTrack");for(d=0;d<m.length;++d)M.appendChild(m[d]);r.push(M)}if(defined(i)&&!f){var D=i instanceof BillboardGraphics?createIconStyleFromBillboard(e,i):createIconStyleFromPoint(e,i);n.push(D)}var I=t.path;if(defined(I)){var O=l.get(I.width),R=I.material;if(defined(R)||defined(O)){var L=o.createElement("LineStyle");defined(O)&&L.appendChild(createBasicElementWithText(o,"width",O)),processMaterial(e,R,L),n.push(L)}}}function createIconStyleFromPoint(e,t){var i=e.kmlDoc,r=e.valueGetter,n=i.createElement("IconStyle"),a=r.getColor(t.color);defined(a)&&(n.appendChild(createBasicElementWithText(i,"color",a)),n.appendChild(createBasicElementWithText(i,"colorMode","normal")));var o=r.get(t.pixelSize);return defined(o)&&n.appendChild(createBasicElementWithText(i,"scale",o/BILLBOARD_SIZE$1)),n}function createIconStyleFromBillboard(e,t){var i=e.kmlDoc,r=e.valueGetter,n=e.externalFileHandler,a=i.createElement("IconStyle"),o=r.get(t.image);if(defined(o)){o=n.texture(o);var s=i.createElement("Icon");s.appendChild(createBasicElementWithText(i,"href",o));var l=r.get(t.imageSubRegion);defined(l)&&(s.appendChild(createBasicElementWithText(i,"x",l.x,gxNamespace)),s.appendChild(createBasicElementWithText(i,"y",l.y,gxNamespace)),s.appendChild(createBasicElementWithText(i,"w",l.width,gxNamespace)),s.appendChild(createBasicElementWithText(i,"h",l.height,gxNamespace))),a.appendChild(s)}var u=r.getColor(t.color);defined(u)&&(a.appendChild(createBasicElementWithText(i,"color",u)),a.appendChild(createBasicElementWithText(i,"colorMode","normal")));var c=r.get(t.scale);defined(c)&&a.appendChild(createBasicElementWithText(i,"scale",c));var d=r.get(t.pixelOffset);if(defined(d)){c=defaultValue(c,1),Cartesian2.divideByScalar(d,c,d);var h=r.get(t.width,BILLBOARD_SIZE$1),p=r.get(t.height,BILLBOARD_SIZE$1),f=r.get(t.horizontalOrigin,HorizontalOrigin$1.CENTER);f===HorizontalOrigin$1.CENTER?d.x-=.5*h:f===HorizontalOrigin$1.RIGHT&&(d.x-=h);var m=r.get(t.verticalOrigin,VerticalOrigin$1.CENTER);m===VerticalOrigin$1.TOP?d.y+=p:m===VerticalOrigin$1.CENTER&&(d.y+=.5*p);var g=i.createElement("hotSpot");g.setAttribute("x",-d.x),g.setAttribute("y",d.y),g.setAttribute("xunits","pixels"),g.setAttribute("yunits","pixels"),a.appendChild(g)}var y=r.get(t.rotation),v=r.get(t.alignedAxis);return defined(y)&&Cartesian3.equals(Cartesian3.UNIT_Z,v)&&(0===(y=CesiumMath.toDegrees(-y))&&(y=360),a.appendChild(createBasicElementWithText(i,"heading",y))),a}function createLineString$1(e,t,i,r){var n=e.kmlDoc,a=e.ellipsoid,o=e.valueGetter;if(defined(t)){var s,l=n.createElement("LineString"),u=n.createElement("altitudeMode"),c=o.get(t.clampToGround,!1);s=c?(l.appendChild(createBasicElementWithText(n,"tessellate",!0)),n.createTextNode("clampToGround")):n.createTextNode("absolute"),u.appendChild(s),l.appendChild(u);var d=t.positions,h=createBasicElementWithText(n,"coordinates",getCoordinates(o.get(d),a));l.appendChild(h);var p=o.get(t.zIndex);c&&defined(p)&&l.appendChild(createBasicElementWithText(n,"drawOrder",p,gxNamespace)),i.push(l);var f=n.createElement("LineStyle"),m=o.get(t.width);defined(m)&&f.appendChild(createBasicElementWithText(n,"width",m)),processMaterial(e,t.material,f),r.push(f)}}function getRectangleBoundaries(e,t,i){var r,n=e.kmlDoc,a=e.valueGetter,o=a.get(t.height,0);0<i&&(o=i);for(var s=t.coordinates,l=a.get(s),u=[],c=[Rectangle.northeast,Rectangle.southeast,Rectangle.southwest,Rectangle.northwest],d=0;d<4;++d)c[d](l,scratchCartographic$e),u.push(CesiumMath.toDegrees(scratchCartographic$e.longitude)+","+CesiumMath.toDegrees(scratchCartographic$e.latitude)+","+o);r=createBasicElementWithText(n,"coordinates",u.join(" "));var h=n.createElement("outerBoundaryIs"),p=n.createElement("LinearRing");return p.appendChild(r),h.appendChild(p),[h]}function getLinearRing(e,t,i,r){for(var n=e.kmlDoc,a=e.ellipsoid,o=[],s=t.length,l=0;l<s;++l)Cartographic.fromCartesian(t[l],a,scratchCartographic$e),o.push(CesiumMath.toDegrees(scratchCartographic$e.longitude)+","+CesiumMath.toDegrees(scratchCartographic$e.latitude)+","+(r?scratchCartographic$e.height:i));var u=createBasicElementWithText(n,"coordinates",o.join(" ")),c=n.createElement("LinearRing");return c.appendChild(u),c}function getPolygonBoundaries(e,t,i){var r=e.kmlDoc,n=e.valueGetter,a=n.get(t.height,0),o=n.get(t.perPositionHeight,!1);!o&&0<i&&(a=i);var s=[],l=t.hierarchy,u=n.get(l),c=Array.isArray(u)?u:u.positions,d=r.createElement("outerBoundaryIs");d.appendChild(getLinearRing(e,c,a,o)),s.push(d);var h=u.holes;if(defined(h))for(var p=h.length,f=0;f<p;++f){var m=r.createElement("innerBoundaryIs");m.appendChild(getLinearRing(e,h[f].positions,a,o)),s.push(m)}return s}function createPolygon$1(e,t,i,r,n){var a=e.kmlDoc,o=e.valueGetter;if(defined(t)){var s=t instanceof RectangleGraphics;if(s&&"Image"===o.getMaterialType(t.material))createGroundOverlay(e,t,n);else{var l=a.createElement("Polygon"),u=o.get(t.extrudedHeight,0);0<u&&l.appendChild(createBasicElementWithText(a,"extrude",!0));for(var c=s?getRectangleBoundaries(e,t,u):getPolygonBoundaries(e,t,u),d=c.length,h=0;h<d;++h)l.appendChild(c[h]);var p=a.createElement("altitudeMode");p.appendChild(getAltitudeMode(e,t.heightReference)),l.appendChild(p),i.push(l);var f=a.createElement("PolyStyle"),m=o.get(t.fill,!1);m&&f.appendChild(createBasicElementWithText(a,"fill",m)),processMaterial(e,t.material,f);var g=o.get(t.outline,!1);if(g){f.appendChild(createBasicElementWithText(a,"outline",g));var y=a.createElement("LineStyle"),v=o.get(t.outlineWidth,1);y.appendChild(createBasicElementWithText(a,"width",v));var _=o.getColor(t.outlineColor,Color.BLACK);y.appendChild(createBasicElementWithText(a,"color",_)),y.appendChild(createBasicElementWithText(a,"colorMode","normal")),r.push(y)}r.push(f)}}}function createGroundOverlay(e,t,i){var r=e.kmlDoc,n=e.valueGetter,a=e.externalFileHandler,o=r.createElement("GroundOverlay"),s=r.createElement("altitudeMode");s.appendChild(getAltitudeMode(e,t.heightReference)),o.appendChild(s);var l=n.get(t.height);defined(l)&&o.appendChild(createBasicElementWithText(r,"altitude",l));var u=n.get(t.coordinates),c=r.createElement("LatLonBox");c.appendChild(createBasicElementWithText(r,"north",CesiumMath.toDegrees(u.north))),c.appendChild(createBasicElementWithText(r,"south",CesiumMath.toDegrees(u.south))),c.appendChild(createBasicElementWithText(r,"east",CesiumMath.toDegrees(u.east))),c.appendChild(createBasicElementWithText(r,"west",CesiumMath.toDegrees(u.west))),o.appendChild(c);var d=n.get(t.material),h=a.texture(d.image),p=r.createElement("Icon");p.appendChild(createBasicElementWithText(r,"href",h)),o.appendChild(p),defined(d.color)&&o.appendChild(createBasicElementWithText(r,"color",colorToString(d.color))),i.push(o)}function createModelGeometry(e,t){var i=e.kmlDoc,r=e.valueGetter,n=e.externalFileHandler,a=i.createElement("Model"),o=r.get(t.scale);if(defined(o)){var s=i.createElement("scale");s.appendChild(createBasicElementWithText(i,"x",o)),s.appendChild(createBasicElementWithText(i,"y",o)),s.appendChild(createBasicElementWithText(i,"z",o)),a.appendChild(s)}var l=i.createElement("Link"),u=n.model(t,e.time);return l.appendChild(createBasicElementWithText(i,"href",u)),a.appendChild(l),a}function createModel$1(e,t,i,r,n){var a=e.kmlDoc,o=e.ellipsoid,s=e.valueGetter;if(defined(i)){var l=t.position;if(l.isConstant){var u=createModelGeometry(e,i),c=a.createElement("altitudeMode");c.appendChild(getAltitudeMode(e,i.heightReference)),u.appendChild(c),s.get(l,void 0,scratchCartesian3$d),Cartographic.fromCartesian(scratchCartesian3$d,o,scratchCartographic$e);var d=a.createElement("Location");d.appendChild(createBasicElementWithText(a,"longitude",CesiumMath.toDegrees(scratchCartographic$e.longitude))),d.appendChild(createBasicElementWithText(a,"latitude",CesiumMath.toDegrees(scratchCartographic$e.latitude))),d.appendChild(createBasicElementWithText(a,"altitude",scratchCartographic$e.height)),u.appendChild(d),r.push(u)}else createTracks(e,t,i,r,n)}}function processMaterial(e,t,i){var r=e.kmlDoc,n=e.valueGetter;if(defined(t)){var a=n.get(t);if(defined(a)){var o;switch(n.getMaterialType(t)){case"Image":o=colorToString(Color.WHITE);break;case"Color":case"Grid":case"PolylineGlow":case"PolylineArrow":case"PolylineDash":o=colorToString(a.color);break;case"PolylineOutline":o=colorToString(a.color);var s=colorToString(a.outlineColor),l=a.outlineWidth;i.appendChild(createBasicElementWithText(r,"outerColor",s,gxNamespace)),i.appendChild(createBasicElementWithText(r,"outerWidth",l,gxNamespace));break;case"Stripe":o=colorToString(a.oddColor)}defined(o)&&(i.appendChild(createBasicElementWithText(r,"color",o)),i.appendChild(createBasicElementWithText(r,"colorMode","normal")))}}}function getAltitudeMode(e,t){var i,r=e.kmlDoc;switch(e.valueGetter.get(t,HeightReference$1.NONE)){case HeightReference$1.NONE:i=r.createTextNode("absolute");break;case HeightReference$1.CLAMP_TO_GROUND:i=r.createTextNode("clampToGround");break;case HeightReference$1.RELATIVE_TO_GROUND:i=r.createTextNode("relativeToGround")}return i}function getCoordinates(e,t){Array.isArray(e)||(e=[e]);for(var i=e.length,r=[],n=0;n<i;++n)Cartographic.fromCartesian(e[n],t,scratchCartographic$e),r.push(CesiumMath.toDegrees(scratchCartographic$e.longitude)+","+CesiumMath.toDegrees(scratchCartographic$e.latitude)+","+scratchCartographic$e.height);return r.join(" ")}function createBasicElementWithText(e,t,i,r){"boolean"==typeof(i=defaultValue(i,""))&&(i=i?"1":"0");var n=defined(r)?e.createElementNS(r,t):e.createElement(t),a="string"===i&&-1!==i.indexOf("<")?e.createCDATASection(i):e.createTextNode(i);return n.appendChild(a),n}function colorToString(e){for(var t="",i=e.toBytes(),r=3;0<=r;--r)t+=i[r]<16?"0"+i[r].toString(16):i[r].toString(16);return t}function Visualizer(){DeveloperError.throwInstantiationError()}Visualizer.prototype.update=DeveloperError.throwInstantiationError,Visualizer.prototype.getBoundingSphere=DeveloperError.throwInstantiationError,Visualizer.prototype.isDestroyed=DeveloperError.throwInstantiationError,Visualizer.prototype.destroy=DeveloperError.throwInstantiationError;var CheckFloatTexturePrecisionFS="uniform sampler2D u_floatTexture;\nvoid main()\n{\nfloat actual = texture2D(u_floatTexture, vec2(0.5, 0.5)).r;\nfloat expected = 123456.0;\ngl_FragColor = vec4(abs(actual - expected), 0.0, 0.0, 1.0);\n}\n",ViewportQuadVS="attribute vec4 position;\nattribute vec2 textureCoordinates;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\ngl_Position = position;\nv_textureCoordinates = textureCoordinates;\n}\n",renderStateScratch;function ComputeEngine(e){this._context=e}var drawCommandScratch=new DrawCommand({primitiveType:PrimitiveType$1.TRIANGLES}),clearCommandScratch=new ClearCommand({color:new Color(0,0,0,0)});function createFramebuffer$5(e,t){return new Framebuffer({context:e,colorTextures:[t],destroyAttachments:!1})}function createViewportQuadShader(e,t){return ShaderProgram.fromCache({context:e,vertexShaderSource:ViewportQuadVS,fragmentShaderSource:t,attributeLocations:{position:0,textureCoordinates:1}})}function createRenderState$4(e,t){return defined(renderStateScratch)&&renderStateScratch.viewport.width===e&&renderStateScratch.viewport.height===t||(renderStateScratch=RenderState.fromCache({viewport:new BoundingRectangle(0,0,e,t)})),renderStateScratch}function checkFloatTexturePrecision(t){if(!t.floatingPointTexture)return!1;var e=new ComputeEngine(t),i=new Texture({context:t,width:1,height:1,pixelFormat:PixelFormat$1.RGBA}),r=new Texture({context:t,width:1,height:1,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:checkFloatTexturePrecision._getFloatPixelType(),source:{width:1,height:1,arrayBufferView:checkFloatTexturePrecision._getArray([123456,0,0,0])}}),n=new Framebuffer({context:t,colorTextures:[i],destroyAttachments:!1}),a={framebuffer:n,x:0,y:0,width:1,height:1},o=!1;return new ComputeCommand({fragmentShaderSource:CheckFloatTexturePrecisionFS,outputTexture:i,uniformMap:{u_floatTexture:function(){return r}},persists:!1,postExecute:function(){var e=t.readPixels(a);o=0===e[0]}}).execute(e),e.destroy(),n.destroy(),o}function ShaderCache(e){this._context=e,this._shaders={},this._numberOfShaders=0,this._shadersToRelease={}}function destroyShader(e,t){for(var i=t.derivedKeywords,r=i.length,n=0;n<r;++n){var a=i[n]+t.keyword;destroyShader(e,e._shaders[a])}delete e._shaders[t.keyword],t.shaderProgram.finalDestroy()}function TextureCache(){this._textures={},this._numberOfTextures=0,this._texturesToRelease={}}function SunLight(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this.color=defined(e.color)?Color.clone(e.color):Color.WHITE,this.intensity=defaultValue(e.intensity,2)}function UniformState(){this.globeDepthTexture=void 0,this.gamma=void 0,this._viewport=new BoundingRectangle,this._viewportCartesian4=new Cartesian4,this._viewportDirty=!1,this._viewportOrthographicMatrix=Matrix4.clone(Matrix4.IDENTITY),this._viewportTransformation=Matrix4.clone(Matrix4.IDENTITY),this._model=Matrix4.clone(Matrix4.IDENTITY),this._view=Matrix4.clone(Matrix4.IDENTITY),this._inverseView=Matrix4.clone(Matrix4.IDENTITY),this._projection=Matrix4.clone(Matrix4.IDENTITY),this._infiniteProjection=Matrix4.clone(Matrix4.IDENTITY),this._entireFrustum=new Cartesian2,this._currentFrustum=new Cartesian2,this._frustumPlanes=new Cartesian4,this._farDepthFromNearPlusOne=void 0,this._log2FarDepthFromNearPlusOne=void 0,this._oneOverLog2FarDepthFromNearPlusOne=void 0,this._frameState=void 0,this._temeToPseudoFixed=Matrix3.clone(Matrix4.IDENTITY),this._view3DDirty=!0,this._view3D=new Matrix4,this._inverseView3DDirty=!0,this._inverseView3D=new Matrix4,this._inverseModelDirty=!0,this._inverseModel=new Matrix4,this._inverseTransposeModelDirty=!0,this._inverseTransposeModel=new Matrix3,this._viewRotation=new Matrix3,this._inverseViewRotation=new Matrix3,this._viewRotation3D=new Matrix3,this._inverseViewRotation3D=new Matrix3,this._inverseProjectionDirty=!0,this._inverseProjection=new Matrix4,this._modelViewDirty=!0,this._modelView=new Matrix4,this._modelView3DDirty=!0,this._modelView3D=new Matrix4,this._modelViewRelativeToEyeDirty=!0,this._modelViewRelativeToEye=new Matrix4,this._inverseModelViewDirty=!0,this._inverseModelView=new Matrix4,this._inverseModelView3DDirty=!0,this._inverseModelView3D=new Matrix4,this._viewProjectionDirty=!0,this._viewProjection=new Matrix4,this._inverseViewProjectionDirty=!0,this._inverseViewProjection=new Matrix4,this._modelViewProjectionDirty=!0,this._modelViewProjection=new Matrix4,this._inverseModelViewProjectionDirty=!0,this._inverseModelViewProjection=new Matrix4,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewProjectionRelativeToEye=new Matrix4,this._modelViewInfiniteProjectionDirty=!0,this._modelViewInfiniteProjection=new Matrix4,this._normalDirty=!0,this._normal=new Matrix3,this._normal3DDirty=!0,this._normal3D=new Matrix3,this._inverseNormalDirty=!0,this._inverseNormal=new Matrix3,this._inverseNormal3DDirty=!0,this._inverseNormal3D=new Matrix3,this._encodedCameraPositionMCDirty=!0,this._encodedCameraPositionMC=new EncodedCartesian3,this._cameraPosition=new Cartesian3,this._sunPositionWC=new Cartesian3,this._sunPositionColumbusView=new Cartesian3,this._sunDirectionWC=new Cartesian3,this._sunDirectionEC=new Cartesian3,this._moonDirectionEC=new Cartesian3,this._lightDirectionWC=new Cartesian3,this._lightDirectionEC=new Cartesian3,this._lightColor=new Cartesian3,this._lightColorHdr=new Cartesian3,this._pass=void 0,this._mode=void 0,this._mapProjection=void 0,this._ellipsoid=void 0,this._cameraDirection=new Cartesian3,this._cameraRight=new Cartesian3,this._cameraUp=new Cartesian3,this._frustum2DWidth=0,this._eyeHeight2D=new Cartesian2,this._pixelRatio=1,this._orthographicIn3D=!1,this._backgroundColor=new Color,this._brdfLut=void 0,this._environmentMap=void 0,this._sphericalHarmonicCoefficients=void 0,this._specularEnvironmentMaps=void 0,this._specularEnvironmentMapsDimensions=new Cartesian2,this._specularEnvironmentMapsMaximumLOD=void 0,this._fogDensity=void 0,this._invertClassificationColor=void 0,this._imagerySplitPosition=0,this._pixelSizePerMeter=void 0,this._geometricToleranceOverMeter=void 0,this._minimumDisableDepthTestDistance=void 0}function setView(e,t){Matrix4.clone(t,e._view),Matrix4.getMatrix3(t,e._viewRotation),e._view3DDirty=!0,e._inverseView3DDirty=!0,e._modelViewDirty=!0,e._modelView3DDirty=!0,e._modelViewRelativeToEyeDirty=!0,e._inverseModelViewDirty=!0,e._inverseModelView3DDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0,e._modelViewInfiniteProjectionDirty=!0,e._normalDirty=!0,e._inverseNormalDirty=!0,e._normal3DDirty=!0,e._inverseNormal3DDirty=!0}function setInverseView(e,t){Matrix4.clone(t,e._inverseView),Matrix4.getMatrix3(t,e._inverseViewRotation)}function setProjection(e,t){Matrix4.clone(t,e._projection),e._inverseProjectionDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0}function setInfiniteProjection(e,t){Matrix4.clone(t,e._infiniteProjection),e._modelViewInfiniteProjectionDirty=!0}function setCamera(e,t){Cartesian3.clone(t.positionWC,e._cameraPosition),Cartesian3.clone(t.directionWC,e._cameraDirection),Cartesian3.clone(t.rightWC,e._cameraRight),Cartesian3.clone(t.upWC,e._cameraUp),e._encodedCameraPositionMCDirty=!0}ComputeEngine.prototype.execute=function(e){defined(e.preExecute)&&e.preExecute(e);var t=e.outputTexture,i=t.width,r=t.height,n=this._context,a=defined(e.vertexArray)?e.vertexArray:n.getViewportQuadVertexArray(),o=defined(e.shaderProgram)?e.shaderProgram:createViewportQuadShader(n,e.fragmentShaderSource),s=createFramebuffer$5(n,t),l=createRenderState$4(i,r),u=e.uniformMap,c=clearCommandScratch;c.framebuffer=s,c.renderState=l,c.execute(n);var d=drawCommandScratch;d.vertexArray=a,d.renderState=l,d.shaderProgram=o,d.uniformMap=u,d.framebuffer=s,d.execute(n),s.destroy(),e.persists||(o.destroy(),defined(e.vertexArray)&&a.destroy()),defined(e.postExecute)&&e.postExecute(t)},ComputeEngine.prototype.isDestroyed=function(){return!1},ComputeEngine.prototype.destroy=function(){return destroyObject(this)},checkFloatTexturePrecision._getFloatPixelType=function(){return PixelDatatype$1.FLOAT},checkFloatTexturePrecision._getArray=function(e){return new Float32Array(e)},Object.defineProperties(ShaderCache.prototype,{numberOfShaders:{get:function(){return this._numberOfShaders}}}),ShaderCache.prototype.replaceShaderProgram=function(e){return defined(e.shaderProgram)&&e.shaderProgram.destroy(),this.getShaderProgram(e)},ShaderCache.prototype.getShaderProgram=function(e){var t=e.vertexShaderSource,i=e.fragmentShaderSource,r=e.attributeLocations;"string"==typeof t&&(t=new ShaderSource({sources:[t]})),"string"==typeof i&&(i=new ShaderSource({sources:[i]}));var n,a=t.createCombinedVertexShader(this._context),o=i.createCombinedFragmentShader(this._context),s=a+o+JSON.stringify(r);if(defined(this._shaders[s]))n=this._shaders[s],delete this._shadersToRelease[s];else{var l=this._context,u=new ShaderProgram({gl:l._gl,logShaderCompilation:l.logShaderCompilation,debugShaders:l.debugShaders,vertexShaderSource:t,vertexShaderText:a,fragmentShaderSource:i,fragmentShaderText:o,attributeLocations:r});n={cache:this,shaderProgram:u,keyword:s,derivedKeywords:[],count:0},u._cachedShader=n,this._shaders[s]=n,++this._numberOfShaders}return++n.count,n.shaderProgram},ShaderCache.prototype.replaceDerivedShaderProgram=function(e,t,i){var r=e._cachedShader,n=t+r.keyword,a=this._shaders[n];if(defined(a)){destroyShader(this,a);var o=r.derivedKeywords.indexOf(t);-1<o&&r.derivedKeywords.splice(o,1)}return this.createDerivedShaderProgram(e,t,i)},ShaderCache.prototype.getDerivedShaderProgram=function(e,t){var i=t+e._cachedShader.keyword,r=this._shaders[i];if(defined(r))return r.shaderProgram},ShaderCache.prototype.createDerivedShaderProgram=function(e,t,i){var r=e._cachedShader,n=t+r.keyword,a=i.vertexShaderSource,o=i.fragmentShaderSource,s=i.attributeLocations;"string"==typeof a&&(a=new ShaderSource({sources:[a]})),"string"==typeof o&&(o=new ShaderSource({sources:[o]}));var l=this._context,u=a.createCombinedVertexShader(l),c=o.createCombinedFragmentShader(l),d=new ShaderProgram({gl:l._gl,logShaderCompilation:l.logShaderCompilation,debugShaders:l.debugShaders,vertexShaderSource:a,vertexShaderText:u,fragmentShaderSource:o,fragmentShaderText:c,attributeLocations:s}),h={cache:this,shaderProgram:d,keyword:n,derivedKeywords:[],count:0};return r.derivedKeywords.push(t),d._cachedShader=h,this._shaders[n]=h,d},ShaderCache.prototype.destroyReleasedShaderPrograms=function(){var e=this._shadersToRelease;for(var t in e){if(e.hasOwnProperty(t))destroyShader(this,e[t]),--this._numberOfShaders}this._shadersToRelease={}},ShaderCache.prototype.releaseShaderProgram=function(e){if(defined(e)){var t=e._cachedShader;t&&0==--t.count&&(this._shadersToRelease[t.keyword]=t)}},ShaderCache.prototype.isDestroyed=function(){return!1},ShaderCache.prototype.destroy=function(){var e=this._shaders;for(var t in e)e.hasOwnProperty(t)&&e[t].shaderProgram.finalDestroy();return destroyObject(this)},Object.defineProperties(TextureCache.prototype,{numberOfTextures:{get:function(){return this._numberOfTextures}}}),TextureCache.prototype.getTexture=function(e){var t=this._textures[e];if(defined(t))return delete this._texturesToRelease[e],++t.count,t.texture},TextureCache.prototype.addTexture=function(e,t){var i={texture:t,count:1};t.finalDestroy=t.destroy;var r=this;t.destroy=function(){0==--i.count&&(r._texturesToRelease[e]=i)},this._textures[e]=i,++this._numberOfTextures},TextureCache.prototype.destroyReleasedTextures=function(){var e=this._texturesToRelease;for(var t in e)if(e.hasOwnProperty(t)){var i=e[t];delete this._textures[t],i.texture.finalDestroy(),--this._numberOfTextures}this._texturesToRelease={}},TextureCache.prototype.isDestroyed=function(){return!1},TextureCache.prototype.destroy=function(){var e=this._textures;for(var t in e)e.hasOwnProperty(t)&&e[t].texture.finalDestroy();return destroyObject(this)},Object.defineProperties(UniformState.prototype,{frameState:{get:function(){return this._frameState}},viewport:{get:function(){return this._viewport},set:function(e){if(!BoundingRectangle.equals(e,this._viewport)){BoundingRectangle.clone(e,this._viewport);var t=this._viewport,i=this._viewportCartesian4;i.x=t.x,i.y=t.y,i.z=t.width,i.w=t.height,this._viewportDirty=!0}}},viewportCartesian4:{get:function(){return this._viewportCartesian4}},viewportOrthographic:{get:function(){return cleanViewport(this),this._viewportOrthographicMatrix}},viewportTransformation:{get:function(){return cleanViewport(this),this._viewportTransformation}},model:{get:function(){return this._model},set:function(e){Matrix4.clone(e,this._model),this._modelView3DDirty=!0,this._inverseModelView3DDirty=!0,this._inverseModelDirty=!0,this._inverseTransposeModelDirty=!0,this._modelViewDirty=!0,this._inverseModelViewDirty=!0,this._modelViewRelativeToEyeDirty=!0,this._inverseModelViewDirty=!0,this._modelViewProjectionDirty=!0,this._inverseModelViewProjectionDirty=!0,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewInfiniteProjectionDirty=!0,this._normalDirty=!0,this._inverseNormalDirty=!0,this._normal3DDirty=!0,this._inverseNormal3DDirty=!0,this._encodedCameraPositionMCDirty=!0}},inverseModel:{get:function(){return this._inverseModelDirty&&(this._inverseModelDirty=!1,Matrix4.inverse(this._model,this._inverseModel)),this._inverseModel}},inverseTransposeModel:{get:function(){var e=this._inverseTransposeModel;return this._inverseTransposeModelDirty&&(this._inverseTransposeModelDirty=!1,Matrix4.getMatrix3(this.inverseModel,e),Matrix3.transpose(e,e)),e}},view:{get:function(){return this._view}},view3D:{get:function(){return updateView3D(this),this._view3D}},viewRotation:{get:function(){return updateView3D(this),this._viewRotation}},viewRotation3D:{get:function(){return updateView3D(this),this._viewRotation3D}},inverseView:{get:function(){return this._inverseView}},inverseView3D:{get:function(){return updateInverseView3D(this),this._inverseView3D}},inverseViewRotation:{get:function(){return this._inverseViewRotation}},inverseViewRotation3D:{get:function(){return updateInverseView3D(this),this._inverseViewRotation3D}},projection:{get:function(){return this._projection}},inverseProjection:{get:function(){return cleanInverseProjection(this),this._inverseProjection}},infiniteProjection:{get:function(){return this._infiniteProjection}},modelView:{get:function(){return cleanModelView(this),this._modelView}},modelView3D:{get:function(){return cleanModelView3D(this),this._modelView3D}},modelViewRelativeToEye:{get:function(){return cleanModelViewRelativeToEye(this),this._modelViewRelativeToEye}},inverseModelView:{get:function(){return cleanInverseModelView(this),this._inverseModelView}},inverseModelView3D:{get:function(){return cleanInverseModelView3D(this),this._inverseModelView3D}},viewProjection:{get:function(){return cleanViewProjection(this),this._viewProjection}},inverseViewProjection:{get:function(){return cleanInverseViewProjection(this),this._inverseViewProjection}},modelViewProjection:{get:function(){return cleanModelViewProjection(this),this._modelViewProjection}},inverseModelViewProjection:{get:function(){return cleanInverseModelViewProjection(this),this._inverseModelViewProjection}},modelViewProjectionRelativeToEye:{get:function(){return cleanModelViewProjectionRelativeToEye(this),this._modelViewProjectionRelativeToEye}},modelViewInfiniteProjection:{get:function(){return cleanModelViewInfiniteProjection(this),this._modelViewInfiniteProjection}},normal:{get:function(){return cleanNormal(this),this._normal}},normal3D:{get:function(){return cleanNormal3D(this),this._normal3D}},inverseNormal:{get:function(){return cleanInverseNormal(this),this._inverseNormal}},inverseNormal3D:{get:function(){return cleanInverseNormal3D(this),this._inverseNormal3D}},entireFrustum:{get:function(){return this._entireFrustum}},currentFrustum:{get:function(){return this._currentFrustum}},frustumPlanes:{get:function(){return this._frustumPlanes}},farDepthFromNearPlusOne:{get:function(){return this._farDepthFromNearPlusOne}},log2FarDepthFromNearPlusOne:{get:function(){return this._log2FarDepthFromNearPlusOne}},oneOverLog2FarDepthFromNearPlusOne:{get:function(){return this._oneOverLog2FarDepthFromNearPlusOne}},eyeHeight2D:{get:function(){return this._eyeHeight2D}},sunPositionWC:{get:function(){return this._sunPositionWC}},sunPositionColumbusView:{get:function(){return this._sunPositionColumbusView}},sunDirectionWC:{get:function(){return this._sunDirectionWC}},sunDirectionEC:{get:function(){return this._sunDirectionEC}},moonDirectionEC:{get:function(){return this._moonDirectionEC}},lightDirectionWC:{get:function(){return this._lightDirectionWC}},lightDirectionEC:{get:function(){return this._lightDirectionEC}},lightColor:{get:function(){return this._lightColor}},lightColorHdr:{get:function(){return this._lightColorHdr}},encodedCameraPositionMCHigh:{get:function(){return cleanEncodedCameraPositionMC(this),this._encodedCameraPositionMC.high}},encodedCameraPositionMCLow:{get:function(){return cleanEncodedCameraPositionMC(this),this._encodedCameraPositionMC.low}},temeToPseudoFixedMatrix:{get:function(){return this._temeToPseudoFixed}},pixelRatio:{get:function(){return this._pixelRatio}},fogDensity:{get:function(){return this._fogDensity}},geometricToleranceOverMeter:{get:function(){return this._geometricToleranceOverMeter}},pass:{get:function(){return this._pass}},backgroundColor:{get:function(){return this._backgroundColor}},brdfLut:{get:function(){return this._brdfLut}},environmentMap:{get:function(){return this._environmentMap}},sphericalHarmonicCoefficients:{get:function(){return this._sphericalHarmonicCoefficients}},specularEnvironmentMaps:{get:function(){return this._specularEnvironmentMaps}},specularEnvironmentMapsDimensions:{get:function(){return this._specularEnvironmentMapsDimensions}},specularEnvironmentMapsMaximumLOD:{get:function(){return this._specularEnvironmentMapsMaximumLOD}},imagerySplitPosition:{get:function(){return this._imagerySplitPosition}},minimumDisableDepthTestDistance:{get:function(){return this._minimumDisableDepthTestDistance}},invertClassificationColor:{get:function(){return this._invertClassificationColor}},orthographicIn3D:{get:function(){return this._orthographicIn3D}},ellipsoid:{get:function(){return defaultValue(this._ellipsoid,Ellipsoid.WGS84)}}});var transformMatrix=new Matrix3,sunCartographicScratch=new Cartographic;function setSunAndMoonDirections(e,t){defined(Transforms.computeIcrfToFixedMatrix(t.time,transformMatrix))||(transformMatrix=Transforms.computeTemeToPseudoFixedMatrix(t.time,transformMatrix));var i=Simon1994PlanetaryPositions.computeSunPositionInEarthInertialFrame(t.time,e._sunPositionWC);Matrix3.multiplyByVector(transformMatrix,i,i),Cartesian3.normalize(i,e._sunDirectionWC),i=Matrix3.multiplyByVector(e.viewRotation3D,i,e._sunDirectionEC),Cartesian3.normalize(i,i),i=Simon1994PlanetaryPositions.computeMoonPositionInEarthInertialFrame(t.time,e._moonDirectionEC),Matrix3.multiplyByVector(transformMatrix,i,i),Matrix3.multiplyByVector(e.viewRotation3D,i,i),Cartesian3.normalize(i,i);var r=t.mapProjection,n=r.ellipsoid.cartesianToCartographic(e._sunPositionWC,sunCartographicScratch);r.project(n,e._sunPositionColumbusView)}UniformState.prototype.updateCamera=function(e){setView(this,e.viewMatrix),setInverseView(this,e.inverseViewMatrix),setCamera(this,e),this._entireFrustum.x=e.frustum.near,this._entireFrustum.y=e.frustum.far,this.updateFrustum(e.frustum),this._orthographicIn3D=this._mode!==SceneMode$1.SCENE2D&&e.frustum instanceof OrthographicFrustum},UniformState.prototype.updateFrustum=function(e){setProjection(this,e.projectionMatrix),defined(e.infiniteProjectionMatrix)&&setInfiniteProjection(this,e.infiniteProjectionMatrix),this._currentFrustum.x=e.near,this._currentFrustum.y=e.far,this._farDepthFromNearPlusOne=e.far-e.near+1,this._log2FarDepthFromNearPlusOne=CesiumMath.log2(this._farDepthFromNearPlusOne),this._oneOverLog2FarDepthFromNearPlusOne=1/this._log2FarDepthFromNearPlusOne,defined(e._offCenterFrustum)&&(e=e._offCenterFrustum),this._frustumPlanes.x=e.top,this._frustumPlanes.y=e.bottom,this._frustumPlanes.z=e.left,this._frustumPlanes.w=e.right},UniformState.prototype.updatePass=function(e){this._pass=e};var EMPTY_ARRAY=[],defaultLight=new SunLight;function cleanViewport(e){if(e._viewportDirty){var t=e._viewport;Matrix4.computeOrthographicOffCenter(t.x,t.x+t.width,t.y,t.y+t.height,0,1,e._viewportOrthographicMatrix),Matrix4.computeViewportTransformation(t,0,1,e._viewportTransformation),e._viewportDirty=!1}}function cleanInverseProjection(e){e._inverseProjectionDirty&&(e._inverseProjectionDirty=!1,e._mode===SceneMode$1.SCENE2D||e._mode===SceneMode$1.MORPHING||e._orthographicIn3D?Matrix4.clone(Matrix4.ZERO,e._inverseProjection):Matrix4.inverse(e._projection,e._inverseProjection))}function cleanModelView(e){e._modelViewDirty&&(e._modelViewDirty=!1,Matrix4.multiplyTransformation(e._view,e._model,e._modelView))}function cleanModelView3D(e){e._modelView3DDirty&&(e._modelView3DDirty=!1,Matrix4.multiplyTransformation(e.view3D,e._model,e._modelView3D))}function cleanInverseModelView(e){e._inverseModelViewDirty&&(e._inverseModelViewDirty=!1,Matrix4.inverse(e.modelView,e._inverseModelView))}function cleanInverseModelView3D(e){e._inverseModelView3DDirty&&(e._inverseModelView3DDirty=!1,Matrix4.inverse(e.modelView3D,e._inverseModelView3D))}function cleanViewProjection(e){e._viewProjectionDirty&&(e._viewProjectionDirty=!1,Matrix4.multiply(e._projection,e._view,e._viewProjection))}function cleanInverseViewProjection(e){e._inverseViewProjectionDirty&&(e._inverseViewProjectionDirty=!1,Matrix4.inverse(e.viewProjection,e._inverseViewProjection))}function cleanModelViewProjection(e){e._modelViewProjectionDirty&&(e._modelViewProjectionDirty=!1,Matrix4.multiply(e._projection,e.modelView,e._modelViewProjection))}function cleanModelViewRelativeToEye(e){if(e._modelViewRelativeToEyeDirty){e._modelViewRelativeToEyeDirty=!1;var t=e.modelView,i=e._modelViewRelativeToEye;i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[3],i[4]=t[4],i[5]=t[5],i[6]=t[6],i[7]=t[7],i[8]=t[8],i[9]=t[9],i[10]=t[10],i[11]=t[11],i[12]=0,i[13]=0,i[14]=0,i[15]=t[15]}}function cleanInverseModelViewProjection(e){e._inverseModelViewProjectionDirty&&(e._inverseModelViewProjectionDirty=!1,Matrix4.inverse(e.modelViewProjection,e._inverseModelViewProjection))}function cleanModelViewProjectionRelativeToEye(e){e._modelViewProjectionRelativeToEyeDirty&&(e._modelViewProjectionRelativeToEyeDirty=!1,Matrix4.multiply(e._projection,e.modelViewRelativeToEye,e._modelViewProjectionRelativeToEye))}function cleanModelViewInfiniteProjection(e){e._modelViewInfiniteProjectionDirty&&(e._modelViewInfiniteProjectionDirty=!1,Matrix4.multiply(e._infiniteProjection,e.modelView,e._modelViewInfiniteProjection))}function cleanNormal(e){if(e._normalDirty){e._normalDirty=!1;var t=e._normal;Matrix4.getMatrix3(e.inverseModelView,t),Matrix3.getRotation(t,t),Matrix3.transpose(t,t)}}function cleanNormal3D(e){if(e._normal3DDirty){e._normal3DDirty=!1;var t=e._normal3D;Matrix4.getMatrix3(e.inverseModelView3D,t),Matrix3.getRotation(t,t),Matrix3.transpose(t,t)}}function cleanInverseNormal(e){e._inverseNormalDirty&&(e._inverseNormalDirty=!1,Matrix4.getMatrix3(e.inverseModelView,e._inverseNormal),Matrix3.getRotation(e._inverseNormal,e._inverseNormal))}function cleanInverseNormal3D(e){e._inverseNormal3DDirty&&(e._inverseNormal3DDirty=!1,Matrix4.getMatrix3(e.inverseModelView3D,e._inverseNormal3D),Matrix3.getRotation(e._inverseNormal3D,e._inverseNormal3D))}UniformState.prototype.update=function(e){this._mode=e.mode,this._mapProjection=e.mapProjection,this._ellipsoid=e.mapProjection.ellipsoid,this._pixelRatio=e.pixelRatio;var t=e.camera;this.updateCamera(t),e.mode===SceneMode$1.SCENE2D?(this._frustum2DWidth=t.frustum.right-t.frustum.left,this._eyeHeight2D.x=.5*this._frustum2DWidth,this._eyeHeight2D.y=this._eyeHeight2D.x*this._eyeHeight2D.x):(this._frustum2DWidth=0,this._eyeHeight2D.x=0,this._eyeHeight2D.y=0),setSunAndMoonDirections(this,e);var i=defaultValue(e.light,defaultLight);i instanceof SunLight?(this._lightDirectionWC=Cartesian3.clone(this._sunDirectionWC,this._lightDirectionWC),this._lightDirectionEC=Cartesian3.clone(this._sunDirectionEC,this._lightDirectionEC)):(this._lightDirectionWC=Cartesian3.normalize(Cartesian3.negate(i.direction,this._lightDirectionWC),this._lightDirectionWC),this._lightDirectionEC=Matrix3.multiplyByVector(this.viewRotation3D,this._lightDirectionWC,this._lightDirectionEC));var r=i.color,n=Cartesian3.fromElements(r.red,r.green,r.blue,this._lightColorHdr);n=Cartesian3.multiplyByScalar(n,i.intensity,n);var a=Cartesian3.maximumComponent(n);1<a?Cartesian3.divideByScalar(n,a,this._lightColor):Cartesian3.clone(n,this._lightColor);var o=e.brdfLutGenerator,s=defined(o)?o.colorTexture:void 0;this._brdfLut=s,this._environmentMap=defaultValue(e.environmentMap,e.context.defaultCubeMap),this._sphericalHarmonicCoefficients=defaultValue(e.sphericalHarmonicCoefficients,EMPTY_ARRAY),this._specularEnvironmentMaps=e.specularEnvironmentMaps,this._specularEnvironmentMapsMaximumLOD=e.specularEnvironmentMapsMaximumLOD,defined(this._specularEnvironmentMaps)&&Cartesian2.clone(this._specularEnvironmentMaps.dimensions,this._specularEnvironmentMapsDimensions),this._fogDensity=e.fog.density,this._invertClassificationColor=e.invertClassificationColor,this._frameState=e,this._temeToPseudoFixed=Transforms.computeTemeToPseudoFixedMatrix(e.time,this._temeToPseudoFixed),this._imagerySplitPosition=e.imagerySplitPosition*e.context.drawingBufferWidth;var l,u=t.frustum.fov,c=this._viewport;l=c.height>c.width?2*Math.tan(.5*u)/c.height:2*Math.tan(.5*u)/c.width,this._geometricToleranceOverMeter=l*e.maximumScreenSpaceError,Color.clone(e.backgroundColor,this._backgroundColor),this._minimumDisableDepthTestDistance=e.minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance*=this._minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance===Number.POSITIVE_INFINITY&&(this._minimumDisableDepthTestDistance=-1)};var cameraPositionMC=new Cartesian3;function cleanEncodedCameraPositionMC(e){e._encodedCameraPositionMCDirty&&(e._encodedCameraPositionMCDirty=!1,Matrix4.multiplyByPoint(e.inverseModel,e._cameraPosition,cameraPositionMC),EncodedCartesian3.fromCartesian(cameraPositionMC,e._encodedCameraPositionMC))}var view2Dto3DPScratch=new Cartesian3,view2Dto3DRScratch=new Cartesian3,view2Dto3DUScratch=new Cartesian3,view2Dto3DDScratch=new Cartesian3,view2Dto3DCartographicScratch=new Cartographic,view2Dto3DCartesian3Scratch=new Cartesian3,view2Dto3DMatrix4Scratch=new Matrix4;function view2Dto3D(e,t,i,r,n,a,o,s){var l=view2Dto3DPScratch;l.x=e.y,l.y=e.z,l.z=e.x;var u=view2Dto3DRScratch;u.x=i.y,u.y=i.z,u.z=i.x;var c=view2Dto3DUScratch;c.x=r.y,c.y=r.z,c.z=r.x;var d=view2Dto3DDScratch;d.x=t.y,d.y=t.z,d.z=t.x,a===SceneMode$1.SCENE2D&&(l.z=.5*n);var h=o.unproject(l,view2Dto3DCartographicScratch);h.longitude=CesiumMath.clamp(h.longitude,-Math.PI,Math.PI),h.latitude=CesiumMath.clamp(h.latitude,-CesiumMath.PI_OVER_TWO,CesiumMath.PI_OVER_TWO);var p=o.ellipsoid,f=p.cartographicToCartesian(h,view2Dto3DCartesian3Scratch),m=Transforms.eastNorthUpToFixedFrame(f,p,view2Dto3DMatrix4Scratch);return Matrix4.multiplyByPointAsVector(m,u,u),Matrix4.multiplyByPointAsVector(m,c,c),Matrix4.multiplyByPointAsVector(m,d,d),defined(s)||(s=new Matrix4),s[0]=u.x,s[1]=c.x,s[2]=-d.x,s[3]=0,s[4]=u.y,s[5]=c.y,s[6]=-d.y,s[7]=0,s[8]=u.z,s[9]=c.z,s[10]=-d.z,s[11]=0,s[12]=-Cartesian3.dot(u,f),s[13]=-Cartesian3.dot(c,f),s[14]=Cartesian3.dot(d,f),s[15]=1,s}function updateView3D(e){e._view3DDirty&&(e._mode===SceneMode$1.SCENE3D?Matrix4.clone(e._view,e._view3D):view2Dto3D(e._cameraPosition,e._cameraDirection,e._cameraRight,e._cameraUp,e._frustum2DWidth,e._mode,e._mapProjection,e._view3D),Matrix4.getMatrix3(e._view3D,e._viewRotation3D),e._view3DDirty=!1)}function updateInverseView3D(e){e._inverseView3DDirty&&(Matrix4.inverseTransformation(e.view3D,e._inverseView3D),Matrix4.getMatrix3(e._inverseView3D,e._inverseViewRotation3D),e._inverseView3DDirty=!1)}function errorToString(e,t){var i="WebGL Error: ";switch(t){case e.INVALID_ENUM:i+="INVALID_ENUM";break;case e.INVALID_VALUE:i+="INVALID_VALUE";break;case e.INVALID_OPERATION:i+="INVALID_OPERATION";break;case e.OUT_OF_MEMORY:i+="OUT_OF_MEMORY";break;case e.CONTEXT_LOST_WEBGL:i+="CONTEXT_LOST_WEBGL lost";break;default:i+="Unknown ("+t+")"}return i}function createErrorMessage(e,t,i,r){for(var n=errorToString(e,r)+": "+t.name+"(",a=0;a<i.length;++a)0!==a&&(n+=", "),n+=i[a];return n+=");"}function throwOnError(e,t,i){var r=e.getError();if(r!==e.NO_ERROR)throw new RuntimeError(createErrorMessage(e,t,i,r))}function makeGetterSetter(t,i,r){return{get:function(){var e=t[i];return r(t,"get: "+i,e),t[i]},set:function(e){t[i]=e,r(t,"set: "+i,e)}}}function wrapGL(i,r){if(!defined(r))return i;function e(t){return function(){var e=t.apply(i,arguments);return r(i,t,arguments),e}}var t={};for(var n in i){var a=i[n];a instanceof Function?t[n]=e(a):Object.defineProperty(t,n,makeGetterSetter(i,n,r))}return t}function getExtension(e,t){for(var i=t.length,r=0;r<i;++r){var n=e.getExtension(t[r]);if(n)return n}}function Context(e,t){if("undefined"==typeof WebGLRenderingContext)throw new RuntimeError("The browser does not support WebGL. Visit http://get.webgl.org.");this._canvas=e,(t=defaultValue(t=clone(t,!0),{})).allowTextureFilterAnisotropic=defaultValue(t.allowTextureFilterAnisotropic,!0);var i=defaultValue(t.webgl,{});i.alpha=defaultValue(i.alpha,!1),i.stencil=defaultValue(i.stencil,!0);var r,n=defaultValue(t.requestWebgl2,!1)&&"undefined"!=typeof WebGL2RenderingContext,a=!1,o=t.getWebGLStub;if(defined(o))r=o(e,i);else if(n&&defined(r=e.getContext("webgl2",i)||e.getContext("experimental-webgl2",i)||void 0)&&(a=!0),defined(r)||(r=e.getContext("webgl",i)||e.getContext("experimental-webgl",i)||void 0),!defined(r))throw new RuntimeError("The browser supports WebGL, but initialization failed.");this._originalGLContext=r,this._gl=r,this._webgl2=a,this._id=createGuid(),this.validateFramebuffer=!1,this.validateShaderProgram=!1,this.logShaderCompilation=!1,this._throwOnWebGLError=!1,this._shaderCache=new ShaderCache(this),this._textureCache=new TextureCache;var s=r;this._stencilBits=s.getParameter(s.STENCIL_BITS),ContextLimits._maximumCombinedTextureImageUnits=s.getParameter(s.MAX_COMBINED_TEXTURE_IMAGE_UNITS),ContextLimits._maximumCubeMapSize=s.getParameter(s.MAX_CUBE_MAP_TEXTURE_SIZE),ContextLimits._maximumFragmentUniformVectors=s.getParameter(s.MAX_FRAGMENT_UNIFORM_VECTORS),ContextLimits._maximumTextureImageUnits=s.getParameter(s.MAX_TEXTURE_IMAGE_UNITS),ContextLimits._maximumRenderbufferSize=s.getParameter(s.MAX_RENDERBUFFER_SIZE),ContextLimits._maximumTextureSize=s.getParameter(s.MAX_TEXTURE_SIZE),ContextLimits._maximumVaryingVectors=s.getParameter(s.MAX_VARYING_VECTORS),ContextLimits._maximumVertexAttributes=s.getParameter(s.MAX_VERTEX_ATTRIBS),ContextLimits._maximumVertexTextureImageUnits=s.getParameter(s.MAX_VERTEX_TEXTURE_IMAGE_UNITS),ContextLimits._maximumVertexUniformVectors=s.getParameter(s.MAX_VERTEX_UNIFORM_VECTORS);var l=s.getParameter(s.ALIASED_LINE_WIDTH_RANGE);ContextLimits._minimumAliasedLineWidth=l[0],ContextLimits._maximumAliasedLineWidth=l[1];var u=s.getParameter(s.ALIASED_POINT_SIZE_RANGE);ContextLimits._minimumAliasedPointSize=u[0],ContextLimits._maximumAliasedPointSize=u[1];var c=s.getParameter(s.MAX_VIEWPORT_DIMS);ContextLimits._maximumViewportWidth=c[0],ContextLimits._maximumViewportHeight=c[1];var d=s.getShaderPrecisionFormat(s.FRAGMENT_SHADER,s.HIGH_FLOAT);ContextLimits._highpFloatSupported=0!==d.precision;var h=s.getShaderPrecisionFormat(s.FRAGMENT_SHADER,s.HIGH_INT);ContextLimits._highpIntSupported=0!==h.rangeMax,this._antialias=s.getContextAttributes().antialias,this._standardDerivatives=!!getExtension(s,["OES_standard_derivatives"]),this._blendMinmax=!!getExtension(s,["EXT_blend_minmax"]),this._elementIndexUint=!!getExtension(s,["OES_element_index_uint"]),this._depthTexture=!!getExtension(s,["WEBGL_depth_texture","WEBKIT_WEBGL_depth_texture"]),this._fragDepth=!!getExtension(s,["EXT_frag_depth"]),this._debugShaders=getExtension(s,["WEBGL_debug_shaders"]),this._textureFloat=!!getExtension(s,["OES_texture_float"]),this._textureHalfFloat=!!getExtension(s,["OES_texture_half_float"]),this._textureFloatLinear=!!getExtension(s,["OES_texture_float_linear"]),this._textureHalfFloatLinear=!!getExtension(s,["OES_texture_half_float_linear"]),this._colorBufferFloat=!!getExtension(s,["EXT_color_buffer_float","WEBGL_color_buffer_float"]),this._floatBlend=!!getExtension(s,["EXT_float_blend"]),this._colorBufferHalfFloat=!!getExtension(s,["EXT_color_buffer_half_float"]),this._s3tc=!!getExtension(s,["WEBGL_compressed_texture_s3tc","MOZ_WEBGL_compressed_texture_s3tc","WEBKIT_WEBGL_compressed_texture_s3tc"]),this._pvrtc=!!getExtension(s,["WEBGL_compressed_texture_pvrtc","WEBKIT_WEBGL_compressed_texture_pvrtc"]),this._etc1=!!getExtension(s,["WEBGL_compressed_texture_etc1"]);var p,f,m,g,y,v,_,C,x,b,A=t.allowTextureFilterAnisotropic?getExtension(s,["EXT_texture_filter_anisotropic","WEBKIT_EXT_texture_filter_anisotropic"]):void 0;if(this._textureFilterAnisotropic=A,ContextLimits._maximumTextureFilterAnisotropy=defined(A)?s.getParameter(A.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1,a){var S=this;p=function(){return S._gl.createVertexArray()},f=function(e){S._gl.bindVertexArray(e)},m=function(e){S._gl.deleteVertexArray(e)},g=function(e,t,i,r,n){s.drawElementsInstanced(e,t,i,r,n)},y=function(e,t,i,r){s.drawArraysInstanced(e,t,i,r)},v=function(e,t){s.vertexAttribDivisor(e,t)},_=function(e){s.drawBuffers(e)}}else defined(C=getExtension(s,["OES_vertex_array_object"]))&&(p=function(){return C.createVertexArrayOES()},f=function(e){C.bindVertexArrayOES(e)},m=function(e){C.deleteVertexArrayOES(e)}),defined(x=getExtension(s,["ANGLE_instanced_arrays"]))&&(g=function(e,t,i,r,n){x.drawElementsInstancedANGLE(e,t,i,r,n)},y=function(e,t,i,r){x.drawArraysInstancedANGLE(e,t,i,r)},v=function(e,t){x.vertexAttribDivisorANGLE(e,t)}),defined(b=getExtension(s,["WEBGL_draw_buffers"]))&&(_=function(e){b.drawBuffersWEBGL(e)});this.glCreateVertexArray=p,this.glBindVertexArray=f,this.glDeleteVertexArray=m,this.glDrawElementsInstanced=g,this.glDrawArraysInstanced=y,this.glVertexAttribDivisor=v,this.glDrawBuffers=_,this._vertexArrayObject=!!C,this._instancedArrays=!!x,this._drawBuffers=!!b,ContextLimits._maximumDrawBuffers=this.drawBuffers?s.getParameter(WebGLConstants$1.MAX_DRAW_BUFFERS):1,ContextLimits._maximumColorAttachments=this.drawBuffers?s.getParameter(WebGLConstants$1.MAX_COLOR_ATTACHMENTS):1,this._clearColor=new Color(0,0,0,0),this._clearDepth=1,this._clearStencil=0;var w=new UniformState,E=new PassState(this),T=RenderState.fromCache();this._defaultPassState=E,this._defaultRenderState=T,this._defaultTexture=void 0,this._defaultCubeMap=void 0,this._us=w,this._currentRenderState=T,this._currentPassState=E,this._currentFramebuffer=void 0,this._maxFrameTextureUnitIndex=0,this._vertexAttribDivisors=[],this._previousDrawInstanced=!1;for(var P=0;P<ContextLimits._maximumVertexAttributes;P++)this._vertexAttribDivisors.push(0);this._pickObjects={},this._nextPickColor=new Uint32Array(1),this.options=t,this.cache={},RenderState.apply(s,T,E),this._floatTexSixPlaces=checkFloatTexturePrecision(this)}var defaultFramebufferMarker={},scratchBackBufferArray;function applyRenderState(e,t,i,r){var n=e._currentRenderState,a=e._currentPassState;e._currentRenderState=t,e._currentPassState=i,RenderState.partialApply(e._gl,n,t,a,i,r)}function bindFramebuffer(e,t){if(t!==e._currentFramebuffer){e._currentFramebuffer=t;var i=scratchBackBufferArray;if(defined(t))t._bind(),i=t._getActiveColorAttachments();else{var r=e._gl;r.bindFramebuffer(r.FRAMEBUFFER,null)}e.drawBuffers&&e.glDrawBuffers(i)}}Object.defineProperties(Context.prototype,{id:{get:function(){return this._id}},webgl2:{get:function(){return this._webgl2}},canvas:{get:function(){return this._canvas}},shaderCache:{get:function(){return this._shaderCache}},textureCache:{get:function(){return this._textureCache}},uniformState:{get:function(){return this._us}},stencilBits:{get:function(){return this._stencilBits}},stencilBuffer:{get:function(){return 8<=this._stencilBits}},antialias:{get:function(){return this._antialias}},standardDerivatives:{get:function(){return this._standardDerivatives||this._webgl2}},floatBlend:{get:function(){return this._floatBlend}},blendMinmax:{get:function(){return this._blendMinmax||this._webgl2}},elementIndexUint:{get:function(){return this._elementIndexUint||this._webgl2}},depthTexture:{get:function(){return this._depthTexture||this._webgl2}},floatingPointTexture:{get:function(){return this._webgl2||this._textureFloat}},floatTextureSixPlaces:{get:function(){return this._floatTexSixPlaces}},halfFloatingPointTexture:{get:function(){return this._webgl2||this._textureHalfFloat}},textureFloatLinear:{get:function(){return this._textureFloatLinear}},textureHalfFloatLinear:{get:function(){return this._webgl2&&this._textureFloatLinear||!this._webgl2&&this._textureHalfFloatLinear}},textureFilterAnisotropic:{get:function(){return!!this._textureFilterAnisotropic}},s3tc:{get:function(){return this._s3tc}},pvrtc:{get:function(){return this._pvrtc}},etc1:{get:function(){return this._etc1}},vertexArrayObject:{get:function(){return this._vertexArrayObject||this._webgl2}},fragmentDepth:{get:function(){return this._fragDepth||this._webgl2}},instancedArrays:{get:function(){return this._instancedArrays||this._webgl2}},colorBufferFloat:{get:function(){return this._colorBufferFloat}},colorBufferHalfFloat:{get:function(){return this._webgl2&&this._colorBufferFloat||!this._webgl2&&this._colorBufferHalfFloat}},drawBuffers:{get:function(){return this._drawBuffers||this._webgl2}},debugShaders:{get:function(){return this._debugShaders}},throwOnWebGLError:{get:function(){return this._throwOnWebGLError},set:function(e){this._throwOnWebGLError=e,this._gl=wrapGL(this._originalGLContext,e?throwOnError:void 0)}},defaultTexture:{get:function(){return void 0===this._defaultTexture&&(this._defaultTexture=new Texture({context:this,source:{width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,255])},flipY:!1})),this._defaultTexture}},defaultCubeMap:{get:function(){if(void 0===this._defaultCubeMap){var e={width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,255])};this._defaultCubeMap=new CubeMap({context:this,source:{positiveX:e,negativeX:e,positiveY:e,negativeY:e,positiveZ:e,negativeZ:e},flipY:!1})}return this._defaultCubeMap}},drawingBufferHeight:{get:function(){return this._gl.drawingBufferHeight}},drawingBufferWidth:{get:function(){return this._gl.drawingBufferWidth}},defaultFramebuffer:{get:function(){return defaultFramebufferMarker}}}),"undefined"!=typeof WebGLRenderingContext&&(scratchBackBufferArray=[WebGLConstants$1.BACK]);var defaultClearCommand=new ClearCommand;function beginDraw(e,t,i,r,n){bindFramebuffer(e,t),applyRenderState(e,n,i,!1),r._bind(),e._maxFrameTextureUnitIndex=Math.max(e._maxFrameTextureUnitIndex,r.maximumTextureUnitIndex)}function continueDraw(e,t,i,r){var n=t._primitiveType,a=t._vertexArray,o=t._offset,s=t._count,l=t.instanceCount;e._us.model=defaultValue(t._modelMatrix,Matrix4.IDENTITY),i._setUniforms(r,e._us,e.validateShaderProgram),a._bind();var u=a.indexBuffer;defined(u)?(o*=u.bytesPerIndex,s=defaultValue(s,u.numberOfIndices),0===l?e._gl.drawElements(n,s,u.indexDatatype,o):e.glDrawElementsInstanced(n,s,u.indexDatatype,o,l)):(s=defaultValue(s,a.numberOfVertices),0===l?e._gl.drawArrays(n,o,s):e.glDrawArraysInstanced(n,o,s,l)),a._unBind()}Context.prototype.clear=function(e,t){e=defaultValue(e,defaultClearCommand),t=defaultValue(t,this._defaultPassState);var i=this._gl,r=0,n=e.color,a=e.depth,o=e.stencil;defined(n)&&(Color.equals(this._clearColor,n)||(Color.clone(n,this._clearColor),i.clearColor(n.red,n.green,n.blue,n.alpha)),r|=i.COLOR_BUFFER_BIT),defined(a)&&(a!==this._clearDepth&&(this._clearDepth=a,i.clearDepth(a)),r|=i.DEPTH_BUFFER_BIT),defined(o)&&(o!==this._clearStencil&&(this._clearStencil=o,i.clearStencil(o)),r|=i.STENCIL_BUFFER_BIT),applyRenderState(this,defaultValue(e.renderState,this._defaultRenderState),t,!0),bindFramebuffer(this,defaultValue(e.framebuffer,t.framebuffer)),i.clear(r)},Context.prototype.draw=function(e,t,i,r){t=defaultValue(t,this._defaultPassState);var n=defaultValue(e._framebuffer,t.framebuffer);defined(t.framebuffer)&&defined(e._framebuffer)&&e._framebuffer._externalDepthStencil&&(e._framebuffer.depthStencilTexture=t.framebuffer.depthStencilTexture);var a=defaultValue(e._renderState,this._defaultRenderState);i=defaultValue(i,e._shaderProgram),r=defaultValue(r,e._uniformMap),beginDraw(this,n,t,i,a),continueDraw(this,e,i,r)},Context.prototype.endFrame=function(){var e=this._gl;e.useProgram(null),this._currentFramebuffer=void 0,e.bindFramebuffer(e.FRAMEBUFFER,null);var t=scratchBackBufferArray;this.drawBuffers&&this.glDrawBuffers(t);for(var i=this._maxFrameTextureUnitIndex,r=this._maxFrameTextureUnitIndex=0;r<i;++r)e.activeTexture(e.TEXTURE0+r),e.bindTexture(e.TEXTURE_2D,null),e.bindTexture(e.TEXTURE_CUBE_MAP,null)},Context.prototype.readPixels=function(e){var t=this._gl;e=defaultValue(e,defaultValue.EMPTY_OBJECT);var i=Math.max(defaultValue(e.x,0),0),r=Math.max(defaultValue(e.y,0),0),n=defaultValue(e.width,t.drawingBufferWidth),a=defaultValue(e.height,t.drawingBufferHeight),o=e.framebuffer,s=PixelDatatype$1.UNSIGNED_BYTE;defined(o)&&0<o.numberOfColorAttachments&&(s=o.getColorTexture(0).pixelDatatype);var l=PixelFormat$1.createTypedArray(PixelFormat$1.RGBA,s,n,a);return bindFramebuffer(this,o),t.readPixels(i,r,n,a,PixelFormat$1.RGBA,s,l),l};var viewportQuadAttributeLocations={position:0,textureCoordinates:1};function PickId(e,t,i){this._pickObjects=e,this.key=t,this.color=i}function loadCubeMap(t,e){var i={flipY:!0,preferImageBitmap:!0},r=[Resource.createIfNeeded(e.positiveX).fetchImage(i),Resource.createIfNeeded(e.negativeX).fetchImage(i),Resource.createIfNeeded(e.positiveY).fetchImage(i),Resource.createIfNeeded(e.negativeY).fetchImage(i),Resource.createIfNeeded(e.positiveZ).fetchImage(i),Resource.createIfNeeded(e.negativeZ).fetchImage(i)];return when.all(r,function(e){return new CubeMap({context:t,source:{positiveX:e[0],negativeX:e[1],positiveY:e[2],negativeY:e[3],positiveZ:e[4],negativeZ:e[5]}})})}function DiscardMissingTileImagePolicy(l){l=defaultValue(l,defaultValue.EMPTY_OBJECT),this._pixelsToCheck=l.pixelsToCheck,this._missingImagePixels=void 0,this._missingImageByteLength=void 0,this._isReady=!1;var e=Resource.createIfNeeded(l.missingImageUrl),u=this;e.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}).then(function(e){defined(e.blob)&&(u._missingImageByteLength=e.blob.size);var t=getImagePixels(e);if(l.disableCheckIfAllPixelsAreTransparent){for(var i=!0,r=e.width,n=l.pixelsToCheck,a=0,o=n.length;i&&a<o;++a){var s=n[a];0<t[3+(4*s.x+s.y*r)]&&(i=!1)}i&&(t=void 0)}u._missingImagePixels=t,u._isReady=!0}).otherwise(function(){u._missingImagePixels=void 0,u._isReady=!0})}function ImageryLayerFeatureInfo(){this.name=void 0,this.description=void 0,this.position=void 0,this.data=void 0,this.imageryLayer=void 0}function ArcGisMapServerImageryProvider(l){l=defaultValue(l,defaultValue.EMPTY_OBJECT);var e=Resource.createIfNeeded(l.url);e.appendForwardSlash(),defined(l.token)&&e.setQueryParameters({token:l.token}),this._resource=e,this._tileDiscardPolicy=l.tileDiscardPolicy,this._tileWidth=defaultValue(l.tileWidth,256),this._tileHeight=defaultValue(l.tileHeight,256),this._maximumLevel=l.maximumLevel,this._tilingScheme=defaultValue(l.tilingScheme,new GeographicTilingScheme({ellipsoid:l.ellipsoid})),this._useTiles=defaultValue(l.usePreCachedTilesIfAvailable,!0),this._rectangle=defaultValue(l.rectangle,this._tilingScheme.rectangle),this._layers=l.layers;var t=l.credit;"string"==typeof t&&(t=new Credit(t)),this._credit=t,this.enablePickFeatures=defaultValue(l.enablePickFeatures,!0),this._errorEvent=new Event,this._ready=!1,this._readyPromise=when.defer();var u,c=this;function i(e){var t=e.tileInfo;if(defined(t)){if(c._tileWidth=t.rows,c._tileHeight=t.cols,102100===t.spatialReference.wkid||102113===t.spatialReference.wkid)c._tilingScheme=new WebMercatorTilingScheme({ellipsoid:l.ellipsoid});else{if(4326!==e.tileInfo.spatialReference.wkid){var i="Tile spatial reference WKID "+e.tileInfo.spatialReference.wkid+" is not supported.";return void(u=TileProviderError.handleError(u,c,c._errorEvent,i,void 0,void 0,void 0,d))}c._tilingScheme=new GeographicTilingScheme({ellipsoid:l.ellipsoid})}if(c._maximumLevel=e.tileInfo.lods.length-1,defined(e.fullExtent)){if(defined(e.fullExtent.spatialReference)&&defined(e.fullExtent.spatialReference.wkid))if(102100===e.fullExtent.spatialReference.wkid||102113===e.fullExtent.spatialReference.wkid){var r=new WebMercatorProjection,n=e.fullExtent,a=r.unproject(new Cartesian3(Math.max(n.xmin,-c._tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.max(n.ymin,-c._tilingScheme.ellipsoid.maximumRadius*Math.PI),0)),o=r.unproject(new Cartesian3(Math.min(n.xmax,c._tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.min(n.ymax,c._tilingScheme.ellipsoid.maximumRadius*Math.PI),0));c._rectangle=new Rectangle(a.longitude,a.latitude,o.longitude,o.latitude)}else{if(4326!==e.fullExtent.spatialReference.wkid){var s="fullExtent.spatialReference WKID "+e.fullExtent.spatialReference.wkid+" is not supported.";return void(u=TileProviderError.handleError(u,c,c._errorEvent,s,void 0,void 0,void 0,d))}c._rectangle=Rectangle.fromDegrees(e.fullExtent.xmin,e.fullExtent.ymin,e.fullExtent.xmax,e.fullExtent.ymax)}}else c._rectangle=c._tilingScheme.rectangle;defined(c._tileDiscardPolicy)||(c._tileDiscardPolicy=new DiscardMissingTileImagePolicy({missingImageUrl:buildImageResource(c,0,0,c._maximumLevel).url,pixelsToCheck:[new Cartesian2(0,0),new Cartesian2(200,20),new Cartesian2(20,200),new Cartesian2(80,110),new Cartesian2(160,130)],disableCheckIfAllPixelsAreTransparent:!0})),c._useTiles=!0}else c._useTiles=!1;defined(e.copyrightText)&&0<e.copyrightText.length&&(c._credit=new Credit(e.copyrightText)),c._ready=!0,c._readyPromise.resolve(!0),TileProviderError.handleSuccess(u)}function r(e){var t="An error occurred while accessing "+c._resource.url+".";u=TileProviderError.handleError(u,c,c._errorEvent,t,void 0,void 0,void 0,d),c._readyPromise.reject(new RuntimeError(t))}function d(){when(c._resource.getDerivedResource({queryParameters:{f:"json"}}).fetchJsonp(),i,r)}this._useTiles?d():(this._ready=!0,this._readyPromise.resolve(!0))}function buildImageResource(e,t,i,r,n){var a;if(e._useTiles)a=e._resource.getDerivedResource({url:"tile/"+r+"/"+i+"/"+t,request:n});else{var o=e._tilingScheme.tileXYToNativeRectangle(t,i,r),s={bbox:o.west+","+o.south+","+o.east+","+o.north,size:e._tileWidth+","+e._tileHeight,format:"png",transparent:!0,f:"image"};e._tilingScheme.projection instanceof GeographicProjection?(s.bboxSR=4326,s.imageSR=4326):(s.bboxSR=3857,s.imageSR=3857),e.layers&&(s.layers="show:"+e.layers),a=e._resource.getDerivedResource({url:"export",request:n,queryParameters:s})}return a}function AutoExposure(){this._uniformMap=void 0,this._command=void 0,this._colorTexture=void 0,this._depthTexture=void 0,this._ready=!1,this._name="czm_autoexposure",this._logDepthChanged=void 0,this._useLogDepth=void 0,this._framebuffers=void 0,this._previousLuminance=void 0,this._commands=void 0,this._clearCommand=void 0,this._minMaxLuminance=new Cartesian2,this.enabled=!0,this._enabled=!0,this.minimumLuminance=.1,this.maximumLuminance=10}function destroyFramebuffers(e){var t=e._framebuffers;if(defined(t)){for(var i=t.length,r=0;r<i;++r)t[r].destroy();e._framebuffers=void 0,e._previousLuminance.destroy(),e._previousLuminance=void 0}}function createFramebuffers(e,t){destroyFramebuffers(e);for(var i=e._width,r=e._height,n=PixelFormat$1.RGBA,a=t.halfFloatingPointTexture?PixelDatatype$1.HALF_FLOAT:PixelDatatype$1.FLOAT,o=Math.ceil(Math.log(Math.max(i,r))/Math.log(3)),s=new Array(o),l=0;l<o;++l)i=Math.max(Math.ceil(i/3),1),r=Math.max(Math.ceil(r/3),1),s[l]=new Framebuffer({context:t,colorTextures:[new Texture({context:t,width:i,height:r,pixelFormat:n,pixelDatatype:a,sampler:Sampler.NEAREST})]});var u=s[o-1].getColorTexture(0);e._previousLuminance=new Framebuffer({context:t,colorTextures:[new Texture({context:t,width:u.width,height:u.height,pixelFormat:n,pixelDatatype:a,sampler:Sampler.NEAREST})]}),e._framebuffers=s}function destroyCommands(e){var t=e._commands;if(defined(t)){for(var i=t.length,r=0;r<i;++r)t[r].shaderProgram.destroy();e._commands=void 0}}function createUniformMap$4(e,t){var i;if(0===t)i={colorTexture:function(){return e._colorTexture},colorTextureDimensions:function(){return e._colorTexture.dimensions}};else{var r=e._framebuffers[t-1].getColorTexture(0);i={colorTexture:function(){return r},colorTextureDimensions:function(){return r.dimensions}}}return i.minMaxLuminance=function(){return e._minMaxLuminance},i.previousLuminance=function(){return e._previousLuminance.getColorTexture(0)},i}function getShaderSource(e,t){var i="uniform sampler2D colorTexture; \nvarying vec2 v_textureCoordinates; \nfloat sampleTexture(vec2 offset) { \n";return i+=0===e?" vec4 color = texture2D(colorTexture, v_textureCoordinates + offset); \n return czm_luminance(color.rgb); \n":" return texture2D(colorTexture, v_textureCoordinates + offset).r; \n",i+="}\n\n",i+="uniform vec2 colorTextureDimensions; \nuniform vec2 minMaxLuminance; \nuniform sampler2D previousLuminance; \nvoid main() { \n float color = 0.0; \n float xStep = 1.0 / colorTextureDimensions.x; \n float yStep = 1.0 / colorTextureDimensions.y; \n int count = 0; \n for (int i = 0; i < 3; ++i) { \n for (int j = 0; j < 3; ++j) { \n vec2 offset; \n offset.x = -xStep + float(i) * xStep; \n offset.y = -yStep + float(j) * yStep; \n if (offset.x < 0.0 || offset.x > 1.0 || offset.y < 0.0 || offset.y > 1.0) { \n continue; \n } \n color += sampleTexture(offset); \n ++count; \n } \n } \n if (count > 0) { \n color /= float(count); \n } \n",e===t-1&&(i+=" float previous = texture2D(previousLuminance, vec2(0.5)).r; \n color = clamp(color, minMaxLuminance.x, minMaxLuminance.y); \n color = previous + (color - previous) / (60.0 * 1.5); \n color = clamp(color, minMaxLuminance.x, minMaxLuminance.y); \n"),i+=" gl_FragColor = vec4(color); \n} \n"}function createCommands$6(e,t){destroyCommands(e);for(var i=e._framebuffers,r=i.length,n=new Array(r),a=0;a<r;++a)n[a]=t.createViewportQuadCommand(getShaderSource(a,r),{framebuffer:i[a],uniformMap:createUniformMap$4(e,a)});e._commands=n}Context.prototype.getViewportQuadVertexArray=function(){var e=this.cache.viewportQuad_vertexArray;if(!defined(e)){var t=new Geometry({attributes:{position:new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1]}),textureCoordinates:new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:2,values:[0,0,1,0,1,1,0,1]})},indices:new Uint16Array([0,1,2,0,2,3]),primitiveType:PrimitiveType$1.TRIANGLES});e=VertexArray.fromGeometry({context:this,geometry:t,attributeLocations:viewportQuadAttributeLocations,bufferUsage:BufferUsage$1.STATIC_DRAW,interleave:!0}),this.cache.viewportQuad_vertexArray=e}return e},Context.prototype.createViewportQuadCommand=function(e,t){return t=defaultValue(t,defaultValue.EMPTY_OBJECT),new DrawCommand({vertexArray:this.getViewportQuadVertexArray(),primitiveType:PrimitiveType$1.TRIANGLES,renderState:t.renderState,shaderProgram:ShaderProgram.fromCache({context:this,vertexShaderSource:ViewportQuadVS,fragmentShaderSource:e,attributeLocations:viewportQuadAttributeLocations}),uniformMap:t.uniformMap,owner:t.owner,framebuffer:t.framebuffer,pass:t.pass})},Context.prototype.getObjectByPickColor=function(e){return this._pickObjects[e.toRgba()]},Object.defineProperties(PickId.prototype,{object:{get:function(){return this._pickObjects[this.key]},set:function(e){this._pickObjects[this.key]=e}}}),PickId.prototype.destroy=function(){delete this._pickObjects[this.key]},Context.prototype.createPickId=function(e){++this._nextPickColor[0];var t=this._nextPickColor[0];if(0===t)throw new RuntimeError("Out of unique Pick IDs.");return this._pickObjects[t]=e,new PickId(this._pickObjects,t,Color.fromRgba(t))},Context.prototype.isDestroyed=function(){return!1},Context.prototype.destroy=function(){var e=this.cache;for(var t in e)if(e.hasOwnProperty(t)){var i=e[t];defined(i.destroy)&&i.destroy()}return this._shaderCache=this._shaderCache.destroy(),this._textureCache=this._textureCache.destroy(),this._defaultTexture=this._defaultTexture&&this._defaultTexture.destroy(),this._defaultCubeMap=this._defaultCubeMap&&this._defaultCubeMap.destroy(),destroyObject(this)},Context.prototype.clearFrameBuffer=function(e){var t=this._gl;t.clearColor(0,0,0,0,0),bindFramebuffer(this,e),t.clear(t.COLOR_BUFFER_BIT),t.clearColor(this._clearColor.red,this._clearColor.green,this._clearColor.blue,this._clearColor.alpha),bindFramebuffer(this,this._currentFramebuffer)},DiscardMissingTileImagePolicy.prototype.isReady=function(){return this._isReady},DiscardMissingTileImagePolicy.prototype.shouldDiscardImage=function(e){var t=this._pixelsToCheck,i=this._missingImagePixels;if(!defined(i))return!1;if(defined(e.blob)&&e.blob.size!==this._missingImageByteLength)return!1;for(var r=getImagePixels(e),n=e.width,a=0,o=t.length;a<o;++a)for(var s=t[a],l=4*s.x+s.y*n,u=0;u<4;++u){var c=l+u;if(r[c]!==i[c])return!1}return!0},ImageryLayerFeatureInfo.prototype.configureNameFromProperties=function(e){var t,i=10;for(var r in e)if(e.hasOwnProperty(r)&&e[r]){var n=r.toLowerCase();1<i&&"name"===n?(i=1,t=r):2<i&&"title"===n?(i=2,t=r):3<i&&/name/i.test(r)?(i=3,t=r):4<i&&/title/i.test(r)&&(i=4,t=r)}defined(t)&&(this.name=e[t])},ImageryLayerFeatureInfo.prototype.configureDescriptionFromProperties=function(e){this.description=function e(t){var i='<table class="cesium-infoBox-defaultTable">';for(var r in t)if(t.hasOwnProperty(r)){var n=t[r];defined(n)&&(i+="object"==typeof n?"<tr><td>"+r+"</td><td>"+e(n)+"</td></tr>":"<tr><td>"+r+"</td><td>"+n+"</td></tr>")}return i+="</table>"}(e)},Object.defineProperties(ArcGisMapServerImageryProvider.prototype,{url:{get:function(){return this._resource._url}},token:{get:function(){return this._resource.queryParameters.token}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},credit:{get:function(){return this._credit}},usingPrecachedTiles:{get:function(){return this._useTiles}},hasAlphaChannel:{get:function(){return!0}},layers:{get:function(){return this._layers}}}),ArcGisMapServerImageryProvider.prototype.getTileCredits=function(e,t,i){},ArcGisMapServerImageryProvider.prototype.requestImage=function(e,t,i,r){return ImageryProvider.loadImage(this,buildImageResource(this,e,t,i,r))},ArcGisMapServerImageryProvider.prototype.pickFeatures=function(e,t,i,r,n){if(this.enablePickFeatures){var a,o,s,l=this._tilingScheme.tileXYToNativeRectangle(e,t,i);if(this._tilingScheme.projection instanceof GeographicProjection)a=CesiumMath.toDegrees(r),o=CesiumMath.toDegrees(n),s="4326";else{var u=this._tilingScheme.projection.project(new Cartographic(r,n,0));a=u.x,o=u.y,s="3857"}var c="visible";defined(this._layers)&&(c+=":"+this._layers);var d={f:"json",tolerance:2,geometryType:"esriGeometryPoint",geometry:a+","+o,mapExtent:l.west+","+l.south+","+l.east+","+l.north,imageDisplay:this._tileWidth+","+this._tileHeight+",96",sr:s,layers:c};return this._resource.getDerivedResource({url:"identify",queryParameters:d}).fetchJson().then(function(e){var t=[],i=e.results;if(!defined(i))return t;for(var r=0;r<i.length;++r){var n=i[r],a=new ImageryLayerFeatureInfo;if(a.data=n,a.name=n.value,a.properties=n.attributes,a.configureDescriptionFromProperties(n.attributes),"esriGeometryPoint"===n.geometryType&&n.geometry){var o=n.geometry.spatialReference&&n.geometry.spatialReference.wkid?n.geometry.spatialReference.wkid:4326;if(4326===o||4283===o)a.position=Cartographic.fromDegrees(n.geometry.x,n.geometry.y,n.geometry.z);else if(102100===o||900913===o||3857===o){var s=new WebMercatorProjection;a.position=s.unproject(new Cartesian3(n.geometry.x,n.geometry.y,n.geometry.z))}}t.push(a)}return t})}},Object.defineProperties(AutoExposure.prototype,{ready:{get:function(){return this._ready}},name:{get:function(){return this._name}},outputTexture:{get:function(){var e=this._framebuffers;if(defined(e))return e[e.length-1].getColorTexture(0)}}}),AutoExposure.prototype.clear=function(e){var t=this._framebuffers;if(defined(t)){var i=this._clearCommand;defined(i)||(i=this._clearCommand=new ClearCommand({color:new Color(0,0,0,0),framebuffer:void 0}));for(var r=t.length,n=0;n<r;++n)i.framebuffer=t[n],i.execute(e)}},AutoExposure.prototype.update=function(e){var t=e.drawingBufferWidth,i=e.drawingBufferHeight;t===this._width&&i===this._height||(this._width=t,this._height=i,createFramebuffers(this,e),createCommands$6(this,e),this._ready||(this._ready=!0)),this._minMaxLuminance.x=this.minimumLuminance,this._minMaxLuminance.y=this.maximumLuminance;var r=this._framebuffers,n=r[r.length-1];r[r.length-1]=this._previousLuminance,this._commands[this._commands.length-1].framebuffer=this._previousLuminance,this._previousLuminance=n},AutoExposure.prototype.execute=function(e,t){this._colorTexture=t;var i=this._commands;if(defined(i))for(var r=i.length,n=0;n<r;++n)i[n].execute(e)},AutoExposure.prototype.isDestroyed=function(){return!1},AutoExposure.prototype.destroy=function(){return destroyFramebuffers(this),destroyCommands(this),destroyObject(this)};var BingMapsStyle={AERIAL:"Aerial",AERIAL_WITH_LABELS:"AerialWithLabels",AERIAL_WITH_LABELS_ON_DEMAND:"AerialWithLabelsOnDemand",ROAD:"Road",ROAD_ON_DEMAND:"RoadOnDemand",CANVAS_DARK:"CanvasDark",CANVAS_LIGHT:"CanvasLight",CANVAS_GRAY:"CanvasGray",ORDNANCE_SURVEY:"OrdnanceSurvey",COLLINS_BART:"CollinsBart"},BingMapsStyle$1=Object.freeze(BingMapsStyle),emptyImage;function DiscardEmptyTileImagePolicy(e){}function BingMapsImageryProvider(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this._key=BingMapsApi.getKey(e.key),this._resource=Resource.createIfNeeded(e.url),this._resource.appendForwardSlash(),this._tileProtocol=e.tileProtocol,this._mapStyle=defaultValue(e.mapStyle,BingMapsStyle$1.AERIAL),this._culture=defaultValue(e.culture,""),this._tileDiscardPolicy=e.tileDiscardPolicy,defined(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new DiscardEmptyTileImagePolicy),this._proxy=e.proxy,this._credit=new Credit('<a href="http://www.bing.com"><img src="'+BingMapsImageryProvider.logoUrl+'" title="Bing Imagery"/></a>'),this.defaultGamma=1,this._tilingScheme=new WebMercatorTilingScheme({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:e.ellipsoid}),this._tileWidth=void 0,this._tileHeight=void 0,this._maximumLevel=void 0,this._imageUrlTemplate=void 0,this._imageUrlSubdomains=void 0,this._errorEvent=new Event,this._ready=!1,this._readyPromise=when.defer();var t=this._tileProtocol;defined(t)?0<t.length&&":"===t[t.length-1]&&(t=t.substr(0,t.length-1)):t="http:"===document.location.protocol?"http":"https";var d,i=this._resource.getDerivedResource({url:"REST/v1/Imagery/Metadata/"+this._mapStyle,queryParameters:{incl:"ImageryProviders",key:this._key,uriScheme:t}}),h=this;function r(e){if(1===e.resourceSets.length){var t=e.resourceSets[0].resources[0];h._tileWidth=t.imageWidth,h._tileHeight=t.imageHeight,h._maximumLevel=t.zoomMax-1,h._imageUrlSubdomains=t.imageUrlSubdomains,h._imageUrlTemplate=t.imageUrl;for(var i=h._attributionList=t.imageryProviders,r=0,n=(i=i||(h._attributionList=[])).length;r<n;++r){var a=i[r];if(a.credit instanceof Credit)break;a.credit=new Credit(a.attribution);for(var o=a.coverageAreas,s=0,l=a.coverageAreas.length;s<l;++s){var u=o[s],c=u.bbox;u.bbox=new Rectangle(CesiumMath.toRadians(c[1]),CesiumMath.toRadians(c[0]),CesiumMath.toRadians(c[3]),CesiumMath.toRadians(c[2]))}}h._ready=!0,h._readyPromise.resolve(!0),TileProviderError.handleSuccess(d)}else p()}function p(e){var t="An error occurred while accessing "+i.url+".";d=TileProviderError.handleError(d,h,h._errorEvent,t,void 0,void 0,void 0,a),h._readyPromise.reject(new RuntimeError(t))}var n=i.url;function a(){var e=i.fetchJsonp("jsonp");(BingMapsImageryProvider._metadataCache[n]=e).then(r).otherwise(p)}var o=BingMapsImageryProvider._metadataCache[n];defined(o)?o.then(r).otherwise(p):a()}DiscardEmptyTileImagePolicy.prototype.isReady=function(){return!0},DiscardEmptyTileImagePolicy.prototype.shouldDiscardImage=function(e){return DiscardEmptyTileImagePolicy.EMPTY_IMAGE===e},Object.defineProperties(DiscardEmptyTileImagePolicy,{EMPTY_IMAGE:{get:function(){return defined(emptyImage)||((emptyImage=new Image).src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="),emptyImage}}}),Object.defineProperties(BingMapsImageryProvider.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},key:{get:function(){return this._key}},mapStyle:{get:function(){return this._mapStyle}},culture:{get:function(){return this._culture}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!1}}});var rectangleScratch$5=new Rectangle;function buildImageResource$1(e,t,i,r,n){var a=e._imageUrlTemplate,o=e._imageUrlSubdomains,s=(t+i+r)%o.length;return e._resource.getDerivedResource({url:a,request:n,templateValues:{quadkey:BingMapsImageryProvider.tileXYToQuadKey(t,i,r),subdomain:o[s],culture:e._culture},queryParameters:{n:"z"}})}BingMapsImageryProvider.prototype.getTileCredits=function(e,t,i){var r=this._tilingScheme.tileXYToRectangle(e,t,i,rectangleScratch$5);return getRectangleAttribution(this._attributionList,i,r)},BingMapsImageryProvider.prototype.requestImage=function(e,t,i,r){var n=ImageryProvider.loadImage(this,buildImageResource$1(this,e,t,i,r));if(defined(n))return n.otherwise(function(e){return defined(e.blob)&&0===e.blob.size?DiscardEmptyTileImagePolicy.EMPTY_IMAGE:when.reject(e)})},BingMapsImageryProvider.prototype.pickFeatures=function(e,t,i,r,n){},BingMapsImageryProvider.tileXYToQuadKey=function(e,t,i){for(var r="",n=i;0<=n;--n){var a=1<<n,o=0;0!=(e&a)&&(o|=1),0!=(t&a)&&(o|=2),r+=o}return r},BingMapsImageryProvider.quadKeyToTileXY=function(e){for(var t=0,i=0,r=e.length-1,n=r;0<=n;--n){var a=1<<n,o=+e[r-n];0!=(1&o)&&(t|=a),0!=(2&o)&&(i|=a)}return{x:t,y:i,level:r}},BingMapsImageryProvider._logoUrl=void 0,Object.defineProperties(BingMapsImageryProvider,{logoUrl:{get:function(){return defined(BingMapsImageryProvider._logoUrl)||(BingMapsImageryProvider._logoUrl=buildModuleUrl("Assets/Images/bing_maps_credit.png")),BingMapsImageryProvider._logoUrl},set:function(e){BingMapsImageryProvider._logoUrl=e}}});var intersectionScratch$1=new Rectangle;function getRectangleAttribution(e,t,i){++t;for(var r=[],n=0,a=e.length;n<a;++n){for(var o=e[n],s=o.coverageAreas,l=!1,u=0,c=o.coverageAreas.length;!l&&u<c;++u){var d=s[u];if(t>=d.zoomMin&&t<=d.zoomMax)defined(Rectangle.intersection(i,d.bbox,intersectionScratch$1))&&(l=!0)}l&&r.push(o.credit)}return r}BingMapsImageryProvider._metadataCache={};var defaultDimensions=new Cartesian3(1,1,1);function BoxEmitter(e){e=defaultValue(e,defaultDimensions),this._dimensions=Cartesian3.clone(e)}Object.defineProperties(BoxEmitter.prototype,{dimensions:{get:function(){return this._dimensions},set:function(e){Cartesian3.clone(e,this._dimensions)}}});var scratchHalfDim=new Cartesian3;BoxEmitter.prototype.emit=function(e){var t=this._dimensions,i=Cartesian3.multiplyByScalar(t,.5,scratchHalfDim),r=CesiumMath.randomBetween(-i.x,i.x),n=CesiumMath.randomBetween(-i.y,i.y),a=CesiumMath.randomBetween(-i.z,i.z);e.position=Cartesian3.fromElements(r,n,a,e.position),e.velocity=Cartesian3.normalize(e.position,e.velocity)};var BrdfLutGeneratorFS="varying vec2 v_textureCoordinates;\nconst float M_PI = 3.141592653589793;\nfloat vdcRadicalInverse(int i)\n{\nfloat r;\nfloat base = 2.0;\nfloat value = 0.0;\nfloat invBase = 1.0 / base;\nfloat invBi = invBase;\nfor (int x = 0; x < 100; x++)\n{\nif (i <= 0)\n{\nbreak;\n}\nr = mod(float(i), base);\nvalue += r * invBi;\ninvBi *= invBase;\ni = int(float(i) * invBase);\n}\nreturn value;\n}\nvec2 hammersley2D(int i, int N)\n{\nreturn vec2(float(i) / float(N), vdcRadicalInverse(i));\n}\nvec3 importanceSampleGGX(vec2 xi, float roughness, vec3 N)\n{\nfloat a = roughness * roughness;\nfloat phi = 2.0 * M_PI * xi.x;\nfloat cosTheta = sqrt((1.0 - xi.y) / (1.0 + (a * a - 1.0) * xi.y));\nfloat sinTheta = sqrt(1.0 - cosTheta * cosTheta);\nvec3 H = vec3(sinTheta * cos(phi), sinTheta * sin(phi), cosTheta);\nvec3 upVector = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0);\nvec3 tangentX = normalize(cross(upVector, N));\nvec3 tangentY = cross(N, tangentX);\nreturn tangentX * H.x + tangentY * H.y + N * H.z;\n}\nfloat G1_Smith(float NdotV, float k)\n{\nreturn NdotV / (NdotV * (1.0 - k) + k);\n}\nfloat G_Smith(float roughness, float NdotV, float NdotL)\n{\nfloat k = roughness * roughness / 2.0;\nreturn G1_Smith(NdotV, k) * G1_Smith(NdotL, k);\n}\nvec2 integrateBrdf(float roughness, float NdotV)\n{\nvec3 V = vec3(sqrt(1.0 - NdotV * NdotV), 0.0, NdotV);\nfloat A = 0.0;\nfloat B = 0.0;\nconst int NumSamples = 1024;\nfor (int i = 0; i < NumSamples; i++)\n{\nvec2 xi = hammersley2D(i, NumSamples);\nvec3 H = importanceSampleGGX(xi, roughness, vec3(0.0, 0.0, 1.0));\nvec3 L = 2.0 * dot(V, H) * H - V;\nfloat NdotL = clamp(L.z, 0.0, 1.0);\nfloat NdotH = clamp(H.z, 0.0, 1.0);\nfloat VdotH = clamp(dot(V, H), 0.0, 1.0);\nif (NdotL > 0.0)\n{\nfloat G = G_Smith(roughness, NdotV, NdotL);\nfloat G_Vis = G * VdotH / (NdotH * NdotV);\nfloat Fc = pow(1.0 - VdotH, 5.0);\nA += (1.0 - Fc) * G_Vis;\nB += Fc * G_Vis;\n}\n}\nreturn vec2(A, B) / float(NumSamples);\n}\nvoid main()\n{\ngl_FragColor = vec4(integrateBrdf(v_textureCoordinates.y, v_textureCoordinates.x), 0.0, 1.0);\n}\n";function BrdfLutGenerator(){this._framebuffer=void 0,this._colorTexture=void 0,this._drawCommand=void 0}function createCommand$1(e,t){var i=e._framebuffer,r=t.createViewportQuadCommand(BrdfLutGeneratorFS,{framebuffer:i,renderState:RenderState.fromCache({viewport:new BoundingRectangle(0,0,256,256)})});e._drawCommand=r}function createFramebuffer$6(e,t){var i=new Texture({context:t,width:256,height:256,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:PixelDatatype$1.UNSIGNED_BYTE,sampler:Sampler.NEAREST}),r=new Framebuffer({context:t,colorTextures:[e._colorTexture=i],destroyAttachments:!1});e._framebuffer=r}Object.defineProperties(BrdfLutGenerator.prototype,{colorTexture:{get:function(){return this._colorTexture}}}),BrdfLutGenerator.prototype.update=function(e){if(!defined(this._colorTexture)){var t=e.context;createFramebuffer$6(this,t),createCommand$1(this,t),this._drawCommand.execute(t),this._framebuffer=this._framebuffer&&this._framebuffer.destroy(),this._drawCommand.shaderProgram=this._drawCommand.shaderProgram&&this._drawCommand.shaderProgram.destroy()}},BrdfLutGenerator.prototype.isDestroyed=function(){return!1},BrdfLutGenerator.prototype.destroy=function(){return this._colorTexture=this._colorTexture&&this._colorTexture.destroy(),destroyObject(this)};var CameraEventType={LEFT_DRAG:0,RIGHT_DRAG:1,MIDDLE_DRAG:2,WHEEL:3,PINCH:4},CameraEventType$1=Object.freeze(CameraEventType);function getKey(e,t){var i=e;return defined(t)&&(i+="+"+t),i}function clonePinchMovement(e,t){Cartesian2.clone(e.distance.startPosition,t.distance.startPosition),Cartesian2.clone(e.distance.endPosition,t.distance.endPosition),Cartesian2.clone(e.angleAndHeight.startPosition,t.angleAndHeight.startPosition),Cartesian2.clone(e.angleAndHeight.endPosition,t.angleAndHeight.endPosition)}function listenToPinch(t,e,n){var a=getKey(CameraEventType$1.PINCH,e),o=t._update,s=t._isDown,i=t._eventStartPosition,r=t._pressTime,l=t._releaseTime;o[a]=!0,s[a]=!1,i[a]=new Cartesian2;var u=t._movement[a];defined(u)||(u=t._movement[a]={}),u.distance={startPosition:new Cartesian2,endPosition:new Cartesian2},u.angleAndHeight={startPosition:new Cartesian2,endPosition:new Cartesian2},u.prevAngle=0,t._eventHandler.setInputAction(function(e){t._buttonsDown++,s[a]=!0,r[a]=new Date,Cartesian2.lerp(e.position1,e.position2,.5,i[a])},ScreenSpaceEventType$1.PINCH_START,e),t._eventHandler.setInputAction(function(){t._buttonsDown=Math.max(t._buttonsDown-1,0),s[a]=!1,l[a]=new Date},ScreenSpaceEventType$1.PINCH_END,e),t._eventHandler.setInputAction(function(e){if(s[a]){o[a]?(clonePinchMovement(e,u),o[a]=!1,u.prevAngle=u.angleAndHeight.startPosition.x):(Cartesian2.clone(e.distance.endPosition,u.distance.endPosition),Cartesian2.clone(e.angleAndHeight.endPosition,u.angleAndHeight.endPosition));for(var t=u.angleAndHeight.endPosition.x,i=u.prevAngle,r=2*Math.PI;t>=i+Math.PI;)t-=r;for(;t<i-Math.PI;)t+=r;u.angleAndHeight.endPosition.x=-t*n.clientWidth/12,u.angleAndHeight.startPosition.x=-i*n.clientWidth/12}},ScreenSpaceEventType$1.PINCH_MOVE,e)}function listenToWheel(e,t){var i=getKey(CameraEventType$1.WHEEL,t),r=e._update;r[i]=!0;var n=e._movement[i];defined(n)||(n=e._movement[i]={}),n.startPosition=new Cartesian2,n.endPosition=new Cartesian2,e._eventHandler.setInputAction(function(e){var t=15*CesiumMath.toRadians(e);r[i]?(Cartesian2.clone(Cartesian2.ZERO,n.startPosition),n.endPosition.x=0,n.endPosition.y=t,r[i]=!1):n.endPosition.y=n.endPosition.y+t},ScreenSpaceEventType$1.WHEEL,t)}function listenMouseButtonDownUp(t,e,i){var r=getKey(i,e),n=t._isDown,a=t._eventStartPosition,o=t._pressTime,s=t._releaseTime;n[r]=!1,a[r]=new Cartesian2;var l,u,c=t._lastMovement[r];defined(c)||(c=t._lastMovement[r]={startPosition:new Cartesian2,endPosition:new Cartesian2,valid:!1}),i===CameraEventType$1.LEFT_DRAG?(l=ScreenSpaceEventType$1.LEFT_DOWN,u=ScreenSpaceEventType$1.LEFT_UP):i===CameraEventType$1.RIGHT_DRAG?(l=ScreenSpaceEventType$1.RIGHT_DOWN,u=ScreenSpaceEventType$1.RIGHT_UP):i===CameraEventType$1.MIDDLE_DRAG&&(l=ScreenSpaceEventType$1.MIDDLE_DOWN,u=ScreenSpaceEventType$1.MIDDLE_UP),t._eventHandler.setInputAction(function(e){t._buttonsDown++,c.valid=!1,n[r]=!0,o[r]=new Date,Cartesian2.clone(e.position,a[r])},l,e),t._eventHandler.setInputAction(function(){t._buttonsDown=Math.max(t._buttonsDown-1,0),n[r]=!1,s[r]=new Date},u,e)}function cloneMouseMovement(e,t){Cartesian2.clone(e.startPosition,t.startPosition),Cartesian2.clone(e.endPosition,t.endPosition)}function listenMouseMove(n,a){var o=n._update,s=n._movement,l=n._lastMovement,u=n._isDown;for(var e in CameraEventType$1)if(CameraEventType$1.hasOwnProperty(e)){var t=CameraEventType$1[e];if(defined(t)){var i=getKey(t,a);o[i]=!0,defined(n._lastMovement[i])||(n._lastMovement[i]={startPosition:new Cartesian2,endPosition:new Cartesian2,valid:!1}),defined(n._movement[i])||(n._movement[i]={startPosition:new Cartesian2,endPosition:new Cartesian2})}}n._eventHandler.setInputAction(function(e){for(var t in CameraEventType$1)if(CameraEventType$1.hasOwnProperty(t)){var i=CameraEventType$1[t];if(defined(i)){var r=getKey(i,a);u[r]&&(o[r]?(cloneMouseMovement(s[r],l[r]),l[r].valid=!0,cloneMouseMovement(e,s[r]),o[r]=!1):Cartesian2.clone(e.endPosition,s[r].endPosition))}}Cartesian2.clone(e.endPosition,n._currentMousePosition)},ScreenSpaceEventType$1.MOUSE_MOVE,a)}function CameraEventAggregator(e){for(var t in this._eventHandler=new ScreenSpaceEventHandler(e),this._update={},this._movement={},this._lastMovement={},this._isDown={},this._eventStartPosition={},this._pressTime={},this._releaseTime={},this._buttonsDown=0,this._currentMousePosition=new Cartesian2,listenToWheel(this,void 0),listenToPinch(this,void 0,e),listenMouseButtonDownUp(this,void 0,CameraEventType$1.LEFT_DRAG),listenMouseButtonDownUp(this,void 0,CameraEventType$1.RIGHT_DRAG),listenMouseButtonDownUp(this,void 0,CameraEventType$1.MIDDLE_DRAG),listenMouseMove(this,void 0),KeyboardEventModifier$1)if(KeyboardEventModifier$1.hasOwnProperty(t)){var i=KeyboardEventModifier$1[t];defined(i)&&(listenToWheel(this,i),listenToPinch(this,i,e),listenMouseButtonDownUp(this,i,CameraEventType$1.LEFT_DRAG),listenMouseButtonDownUp(this,i,CameraEventType$1.RIGHT_DRAG),listenMouseButtonDownUp(this,i,CameraEventType$1.MIDDLE_DRAG),listenMouseMove(this,i))}}function Cesium3DTileContent(e,t,i,r,n){this.featurePropertiesDirty=!1}function Cesium3DTilePassState(e){this.pass=e.pass,this.commandList=e.commandList,this.camera=e.camera,this.cullingVolume=e.cullingVolume,this.ready=!1}function ConditionsExpression(e,t){this._conditionsExpression=clone(e,!0),this._conditions=e.conditions,this._runtimeConditions=void 0,setRuntime(this,t)}function Statement(e,t){this.condition=e,this.expression=t}function setRuntime(e,t){var i=[],r=e._conditions;if(defined(r)){for(var n=r.length,a=0;a<n;++a){var o=r[a],s=String(o[0]),l=String(o[1]);i.push(new Statement(new Expression(s,t),new Expression(l,t)))}e._runtimeConditions=i}}function Cesium3DTileStyle(e){var t;(this._style={},this._ready=!1,this._show=void 0,this._color=void 0,this._pointSize=void 0,this._pointOutlineColor=void 0,this._pointOutlineWidth=void 0,this._labelColor=void 0,this._labelOutlineColor=void 0,this._labelOutlineWidth=void 0,this._font=void 0,this._labelStyle=void 0,this._labelText=void 0,this._backgroundColor=void 0,this._backgroundPadding=void 0,this._backgroundEnabled=void 0,this._scaleByDistance=void 0,this._translucencyByDistance=void 0,this._distanceDisplayCondition=void 0,this._heightOffset=void 0,this._anchorLineEnabled=void 0,this._anchorLineColor=void 0,this._image=void 0,this._disableDepthTestDistance=void 0,this._horizontalOrigin=void 0,this._verticalOrigin=void 0,this._labelHorizontalOrigin=void 0,this._labelVerticalOrigin=void 0,this._meta=void 0,this._colorShaderFunction=void 0,this._showShaderFunction=void 0,this._pointSizeShaderFunction=void 0,this._colorShaderFunctionReady=!1,this._showShaderFunctionReady=!1,this._pointSizeShaderFunctionReady=!1,this._colorShaderTranslucent=!1,"string"==typeof e||e instanceof Resource)?t=Resource.createIfNeeded(e).fetchJson(e):t=when.resolve(e);var i=this;this._readyPromise=t.then(function(e){return setup(i,e),i})}function setup(e,t){t=defaultValue(clone(t,!0),e._style),e._style=t,e.show=t.show,e.color=t.color,e.pointSize=t.pointSize,e.pointOutlineColor=t.pointOutlineColor,e.pointOutlineWidth=t.pointOutlineWidth,e.labelColor=t.labelColor,e.labelOutlineColor=t.labelOutlineColor,e.labelOutlineWidth=t.labelOutlineWidth,e.labelStyle=t.labelStyle,e.font=t.font,e.labelText=t.labelText,e.backgroundColor=t.backgroundColor,e.backgroundPadding=t.backgroundPadding,e.backgroundEnabled=t.backgroundEnabled,e.scaleByDistance=t.scaleByDistance,e.translucencyByDistance=t.translucencyByDistance,e.distanceDisplayCondition=t.distanceDisplayCondition,e.heightOffset=t.heightOffset,e.anchorLineEnabled=t.anchorLineEnabled,e.anchorLineColor=t.anchorLineColor,e.image=t.image,e.disableDepthTestDistance=t.disableDepthTestDistance,e.horizontalOrigin=t.horizontalOrigin,e.verticalOrigin=t.verticalOrigin,e.labelHorizontalOrigin=t.labelHorizontalOrigin,e.labelVerticalOrigin=t.labelVerticalOrigin;var i={};if(defined(t.meta)){var r=t.defines,n=defaultValue(t.meta,defaultValue.EMPTY_OBJECT);for(var a in n)n.hasOwnProperty(a)&&(i[a]=new Expression(n[a],r))}e._meta=i,e._ready=!0}function getExpression(e,t){var i=defaultValue(e._style,defaultValue.EMPTY_OBJECT).defines;if(defined(t))return"boolean"==typeof t||"number"==typeof t?new Expression(String(t)):"string"==typeof t?new Expression(t,i):defined(t.conditions)?new ConditionsExpression(t,i):t}function getJsonFromExpression(e){if(defined(e))return defined(e.expression)?e.expression:defined(e.conditionsExpression)?clone(e.conditionsExpression,!0):e}function CircleEmitter(e){e=defaultValue(e,1),this._radius=defaultValue(e,1)}function computeFlyToLocationForRectangle(t,i){var r,n=i.terrainProvider,e=i.mapProjection,a=e.ellipsoid,o=i.camera.getRectangleCameraCoordinates(t);return r=i.mode===SceneMode$1.SCENE3D?a.cartesianToCartographic(o):e.unproject(o),defined(n)?n.readyPromise.then(function(){if(!defined(n.availability)||i.mode===SceneMode$1.SCENE2D)return r;var e=[Rectangle.center(t),Rectangle.southeast(t),Rectangle.southwest(t),Rectangle.northeast(t),Rectangle.northwest(t)];return computeFlyToLocationForRectangle._sampleTerrainMostDetailed(n,e).then(function(e){var t=e.reduce(function(e,t){return Math.max(t.height,e)},-Number.MAX_VALUE),i=r;return i.height+=t,i})}):when.resolve(r)}Object.defineProperties(CameraEventAggregator.prototype,{currentMousePosition:{get:function(){return this._currentMousePosition}},anyButtonDown:{get:function(){var e=!(this._update[getKey(CameraEventType$1.WHEEL)]&&this._update[getKey(CameraEventType$1.WHEEL,KeyboardEventModifier$1.SHIFT)]&&this._update[getKey(CameraEventType$1.WHEEL,KeyboardEventModifier$1.CTRL)]&&this._update[getKey(CameraEventType$1.WHEEL,KeyboardEventModifier$1.ALT)]);return 0<this._buttonsDown||e}}}),CameraEventAggregator.prototype.isMoving=function(e,t){var i=getKey(e,t);return!this._update[i]},CameraEventAggregator.prototype.getMovement=function(e,t){var i=getKey(e,t);return this._movement[i]},CameraEventAggregator.prototype.getLastMovement=function(e,t){var i=getKey(e,t),r=this._lastMovement[i];if(r.valid)return r},CameraEventAggregator.prototype.isButtonDown=function(e,t){var i=getKey(e,t);return this._isDown[i]},CameraEventAggregator.prototype.getStartMousePosition=function(e,t){if(e===CameraEventType$1.WHEEL)return this._currentMousePosition;var i=getKey(e,t);return this._eventStartPosition[i]},CameraEventAggregator.prototype.getButtonPressTime=function(e,t){var i=getKey(e,t);return this._pressTime[i]},CameraEventAggregator.prototype.getButtonReleaseTime=function(e,t){var i=getKey(e,t);return this._releaseTime[i]},CameraEventAggregator.prototype.reset=function(){for(var e in this._update)this._update.hasOwnProperty(e)&&(this._update[e]=!0)},CameraEventAggregator.prototype.isDestroyed=function(){return!1},CameraEventAggregator.prototype.destroy=function(){return this._eventHandler=this._eventHandler&&this._eventHandler.destroy(),destroyObject(this)},Object.defineProperties(Cesium3DTileContent.prototype,{featuresLength:{get:function(){DeveloperError.throwInstantiationError()}},pointsLength:{get:function(){DeveloperError.throwInstantiationError()}},trianglesLength:{get:function(){DeveloperError.throwInstantiationError()}},geometryByteLength:{get:function(){DeveloperError.throwInstantiationError()}},texturesByteLength:{get:function(){DeveloperError.throwInstantiationError()}},batchTableByteLength:{get:function(){DeveloperError.throwInstantiationError()}},innerContents:{get:function(){DeveloperError.throwInstantiationError()}},readyPromise:{get:function(){DeveloperError.throwInstantiationError()}},tileset:{get:function(){DeveloperError.throwInstantiationError()}},tile:{get:function(){DeveloperError.throwInstantiationError()}},url:{get:function(){DeveloperError.throwInstantiationError()}},batchTable:{get:function(){DeveloperError.throwInstantiationError()}}}),Cesium3DTileContent.prototype.hasProperty=function(e,t){DeveloperError.throwInstantiationError()},Cesium3DTileContent.prototype.getFeature=function(e){DeveloperError.throwInstantiationError()},Cesium3DTileContent.prototype.applyDebugSettings=function(e,t){DeveloperError.throwInstantiationError()},Cesium3DTileContent.prototype.applyStyle=function(e){DeveloperError.throwInstantiationError()},Cesium3DTileContent.prototype.update=function(e,t){DeveloperError.throwInstantiationError()},Cesium3DTileContent.prototype.isDestroyed=function(){DeveloperError.throwInstantiationError()},Cesium3DTileContent.prototype.destroy=function(){DeveloperError.throwInstantiationError()},Object.defineProperties(ConditionsExpression.prototype,{conditionsExpression:{get:function(){return this._conditionsExpression}}}),ConditionsExpression.prototype.evaluate=function(e,t){var i=this._runtimeConditions;if(defined(i))for(var r=i.length,n=0;n<r;++n){var a=i[n];if(a.condition.evaluate(e))return a.expression.evaluate(e,t)}},ConditionsExpression.prototype.evaluateColor=function(e,t){var i=this._runtimeConditions;if(defined(i))for(var r=i.length,n=0;n<r;++n){var a=i[n];if(a.condition.evaluate(e))return a.expression.evaluateColor(e,t)}},ConditionsExpression.prototype.getShaderFunction=function(e,t,i,r){var n=this._runtimeConditions;if(defined(n)&&0!==n.length){for(var a="",o=n.length,s=0;s<o;++s){var l=n[s];a+=" "+(0===s?"if":"else if")+" ("+l.condition.getShaderExpression(t,i)+") \n { \n return "+l.expression.getShaderExpression(t,i)+"; \n } \n"}return a=r+" "+e+"() \n{ \n"+a+" return "+r+"(1.0); \n} \n"}},Object.defineProperties(Cesium3DTileStyle.prototype,{style:{get:function(){return this._style}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise}},show:{get:function(){return this._show},set:function(e){this._show=getExpression(this,e),this._style.show=getJsonFromExpression(this._show),this._showShaderFunctionReady=!1}},color:{get:function(){return this._color},set:function(e){this._color=getExpression(this,e),this._style.color=getJsonFromExpression(this._color),this._colorShaderFunctionReady=!1}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=getExpression(this,e),this._style.pointSize=getJsonFromExpression(this._pointSize),this._pointSizeShaderFunctionReady=!1}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=getExpression(this,e),this._style.pointOutlineColor=getJsonFromExpression(this._pointOutlineColor)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=getExpression(this,e),this._style.pointOutlineWidth=getJsonFromExpression(this._pointOutlineWidth)}},labelColor:{get:function(){return this._labelColor},set:function(e){this._labelColor=getExpression(this,e),this._style.labelColor=getJsonFromExpression(this._labelColor)}},labelOutlineColor:{get:function(){return this._labelOutlineColor},set:function(e){this._labelOutlineColor=getExpression(this,e),this._style.labelOutlineColor=getJsonFromExpression(this._labelOutlineColor)}},labelOutlineWidth:{get:function(){return this._labelOutlineWidth},set:function(e){this._labelOutlineWidth=getExpression(this,e),this._style.labelOutlineWidth=getJsonFromExpression(this._labelOutlineWidth)}},font:{get:function(){return this._font},set:function(e){this._font=getExpression(this,e),this._style.font=getJsonFromExpression(this._font)}},labelStyle:{get:function(){return this._labelStyle},set:function(e){this._labelStyle=getExpression(this,e),this._style.labelStyle=getJsonFromExpression(this._labelStyle)}},labelText:{get:function(){return this._labelText},set:function(e){this._labelText=getExpression(this,e),this._style.labelText=getJsonFromExpression(this._labelText)}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){this._backgroundColor=getExpression(this,e),this._style.backgroundColor=getJsonFromExpression(this._backgroundColor)}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){this._backgroundPadding=getExpression(this,e),this._style.backgroundPadding=getJsonFromExpression(this._backgroundPadding)}},backgroundEnabled:{get:function(){return this._backgroundEnabled},set:function(e){this._backgroundEnabled=getExpression(this,e),this._style.backgroundEnabled=getJsonFromExpression(this._backgroundEnabled)}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){this._scaleByDistance=getExpression(this,e),this._style.scaleByDistance=getJsonFromExpression(this._scaleByDistance)}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){this._translucencyByDistance=getExpression(this,e),this._style.translucencyByDistance=getJsonFromExpression(this._translucencyByDistance)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=getExpression(this,e),this._style.distanceDisplayCondition=getJsonFromExpression(this._distanceDisplayCondition)}},heightOffset:{get:function(){return this._heightOffset},set:function(e){this._heightOffset=getExpression(this,e),this._style.heightOffset=getJsonFromExpression(this._heightOffset)}},anchorLineEnabled:{get:function(){return this._anchorLineEnabled},set:function(e){this._anchorLineEnabled=getExpression(this,e),this._style.anchorLineEnabled=getJsonFromExpression(this._anchorLineEnabled)}},anchorLineColor:{get:function(){return this._anchorLineColor},set:function(e){this._anchorLineColor=getExpression(this,e),this._style.anchorLineColor=getJsonFromExpression(this._anchorLineColor)}},image:{get:function(){return this._image},set:function(e){this._image=getExpression(this,e),this._style.image=getJsonFromExpression(this._image)}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance=getExpression(this,e),this._style.disableDepthTestDistance=getJsonFromExpression(this._disableDepthTestDistance)}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin=getExpression(this,e),this._style.horizontalOrigin=getJsonFromExpression(this._horizontalOrigin)}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin=getExpression(this,e),this._style.verticalOrigin=getJsonFromExpression(this._verticalOrigin)}},labelHorizontalOrigin:{get:function(){return this._labelHorizontalOrigin},set:function(e){this._labelHorizontalOrigin=getExpression(this,e),this._style.labelHorizontalOrigin=getJsonFromExpression(this._labelHorizontalOrigin)}},labelVerticalOrigin:{get:function(){return this._labelVerticalOrigin},set:function(e){this._labelVerticalOrigin=getExpression(this,e),this._style.labelVerticalOrigin=getJsonFromExpression(this._labelVerticalOrigin)}},meta:{get:function(){return this._meta},set:function(e){this._meta=e}}}),Cesium3DTileStyle.prototype.getColorShaderFunction=function(e,t,i){return this._colorShaderFunctionReady?i.translucent=this._colorShaderTranslucent:(this._colorShaderFunctionReady=!0,this._colorShaderFunction=defined(this.color)?this.color.getShaderFunction(e,t,i,"vec4"):void 0,this._colorShaderTranslucent=i.translucent),this._colorShaderFunction},Cesium3DTileStyle.prototype.getShowShaderFunction=function(e,t,i){return this._showShaderFunctionReady||(this._showShaderFunctionReady=!0,this._showShaderFunction=defined(this.show)?this.show.getShaderFunction(e,t,i,"bool"):void 0),this._showShaderFunction},Cesium3DTileStyle.prototype.getPointSizeShaderFunction=function(e,t,i){return this._pointSizeShaderFunctionReady||(this._pointSizeShaderFunctionReady=!0,this._pointSizeShaderFunction=defined(this.pointSize)?this.pointSize.getShaderFunction(e,t,i,"float"):void 0),this._pointSizeShaderFunction},Object.defineProperties(CircleEmitter.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}}),CircleEmitter.prototype.emit=function(e){var t=CesiumMath.randomBetween(0,CesiumMath.TWO_PI),i=CesiumMath.randomBetween(0,this._radius),r=i*Math.cos(t),n=i*Math.sin(t);e.position=Cartesian3.fromElements(r,n,0,e.position),e.velocity=Cartesian3.clone(Cartesian3.UNIT_Z,e.velocity)},computeFlyToLocationForRectangle._sampleTerrainMostDetailed=sampleTerrainMostDetailed;var defaultAngle=CesiumMath.toRadians(30);function ConeEmitter(e){this._angle=defaultValue(e,defaultAngle)}function createTangentSpaceDebugPrimitive(e){var t=[],i=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).geometry;defined(i.attributes)&&defined(i.primitiveType)||(i=i.constructor.createGeometry(i));var r=i.attributes,n=Matrix4.clone(defaultValue(e.modelMatrix,Matrix4.IDENTITY)),a=defaultValue(e.length,1e4);if(defined(r.normal)&&t.push(new GeometryInstance({geometry:GeometryPipeline.createLineSegmentsForVectors(i,"normal",a),attributes:{color:new ColorGeometryInstanceAttribute(1,0,0,1)},modelMatrix:n})),defined(r.tangent)&&t.push(new GeometryInstance({geometry:GeometryPipeline.createLineSegmentsForVectors(i,"tangent",a),attributes:{color:new ColorGeometryInstanceAttribute(0,1,0,1)},modelMatrix:n})),defined(r.bitangent)&&t.push(new GeometryInstance({geometry:GeometryPipeline.createLineSegmentsForVectors(i,"bitangent",a),attributes:{color:new ColorGeometryInstanceAttribute(0,0,1,1)},modelMatrix:n})),0<t.length)return new Primitive({asynchronous:!1,geometryInstances:t,appearance:new PerInstanceColorAppearance({flat:!0,translucent:!1})})}Object.defineProperties(ConeEmitter.prototype,{angle:{get:function(){return this._angle},set:function(e){this._angle=e}}}),ConeEmitter.prototype.emit=function(e){var t=Math.tan(this._angle),i=CesiumMath.randomBetween(0,CesiumMath.TWO_PI),r=CesiumMath.randomBetween(0,t),n=r*Math.cos(i),a=r*Math.sin(i);e.velocity=Cartesian3.fromElements(n,a,1,e.velocity),Cartesian3.normalize(e.velocity,e.velocity),e.position=Cartesian3.clone(Cartesian3.ZERO,e.position)};var templateRegex=/{[^}]+}/g,tags={x:xTag,y:yTag,z:zTag,s:sTag,reverseX:reverseXTag,reverseY:reverseYTag,reverseZ:reverseZTag,westDegrees:westDegreesTag,southDegrees:southDegreesTag,eastDegrees:eastDegreesTag,northDegrees:northDegreesTag,westProjected:westProjectedTag,southProjected:southProjectedTag,eastProjected:eastProjectedTag,northProjected:northProjectedTag,width:widthTag,height:heightTag},pickFeaturesTags=combine(tags,{i:iTag,j:jTag,reverseI:reverseITag,reverseJ:reverseJTag,longitudeDegrees:longitudeDegreesTag,latitudeDegrees:latitudeDegreesTag,longitudeProjected:longitudeProjectedTag,latitudeProjected:latitudeProjectedTag,format:formatTag});function UrlTemplateImageryProvider(e){this._errorEvent=new Event,this._resource=void 0,this._urlSchemeZeroPadding=void 0,this._pickFeaturesResource=void 0,this._tileWidth=void 0,this._tileHeight=void 0,this._maximumLevel=void 0,this._minimumLevel=void 0,this._tilingScheme=void 0,this._rectangle=void 0,this._tileDiscardPolicy=void 0,this._credit=void 0,this._hasAlphaChannel=void 0,this._readyPromise=void 0,this._tags=void 0,this._pickFeaturesTags=void 0,this.enablePickFeatures=!0,this.reinitialize(e)}Object.defineProperties(UrlTemplateImageryProvider.prototype,{url:{get:function(){return this._resource.url}},urlSchemeZeroPadding:{get:function(){return this._urlSchemeZeroPadding}},pickFeaturesUrl:{get:function(){return this._pickFeaturesResource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return defined(this._resource)}},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return this._hasAlphaChannel}}}),UrlTemplateImageryProvider.prototype.reinitialize=function(e){var s=this;s._readyPromise=when(e).then(function(e){var t=e.customTags,i=combine(tags,t),r=combine(pickFeaturesTags,t),n=Resource.createIfNeeded(e.url),a=Resource.createIfNeeded(e.pickFeaturesUrl);s.enablePickFeatures=defaultValue(e.enablePickFeatures,s.enablePickFeatures),s._urlSchemeZeroPadding=defaultValue(e.urlSchemeZeroPadding,s.urlSchemeZeroPadding),s._tileDiscardPolicy=e.tileDiscardPolicy,s._getFeatureInfoFormats=e.getFeatureInfoFormats,s._subdomains=e.subdomains,Array.isArray(s._subdomains)?s._subdomains=s._subdomains.slice():defined(s._subdomains)&&0<s._subdomains.length?s._subdomains=s._subdomains.split(""):s._subdomains=["a","b","c"],s._tileWidth=defaultValue(e.tileWidth,256),s._tileHeight=defaultValue(e.tileHeight,256),s._minimumLevel=defaultValue(e.minimumLevel,0),s._maximumLevel=e.maximumLevel,s._tilingScheme=defaultValue(e.tilingScheme,new WebMercatorTilingScheme({ellipsoid:e.ellipsoid})),s._rectangle=defaultValue(e.rectangle,s._tilingScheme.rectangle),s._rectangle=Rectangle.intersection(s._rectangle,s._tilingScheme.rectangle),s._hasAlphaChannel=defaultValue(e.hasAlphaChannel,!0);var o=e.credit;return"string"==typeof o&&(o=new Credit(o)),s._credit=o,s._resource=n,s._tags=i,s._pickFeaturesResource=a,s._pickFeaturesTags=r,!0})},UrlTemplateImageryProvider.prototype.getTileCredits=function(e,t,i){},UrlTemplateImageryProvider.prototype.requestImage=function(e,t,i,r){return ImageryProvider.loadImage(this,buildImageResource$2(this,e,t,i,r))},UrlTemplateImageryProvider.prototype.pickFeatures=function(r,n,a,o,s){if(this.enablePickFeatures&&defined(this._pickFeaturesResource)&&0!==this._getFeatureInfoFormats.length){var l=0,u=this;return function e(){if(l>=u._getFeatureInfoFormats.length)return when([]);var t=u._getFeatureInfoFormats[l],i=buildPickFeaturesResource(u,r,n,a,o,s,t.format);return++l,"json"===t.type?i.fetchJson().then(t.callback).otherwise(e):"xml"===t.type?i.fetchXML().then(t.callback).otherwise(e):"text"===t.type||"html"===t.type?i.fetchText().then(t.callback).otherwise(e):i.fetch({responseType:t.format}).then(function(e,t){return e.callback(t)}.bind(void 0,t)).otherwise(e)}()}};var degreesScratchComputed=!1,degreesScratch=new Rectangle,projectedScratchComputed=!1,projectedScratch=new Rectangle;function buildImageResource$2(i,r,n,a,e){projectedScratchComputed=degreesScratchComputed=!1;var t=i._resource,o=t.getUrlComponent(!0),s=i._tags,l={},u=o.match(templateRegex);return defined(u)&&u.forEach(function(e){var t=e.substring(1,e.length-1);defined(s[t])&&(l[t]=s[t](i,r,n,a))}),t.getDerivedResource({request:e,templateValues:l})}var ijScratchComputed=!1,ijScratch=new Cartesian2,longitudeLatitudeProjectedScratchComputed=!1;function buildPickFeaturesResource(i,r,n,a,o,s,l){longitudeLatitudeProjectedScratchComputed=ijScratchComputed=projectedScratchComputed=degreesScratchComputed=!1;var e=i._pickFeaturesResource,t=e.getUrlComponent(!0),u=i._pickFeaturesTags,c={},d=t.match(templateRegex);return defined(d)&&d.forEach(function(e){var t=e.substring(1,e.length-1);defined(u[t])&&(c[t]=u[t](i,r,n,a,o,s,l))}),e.getDerivedResource({templateValues:c})}function padWithZerosIfNecessary(e,t,i){if(e&&e.urlSchemeZeroPadding&&e.urlSchemeZeroPadding.hasOwnProperty(t)){var r=e.urlSchemeZeroPadding[t];if("string"==typeof r){var n=r.length;1<n&&(i=i.length>=n?i:new Array(n-i.toString().length+1).join("0")+i)}}return i}function xTag(e,t,i,r){return padWithZerosIfNecessary(e,"{x}",t)}function reverseXTag(e,t,i,r){var n=e.tilingScheme.getNumberOfXTilesAtLevel(r)-t-1;return padWithZerosIfNecessary(e,"{reverseX}",n)}function yTag(e,t,i,r){return padWithZerosIfNecessary(e,"{y}",i)}function reverseYTag(e,t,i,r){var n=e.tilingScheme.getNumberOfYTilesAtLevel(r)-i-1;return padWithZerosIfNecessary(e,"{reverseY}",n)}function reverseZTag(e,t,i,r){var n=e.maximumLevel;return padWithZerosIfNecessary(e,"{reverseZ}",defined(n)&&r<n?n-r-1:r)}function zTag(e,t,i,r){return padWithZerosIfNecessary(e,"{z}",r)}function sTag(e,t,i,r){var n=(t+i+r)%e._subdomains.length;return e._subdomains[n]}function computeDegrees(e,t,i,r){degreesScratchComputed||(e.tilingScheme.tileXYToRectangle(t,i,r,degreesScratch),degreesScratch.west=CesiumMath.toDegrees(degreesScratch.west),degreesScratch.south=CesiumMath.toDegrees(degreesScratch.south),degreesScratch.east=CesiumMath.toDegrees(degreesScratch.east),degreesScratch.north=CesiumMath.toDegrees(degreesScratch.north),degreesScratchComputed=!0)}function westDegreesTag(e,t,i,r){return computeDegrees(e,t,i,r),degreesScratch.west}function southDegreesTag(e,t,i,r){return computeDegrees(e,t,i,r),degreesScratch.south}function eastDegreesTag(e,t,i,r){return computeDegrees(e,t,i,r),degreesScratch.east}function northDegreesTag(e,t,i,r){return computeDegrees(e,t,i,r),degreesScratch.north}function computeProjected(e,t,i,r){projectedScratchComputed||(e.tilingScheme.tileXYToNativeRectangle(t,i,r,projectedScratch),projectedScratchComputed=!0)}function westProjectedTag(e,t,i,r){return computeProjected(e,t,i,r),projectedScratch.west}function southProjectedTag(e,t,i,r){return computeProjected(e,t,i,r),projectedScratch.south}function eastProjectedTag(e,t,i,r){return computeProjected(e,t,i,r),projectedScratch.east}function northProjectedTag(e,t,i,r){return computeProjected(e,t,i,r),projectedScratch.north}function widthTag(e,t,i,r){return e.tileWidth}function heightTag(e,t,i,r){return e.tileHeight}function iTag(e,t,i,r,n,a,o){return computeIJ(e,t,i,r,n,a),ijScratch.x}function jTag(e,t,i,r,n,a,o){return computeIJ(e,t,i,r,n,a),ijScratch.y}function reverseITag(e,t,i,r,n,a,o){return computeIJ(e,t,i,r,n,a),e.tileWidth-ijScratch.x-1}function reverseJTag(e,t,i,r,n,a,o){return computeIJ(e,t,i,r,n,a),e.tileHeight-ijScratch.y-1}var rectangleScratch$6=new Rectangle,longitudeLatitudeProjectedScratch=new Cartesian3;function computeIJ(e,t,i,r,n,a,o){if(!ijScratchComputed){computeLongitudeLatitudeProjected(e,t,i,r,n,a);var s=longitudeLatitudeProjectedScratch,l=e.tilingScheme.tileXYToNativeRectangle(t,i,r,rectangleScratch$6);ijScratch.x=e.tileWidth*(s.x-l.west)/l.width|0,ijScratch.y=e.tileHeight*(l.north-s.y)/l.height|0,ijScratchComputed=!0}}function longitudeDegreesTag(e,t,i,r,n,a,o){return CesiumMath.toDegrees(n)}function latitudeDegreesTag(e,t,i,r,n,a,o){return CesiumMath.toDegrees(a)}function longitudeProjectedTag(e,t,i,r,n,a,o){return computeLongitudeLatitudeProjected(e,t,i,r,n,a),longitudeLatitudeProjectedScratch.x}function latitudeProjectedTag(e,t,i,r,n,a,o){return computeLongitudeLatitudeProjected(e,t,i,r,n,a),longitudeLatitudeProjectedScratch.y}var cartographicScratch$3=new Cartographic;function computeLongitudeLatitudeProjected(e,t,i,r,n,a,o){if(!longitudeLatitudeProjectedScratchComputed){if(e.tilingScheme.projection instanceof GeographicProjection)longitudeLatitudeProjectedScratch.x=CesiumMath.toDegrees(n),longitudeLatitudeProjectedScratch.y=CesiumMath.toDegrees(a);else{var s=cartographicScratch$3;s.longitude=n,s.latitude=a,e.tilingScheme.projection.project(s,longitudeLatitudeProjectedScratch)}longitudeLatitudeProjectedScratchComputed=!0}}function formatTag(e,t,i,r,n,a,o){return o}function TileMapServiceImageryProvider(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT);var t,i=when.defer();UrlTemplateImageryProvider.call(this,i.promise),this._tmsResource=void 0,this._xmlResource=void 0,this._options=e,this._deferred=i,this._metadataError=void 0,this._metadataSuccess=this._metadataSuccess.bind(this),this._metadataFailure=this._metadataFailure.bind(this),this._requestMetadata=this._requestMetadata.bind(this);var r=this;when(e.url).then(function(e){(t=Resource.createIfNeeded(e)).appendForwardSlash(),r._tmsResource=t,r._xmlResource=t.getDerivedResource({url:"tilemapresource.xml"}),r._requestMetadata()}).otherwise(function(e){i.reject(e)})}function confineRectangleToTilingScheme(e,t){return e.west<t.rectangle.west&&(e.west=t.rectangle.west),e.east>t.rectangle.east&&(e.east=t.rectangle.east),e.south<t.rectangle.south&&(e.south=t.rectangle.south),e.north>t.rectangle.north&&(e.north=t.rectangle.north),e}function calculateSafeMinimumDetailLevel(e,t,i){var r=e.positionToTileXY(Rectangle.southwest(t),i),n=e.positionToTileXY(Rectangle.northeast(t),i);return 4<(Math.abs(n.x-r.x)+1)*(Math.abs(n.y-r.y)+1)?0:i}function GoogleEarthEnterpriseMapsProvider(a){var e=(a=defaultValue(a,{})).url,t=defaultValue(a.path,"/default_map"),i=Resource.createIfNeeded(e).getDerivedResource({url:"/"===t[0]?t.substring(1):t});i.appendForwardSlash(),this._resource=i,this._url=e,this._path=t,this._tileDiscardPolicy=a.tileDiscardPolicy,this._channel=a.channel,this._requestType="ImageryMaps",this._credit=new Credit('<a href="http://www.google.com/enterprise/mapsearth/products/earthenterprise.html"><img src="'+GoogleEarthEnterpriseMapsProvider.logoUrl+'" title="Google Imagery"/></a>'),this.defaultGamma=1.9,this._tilingScheme=void 0,this._version=void 0,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=a.maximumLevel,this._errorEvent=new Event,this._ready=!1,this._readyPromise=when.defer();var o,r=i.getDerivedResource({url:"query",queryParameters:{request:"Json",vars:"geeServerDefs",is2d:"t"}}),s=this;function n(t){var i,e,r;try{i=JSON.parse(t)}catch(e){i=JSON.parse(t.replace(/([\[\{,])[\n\r ]*([A-Za-z0-9]+)[\n\r ]*:/g,'$1"$2":'))}for(var n=0;n<i.layers.length;n++)if(i.layers[n].id===s._channel){e=i.layers[n];break}if(!defined(e))throw r="Could not find layer with channel (id) of "+s._channel+".",o=TileProviderError.handleError(o,s,s._errorEvent,r,void 0,void 0,void 0,u),new RuntimeError(r);if(!defined(e.version))throw r="Could not find a version in channel (id) "+s._channel+".",o=TileProviderError.handleError(o,s,s._errorEvent,r,void 0,void 0,void 0,u),new RuntimeError(r);if(s._version=e.version,defined(i.projection)&&"flat"===i.projection)s._tilingScheme=new GeographicTilingScheme({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new Rectangle(-Math.PI,-Math.PI,Math.PI,Math.PI),ellipsoid:a.ellipsoid});else{if(defined(i.projection)&&"mercator"!==i.projection)throw r="Unsupported projection "+i.projection+".",o=TileProviderError.handleError(o,s,s._errorEvent,r,void 0,void 0,void 0,u),new RuntimeError(r);s._tilingScheme=new WebMercatorTilingScheme({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:a.ellipsoid})}s._ready=!0,s._readyPromise.resolve(!0),TileProviderError.handleSuccess(o)}function l(e){var t="An error occurred while accessing "+r.url+".";o=TileProviderError.handleError(o,s,s._errorEvent,t,void 0,void 0,void 0,u),s._readyPromise.reject(new RuntimeError(t))}function u(){when(r.fetchText(),n,l)}u()}defined(Object.create)&&(TileMapServiceImageryProvider.prototype=Object.create(UrlTemplateImageryProvider.prototype),TileMapServiceImageryProvider.prototype.constructor=TileMapServiceImageryProvider),TileMapServiceImageryProvider.prototype._requestMetadata=function(){this._xmlResource.fetchXML().then(this._metadataSuccess).otherwise(this._metadataFailure)},TileMapServiceImageryProvider.prototype._metadataSuccess=function(e){for(var t,i,r,n,a=/tileformat/i,o=/tileset/i,s=/tilesets/i,l=/boundingbox/i,u=[],c=this._xmlResource,d=this._metadataError,h=this._deferred,p=this._requestMetadata,f=e.childNodes[0].childNodes,m=0;m<f.length;m++)if(a.test(f.item(m).nodeName))t=f.item(m);else if(s.test(f.item(m).nodeName)){r=f.item(m);for(var g=f.item(m).childNodes,y=0;y<g.length;y++)o.test(g.item(y).nodeName)&&u.push(g.item(y))}else l.test(f.item(m).nodeName)&&(i=f.item(m));if(!defined(r)||!defined(i))return n="Unable to find expected tilesets or bbox attributes in "+c.url+".",(d=TileProviderError.handleError(d,this,this.errorEvent,n,void 0,void 0,void 0,p)).retry||h.reject(new RuntimeError(n)),void(this._metadataError=d);var v=this._options,_=defaultValue(v.fileExtension,t.getAttribute("extension")),C=defaultValue(v.tileWidth,parseInt(t.getAttribute("width"),10)),x=defaultValue(v.tileHeight,parseInt(t.getAttribute("height"),10)),b=defaultValue(v.minimumLevel,parseInt(u[0].getAttribute("order"),10)),A=defaultValue(v.maximumLevel,parseInt(u[u.length-1].getAttribute("order"),10)),S=r.getAttribute("profile"),w=v.tilingScheme;if(!defined(w))if("geodetic"===S||"global-geodetic"===S)w=new GeographicTilingScheme({ellipsoid:v.ellipsoid});else{if("mercator"!==S&&"global-mercator"!==S)return n=c.url+"specifies an unsupported profile attribute, "+S+".",(d=TileProviderError.handleError(d,this,this.errorEvent,n,void 0,void 0,void 0,p)).retry||h.reject(new RuntimeError(n)),void(this._metadataError=d);w=new WebMercatorTilingScheme({ellipsoid:v.ellipsoid})}var E=Rectangle.clone(v.rectangle);if(!defined(E)){var T,P,M,D;D=defaultValue(v.flipXY,!1)?(M=new Cartesian2(parseFloat(i.getAttribute("miny")),parseFloat(i.getAttribute("minx"))),new Cartesian2(parseFloat(i.getAttribute("maxy")),parseFloat(i.getAttribute("maxx")))):(M=new Cartesian2(parseFloat(i.getAttribute("minx")),parseFloat(i.getAttribute("miny"))),new Cartesian2(parseFloat(i.getAttribute("maxx")),parseFloat(i.getAttribute("maxy"))));var I="geodetic"===S||"mercator"===S;if(w.projection instanceof GeographicProjection||I)T=Cartographic.fromDegrees(M.x,M.y),P=Cartographic.fromDegrees(D.x,D.y);else{var O=w.projection;T=O.unproject(M),P=O.unproject(D)}E=new Rectangle(T.longitude,T.latitude,P.longitude,P.latitude)}b=calculateSafeMinimumDetailLevel(w,E=confineRectangleToTilingScheme(E,w),b);var R=this._tmsResource.getDerivedResource({url:"{z}/{x}/{reverseY}."+_});h.resolve({url:R,tilingScheme:w,rectangle:E,tileWidth:C,tileHeight:x,minimumLevel:b,maximumLevel:A,tileDiscardPolicy:v.tileDiscardPolicy,credit:v.credit})},TileMapServiceImageryProvider.prototype._metadataFailure=function(e){var t=this._options,i=defaultValue(t.fileExtension,"png"),r=defaultValue(t.tileWidth,256),n=defaultValue(t.tileHeight,256),a=t.maximumLevel,o=defined(t.tilingScheme)?t.tilingScheme:new WebMercatorTilingScheme({ellipsoid:t.ellipsoid}),s=defaultValue(t.rectangle,o.rectangle),l=calculateSafeMinimumDetailLevel(o,s=confineRectangleToTilingScheme(s,o),t.maximumLevel),u=this._tmsResource.getDerivedResource({url:"{z}/{x}/{reverseY}."+i});this._deferred.resolve({url:u,tilingScheme:o,rectangle:s,tileWidth:r,tileHeight:n,minimumLevel:l,maximumLevel:a,tileDiscardPolicy:t.tileDiscardPolicy,credit:t.credit})},Object.defineProperties(GoogleEarthEnterpriseMapsProvider.prototype,{url:{get:function(){return this._url}},path:{get:function(){return this._path}},proxy:{get:function(){return this._resource.proxy}},channel:{get:function(){return this._channel}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},version:{get:function(){return this._version}},requestType:{get:function(){return this._requestType}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}}),GoogleEarthEnterpriseMapsProvider.prototype.getTileCredits=function(e,t,i){},GoogleEarthEnterpriseMapsProvider.prototype.requestImage=function(e,t,i,r){var n=this._resource.getDerivedResource({url:"query",request:r,queryParameters:{request:this._requestType,channel:this._channel,version:this._version,x:e,y:t,z:i+1}});return ImageryProvider.loadImage(this,n)},GoogleEarthEnterpriseMapsProvider.prototype.pickFeatures=function(e,t,i,r,n){},GoogleEarthEnterpriseMapsProvider._logoUrl=void 0,Object.defineProperties(GoogleEarthEnterpriseMapsProvider,{logoUrl:{get:function(){return defined(GoogleEarthEnterpriseMapsProvider._logoUrl)||(GoogleEarthEnterpriseMapsProvider._logoUrl=buildModuleUrl("Assets/Images/google_earth_credit.png")),GoogleEarthEnterpriseMapsProvider._logoUrl},set:function(e){GoogleEarthEnterpriseMapsProvider._logoUrl=e}}});var trailingSlashRegex=/\/$/,defaultCredit=new Credit('© <a href="https://www.mapbox.com/about/maps/">Mapbox</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/">Improve this map</a></strong>');function MapboxImageryProvider(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).mapId,i=Resource.createIfNeeded(defaultValue(e.url,"https://{s}.tiles.mapbox.com/v4/")),r=MapboxApi.getAccessToken(e.accessToken);this._mapId=t,this._accessToken=r,this._accessTokenErrorCredit=Credit.clone(MapboxApi.getErrorCredit(e.accessToken));var n=defaultValue(e.format,"png");/\./.test(n)||(n="."+n),this._format=n;var a,o=i.getUrlComponent();trailingSlashRegex.test(o)||(o+="/"),o+=t+"/{z}/{x}/{y}"+this._format,i.url=o,i.setQueryParameters({access_token:r}),defined(e.credit)?"string"==typeof(a=e.credit)&&(a=new Credit(a)):a=defaultCredit,this._resource=i,this._imageryProvider=new UrlTemplateImageryProvider({url:i,credit:a,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}function SingleTileImageryProvider(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT);var i=Resource.createIfNeeded(e.url),t=new GeographicTilingScheme({rectangle:defaultValue(e.rectangle,Rectangle.MAX_VALUE),numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});this._tilingScheme=t,this._resource=i,this._image=void 0,this._texture=void 0,this._tileWidth=0,this._tileHeight=0,this._errorEvent=new Event,this._ready=!1,this._readyPromise=when.defer();var r=e.credit;"string"==typeof r&&(r=new Credit(r)),this._credit=r;var n,a=this;function o(e){a._image=e,a._tileWidth=e.width,a._tileHeight=e.height,a._ready=!0,a._readyPromise.resolve(!0),TileProviderError.handleSuccess(a._errorEvent)}function s(e){var t="Failed to load image "+i.url+".";n=TileProviderError.handleError(n,a,a._errorEvent,t,0,0,0,l,e),a._readyPromise.reject(new RuntimeError(t))}function l(){ImageryProvider.loadImage(null,i).then(o).otherwise(s)}l()}function GetFeatureInfoFormat(e,t,i){this.type=e,defined(t)||("json"===e?t="application/json":"xml"===e?t="text/xml":"html"===e?t="text/html":"text"===e&&(t="text/plain")),this.format=t,defined(i)||("json"===e?i=geoJsonToFeatureInfo:"xml"===e?i=xmlToFeatureInfo:"html"===e?i=textToFeatureInfo:"text"===e&&(i=textToFeatureInfo)),this.callback=i}function geoJsonToFeatureInfo(e){for(var t=[],i=e.features,r=0;r<i.length;++r){var n=i[r],a=new ImageryLayerFeatureInfo;if(a.data=n,a.properties=n.properties,a.configureNameFromProperties(n.properties),a.configureDescriptionFromProperties(n.properties),defined(n.geometry)&&"Point"===n.geometry.type){var o=n.geometry.coordinates[0],s=n.geometry.coordinates[1];a.position=Cartographic.fromDegrees(o,s)}t.push(a)}return t}Object.defineProperties(MapboxImageryProvider.prototype,{url:{get:function(){return this._imageryProvider.url}},ready:{get:function(){return this._imageryProvider.ready}},readyPromise:{get:function(){return this._imageryProvider.readyPromise}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._imageryProvider.errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},proxy:{get:function(){return this._imageryProvider.proxy}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}}}),MapboxImageryProvider.prototype.getTileCredits=function(e,t,i){if(defined(this._accessTokenErrorCredit))return[this._accessTokenErrorCredit]},MapboxImageryProvider.prototype.requestImage=function(e,t,i,r){return this._imageryProvider.requestImage(e,t,i,r)},MapboxImageryProvider.prototype.pickFeatures=function(e,t,i,r,n){return this._imageryProvider.pickFeatures(e,t,i,r,n)},MapboxImageryProvider._defaultCredit=defaultCredit,Object.defineProperties(SingleTileImageryProvider.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return 0}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}}),SingleTileImageryProvider.prototype.getTileCredits=function(e,t,i){},SingleTileImageryProvider.prototype.requestImage=function(e,t,i,r){return this._image},SingleTileImageryProvider.prototype.pickFeatures=function(e,t,i,r,n){};var mapInfoMxpNamespace="http://www.mapinfo.com/mxp",esriWmsNamespace="http://www.esri.com/wms",wfsNamespace="http://www.opengis.net/wfs",gmlNamespace="http://www.opengis.net/gml";function xmlToFeatureInfo(e){var t=e.documentElement;if("MultiFeatureCollection"===t.localName&&t.namespaceURI===mapInfoMxpNamespace)return mapInfoXmlToFeatureInfo(e);if("FeatureInfoResponse"===t.localName&&t.namespaceURI===esriWmsNamespace)return esriXmlToFeatureInfo(e);if("FeatureCollection"===t.localName&&t.namespaceURI===wfsNamespace)return gmlToFeatureInfo(e);if("ServiceExceptionReport"===t.localName)throw new RuntimeError((new XMLSerializer).serializeToString(t));return"msGMLOutput"===t.localName?msGmlToFeatureInfo(e):unknownXmlToFeatureInfo(e)}function mapInfoXmlToFeatureInfo(e){for(var t=[],i=e.documentElement.getElementsByTagNameNS(mapInfoMxpNamespace,"Feature"),r=0;r<i.length;++r){for(var n=i[r],a={},o=n.getElementsByTagNameNS(mapInfoMxpNamespace,"Val"),s=0;s<o.length;++s){var l=o[s];if(l.hasAttribute("ref")){var u=l.getAttribute("ref"),c=l.textContent.trim();a[u]=c}}var d=new ImageryLayerFeatureInfo;d.data=n,d.properties=a,d.configureNameFromProperties(a),d.configureDescriptionFromProperties(a),t.push(d)}return t}function esriXmlToFeatureInfo(e){var t,i=e.documentElement,r=[],n=i.getElementsByTagNameNS("*","FIELDS");if(0<n.length)for(var a=0;a<n.length;++a){var o=n[a];t={};for(var s=o.attributes,l=0;l<s.length;++l){var u=s[l];t[u.name]=u.value}r.push(imageryLayerFeatureInfoFromDataAndProperties(o,t))}else for(var c=i.getElementsByTagNameNS("*","FeatureInfo"),d=0;d<c.length;++d){var h=c[d];t={};for(var p=h.childNodes,f=0;f<p.length;++f){var m=p[f];m.nodeType===Node.ELEMENT_NODE&&(t[m.localName]=m.textContent)}r.push(imageryLayerFeatureInfoFromDataAndProperties(h,t))}return r}function gmlToFeatureInfo(e){for(var t=[],i=e.documentElement.getElementsByTagNameNS(gmlNamespace,"featureMember"),r=0;r<i.length;++r){var n=i[r],a={};getGmlPropertiesRecursively(n,a),t.push(imageryLayerFeatureInfoFromDataAndProperties(n,a))}return t}function msGmlToFeatureInfo(e){for(var t,i=[],r=e.documentElement.childNodes,n=0;n<r.length;n++)if(r[n].nodeType===Node.ELEMENT_NODE){t=r[n];break}if(!defined(t))throw new RuntimeError("Unable to find first child of the feature info xml document");for(var a=t.childNodes,o=0;o<a.length;++o){var s=a[o];if(s.nodeType===Node.ELEMENT_NODE){var l={};getGmlPropertiesRecursively(s,l),i.push(imageryLayerFeatureInfoFromDataAndProperties(s,l))}}return i}function getGmlPropertiesRecursively(e,t){for(var i=!0,r=0;r<e.childNodes.length;++r){var n=e.childNodes[r];n.nodeType===Node.ELEMENT_NODE&&(i=!1),"Point"!==n.localName&&"LineString"!==n.localName&&"Polygon"!==n.localName&&"boundedBy"!==n.localName&&n.hasChildNodes()&&getGmlPropertiesRecursively(n,t)&&(t[n.localName]=n.textContent)}return i}function imageryLayerFeatureInfoFromDataAndProperties(e,t){var i=new ImageryLayerFeatureInfo;return i.data=e,i.properties=t,i.configureNameFromProperties(t),i.configureDescriptionFromProperties(t),i}function unknownXmlToFeatureInfo(e){var t=(new XMLSerializer).serializeToString(e),i=document.createElement("div"),r=document.createElement("pre");r.textContent=t,i.appendChild(r);var n=new ImageryLayerFeatureInfo;return n.data=e,n.description=i.innerHTML,[n]}var emptyBodyRegex=/<body>\s*<\/body>/im,wmsServiceExceptionReportRegex=/<ServiceExceptionReport([\s\S]*)<\/ServiceExceptionReport>/im,titleRegex=/<title>([\s\S]*)<\/title>/im;function textToFeatureInfo(e){if(!emptyBodyRegex.test(e)&&!wmsServiceExceptionReportRegex.test(e)){var t,i=titleRegex.exec(e);i&&1<i.length&&(t=i[1]);var r=new ImageryLayerFeatureInfo;return r.name=t,r.description=e,r.data=e,[r]}}function TimeDynamicImagery(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this._tileCache={},this._tilesRequestedForInterval=[];var t=this._clock=e.clock;this._times=e.times,this._requestImageFunction=e.requestImageFunction,this._reloadFunction=e.reloadFunction,this._currentIntervalIndex=-1,t.onTick.addEventListener(this._clockOnTick,this),this._clockOnTick(t)}function getKey$1(e,t,i){return e+"-"+t+"-"+i}function getKeyElements(e){var t=e.split("-");if(3===t.length)return{x:Number(t[0]),y:Number(t[1]),level:Number(t[2])}}function getApproachingInterval(e){var t=e._times;if(defined(t)){var i=e._clock,r=i.currentTime,n=i.canAnimate&&i.shouldAnimate,a=i.multiplier;if(n||0===a){var o,s=t.indexOf(r);if(!(s<0)){var l=t.get(s);return 0<a?(o=JulianDate.secondsDifference(l.stop,r),++s):(o=JulianDate.secondsDifference(l.start,r),--s),o/=a,0<=s&&o<=5?t.get(s):void 0}}}}function addToCache(e,t,i){var r=e._times.indexOf(i.start),n=e._tileCache,a=n[r];defined(a)||(a=n[r]={});var o=t.key;if(defined(a[o]))return!0;var s=getKeyElements(o),l=new Request({throttle:!0,throttleByServer:!0,type:RequestType$1.IMAGERY,priorityFunction:t.priorityFunction}),u=e._requestImageFunction(s.x,s.y,s.level,l,i);return!!defined(u)&&(a[o]={promise:u,request:l},!0)}function WebMapServiceImageryProvider(e){if(defined((e=defaultValue(e,defaultValue.EMPTY_OBJECT)).times)&&!defined(e.clock))throw new DeveloperError("options.times was specified, so options.clock is required.");var t=Resource.createIfNeeded(e.url),i=t.clone();t.setQueryParameters(WebMapServiceImageryProvider.DefaultParameters,!0),i.setQueryParameters(WebMapServiceImageryProvider.GetFeatureInfoDefaultParameters,!0),defined(e.parameters)&&t.setQueryParameters(objectToLowercase(e.parameters)),defined(e.getFeatureInfoParameters)&&i.setQueryParameters(objectToLowercase(e.getFeatureInfoParameters));var a=this;this._reload=void 0,defined(e.times)&&(this._timeDynamicImagery=new TimeDynamicImagery({clock:e.clock,times:e.times,requestImageFunction:function(e,t,i,r,n){return requestImage(a,e,t,i,r,n)},reloadFunction:function(){defined(a._reload)&&a._reload()}}));var r={};r.layers=e.layers,r.bbox="{westProjected},{southProjected},{eastProjected},{northProjected}",r.width="{width}",r.height="{height}",1.3<=parseFloat(t.queryParameters.version)?r.crs=defaultValue(e.crs,e.tilingScheme&&e.tilingScheme.projection instanceof WebMercatorProjection?"EPSG:3857":"CRS:84"):r.srs=defaultValue(e.srs,e.tilingScheme&&e.tilingScheme.projection instanceof WebMercatorProjection?"EPSG:3857":"EPSG:4326"),t.setQueryParameters(r,!0),i.setQueryParameters(r,!0);var n={query_layers:e.layers,x:"{i}",y:"{j}",info_format:"{format}"};i.setQueryParameters(n,!0),this._resource=t,this._pickFeaturesResource=i,this._layers=e.layers,this._tileProvider=new UrlTemplateImageryProvider({url:t,pickFeaturesUrl:i,tilingScheme:defaultValue(e.tilingScheme,new GeographicTilingScheme({ellipsoid:e.ellipsoid})),rectangle:e.rectangle,tileWidth:e.tileWidth,tileHeight:e.tileHeight,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,subdomains:e.subdomains,tileDiscardPolicy:e.tileDiscardPolicy,credit:e.credit,getFeatureInfoFormats:defaultValue(e.getFeatureInfoFormats,WebMapServiceImageryProvider.DefaultGetFeatureInfoFormats),enablePickFeatures:e.enablePickFeatures})}function requestImage(e,t,i,r,n,a){var o=defined(a)?a.data:void 0,s=e._tileProvider;return defined(o)&&s._resource.setQueryParameters(o),s.requestImage(t,i,r,n)}function pickFeatures(e,t,i,r,n,a,o){var s=defined(o)?o.data:void 0,l=e._tileProvider;return defined(s)&&l._pickFeaturesResource.setQueryParameters(s),l.pickFeatures(t,i,r,n,a)}function objectToLowercase(e){var t={};for(var i in e)e.hasOwnProperty(i)&&(t[i.toLowerCase()]=e[i]);return t}Object.defineProperties(TimeDynamicImagery.prototype,{clock:{get:function(){return this._clock},set:function(e){this._clock!==e&&(this._clock=e,this._clockOnTick(e),this._reloadFunction())}},times:{get:function(){return this._times},set:function(e){this._times!==e&&(this._times=e,this._clockOnTick(this._clock),this._reloadFunction())}},currentInterval:{get:function(){return this._times.get(this._currentIntervalIndex)}}}),TimeDynamicImagery.prototype.getFromCache=function(e,t,i,r){var n,a=getKey$1(e,t,i),o=this._tileCache[this._currentIntervalIndex];if(defined(o)&&defined(o[a])){var s=o[a];n=s.promise.otherwise(function(e){throw r.state=s.request.state,e}),delete o[a]}return n},TimeDynamicImagery.prototype.checkApproachingInterval=function(e,t,i,r){var n=getKey$1(e,t,i),a=this._tilesRequestedForInterval,o=getApproachingInterval(this),s={key:n,priorityFunction:r.priorityFunction};defined(o)&&addToCache(this,s,o)||a.push(s),512<=a.length&&a.splice(0,256)},TimeDynamicImagery.prototype._clockOnTick=function(e){var t=e.currentTime,i=this._times.indexOf(t),r=this._currentIntervalIndex;if(i!==r){var n=this._tileCache[r];for(var a in n)n.hasOwnProperty(a)&&n[a].request.cancel();return delete this._tileCache[r],this._tilesRequestedForInterval=[],this._currentIntervalIndex=i,void this._reloadFunction()}var o=getApproachingInterval(this);if(defined(o))for(var s=this._tilesRequestedForInterval,l=!0;l&&0!==s.length;){var u=s.pop();(l=addToCache(this,u,o))||s.push(u)}},Object.defineProperties(WebMapServiceImageryProvider.prototype,{url:{get:function(){return this._resource._url}},proxy:{get:function(){return this._resource.proxy}},layers:{get:function(){return this._layers}},tileWidth:{get:function(){return this._tileProvider.tileWidth}},tileHeight:{get:function(){return this._tileProvider.tileHeight}},maximumLevel:{get:function(){return this._tileProvider.maximumLevel}},minimumLevel:{get:function(){return this._tileProvider.minimumLevel}},tilingScheme:{get:function(){return this._tileProvider.tilingScheme}},rectangle:{get:function(){return this._tileProvider.rectangle}},tileDiscardPolicy:{get:function(){return this._tileProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._tileProvider.errorEvent}},ready:{get:function(){return this._tileProvider.ready}},readyPromise:{get:function(){return this._tileProvider.readyPromise}},credit:{get:function(){return this._tileProvider.credit}},hasAlphaChannel:{get:function(){return this._tileProvider.hasAlphaChannel}},enablePickFeatures:{get:function(){return this._tileProvider.enablePickFeatures},set:function(e){this._tileProvider.enablePickFeatures=e}},clock:{get:function(){return this._timeDynamicImagery.clock},set:function(e){this._timeDynamicImagery.clock=e}},times:{get:function(){return this._timeDynamicImagery.times},set:function(e){this._timeDynamicImagery.times=e}}}),WebMapServiceImageryProvider.prototype.getTileCredits=function(e,t,i){return this._tileProvider.getTileCredits(e,t,i)},WebMapServiceImageryProvider.prototype.requestImage=function(e,t,i,r){var n,a,o=this._timeDynamicImagery;return defined(o)&&(a=o.currentInterval,n=o.getFromCache(e,t,i,r)),defined(n)||(n=requestImage(this,e,t,i,r,a)),defined(n)&&defined(o)&&o.checkApproachingInterval(e,t,i,r),n},WebMapServiceImageryProvider.prototype.pickFeatures=function(e,t,i,r,n){var a=this._timeDynamicImagery;return pickFeatures(this,e,t,i,r,n,defined(a)?a.currentInterval:void 0)},WebMapServiceImageryProvider.DefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetMap",styles:"",format:"image/jpeg"}),WebMapServiceImageryProvider.GetFeatureInfoDefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetFeatureInfo"}),WebMapServiceImageryProvider.DefaultGetFeatureInfoFormats=Object.freeze([Object.freeze(new GetFeatureInfoFormat("json","application/json")),Object.freeze(new GetFeatureInfoFormat("xml","text/xml")),Object.freeze(new GetFeatureInfoFormat("text","text/html"))]);var defaultParameters=Object.freeze({service:"WMTS",version:"1.0.0",request:"GetTile"});function WebMapTileServiceImageryProvider(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT);var t=Resource.createIfNeeded(e.url),i=e.style,r=e.tileMatrixSetID;if(0<=t.url.indexOf("{")){var n={style:i,Style:i,TileMatrixSet:r};t.setTemplateValues(n),this._useKvp=!1}else t.setQueryParameters(defaultParameters),this._useKvp=!0;this._resource=t,this._layer=e.layer,this._style=i,this._tileMatrixSetID=r,this._tileMatrixLabels=e.tileMatrixLabels,this._format=defaultValue(e.format,"image/jpeg"),this._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=defined(e.tilingScheme)?e.tilingScheme:new WebMercatorTilingScheme({ellipsoid:e.ellipsoid}),this._tileWidth=defaultValue(e.tileWidth,256),this._tileHeight=defaultValue(e.tileHeight,256),this._minimumLevel=defaultValue(e.minimumLevel,0),this._maximumLevel=e.maximumLevel,this._rectangle=defaultValue(e.rectangle,this._tilingScheme.rectangle),this._dimensions=e.dimensions;var a=this;this._reload=void 0,defined(e.times)&&(this._timeDynamicImagery=new TimeDynamicImagery({clock:e.clock,times:e.times,requestImageFunction:function(e,t,i,r,n){return requestImage$1(a,e,t,i,r,n)},reloadFunction:function(){defined(a._reload)&&a._reload()}})),this._readyPromise=when.resolve(!0);var o=this._tilingScheme.positionToTileXY(Rectangle.southwest(this._rectangle),this._minimumLevel),s=this._tilingScheme.positionToTileXY(Rectangle.northeast(this._rectangle),this._minimumLevel);Math.abs(s.x-o.x),Math.abs(s.y-o.y);this._errorEvent=new Event;var l=e.credit;this._credit="string"==typeof l?new Credit(l):l,this._subdomains=e.subdomains,Array.isArray(this._subdomains)?this._subdomains=this._subdomains.slice():defined(this._subdomains)&&0<this._subdomains.length?this._subdomains=this._subdomains.split(""):this._subdomains=["a","b","c"]}function requestImage$1(e,t,i,r,n,a){var o,s=e._tileMatrixLabels,l=defined(s)?s[r]:r.toString(),u=e._subdomains,c=e._dimensions,d=defined(a)?a.data:void 0;if(e._useKvp){var h={};h.tilematrix=l,h.layer=e._layer,h.style=e._style,h.tilerow=i,h.tilecol=t,h.tilematrixset=e._tileMatrixSetID,h.format=e._format,defined(c)&&(h=combine(h,c)),defined(d)&&(h=combine(h,d)),o=e._resource.getDerivedResource({queryParameters:h,request:n})}else{var p={TileMatrix:l,TileRow:i.toString(),TileCol:t.toString(),s:u[(t+i+r)%u.length]};(o=e._resource.getDerivedResource({request:n})).setTemplateValues(p),defined(c)&&o.setTemplateValues(c),defined(d)&&o.setTemplateValues(d)}return ImageryProvider.loadImage(e,o)}function createFactory(t){return function(e){return new t(e)}}Object.defineProperties(WebMapTileServiceImageryProvider.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},format:{get:function(){return this._format}},ready:{value:!0},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}},clock:{get:function(){return this._timeDynamicImagery.clock},set:function(e){this._timeDynamicImagery.clock=e}},times:{get:function(){return this._timeDynamicImagery.times},set:function(e){this._timeDynamicImagery.times=e}},dimensions:{get:function(){return this._dimensions},set:function(e){this._dimensions!==e&&(this._dimensions=e,defined(this._reload)&&this._reload())}}}),WebMapTileServiceImageryProvider.prototype.getTileCredits=function(e,t,i){},WebMapTileServiceImageryProvider.prototype.requestImage=function(e,t,i,r){var n,a,o=this._timeDynamicImagery;return defined(o)&&(a=o.currentInterval,n=o.getFromCache(e,t,i,r)),defined(n)||(n=requestImage$1(this,e,t,i,r,a)),defined(n)&&defined(o)&&o.checkApproachingInterval(e,t,i,r),n},WebMapTileServiceImageryProvider.prototype.pickFeatures=function(e,t,i,r,n){};var ImageryProviderMapping={ARCGIS_MAPSERVER:createFactory(ArcGisMapServerImageryProvider),BING:createFactory(BingMapsImageryProvider),GOOGLE_EARTH:createFactory(GoogleEarthEnterpriseMapsProvider),MAPBOX:createFactory(MapboxImageryProvider),SINGLE_TILE:createFactory(SingleTileImageryProvider),TMS:createFactory(TileMapServiceImageryProvider),URL_TEMPLATE:createFactory(UrlTemplateImageryProvider),WMS:createFactory(WebMapServiceImageryProvider),WMTS:createFactory(WebMapTileServiceImageryProvider)};function IonImageryProvider(e){var n=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).assetId;this.defaultAlpha=void 0,this.defaultBrightness=void 0,this.defaultContrast=void 0,this.defaultHue=void 0,this.defaultSaturation=void 0,this.defaultGamma=void 0,this.defaultMinificationFilter=void 0,this.defaultMagnificationFilter=void 0,this._ready=!1,this._tileCredits=void 0,this._errorEvent=new Event;var a=this,o=IonResource._createEndpointResource(n,e),t=e.assetId.toString()+e.accessToken+e.server,i=IonImageryProvider._endpointCache[t];defined(i)||(i=o.fetchJson(),IonImageryProvider._endpointCache[t]=i),this._readyPromise=i.then(function(e){if("IMAGERY"!==e.type)return when.reject(new RuntimeError("Cesium ion asset "+n+" is not an imagery asset."));var t,i=e.externalType;if(defined(i)){var r=ImageryProviderMapping[i];if(!defined(r))return when.reject(new RuntimeError("Unrecognized Cesium ion imagery type: "+i));t=r(e.options)}else t=new TileMapServiceImageryProvider({url:new IonResource(e,o)});return a._tileCredits=IonResource.getCreditsFromEndpoint(e,o),t.errorEvent.addEventListener(function(e){(e.provider=a)._errorEvent.raiseEvent(e)}),(a._imageryProvider=t).readyPromise.then(function(){return a._ready=!0})})}Object.defineProperties(IonImageryProvider.prototype,{ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}}}),IonImageryProvider.prototype.getTileCredits=function(e,t,i){var r=this._imageryProvider.getTileCredits(e,t,i);return defined(r)?this._tileCredits.concat(r):this._tileCredits},IonImageryProvider.prototype.requestImage=function(e,t,i,r){return this._imageryProvider.requestImage(e,t,i,r)},IonImageryProvider.prototype.pickFeatures=function(e,t,i,r,n){return this._imageryProvider.pickFeatures(e,t,i,r,n)},IonImageryProvider._endpointCache={};var IonWorldImageryStyle={AERIAL:2,AERIAL_WITH_LABELS:3,ROAD:4},IonWorldImageryStyle$1=Object.freeze(IonWorldImageryStyle);function createWorldImagery(e){return new IonImageryProvider({assetId:defaultValue((e=defaultValue(e,defaultValue.EMPTY_OBJECT)).style,IonWorldImageryStyle$1.AERIAL)})}var mobileWidth=576,lightboxHeight=100,textColor="#ffffff",highlightColor="#48b";function contains$1(e,t){for(var i=e.length,r=0;r<i;r++){var n=e[r];if(Credit.equals(n,t))return!0}return!1}function swapCesiumCredit(e){var t=e._previousCesiumCredit,i=e._currentCesiumCredit;Credit.equals(i,t)||(defined(t)&&e._cesiumCreditContainer.removeChild(t.element),defined(i)&&e._cesiumCreditContainer.appendChild(i.element),e._previousCesiumCredit=i)}var delimiterClassName="cesium-credit-delimiter",defaultCredit$1;function createDelimiterElement(e){var t=document.createElement("span");return t.textContent=e,t.className=delimiterClassName,t}function createCreditElement(e,t){if(defined(t)){var i=document.createElement(t);i._creditId=e._creditId,i.appendChild(e),e=i}return e}function displayCredits(e,t,i,r){for(var n=e.childNodes,a=-1,o=0;o<t.length;++o){var s=t[o];if(defined(s)){if(a=o,defined(i)&&(a*=2,0<o)){var l=a-1;if(n.length<=l)e.appendChild(createDelimiterElement(i));else{var u=n[l];u.className!==delimiterClassName&&e.replaceChild(createDelimiterElement(i),u)}}var c=s.element;if(n.length<=a)e.appendChild(createCreditElement(c,r));else{var d=n[a];d._creditId!==s._id&&e.replaceChild(createCreditElement(c,r),d)}}}for(++a;a<n.length;)e.removeChild(n[a])}function styleLightboxContainer(e){var t=e._lightboxCredits,i=e.viewport.clientWidth,r=e.viewport.clientHeight;i!==e._lastViewportWidth&&(i<mobileWidth?(t.className="cesium-credit-lightbox cesium-credit-lightbox-mobile",t.style.marginTop="0"):(t.className="cesium-credit-lightbox cesium-credit-lightbox-expanded",t.style.marginTop=Math.floor(.5*(r-t.clientHeight))+"px"),e._lastViewportWidth=i),mobileWidth<=i&&r!==e._lastViewportHeight&&(t.style.marginTop=Math.floor(.5*(r-t.clientHeight))+"px",e._lastViewportHeight=r)}function addStyle(e,t){var i=e+" {";for(var r in t)t.hasOwnProperty(r)&&(i+=r+": "+t[r]+"; ");return i+=" }\n"}function appendCss(){var e="";e+=addStyle(".cesium-credit-lightbox-overlay",{display:"none","z-index":"1",position:"absolute",top:"0",left:"0",width:"100%",height:"100%","background-color":"rgba(80, 80, 80, 0.8)"}),e+=addStyle(".cesium-credit-lightbox",{"background-color":"#303336",color:textColor,position:"relative","min-height":lightboxHeight+"px",margin:"auto"}),e+=addStyle(".cesium-credit-lightbox > ul > li a, .cesium-credit-lightbox > ul > li a:visited",{color:textColor}),e+=addStyle(".cesium-credit-lightbox > ul > li a:hover",{color:highlightColor}),e+=addStyle(".cesium-credit-lightbox.cesium-credit-lightbox-expanded",{border:"1px solid #444","border-radius":"5px","max-width":"370px"}),e+=addStyle(".cesium-credit-lightbox.cesium-credit-lightbox-mobile",{height:"100%",width:"100%"}),e+=addStyle(".cesium-credit-lightbox-title",{padding:"20px 20px 0 20px"}),e+=addStyle(".cesium-credit-lightbox-close",{"font-size":"18pt",cursor:"pointer",position:"absolute",top:"0",right:"6px",color:textColor}),e+=addStyle(".cesium-credit-lightbox-close:hover",{color:highlightColor}),e+=addStyle(".cesium-credit-lightbox > ul",{margin:"0",padding:"12px 20px 12px 40px","font-size":"13px"}),e+=addStyle(".cesium-credit-lightbox > ul > li",{"padding-bottom":"6px"}),e+=addStyle(".cesium-credit-lightbox > ul > li *",{padding:"0",margin:"0"}),e+=addStyle(".cesium-credit-expand-link",{"padding-left":"5px",cursor:"pointer","text-decoration":"underline",color:textColor}),e+=addStyle(".cesium-credit-expand-link:hover",{color:highlightColor}),e+=addStyle(".cesium-credit-text",{color:textColor}),e+=addStyle(".cesium-credit-textContainer *, .cesium-credit-logoContainer *",{display:"inline"});var t=document.head,i=document.createElement("style");i.innerHTML=e,t.insertBefore(i,t.firstChild)}function CreditDisplay(e,t,i){var r=this;i=defaultValue(i,document.body);var n=document.createElement("div");n.className="cesium-credit-lightbox-overlay",i.appendChild(n);var a=document.createElement("div");function o(e){a.contains(e.target)||r.hideLightbox()}a.className="cesium-credit-lightbox",n.appendChild(a),n.addEventListener("click",o,!1);var s=document.createElement("div");s.className="cesium-credit-lightbox-title",s.textContent="Data provided by:",a.appendChild(s);var l=document.createElement("a");l.onclick=this.hideLightbox.bind(this),l.innerHTML="×",l.className="cesium-credit-lightbox-close",a.appendChild(l);var u=document.createElement("ul");a.appendChild(u);var c=document.createElement("div");c.className="cesium-credit-logoContainer",c.style.display="inline",e.appendChild(c);var d=document.createElement("div");d.className="cesium-credit-textContainer",d.style.display="inline",e.appendChild(d);var h=document.createElement("a");h.className="cesium-credit-expand-link",h.onclick=this.showLightbox.bind(this),h.textContent="Data attribution",e.appendChild(h),appendCss();var p=Credit.clone(CreditDisplay.cesiumCredit);this._delimiter=defaultValue(t," • "),this._screenContainer=d,this._cesiumCreditContainer=c,this._lastViewportHeight=void 0,this._lastViewportWidth=void 0,this._lightboxCredits=a,this._creditList=u,this._lightbox=n,this._hideLightbox=o,this._expandLink=h,this._expanded=!1,this._defaultCredits=[],this._cesiumCredit=p,this._previousCesiumCredit=void 0,this._currentCesiumCredit=p,this._currentFrameCredits={screenCredits:new AssociativeArray,lightboxCredits:new AssociativeArray},this._defaultCredit=void 0,this.viewport=i,this.container=e}function getDefaultCredit(){if(!defined(defaultCredit$1)){var e=buildModuleUrl("Assets/Images/ion-credit.png");defaultCredit$1=new Credit('<a href="https://cesium.com/" target="_blank"><img src="'+e+'" title="Cesium ion"/></a>',!0)}return CreditDisplay._cesiumCreditInitialized||(CreditDisplay._cesiumCredit=defaultCredit$1,CreditDisplay._cesiumCreditInitialized=!0),defaultCredit$1}function DebugAppearance(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).attributeName,i=e.perInstanceAttribute;defined(i)||(i=!1);var r,n=defaultValue(e.glslDatatype,"vec3"),a="v_"+t;if("normal"===t||"tangent"===t||"bitangent"===t)r="vec4 getColor() { return vec4(("+a+" + vec3(1.0)) * 0.5, 1.0); }\n";else switch("st"===t&&(n="vec2"),n){case"float":r="vec4 getColor() { return vec4(vec3("+a+"), 1.0); }\n";break;case"vec2":r="vec4 getColor() { return vec4("+a+", 0.0, 1.0); }\n";break;case"vec3":r="vec4 getColor() { return vec4("+a+", 1.0); }\n";break;case"vec4":r="vec4 getColor() { return "+a+"; }\n"}var o="attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute float batchId;\n"+(i?"":"attribute "+n+" "+t+";\n")+"varying "+n+" "+a+";\nvoid main()\n{\nvec4 p = czm_translateRelativeToEye(position3DHigh, position3DLow);\n"+(i?a+" = czm_batchTable_"+t+"(batchId);\n":a+" = "+t+";\n")+"gl_Position = czm_modelViewProjectionRelativeToEye * p;\n}",s="varying "+n+" "+a+";\n"+r+"\nvoid main()\n{\ngl_FragColor = getColor();\n}";this.material=void 0,this.translucent=defaultValue(e.translucent,!1),this._vertexShaderSource=defaultValue(e.vertexShaderSource,o),this._fragmentShaderSource=defaultValue(e.fragmentShaderSource,s),this._renderState=Appearance.getDefaultRenderState(!1,!1,e.renderState),this._closed=defaultValue(e.closed,!1),this._attributeName=t,this._glslDatatype=n}function DebugModelMatrixPrimitive(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this.length=defaultValue(e.length,1e7),this._length=void 0,this.width=defaultValue(e.width,2),this._width=void 0,this.show=defaultValue(e.show,!0),this.modelMatrix=Matrix4.clone(defaultValue(e.modelMatrix,Matrix4.IDENTITY)),this._modelMatrix=new Matrix4,this.id=e.id,this._id=void 0,this._primitive=void 0}CreditDisplay.prototype.addCredit=function(e){if(e._isIon)return defined(this._defaultCredit)||(this._defaultCredit=Credit.clone(getDefaultCredit())),void(this._currentCesiumCredit=this._defaultCredit);e.showOnScreen?this._currentFrameCredits.screenCredits.set(e.id,e):this._currentFrameCredits.lightboxCredits.set(e.id,e)},CreditDisplay.prototype.addDefaultCredit=function(e){var t=this._defaultCredits;contains$1(t,e)||t.push(e)},CreditDisplay.prototype.removeDefaultCredit=function(e){var t=this._defaultCredits,i=t.indexOf(e);-1!==i&&t.splice(i,1)},CreditDisplay.prototype.showLightbox=function(){this._lightbox.style.display="block",this._expanded=!0},CreditDisplay.prototype.hideLightbox=function(){this._lightbox.style.display="none",this._expanded=!1},CreditDisplay.prototype.update=function(){this._expanded&&styleLightboxContainer(this)},CreditDisplay.prototype.beginFrame=function(){var e=this._currentFrameCredits,t=e.screenCredits;t.removeAll();for(var i=this._defaultCredits,r=0;r<i.length;++r){var n=i[r];t.set(n.id,n)}e.lightboxCredits.removeAll(),Credit.equals(CreditDisplay.cesiumCredit,this._cesiumCredit)||(this._cesiumCredit=Credit.clone(CreditDisplay.cesiumCredit)),this._currentCesiumCredit=this._cesiumCredit},CreditDisplay.prototype.endFrame=function(){var e=this._currentFrameCredits.screenCredits.values;displayCredits(this._screenContainer,e,this._delimiter,void 0);var t=this._currentFrameCredits.lightboxCredits.values;this._expandLink.style.display=0<t.length?"inline":"none",displayCredits(this._creditList,t,void 0,"li"),swapCesiumCredit(this)},CreditDisplay.prototype.destroy=function(){return this._lightbox.removeEventListener("click",this._hideLightbox,!1),this.container.removeChild(this._cesiumCreditContainer),this.container.removeChild(this._screenContainer),this.container.removeChild(this._expandLink),this.viewport.removeChild(this._lightbox),destroyObject(this)},CreditDisplay.prototype.isDestroyed=function(){return!1},CreditDisplay._cesiumCredit=void 0,CreditDisplay._cesiumCreditInitialized=!1,Object.defineProperties(CreditDisplay,{cesiumCredit:{get:function(){return getDefaultCredit(),CreditDisplay._cesiumCredit},set:function(e){CreditDisplay._cesiumCredit=e,CreditDisplay._cesiumCreditInitialized=!0}}}),Object.defineProperties(DebugAppearance.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},attributeName:{get:function(){return this._attributeName}},glslDatatype:{get:function(){return this._glslDatatype}}}),DebugAppearance.prototype.getFragmentShaderSource=Appearance.prototype.getFragmentShaderSource,DebugAppearance.prototype.isTranslucent=Appearance.prototype.isTranslucent,DebugAppearance.prototype.getRenderState=Appearance.prototype.getRenderState,DebugModelMatrixPrimitive.prototype.update=function(e){if(this.show){if(!defined(this._primitive)||!Matrix4.equals(this._modelMatrix,this.modelMatrix)||this._length!==this.length||this._width!==this.width||this._id!==this.id){this._modelMatrix=Matrix4.clone(this.modelMatrix,this._modelMatrix),this._length=this.length,this._width=this.width,this._id=this.id,defined(this._primitive)&&this._primitive.destroy(),0===this.modelMatrix[12]&&0===this.modelMatrix[13]&&0===this.modelMatrix[14]&&(this.modelMatrix[14]=.01);var t=new GeometryInstance({geometry:new PolylineGeometry({positions:[Cartesian3.ZERO,Cartesian3.UNIT_X],width:this.width,vertexFormat:PolylineColorAppearance.VERTEX_FORMAT,colors:[Color.RED,Color.RED],arcType:ArcType$1.NONE}),modelMatrix:Matrix4.multiplyByUniformScale(this.modelMatrix,this.length,new Matrix4),id:this.id,pickPrimitive:this}),i=new GeometryInstance({geometry:new PolylineGeometry({positions:[Cartesian3.ZERO,Cartesian3.UNIT_Y],width:this.width,vertexFormat:PolylineColorAppearance.VERTEX_FORMAT,colors:[Color.GREEN,Color.GREEN],arcType:ArcType$1.NONE}),modelMatrix:Matrix4.multiplyByUniformScale(this.modelMatrix,this.length,new Matrix4),id:this.id,pickPrimitive:this}),r=new GeometryInstance({geometry:new PolylineGeometry({positions:[Cartesian3.ZERO,Cartesian3.UNIT_Z],width:this.width,vertexFormat:PolylineColorAppearance.VERTEX_FORMAT,colors:[Color.BLUE,Color.BLUE],arcType:ArcType$1.NONE}),modelMatrix:Matrix4.multiplyByUniformScale(this.modelMatrix,this.length,new Matrix4),id:this.id,pickPrimitive:this});this._primitive=new Primitive({geometryInstances:[t,i,r],appearance:new PolylineColorAppearance,asynchronous:!1})}this._primitive.update(e)}},DebugModelMatrixPrimitive.prototype.isDestroyed=function(){return!1},DebugModelMatrixPrimitive.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),destroyObject(this)};var DepthPlaneFS="varying vec4 positionEC;\nvoid main()\n{\nvec3 direction = normalize(positionEC.xyz);\nczm_ray ray = czm_ray(vec3(0.0), direction);\nvec3 ellipsoid_center = czm_view[3].xyz;\nczm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid_center, czm_ellipsoidInverseRadii);\nif (!czm_isEmpty(intersection))\n{\ngl_FragColor = vec4(1.0, 1.0, 0.0, 1.0);\n}\nelse\n{\ndiscard;\n}\nczm_writeLogDepth();\n}\n",DepthPlaneVS="attribute vec4 position;\nvarying vec4 positionEC;\nvoid main()\n{\npositionEC = czm_modelView * position;\ngl_Position = czm_projection * positionEC;\nczm_vertexLogDepth();\n}\n";function DepthPlane(){this._rs=void 0,this._sp=void 0,this._va=void 0,this._command=void 0,this._mode=void 0,this._useLogDepth=!1}var depthQuadScratch=FeatureDetection$1.supportsTypedArrays()?new Float32Array(12):[],scratchCartesian1$b=new Cartesian3,scratchCartesian2$e=new Cartesian3,scratchCartesian3$e=new Cartesian3,scratchCartesian4$5=new Cartesian3;function computeDepthQuad(e,t){var i=e.radii,r=t.camera.positionWC,n=Cartesian3.multiplyComponents(e.oneOverRadii,r,scratchCartesian1$b),a=Cartesian3.magnitude(n),o=Cartesian3.normalize(n,scratchCartesian2$e),s=Cartesian3.normalize(Cartesian3.cross(Cartesian3.UNIT_Z,n,scratchCartesian3$e),scratchCartesian3$e),l=Cartesian3.normalize(Cartesian3.cross(o,s,scratchCartesian4$5),scratchCartesian4$5),u=Math.sqrt(Cartesian3.magnitudeSquared(n)-1),c=Cartesian3.multiplyByScalar(o,1/a,scratchCartesian1$b),d=u/a,h=Cartesian3.multiplyByScalar(s,d,scratchCartesian2$e),p=Cartesian3.multiplyByScalar(l,d,scratchCartesian3$e),f=Cartesian3.add(c,p,scratchCartesian4$5);Cartesian3.subtract(f,h,f),Cartesian3.multiplyComponents(i,f,f),Cartesian3.pack(f,depthQuadScratch,0);var m=Cartesian3.subtract(c,p,scratchCartesian4$5);Cartesian3.subtract(m,h,m),Cartesian3.multiplyComponents(i,m,m),Cartesian3.pack(m,depthQuadScratch,3);var g=Cartesian3.add(c,p,scratchCartesian4$5);Cartesian3.add(g,h,g),Cartesian3.multiplyComponents(i,g,g),Cartesian3.pack(g,depthQuadScratch,6);var y=Cartesian3.subtract(c,p,scratchCartesian4$5);return Cartesian3.add(y,h,y),Cartesian3.multiplyComponents(i,y,y),Cartesian3.pack(y,depthQuadScratch,9),depthQuadScratch}function DerivedCommand(){}DepthPlane.prototype.update=function(e){if(this._mode=e.mode,e.mode===SceneMode$1.SCENE3D){var t=e.context,i=e.mapProjection.ellipsoid,r=e.useLogDepth;if(defined(this._command)||(this._rs=RenderState.fromCache({cull:{enabled:!0},depthTest:{enabled:!0},colorMask:{red:!1,green:!1,blue:!1,alpha:!1}}),this._command=new DrawCommand({renderState:this._rs,boundingVolume:new BoundingSphere(Cartesian3.ZERO,i.maximumRadius),pass:Pass$1.OPAQUE,owner:this})),!defined(this._sp)||this._useLogDepth!==r){this._useLogDepth=r;var n=new ShaderSource({sources:[DepthPlaneVS]}),a=new ShaderSource({sources:[DepthPlaneFS]});if(r){a.sources.push("#ifdef GL_EXT_frag_depth \n#extension GL_EXT_frag_depth : enable \n#endif \n\n"),a.defines.push("LOG_DEPTH"),n.defines.push("LOG_DEPTH")}this._sp=ShaderProgram.replaceCache({shaderProgram:this._sp,context:t,vertexShaderSource:n,fragmentShaderSource:a,attributeLocations:{position:0}}),this._command.shaderProgram=this._sp}var o=computeDepthQuad(i,e);if(defined(this._va))this._va.getAttribute(0).vertexBuffer.copyFromArrayView(o);else{var s=new Geometry({attributes:{position:new GeometryAttribute({componentDatatype:ComponentDatatype$1.FLOAT,componentsPerAttribute:3,values:o})},indices:[0,1,2,2,1,3],primitiveType:PrimitiveType$1.TRIANGLES});this._va=VertexArray.fromGeometry({context:t,geometry:s,attributeLocations:{position:0},bufferUsage:BufferUsage$1.DYNAMIC_DRAW}),this._command.vertexArray=this._va}}},DepthPlane.prototype.execute=function(e,t){this._mode===SceneMode$1.SCENE3D&&this._command.execute(e,t)},DepthPlane.prototype.isDestroyed=function(){return!1},DepthPlane.prototype.destroy=function(){this._sp=this._sp&&this._sp.destroy(),this._va=this._va&&this._va.destroy()};var fragDepthRegex=/\bgl_FragDepthEXT\b/,discardRegex=/\bdiscard\b/;function getDepthOnlyShaderProgram(e,t){var i=e.shaderCache.getDerivedShaderProgram(t,"depthOnly");if(!defined(i)){var r,n=t._attributeLocations,a=t.fragmentShaderSource,o=!1,s=a.sources,l=s.length;for(r=0;r<l;++r)if(fragDepthRegex.test(s[r])||discardRegex.test(s[r])){o=!0;break}var u=!1,c=a.defines;for(l=c.length,r=0;r<l;++r)if("LOG_DEPTH"===c[r]){u=!0;break}o||u?!o&&u&&(a=new ShaderSource({defines:["LOG_DEPTH"],sources:["#ifdef GL_EXT_frag_depth \n#extension GL_EXT_frag_depth : enable \n#endif \n\nvoid main() \n{ \n gl_FragColor = vec4(1.0); \n czm_writeLogDepth(); \n} \n"]})):a=new ShaderSource({sources:["void main() \n{ \n gl_FragColor = vec4(1.0); \n} \n"]}),i=e.shaderCache.createDerivedShaderProgram(t,"depthOnly",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:a,attributeLocations:n})}return i}function getDepthOnlyRenderState(e,t){var i=e._depthOnlyRenderStateCache,r=i[t.id];if(!defined(r)){var n=RenderState.getState(t);n.depthMask=!0,n.colorMask={red:!1,green:!1,blue:!1,alpha:!1},r=RenderState.fromCache(n),i[t.id]=r}return r}DerivedCommand.createDepthOnlyDerivedCommand=function(e,t,i,r){var n,a;return defined(r)||(r={}),defined(r.depthOnlyCommand)&&(n=r.depthOnlyCommand.shaderProgram,a=r.depthOnlyCommand.renderState),r.depthOnlyCommand=DrawCommand.shallowClone(t,r.depthOnlyCommand),defined(n)&&r.shaderProgramId===t.shaderProgram.id?(r.depthOnlyCommand.shaderProgram=n,r.depthOnlyCommand.renderState=a):(r.depthOnlyCommand.shaderProgram=getDepthOnlyShaderProgram(i,t.shaderProgram),r.depthOnlyCommand.renderState=getDepthOnlyRenderState(e,t.renderState),r.shaderProgramId=t.shaderProgram.id),r};var writeLogDepthRegex=/\s+czm_writeLogDepth\(/,vertexlogDepthRegex=/\s+czm_vertexLogDepth\(/,extensionRegex=/\s*#extension\s+GL_EXT_frag_depth\s*:\s*enable/;function getLogDepthShaderProgram(e,t){var i=e.shaderCache.getDerivedShaderProgram(t,"logDepth");if(!defined(i)){var r,n=t._attributeLocations,a=t.vertexShaderSource.clone(),o=t.fragmentShaderSource.clone();a.defines=defined(a.defines)?a.defines.slice(0):[],a.defines.push("LOG_DEPTH"),o.defines=defined(o.defines)?o.defines.slice(0):[],o.defines.push("LOG_DEPTH");var s=!1,l=a.sources,u=l.length;for(r=0;r<u;++r)if(vertexlogDepthRegex.test(l[r])){s=!0;break}if(!s){for(r=0;r<u;++r)l[r]=ShaderSource.replaceMain(l[r],"czm_log_depth_main");"\n\nvoid main() \n{ \n czm_log_depth_main(); \n czm_vertexLogDepth(); \n} \n",l.push("\n\nvoid main() \n{ \n czm_log_depth_main(); \n czm_vertexLogDepth(); \n} \n")}var c=!0;for(s=!1,u=(l=o.sources).length,r=0;r<u;++r)writeLogDepthRegex.test(l[r])&&(s=!0),extensionRegex.test(l[r])&&(c=!1);var d="";if(c&&(d+="#ifdef GL_EXT_frag_depth \n#extension GL_EXT_frag_depth : enable \n#endif \n\n"),!s){for(r=0;r<u;r++)l[r]=ShaderSource.replaceMain(l[r],"czm_log_depth_main");d+="\nvoid main() \n{ \n czm_log_depth_main(); \n czm_writeLogDepth(); \n} \n"}l.push(d),i=e.shaderCache.createDerivedShaderProgram(t,"logDepth",{vertexShaderSource:a,fragmentShaderSource:o,attributeLocations:n})}return i}function getPickShaderProgram(e,t,i){var r=e.shaderCache.getDerivedShaderProgram(t,"pick");if(!defined(r)){for(var n=t._attributeLocations,a=t.fragmentShaderSource,o=a.sources,s=o.length,l="void main() \n{ \n czm_non_pick_main(); \n if (gl_FragColor.a == 0.0) { \n discard; \n } \n gl_FragColor = "+i+"; \n} \n",u=new Array(s+1),c=0;c<s;++c)u[c]=ShaderSource.replaceMain(o[c],"czm_non_pick_main");u[s]=l,a=new ShaderSource({sources:u,defines:a.defines}),r=e.shaderCache.createDerivedShaderProgram(t,"pick",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:a,attributeLocations:n})}return r}function getPickRenderState(e,t){var i=e.picking.pickRenderStateCache,r=i[t.id];if(!defined(r)){var n=RenderState.getState(t);n.blending.enabled=!1,n.depthMask=!0,r=RenderState.fromCache(n),i[t.id]=r}return r}function getHdrShaderProgram(e,t){var i=e.shaderCache.getDerivedShaderProgram(t,"HDR");if(!defined(i)){var r=t._attributeLocations,n=t.vertexShaderSource.clone(),a=t.fragmentShaderSource.clone();n.defines=defined(n.defines)?n.defines.slice(0):[],n.defines.push("HDR"),a.defines=defined(a.defines)?a.defines.slice(0):[],a.defines.push("HDR"),i=e.shaderCache.createDerivedShaderProgram(t,"HDR",{vertexShaderSource:n,fragmentShaderSource:a,attributeLocations:r})}return i}function DeviceOrientationCameraController(e){this._scene=e,this._lastAlpha=void 0,this._lastBeta=void 0,this._lastGamma=void 0,this._alpha=void 0,this._beta=void 0,this._gamma=void 0;var i=this;function t(e){var t=e.alpha;if(!defined(t))return i._alpha=void 0,i._beta=void 0,void(i._gamma=void 0);i._alpha=CesiumMath.toRadians(t),i._beta=CesiumMath.toRadians(e.beta),i._gamma=CesiumMath.toRadians(e.gamma)}window.addEventListener("deviceorientation",t,!1),this._removeListener=function(){window.removeEventListener("deviceorientation",t,!1)}}DerivedCommand.createLogDepthCommand=function(e,t,i){var r;return defined(i)||(i={}),defined(i.command)&&(r=i.command.shaderProgram),i.command=DrawCommand.shallowClone(e,i.command),defined(r)&&i.shaderProgramId===e.shaderProgram.id?i.command.shaderProgram=r:(i.command.shaderProgram=getLogDepthShaderProgram(t,e.shaderProgram),i.shaderProgramId=e.shaderProgram.id),i},DerivedCommand.createPickDerivedCommand=function(e,t,i,r){var n,a;return defined(r)||(r={}),defined(r.pickCommand)&&(n=r.pickCommand.shaderProgram,a=r.pickCommand.renderState),r.pickCommand=DrawCommand.shallowClone(t,r.pickCommand),defined(n)&&r.shaderProgramId===t.shaderProgram.id?(r.pickCommand.shaderProgram=n,r.pickCommand.renderState=a):(r.pickCommand.shaderProgram=getPickShaderProgram(i,t.shaderProgram,t.pickId),r.pickCommand.renderState=getPickRenderState(e,t.renderState),r.shaderProgramId=t.shaderProgram.id),r},DerivedCommand.createHdrCommand=function(e,t,i){var r;return defined(i)||(i={}),defined(i.command)&&(r=i.command.shaderProgram),i.command=DrawCommand.shallowClone(e,i.command),defined(r)&&i.shaderProgramId===e.shaderProgram.id?i.command.shaderProgram=r:(i.command.shaderProgram=getHdrShaderProgram(t,e.shaderProgram),i.shaderProgramId=e.shaderProgram.id),i};var scratchQuaternion1=new Quaternion,scratchQuaternion2=new Quaternion,scratchMatrix3$2=new Matrix3;function rotate(e,t,i,r){var n=e.direction,a=e.right,o=e.up,s=Quaternion.fromAxisAngle(n,i,scratchQuaternion2),l=Quaternion.fromAxisAngle(a,r,scratchQuaternion1),u=Quaternion.multiply(l,s,l),c=Quaternion.fromAxisAngle(o,t,scratchQuaternion2);Quaternion.multiply(c,u,u);var d=Matrix3.fromQuaternion(u,scratchMatrix3$2);Matrix3.multiplyByVector(d,a,a),Matrix3.multiplyByVector(d,o,o),Matrix3.multiplyByVector(d,n,n)}function DirectionalLight(e){this.direction=Cartesian3.clone(e.direction),this.color=Color.clone(defaultValue(e.color,Color.WHITE)),this.intensity=defaultValue(e.intensity,1)}DeviceOrientationCameraController.prototype.update=function(){if(defined(this._alpha)){defined(this._lastAlpha)||(this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma);var e=this._lastAlpha-this._alpha,t=this._lastBeta-this._beta,i=this._lastGamma-this._gamma;rotate(this._scene.camera,-e,t,i),this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma}},DeviceOrientationCameraController.prototype.isDestroyed=function(){return!1},DeviceOrientationCameraController.prototype.destroy=function(){return this._removeListener(),destroyObject(this)};var EllipsoidFS="#ifdef WRITE_DEPTH\n#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n#endif\n#endif\nuniform vec3 u_radii;\nuniform vec3 u_oneOverEllipsoidRadiiSquared;\nvarying vec3 v_positionEC;\nvec4 computeEllipsoidColor(czm_ray ray, float intersection, float side)\n{\nvec3 positionEC = czm_pointAlongRay(ray, intersection);\nvec3 positionMC = (czm_inverseModelView * vec4(positionEC, 1.0)).xyz;\nvec3 geodeticNormal = normalize(czm_geodeticSurfaceNormal(positionMC, vec3(0.0), u_oneOverEllipsoidRadiiSquared));\nvec3 sphericalNormal = normalize(positionMC / u_radii);\nvec3 normalMC = geodeticNormal * side;\nvec3 normalEC = normalize(czm_normal * normalMC);\nvec2 st = czm_ellipsoidWgs84TextureCoordinates(sphericalNormal);\nvec3 positionToEyeEC = -positionEC;\nczm_materialInput materialInput;\nmaterialInput.s = st.s;\nmaterialInput.st = st;\nmaterialInput.str = (positionMC + u_radii) / u_radii;\nmaterialInput.normalEC = normalEC;\nmaterialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(positionMC, normalEC);\nmaterialInput.positionToEyeEC = positionToEyeEC;\nczm_material material = czm_getMaterial(materialInput);\n#ifdef ONLY_SUN_LIGHTING\nreturn czm_private_phong(normalize(positionToEyeEC), material, czm_sunDirectionEC);\n#else\nreturn czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);\n#endif\n}\nvoid main()\n{\nfloat maxRadius = max(u_radii.x, max(u_radii.y, u_radii.z)) * 1.5;\nvec3 direction = normalize(v_positionEC);\nvec3 ellipsoidCenter = czm_modelView[3].xyz;\nfloat t1 = -1.0;\nfloat t2 = -1.0;\nfloat b = -2.0 * dot(direction, ellipsoidCenter);\nfloat c = dot(ellipsoidCenter, ellipsoidCenter) - maxRadius * maxRadius;\nfloat discriminant = b * b - 4.0 * c;\nif (discriminant >= 0.0) {\nt1 = (-b - sqrt(discriminant)) * 0.5;\nt2 = (-b + sqrt(discriminant)) * 0.5;\n}\nif (t1 < 0.0 && t2 < 0.0) {\ndiscard;\n}\nfloat t = min(t1, t2);\nif (t < 0.0) {\nt = 0.0;\n}\nczm_ray ray = czm_ray(t * direction, direction);\nvec3 ellipsoid_inverseRadii = vec3(1.0 / u_radii.x, 1.0 / u_radii.y, 1.0 / u_radii.z);\nczm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoidCenter, ellipsoid_inverseRadii);\nif (czm_isEmpty(intersection))\n{\ndiscard;\n}\nvec4 outsideFaceColor = (intersection.start != 0.0) ? computeEllipsoidColor(ray, intersection.start, 1.0) : vec4(0.0);\nvec4 insideFaceColor = (outsideFaceColor.a < 1.0) ? computeEllipsoidColor(ray, intersection.stop, -1.0) : vec4(0.0);\ngl_FragColor = mix(insideFaceColor, outsideFaceColor, outsideFaceColor.a);\ngl_FragColor.a = 1.0 - (1.0 - insideFaceColor.a) * (1.0 - outsideFaceColor.a);\n#ifdef WRITE_DEPTH\n#ifdef GL_EXT_frag_depth\nt = (intersection.start != 0.0) ? intersection.start : intersection.stop;\nvec3 positionEC = czm_pointAlongRay(ray, t);\nvec4 positionCC = czm_projection * vec4(positionEC, 1.0);\n#ifdef LOG_DEPTH\nczm_writeLogDepth(1.0 + positionCC.w);\n#else\nfloat z = positionCC.z / positionCC.w;\nfloat n = czm_depthRange.near;\nfloat f = czm_depthRange.far;\ngl_FragDepthEXT = (z * (f - n) + f + n) * 0.5;\n#endif\n#endif\n#endif\n}\n",EllipsoidVS="attribute vec3 position;\nuniform vec3 u_radii;\nvarying vec3 v_positionEC;\nvoid main()\n{\nvec4 p = vec4(u_radii * position, 1.0);\nv_positionEC = (czm_modelView * p).xyz;\ngl_Position = czm_modelViewProjection * p;\ngl_Position.z = clamp(gl_Position.z, czm_depthRange.near, czm_depthRange.far);\nczm_vertexLogDepth();\n}\n",attributeLocations$4={position:0};function EllipsoidPrimitive(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this.center=Cartesian3.clone(defaultValue(e.center,Cartesian3.ZERO)),this._center=new Cartesian3,this.radii=Cartesian3.clone(e.radii),this._radii=new Cartesian3,this._oneOverEllipsoidRadiiSquared=new Cartesian3,this._boundingSphere=new BoundingSphere,this.modelMatrix=Matrix4.clone(defaultValue(e.modelMatrix,Matrix4.IDENTITY)),this._modelMatrix=new Matrix4,this._computedModelMatrix=new Matrix4,this.show=defaultValue(e.show,!0),this.material=defaultValue(e.material,Material.fromType(Material.ColorType)),this._material=void 0,this._translucent=void 0,this.id=e.id,this._id=void 0,this.debugShowBoundingVolume=defaultValue(e.debugShowBoundingVolume,!1),this.onlySunLighting=defaultValue(e.onlySunLighting,!1),this._onlySunLighting=!1,this._depthTestEnabled=defaultValue(e.depthTestEnabled,!0),this._useLogDepth=!1,this._sp=void 0,this._rs=void 0,this._va=void 0,this._pickSP=void 0,this._pickId=void 0,this._colorCommand=new DrawCommand({owner:defaultValue(e._owner,this)}),this._pickCommand=new DrawCommand({owner:defaultValue(e._owner,this),pickOnly:!0});var t=this;this._uniforms={u_radii:function(){return t.radii},u_oneOverEllipsoidRadiiSquared:function(){return t._oneOverEllipsoidRadiiSquared}},this._pickUniforms={czm_pickColor:function(){return t._pickId.color}}}function getVertexArray(e){var t=e.cache.ellipsoidPrimitive_vertexArray;if(defined(t))return t;var i=BoxGeometry.createGeometry(BoxGeometry.fromDimensions({dimensions:new Cartesian3(2,2,2),vertexFormat:VertexFormat.POSITION_ONLY}));return t=VertexArray.fromGeometry({context:e,geometry:i,attributeLocations:attributeLocations$4,bufferUsage:BufferUsage$1.STATIC_DRAW,interleave:!0}),e.cache.ellipsoidPrimitive_vertexArray=t}var logDepthExtension="#ifdef GL_EXT_frag_depth \n#extension GL_EXT_frag_depth : enable \n#endif \n\n";function Fog(){this.enabled=!0,this.density=2e-4,this.screenSpaceErrorFactor=2,this.minimumBrightness=.03}EllipsoidPrimitive.prototype.update=function(e){if(this.show&&e.mode===SceneMode$1.SCENE3D&&defined(this.center)&&defined(this.radii)){var t=e.context,i=this.material.isTranslucent(),r=this._translucent!==i;defined(this._rs)&&!r||(this._translucent=i,this._rs=RenderState.fromCache({cull:{enabled:!0,face:CullFace$1.FRONT},depthTest:{enabled:this._depthTestEnabled},depthMask:!i&&t.fragmentDepth,blending:i?BlendingState$1.ALPHA_BLEND:void 0})),defined(this._va)||(this._va=getVertexArray(t));var n=!1,a=this.radii;if(!Cartesian3.equals(this._radii,a)){Cartesian3.clone(a,this._radii);var o=this._oneOverEllipsoidRadiiSquared;o.x=1/(a.x*a.x),o.y=1/(a.y*a.y),o.z=1/(a.z*a.z),n=!0}Matrix4.equals(this.modelMatrix,this._modelMatrix)&&Cartesian3.equals(this.center,this._center)||(Matrix4.clone(this.modelMatrix,this._modelMatrix),Cartesian3.clone(this.center,this._center),Matrix4.multiplyByTranslation(this.modelMatrix,this.center,this._computedModelMatrix),n=!0),n&&(Cartesian3.clone(Cartesian3.ZERO,this._boundingSphere.center),this._boundingSphere.radius=Cartesian3.maximumComponent(a),BoundingSphere.transform(this._boundingSphere,this._computedModelMatrix,this._boundingSphere));var s=this._material!==this.material;this._material=this.material,this._material.update(t);var l=this.onlySunLighting!==this._onlySunLighting;this._onlySunLighting=this.onlySunLighting;var u=e.useLogDepth,c=this._useLogDepth!==u;this._useLogDepth=u;var d,h,p=this._colorCommand;(s||l||r||c)&&(d=new ShaderSource({sources:[EllipsoidVS]}),h=new ShaderSource({sources:[this.material.shaderSource,EllipsoidFS]}),this.onlySunLighting&&h.defines.push("ONLY_SUN_LIGHTING"),!i&&t.fragmentDepth&&h.defines.push("WRITE_DEPTH"),this._useLogDepth&&(d.defines.push("LOG_DEPTH"),h.defines.push("LOG_DEPTH"),h.sources.push(logDepthExtension)),this._sp=ShaderProgram.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:d,fragmentShaderSource:h,attributeLocations:attributeLocations$4}),p.vertexArray=this._va,p.renderState=this._rs,p.shaderProgram=this._sp,p.uniformMap=combine(this._uniforms,this.material._uniforms),p.executeInClosestFrustum=i);var f=e.commandList,m=e.passes;if(m.render&&(p.boundingVolume=this._boundingSphere,p.debugShowBoundingVolume=this.debugShowBoundingVolume,p.modelMatrix=this._computedModelMatrix,p.pass=i?Pass$1.TRANSLUCENT:Pass$1.OPAQUE,f.push(p)),m.pick){var g=this._pickCommand;defined(this._pickId)&&this._id===this.id||(this._id=this.id,this._pickId=this._pickId&&this._pickId.destroy(),this._pickId=t.createPickId({primitive:this,id:this.id})),(s||l||!defined(this._pickSP)||c)&&(d=new ShaderSource({sources:[EllipsoidVS]}),h=new ShaderSource({sources:[this.material.shaderSource,EllipsoidFS],pickColorQualifier:"uniform"}),this.onlySunLighting&&h.defines.push("ONLY_SUN_LIGHTING"),!i&&t.fragmentDepth&&h.defines.push("WRITE_DEPTH"),this._useLogDepth&&(d.defines.push("LOG_DEPTH"),h.defines.push("LOG_DEPTH"),h.sources.push(logDepthExtension)),this._pickSP=ShaderProgram.replaceCache({context:t,shaderProgram:this._pickSP,vertexShaderSource:d,fragmentShaderSource:h,attributeLocations:attributeLocations$4}),g.vertexArray=this._va,g.renderState=this._rs,g.shaderProgram=this._pickSP,g.uniformMap=combine(combine(this._uniforms,this._pickUniforms),this.material._uniforms),g.executeInClosestFrustum=i),g.boundingVolume=this._boundingSphere,g.modelMatrix=this._computedModelMatrix,g.pass=i?Pass$1.TRANSLUCENT:Pass$1.OPAQUE,f.push(g)}}},EllipsoidPrimitive.prototype.isDestroyed=function(){return!1},EllipsoidPrimitive.prototype.destroy=function(){return this._sp=this._sp&&this._sp.destroy(),this._pickSP=this._pickSP&&this._pickSP.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),destroyObject(this)};for(var heightsTable=[359.393,800.749,1275.6501,2151.1192,3141.7763,4777.5198,6281.2493,12364.307,15900.765,49889.0549,78026.8259,99260.7344,120036.3873,151011.0158,156091.1953,203849.3112,274866.9803,319916.3149,493552.0528,628733.5874],densityTable=[2e-5,2e-4,1e-4,7e-5,5e-5,4e-5,3e-5,19e-6,1e-5,85e-7,62e-7,58e-7,53e-7,52e-7,51e-7,42e-7,4e-6,34e-7,26e-7,22e-7],i$7=0;i$7<densityTable.length;++i$7)densityTable[i$7]*=1e6;for(var tableStartDensity=densityTable[1],tableEndDensity=densityTable[densityTable.length-1],j=0;j<densityTable.length;++j)densityTable[j]=(densityTable[j]-tableEndDensity)/(tableStartDensity-tableEndDensity);var tableLastIndex=0;function findInterval(e){var t,i=heightsTable,r=i.length;if(e<i[0])return tableLastIndex=0;if(e>i[r-1])return tableLastIndex=r-2;if(e>=i[tableLastIndex]){if(tableLastIndex+1<r&&e<i[tableLastIndex+1])return tableLastIndex;if(tableLastIndex+2<r&&e<i[tableLastIndex+2])return++tableLastIndex}else if(0<=tableLastIndex-1&&e>=i[tableLastIndex-1])return--tableLastIndex;for(t=0;t<r-2&&!(e>=i[t]&&e<i[t+1]);++t);return tableLastIndex=t}var scratchPositionNormal$1=new Cartesian3;function FrameRateMonitor(e){this._scene=e.scene,this.samplingWindow=defaultValue(e.samplingWindow,FrameRateMonitor.defaultSettings.samplingWindow),this.quietPeriod=defaultValue(e.quietPeriod,FrameRateMonitor.defaultSettings.quietPeriod),this.warmupPeriod=defaultValue(e.warmupPeriod,FrameRateMonitor.defaultSettings.warmupPeriod),this.minimumFrameRateDuringWarmup=defaultValue(e.minimumFrameRateDuringWarmup,FrameRateMonitor.defaultSettings.minimumFrameRateDuringWarmup),this.minimumFrameRateAfterWarmup=defaultValue(e.minimumFrameRateAfterWarmup,FrameRateMonitor.defaultSettings.minimumFrameRateAfterWarmup),this._lowFrameRate=new Event,this._nominalFrameRate=new Event,this._frameTimes=[],this._needsQuietPeriod=!0,this._quietPeriodEndTime=0,this._warmupPeriodEndTime=0,this._frameRateIsLow=!1,this._lastFramesPerSecond=void 0,this._pauseCount=0;var i=this;this._preUpdateRemoveListener=this._scene.preUpdate.addEventListener(function(e,t){update$5(i)}),this._hiddenPropertyName=void 0!==document.hidden?"hidden":void 0!==document.mozHidden?"mozHidden":void 0!==document.msHidden?"msHidden":void 0!==document.webkitHidden?"webkitHidden":void 0;var t=void 0!==document.hidden?"visibilitychange":void 0!==document.mozHidden?"mozvisibilitychange":void 0!==document.msHidden?"msvisibilitychange":void 0!==document.webkitHidden?"webkitvisibilitychange":void 0;function r(){visibilityChanged(i)}this._visibilityChangeRemoveListener=void 0,defined(t)&&(document.addEventListener(t,r,!1),this._visibilityChangeRemoveListener=function(){document.removeEventListener(t,r,!1)})}function update$5(e,t){if(!(0<e._pauseCount)){var i=getTimestamp$1();if(e._needsQuietPeriod)e._needsQuietPeriod=!1,e._frameTimes.length=0,e._quietPeriodEndTime=i+e.quietPeriod/TimeConstants$1.SECONDS_PER_MILLISECOND,e._warmupPeriodEndTime=e._quietPeriodEndTime+(e.warmupPeriod+e.samplingWindow)/TimeConstants$1.SECONDS_PER_MILLISECOND;else if(i>=e._quietPeriodEndTime){e._frameTimes.push(i);var r=i-e.samplingWindow/TimeConstants$1.SECONDS_PER_MILLISECOND;if(2<=e._frameTimes.length&&e._frameTimes[0]<=r){for(;2<=e._frameTimes.length&&e._frameTimes[1]<r;)e._frameTimes.shift();var n=(i-e._frameTimes[0])/(e._frameTimes.length-1);e._lastFramesPerSecond=1e3/n,1e3/(i>e._warmupPeriodEndTime?e.minimumFrameRateAfterWarmup:e.minimumFrameRateDuringWarmup)<n?e._frameRateIsLow||(e._frameRateIsLow=!0,e._needsQuietPeriod=!0,e.lowFrameRate.raiseEvent(e.scene,e._lastFramesPerSecond)):e._frameRateIsLow&&(e._frameRateIsLow=!1,e._needsQuietPeriod=!0,e.nominalFrameRate.raiseEvent(e.scene,e._lastFramesPerSecond))}}}}function visibilityChanged(e){document[e._hiddenPropertyName]?e.pause():e.unpause()}function FrameState(e,t,i){this.context=e,this.commandList=[],this.shadowMaps=[],this.textureProjectionMaps=[],this.viewShedMaps=[],this.brdfLutGenerator=void 0,this.environmentMap=void 0,this.sphericalHarmonicCoefficients=void 0,this.specularEnvironmentMaps=void 0,this.specularEnvironmentMapsMaximumLOD=void 0,this.mode=SceneMode$1.SCENE3D,this.morphTime=SceneMode$1.getMorphTime(SceneMode$1.SCENE3D),this.frameNumber=0,this.newFrame=!1,this.time=void 0,this.jobScheduler=i,this.mapProjection=void 0,this.camera=void 0,this.cameraUnderground=!1,this.cullingVolume=void 0,this.occluder=void 0,this.maximumScreenSpaceError=void 0,this.pixelRatio=1,this.passes={render:!1,pick:!1,depth:!1,postProcess:!1,offscreen:!1},this.creditDisplay=t,this.afterRender=[],this.scene3DOnly=!1,this.fog={enabled:!1,density:void 0,sse:void 0,minimumBrightness:void 0},this.terrainExaggeration=1,this.shadowState={shadowsEnabled:!0,lightShadowsEnabled:!0,shadowMaps:[],lightShadowMaps:[],nearPlane:1,farPlane:5e3,closestObjectSize:1e3,lastDirtyTime:0,outOfView:!0},this.textureProjecitonHints={shadowsEnabled:!0,shadowMaps:[],lightShadowMaps:[],nearPlane:1,farPlane:5e3,closestObjectSize:1e3,lastDirtyTime:0,outOfView:!0},this.viewShedState={shadowsEnabled:!0,lightShadowsEnabled:!0,shadowMaps:[],lightShadowMaps:[],nearPlane:1,farPlane:5e3,closestObjectSize:1e3,lastDirtyTime:0,outOfView:!0},this.imagerySplitPosition=0,this.frustumSplits=[],this.backgroundColor=void 0,this.light=void 0,this.minimumDisableDepthTestDistance=void 0,this.invertClassification=!1,this.invertClassificationColor=void 0,this.useLogDepth=!1,this.tilesetPassState=void 0,this.minimumTerrainHeight=0}function FrustumCommands(e,t){this.near=defaultValue(e,0),this.far=defaultValue(t,0);for(var i=Pass$1.NUMBER_OF_PASSES,r=new Array(i),n=new Array(i),a=0;a<i;++a)r[a]=[],n[a]=0;this.commands=r,this.indices=n}Fog.prototype.update=function(e){if(e.fog.enabled=this.enabled){var t=e.camera,i=t.positionCartographic;if(!defined(i)||8e5<i.height||e.mode!==SceneMode$1.SCENE3D)e.fog.enabled=!1;else{var r=i.height,n=findInterval(r),a=CesiumMath.clamp((r-heightsTable[n])/(heightsTable[n+1]-heightsTable[n]),0,1),o=CesiumMath.lerp(densityTable[n],densityTable[n+1],a),s=1e6*this.density;o=o*(s-s/tableStartDensity*tableEndDensity)*1e-6;var l=Cartesian3.normalize(t.positionWC,scratchPositionNormal$1);o*=1-Math.abs(Cartesian3.dot(t.directionWC,l)),e.fog.density=o,e.fog.sse=this.screenSpaceErrorFactor,e.fog.minimumBrightness=this.minimumBrightness}}},FrameRateMonitor.defaultSettings={samplingWindow:5,quietPeriod:2,warmupPeriod:5,minimumFrameRateDuringWarmup:4,minimumFrameRateAfterWarmup:8},FrameRateMonitor.fromScene=function(e){return defined(e._frameRateMonitor)&&!e._frameRateMonitor.isDestroyed()||(e._frameRateMonitor=new FrameRateMonitor({scene:e})),e._frameRateMonitor},Object.defineProperties(FrameRateMonitor.prototype,{scene:{get:function(){return this._scene}},lowFrameRate:{get:function(){return this._lowFrameRate}},nominalFrameRate:{get:function(){return this._nominalFrameRate}},lastFramesPerSecond:{get:function(){return this._lastFramesPerSecond}}}),FrameRateMonitor.prototype.pause=function(){++this._pauseCount,1===this._pauseCount&&(this._frameTimes.length=0,this._lastFramesPerSecond=void 0)},FrameRateMonitor.prototype.unpause=function(){--this._pauseCount,this._pauseCount<=0&&(this._pauseCount=0,this._needsQuietPeriod=!0)},FrameRateMonitor.prototype.isDestroyed=function(){return!1},FrameRateMonitor.prototype.destroy=function(){return this._preUpdateRemoveListener(),defined(this._visibilityChangeRemoveListener)&&this._visibilityChangeRemoveListener(),destroyObject(this)};var GlobeFS="uniform vec4 u_initialColor;\n#if TEXTURE_UNITS > 0\nuniform sampler2D u_dayTextures[TEXTURE_UNITS];\nuniform vec4 u_dayTextureTranslationAndScale[TEXTURE_UNITS];\nuniform bool u_dayTextureUseWebMercatorT[TEXTURE_UNITS];\n#ifdef APPLY_ALPHA\nuniform float u_dayTextureAlpha[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_SPLIT\nuniform float u_dayTextureSplit[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_BRIGHTNESS\nuniform float u_dayTextureBrightness[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_CONTRAST\nuniform float u_dayTextureContrast[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_HUE\nuniform float u_dayTextureHue[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_SATURATION\nuniform float u_dayTextureSaturation[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_GAMMA\nuniform float u_dayTextureOneOverGamma[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_IMAGERY_CUTOUT\nuniform vec4 u_dayTextureCutoutRectangles[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_COLOR_TO_ALPHA\nuniform vec4 u_colorsToAlpha[TEXTURE_UNITS];\n#endif\nuniform vec4 u_dayTextureTexCoordsRectangle[TEXTURE_UNITS];\n#endif\n#ifdef SHOW_REFLECTIVE_OCEAN\nuniform sampler2D u_waterMask;\nuniform vec4 u_waterMaskTranslationAndScale;\nuniform float u_zoomedOutOceanSpecularIntensity;\n#endif\n#ifdef SHOW_OCEAN_WAVES\nuniform sampler2D u_oceanNormalMap;\n#endif\n#if defined(ENABLE_DAYNIGHT_SHADING) || defined(GROUND_ATMOSPHERE)\nuniform vec2 u_lightingFadeDistance;\n#endif\n#ifdef TILE_LIMIT_RECTANGLE\nuniform vec4 u_cartographicLimitRectangle;\n#endif\n#ifdef GROUND_ATMOSPHERE\nuniform vec2 u_nightFadeDistance;\n#endif\n#ifdef ENABLE_CLIPPING_PLANES\nuniform sampler2D u_clippingPlanes;\nuniform mat4 u_clippingPlanesMatrix;\nuniform vec4 u_clippingPlanesEdgeStyle;\n#endif\n#if defined(FOG) && defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING))\nuniform float u_minimumBrightness;\n#endif\n#ifdef COLOR_CORRECT\nuniform vec3 u_hsbShift;\n#endif\n#ifdef HIGHLIGHT_FILL_TILE\nuniform vec4 u_fillHighlightColor;\n#endif\nvarying vec3 v_positionMC;\nvarying vec3 v_positionEC;\nvarying vec3 v_textureCoordinates;\nvarying vec3 v_normalMC;\nvarying vec3 v_normalEC;\n#ifdef APPLY_MATERIAL\nvarying float v_height;\nvarying float v_slope;\nvarying float v_aspect;\n#endif\n#if defined(FOG) || defined(GROUND_ATMOSPHERE)\nvarying float v_distance;\nvarying vec3 v_fogRayleighColor;\nvarying vec3 v_fogMieColor;\n#endif\n#ifdef GROUND_ATMOSPHERE\nvarying vec3 v_rayleighColor;\nvarying vec3 v_mieColor;\n#endif\nvec4 sampleAndBlend(\nvec4 previousColor,\nsampler2D textureToSample,\nvec2 tileTextureCoordinates,\nvec4 textureCoordinateRectangle,\nvec4 textureCoordinateTranslationAndScale,\nfloat textureAlpha,\nfloat textureBrightness,\nfloat textureContrast,\nfloat textureHue,\nfloat textureSaturation,\nfloat textureOneOverGamma,\nfloat split,\nvec4 colorToAlpha)\n{\nvec2 alphaMultiplier = step(textureCoordinateRectangle.st, tileTextureCoordinates);\ntextureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y;\nalphaMultiplier = step(vec2(0.0), textureCoordinateRectangle.pq - tileTextureCoordinates);\ntextureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y;\nvec2 translation = textureCoordinateTranslationAndScale.xy;\nvec2 scale = textureCoordinateTranslationAndScale.zw;\nvec2 textureCoordinates = tileTextureCoordinates * scale + translation;\nvec4 value = texture2D(textureToSample, textureCoordinates);\nvec3 color = value.rgb;\nfloat alpha = value.a;\n#ifdef APPLY_COLOR_TO_ALPHA\nvec3 colorDiff = abs(color.rgb - colorToAlpha.rgb);\ncolorDiff.r = max(max(colorDiff.r, colorDiff.g), colorDiff.b);\nalpha = czm_branchFreeTernary(colorDiff.r < colorToAlpha.a, 0.0, alpha);\n#endif\n#if !defined(APPLY_GAMMA)\nvec4 tempColor = czm_gammaCorrect(vec4(color, alpha));\ncolor = tempColor.rgb;\nalpha = tempColor.a;\n#else\ncolor = pow(color, vec3(textureOneOverGamma));\n#endif\n#ifdef APPLY_SPLIT\nfloat splitPosition = czm_imagerySplitPosition;\nif (split < 0.0 && gl_FragCoord.x > splitPosition) {\nalpha = 0.0;\n}\nelse if (split > 0.0 && gl_FragCoord.x < splitPosition) {\nalpha = 0.0;\n}\n#endif\n#ifdef APPLY_BRIGHTNESS\ncolor = mix(vec3(0.0), color, textureBrightness);\n#endif\n#ifdef APPLY_CONTRAST\ncolor = mix(vec3(0.5), color, textureContrast);\n#endif\n#ifdef APPLY_HUE\ncolor = czm_hue(color, textureHue);\n#endif\n#ifdef APPLY_SATURATION\ncolor = czm_saturation(color, textureSaturation);\n#endif\nfloat sourceAlpha = alpha * textureAlpha;\nfloat outAlpha = mix(previousColor.a, 1.0, sourceAlpha);\noutAlpha += sign(outAlpha) - 1.0;\nvec3 outColor = mix(previousColor.rgb * previousColor.a, color, sourceAlpha) / outAlpha;\nreturn vec4(outColor, max(outAlpha, 0.0));\n}\nvec3 colorCorrect(vec3 rgb) {\n#ifdef COLOR_CORRECT\nvec3 hsb = czm_RGBToHSB(rgb);\nhsb.x += u_hsbShift.x;\nhsb.y = clamp(hsb.y + u_hsbShift.y, 0.0, 1.0);\nhsb.z = hsb.z > czm_epsilon7 ? hsb.z + u_hsbShift.z : 0.0;\nrgb = czm_HSBToRGB(hsb);\n#endif\nreturn rgb;\n}\nvec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates);\nvec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec4 imageryColor, float specularMapValue, float fade);\nvoid main()\n{\n#ifdef TILE_LIMIT_RECTANGLE\nif (v_textureCoordinates.x < u_cartographicLimitRectangle.x || u_cartographicLimitRectangle.z < v_textureCoordinates.x ||\nv_textureCoordinates.y < u_cartographicLimitRectangle.y || u_cartographicLimitRectangle.w < v_textureCoordinates.y)\n{\ndiscard;\n}\n#endif\n#ifdef ENABLE_CLIPPING_PLANES\nfloat clipDistance = clip(gl_FragCoord, u_clippingPlanes, u_clippingPlanesMatrix);\n#endif\nvec4 color = computeDayColor(u_initialColor, clamp(v_textureCoordinates, 0.0, 1.0));\n#ifdef SHOW_TILE_BOUNDARIES\nif (v_textureCoordinates.x < (1.0/256.0) || v_textureCoordinates.x > (255.0/256.0) ||\nv_textureCoordinates.y < (1.0/256.0) || v_textureCoordinates.y > (255.0/256.0))\n{\ncolor = vec4(1.0, 0.0, 0.0, 1.0);\n}\n#endif\n#if defined(SHOW_REFLECTIVE_OCEAN) || defined(ENABLE_DAYNIGHT_SHADING) || defined(HDR)\nvec3 normalMC = czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0));\nvec3 normalEC = czm_normal3D * normalMC;\n#endif\n#if defined(ENABLE_DAYNIGHT_SHADING) || defined(GROUND_ATMOSPHERE)\nfloat cameraDist;\nif (czm_sceneMode == czm_sceneMode2D)\n{\ncameraDist = max(czm_frustumPlanes.x - czm_frustumPlanes.y, czm_frustumPlanes.w - czm_frustumPlanes.z) * 0.5;\n}\nelse if (czm_sceneMode == czm_sceneModeColumbusView)\n{\ncameraDist = -czm_view[3].z;\n}\nelse\n{\ncameraDist = length(czm_view[3]);\n}\nfloat fadeOutDist = u_lightingFadeDistance.x;\nfloat fadeInDist = u_lightingFadeDistance.y;\nif (czm_sceneMode != czm_sceneMode3D) {\nvec3 radii = czm_ellipsoidRadii;\nfloat maxRadii = max(radii.x, max(radii.y, radii.z));\nfadeOutDist -= maxRadii;\nfadeInDist -= maxRadii;\n}\nfloat fade = clamp((cameraDist - fadeOutDist) / (fadeInDist - fadeOutDist), 0.0, 1.0);\n#else\nfloat fade = 0.0;\n#endif\n#ifdef SHOW_REFLECTIVE_OCEAN\nvec2 waterMaskTranslation = u_waterMaskTranslationAndScale.xy;\nvec2 waterMaskScale = u_waterMaskTranslationAndScale.zw;\nvec2 waterMaskTextureCoordinates = v_textureCoordinates.xy * waterMaskScale + waterMaskTranslation;\nwaterMaskTextureCoordinates.y = 1.0 - waterMaskTextureCoordinates.y;\nfloat mask = texture2D(u_waterMask, waterMaskTextureCoordinates).r;\nif (mask > 0.0)\n{\nmat3 enuToEye = czm_eastNorthUpToEyeCoordinates(v_positionMC, normalEC);\nvec2 ellipsoidTextureCoordinates = czm_ellipsoidWgs84TextureCoordinates(normalMC);\nvec2 ellipsoidFlippedTextureCoordinates = czm_ellipsoidWgs84TextureCoordinates(normalMC.zyx);\nvec2 textureCoordinates = mix(ellipsoidTextureCoordinates, ellipsoidFlippedTextureCoordinates, czm_morphTime * smoothstep(0.9, 0.95, normalMC.z));\ncolor = computeWaterColor(v_positionEC, textureCoordinates, enuToEye, color, mask, fade);\n}\n#endif\n#ifdef APPLY_MATERIAL\nczm_materialInput materialInput;\nmaterialInput.st = v_textureCoordinates.st;\nmaterialInput.normalEC = normalize(v_normalEC);\nmaterialInput.slope = v_slope;\nmaterialInput.height = v_height;\nmaterialInput.aspect = v_aspect;\nczm_material material = czm_getMaterial(materialInput);\ncolor.xyz = mix(color.xyz, material.diffuse, material.alpha);\n#endif\n#ifdef ENABLE_VERTEX_LIGHTING\nfloat diffuseIntensity = clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalize(v_normalEC)) * 0.9 + 0.3, 0.0, 1.0);\nvec4 finalColor = vec4(color.rgb * czm_lightColor * diffuseIntensity, color.a);\n#elif defined(ENABLE_DAYNIGHT_SHADING)\nfloat diffuseIntensity = clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * 5.0 + 0.3, 0.0, 1.0);\ndiffuseIntensity = mix(1.0, diffuseIntensity, fade);\nvec4 finalColor = vec4(color.rgb * czm_lightColor * diffuseIntensity, color.a);\n#else\nvec4 finalColor = color;\n#endif\n#ifdef ENABLE_CLIPPING_PLANES\nvec4 clippingPlanesEdgeColor = vec4(1.0);\nclippingPlanesEdgeColor.rgb = u_clippingPlanesEdgeStyle.rgb;\nfloat clippingPlanesEdgeWidth = u_clippingPlanesEdgeStyle.a;\nif (clipDistance < clippingPlanesEdgeWidth)\n{\nfinalColor = clippingPlanesEdgeColor;\n}\n#endif\n#ifdef HIGHLIGHT_FILL_TILE\nfinalColor = vec4(mix(finalColor.rgb, u_fillHighlightColor.rgb, u_fillHighlightColor.a), finalColor.a);\n#endif\n#if defined(FOG) || defined(GROUND_ATMOSPHERE)\nvec3 fogColor = colorCorrect(v_fogMieColor) + finalColor.rgb * colorCorrect(v_fogRayleighColor);\n#ifndef HDR\nconst float fExposure = 2.0;\nfogColor = vec3(1.0) - exp(-fExposure * fogColor);\n#endif\n#endif\n#if defined(DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN)\nvec3 atmosphereLightDirection = czm_sunDirectionWC;\n#else\nvec3 atmosphereLightDirection = czm_lightDirectionWC;\n#endif\n#ifdef FOG\n#if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING))\nfloat darken = clamp(dot(normalize(czm_viewerPositionWC), atmosphereLightDirection), u_minimumBrightness, 1.0);\nfogColor *= darken;\n#endif\n#ifdef HDR\nconst float modifier = 0.15;\nfinalColor = vec4(czm_fog(v_distance, finalColor.rgb, fogColor, modifier), finalColor.a);\n#else\nfinalColor = vec4(czm_fog(v_distance, finalColor.rgb, fogColor), finalColor.a);\n#endif\n#endif\n#ifdef GROUND_ATMOSPHERE\nif (czm_sceneMode != czm_sceneMode3D)\n{\ngl_FragColor = finalColor;\nreturn;\n}\n#if defined(PER_FRAGMENT_GROUND_ATMOSPHERE) && defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_DAYNIGHT_SHADING) || defined(ENABLE_VERTEX_LIGHTING))\nfloat mpp = czm_metersPerPixel(vec4(0.0, 0.0, -czm_currentFrustum.x, 1.0), 1.0);\nvec2 xy = gl_FragCoord.xy / czm_viewport.zw * 2.0 - vec2(1.0);\nxy *= czm_viewport.zw * mpp * 0.5;\nvec3 direction = normalize(vec3(xy, -czm_currentFrustum.x));\nczm_ray ray = czm_ray(vec3(0.0), direction);\nvec3 ellipsoid_center = czm_view[3].xyz;\nczm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid_center, czm_ellipsoidInverseRadii);\nvec3 ellipsoidPosition = czm_pointAlongRay(ray, intersection.start);\nellipsoidPosition = (czm_inverseView * vec4(ellipsoidPosition, 1.0)).xyz;\nAtmosphereColor atmosColor = computeGroundAtmosphereFromSpace(ellipsoidPosition, true, atmosphereLightDirection);\nvec3 groundAtmosphereColor = colorCorrect(atmosColor.mie) + finalColor.rgb * colorCorrect(atmosColor.rayleigh);\n#ifndef HDR\ngroundAtmosphereColor = vec3(1.0) - exp(-fExposure * groundAtmosphereColor);\n#endif\nfadeInDist = u_nightFadeDistance.x;\nfadeOutDist = u_nightFadeDistance.y;\nfloat sunlitAtmosphereIntensity = clamp((cameraDist - fadeOutDist) / (fadeInDist - fadeOutDist), 0.0, 1.0);\n#ifdef HDR\nsunlitAtmosphereIntensity = max(sunlitAtmosphereIntensity * sunlitAtmosphereIntensity, 0.03);\n#endif\ngroundAtmosphereColor = mix(groundAtmosphereColor, fogColor, sunlitAtmosphereIntensity);\n#else\nvec3 groundAtmosphereColor = fogColor;\n#endif\n#ifdef HDR\ngroundAtmosphereColor = czm_saturation(groundAtmosphereColor, 1.6);\n#endif\nfinalColor = vec4(mix(finalColor.rgb, groundAtmosphereColor, fade), finalColor.a);\n#endif\ngl_FragColor = finalColor;\n}\n#ifdef SHOW_REFLECTIVE_OCEAN\nfloat waveFade(float edge0, float edge1, float x)\n{\nfloat y = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);\nreturn pow(1.0 - y, 5.0);\n}\nfloat linearFade(float edge0, float edge1, float x)\n{\nreturn clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);\n}\nconst float oceanFrequencyLowAltitude = 825000.0;\nconst float oceanAnimationSpeedLowAltitude = 0.004;\nconst float oceanOneOverAmplitudeLowAltitude = 1.0 / 2.0;\nconst float oceanSpecularIntensity = 0.5;\nconst float oceanFrequencyHighAltitude = 125000.0;\nconst float oceanAnimationSpeedHighAltitude = 0.008;\nconst float oceanOneOverAmplitudeHighAltitude = 1.0 / 2.0;\nvec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec4 imageryColor, float maskValue, float fade)\n{\nvec3 positionToEyeEC = -positionEyeCoordinates;\nfloat positionToEyeECLength = length(positionToEyeEC);\nvec3 normalizedPositionToEyeEC = normalize(normalize(positionToEyeEC));\nfloat waveIntensity = waveFade(70000.0, 1000000.0, positionToEyeECLength);\n#ifdef SHOW_OCEAN_WAVES\nfloat time = czm_frameNumber * oceanAnimationSpeedHighAltitude;\nvec4 noise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequencyHighAltitude, time, 0.0);\nvec3 normalTangentSpaceHighAltitude = vec3(noise.xy, noise.z * oceanOneOverAmplitudeHighAltitude);\ntime = czm_frameNumber * oceanAnimationSpeedLowAltitude;\nnoise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequencyLowAltitude, time, 0.0);\nvec3 normalTangentSpaceLowAltitude = vec3(noise.xy, noise.z * oceanOneOverAmplitudeLowAltitude);\nfloat highAltitudeFade = linearFade(0.0, 60000.0, positionToEyeECLength);\nfloat lowAltitudeFade = 1.0 - linearFade(20000.0, 60000.0, positionToEyeECLength);\nvec3 normalTangentSpace =\n(highAltitudeFade * normalTangentSpaceHighAltitude) +\n(lowAltitudeFade * normalTangentSpaceLowAltitude);\nnormalTangentSpace = normalize(normalTangentSpace);\nnormalTangentSpace.xy *= waveIntensity;\nnormalTangentSpace = normalize(normalTangentSpace);\n#else\nvec3 normalTangentSpace = vec3(0.0, 0.0, 1.0);\n#endif\nvec3 normalEC = enuToEye * normalTangentSpace;\nconst vec3 waveHighlightColor = vec3(0.3, 0.45, 0.6);\nfloat diffuseIntensity = czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * maskValue;\nvec3 diffuseHighlight = waveHighlightColor * diffuseIntensity * (1.0 - fade);\n#ifdef SHOW_OCEAN_WAVES\nfloat tsPerturbationRatio = normalTangentSpace.z;\nvec3 nonDiffuseHighlight = mix(waveHighlightColor * 5.0 * (1.0 - tsPerturbationRatio), vec3(0.0), diffuseIntensity);\n#else\nvec3 nonDiffuseHighlight = vec3(0.0);\n#endif\nfloat specularIntensity = czm_getSpecular(czm_lightDirectionEC, normalizedPositionToEyeEC, normalEC, 10.0);\nfloat surfaceReflectance = mix(0.0, mix(u_zoomedOutOceanSpecularIntensity, oceanSpecularIntensity, waveIntensity), maskValue);\nfloat specular = specularIntensity * surfaceReflectance;\n#ifdef HDR\nspecular *= 1.4;\nfloat e = 0.2;\nfloat d = 3.3;\nfloat c = 1.7;\nvec3 color = imageryColor.rgb + (c * (vec3(e) + imageryColor.rgb * d) * (diffuseHighlight + nonDiffuseHighlight + specular));\n#else\nvec3 color = imageryColor.rgb + diffuseHighlight + nonDiffuseHighlight + specular;\n#endif\nreturn vec4(color, imageryColor.a);\n}\n#endif // #ifdef SHOW_REFLECTIVE_OCEAN\n",GlobeVS="#ifdef QUANTIZATION_BITS12\nattribute vec4 compressed0;\nattribute float compressed1;\n#else\nattribute vec4 position3DAndHeight;\nattribute vec4 textureCoordAndEncodedNormals;\n#endif\nuniform vec3 u_center3D;\nuniform mat4 u_modifiedModelView;\nuniform mat4 u_modifiedModelViewProjection;\nuniform vec4 u_tileRectangle;\nuniform vec2 u_southAndNorthLatitude;\nuniform vec2 u_southMercatorYAndOneOverHeight;\nvarying vec3 v_positionMC;\nvarying vec3 v_positionEC;\nvarying vec3 v_textureCoordinates;\nvarying vec3 v_normalMC;\nvarying vec3 v_normalEC;\n#ifdef APPLY_MATERIAL\nvarying float v_slope;\nvarying float v_aspect;\nvarying float v_height;\n#endif\n#if defined(FOG) || defined(GROUND_ATMOSPHERE)\nvarying float v_distance;\nvarying vec3 v_fogMieColor;\nvarying vec3 v_fogRayleighColor;\n#endif\nvec4 getPosition(vec3 position, float height, vec2 textureCoordinates);\nfloat get2DYPositionFraction(vec2 textureCoordinates);\nvec4 getPosition3DMode(vec3 position, float height, vec2 textureCoordinates)\n{\nreturn u_modifiedModelViewProjection * vec4(position, 1.0);\n}\nfloat get2DMercatorYPositionFraction(vec2 textureCoordinates)\n{\nconst float maxTileWidth = 0.003068;\nfloat positionFraction = textureCoordinates.y;\nfloat southLatitude = u_southAndNorthLatitude.x;\nfloat northLatitude = u_southAndNorthLatitude.y;\nif (northLatitude - southLatitude > maxTileWidth)\n{\nfloat southMercatorY = u_southMercatorYAndOneOverHeight.x;\nfloat oneOverMercatorHeight = u_southMercatorYAndOneOverHeight.y;\nfloat currentLatitude = mix(southLatitude, northLatitude, textureCoordinates.y);\ncurrentLatitude = clamp(currentLatitude, -czm_webMercatorMaxLatitude, czm_webMercatorMaxLatitude);\npositionFraction = czm_latitudeToWebMercatorFraction(currentLatitude, southMercatorY, oneOverMercatorHeight);\n}\nreturn positionFraction;\n}\nfloat get2DGeographicYPositionFraction(vec2 textureCoordinates)\n{\nreturn textureCoordinates.y;\n}\nvec4 getPositionPlanarEarth(vec3 position, float height, vec2 textureCoordinates)\n{\nfloat yPositionFraction = get2DYPositionFraction(textureCoordinates);\nvec4 rtcPosition2D = vec4(height, mix(u_tileRectangle.st, u_tileRectangle.pq, vec2(textureCoordinates.x, yPositionFraction)), 1.0);\nreturn u_modifiedModelViewProjection * rtcPosition2D;\n}\nvec4 getPosition2DMode(vec3 position, float height, vec2 textureCoordinates)\n{\nreturn getPositionPlanarEarth(position, 0.0, textureCoordinates);\n}\nvec4 getPositionColumbusViewMode(vec3 position, float height, vec2 textureCoordinates)\n{\nreturn getPositionPlanarEarth(position, height, textureCoordinates);\n}\nvec4 getPositionMorphingMode(vec3 position, float height, vec2 textureCoordinates)\n{\nvec3 position3DWC = position + u_center3D;\nfloat yPositionFraction = get2DYPositionFraction(textureCoordinates);\nvec4 position2DWC = vec4(height, mix(u_tileRectangle.st, u_tileRectangle.pq, vec2(textureCoordinates.x, yPositionFraction)), 1.0);\nvec4 morphPosition = czm_columbusViewMorph(position2DWC, vec4(position3DWC, 1.0), czm_morphTime);\nreturn czm_modelViewProjection * morphPosition;\n}\n#ifdef QUANTIZATION_BITS12\nuniform vec2 u_minMaxHeight;\nuniform mat4 u_scaleAndBias;\n#endif\nvoid main()\n{\n#ifdef QUANTIZATION_BITS12\nvec2 xy = czm_decompressTextureCoordinates(compressed0.x);\nvec2 zh = czm_decompressTextureCoordinates(compressed0.y);\nvec3 position = vec3(xy, zh.x);\nfloat height = zh.y;\nvec2 textureCoordinates = czm_decompressTextureCoordinates(compressed0.z);\nheight = height * (u_minMaxHeight.y - u_minMaxHeight.x) + u_minMaxHeight.x;\nposition = (u_scaleAndBias * vec4(position, 1.0)).xyz;\n#if (defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL)) && defined(INCLUDE_WEB_MERCATOR_Y)\nfloat webMercatorT = czm_decompressTextureCoordinates(compressed0.w).x;\nfloat encodedNormal = compressed1;\n#elif defined(INCLUDE_WEB_MERCATOR_Y)\nfloat webMercatorT = czm_decompressTextureCoordinates(compressed0.w).x;\nfloat encodedNormal = 0.0;\n#elif defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL)\nfloat webMercatorT = textureCoordinates.y;\nfloat encodedNormal = compressed0.w;\n#else\nfloat webMercatorT = textureCoordinates.y;\nfloat encodedNormal = 0.0;\n#endif\n#else\nvec3 position = position3DAndHeight.xyz;\nfloat height = position3DAndHeight.w;\nvec2 textureCoordinates = textureCoordAndEncodedNormals.xy;\n#if (defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL)) && defined(INCLUDE_WEB_MERCATOR_Y)\nfloat webMercatorT = textureCoordAndEncodedNormals.z;\nfloat encodedNormal = textureCoordAndEncodedNormals.w;\n#elif defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL)\nfloat webMercatorT = textureCoordinates.y;\nfloat encodedNormal = textureCoordAndEncodedNormals.z;\n#elif defined(INCLUDE_WEB_MERCATOR_Y)\nfloat webMercatorT = textureCoordAndEncodedNormals.z;\nfloat encodedNormal = 0.0;\n#else\nfloat webMercatorT = textureCoordinates.y;\nfloat encodedNormal = 0.0;\n#endif\n#endif\nvec3 position3DWC = position + u_center3D;\ngl_Position = getPosition(position, height, textureCoordinates);\nv_textureCoordinates = vec3(textureCoordinates, webMercatorT);\n#if defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL)\nv_positionEC = (u_modifiedModelView * vec4(position, 1.0)).xyz;\nv_positionMC = position3DWC;\nvec3 normalMC = czm_octDecode(encodedNormal);\nv_normalMC = normalMC;\nv_normalEC = czm_normal3D * v_normalMC;\n#elif defined(SHOW_REFLECTIVE_OCEAN) || defined(ENABLE_DAYNIGHT_SHADING) || defined(GENERATE_POSITION) || defined(HDR)\nv_positionEC = (u_modifiedModelView * vec4(position, 1.0)).xyz;\nv_positionMC = position3DWC;\n#endif\n#if defined(FOG) || defined(GROUND_ATMOSPHERE)\nAtmosphereColor atmosFogColor = computeGroundAtmosphereFromSpace(position3DWC, false, vec3(0.0));\nv_fogMieColor = atmosFogColor.mie;\nv_fogRayleighColor = atmosFogColor.rayleigh;\nv_distance = length((czm_modelView3D * vec4(position3DWC, 1.0)).xyz);\n#endif\n#ifdef APPLY_MATERIAL\nfloat northPoleZ = czm_ellipsoidRadii.z;\nvec3 northPolePositionMC = vec3(0.0, 0.0, northPoleZ);\nvec3 ellipsoidNormal = normalize(v_positionMC);\nvec3 vectorEastMC = normalize(cross(northPolePositionMC - v_positionMC, ellipsoidNormal));\nfloat dotProd = abs(dot(ellipsoidNormal, v_normalMC));\nv_slope = acos(dotProd);\nvec3 normalRejected = ellipsoidNormal * dotProd;\nvec3 normalProjected = v_normalMC - normalRejected;\nvec3 aspectVector = normalize(normalProjected);\nv_aspect = acos(dot(aspectVector, vectorEastMC));\nfloat determ = dot(cross(vectorEastMC, aspectVector), ellipsoidNormal);\nv_aspect = czm_branchFreeTernary(determ < 0.0, 2.0 * czm_pi - v_aspect, v_aspect);\nv_height = height;\n#endif\n}\n",GroundAtmosphere="const float Kr = 0.0025;\nconst float Km = 0.0015;\nconst float ESun = 15.0;\nconst float fKrESun = Kr * ESun;\nconst float fKmESun = Km * ESun;\nconst float fKr4PI = Kr * 4.0 * czm_pi;\nconst float fKm4PI = Km * 4.0 * czm_pi;\nconst vec3 v3InvWavelength = vec3(5.60204474633241, 9.473284437923038, 19.64380261047721);\nconst float fScaleDepth = 0.25;\nstruct AtmosphereColor\n{\nvec3 mie;\nvec3 rayleigh;\n};\nconst int nSamples = 2;\nconst float fSamples = 2.0;\nfloat scale(float fCos)\n{\nfloat x = 1.0 - fCos;\nreturn fScaleDepth * exp(-0.00287 + x*(0.459 + x*(3.83 + x*(-6.80 + x*5.25))));\n}\nAtmosphereColor computeGroundAtmosphereFromSpace(vec3 v3Pos, bool dynamicLighting, vec3 lightDirectionWC)\n{\nfloat fInnerRadius = czm_ellipsoidRadii.x;\nfloat fOuterRadius = czm_ellipsoidRadii.x * 1.025;\nfloat fOuterRadius2 = fOuterRadius * fOuterRadius;\nfloat fScale = 1.0 / (fOuterRadius - fInnerRadius);\nfloat fScaleOverScaleDepth = fScale / fScaleDepth;\nvec3 v3Ray = v3Pos - czm_viewerPositionWC;\nfloat fFar = length(v3Ray);\nv3Ray /= fFar;\nfloat fCameraHeight = length(czm_viewerPositionWC);\nfloat fCameraHeight2 = fCameraHeight * fCameraHeight;\nfloat B = 2.0 * length(czm_viewerPositionWC) * dot(normalize(czm_viewerPositionWC), v3Ray);\nfloat C = fCameraHeight2 - fOuterRadius2;\nfloat fDet = max(0.0, B*B - 4.0 * C);\nfloat fNear = 0.5 * (-B - sqrt(fDet));\nvec3 v3Start = czm_viewerPositionWC + v3Ray * fNear;\nfFar -= fNear;\nfloat fDepth = exp((fInnerRadius - fOuterRadius) / fScaleDepth);\nfloat fLightAngle = czm_branchFreeTernary(dynamicLighting, dot(lightDirectionWC, v3Pos) / length(v3Pos), 1.0);\nfloat fCameraAngle = dot(-v3Ray, v3Pos) / length(v3Pos);\nfloat fCameraScale = scale(fCameraAngle);\nfloat fLightScale = scale(fLightAngle);\nfloat fCameraOffset = fDepth*fCameraScale;\nfloat fTemp = (fLightScale + fCameraScale);\nfloat fSampleLength = fFar / fSamples;\nfloat fScaledLength = fSampleLength * fScale;\nvec3 v3SampleRay = v3Ray * fSampleLength;\nvec3 v3SamplePoint = v3Start + v3SampleRay * 0.5;\nvec3 v3FrontColor = vec3(0.0);\nvec3 v3Attenuate = vec3(0.0);\nfor(int i=0; i<nSamples; i++)\n{\nfloat fHeight = length(v3SamplePoint);\nfloat fDepth = exp(fScaleOverScaleDepth * (fInnerRadius - fHeight));\nfloat fScatter = fDepth*fTemp - fCameraOffset;\nv3Attenuate = exp(-fScatter * (v3InvWavelength * fKr4PI + fKm4PI));\nv3FrontColor += v3Attenuate * (fDepth * fScaledLength);\nv3SamplePoint += v3SampleRay;\n}\nAtmosphereColor color;\ncolor.mie = v3FrontColor * (v3InvWavelength * fKrESun + fKmESun);\ncolor.rayleigh = v3Attenuate;\nreturn color;\n}\n";function GlobeSurfaceShader(e,t,i,r,n){this.numberOfDayTextures=e,this.flags=t,this.material=i,this.shaderProgram=r,this.clippingShaderState=n}function GlobeSurfaceShaderSet(){this.baseVertexShaderSource=void 0,this.baseFragmentShaderSource=void 0,this._shadersByTexturesFlags=[],this.material=void 0}function getPositionMode(e){var t;switch(e){case SceneMode$1.SCENE3D:t="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPosition3DMode(position, height, textureCoordinates); }";break;case SceneMode$1.SCENE2D:case SceneMode$1.COLUMBUS_VIEW:t="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionColumbusViewMode(position, height, textureCoordinates); }";break;case SceneMode$1.MORPHING:t="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionMorphingMode(position, height, textureCoordinates); }"}return t}function get2DYPositionFraction(e){return e?"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DMercatorYPositionFraction(textureCoordinates); }":"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DGeographicYPositionFraction(textureCoordinates); }"}GlobeSurfaceShaderSet.prototype.getShaderProgram=function(e){var t=e.frameState,i=e.surfaceTile,r=e.numberOfDayTextures,n=e.applyBrightness,a=e.applyContrast,o=e.applyHue,s=e.applySaturation,l=e.applyGamma,u=e.applyAlpha,c=e.applySplit,d=e.showReflectiveOcean,h=e.showOceanWaves,p=e.enableLighting,f=e.dynamicAtmosphereLighting,m=e.dynamicAtmosphereLightingFromSun,g=e.showGroundAtmosphere,y=e.perFragmentGroundAtmosphere,v=e.hasVertexNormals,_=e.useWebMercatorProjection,C=e.enableFog,x=e.enableClippingPlanes,b=e.clippingPlanes,A=e.clippedByBoundaries,S=e.hasImageryLayerCutout,w=e.colorCorrect,E=e.highlightFillTile,T=e.colorToAlpha,P=0,M="",D=i.renderedMesh.encoding;D.quantization===TerrainQuantization$1.BITS12&&(P=1,M="QUANTIZATION_BITS12");var I=0,O="";A&&(I=1,O="TILE_LIMIT_RECTANGLE");var R=0,L="";S&&(R=1,L="APPLY_IMAGERY_CUTOUT");var N=t.mode,k=N|n<<2|a<<3|o<<4|s<<5|l<<6|u<<7|d<<8|h<<9|p<<10|f<<11|m<<12|g<<13|y<<14|v<<15|_<<16|C<<17|P<<18|c<<19|x<<20|I<<21|R<<22|w<<23|E<<24|T<<25,B=0;defined(b)&&0<b.length&&(B=x?b.clippingPlanesState:0);var F=i.surfaceShader;if(defined(F)&&F.numberOfDayTextures===r&&F.flags===k&&F.material===this.material&&F.clippingShaderState===B)return F.shaderProgram;var V=this._shadersByTexturesFlags[r];if(defined(V)||(V=this._shadersByTexturesFlags[r]=[]),!defined(F=V[k])||F.material!==this.material||F.clippingShaderState!==B){var z=this.baseVertexShaderSource.clone(),U=this.baseFragmentShaderSource.clone();0!==B&&U.sources.unshift(getClippingFunction(b,t.context)),z.defines.push(M),U.defines.push("TEXTURE_UNITS "+r,O,L),n&&U.defines.push("APPLY_BRIGHTNESS"),a&&U.defines.push("APPLY_CONTRAST"),o&&U.defines.push("APPLY_HUE"),s&&U.defines.push("APPLY_SATURATION"),l&&U.defines.push("APPLY_GAMMA"),u&&U.defines.push("APPLY_ALPHA"),d&&(U.defines.push("SHOW_REFLECTIVE_OCEAN"),z.defines.push("SHOW_REFLECTIVE_OCEAN")),h&&U.defines.push("SHOW_OCEAN_WAVES"),T&&U.defines.push("APPLY_COLOR_TO_ALPHA"),p&&(v?(z.defines.push("ENABLE_VERTEX_LIGHTING"),U.defines.push("ENABLE_VERTEX_LIGHTING")):(z.defines.push("ENABLE_DAYNIGHT_SHADING"),U.defines.push("ENABLE_DAYNIGHT_SHADING"))),f&&(U.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),m&&U.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN")),g&&(z.defines.push("GROUND_ATMOSPHERE"),U.defines.push("GROUND_ATMOSPHERE"),y&&U.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE")),z.defines.push("INCLUDE_WEB_MERCATOR_Y"),U.defines.push("INCLUDE_WEB_MERCATOR_Y"),C&&(z.defines.push("FOG"),U.defines.push("FOG")),c&&U.defines.push("APPLY_SPLIT"),x&&U.defines.push("ENABLE_CLIPPING_PLANES"),w&&U.defines.push("COLOR_CORRECT"),E&&U.defines.push("HIGHLIGHT_FILL_TILE");var G=" vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates)\n {\n vec4 color = initialColor;\n";S&&(G+=" vec4 cutoutAndColorResult;\n bool texelUnclipped;\n");for(var $=0;$<r;++$)G+=S?" cutoutAndColorResult = u_dayTextureCutoutRectangles["+$+"];\n texelUnclipped = v_textureCoordinates.x < cutoutAndColorResult.x || cutoutAndColorResult.z < v_textureCoordinates.x || v_textureCoordinates.y < cutoutAndColorResult.y || cutoutAndColorResult.w < v_textureCoordinates.y;\n cutoutAndColorResult = sampleAndBlend(\n":" color = sampleAndBlend(\n",G+=" color,\n u_dayTextures["+$+"],\n u_dayTextureUseWebMercatorT["+$+"] ? textureCoordinates.xz : textureCoordinates.xy,\n u_dayTextureTexCoordsRectangle["+$+"],\n u_dayTextureTranslationAndScale["+$+"],\n "+(u?"u_dayTextureAlpha["+$+"]":"1.0")+",\n "+(n?"u_dayTextureBrightness["+$+"]":"0.0")+",\n "+(a?"u_dayTextureContrast["+$+"]":"0.0")+",\n "+(o?"u_dayTextureHue["+$+"]":"0.0")+",\n "+(s?"u_dayTextureSaturation["+$+"]":"0.0")+",\n "+(l?"u_dayTextureOneOverGamma["+$+"]":"0.0")+",\n "+(c?"u_dayTextureSplit["+$+"]":"0.0")+",\n "+(T?"u_colorsToAlpha["+$+"]":"vec4(0.0)")+"\n );\n",S&&(G+=" color = czm_branchFreeTernary(texelUnclipped, cutoutAndColorResult, color);\n");G+=" return color;\n }",U.sources.push(G),z.sources.push(getPositionMode(N)),z.sources.push(get2DYPositionFraction(_));var H=ShaderProgram.fromCache({context:t.context,vertexShaderSource:z,fragmentShaderSource:U,attributeLocations:D.getAttributeLocations()});F=V[k]=new GlobeSurfaceShader(r,k,this.material,H,B)}return(i.surfaceShader=F).shaderProgram},GlobeSurfaceShaderSet.prototype.destroy=function(){var e,t,i=this._shadersByTexturesFlags;for(var r in i)if(i.hasOwnProperty(r)){var n=i[r];if(!defined(n))continue;for(e in n)n.hasOwnProperty(e)&&defined(t=n[e])&&t.shaderProgram.destroy()}return destroyObject(this)};var ImageryState={UNLOADED:0,TRANSITIONING:1,RECEIVED:2,TEXTURE_LOADED:3,READY:4,FAILED:5,INVALID:6,PLACEHOLDER:7},ImageryState$1=Object.freeze(ImageryState),QuadtreeTileLoadState={START:0,LOADING:1,DONE:2,FAILED:3},QuadtreeTileLoadState$1=Object.freeze(QuadtreeTileLoadState),TerrainState$1={FAILED:0,UNLOADED:1,RECEIVING:2,RECEIVED:3,TRANSFORMING:4,TRANSFORMED:5,READY:6},TerrainState$2=Object.freeze(TerrainState$1);function GlobeSurfaceTile(){this.imagery=[],this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new Cartesian4(0,0,1,1),this.terrainData=void 0,this.vertexArray=void 0,this.orientedBoundingBox=void 0,this.boundingVolumeSourceTile=void 0,this.tileBoundingRegion=void 0,this.occludeePointInScaledSpace=new Cartesian3,this.terrainState=TerrainState$2.UNLOADED,this.mesh=void 0,this.fill=void 0,this.pickBoundingSphere=new BoundingSphere,this.surfaceShader=void 0,this.isClipped=!0,this.clippedByBoundaries=!1}function getPosition$2(e,t,i,r,n,a){if(e.decodePosition(r,n,a),defined(t)&&t!==SceneMode$1.SCENE3D){var o=i.ellipsoid.cartesianToCartographic(a);i.project(o,a),Cartesian3.fromElements(a.z,a.x,a.y,a)}return a}Object.defineProperties(GlobeSurfaceTile.prototype,{eligibleForUnloading:{get:function(){for(var e=this.terrainState,t=!(e===TerrainState$2.RECEIVING||e===TerrainState$2.TRANSFORMING),i=this.imagery,r=0,n=i.length;t&&r<n;++r){var a=i[r];t=!defined(a.loadingImagery)||a.loadingImagery.state!==ImageryState$1.TRANSITIONING}return t}},renderedMesh:{get:function(){return defined(this.vertexArray)?this.mesh:defined(this.fill)?this.fill.mesh:void 0}}});var scratchV0=new Cartesian3,scratchV1=new Cartesian3,scratchV2=new Cartesian3;function prepareNewTile(e,t,i){var r=t.getTileDataAvailable(e.x,e.y,e.level);if(!defined(r)&&defined(e.parent)){var n=e.parent,a=n.data;defined(a)&&defined(a.terrainData)&&(r=a.terrainData.isChildAvailable(n.x,n.y,e.x,e.y))}!1===r&&(e.data.terrainState=TerrainState$2.FAILED);for(var o=0,s=i.length;o<s;++o){var l=i.get(o);l.show&&l._createTileImagerySkeletons(e,t)}}function processTerrainStateMachine(e,t,i,r,n){var a=e.data,o=e.parent;a.terrainState===TerrainState$2.FAILED&&void 0!==o&&(void 0!==o.data&&void 0!==o.data.terrainData&&!1!==o.data.terrainData.canUpsample||GlobeSurfaceTile.processStateMachine(o,t,i,r,!0));if(a.terrainState===TerrainState$2.FAILED&&upsample(a,e,t,i,e.x,e.y,e.level),a.terrainState===TerrainState$2.UNLOADED&&requestTileGeometry$1(a,i,e.x,e.y,e.level),a.terrainState===TerrainState$2.RECEIVED&&transform$1(a,t,i,e.x,e.y,e.level),a.terrainState===TerrainState$2.TRANSFORMED&&createResources$4(a,t.context,i,e.x,e.y,e.level,n),a.terrainState>=TerrainState$2.RECEIVED&&void 0===a.waterMaskTexture&&i.hasWaterMask)if(void 0!==a.terrainData.waterMask)createWaterMaskTextureIfNeeded(t.context,a);else{var s=a._findAncestorTileWithTerrainData(e);defined(s)&&defined(s.data.waterMaskTexture)&&(a.waterMaskTexture=s.data.waterMaskTexture,++a.waterMaskTexture.referenceCount,a._computeWaterMaskTranslationAndScale(e,s,a.waterMaskTranslationAndScale))}}function upsample(t,e,i,r,n,a,o){var s=e.parent;if(s){var l=s.data.terrainData,u=s.x,c=s.y,d=s.level;if(defined(l)){var h=l.upsample(r.tilingScheme,u,c,d,n,a,o);defined(h)&&(t.terrainState=TerrainState$2.RECEIVING,when(h,function(e){t.terrainData=e,t.terrainState=TerrainState$2.RECEIVED},function(){t.terrainState=TerrainState$2.FAILED}))}}else e.state=QuadtreeTileLoadState$1.FAILED}function requestTileGeometry$1(i,r,n,a,o){function s(e){i.terrainData=e,i.terrainState=TerrainState$2.RECEIVED,i.request=void 0}function l(){if(i.request.state===RequestState$1.CANCELLED)return i.terrainData=void 0,i.terrainState=TerrainState$2.UNLOADED,void(i.request=void 0);i.terrainState=TerrainState$2.FAILED,i.request=void 0;var e="Failed to obtain terrain tile X: "+n+" Y: "+a+" Level: "+o+".";r._requestError=TileProviderError.handleError(r._requestError,r,r.errorEvent,e,n,a,o,t)}function t(){var e=new Request({throttle:!1,throttleByServer:!0,type:RequestType$1.TERRAIN});i.request=e;var t=r.requestTileGeometry(n,a,o,e);defined(t)?(i.terrainState=TerrainState$2.RECEIVING,when(t,s,l)):(i.terrainState=TerrainState$2.UNLOADED,i.request=void 0)}t()}function transform$1(t,e,i,r,n,a){var o=i.tilingScheme,s=t.terrainData.createMesh(o,r,n,a,e.terrainExaggeration);defined(s)&&(t.terrainState=TerrainState$2.TRANSFORMING,when(s,function(e){t.mesh=e,t.orientedBoundingBox=OrientedBoundingBox.clone(e.orientedBoundingBox,t.orientedBoundingBox),t.occludeePointInScaledSpace=Cartesian3.clone(e.occludeePointInScaledSpace,t.occludeePointInScaledSpace),t.terrainState=TerrainState$2.TRANSFORMED},function(){t.terrainState=TerrainState$2.FAILED}))}function createResources$4(e,t,i,r,n,a,o){e.vertexArray=GlobeSurfaceTile._createVertexArrayForMesh(t,e.mesh),e.terrainState=TerrainState$2.READY,e.fill=e.fill&&e.fill.destroy(o)}function getContextWaterMaskData(e){var t=e.cache.tile_waterMaskData;if(!defined(t)){var i=Texture.create({context:e,pixelFormat:PixelFormat$1.LUMINANCE,pixelDatatype:PixelDatatype$1.UNSIGNED_BYTE,source:{arrayBufferView:new Uint8Array([255]),width:1,height:1}});i.referenceCount=1,t={allWaterTexture:i,sampler:new Sampler({wrapS:TextureWrap$1.CLAMP_TO_EDGE,wrapT:TextureWrap$1.CLAMP_TO_EDGE,minificationFilter:TextureMinificationFilter$1.LINEAR,magnificationFilter:TextureMagnificationFilter$1.LINEAR}),destroy:function(){this.allWaterTexture.destroy()}},e.cache.tile_waterMaskData=t}return t}function createWaterMaskTextureIfNeeded(e,t){var i,r=t.terrainData.waterMask,n=getContextWaterMaskData(e),a=r.length;if(1===a){if(0===r[0])return;i=n.allWaterTexture}else{var o=Math.sqrt(a);(i=Texture.create({context:e,pixelFormat:PixelFormat$1.LUMINANCE,pixelDatatype:PixelDatatype$1.UNSIGNED_BYTE,source:{width:o,height:o,arrayBufferView:r},sampler:n.sampler,flipY:!1})).referenceCount=0}++i.referenceCount,t.waterMaskTexture=i,Cartesian4.fromElements(0,0,1,1,t.waterMaskTranslationAndScale)}GlobeSurfaceTile.prototype.pick=function(e,t,i,r,n){var a=this.renderedMesh;if(defined(a)){for(var o=a.vertices,s=a.indices,l=a.encoding,u=s.length,c=Number.MAX_VALUE,d=0;d<u;d+=3){var h=s[d],p=s[d+1],f=s[d+2],m=getPosition$2(l,t,i,o,h,scratchV0),g=getPosition$2(l,t,i,o,p,scratchV1),y=getPosition$2(l,t,i,o,f,scratchV2),v=IntersectionTests.rayTriangleParametric(e,m,g,y,r);defined(v)&&v<c&&0<=v&&(c=v)}return c!==Number.MAX_VALUE?Ray.getPoint(e,c,n):void 0}},GlobeSurfaceTile.prototype.freeResources=function(){defined(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,0===this.waterMaskTexture.referenceCount&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0),this.terrainData=void 0,this.terrainState=TerrainState$2.UNLOADED,this.mesh=void 0,this.fill=this.fill&&this.fill.destroy();for(var e=this.imagery,t=0,i=e.length;t<i;++t)e[t].freeResources();this.imagery.length=0,this.freeVertexArray()},GlobeSurfaceTile.prototype.freeVertexArray=function(){GlobeSurfaceTile._freeVertexArray(this.vertexArray),this.vertexArray=void 0,GlobeSurfaceTile._freeVertexArray(this.wireframeVertexArray),this.wireframeVertexArray=void 0},GlobeSurfaceTile.initialize=function(e,t,i){var r=e.data;defined(r)||(r=e.data=new GlobeSurfaceTile),e.state===QuadtreeTileLoadState$1.START&&(prepareNewTile(e,t,i),e.state=QuadtreeTileLoadState$1.LOADING)},GlobeSurfaceTile.processStateMachine=function(e,t,i,r,n,a){GlobeSurfaceTile.initialize(e,i,r);var o=e.data;if(e.state===QuadtreeTileLoadState$1.LOADING&&processTerrainStateMachine(e,t,i,r,n),!a){var s=e.renderable;e.renderable=defined(o.vertexArray);var l=o.terrainState===TerrainState$2.READY;e.upsampledFromParent=defined(o.terrainData)&&o.terrainData.wasCreatedByUpsampling();var u=o.processImagery(e,i,t);if(l&&u){var c=e._loadedCallbacks,d={};for(var h in c)c.hasOwnProperty(h)&&(c[h](e)||(d[h]=c[h]));e._loadedCallbacks=d,e.state=QuadtreeTileLoadState$1.DONE}s&&(e.renderable=!0)}},GlobeSurfaceTile.prototype.processImagery=function(e,t,i,r){var n,a,o=e.data,s=e.upsampledFromParent,l=!1,u=!0,c=o.imagery;for(n=0,a=c.length;n<a;++n){var d=c[n];if(defined(d.loadingImagery)){if(d.loadingImagery.state===ImageryState$1.PLACEHOLDER){var h=d.loadingImagery.imageryLayer;if(h.imageryProvider.ready){d.freeResources(),c.splice(n,1),h._createTileImagerySkeletons(e,t,n),--n,a=c.length;continue}s=!1}var p=d.processStateMachine(e,i,r);u=u&&p,l=l||p||defined(d.readyImagery),s=s&&defined(d.loadingImagery)&&(d.loadingImagery.state===ImageryState$1.FAILED||d.loadingImagery.state===ImageryState$1.INVALID)}else s=!1}return e.upsampledFromParent=s,e.renderable=e.renderable&&(l||u),u},GlobeSurfaceTile._createVertexArrayForMesh=function(e,t){var i=t.vertices,r=Buffer$1.createVertexBuffer({context:e,typedArray:i,usage:BufferUsage$1.STATIC_DRAW}),n=t.encoding.getAttributes(r),a=t.indices.indexBuffers||{},o=a[e.id];if(!defined(o)||o.isDestroyed()){var s=t.indices;(o=Buffer$1.createIndexBuffer({context:e,typedArray:s,usage:BufferUsage$1.STATIC_DRAW,indexDatatype:IndexDatatype$1.fromSizeInBytes(s.BYTES_PER_ELEMENT)})).vertexArrayDestroyable=!1,o.referenceCount=1,a[e.id]=o,t.indices.indexBuffers=a}else++o.referenceCount;return new VertexArray({context:e,attributes:n,indexBuffer:o})},GlobeSurfaceTile._freeVertexArray=function(e){if(defined(e)){var t=e.indexBuffer;e.destroy(),defined(t)&&!t.isDestroyed()&&defined(t.referenceCount)&&(--t.referenceCount,0===t.referenceCount&&t.destroy())}},GlobeSurfaceTile.prototype._findAncestorTileWithTerrainData=function(e){for(var t=e.parent;defined(t)&&(!defined(t.data)||!defined(t.data.terrainData)||t.data.terrainData.wasCreatedByUpsampling());)t=t.parent;return t},GlobeSurfaceTile.prototype._computeWaterMaskTranslationAndScale=function(e,t,i){var r=t.rectangle,n=e.rectangle,a=n.width,o=n.height,s=a/r.width,l=o/r.height;return i.x=s*(n.west-r.west)/a,i.y=l*(n.south-r.south)/o,i.z=s,i.w=l,i};var ReprojectWebMercatorFS="uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\ngl_FragColor = texture2D(u_texture, v_textureCoordinates);\n}\n",ReprojectWebMercatorVS="attribute vec4 position;\nattribute float webMercatorT;\nuniform vec2 u_textureDimensions;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nv_textureCoordinates = vec2(position.x, webMercatorT);\ngl_Position = czm_viewportOrthographic * (position * vec4(u_textureDimensions, 1.0, 1.0));\n}\n";function Imagery(e,t,i,r,n){if(this.imageryLayer=e,this.x=t,this.y=i,this.level=r,this.request=void 0,0!==r){var a=t/2|0,o=i/2|0,s=r-1;this.parent=e.getImageryFromCache(a,o,s)}this.state=ImageryState$1.UNLOADED,this.imageUrl=void 0,this.image=void 0,this.texture=void 0,this.textureWebMercator=void 0,this.credits=void 0,this.referenceCount=0,!defined(n)&&e.imageryProvider.ready&&(n=e.imageryProvider.tilingScheme.tileXYToRectangle(t,i,r));this.rectangle=n}Imagery.createPlaceholder=function(e){var t=new Imagery(e,0,0,0);return t.addReference(),t.state=ImageryState$1.PLACEHOLDER,t},Imagery.prototype.addReference=function(){++this.referenceCount},Imagery.prototype.releaseReference=function(){return--this.referenceCount,0===this.referenceCount?(this.imageryLayer.removeImageryFromCache(this),defined(this.parent)&&this.parent.releaseReference(),defined(this.image)&&defined(this.image.destroy)&&this.image.destroy(),defined(this.texture)&&this.texture.destroy(),defined(this.textureWebMercator)&&this.texture!==this.textureWebMercator&&this.textureWebMercator.destroy(),destroyObject(this),0):this.referenceCount},Imagery.prototype.processStateMachine=function(e,t,i){this.state!==ImageryState$1.UNLOADED||i||(this.state=ImageryState$1.TRANSITIONING,this.imageryLayer._requestImagery(this)),this.state===ImageryState$1.RECEIVED&&(this.state=ImageryState$1.TRANSITIONING,this.imageryLayer._createTexture(e.context,this));var r=this.state===ImageryState$1.READY&&t&&!this.texture;this.state!==ImageryState$1.TEXTURE_LOADED&&!r||(this.state=ImageryState$1.TRANSITIONING,this.imageryLayer._reprojectTexture(e,this,t))};var ImagerySplitDirection={LEFT:-1,NONE:0,RIGHT:1},ImagerySplitDirection$1=Object.freeze(ImagerySplitDirection);function TileImagery(e,t,i){this.readyImagery=void 0,this.loadingImagery=e,this.textureCoordinateRectangle=t,this.textureTranslationAndScale=void 0,this.useWebMercatorT=i}function ImageryLayer(e,t){this._imageryProvider=e,t=defaultValue(t,defaultValue.EMPTY_OBJECT),this.alpha=defaultValue(t.alpha,defaultValue(e.defaultAlpha,1)),this.brightness=defaultValue(t.brightness,defaultValue(e.defaultBrightness,ImageryLayer.DEFAULT_BRIGHTNESS)),this.contrast=defaultValue(t.contrast,defaultValue(e.defaultContrast,ImageryLayer.DEFAULT_CONTRAST)),this.hue=defaultValue(t.hue,defaultValue(e.defaultHue,ImageryLayer.DEFAULT_HUE)),this.saturation=defaultValue(t.saturation,defaultValue(e.defaultSaturation,ImageryLayer.DEFAULT_SATURATION)),this.gamma=defaultValue(t.gamma,defaultValue(e.defaultGamma,ImageryLayer.DEFAULT_GAMMA)),this.splitDirection=defaultValue(t.splitDirection,defaultValue(e.defaultSplit,ImageryLayer.DEFAULT_SPLIT)),this.minificationFilter=defaultValue(t.minificationFilter,defaultValue(e.defaultMinificationFilter,ImageryLayer.DEFAULT_MINIFICATION_FILTER)),this.magnificationFilter=defaultValue(t.magnificationFilter,defaultValue(e.defaultMagnificationFilter,ImageryLayer.DEFAULT_MAGNIFICATION_FILTER)),this.show=defaultValue(t.show,!0),this._minimumTerrainLevel=t.minimumTerrainLevel,this._maximumTerrainLevel=t.maximumTerrainLevel,this._rectangle=defaultValue(t.rectangle,Rectangle.MAX_VALUE),this._maximumAnisotropy=t.maximumAnisotropy,this._imageryCache={},this._skeletonPlaceholder=new TileImagery(Imagery.createPlaceholder(this)),this._show=!0,this._layerIndex=-1,this._isBaseLayer=!1,this._requestImageError=void 0,this._reprojectComputeCommands=[],this.cutoutRectangle=t.cutoutRectangle,this.colorToAlpha=t.colorToAlpha,this.colorToAlphaThreshold=defaultValue(t.colorToAlphaThreshold,ImageryLayer.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD)}TileImagery.prototype.freeResources=function(){defined(this.readyImagery)&&this.readyImagery.releaseReference(),defined(this.loadingImagery)&&this.loadingImagery.releaseReference()},TileImagery.prototype.processStateMachine=function(e,t,i){var r=this.loadingImagery,n=r.imageryLayer;if(r.processStateMachine(t,!this.useWebMercatorT,i),r.state===ImageryState$1.READY)return defined(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=this.loadingImagery,this.loadingImagery=void 0,this.textureTranslationAndScale=n._calculateTextureTranslationAndScale(e,this),!0;for(var a,o=r.parent;defined(o)&&(o.state!==ImageryState$1.READY||!this.useWebMercatorT&&!defined(o.texture));)o.state!==ImageryState$1.FAILED&&o.state!==ImageryState$1.INVALID&&(a=a||o),o=o.parent;return this.readyImagery!==o&&(defined(this.readyImagery)&&this.readyImagery.releaseReference(),defined(this.readyImagery=o)&&(o.addReference(),this.textureTranslationAndScale=n._calculateTextureTranslationAndScale(e,this))),(r.state===ImageryState$1.FAILED||r.state===ImageryState$1.INVALID)&&(!defined(a)||(a.processStateMachine(t,!this.useWebMercatorT,i),!1))},Object.defineProperties(ImageryLayer.prototype,{imageryProvider:{get:function(){return this._imageryProvider}},rectangle:{get:function(){return this._rectangle}}}),ImageryLayer.DEFAULT_BRIGHTNESS=1,ImageryLayer.DEFAULT_CONTRAST=1,ImageryLayer.DEFAULT_HUE=0,ImageryLayer.DEFAULT_SATURATION=1,ImageryLayer.DEFAULT_GAMMA=1,ImageryLayer.DEFAULT_SPLIT=ImagerySplitDirection$1.NONE,ImageryLayer.DEFAULT_MINIFICATION_FILTER=TextureMinificationFilter$1.LINEAR,ImageryLayer.DEFAULT_MAGNIFICATION_FILTER=TextureMagnificationFilter$1.LINEAR,ImageryLayer.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD=.004,ImageryLayer.prototype.isBaseLayer=function(){return this._isBaseLayer},ImageryLayer.prototype.isDestroyed=function(){return!1},ImageryLayer.prototype.destroy=function(){return destroyObject(this)};var imageryBoundsScratch=new Rectangle,tileImageryBoundsScratch=new Rectangle,clippedRectangleScratch=new Rectangle,terrainRectangleScratch=new Rectangle;function getSamplerKey(e,t,i){return e+":"+t+":"+i}function getImageryCacheKey(e,t,i){return JSON.stringify([e,t,i])}ImageryLayer.prototype.getViewableRectangle=function(){var e=this._imageryProvider,t=this._rectangle;return e.readyPromise.then(function(){return Rectangle.intersection(e.rectangle,t)})},ImageryLayer.prototype._createTileImagerySkeletons=function(e,t,i){var r=e.data;if(defined(this._minimumTerrainLevel)&&e.level<this._minimumTerrainLevel)return!1;if(defined(this._maximumTerrainLevel)&&e.level>this._maximumTerrainLevel)return!1;var n=this._imageryProvider;if(defined(i)||(i=r.imagery.length),!n.ready)return this._skeletonPlaceholder.loadingImagery.addReference(),r.imagery.splice(i,0,this._skeletonPlaceholder),!0;var a=n.tilingScheme.projection instanceof WebMercatorProjection&&e.rectangle.north<WebMercatorProjection.MaximumLatitude&&e.rectangle.south>-WebMercatorProjection.MaximumLatitude,o=Rectangle.intersection(n.rectangle,this._rectangle,imageryBoundsScratch),s=Rectangle.intersection(e.rectangle,o,tileImageryBoundsScratch);if(!defined(s)){if(!this.isBaseLayer())return!1;var l=o,u=e.rectangle;s=tileImageryBoundsScratch,u.south>=l.north?s.north=s.south=l.north:u.north<=l.south?s.north=s.south=l.south:(s.south=Math.max(u.south,l.south),s.north=Math.min(u.north,l.north)),u.west>=l.east?s.west=s.east=l.east:u.east<=l.west?s.west=s.east=l.west:(s.west=Math.max(u.west,l.west),s.east=Math.min(u.east,l.east))}var c=0;0<s.south?c=s.south:s.north<0&&(c=s.north);var d=getLevelWithMaximumTexelSpacing(this,1*t.getLevelMaximumGeometricError(e.level),c);d=Math.max(0,d);var h=n.maximumLevel;if(h<d&&(d=h),defined(n.minimumLevel)){var p=n.minimumLevel;d<p&&(d=p)}var f=n.tilingScheme,m=f.positionToTileXY(Rectangle.northwest(s),d),g=f.positionToTileXY(Rectangle.southeast(s),d),y=e.rectangle.width/512,v=e.rectangle.height/512,_=f.tileXYToRectangle(m.x,m.y,d);Math.abs(_.south-e.rectangle.north)<v&&m.y<g.y&&++m.y,Math.abs(_.east-e.rectangle.west)<y&&m.x<g.x&&++m.x;var C=f.tileXYToRectangle(g.x,g.y,d);Math.abs(C.north-e.rectangle.south)<v&&g.y>m.y&&--g.y,Math.abs(C.west-e.rectangle.east)<y&&g.x>m.x&&--g.x;var x,b,A=Rectangle.clone(e.rectangle,terrainRectangleScratch),S=f.tileXYToRectangle(m.x,m.y,d),w=Rectangle.intersection(S,o,clippedRectangleScratch);a?(f.rectangleToNativeRectangle(A,A),f.rectangleToNativeRectangle(S,S),f.rectangleToNativeRectangle(w,w),f.rectangleToNativeRectangle(o,o),x=f.tileXYToNativeRectangle.bind(f),y=A.width/512,v=A.height/512):x=f.tileXYToRectangle.bind(f);var E,T=0,P=1;!this.isBaseLayer()&&Math.abs(w.west-A.west)>=y&&(T=Math.min(1,(w.west-A.west)/A.width)),!this.isBaseLayer()&&Math.abs(w.north-A.north)>=v&&(P=Math.max(0,(w.north-A.south)/A.height));for(var M=P,D=m.x;D<=g.x;D++)if(b=T,S=x(D,m.y,d),defined(w=Rectangle.simpleIntersection(S,o,clippedRectangleScratch))){T=Math.min(1,(w.east-A.west)/A.width),D===g.x&&(this.isBaseLayer()||Math.abs(w.east-A.east)<y)&&(T=1),P=M;for(var I=m.y;I<=g.y;I++)if(E=P,S=x(D,I,d),defined(w=Rectangle.simpleIntersection(S,o,clippedRectangleScratch))){P=Math.max(0,(w.south-A.south)/A.height),I===g.y&&(this.isBaseLayer()||Math.abs(w.south-A.south)<v)&&(P=0);var O=new Cartesian4(b,P,T,E),R=this.getImageryFromCache(D,I,d);r.imagery.splice(i,0,new TileImagery(R,O,a)),++i}}return!0},ImageryLayer.prototype._calculateTextureTranslationAndScale=function(e,t){var i=t.readyImagery.rectangle,r=e.rectangle;if(t.useWebMercatorT){var n=t.readyImagery.imageryLayer.imageryProvider.tilingScheme;i=n.rectangleToNativeRectangle(i,imageryBoundsScratch),r=n.rectangleToNativeRectangle(r,terrainRectangleScratch)}var a=r.width,o=r.height,s=a/i.width,l=o/i.height;return new Cartesian4(s*(r.west-i.west)/a,l*(r.south-i.south)/o,s,l)},ImageryLayer.prototype._requestImagery=function(i){var r=this._imageryProvider,n=this;function a(e){if(!defined(e))return o();i.image=e,i.state=ImageryState$1.RECEIVED,i.request=void 0,TileProviderError.handleSuccess(n._requestImageError)}function o(e){if(i.request.state===RequestState$1.CANCELLED)return i.state=ImageryState$1.UNLOADED,void(i.request=void 0);i.state=ImageryState$1.FAILED,i.request=void 0;var t="Failed to obtain image tile X: "+i.x+" Y: "+i.y+" Level: "+i.level+".";n._requestImageError=TileProviderError.handleError(n._requestImageError,r,r.errorEvent,t,i.x,i.y,i.level,s,e)}function s(){var e=new Request({throttle:!1,throttleByServer:!0,type:RequestType$1.IMAGERY});i.request=e,i.state=ImageryState$1.TRANSITIONING;var t=r.requestImage(i.x,i.y,i.level,e);if(!defined(t))return i.state=ImageryState$1.UNLOADED,void(i.request=void 0);defined(r.getTileCredits)&&(i.credits=r.getTileCredits(i.x,i.y,i.level)),when(t,a,o)}s()},ImageryLayer.prototype._createTextureWebGL=function(e,t){var i=new Sampler({minificationFilter:this.minificationFilter,magnificationFilter:this.magnificationFilter}),r=t.image;return defined(r.internalFormat)?new Texture({context:e,pixelFormat:r.internalFormat,width:r.width,height:r.height,source:{arrayBufferView:r.bufferView},sampler:i}):new Texture({context:e,source:r,pixelFormat:this._imageryProvider.hasAlphaChannel?PixelFormat$1.RGBA:PixelFormat$1.RGB,sampler:i})},ImageryLayer.prototype._createTexture=function(e,t){var i=this._imageryProvider,r=t.image;if(defined(i.tileDiscardPolicy)){var n=i.tileDiscardPolicy;if(defined(n)){if(!n.isReady())return void(t.state=ImageryState$1.RECEIVED);if(n.shouldDiscardImage(r))return void(t.state=ImageryState$1.INVALID)}}var a=this._createTextureWebGL(e,t);i.tilingScheme.projection instanceof WebMercatorProjection?t.textureWebMercator=a:t.texture=a,t.image=void 0,t.state=ImageryState$1.TEXTURE_LOADED},ImageryLayer.prototype._finalizeReprojectTexture=function(e,t){var i=this.minificationFilter,r=this.magnificationFilter;if(i===TextureMinificationFilter$1.LINEAR&&r===TextureMagnificationFilter$1.LINEAR&&!PixelFormat$1.isCompressedFormat(t.pixelFormat)&&CesiumMath.isPowerOfTwo(t.width)&&CesiumMath.isPowerOfTwo(t.height)){i=TextureMinificationFilter$1.LINEAR_MIPMAP_LINEAR;var n=ContextLimits.maximumTextureFilterAnisotropy,a=Math.min(n,defaultValue(this._maximumAnisotropy,n)),o=getSamplerKey(i,r,a),s=e.cache.imageryLayerMipmapSamplers;defined(s)||(s={},e.cache.imageryLayerMipmapSamplers=s);var l=s[o];defined(l)||(l=s[o]=new Sampler({wrapS:TextureWrap$1.CLAMP_TO_EDGE,wrapT:TextureWrap$1.CLAMP_TO_EDGE,minificationFilter:i,magnificationFilter:r,maximumAnisotropy:a})),t.generateMipmap(MipmapHint$1.NICEST),t.sampler=l}else{var u=getSamplerKey(i,r,0),c=e.cache.imageryLayerNonMipmapSamplers;defined(c)||(c={},e.cache.imageryLayerNonMipmapSamplers=c);var d=c[u];defined(d)||(d=c[u]=new Sampler({wrapS:TextureWrap$1.CLAMP_TO_EDGE,wrapT:TextureWrap$1.CLAMP_TO_EDGE,minificationFilter:i,magnificationFilter:r})),t.sampler=d}},ImageryLayer.prototype._reprojectTexture=function(e,t,i){var r=t.textureWebMercator||t.texture,n=t.rectangle,a=e.context;if((i=defaultValue(i,!0))&&!(this._imageryProvider.tilingScheme.projection instanceof GeographicProjection)&&1e-5<n.width/r.width){var o=this;t.addReference();var s=new ComputeCommand({persists:!0,owner:this,preExecute:function(e){reprojectToGeographic(e,a,r,t.rectangle)},postExecute:function(e){t.texture=e,o._finalizeReprojectTexture(a,e),t.state=ImageryState$1.READY,t.releaseReference()}});this._reprojectComputeCommands.push(s)}else i&&(t.texture=r),this._finalizeReprojectTexture(a,r),t.state=ImageryState$1.READY},ImageryLayer.prototype.queueReprojectionCommands=function(e){for(var t=this._reprojectComputeCommands,i=t.length,r=0;r<i;++r)e.commandList.push(t[r]);t.length=0},ImageryLayer.prototype.cancelReprojections=function(){this._reprojectComputeCommands.length=0},ImageryLayer.prototype.getImageryFromCache=function(e,t,i,r){var n=getImageryCacheKey(e,t,i),a=this._imageryCache[n];return defined(a)||(a=new Imagery(this,e,t,i,r),this._imageryCache[n]=a),a.addReference(),a},ImageryLayer.prototype.removeImageryFromCache=function(e){var t=getImageryCacheKey(e.x,e.y,e.level);delete this._imageryCache[t]};var uniformMap={u_textureDimensions:function(){return this.textureDimensions},u_texture:function(){return this.texture},textureDimensions:new Cartesian2,texture:void 0},float32ArrayScratch=FeatureDetection$1.supportsTypedArrays()?new Float32Array(128):void 0;function reprojectToGeographic(e,t,i,r){var n=t.cache.imageryLayer_reproject;if(!defined(n)){n=t.cache.imageryLayer_reproject={vertexArray:void 0,shaderProgram:void 0,sampler:void 0,destroy:function(){defined(this.framebuffer)&&this.framebuffer.destroy(),defined(this.vertexArray)&&this.vertexArray.destroy(),defined(this.shaderProgram)&&this.shaderProgram.destroy()}};for(var a=new Float32Array(256),o=0,s=0;s<64;++s){var l=s/63;a[o++]=0,a[o++]=l,a[o++]=1,a[o++]=l}var u={position:0,webMercatorT:1},c=TerrainProvider.getRegularGridIndices(2,64),d=Buffer$1.createIndexBuffer({context:t,typedArray:c,usage:BufferUsage$1.STATIC_DRAW,indexDatatype:IndexDatatype$1.UNSIGNED_SHORT});n.vertexArray=new VertexArray({context:t,attributes:[{index:u.position,vertexBuffer:Buffer$1.createVertexBuffer({context:t,typedArray:a,usage:BufferUsage$1.STATIC_DRAW}),componentsPerAttribute:2},{index:u.webMercatorT,vertexBuffer:Buffer$1.createVertexBuffer({context:t,sizeInBytes:512,usage:BufferUsage$1.STREAM_DRAW}),componentsPerAttribute:1}],indexBuffer:d});var h=new ShaderSource({sources:[ReprojectWebMercatorVS]});n.shaderProgram=ShaderProgram.fromCache({context:t,vertexShaderSource:h,fragmentShaderSource:ReprojectWebMercatorFS,attributeLocations:u}),n.sampler=new Sampler({wrapS:TextureWrap$1.CLAMP_TO_EDGE,wrapT:TextureWrap$1.CLAMP_TO_EDGE,minificationFilter:TextureMinificationFilter$1.LINEAR,magnificationFilter:TextureMagnificationFilter$1.LINEAR})}i.sampler=n.sampler;var p=i.width,f=i.height;uniformMap.textureDimensions.x=p,uniformMap.textureDimensions.y=f,uniformMap.texture=i;var m=Math.sin(r.south),g=.5*Math.log((1+m)/(1-m));m=Math.sin(r.north);var y=1/(.5*Math.log((1+m)/(1-m))-g),v=new Texture({context:t,width:p,height:f,pixelFormat:i.pixelFormat,pixelDatatype:i.pixelDatatype,preMultiplyAlpha:i.preMultiplyAlpha});CesiumMath.isPowerOfTwo(p)&&CesiumMath.isPowerOfTwo(f)&&v.generateMipmap(MipmapHint$1.NICEST);for(var _=r.south,C=r.north,x=float32ArrayScratch,b=0,A=0;A<64;++A){var S=A/63,w=CesiumMath.lerp(_,C,S);m=Math.sin(w);var E=(.5*Math.log((1+m)/(1-m))-g)*y;x[b++]=E,x[b++]=E}n.vertexArray.getAttribute(1).vertexBuffer.copyFromArrayView(x),e.shaderProgram=n.shaderProgram,e.outputTexture=v,e.uniformMap=uniformMap,e.vertexArray=n.vertexArray}function getLevelWithMaximumTexelSpacing(e,t,i){var r=e._imageryProvider,n=r.tilingScheme,a=n.ellipsoid,o=e._imageryProvider.tilingScheme.projection instanceof GeographicProjection?1:Math.cos(i),s=n.rectangle,l=a.maximumRadius*s.width*o/(r.tileWidth*n.getNumberOfXTilesAtLevel(0))/t,u=Math.log(l)/Math.log(2);return 0|Math.round(u)}var TileSelectionResult={NONE:0,CULLED:1,RENDERED:2,REFINED:3,RENDERED_AND_KICKED:6,REFINED_AND_KICKED:7,CULLED_BUT_NEEDED:9,wasKicked:function(e){return e>=TileSelectionResult.RENDERED_AND_KICKED},originalResult:function(e){return 3&e},kick:function(e){return 4|e}};function TerrainFillMesh(e){this.tile=e,this.frameLastUpdated=void 0,this.westMeshes=[],this.westTiles=[],this.southMeshes=[],this.southTiles=[],this.eastMeshes=[],this.eastTiles=[],this.northMeshes=[],this.northTiles=[],this.southwestMesh=void 0,this.southwestTile=void 0,this.southeastMesh=void 0,this.southeastTile=void 0,this.northwestMesh=void 0,this.northwestTile=void 0,this.northeastMesh=void 0,this.northeastTile=void 0,this.changedThisFrame=!0,this.visitedFrame=void 0,this.enqueuedFrame=void 0,this.mesh=void 0,this.vertexArray=void 0,this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new Cartesian4}TerrainFillMesh.prototype.update=function(e,t,i){this.changedThisFrame&&(createFillMesh(e,t,this.tile,i),this.changedThisFrame=!1)},TerrainFillMesh.prototype.destroy=function(e){defined(this.vertexArray)&&(defined(e)?e.push(this.vertexArray):GlobeSurfaceTile._freeVertexArray(this.vertexArray,e),this.vertexArray=void 0),defined(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,0===this.waterMaskTexture.referenceCount&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0)};var traversalQueueScratch=new Queue;function visitRenderedTiles(e,t,i,r,n,a,o,s,l){if(void 0!==r){for(var u=r;u&&(u._lastSelectionResultFrame!==n||TileSelectionResult.wasKicked(u._lastSelectionResult)||TileSelectionResult.originalResult(u._lastSelectionResult)===TileSelectionResult.CULLED);){if(o)return;var c=u.parent;if(a>=TileEdge.NORTHWEST&&void 0!==c)switch(a){case TileEdge.NORTHWEST:u=u===c.northwestChild?c:void 0;break;case TileEdge.NORTHEAST:u=u===c.northeastChild?c:void 0;break;case TileEdge.SOUTHWEST:u=u===c.southwestChild?c:void 0;break;case TileEdge.SOUTHEAST:u=u===c.southeastChild?c:void 0}else u=c}if(void 0!==u)if(u._lastSelectionResult!==TileSelectionResult.RENDERED){if(TileSelectionResult.originalResult(r._lastSelectionResult)!==TileSelectionResult.CULLED)switch(a){case TileEdge.WEST:visitRenderedTiles(e,t,i,r.northwestChild,n,a,!0,s,l),visitRenderedTiles(e,t,i,r.southwestChild,n,a,!0,s,l);break;case TileEdge.EAST:visitRenderedTiles(e,t,i,r.southeastChild,n,a,!0,s,l),visitRenderedTiles(e,t,i,r.northeastChild,n,a,!0,s,l);break;case TileEdge.SOUTH:visitRenderedTiles(e,t,i,r.southwestChild,n,a,!0,s,l),visitRenderedTiles(e,t,i,r.southeastChild,n,a,!0,s,l);break;case TileEdge.NORTH:visitRenderedTiles(e,t,i,r.northeastChild,n,a,!0,s,l),visitRenderedTiles(e,t,i,r.northwestChild,n,a,!0,s,l);break;case TileEdge.NORTHWEST:visitRenderedTiles(e,t,i,r.northwestChild,n,a,!0,s,l);break;case TileEdge.NORTHEAST:visitRenderedTiles(e,t,i,r.northeastChild,n,a,!0,s,l);break;case TileEdge.SOUTHWEST:visitRenderedTiles(e,t,i,r.southwestChild,n,a,!0,s,l);break;case TileEdge.SOUTHEAST:visitRenderedTiles(e,t,i,r.southeastChild,n,a,!0,s,l);break;default:throw new DeveloperError("Invalid edge")}}else{if(defined(u.data.vertexArray))return;visitTile$2(e,t,i,u,a,n,s,l)}}}function visitTile$2(e,t,i,r,n,a,o,s){var l=r.data;if(void 0===l.fill)l.fill=new TerrainFillMesh(r);else if(l.fill.visitedFrame===a)return;l.fill.enqueuedFrame!==a&&(l.fill.enqueuedFrame=a,l.fill.changedThisFrame=!1,o.enqueue(r)),propagateEdge(e,t,i,r,n,s)}function propagateEdge(e,t,i,r,n,a){var o,s,l,u,c,d,h=r.data.fill,p=i.data.fill;switch(o=defined(p)?(p.visitedFrame=t.frameNumber,p.changedThisFrame&&(createFillMesh(e,t,i,a),p.changedThisFrame=!1),i.data.fill.mesh):i.data.mesh,n){case TileEdge.WEST:s=h.westMeshes,l=h.westTiles;break;case TileEdge.SOUTH:s=h.southMeshes,l=h.southTiles;break;case TileEdge.EAST:s=h.eastMeshes,l=h.eastTiles;break;case TileEdge.NORTH:s=h.northMeshes,l=h.northTiles;break;case TileEdge.NORTHWEST:return h.changedThisFrame=h.changedThisFrame||h.northwestMesh!==o,h.northwestMesh=o,void(h.northwestTile=i);case TileEdge.NORTHEAST:return h.changedThisFrame=h.changedThisFrame||h.northeastMesh!==o,h.northeastMesh=o,void(h.northeastTile=i);case TileEdge.SOUTHWEST:return h.changedThisFrame=h.changedThisFrame||h.southwestMesh!==o,h.southwestMesh=o,void(h.southwestTile=i);case TileEdge.SOUTHEAST:return h.changedThisFrame=h.changedThisFrame||h.southeastMesh!==o,h.southeastMesh=o,void(h.southeastTile=i)}if(i.level<=r.level)return h.changedThisFrame=h.changedThisFrame||s[0]!==o||1!==s.length,s[0]=o,l[0]=i,s.length=1,void(l.length=1);var f,m=i.rectangle,g=r.rectangle;switch(n){case TileEdge.WEST:for(f=(g.north-g.south)*CesiumMath.EPSILON5,u=0;u<l.length&&(d=l[u].rectangle,!CesiumMath.greaterThan(m.north,d.south,f));++u);for(c=u;c<l.length&&(d=l[c].rectangle,!CesiumMath.greaterThanOrEquals(m.south,d.north,f));++c);break;case TileEdge.SOUTH:for(f=(g.east-g.west)*CesiumMath.EPSILON5,u=0;u<l.length&&(d=l[u].rectangle,!CesiumMath.lessThan(m.west,d.east,f));++u);for(c=u;c<l.length&&(d=l[c].rectangle,!CesiumMath.lessThanOrEquals(m.east,d.west,f));++c);break;case TileEdge.EAST:for(f=(g.north-g.south)*CesiumMath.EPSILON5,u=0;u<l.length&&(d=l[u].rectangle,!CesiumMath.lessThan(m.south,d.north,f));++u);for(c=u;c<l.length&&(d=l[c].rectangle,!CesiumMath.lessThanOrEquals(m.north,d.south,f));++c);break;case TileEdge.NORTH:for(f=(g.east-g.west)*CesiumMath.EPSILON5,u=0;u<l.length&&(d=l[u].rectangle,!CesiumMath.greaterThan(m.east,d.west,f));++u);for(c=u;c<l.length&&(d=l[c].rectangle,!CesiumMath.greaterThanOrEquals(m.west,d.east,f));++c);}c-u==1?(h.changedThisFrame=h.changedThisFrame||s[u]!==o,s[u]=o,l[u]=i):(h.changedThisFrame=!0,s.splice(u,c-u,o),l.splice(u,c-u,i))}TerrainFillMesh.updateFillTiles=function(e,t,i,r){var n=e._quadtree,a=n._levelZeroTiles,o=n._lastSelectionFrameNumber,s=traversalQueueScratch;s.clear();for(var l=0;l<t.length;++l){defined(t[l].data.vertexArray)&&s.enqueue(t[l])}for(var u=s.dequeue();void 0!==u;){var c=u.findTileToWest(a),d=u.findTileToSouth(a),h=u.findTileToEast(a),p=u.findTileToNorth(a);visitRenderedTiles(e,i,u,c,o,TileEdge.EAST,!1,s,r),visitRenderedTiles(e,i,u,d,o,TileEdge.NORTH,!1,s,r),visitRenderedTiles(e,i,u,h,o,TileEdge.WEST,!1,s,r),visitRenderedTiles(e,i,u,p,o,TileEdge.SOUTH,!1,s,r);var f=c.findTileToNorth(a),m=c.findTileToSouth(a),g=h.findTileToNorth(a),y=h.findTileToSouth(a);visitRenderedTiles(e,i,u,f,o,TileEdge.SOUTHEAST,!1,s,r),visitRenderedTiles(e,i,u,g,o,TileEdge.SOUTHWEST,!1,s,r),visitRenderedTiles(e,i,u,m,o,TileEdge.NORTHEAST,!1,s,r),visitRenderedTiles(e,i,u,y,o,TileEdge.NORTHWEST,!1,s,r),u=s.dequeue()}};var cartographicScratch$4=new Cartographic,centerCartographicScratch=new Cartographic,cartesianScratch=new Cartesian3,normalScratch$6=new Cartesian3,octEncodedNormalScratch=new Cartesian2,uvScratch2=new Cartesian2,uvScratch=new Cartesian2;function HeightAndNormal(){this.height=0,this.encodedNormal=new Cartesian2}function fillMissingCorner(e,t,i,r,n,a,o,s,l){if(defined(n))return n;var u;if(defined(a)&&defined(o))u=.5*(a.height+o.height);else if(defined(a))u=a.height;else if(defined(o))u=o.height;else if(defined(s))u=s.height;else{var c=e.tile.data.tileBoundingRegion,d=0,h=0;defined(c)&&(d=c.minimumHeight,h=c.maximumHeight),u=.5*(d+h)}return getVertexWithHeightAtCorner(e,t,i,r,u,l),l}var heightRangeScratch={minimumHeight:0,maximumHeight:0},swVertexScratch=new HeightAndNormal,seVertexScratch=new HeightAndNormal,nwVertexScratch=new HeightAndNormal,neVertexScratch=new HeightAndNormal,heightmapBuffer="undefined"!=typeof Uint8Array?new Uint8Array(81):void 0;function createFillMesh(e,t,i,r){GlobeSurfaceTile.initialize(i,e.terrainProvider,e._imageryLayers);var n=i.data,a=n.fill,o=i.rectangle,s=i.tilingScheme.ellipsoid,l=getCorner(a,s,0,1,a.northwestTile,a.northwestMesh,a.northTiles,a.northMeshes,a.westTiles,a.westMeshes,nwVertexScratch),u=getCorner(a,s,0,0,a.southwestTile,a.southwestMesh,a.westTiles,a.westMeshes,a.southTiles,a.southMeshes,swVertexScratch),c=getCorner(a,s,1,0,a.southeastTile,a.southeastMesh,a.southTiles,a.southMeshes,a.eastTiles,a.eastMeshes,seVertexScratch),d=getCorner(a,s,1,1,a.northeastTile,a.northeastMesh,a.eastTiles,a.eastMeshes,a.northTiles,a.northMeshes,neVertexScratch);d=fillMissingCorner(a,s,1,1,d,c=fillMissingCorner(a,s,1,1,c,u=fillMissingCorner(a,s,0,0,u,l=fillMissingCorner(a,s,0,1,l,u,d,c,nwVertexScratch),c,d,swVertexScratch),d,l,seVertexScratch),l,u,neVertexScratch);var h,p,f=u.height,m=c.height,g=l.height,y=d.height,v=Math.min(f,m,g,y),_=Math.max(f,m,g,y),C=.5*(v+_),x=e.getLevelMaximumGeometricError(i.level),b=s.maximumRadius-x,A=4*Math.acos(b/s.maximumRadius);if(A*=1.5,o.width>A&&_-v<=x){var S=new HeightmapTerrainData({width:9,height:9,buffer:heightmapBuffer,structure:{heightOffset:_}});a.mesh=S._createMeshSync(i.tilingScheme,i.x,i.y,i.level,1)}else{var w=new TerrainEncoding(void 0,void 0,void 0,void 0,!0,!0),E=centerCartographicScratch;E.longitude=.5*(o.east+o.west),E.latitude=.5*(o.north+o.south),E.height=C,w.center=s.cartographicToCartesian(E,w.center);var T,P=5;for(h=0,p=(T=a.westMeshes).length;h<p;++h)P+=T[h].eastIndicesNorthToSouth.length;for(h=0,p=(T=a.southMeshes).length;h<p;++h)P+=T[h].northIndicesWestToEast.length;for(h=0,p=(T=a.eastMeshes).length;h<p;++h)P+=T[h].westIndicesSouthToNorth.length;for(h=0,p=(T=a.northMeshes).length;h<p;++h)P+=T[h].southIndicesEastToWest.length;var M=heightRangeScratch;M.minimumHeight=v,M.maximumHeight=_;var D=w.getStride(),I=new Float32Array(P*D),O=0,R=O,L=O=addEdge(a,s,w,I,O=addVertexWithComputedPosition(s,o,w,I,O,0,1,l.height,l.encodedNormal,1,M),a.westTiles,a.westMeshes,TileEdge.EAST,M),N=O=addEdge(a,s,w,I,O=addVertexWithComputedPosition(s,o,w,I,O,0,0,u.height,u.encodedNormal,0,M),a.southTiles,a.southMeshes,TileEdge.NORTH,M),k=O=addEdge(a,s,w,I,O=addVertexWithComputedPosition(s,o,w,I,O,1,0,c.height,c.encodedNormal,0,M),a.eastTiles,a.eastMeshes,TileEdge.WEST,M);O=addEdge(a,s,w,I,O=addVertexWithComputedPosition(s,o,w,I,O,1,1,d.height,d.encodedNormal,1,M),a.northTiles,a.northMeshes,TileEdge.SOUTH,M),v=M.minimumHeight,_=M.maximumHeight;var B=OrientedBoundingBox.fromRectangle(o,v,_,i.tilingScheme.ellipsoid),F=WebMercatorProjection.geodeticLatitudeToMercatorAngle(o.south),V=1/(WebMercatorProjection.geodeticLatitudeToMercatorAngle(o.north)-F),z=(WebMercatorProjection.geodeticLatitudeToMercatorAngle(E.latitude)-F)*V;s.geodeticSurfaceNormalCartographic(cartographicScratch$4,normalScratch$6);var U=AttributeCompression.octEncode(normalScratch$6,octEncodedNormalScratch),G=O;w.encode(I,O*D,B.center,Cartesian2.fromElements(.5,.5,uvScratch),C,U,z);var $,H=++O,W=3*(H-1);if(W*(H<256?1:2)<=(I.length-H*D)*Float32Array.BYTES_PER_ELEMENT){var j=H*D*Float32Array.BYTES_PER_ELEMENT;$=H<256?new Uint8Array(I.buffer,j,W):new Uint16Array(I.buffer,j,W)}else $=H<256?new Uint8Array(W):new Uint16Array(W);I=new Float32Array(I.buffer,0,H*D);var q=0;for(h=0;h<H-2;++h)$[q++]=G,$[q++]=h,$[q++]=h+1;$[q++]=G,$[q++]=h,$[q++]=0;var Q=[];for(h=L;R<=h;--h)Q.push(h);var Y=[];for(h=N;L<=h;--h)Y.push(h);var X=[];for(h=k;N<=h;--h)X.push(h);var Z=[];for(Z.push(0),h=G-1;k<=h;--h)Z.push(h);a.mesh=new TerrainMesh(w.center,I,$,W,H,v,_,BoundingSphere.fromOrientedBoundingBox(B),computeOccludeePoint(e,B.center,o,v,_),w.getStride(),B,w,t.terrainExaggeration,Q,Y,X,Z)}var J=t.context;defined(a.vertexArray)&&(defined(r)?r.push(a.vertexArray):GlobeSurfaceTile._freeVertexArray(a.vertexArray)),a.vertexArray=GlobeSurfaceTile._createVertexArrayForMesh(J,a.mesh),n.processImagery(i,e.terrainProvider,t,!0);var K=a.waterMaskTexture;if(a.waterMaskTexture=void 0,e.terrainProvider.hasWaterMask){var ee=n._findAncestorTileWithTerrainData(i);defined(ee)&&defined(ee.data.waterMaskTexture)&&(a.waterMaskTexture=ee.data.waterMaskTexture,++a.waterMaskTexture.referenceCount,n._computeWaterMaskTranslationAndScale(i,ee,a.waterMaskTranslationAndScale))}defined(K)&&(--K.referenceCount,0===K.referenceCount&&K.destroy())}function addVertexWithComputedPosition(e,t,i,r,n,a,o,s,l,u,c){var d=cartographicScratch$4;d.longitude=CesiumMath.lerp(t.west,t.east,a),d.latitude=CesiumMath.lerp(t.south,t.north,o),d.height=s;var h=e.cartographicToCartesian(d,cartesianScratch),p=uvScratch2;return p.x=a,p.y=o,i.encode(r,n*i.getStride(),h,p,s,l,u),c.minimumHeight=Math.min(c.minimumHeight,s),c.maximumHeight=Math.max(c.maximumHeight,s),n+1}var sourceRectangleScratch=new Rectangle;function transformTextureCoordinates(e,t,i,r){var n=e.rectangle,a=t.rectangle;0===t.x&&1===i.x&&e.x===e.tilingScheme.getNumberOfXTilesAtLevel(e.level)-1?((n=Rectangle.clone(e.rectangle,sourceRectangleScratch)).west-=CesiumMath.TWO_PI,n.east-=CesiumMath.TWO_PI):0===e.x&&0===i.x&&t.x===t.tilingScheme.getNumberOfXTilesAtLevel(t.level)-1&&((n=Rectangle.clone(e.rectangle,sourceRectangleScratch)).west+=CesiumMath.TWO_PI,n.east+=CesiumMath.TWO_PI);var o=n.east-n.west,s=(a.west-n.west)/o,l=(a.east-n.west)/o,u=n.north-n.south,c=(a.south-n.south)/u,d=(a.north-n.south)/u,h=(i.x-s)/(l-s),p=(i.y-c)/(d-c);return Math.abs(h)<Math.EPSILON5?h=0:Math.abs(h-1)<Math.EPSILON5&&(h=1),Math.abs(p)<Math.EPSILON5?p=0:Math.abs(p-1)<Math.EPSILON5&&(p=1),r.x=h,r.y=p,r}var encodedNormalScratch=new Cartesian2;function getVertexFromTileAtCorner(e,t,i,r,n){var a=e.encoding,o=e.vertices;if(n.height=a.decodeHeight(o,t),a.hasVertexNormals)a.getOctEncodedNormal(o,t,n.encodedNormal);else{var s=n.encodedNormal;s.x=0,s.y=0}}var encodedNormalScratch2=new Cartesian2,cartesianScratch2=new Cartesian3;function getInterpolatedVertexAtCorner(e,t,i,r,n,a,o,s,l,u){var c,d=r.encoding,h=r.vertices,p=transformTextureCoordinates(t,i,d.decodeTextureCoordinates(h,n,uvScratch),uvScratch),f=transformTextureCoordinates(t,i,d.decodeTextureCoordinates(h,a,uvScratch2),uvScratch2);c=l?(o-p.x)/(f.x-p.x):(s-p.y)/(f.y-p.y);var m,g=d.decodeHeight(h,n),y=d.decodeHeight(h,a),v=i.rectangle;if(cartographicScratch$4.longitude=CesiumMath.lerp(v.west,v.east,o),cartographicScratch$4.latitude=CesiumMath.lerp(v.south,v.north,s),u.height=cartographicScratch$4.height=CesiumMath.lerp(g,y,c),d.hasVertexNormals){var _=d.getOctEncodedNormal(h,n,encodedNormalScratch),C=d.getOctEncodedNormal(h,a,encodedNormalScratch2),x=AttributeCompression.octDecode(_.x,_.y,cartesianScratch),b=AttributeCompression.octDecode(C.x,C.y,cartesianScratch2);m=Cartesian3.lerp(x,b,c,cartesianScratch),Cartesian3.normalize(m,m),AttributeCompression.octEncode(m,u.encodedNormal)}else m=e.geodeticSurfaceNormalCartographic(cartographicScratch$4,cartesianScratch),AttributeCompression.octEncode(m,u.encodedNormal)}function getVertexWithHeightAtCorner(e,t,i,r,n,a){a.height=n;var o=t.geodeticSurfaceNormalCartographic(cartographicScratch$4,cartesianScratch);AttributeCompression.octEncode(o,a.encodedNormal)}function getCorner(e,t,i,r,n,a,o,s,l,u,c){var d;return getCornerFromEdge(e,t,s,o,!1,i,r,c)||getCornerFromEdge(e,t,u,l,!0,i,r,c)?c:meshIsUsable(n,a)?(getVertexFromTileAtCorner(a,0===i?0===r?a.eastIndicesNorthToSouth[0]:a.southIndicesEastToWest[0]:0===r?a.northIndicesWestToEast[0]:a.westIndicesSouthToNorth[0],i,r,c),c):defined(d=0===i?0===r?getClosestHeightToCorner(e.westMeshes,e.westTiles,TileEdge.EAST,e.southMeshes,e.southTiles,TileEdge.NORTH):getClosestHeightToCorner(e.northMeshes,e.northTiles,TileEdge.SOUTH,e.westMeshes,e.westTiles,TileEdge.EAST):0===r?getClosestHeightToCorner(e.southMeshes,e.southTiles,TileEdge.NORTH,e.eastMeshes,e.eastTiles,TileEdge.WEST):getClosestHeightToCorner(e.eastMeshes,e.eastTiles,TileEdge.WEST,e.northMeshes,e.northTiles,TileEdge.SOUTH))?(getVertexWithHeightAtCorner(e,t,i,r,d,c),c):void 0}function getClosestHeightToCorner(e,t,i,r,n,a,o,s){var l=getNearestHeightOnEdge(e,t,!1,i),u=getNearestHeightOnEdge(r,n,!0,a);return defined(l)&&defined(u)?.5*(l+u):defined(l)?l:u}function addEdge(e,t,i,r,n,a,o,s,l){for(var u=0;u<a.length;++u)n=addEdgeMesh(e,t,i,r,n,a[u],o[u],s,l);return n}function addEdgeMesh(e,t,i,r,n,a,o,s,l){var u=a.rectangle;s===TileEdge.EAST&&0===e.tile.x?((u=Rectangle.clone(a.rectangle,sourceRectangleScratch)).west-=CesiumMath.TWO_PI,u.east-=CesiumMath.TWO_PI):s===TileEdge.WEST&&0===a.x&&((u=Rectangle.clone(a.rectangle,sourceRectangleScratch)).west+=CesiumMath.TWO_PI,u.east+=CesiumMath.TWO_PI);var c,d,h,p,f=e.tile.rectangle;switch(0<n&&(i.decodeTextureCoordinates(r,n-1,uvScratch),c=uvScratch.x,d=uvScratch.y),s){case TileEdge.WEST:h=o.westIndicesSouthToNorth,p=!1;break;case TileEdge.NORTH:h=o.northIndicesWestToEast,p=!0;break;case TileEdge.EAST:h=o.eastIndicesNorthToSouth,p=!1;break;case TileEdge.SOUTH:h=o.southIndicesEastToWest,p=!0}var m,g,y=a,v=e.tile,_=o.encoding,C=o.vertices,x=i.getStride();_.hasWebMercatorT&&(m=WebMercatorProjection.geodeticLatitudeToMercatorAngle(f.south),g=1/(WebMercatorProjection.geodeticLatitudeToMercatorAngle(f.north)-m));for(var b=0;b<h.length;++b){var A=h[b],S=_.decodeTextureCoordinates(C,A,uvScratch);transformTextureCoordinates(y,v,S,S);var w=S.x,E=S.y,T=p?w:E;if(!(T<0||1<T)&&!(Math.abs(w-c)<CesiumMath.EPSILON5&&Math.abs(E-d)<CesiumMath.EPSILON5)){var P=Math.abs(w)<CesiumMath.EPSILON5||Math.abs(w-1)<CesiumMath.EPSILON5,M=Math.abs(E)<CesiumMath.EPSILON5||Math.abs(E-1)<CesiumMath.EPSILON5;if(!P||!M){var D,I=_.decodePosition(C,A,cartesianScratch),O=_.decodeHeight(C,A);_.hasVertexNormals?D=_.getOctEncodedNormal(C,A,octEncodedNormalScratch):((D=octEncodedNormalScratch).x=0,D.y=0);var R=E;if(_.hasWebMercatorT){var L=CesiumMath.lerp(f.south,f.north,E);R=(WebMercatorProjection.geodeticLatitudeToMercatorAngle(L)-m)*g}i.encode(r,n*x,I,S,O,D,R),l.minimumHeight=Math.min(l.minimumHeight,O),l.maximumHeight=Math.max(l.maximumHeight,O),++n}}}return n}function getNearestHeightOnEdge(e,t,i,r,n,a){var o,s,l;l=i?(o=0,s=e.length,1):(o=e.length-1,s=-1);for(var u=o;u!==s;u+=l){var c=e[u];if(meshIsUsable(t[u],c)){var d;switch(r){case TileEdge.WEST:d=c.westIndicesSouthToNorth;break;case TileEdge.SOUTH:d=c.southIndicesEastToWest;break;case TileEdge.EAST:d=c.eastIndicesNorthToSouth;break;case TileEdge.NORTH:d=c.northIndicesWestToEast}var h=d[i?0:d.length-1];if(defined(h))return c.encoding.decodeHeight(c.vertices,h)}}}function meshIsUsable(e,t){return defined(t)&&(!defined(e.data.fill)||!e.data.fill.changedThisFrame)}function getCornerFromEdge(r,e,t,i,n,a,o,s){var l,u,c,d,h,p=i[n?0:t.length-1],f=t[n?0:t.length-1];if(meshIsUsable(p,f)&&(c=0===a?0===o?(l=n?f.northIndicesWestToEast:f.eastIndicesNorthToSouth,u=n):(l=n?f.eastIndicesNorthToSouth:f.southIndicesEastToWest,u=!n,!1):0===o?(l=n?f.westIndicesSouthToNorth:f.northIndicesWestToEast,u=!n,!0):(l=n?f.southIndicesEastToWest:f.westIndicesSouthToNorth,!(u=n)),0<l.length)){h=l[d=n?0:l.length-1],f.encoding.decodeTextureCoordinates(f.vertices,h,uvScratch);var m=transformTextureCoordinates(p,r.tile,uvScratch,uvScratch);if(m.x===a&&m.y===o)return getVertexFromTileAtCorner(f,h,a,o,s),!0;if(!((d=binarySearch(l,u?a:o,function(e,t){f.encoding.decodeTextureCoordinates(f.vertices,e,uvScratch);var i=transformTextureCoordinates(p,r.tile,uvScratch,uvScratch);return c?u?i.x-a:i.y-o:u?a-i.x:o-i.y}))<0))return getVertexFromTileAtCorner(f,l[d],a,o,s),!0;if(0<(d=~d)&&d<l.length)return getInterpolatedVertexAtCorner(e,p,r.tile,f,l[d-1],l[d],a,o,u,s),!0}return!1}var cornerPositionsScratch=[new Cartesian3,new Cartesian3,new Cartesian3,new Cartesian3];function computeOccludeePoint(e,t,i,r,n,a){var o=e.quadtree._occluders.ellipsoid,s=o.ellipsoid,l=cornerPositionsScratch;return Cartesian3.fromRadians(i.west,i.south,n,s,l[0]),Cartesian3.fromRadians(i.east,i.south,n,s,l[1]),Cartesian3.fromRadians(i.west,i.north,n,s,l[2]),Cartesian3.fromRadians(i.east,i.north,n,s,l[3]),o.computeHorizonCullingPointPossiblyUnderEllipsoid(t,l,r,a)}function GlobeSurfaceTileProvider(e){this.lightingFadeOutDistance=65e5,this.lightingFadeInDistance=9e6,this.hasWaterMask=!1,this.oceanNormalMap=void 0,this.zoomedOutOceanSpecularIntensity=.5,this.enableLighting=!1,this.dynamicAtmosphereLighting=!1,this.dynamicAtmosphereLightingFromSun=!1,this.showGroundAtmosphere=!1,this.shadows=ShadowMode$1.RECEIVE_ONLY,this.fillHighlightColor=void 0,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this.showSkirts=!0,this.backFaceCulling=!0,this._quadtree=void 0,this._terrainProvider=e.terrainProvider,this._imageryLayers=e.imageryLayers,this._surfaceShaderSet=e.surfaceShaderSet,this._renderState=void 0,this._blendRenderState=void 0,this._disableCullingRenderState=void 0,this._disableCullingBlendRenderState=void 0,this._errorEvent=new Event,this._imageryLayers.layerAdded.addEventListener(GlobeSurfaceTileProvider.prototype._onLayerAdded,this),this._imageryLayers.layerRemoved.addEventListener(GlobeSurfaceTileProvider.prototype._onLayerRemoved,this),this._imageryLayers.layerMoved.addEventListener(GlobeSurfaceTileProvider.prototype._onLayerMoved,this),this._imageryLayers.layerShownOrHidden.addEventListener(GlobeSurfaceTileProvider.prototype._onLayerShownOrHidden,this),this._imageryLayersUpdatedEvent=new Event,this._layerOrderChanged=!1,this._tilesToRenderByTextureCount=[],this._drawCommands=[],this._uniformMaps=[],this._usedDrawCommands=0,this._vertexArraysToDestroy=[],this._debug={wireframe:!1,boundingSphereTile:void 0},this._baseColor=void 0,this._firstPassInitialColor=void 0,this.baseColor=new Color(0,0,.5,1),this._clippingPlanes=void 0,this.cartographicLimitRectangle=Rectangle.clone(Rectangle.MAX_VALUE),this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1}function sortTileImageryByLayerIndex(e,t){var i=e.loadingImagery;defined(i)||(i=e.readyImagery);var r=t.loadingImagery;return defined(r)||(r=t.readyImagery),i.imageryLayer._layerIndex-r.imageryLayer._layerIndex}function updateCredits(e,t){var i=t.creditDisplay;e._terrainProvider.ready&&defined(e._terrainProvider.credit)&&i.addCredit(e._terrainProvider.credit);for(var r=e._imageryLayers,n=0,a=r.length;n<a;++n){var o=r.get(n).imageryProvider;o.ready&&defined(o.credit)&&i.addCredit(o.credit)}}Object.defineProperties(GlobeSurfaceTileProvider.prototype,{baseColor:{get:function(){return this._baseColor},set:function(e){this._baseColor=e,this._firstPassInitialColor=Cartesian4.fromColor(e,this._firstPassInitialColor)}},quadtree:{get:function(){return this._quadtree},set:function(e){this._quadtree=e}},ready:{get:function(){return this._terrainProvider.ready&&(0===this._imageryLayers.length||this._imageryLayers.get(0).imageryProvider.ready)}},tilingScheme:{get:function(){return this._terrainProvider.tilingScheme}},errorEvent:{get:function(){return this._errorEvent}},imageryLayersUpdatedEvent:{get:function(){return this._imageryLayersUpdatedEvent}},terrainProvider:{get:function(){return this._terrainProvider},set:function(e){this._terrainProvider!==e&&(this._terrainProvider=e,defined(this._quadtree)&&this._quadtree.invalidateAllTiles())}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){ClippingPlaneCollection.setOwner(e,this,"_clippingPlanes")}}}),GlobeSurfaceTileProvider.prototype.update=function(e){this._imageryLayers._update()},GlobeSurfaceTileProvider.prototype.initialize=function(e){this._imageryLayers.queueReprojectionCommands(e),this._layerOrderChanged&&(this._layerOrderChanged=!1,this._quadtree.forEachLoadedTile(function(e){e.data.imagery.sort(sortTileImageryByLayerIndex)})),updateCredits(this,e);for(var t=this._vertexArraysToDestroy,i=t.length,r=0;r<i;++r)GlobeSurfaceTile._freeVertexArray(t[r]);t.length=0},GlobeSurfaceTileProvider.prototype.beginUpdate=function(e){for(var t=this._tilesToRenderByTextureCount,i=0,r=t.length;i<r;++i){var n=t[i];defined(n)&&(n.length=0)}var a=this._clippingPlanes;defined(a)&&a.enabled&&a.update(e),this._usedDrawCommands=0,this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1},GlobeSurfaceTileProvider.prototype.endUpdate=function(e){if(!defined(this._renderState)){this._renderState=RenderState.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:DepthFunction$1.LESS}}),this._blendRenderState=RenderState.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:DepthFunction$1.LESS_OR_EQUAL},blending:BlendingState$1.ALPHA_BLEND});var t=clone(this._renderState,!0);t.cull.enabled=!1,this._disableCullingRenderState=RenderState.fromCache(t),(t=clone(this._blendRenderState,!0)).cull.enabled=!1,this._disableCullingBlendRenderState=RenderState.fromCache(t)}this._hasFillTilesThisFrame&&this._hasLoadedTilesThisFrame&&TerrainFillMesh.updateFillTiles(this,this._quadtree._tilesToRender,e,this._vertexArraysToDestroy);for(var i=this._tilesToRenderByTextureCount,r=0,n=i.length;r<n;++r){var a=i[r];if(defined(a))for(var o=0,s=a.length;o<s;++o){var l=a[o],u=l.data.tileBoundingRegion;addDrawCommandsForTile(this,l,e),e.minimumTerrainHeight=Math.min(e.minimumTerrainHeight,u.minimumHeight)}}},GlobeSurfaceTileProvider.prototype.updateForPick=function(e){for(var t=this._drawCommands,i=0,r=this._usedDrawCommands;i<r;++i)e.commandList.push(t[i])},GlobeSurfaceTileProvider.prototype.cancelReprojections=function(){this._imageryLayers.cancelReprojections()},GlobeSurfaceTileProvider.prototype.getLevelMaximumGeometricError=function(e){return this._terrainProvider.getLevelMaximumGeometricError(e)},GlobeSurfaceTileProvider.prototype.loadTile=function(e,t){var i,r=t.data,n=!0;defined(r)&&(n=r.boundingVolumeSourceTile!==t||t._lastSelectionResult===TileSelectionResult.CULLED_BUT_NEEDED,i=r.terrainState),GlobeSurfaceTile.processStateMachine(t,e,this.terrainProvider,this._imageryLayers,this._vertexArraysToDestroy,n),r=t.data,n&&i!==t.data.terrainState&&this.computeTileVisibility(t,e,this.quadtree.occluders)&&r.boundingVolumeSourceTile===t&&(n=!1,GlobeSurfaceTile.processStateMachine(t,e,this.terrainProvider,this._imageryLayers,this._vertexArraysToDestroy,n))};var boundingSphereScratch$1=new BoundingSphere,rectangleIntersectionScratch=new Rectangle,splitCartographicLimitRectangleScratch=new Rectangle,rectangleCenterScratch$3=new Cartographic;function clipRectangleAntimeridian(e,t){if(t.west<t.east)return t;var i=Rectangle.clone(t,splitCartographicLimitRectangleScratch);return 0<Rectangle.center(e,rectangleCenterScratch$3).longitude?i.east=CesiumMath.PI:i.west=-CesiumMath.PI,i}GlobeSurfaceTileProvider.prototype.computeTileVisibility=function(e,t,i){var r=this.computeDistanceToTile(e,t);if(e._distance=r,t.fog.enabled&&!t.cameraUnderground&&1<=CesiumMath.fog(r,t.fog.density))return Visibility$1.NONE;var n=e.data,a=n.tileBoundingRegion;if(void 0===n.boundingVolumeSourceTile)return Visibility$1.PARTIAL;var o=t.cullingVolume,s=n.orientedBoundingBox;!defined(s)&&defined(n.renderedMesh)&&(s=n.renderedMesh.boundingSphere3D),n.clippedByBoundaries=!1;var l=clipRectangleAntimeridian(e.rectangle,this.cartographicLimitRectangle),u=Rectangle.simpleIntersection(l,e.rectangle,rectangleIntersectionScratch);if(!defined(u))return Visibility$1.NONE;if(Rectangle.equals(u,e.rectangle)||(n.clippedByBoundaries=!0),t.mode!==SceneMode$1.SCENE3D&&(s=boundingSphereScratch$1,BoundingSphere.fromRectangleWithHeights2D(e.rectangle,t.mapProjection,a.minimumHeight,a.maximumHeight,s),Cartesian3.fromElements(s.center.z,s.center.x,s.center.y,s.center),t.mode===SceneMode$1.MORPHING&&defined(n.renderedMesh)&&(s=BoundingSphere.union(n.renderedMesh.boundingSphere3D,s,s))),!defined(s))return Intersect$1.INTERSECTING;var c=this._clippingPlanes;if(defined(c)&&c.enabled){var d=c.computeIntersectionWithBoundingVolume(s);if(e.isClipped=d!==Intersect$1.INSIDE,d===Intersect$1.OUTSIDE)return Visibility$1.NONE}var h=o.computeVisibility(s);if(h===Intersect$1.OUTSIDE)return Visibility$1.NONE;var p=t.mode===SceneMode$1.SCENE3D&&t.camera.frustum instanceof OrthographicFrustum;if(t.mode!==SceneMode$1.SCENE3D||p||!defined(i)||t.cameraUnderground)return h;var f=n.occludeePointInScaledSpace;return defined(f)?i.ellipsoid.isScaledSpacePointVisiblePossiblyUnderEllipsoid(f,a.minimumHeight)?h:Visibility$1.NONE:h},GlobeSurfaceTileProvider.prototype.canRefine=function(e){return!!defined(e.data.terrainData)||void 0!==this.terrainProvider.getTileDataAvailable(2*e.x,2*e.y,e.level+1)};var readyImageryScratch=[],canRenderTraversalStack=[];GlobeSurfaceTileProvider.prototype.canRenderWithoutLosingDetail=function(e,t){var i=e.data,r=readyImageryScratch;r.length=this._imageryLayers.length;var n,a,o,s=!1,l=!1;for(defined(i)&&(s=i.terrainState===TerrainState$2.READY,l=!0,n=i.imagery),a=0,o=r.length;a<o;++a)r[a]=l;if(defined(n))for(a=0,o=n.length;a<o;++a){var u=n[a],c=u.loadingImagery,d=!defined(c)||c.state===ImageryState$1.FAILED||c.state===ImageryState$1.INVALID,h=(u.loadingImagery||u.readyImagery).imageryLayer._layerIndex;r[h]=d&&r[h]}var p=this.quadtree._lastSelectionFrameNumber,f=canRenderTraversalStack;for(f.length=0,f.push(e.southwestChild,e.southeastChild,e.northwestChild,e.northeastChild);0<f.length;){var m=f.pop(),g=m._lastSelectionResultFrame===p?m._lastSelectionResult:TileSelectionResult.NONE;if(g===TileSelectionResult.RENDERED){if(!defined(m.data))continue;if(!s&&m.data.terrainState===TerrainState$2.READY)return!1;var y=m.data.imagery;for(a=0,o=y.length;a<o;++a){var v=y[a],_=v.loadingImagery,C=!defined(_)||_.state===ImageryState$1.FAILED||_.state===ImageryState$1.INVALID,x=(v.loadingImagery||v.readyImagery).imageryLayer._layerIndex;if(C&&!r[x])return!1}}else g===TileSelectionResult.REFINED&&f.push(m.southwestChild,m.southeastChild,m.northwestChild,m.northeastChild)}return!0};var tileDirectionScratch=new Cartesian3;GlobeSurfaceTileProvider.prototype.computeTileLoadPriority=function(e,t){var i=e.data;if(void 0===i)return 0;var r=i.orientedBoundingBox;if(void 0===r)return 0;var n=t.camera.positionWC,a=t.camera.directionWC,o=Cartesian3.subtract(r.center,n,tileDirectionScratch),s=Cartesian3.magnitude(o);return s<CesiumMath.EPSILON5?0:(Cartesian3.divideByScalar(o,s,o),(1-Cartesian3.dot(o,a))*e._distance)};var modifiedModelViewScratch$4=new Matrix4,modifiedModelViewProjectionScratch=new Matrix4,tileRectangleScratch=new Cartesian4,localizedCartographicLimitRectangleScratch=new Cartesian4,rtcScratch$4=new Cartesian3,centerEyeScratch=new Cartesian3,southwestScratch=new Cartesian3,northeastScratch=new Cartesian3;GlobeSurfaceTileProvider.prototype.showTileThisFrame=function(e,t){for(var i=0,r=e.data.imagery,n=0,a=r.length;n<a;++n){var o=r[n];defined(o.readyImagery)&&0!==o.readyImagery.imageryLayer.alpha&&++i}var s=this._tilesToRenderByTextureCount[i];defined(s)||(s=[],this._tilesToRenderByTextureCount[i]=s),s.push(e),defined(e.data.vertexArray)?this._hasLoadedTilesThisFrame=!0:this._hasFillTilesThisFrame=!0;var l=this._debug;++l.tilesRendered,l.texturesRendered+=i};var cornerPositionsScratch$1=[new Cartesian3,new Cartesian3,new Cartesian3,new Cartesian3];function computeOccludeePoint$1(e,t,i,r,n,a){var o=e.quadtree._occluders.ellipsoid,s=o.ellipsoid,l=cornerPositionsScratch$1;return Cartesian3.fromRadians(i.west,i.south,n,s,l[0]),Cartesian3.fromRadians(i.east,i.south,n,s,l[1]),Cartesian3.fromRadians(i.west,i.north,n,s,l[2]),Cartesian3.fromRadians(i.east,i.north,n,s,l[3]),o.computeHorizonCullingPointPossiblyUnderEllipsoid(t,l,r,a)}function updateTileBoundingRegion(e,t,i){var r=e.data;void 0===r&&(r=e.data=new GlobeSurfaceTile),void 0===r.tileBoundingRegion&&(r.tileBoundingRegion=new TileBoundingRegion({computeBoundingVolumes:!1,rectangle:e.rectangle,ellipsoid:e.tilingScheme.ellipsoid,minimumHeight:0,maximumHeight:0}));var n=r.terrainData,a=r.mesh,o=r.tileBoundingRegion;if(void 0!==a&&void 0!==a.minimumHeight&&void 0!==a.maximumHeight)return o.minimumHeight=a.minimumHeight,o.maximumHeight=a.maximumHeight,e;if(void 0!==n&&void 0!==n._minimumHeight&&void 0!==n._maximumHeight)return o.minimumHeight=n._minimumHeight*i.terrainExaggeration,o.maximumHeight=n._maximumHeight*i.terrainExaggeration,e;o.minimumHeight=Number.NaN,o.maximumHeight=Number.NaN;for(var s=e.parent;void 0!==s;){var l=s.data;if(void 0!==l){var u=l.mesh;if(void 0!==u&&void 0!==u.minimumHeight&&void 0!==u.maximumHeight)return o.minimumHeight=u.minimumHeight,o.maximumHeight=u.maximumHeight,s;var c=l.terrainData;if(void 0!==c&&void 0!==c._minimumHeight&&void 0!==c._maximumHeight)return o.minimumHeight=c._minimumHeight*i.terrainExaggeration,o.maximumHeight=c._maximumHeight*i.terrainExaggeration,s}s=s.parent}}function getTileReadyCallback(l,u,c){return function(e){var t,i,r,n=-1,a=e.data.imagery,o=a.length;for(r=0;r<o;++r)if((i=defaultValue((t=a[r]).readyImagery,t.loadingImagery)).imageryLayer===u){n=r;break}if(-1!==n){var s=n+l;if(!defined(i=defined(t=a[s])?defaultValue(t.readyImagery,t.loadingImagery):void 0)||i.imageryLayer!==u)return!u._createTileImagerySkeletons(e,c,s);for(r=n;r<s;++r)a[r].freeResources();a.splice(n,l)}return!0}}GlobeSurfaceTileProvider.prototype.computeDistanceToTile=function(e,t){var i=updateTileBoundingRegion(e,this.terrainProvider,t),r=e.data,n=r.tileBoundingRegion;if(void 0===i)return 9999999999;r.boundingVolumeSourceTile!==i&&(r.boundingVolumeSourceTile=i,defined(e.rectangle)&&(r.orientedBoundingBox=OrientedBoundingBox.fromRectangle(e.rectangle,n.minimumHeight,n.maximumHeight,e.tilingScheme.ellipsoid,r.orientedBoundingBox),r.occludeePointInScaledSpace=computeOccludeePoint$1(this,r.orientedBoundingBox.center,e.rectangle,n.minimumHeight,n.maximumHeight,r.occludeePointInScaledSpace)));var a=n.minimumHeight,o=n.maximumHeight;if(r.boundingVolumeSourceTile!==e){var s=t.camera.positionCartographic.height,l=Math.abs(s-a);Math.abs(s-o)<l?(n.minimumHeight=a,n.maximumHeight=a):(n.minimumHeight=o,n.maximumHeight=o)}var u=n.distanceToCamera(t);return n.minimumHeight=a,n.maximumHeight=o,u},GlobeSurfaceTileProvider.prototype.isDestroyed=function(){return!1},GlobeSurfaceTileProvider.prototype.destroy=function(){return this._tileProvider=this._tileProvider&&this._tileProvider.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),destroyObject(this)},GlobeSurfaceTileProvider.prototype._onLayerAdded=function(l,e){if(l.show){var u=this._terrainProvider,t=this,i=l.imageryProvider,r=this._imageryLayersUpdatedEvent;i._reload=function(){l._imageryCache={},t._quadtree.forEachLoadedTile(function(e){if(!defined(e._loadedCallbacks[l._layerIndex])){var t,i=e.data.imagery,r=i.length,n=-1,a=0;for(t=0;t<r;++t){var o=i[t];if(defaultValue(o.readyImagery,o.loadingImagery).imageryLayer===l)-1===n&&(n=t),++a;else if(-1!==n)break}if(-1!==n){var s=n+a;l._createTileImagerySkeletons(e,u,s)&&(e._loadedCallbacks[l._layerIndex]=getTileReadyCallback(a,l,u),e.state=QuadtreeTileLoadState$1.LOADING)}}})},this._quadtree.forEachLoadedTile(function(e){l._createTileImagerySkeletons(e,u)&&(e.state=QuadtreeTileLoadState$1.LOADING,0===e.level||e._lastSelectionResultFrame===t.quadtree._lastSelectionFrameNumber&&e._lastSelectionResult===TileSelectionResult.RENDERED||(e.renderable=!1))}),this._layerOrderChanged=!0,r.raiseEvent()}},GlobeSurfaceTileProvider.prototype._onLayerRemoved=function(l,e){this._quadtree.forEachLoadedTile(function(e){for(var t=e.data.imagery,i=-1,r=0,n=0,a=t.length;n<a;++n){var o=t[n],s=o.loadingImagery;if(defined(s)||(s=o.readyImagery),s.imageryLayer===l)-1===i&&(i=n),o.freeResources(),++r;else if(-1!==i)break}-1!==i&&t.splice(i,r)}),defined(l.imageryProvider)&&(l.imageryProvider._reload=void 0),this._imageryLayersUpdatedEvent.raiseEvent()},GlobeSurfaceTileProvider.prototype._onLayerMoved=function(e,t,i){this._layerOrderChanged=!0,this._imageryLayersUpdatedEvent.raiseEvent()},GlobeSurfaceTileProvider.prototype._onLayerShownOrHidden=function(e,t,i){i?this._onLayerAdded(e,t):this._onLayerRemoved(e,t)};var scratchClippingPlaneMatrix$2=new Matrix4,getDebugOrientedBoundingBox,getDebugBoundingSphere,debugDestroyPrimitive,gyw,hyw,dyw,eyw,fyw;function createTileUniformMap(r,t){return{u_initialColor:function(){return this.properties.initialColor},u_fillHighlightColor:function(){return this.properties.fillHighlightColor},u_zoomedOutOceanSpecularIntensity:function(){return this.properties.zoomedOutOceanSpecularIntensity},u_oceanNormalMap:function(){return this.properties.oceanNormalMap},u_lightingFadeDistance:function(){return this.properties.lightingFadeDistance},u_nightFadeDistance:function(){return this.properties.nightFadeDistance},u_center3D:function(){return this.properties.center3D},u_tileRectangle:function(){return this.properties.tileRectangle},u_modifiedModelView:function(){var e=r.context.uniformState.view,t=Matrix4.multiplyByPoint(e,this.properties.rtc,centerEyeScratch);return Matrix4.setTranslation(e,t,modifiedModelViewScratch$4),modifiedModelViewScratch$4},u_modifiedModelViewProjection:function(){var e=r.context.uniformState.view,t=r.context.uniformState.projection,i=Matrix4.multiplyByPoint(e,this.properties.rtc,centerEyeScratch);return Matrix4.setTranslation(e,i,modifiedModelViewProjectionScratch),Matrix4.multiply(t,modifiedModelViewProjectionScratch,modifiedModelViewProjectionScratch),modifiedModelViewProjectionScratch},u_dayTextures:function(){return this.properties.dayTextures},u_dayTextureTranslationAndScale:function(){return this.properties.dayTextureTranslationAndScale},u_dayTextureTexCoordsRectangle:function(){return this.properties.dayTextureTexCoordsRectangle},u_dayTextureUseWebMercatorT:function(){return this.properties.dayTextureUseWebMercatorT},u_dayTextureAlpha:function(){return this.properties.dayTextureAlpha},u_dayTextureBrightness:function(){return this.properties.dayTextureBrightness},u_dayTextureContrast:function(){return this.properties.dayTextureContrast},u_dayTextureHue:function(){return this.properties.dayTextureHue},u_dayTextureSaturation:function(){return this.properties.dayTextureSaturation},u_dayTextureOneOverGamma:function(){return this.properties.dayTextureOneOverGamma},u_dayIntensity:function(){return this.properties.dayIntensity},u_southAndNorthLatitude:function(){return this.properties.southAndNorthLatitude},u_southMercatorYAndOneOverHeight:function(){return this.properties.southMercatorYAndOneOverHeight},u_waterMask:function(){return this.properties.waterMask},u_waterMaskTranslationAndScale:function(){return this.properties.waterMaskTranslationAndScale},u_minMaxHeight:function(){return this.properties.minMaxHeight},u_scaleAndBias:function(){return this.properties.scaleAndBias},u_dayTextureSplit:function(){return this.properties.dayTextureSplit},u_dayTextureCutoutRectangles:function(){return this.properties.dayTextureCutoutRectangles},u_clippingPlanes:function(){var e=t._clippingPlanes;return defined(e)&&defined(e.texture)?e.texture:r.context.defaultTexture},u_cartographicLimitRectangle:function(){return this.properties.localizedCartographicLimitRectangle},u_clippingPlanesMatrix:function(){var e=t._clippingPlanes;return defined(e)?Matrix4.multiply(r.context.uniformState.view,e.modelMatrix,scratchClippingPlaneMatrix$2):Matrix4.IDENTITY},u_clippingPlanesEdgeStyle:function(){var e=this.properties.clippingPlanesEdgeColor;return e.alpha=this.properties.clippingPlanesEdgeWidth,e},u_minimumBrightness:function(){return r.fog.minimumBrightness},u_hsbShift:function(){return this.properties.hsbShift},u_colorsToAlpha:function(){return this.properties.colorsToAlpha},properties:{initialColor:new Cartesian4(0,0,.5,1),fillHighlightColor:new Color(0,0,0,0),zoomedOutOceanSpecularIntensity:.5,oceanNormalMap:void 0,lightingFadeDistance:new Cartesian2(65e5,9e6),nightFadeDistance:new Cartesian2(1e7,4e7),hsbShift:new Cartesian3,center3D:void 0,rtc:new Cartesian3,modifiedModelView:new Matrix4,tileRectangle:new Cartesian4,dayTextures:[],dayTextureTranslationAndScale:[],dayTextureTexCoordsRectangle:[],dayTextureUseWebMercatorT:[],dayTextureAlpha:[],dayTextureBrightness:[],dayTextureContrast:[],dayTextureHue:[],dayTextureSaturation:[],dayTextureOneOverGamma:[],dayTextureSplit:[],dayTextureCutoutRectangles:[],dayIntensity:0,colorsToAlpha:[],southAndNorthLatitude:new Cartesian2,southMercatorYAndOneOverHeight:new Cartesian2,waterMask:void 0,waterMaskTranslationAndScale:new Cartesian4,minMaxHeight:new Cartesian2,scaleAndBias:new Matrix4,clippingPlanesEdgeColor:Color.clone(Color.WHITE),clippingPlanesEdgeWidth:0,localizedCartographicLimitRectangle:new Cartesian4}}}function createWireframeVertexArrayIfNecessary(e,t,i){var r,n,a=i.data;if(defined(a.vertexArray)?(r=a.mesh,n=a.vertexArray):defined(a.fill)&&defined(a.fill.vertexArray)&&(r=a.fill.mesh,n=a.fill.vertexArray),defined(r)&&defined(n)){if(defined(a.wireframeVertexArray)){if(a.wireframeVertexArray.mesh===r)return;a.wireframeVertexArray.destroy(),a.wireframeVertexArray=void 0}a.wireframeVertexArray=createWireframeVertexArray(e,n,r),a.wireframeVertexArray.mesh=r}}function createWireframeVertexArray(e,t,i){var r={indices:i.indices,primitiveType:PrimitiveType$1.TRIANGLES};GeometryPipeline.toWireframe(r);var n=r.indices,a=Buffer$1.createIndexBuffer({context:e,typedArray:n,usage:BufferUsage$1.STATIC_DRAW,indexDatatype:IndexDatatype$1.fromSizeInBytes(n.BYTES_PER_ELEMENT)});return new VertexArray({context:e,attributes:t._attributes,indexBuffer:a})}function iyw(e){return new Primitive({geometryInstances:e,appearance:new PerInstanceColorAppearance({translucent:!1,flat:!0}),asynchronous:!1})}dyw=new GeometryInstance({geometry:BoxOutlineGeometry.fromDimensions({dimensions:new Cartesian3(2,2,2)})}),eyw=new GeometryInstance({geometry:new SphereOutlineGeometry({radius:1})}),fyw=new Matrix4,getDebugOrientedBoundingBox=function(e,t){return e===gyw?hyw:(debugDestroyPrimitive(),gyw=e,fyw=Matrix4.fromRotationTranslation(e.halfAxes,e.center,fyw),dyw.modelMatrix=fyw,dyw.attributes.color=ColorGeometryInstanceAttribute.fromColor(t),hyw=iyw(dyw))},getDebugBoundingSphere=function(e,t){return e===gyw?hyw:(debugDestroyPrimitive(),gyw=e,fyw=Matrix4.fromTranslation(e.center,fyw),fyw=Matrix4.multiplyByUniformScale(fyw,e.radius,fyw),eyw.modelMatrix=fyw,eyw.attributes.color=ColorGeometryInstanceAttribute.fromColor(t),hyw=iyw(eyw))},debugDestroyPrimitive=function(){defined(hyw)&&(hyw.destroy(),gyw=hyw=void 0)};var otherPassesInitialColor=new Cartesian4(0,0,0,0),surfaceShaderSetOptionsScratch={frameState:void 0,surfaceTile:void 0,numberOfDayTextures:void 0,applyBrightness:void 0,applyContrast:void 0,applyHue:void 0,applySaturation:void 0,applyGamma:void 0,applyAlpha:void 0,applySplit:void 0,showReflectiveOcean:void 0,showOceanWaves:void 0,enableLighting:void 0,dynamicAtmosphereLighting:void 0,dynamicAtmosphereLightingFromSun:void 0,showGroundAtmosphere:void 0,perFragmentGroundAtmosphere:void 0,hasVertexNormals:void 0,useWebMercatorProjection:void 0,enableFog:void 0,enableClippingPlanes:void 0,clippingPlanes:void 0,clippedByBoundaries:void 0,hasImageryLayerCutout:void 0,colorCorrect:void 0,colorToAlpha:void 0};function addDrawCommandsForTile(e,t,i){var r=t.data;defined(r.vertexArray)||(void 0===r.fill&&(r.fill=new TerrainFillMesh(t)),r.fill.update(e,i));var n=i.creditDisplay,a=r.terrainData;if(defined(a)&&defined(a.credits))for(var o=a.credits,s=0,l=o.length;s<l;++s)n.addCredit(o[s]);var u=ContextLimits.maximumTextureImageUnits,c=r.waterMaskTexture,d=r.waterMaskTranslationAndScale;!defined(c)&&defined(r.fill)&&(c=r.fill.waterMaskTexture,d=r.fill.waterMaskTranslationAndScale);var h=i.cameraUnderground,p=e.hasWaterMask&&defined(c),f=e.oceanNormalMap,m=p&&defined(f),g=e.terrainProvider.ready&&e.terrainProvider.hasVertexNormals,y=i.fog.enabled&&!h,v=e.showGroundAtmosphere,_=ShadowMode$1.castShadows(e.shadows),C=ShadowMode$1.receiveShadows(e.shadows),x=e.hueShift,b=e.saturationShift,A=e.brightnessShift,S=!(CesiumMath.equalsEpsilon(x,0,CesiumMath.EPSILON7)&&CesiumMath.equalsEpsilon(b,0,CesiumMath.EPSILON7)&&CesiumMath.equalsEpsilon(A,0,CesiumMath.EPSILON7)),w=!1;if(v){var E,T=i.mode,P=i.camera;E=T===SceneMode$1.SCENE2D||T===SceneMode$1.COLUMBUS_VIEW?P.positionCartographic.height:Cartesian3.magnitude(P.positionWC);var M=e.nightFadeOutDistance;T!==SceneMode$1.SCENE3D&&(M-=i.mapProjection.ellipsoid.maximumRadius),w=M<E}p&&--u,m&&--u,defined(i.shadowState)&&i.shadowState.shadowsEnabled&&--u,defined(e.clippingPlanes)&&e.clippingPlanes.enabled&&--u;var D=r.renderedMesh,I=D.center,O=D.encoding,R=tileRectangleScratch,L=0,N=0,k=0,B=0,F=!1;if(i.mode!==SceneMode$1.SCENE3D){var V=i.mapProjection,z=V.project(Rectangle.southwest(t.rectangle),southwestScratch),U=V.project(Rectangle.northeast(t.rectangle),northeastScratch);if(R.x=z.x,R.y=z.y,R.z=U.x,R.w=U.y,i.mode!==SceneMode$1.MORPHING&&((I=rtcScratch$4).x=0,I.y=.5*(R.z+R.x),I.z=.5*(R.w+R.y),R.x-=I.y,R.y-=I.z,R.z-=I.y,R.w-=I.z),i.mode===SceneMode$1.SCENE2D&&O.quantization===TerrainQuantization$1.BITS12){var G=1/(Math.pow(2,12)-1)*.5,$=(R.z-R.x)*G,H=(R.w-R.y)*G;R.x-=$,R.y-=H,R.z+=$,R.w+=H}V instanceof WebMercatorProjection&&(L=t.rectangle.south,N=t.rectangle.north,k=WebMercatorProjection.geodeticLatitudeToMercatorAngle(L),B=1/(WebMercatorProjection.geodeticLatitudeToMercatorAngle(N)-k),F=!0)}var W=surfaceShaderSetOptionsScratch;W.frameState=i,W.surfaceTile=r,W.showReflectiveOcean=p,W.showOceanWaves=m,W.enableLighting=e.enableLighting,W.dynamicAtmosphereLighting=e.dynamicAtmosphereLighting,W.dynamicAtmosphereLightingFromSun=e.dynamicAtmosphereLightingFromSun,W.showGroundAtmosphere=v,W.perFragmentGroundAtmosphere=w,W.hasVertexNormals=g,W.useWebMercatorProjection=F,W.clippedByBoundaries=r.clippedByBoundaries;var j=r.imagery,q=0,Q=j.length,Y=e.showSkirts&&!h,X=e.backFaceCulling&&!h,Z=X?e._renderState:e._disableCullingRenderState,J=X?e._blendRenderState:e._disableCullingBlendRenderState,K=Z,ee=e._firstPassInitialColor,te=i.context;defined(e._debug.boundingSphereTile)||debugDestroyPrimitive();do{var ie,re,ne=0;if(e._drawCommands.length<=e._usedDrawCommands?((ie=new DrawCommand).owner=t,ie.cull=!1,ie.boundingVolume=new BoundingSphere,ie.orientedBoundingBox=void 0,re=createTileUniformMap(i,e),e._drawCommands.push(ie),e._uniformMaps.push(re)):(ie=e._drawCommands[e._usedDrawCommands],re=e._uniformMaps[e._usedDrawCommands]),ie.owner=t,++e._usedDrawCommands,t===e._debug.boundingSphereTile){var ae=r.orientedBoundingBox;defined(ae)?getDebugOrientedBoundingBox(ae,Color.RED).update(i):defined(D)&&defined(D.boundingSphere3D)&&getDebugBoundingSphere(D.boundingSphere3D,Color.RED).update(i)}var oe=re.properties;Cartesian4.clone(ee,oe.initialColor),oe.oceanNormalMap=f,oe.lightingFadeDistance.x=e.lightingFadeOutDistance,oe.lightingFadeDistance.y=e.lightingFadeInDistance,oe.nightFadeDistance.x=e.nightFadeOutDistance,oe.nightFadeDistance.y=e.nightFadeInDistance,oe.zoomedOutOceanSpecularIntensity=e.zoomedOutOceanSpecularIntensity;var se=!defined(r.vertexArray)&&defined(e.fillHighlightColor)&&0<e.fillHighlightColor.alpha;se&&Color.clone(e.fillHighlightColor,oe.fillHighlightColor),oe.center3D=D.center,Cartesian3.clone(I,oe.rtc),Cartesian4.clone(R,oe.tileRectangle),oe.southAndNorthLatitude.x=L,oe.southAndNorthLatitude.y=N,oe.southMercatorYAndOneOverHeight.x=k,oe.southMercatorYAndOneOverHeight.y=B;var le=localizedCartographicLimitRectangleScratch,ue=clipRectangleAntimeridian(t.rectangle,e.cartographicLimitRectangle);Cartesian3.fromElements(x,b,A,oe.hsbShift);var ce=t.rectangle,de=1/ce.width,he=1/ce.height;le.x=(ue.west-ce.west)*de,le.y=(ue.south-ce.south)*he,le.z=(ue.east-ce.west)*de,le.w=(ue.north-ce.south)*he,Cartesian4.clone(le,oe.localizedCartographicLimitRectangle);var pe=y&&CesiumMath.fog(t._distance,i.fog.density)>CesiumMath.EPSILON3;S=S&&(pe||v);for(var fe=!1,me=!1,ge=!1,ye=!1,ve=!1,_e=!1,Ce=!1,xe=!1,be=!1;ne<u&&q<Q;){var Ae=j[q],Se=Ae.readyImagery;if(++q,defined(Se)&&0!==Se.imageryLayer.alpha){var we=Ae.useWebMercatorT?Se.textureWebMercator:Se.texture,Ee=Se.imageryLayer;defined(Ae.textureTranslationAndScale)||(Ae.textureTranslationAndScale=Ee._calculateTextureTranslationAndScale(t,Ae)),oe.dayTextures[ne]=we,oe.dayTextureTranslationAndScale[ne]=Ae.textureTranslationAndScale,oe.dayTextureTexCoordsRectangle[ne]=Ae.textureCoordinateRectangle,oe.dayTextureUseWebMercatorT[ne]=Ae.useWebMercatorT,oe.dayTextureAlpha[ne]=Ee.alpha,_e=_e||1!==oe.dayTextureAlpha[ne],oe.dayTextureBrightness[ne]=Ee.brightness,fe=fe||oe.dayTextureBrightness[ne]!==ImageryLayer.DEFAULT_BRIGHTNESS,oe.dayTextureContrast[ne]=Ee.contrast,me=me||oe.dayTextureContrast[ne]!==ImageryLayer.DEFAULT_CONTRAST,oe.dayTextureHue[ne]=Ee.hue,ge=ge||oe.dayTextureHue[ne]!==ImageryLayer.DEFAULT_HUE,oe.dayTextureSaturation[ne]=Ee.saturation,ye=ye||oe.dayTextureSaturation[ne]!==ImageryLayer.DEFAULT_SATURATION,oe.dayTextureOneOverGamma[ne]=1/Ee.gamma,ve=ve||oe.dayTextureOneOverGamma[ne]!==1/ImageryLayer.DEFAULT_GAMMA,oe.dayTextureSplit[ne]=Ee.splitDirection,Ce=Ce||0!==oe.dayTextureSplit[ne];var Te=oe.dayTextureCutoutRectangles[ne];if(defined(Te)||(Te=oe.dayTextureCutoutRectangles[ne]=new Cartesian4),Cartesian4.clone(Cartesian4.ZERO,Te),defined(Ee.cutoutRectangle)){var Pe=clipRectangleAntimeridian(ce,Ee.cutoutRectangle);xe=defined(Rectangle.simpleIntersection(Pe,ce,rectangleIntersectionScratch))||xe,Te.x=(Pe.west-ce.west)*de,Te.y=(Pe.south-ce.south)*he,Te.z=(Pe.east-ce.west)*de,Te.w=(Pe.north-ce.south)*he}var Me=oe.colorsToAlpha[ne];defined(Me)||(Me=oe.colorsToAlpha[ne]=new Cartesian4);var De=defined(Ee.colorToAlpha)&&0<Ee.colorToAlphaThreshold;if(be=be||De,De){var Ie=Ee.colorToAlpha;Me.x=Ie.red,Me.y=Ie.green,Me.z=Ie.blue,Me.w=Ee.colorToAlphaThreshold}else Me.w=-1;if(defined(Se.credits))for(var Oe=Se.credits,Re=0,Le=Oe.length;Re<Le;++Re)n.addCredit(Oe[Re]);++ne}}oe.dayTextures.length=ne,oe.waterMask=c,Cartesian4.clone(d,oe.waterMaskTranslationAndScale),oe.minMaxHeight.x=O.minimumHeight,oe.minMaxHeight.y=O.maximumHeight,Matrix4.clone(O.matrix,oe.scaleAndBias);var Ne=e._clippingPlanes,ke=defined(Ne)&&Ne.enabled&&t.isClipped;ke&&(oe.clippingPlanesEdgeColor=Color.clone(Ne.edgeColor,oe.clippingPlanesEdgeColor),oe.clippingPlanesEdgeWidth=Ne.edgeWidth),defined(e.uniformMap)&&(re=combine(re,e.uniformMap)),W.numberOfDayTextures=ne,W.applyBrightness=fe,W.applyContrast=me,W.applyHue=ge,W.applySaturation=ye,W.applyGamma=ve,W.applyAlpha=_e,W.applySplit=Ce,W.enableFog=pe,W.enableClippingPlanes=ke,W.clippingPlanes=Ne,W.hasImageryLayerCutout=xe,W.colorCorrect=S,W.highlightFillTile=se,W.colorToAlpha=be;var Be=r.renderedMesh.indices.length;Y||(Be=r.renderedMesh.indexCountWithoutSkirts),ie.shaderProgram=e._surfaceShaderSet.getShaderProgram(W),ie.castShadows=_,ie.receiveShadows=C,ie.renderState=K,ie.primitiveType=PrimitiveType$1.TRIANGLES,ie.vertexArray=r.vertexArray||r.fill.vertexArray,ie.count=Be,ie.uniformMap=re,ie.pass=ExpandByTerra.underEarth.enable?Pass$1.TRANSLUCENT:Pass$1.GLOBE,e._debug.wireframe&&(createWireframeVertexArrayIfNecessary(te,e,t),defined(r.wireframeVertexArray)&&(ie.vertexArray=r.wireframeVertexArray,ie.primitiveType=PrimitiveType$1.LINES,ie.count=2*Be));var Fe=ie.boundingVolume,Ve=ie.orientedBoundingBox;if(i.mode!==SceneMode$1.SCENE3D){var ze=r.tileBoundingRegion;BoundingSphere.fromRectangleWithHeights2D(t.rectangle,i.mapProjection,ze.minimumHeight,ze.maximumHeight,Fe),Cartesian3.fromElements(Fe.center.z,Fe.center.x,Fe.center.y,Fe.center),i.mode===SceneMode$1.MORPHING&&(Fe=BoundingSphere.union(D.boundingSphere3D,Fe,Fe))}else ie.boundingVolume=BoundingSphere.clone(D.boundingSphere3D,Fe),ie.orientedBoundingBox=OrientedBoundingBox.clone(r.orientedBoundingBox,Ve);ie.dirty=!0,i.commandList.push(ie),K=J,ee=otherPassesInitialColor}while(q<Q)}function ImageryLayerCollection(){this._layers=[],this.layerAdded=new Event,this.layerRemoved=new Event,this.layerMoved=new Event,this.layerShownOrHidden=new Event}function getLayerIndex(e,t){return e.indexOf(t)}function swapLayers(e,t,i){var r=e._layers;if((t=CesiumMath.clamp(t,0,r.length-1))!==(i=CesiumMath.clamp(i,0,r.length-1))){var n=r[t];r[t]=r[i],r[i]=n,e._update(),e.layerMoved.raiseEvent(n,i,t)}}Object.defineProperties(ImageryLayerCollection.prototype,{length:{get:function(){return this._layers.length}}}),ImageryLayerCollection.prototype.add=function(e,t){defined(t)?this._layers.splice(t,0,e):(t=this._layers.length,this._layers.push(e)),this._update(),this.layerAdded.raiseEvent(e,t)},ImageryLayerCollection.prototype.addImageryProvider=function(e,t){var i=new ImageryLayer(e);return this.add(i,t),i},ImageryLayerCollection.prototype.remove=function(e,t){t=defaultValue(t,!0);var i=this._layers.indexOf(e);return-1!==i&&(this._layers.splice(i,1),this._update(),this.layerRemoved.raiseEvent(e,i),t&&e.destroy(),!0)},ImageryLayerCollection.prototype.removeAll=function(e){e=defaultValue(e,!0);for(var t=this._layers,i=0,r=t.length;i<r;i++){var n=t[i];this.layerRemoved.raiseEvent(n,i),e&&n.destroy()}this._layers=[]},ImageryLayerCollection.prototype.contains=function(e){return-1!==this.indexOf(e)},ImageryLayerCollection.prototype.indexOf=function(e){return this._layers.indexOf(e)},ImageryLayerCollection.prototype.get=function(e){return this._layers[e]},ImageryLayerCollection.prototype.raise=function(e){var t=getLayerIndex(this._layers,e);swapLayers(this,t,t+1)},ImageryLayerCollection.prototype.lower=function(e){var t=getLayerIndex(this._layers,e);swapLayers(this,t,t-1)},ImageryLayerCollection.prototype.raiseToTop=function(e){var t=getLayerIndex(this._layers,e);t!==this._layers.length-1&&(this._layers.splice(t,1),this._layers.push(e),this._update(),this.layerMoved.raiseEvent(e,this._layers.length-1,t))},ImageryLayerCollection.prototype.lowerToBottom=function(e){var t=getLayerIndex(this._layers,e);0!==t&&(this._layers.splice(t,1),this._layers.splice(0,0,e),this._update(),this.layerMoved.raiseEvent(e,0,t))};var applicableRectangleScratch=new Rectangle,comparisonPoint;function QuadtreeOccluders(e){this._ellipsoid=new EllipsoidalOccluder(e.ellipsoid,Cartesian3.ZERO)}function QuadtreeTile(e){this._tilingScheme=e.tilingScheme,this._x=e.x,this._y=e.y,this._level=e.level,this._parent=e.parent,this._rectangle=this._tilingScheme.tileXYToRectangle(this._x,this._y,this._level),this._southwestChild=void 0,this._southeastChild=void 0,this._northwestChild=void 0,this._northeastChild=void 0,this.replacementPrevious=void 0,this.replacementNext=void 0,this._distance=0,this._loadPriority=0,this._customData=[],this._frameUpdated=void 0,this._lastSelectionResult=TileSelectionResult.NONE,this._lastSelectionResultFrame=void 0,this._loadedCallbacks={},this.state=QuadtreeTileLoadState$1.START,this.renderable=!1,this.upsampledFromParent=!1,this.data=void 0}function freeTile(e){defined(e)&&e.freeResources()}function TileReplacementQueue(){this.head=void 0,this.tail=void 0,this.count=0,this._lastBeforeStartOfFrame=void 0}function remove$1(e,t){var i=t.replacementPrevious,r=t.replacementNext;t===e._lastBeforeStartOfFrame&&(e._lastBeforeStartOfFrame=r),t===e.head?e.head=r:i.replacementNext=r,t===e.tail?e.tail=i:r.replacementPrevious=i,t.replacementPrevious=void 0,t.replacementNext=void 0,--e.count}function QuadtreePrimitive(e){this._tileProvider=e.tileProvider,(this._tileProvider.quadtree=this)._debug={enableDebugOutput:!1,maxDepth:0,maxDepthVisited:0,tilesVisited:0,tilesCulled:0,tilesRendered:0,tilesWaitingForChildren:0,lastMaxDepth:-1,lastMaxDepthVisited:-1,lastTilesVisited:-1,lastTilesCulled:-1,lastTilesRendered:-1,lastTilesWaitingForChildren:-1,suspendLodUpdate:!1};var t=this._tileProvider.tilingScheme.ellipsoid;this._tilesToRender=[],this._tileLoadQueueHigh=[],this._tileLoadQueueMedium=[],this._tileLoadQueueLow=[],this._tileReplacementQueue=new TileReplacementQueue,this._levelZeroTiles=void 0,this._loadQueueTimeSlice=5,this._tilesInvalidated=!1,this._addHeightCallbacks=[],this._removeHeightCallbacks=[],this._tileToUpdateHeights=[],this._lastTileIndex=0,this._updateHeightsTimeSlice=2,this._cameraPositionCartographic=void 0,this._cameraReferenceFrameOriginCartographic=void 0,this.maximumScreenSpaceError=defaultValue(e.maximumScreenSpaceError,2),this.tileCacheSize=defaultValue(e.tileCacheSize,100),this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this._occluders=new QuadtreeOccluders({ellipsoid:t}),this._tileLoadProgressEvent=new Event,this._lastTileLoadQueueLength=0,this._lastSelectionFrameNumber=void 0}function invalidateAllTiles(e){var t=e._tileReplacementQueue;t.head=void 0,t.tail=void 0,t.count=0,clearTileLoadQueue(e);var i=e._levelZeroTiles;if(defined(i))for(var r=0;r<i.length;++r){for(var n=i[r].customData,a=n.length,o=0;o<a;++o){var s=n[o];s.level=0,e._addHeightCallbacks.push(s)}i[r].freeResources()}e._levelZeroTiles=void 0,e._tileProvider.cancelReprojections()}function clearTileLoadQueue(e){var t=e._debug;t.maxDepth=0,t.maxDepthVisited=0,t.tilesVisited=0,t.tilesCulled=0,t.tilesRendered=0,t.tilesWaitingForChildren=0,e._tileLoadQueueHigh.length=0,e._tileLoadQueueMedium.length=0,e._tileLoadQueueLow.length=0}function updateTileLoadProgress(e,t){var i=e._tileLoadQueueHigh.length+e._tileLoadQueueMedium.length+e._tileLoadQueueLow.length;i===e._lastTileLoadQueueLength&&!e._tilesInvalidated||(t.afterRender.push(Event.prototype.raiseEvent.bind(e._tileLoadProgressEvent,i)),e._lastTileLoadQueueLength=i);var r=e._debug;r.enableDebugOutput&&!r.suspendLodUpdate&&(r.maxDepth=e._tilesToRender.reduce(function(e,t){return Math.max(e,t.level)},-1),r.tilesRendered=e._tilesToRender.length,r.tilesVisited===r.lastTilesVisited&&r.tilesRendered===r.lastTilesRendered&&r.tilesCulled===r.lastTilesCulled&&r.maxDepth===r.lastMaxDepth&&r.tilesWaitingForChildren===r.lastTilesWaitingForChildren&&r.maxDepthVisited===r.lastMaxDepthVisited||(console.log("Visited "+r.tilesVisited+", Rendered: "+r.tilesRendered+", Culled: "+r.tilesCulled+", Max Depth Rendered: "+r.maxDepth+", Max Depth Visited: "+r.maxDepthVisited+", Waiting for children: "+r.tilesWaitingForChildren),r.lastTilesVisited=r.tilesVisited,r.lastTilesRendered=r.tilesRendered,r.lastTilesCulled=r.tilesCulled,r.lastMaxDepth=r.maxDepth,r.lastTilesWaitingForChildren=r.tilesWaitingForChildren,r.lastMaxDepthVisited=r.maxDepthVisited))}ImageryLayerCollection.prototype.pickImageryLayerFeatures=function(e,t){var i=t.globe.pick(e,t);if(defined(i)){for(var r,s=t.globe.ellipsoid.cartesianToCartographic(i),n=t.globe._surface._tilesToRender,a=0;!defined(r)&&a<n.length;++a){var o=n[a];Rectangle.contains(o.rectangle,s)&&(r=o)}if(defined(r)){for(var l=r.data.imagery,u=[],c=[],d=l.length-1;0<=d;--d){var h=l[d],p=h.readyImagery;if(defined(p)){var f=p.imageryLayer.imageryProvider;if(defined(f.pickFeatures)&&Rectangle.contains(p.rectangle,s)){var m=applicableRectangleScratch,g=1/1024;if(m.west=CesiumMath.lerp(r.rectangle.west,r.rectangle.east,h.textureCoordinateRectangle.x-g),m.east=CesiumMath.lerp(r.rectangle.west,r.rectangle.east,h.textureCoordinateRectangle.z+g),m.south=CesiumMath.lerp(r.rectangle.south,r.rectangle.north,h.textureCoordinateRectangle.y-g),m.north=CesiumMath.lerp(r.rectangle.south,r.rectangle.north,h.textureCoordinateRectangle.w+g),Rectangle.contains(m,s)){var y=f.pickFeatures(p.x,p.y,p.level,s.longitude,s.latitude);defined(y)&&(u.push(y),c.push(p.imageryLayer))}}}}if(0!==u.length)return when.all(u,function(e){for(var t=[],i=0;i<e.length;++i){var r=e[i],n=c[i];if(defined(r)&&0<r.length)for(var a=0;a<r.length;++a){var o=r[a];o.imageryLayer=n,defined(o.position)||(o.position=s),t.push(o)}}return t})}}},ImageryLayerCollection.prototype.queueReprojectionCommands=function(e){for(var t=this._layers,i=0,r=t.length;i<r;++i)t[i].queueReprojectionCommands(e)},ImageryLayerCollection.prototype.cancelReprojections=function(){for(var e=this._layers,t=0,i=e.length;t<i;++t)e[t].cancelReprojections()},ImageryLayerCollection.prototype.isDestroyed=function(){return!1},ImageryLayerCollection.prototype.destroy=function(){return this.removeAll(!0),destroyObject(this)},ImageryLayerCollection.prototype._update=function(){var e,t,i,r,n=!0,a=this._layers;for(i=0,r=a.length;i<r;++i)(t=a[i])._layerIndex=i,t.show?(t._isBaseLayer=n,n=!1):t._isBaseLayer=!1,t.show!==t._show&&(defined(t._show)&&(defined(e)||(e=[]),e.push(t)),t._show=t.show);if(defined(e))for(i=0,r=e.length;i<r;++i)t=e[i],this.layerShownOrHidden.raiseEvent(t,t._layerIndex,t.show)},Object.defineProperties(QuadtreeOccluders.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),QuadtreeTile.createLevelZeroTiles=function(e){for(var t=e.getNumberOfXTilesAtLevel(0),i=e.getNumberOfYTilesAtLevel(0),r=new Array(t*i),n=0,a=0;a<i;++a)for(var o=0;o<t;++o)r[n++]=new QuadtreeTile({tilingScheme:e,x:o,y:a,level:0});return r},QuadtreeTile.prototype._updateCustomData=function(e,t,i){var r,n,a,o=this.customData;if(defined(t)&&defined(i)){for(o=o.filter(function(e){return-1===i.indexOf(e)}),this._customData=o,a=this._rectangle,r=0;r<t.length;++r)n=t[r],Rectangle.contains(a,n.positionCartographic)&&o.push(n);this._frameUpdated=e}else{var s=this._parent;if(defined(s)&&this._frameUpdated!==s._frameUpdated){o.length=0,a=this._rectangle;var l=s.customData;for(r=0;r<l.length;++r)n=l[r],Rectangle.contains(a,n.positionCartographic)&&o.push(n);this._frameUpdated=s._frameUpdated}}},Object.defineProperties(QuadtreeTile.prototype,{tilingScheme:{get:function(){return this._tilingScheme}},x:{get:function(){return this._x}},y:{get:function(){return this._y}},level:{get:function(){return this._level}},parent:{get:function(){return this._parent}},rectangle:{get:function(){return this._rectangle}},children:{get:function(){return[this.northwestChild,this.northeastChild,this.southwestChild,this.southeastChild]}},southwestChild:{get:function(){return defined(this._southwestChild)||(this._southwestChild=new QuadtreeTile({tilingScheme:this.tilingScheme,x:2*this.x,y:2*this.y+1,level:this.level+1,parent:this})),this._southwestChild}},southeastChild:{get:function(){return defined(this._southeastChild)||(this._southeastChild=new QuadtreeTile({tilingScheme:this.tilingScheme,x:2*this.x+1,y:2*this.y+1,level:this.level+1,parent:this})),this._southeastChild}},northwestChild:{get:function(){return defined(this._northwestChild)||(this._northwestChild=new QuadtreeTile({tilingScheme:this.tilingScheme,x:2*this.x,y:2*this.y,level:this.level+1,parent:this})),this._northwestChild}},northeastChild:{get:function(){return defined(this._northeastChild)||(this._northeastChild=new QuadtreeTile({tilingScheme:this.tilingScheme,x:2*this.x+1,y:2*this.y,level:this.level+1,parent:this})),this._northeastChild}},customData:{get:function(){return this._customData}},needsLoading:{get:function(){return this.state<QuadtreeTileLoadState$1.DONE}},eligibleForUnloading:{get:function(){var e=!0;return defined(this.data)&&(defined(e=this.data.eligibleForUnloading)||(e=!0)),e}}}),QuadtreeTile.prototype.findLevelZeroTile=function(e,t,i){var r=this.tilingScheme.getNumberOfXTilesAtLevel(0);if(t<0?t+=r:r<=t&&(t-=r),!(i<0||i>=this.tilingScheme.getNumberOfYTilesAtLevel(0)))return e.filter(function(e){return e.x===t&&e.y===i})[0]},QuadtreeTile.prototype.findTileToWest=function(e){var t=this.parent;if(void 0===t)return this.findLevelZeroTile(e,this.x-1,this.y);if(t.southeastChild===this)return t.southwestChild;if(t.northeastChild===this)return t.northwestChild;var i=t.findTileToWest(e);return void 0!==i?t.southwestChild===this?i.southeastChild:i.northeastChild:void 0},QuadtreeTile.prototype.findTileToEast=function(e){var t=this.parent;if(void 0===t)return this.findLevelZeroTile(e,this.x+1,this.y);if(t.southwestChild===this)return t.southeastChild;if(t.northwestChild===this)return t.northeastChild;var i=t.findTileToEast(e);return void 0!==i?t.southeastChild===this?i.southwestChild:i.northwestChild:void 0},QuadtreeTile.prototype.findTileToSouth=function(e){var t=this.parent;if(void 0===t)return this.findLevelZeroTile(e,this.x,this.y+1);if(t.northwestChild===this)return t.southwestChild;if(t.northeastChild===this)return t.southeastChild;var i=t.findTileToSouth(e);return void 0!==i?t.southwestChild===this?i.northwestChild:i.northeastChild:void 0},QuadtreeTile.prototype.findTileToNorth=function(e){var t=this.parent;if(void 0===t)return this.findLevelZeroTile(e,this.x,this.y-1);if(t.southwestChild===this)return t.northwestChild;if(t.southeastChild===this)return t.northeastChild;var i=t.findTileToNorth(e);return void 0!==i?t.northwestChild===this?i.southwestChild:i.southeastChild:void 0},QuadtreeTile.prototype.freeResources=function(){this.state=QuadtreeTileLoadState$1.START,this.renderable=!1,this.upsampledFromParent=!1,defined(this.data)&&defined(this.data.freeResources)&&this.data.freeResources(),freeTile(this._southwestChild),this._southwestChild=void 0,freeTile(this._southeastChild),this._southeastChild=void 0,freeTile(this._northwestChild),this._northwestChild=void 0,freeTile(this._northeastChild),this._northeastChild=void 0},TileReplacementQueue.prototype.markStartOfRenderFrame=function(){this._lastBeforeStartOfFrame=this.head},TileReplacementQueue.prototype.trimTiles=function(e){for(var t=this.tail,i=!0;i&&defined(this._lastBeforeStartOfFrame)&&this.count>e&&defined(t);){i=t!==this._lastBeforeStartOfFrame;var r=t.replacementPrevious;t.eligibleForUnloading&&(t.freeResources(),remove$1(this,t)),t=r}},TileReplacementQueue.prototype.markTileRendered=function(e){var t=this.head;if(t!==e){if(++this.count,!defined(t))return e.replacementPrevious=void 0,e.replacementNext=void 0,this.head=e,void(this.tail=e);(defined(e.replacementPrevious)||defined(e.replacementNext))&&remove$1(this,e),e.replacementPrevious=void 0,(e.replacementNext=t).replacementPrevious=e,this.head=e}else e===this._lastBeforeStartOfFrame&&(this._lastBeforeStartOfFrame=e.replacementNext)},Object.defineProperties(QuadtreePrimitive.prototype,{tileProvider:{get:function(){return this._tileProvider}},tileLoadProgressEvent:{get:function(){return this._tileLoadProgressEvent}},occluders:{get:function(){return this._occluders}}}),QuadtreePrimitive.prototype.invalidateAllTiles=function(){this._tilesInvalidated=!0},QuadtreePrimitive.prototype.forEachLoadedTile=function(e){for(var t=this._tileReplacementQueue.head;defined(t);)t.state!==QuadtreeTileLoadState$1.START&&e(t),t=t.replacementNext},QuadtreePrimitive.prototype.forEachRenderedTile=function(e){for(var t=this._tilesToRender,i=0,r=t.length;i<r;++i)e(t[i])},QuadtreePrimitive.prototype.updateHeight=function(e,t){var r=this,n={positionOnEllipsoidSurface:void 0,positionCartographic:e,level:-1,callback:t,removeFunc:function(){for(var e=r._addHeightCallbacks,t=e.length,i=0;i<t;++i)if(e[i]===n){e.splice(i,1);break}r._removeHeightCallbacks.push(n)}};return r._addHeightCallbacks.push(n),n.removeFunc},QuadtreePrimitive.prototype.update=function(e){defined(this._tileProvider.update)&&this._tileProvider.update(e)},QuadtreePrimitive.prototype.beginFrame=function(e){e.passes.render&&(this._tilesInvalidated&&(invalidateAllTiles(this),this._tilesInvalidated=!1),this._tileProvider.initialize(e),clearTileLoadQueue(this),this._debug.suspendLodUpdate||this._tileReplacementQueue.markStartOfRenderFrame())},QuadtreePrimitive.prototype.render=function(e){var t=e.passes,i=this._tileProvider;t.render&&(i.beginUpdate(e),selectTilesForRendering(this,e),createRenderCommandsForSelectedTiles(this,e),i.endUpdate(e)),t.pick&&0<this._tilesToRender.length&&i.updateForPick(e)},QuadtreePrimitive.prototype.endFrame=function(e){e.passes.render&&e.mode!==SceneMode$1.MORPHING&&(processTileLoadQueue(this,e),updateHeights(this,e),updateTileLoadProgress(this,e))},QuadtreePrimitive.prototype.isDestroyed=function(){return!1},QuadtreePrimitive.prototype.destroy=function(){this._tileProvider=this._tileProvider&&this._tileProvider.destroy()};var centerScratch$6=new Cartographic;function compareDistanceToPoint(e,t){var i=Rectangle.center(e.rectangle,centerScratch$6),r=i.longitude-comparisonPoint.longitude,n=i.latitude-comparisonPoint.latitude,a=(i=Rectangle.center(t.rectangle,centerScratch$6)).longitude-comparisonPoint.longitude,o=i.latitude-comparisonPoint.latitude;return r*r+n*n-(a*a+o*o)}var cameraOriginScratch=new Cartesian3,rootTraversalDetails=[];function selectTilesForRendering(e,t){var i=e._debug;if(!i.suspendLodUpdate){var r;e._tilesToRender.length=0;var n,a=e._tileProvider;if(!defined(e._levelZeroTiles)){if(!a.ready)return;var o=a.tilingScheme;e._levelZeroTiles=QuadtreeTile.createLevelZeroTiles(o);var s=e._levelZeroTiles.length;if(rootTraversalDetails.length<s)for(rootTraversalDetails=new Array(s),r=0;r<s;++r)void 0===rootTraversalDetails[r]&&(rootTraversalDetails[r]=new TraversalDetails)}e._occluders.ellipsoid.cameraPosition=t.camera.positionWC;var l=e._levelZeroTiles,u=1<l.length?e._occluders:void 0;comparisonPoint=t.camera.positionCartographic,l.sort(compareDistanceToPoint);var c,d=e._addHeightCallbacks,h=e._removeHeightCallbacks,p=t.frameNumber;if(0<d.length||0<h.length){for(r=0,c=l.length;r<c;++r)(n=l[r])._updateCustomData(p,d,h);d.length=0,h.length=0}var f=t.camera;e._cameraPositionCartographic=f.positionCartographic;var m=Matrix4.getTranslation(f.transform,cameraOriginScratch);for(e._cameraReferenceFrameOriginCartographic=e.tileProvider.tilingScheme.ellipsoid.cartesianToCartographic(m,e._cameraReferenceFrameOriginCartographic),r=0,c=l.length;r<c;++r)n=l[r],e._tileReplacementQueue.markTileRendered(n),n.renderable?visitIfVisible(e,n,a,t,u,!1,rootTraversalDetails[r]):(queueTileLoad(e,e._tileLoadQueueHigh,n,t),++i.tilesWaitingForChildren);e._lastSelectionFrameNumber=p}}function queueTileLoad(e,t,i,r){i.needsLoading&&(void 0!==e.tileProvider.computeTileLoadPriority&&(i._loadPriority=e.tileProvider.computeTileLoadPriority(i,r)),t.push(i))}function TraversalDetails(){this.allAreRenderable=!0,this.anyWereRenderedLastFrame=!1,this.notYetRenderableCount=0}function TraversalQuadDetails(){this.southwest=new TraversalDetails,this.southeast=new TraversalDetails,this.northwest=new TraversalDetails,this.northeast=new TraversalDetails}TraversalQuadDetails.prototype.combine=function(e){var t=this.southwest,i=this.southeast,r=this.northwest,n=this.northeast;e.allAreRenderable=t.allAreRenderable&&i.allAreRenderable&&r.allAreRenderable&&n.allAreRenderable,e.anyWereRenderedLastFrame=t.anyWereRenderedLastFrame||i.anyWereRenderedLastFrame||r.anyWereRenderedLastFrame||n.anyWereRenderedLastFrame,e.notYetRenderableCount=t.notYetRenderableCount+i.notYetRenderableCount+r.notYetRenderableCount+n.notYetRenderableCount};for(var traversalQuadsByLevel=new Array(31),i$8=0;i$8<traversalQuadsByLevel.length;++i$8)traversalQuadsByLevel[i$8]=new TraversalQuadDetails;function visitTile$3(e,t,i,r,n){var a=e._debug;++a.tilesVisited,e._tileReplacementQueue.markTileRendered(i),i._updateCustomData(t.frameNumber),i.level>a.maxDepthVisited&&(a.maxDepthVisited=i.level);var o=screenSpaceError(e,t,i)<e.maximumScreenSpaceError,s=i.southwestChild,l=i.southeastChild,u=i.northwestChild,c=i.northeastChild,d=e._lastSelectionFrameNumber,h=i._lastSelectionResultFrame===d?i._lastSelectionResult:TileSelectionResult.NONE,p=e.tileProvider;if(o||r){var f=TileSelectionResult.originalResult(h)===TileSelectionResult.RENDERED,m=TileSelectionResult.originalResult(h)===TileSelectionResult.CULLED||h===TileSelectionResult.NONE,g=i.state===QuadtreeTileLoadState$1.DONE,y=f||m||g;if(y||defined(p.canRenderWithoutLosingDetail)&&(y=p.canRenderWithoutLosingDetail(i)),y)return o&&queueTileLoad(e,e._tileLoadQueueMedium,i,t),addTileToRenderList(e,i),n.allAreRenderable=i.renderable,n.anyWereRenderedLastFrame=h===TileSelectionResult.RENDERED,n.notYetRenderableCount=i.renderable?0:1,i._lastSelectionResultFrame=t.frameNumber,i._lastSelectionResult=TileSelectionResult.RENDERED,void(n.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(i));r=!0,o&&queueTileLoad(e,e._tileLoadQueueHigh,i,t)}if(p.canRefine(i)){if(s.upsampledFromParent&&l.upsampledFromParent&&u.upsampledFromParent&&c.upsampledFromParent)return addTileToRenderList(e,i),queueTileLoad(e,e._tileLoadQueueMedium,i,t),e._tileReplacementQueue.markTileRendered(s),e._tileReplacementQueue.markTileRendered(l),e._tileReplacementQueue.markTileRendered(u),e._tileReplacementQueue.markTileRendered(c),n.allAreRenderable=i.renderable,n.anyWereRenderedLastFrame=h===TileSelectionResult.RENDERED,n.notYetRenderableCount=i.renderable?0:1,i._lastSelectionResultFrame=t.frameNumber,i._lastSelectionResult=TileSelectionResult.RENDERED,void(n.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(i));i._lastSelectionResultFrame=t.frameNumber,i._lastSelectionResult=TileSelectionResult.REFINED;var v=e._tilesToRender.length,_=e._tileLoadQueueLow.length,C=e._tileLoadQueueMedium.length,x=e._tileLoadQueueHigh.length,b=e._tileToUpdateHeights.length;if(visitVisibleChildrenNearToFar(e,s,l,u,c,t,r,n),v!==e._tilesToRender.length){var A=n.allAreRenderable,S=n.anyWereRenderedLastFrame,w=n.notYetRenderableCount,E=!1;if(!A&&!S){for(var T=e._tilesToRender,P=v;P<T.length;++P)for(var M=T[P];void 0!==M&&M._lastSelectionResult!==TileSelectionResult.KICKED&&M!==i;)M._lastSelectionResult=TileSelectionResult.kick(M._lastSelectionResult),M=M.parent;e._tilesToRender.length=v,e._tileToUpdateHeights.length=b,addTileToRenderList(e,i),i._lastSelectionResult=TileSelectionResult.RENDERED;var D=h===TileSelectionResult.RENDERED;!D&&w>e.loadingDescendantLimit&&(e._tileLoadQueueLow.length=_,e._tileLoadQueueMedium.length=C,e._tileLoadQueueHigh.length=x,queueTileLoad(e,e._tileLoadQueueMedium,i,t),n.notYetRenderableCount=i.renderable?0:1,E=!0),n.allAreRenderable=i.renderable,(n.anyWereRenderedLastFrame=D)||e._tileToUpdateHeights.push(i),++a.tilesWaitingForChildren}e.preloadAncestors&&!E&&queueTileLoad(e,e._tileLoadQueueLow,i,t)}}else i._lastSelectionResultFrame=t.frameNumber,i._lastSelectionResult=TileSelectionResult.RENDERED,addTileToRenderList(e,i),queueTileLoad(e,e._tileLoadQueueHigh,i,t),n.allAreRenderable=i.renderable,n.anyWereRenderedLastFrame=h===TileSelectionResult.RENDERED,n.notYetRenderableCount=i.renderable?0:1}function visitVisibleChildrenNearToFar(e,t,i,r,n,a,o,s){var l=a.camera.positionCartographic,u=e._tileProvider,c=e._occluders,d=traversalQuadsByLevel[t.level],h=d.southwest,p=d.southeast,f=d.northwest,m=d.northeast;l.longitude<t.rectangle.east?l.latitude<t.rectangle.north?(visitIfVisible(e,t,u,a,c,o,h),visitIfVisible(e,i,u,a,c,o,p),visitIfVisible(e,r,u,a,c,o,f),visitIfVisible(e,n,u,a,c,o,m)):(visitIfVisible(e,r,u,a,c,o,f),visitIfVisible(e,t,u,a,c,o,h),visitIfVisible(e,n,u,a,c,o,m),visitIfVisible(e,i,u,a,c,o,p)):l.latitude<t.rectangle.north?(visitIfVisible(e,i,u,a,c,o,p),visitIfVisible(e,t,u,a,c,o,h),visitIfVisible(e,n,u,a,c,o,m),visitIfVisible(e,r,u,a,c,o,f)):(visitIfVisible(e,n,u,a,c,o,m),visitIfVisible(e,r,u,a,c,o,f),visitIfVisible(e,i,u,a,c,o,p),visitIfVisible(e,t,u,a,c,o,h)),d.combine(s)}function containsNeededPosition(e,t){var i=t.rectangle;return defined(e._cameraPositionCartographic)&&Rectangle.contains(i,e._cameraPositionCartographic)||defined(e._cameraReferenceFrameOriginCartographic)&&Rectangle.contains(i,e._cameraReferenceFrameOriginCartographic)}function visitIfVisible(e,t,i,r,n,a,o){if(i.computeTileVisibility(t,r,n)!==Visibility$1.NONE)return visitTile$3(e,r,t,a,o);if(++e._debug.tilesCulled,e._tileReplacementQueue.markTileRendered(t),o.allAreRenderable=!0,o.anyWereRenderedLastFrame=!1,o.notYetRenderableCount=0,containsNeededPosition(e,t)){defined(t.data)&&defined(t.data.vertexArray)||queueTileLoad(e,e._tileLoadQueueMedium,t,r);var s=e._lastSelectionFrameNumber,l=t._lastSelectionResultFrame===s?t._lastSelectionResult:TileSelectionResult.NONE;l!==TileSelectionResult.CULLED_BUT_NEEDED&&l!==TileSelectionResult.RENDERED&&e._tileToUpdateHeights.push(t),t._lastSelectionResult=TileSelectionResult.CULLED_BUT_NEEDED}else(e.preloadSiblings||0===t.level)&&queueTileLoad(e,e._tileLoadQueueLow,t,r),t._lastSelectionResult=TileSelectionResult.CULLED;t._lastSelectionResultFrame=r.frameNumber}function screenSpaceError(e,t,i){if(t.mode===SceneMode$1.SCENE2D||t.camera.frustum instanceof OrthographicFrustum||t.camera.frustum instanceof OrthographicOffCenterFrustum)return screenSpaceError2D(e,t,i);var r=e._tileProvider.getLevelMaximumGeometricError(i.level),n=i._distance,a=r*t.context.drawingBufferHeight/(n*t.camera.frustum.sseDenominator);return t.fog.enabled&&(a-=CesiumMath.fog(n,t.fog.density)*t.fog.sse),a/=t.pixelRatio}function screenSpaceError2D(e,t,i){var r=t.camera.frustum;defined(r._offCenterFrustum)&&(r=r._offCenterFrustum);var n=t.context,a=n.drawingBufferWidth,o=n.drawingBufferHeight,s=e._tileProvider.getLevelMaximumGeometricError(i.level)/(Math.max(r.top-r.bottom,r.right-r.left)/Math.max(a,o));return t.fog.enabled&&t.mode!==SceneMode$1.SCENE2D&&(s-=CesiumMath.fog(i._distance,t.fog.density)*t.fog.sse),s/=t.pixelRatio}function addTileToRenderList(e,t){e._tilesToRender.push(t)}function processTileLoadQueue(e,t){var i=e._tileLoadQueueHigh,r=e._tileLoadQueueMedium,n=e._tileLoadQueueLow;if(0!==i.length||0!==r.length||0!==n.length){e._tileReplacementQueue.trimTiles(e.tileCacheSize);var a=getTimestamp$1()+e._loadQueueTimeSlice,o=e._tileProvider,s=processSinglePriorityLoadQueue(e,t,o,a,i,!1);processSinglePriorityLoadQueue(e,t,o,a,n,s=processSinglePriorityLoadQueue(e,t,o,a,r,s))}}function sortByLoadPriority(e,t){return e._loadPriority-t._loadPriority}function processSinglePriorityLoadQueue(e,t,i,r,n,a){void 0!==i.computeTileLoadPriority&&n.sort(sortByLoadPriority);for(var o=0,s=n.length;o<s&&(getTimestamp$1()<r||!a);++o){var l=n[o];e._tileReplacementQueue.markTileRendered(l),i.loadTile(t,l),a=!0}return a}var scratchRay=new Ray,scratchCartographic$f=new Cartographic,scratchPosition$b=new Cartesian3,scratchArray=[];function updateHeights(e,t){if(e.tileProvider.ready){var i=scratchArray;i.length=0;for(var r,n=e._tileToUpdateHeights,a=e._tileProvider.terrainProvider,o=getTimestamp$1()+e._updateHeightsTimeSlice,s=t.mode,l=t.mapProjection,u=e.tileProvider.tilingScheme.ellipsoid;0<n.length;){var c=n[0];if(defined(c.data)&&defined(c.data.mesh)){var d=c.customData,h=d.length,p=!1;for(r=e._lastTileIndex;r<h;++r){var f=d[r];if(c.level>f.level){if(defined(f.positionOnEllipsoidSurface)||(f.positionOnEllipsoidSurface=Cartesian3.fromRadians(f.positionCartographic.longitude,f.positionCartographic.latitude,0,u)),s===SceneMode$1.SCENE3D){var m=u.geodeticSurfaceNormal(f.positionOnEllipsoidSurface,scratchRay.direction);if(!defined(u.getSurfaceNormalIntersectionWithZAxis(f.positionOnEllipsoidSurface,11500,scratchRay.origin))){var g;defined(c.data.tileBoundingRegion)&&(g=c.data.tileBoundingRegion.minimumHeight);var y=Math.min(defaultValue(g,0),-11500),v=Cartesian3.multiplyByScalar(m,Math.abs(y)+1,scratchPosition$b);Cartesian3.subtract(f.positionOnEllipsoidSurface,v,scratchRay.origin)}}else Cartographic.clone(f.positionCartographic,scratchCartographic$f),scratchCartographic$f.height=-11500,l.project(scratchCartographic$f,scratchPosition$b),Cartesian3.fromElements(scratchPosition$b.z,scratchPosition$b.x,scratchPosition$b.y,scratchPosition$b),Cartesian3.clone(scratchPosition$b,scratchRay.origin),Cartesian3.clone(Cartesian3.UNIT_X,scratchRay.direction);var _=c.data.pick(scratchRay,s,l,!1,scratchPosition$b);defined(_)&&(f.callback(_),f.level=c.level)}else if(c.level===f.level){for(var C,x=c.children,b=x.length,A=0;A<b&&(C=x[A],!Rectangle.contains(C.rectangle,f.positionCartographic));++A);var S=a.getTileDataAvailable(C.x,C.y,C.level),w=c.parent;(defined(S)&&!S||defined(w)&&defined(w.data)&&defined(w.data.terrainData)&&!w.data.terrainData.isChildAvailable(w.x,w.y,C.x,C.y))&&f.removeFunc()}if(getTimestamp$1()>=o){p=!0;break}}if(p){e._lastTileIndex=r;break}e._lastTileIndex=0,n.shift()}else{var E=c._lastSelectionResultFrame===e._lastSelectionFrameNumber?c._lastSelectionResult:TileSelectionResult.NONE;E!==TileSelectionResult.RENDERED&&E!==TileSelectionResult.CULLED_BUT_NEEDED||i.push(c),n.shift(),e._lastTileIndex=0}}for(r=0;r<i.length;r++)n.push(i[r])}}function createRenderCommandsForSelectedTiles(e,t){for(var i=e._tileProvider,r=e._tilesToRender,n=0,a=r.length;n<a;++n){var o=r[n];i.showTileThisFrame(o,t)}}function Globe(e){var t=new EllipsoidTerrainProvider({ellipsoid:e=defaultValue(e,Ellipsoid.WGS84)}),i=new ImageryLayerCollection;this._ellipsoid=e,this._imageryLayerCollection=i,this._surfaceShaderSet=new GlobeSurfaceShaderSet,this._material=void 0,this._surface=new QuadtreePrimitive({tileProvider:new GlobeSurfaceTileProvider({terrainProvider:t,imageryLayers:i,surfaceShaderSet:this._surfaceShaderSet})}),this._terrainProvider=t,this._terrainProviderChanged=new Event,makeShadersDirty(this),this.show=!0,this._oceanNormalMapResourceDirty=!0,this._oceanNormalMapResource=new Resource({url:buildModuleUrl("Assets/Textures/waterNormalsSmall.jpg")}),this.maximumScreenSpaceError=2,this.tileCacheSize=100,this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this.fillHighlightColor=void 0,this.enableLighting=!1,this.dynamicAtmosphereLighting=!0,this.dynamicAtmosphereLightingFromSun=!1,this.showGroundAtmosphere=!0,this.lightingFadeOutDistance=1e7,this.lightingFadeInDistance=2e7,this.nightFadeOutDistance=1e7,this.nightFadeInDistance=5e7,this.showWaterEffect=!0,this.depthTestAgainstTerrain=!0,this.shadows=ShadowMode$1.RECEIVE_ONLY,this.atmosphereHueShift=0,this.atmosphereSaturationShift=0,this.atmosphereBrightnessShift=0,this.showSkirts=!0,this.backFaceCulling=!0,this._oceanNormalMap=void 0,this._zoomedOutOceanSpecularIntensity=void 0}function makeShadersDirty(e){var t=[],i=defined(e._material)&&(e._material.shaderSource.match(/slope/)||e._material.shaderSource.match("normalEC")),r=[GroundAtmosphere];!defined(e._material)||i&&!e._terrainProvider.requestVertexNormals?e._surface._tileProvider.uniformMap=void 0:(r.push(e._material.shaderSource),t.push("APPLY_MATERIAL"),e._surface._tileProvider.uniformMap=e._material._uniforms),r.push(GlobeFS),e._surfaceShaderSet.baseVertexShaderSource=new ShaderSource({sources:[GroundAtmosphere,GlobeVS],defines:t}),e._surfaceShaderSet.baseFragmentShaderSource=new ShaderSource({sources:r,defines:t}),e._surfaceShaderSet.material=e._material}function createComparePickTileFunction(i){return function(e,t){return BoundingSphere.distanceSquaredTo(e.pickBoundingSphere,i)-BoundingSphere.distanceSquaredTo(t.pickBoundingSphere,i)}}Object.defineProperties(Globe.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},imageryLayers:{get:function(){return this._imageryLayerCollection}},imageryLayersUpdatedEvent:{get:function(){return this._surface.tileProvider.imageryLayersUpdatedEvent}},tilesLoaded:{get:function(){return!defined(this._surface)||this._surface.tileProvider.ready&&0===this._surface._tileLoadQueueHigh.length&&0===this._surface._tileLoadQueueMedium.length&&0===this._surface._tileLoadQueueLow.length}},baseColor:{get:function(){return this._surface.tileProvider.baseColor},set:function(e){this._surface.tileProvider.baseColor=e}},clippingPlanes:{get:function(){return this._surface.tileProvider.clippingPlanes},set:function(e){this._surface.tileProvider.clippingPlanes=e}},cartographicLimitRectangle:{get:function(){return this._surface.tileProvider.cartographicLimitRectangle},set:function(e){defined(e)||(e=Rectangle.clone(Rectangle.MAX_VALUE)),this._surface.tileProvider.cartographicLimitRectangle=e}},oceanNormalMapUrl:{get:function(){return this._oceanNormalMapResource.url},set:function(e){this._oceanNormalMapResource.url=e,this._oceanNormalMapResourceDirty=!0}},terrainProvider:{get:function(){return this._terrainProvider},set:function(e){e!==this._terrainProvider&&(this._terrainProvider=e,this._terrainProviderChanged.raiseEvent(e),defined(this._material)&&makeShadersDirty(this))}},terrainProviderChanged:{get:function(){return this._terrainProviderChanged}},tileLoadProgressEvent:{get:function(){return this._surface.tileLoadProgressEvent}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,makeShadersDirty(this))}}});var scratchArray$1=[],scratchSphereIntersectionResult={start:0,stop:0};Globe.prototype.pickWorldCoordinates=function(e,t,i){var r=t.mode,n=t.mapProjection,a=scratchArray$1;a.length=0;var o,s,l,u=this._surface._tilesToRender,c=u.length;for(s=0;s<c;++s){var d=(o=u[s]).data;if(defined(d)){var h=d.pickBoundingSphere;if(r!==SceneMode$1.SCENE3D)d.pickBoundingSphere=h=BoundingSphere.fromRectangleWithHeights2D(o.rectangle,n,d.tileBoundingRegion.minimumHeight,d.tileBoundingRegion.maximumHeight,h),Cartesian3.fromElements(h.center.z,h.center.x,h.center.y,h.center);else{if(!defined(d.renderedMesh))continue;BoundingSphere.clone(d.renderedMesh.boundingSphere3D,h)}defined(IntersectionTests.raySphere(e,h,scratchSphereIntersectionResult))&&a.push(d)}}for(a.sort(createComparePickTileFunction(e.origin)),c=a.length,s=0;s<c&&!defined(l=a[s].pick(e,t.mode,t.mapProjection,!0,i));++s);return l};var cartoScratch$2=new Cartographic;Globe.prototype.pick=function(e,t,i){if(defined(i=this.pickWorldCoordinates(e,t,i))&&t.mode!==SceneMode$1.SCENE3D){i=Cartesian3.fromElements(i.y,i.z,i.x,i);var r=t.mapProjection.unproject(i,cartoScratch$2);i=t.globe.ellipsoid.cartographicToCartesian(r,i)}return i};var scratchGetHeightCartesian=new Cartesian3,scratchGetHeightIntersection=new Cartesian3,scratchGetHeightCartographic=new Cartographic,scratchGetHeightRay=new Ray;function tileIfContainsCartographic(e,t){return defined(e)&&Rectangle.contains(e.rectangle,t)?e:void 0}Globe.prototype.getHeight=function(e){var t=this._surface._levelZeroTiles;if(defined(t)){var i,r,n=t.length;for(r=0;r<n&&(i=t[r],!Rectangle.contains(i.rectangle,e));++r);if(!(n<=r)){for(var a=i;defined(i);)defined(i=tileIfContainsCartographic(i._southwestChild,e)||tileIfContainsCartographic(i._southeastChild,e)||tileIfContainsCartographic(i._northwestChild,e)||i._northeastChild)&&defined(i.data)&&defined(i.data.renderedMesh)&&(a=i);if(defined(i=a)){var o=this._surface._tileProvider.tilingScheme.ellipsoid,s=Cartesian3.fromRadians(e.longitude,e.latitude,0,o,scratchGetHeightCartesian),l=scratchGetHeightRay,u=o.geodeticSurfaceNormal(s,l.direction);if(!defined(o.getSurfaceNormalIntersectionWithZAxis(s,11500,l.origin))){var c;defined(i.data.tileBoundingRegion)&&(c=i.data.tileBoundingRegion.minimumHeight);var d=Math.min(defaultValue(c,0),-11500),h=Cartesian3.multiplyByScalar(u,Math.abs(d)+1,scratchGetHeightIntersection);Cartesian3.subtract(s,h,l.origin)}var p=i.data.pick(l,void 0,void 0,!1,scratchGetHeightIntersection);if(defined(p))return o.cartesianToCartographic(p,scratchGetHeightCartographic).height}}}},Globe.prototype.update=function(e){this.show&&e.passes.render&&this._surface.update(e)},Globe.prototype.beginFrame=function(t){var e=this._surface,i=e.tileProvider,r=this.terrainProvider,n=this.showWaterEffect&&r.ready&&r.hasWaterMask;if(n&&this._oceanNormalMapResourceDirty){this._oceanNormalMapResourceDirty=!1;var a=this._oceanNormalMapResource,o=a.url;if(defined(o)){var s=this;when(a.fetchImage(),function(e){o===s._oceanNormalMapResource.url&&(s._oceanNormalMap=s._oceanNormalMap&&s._oceanNormalMap.destroy(),s._oceanNormalMap=new Texture({context:t.context,source:e}))})}else this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy()}var l=t.passes,u=t.mode;l.render&&(this.showGroundAtmosphere?this._zoomedOutOceanSpecularIntensity=.4:this._zoomedOutOceanSpecularIntensity=.5,e.maximumScreenSpaceError=this.maximumScreenSpaceError,e.tileCacheSize=this.tileCacheSize,e.loadingDescendantLimit=this.loadingDescendantLimit,e.preloadAncestors=this.preloadAncestors,e.preloadSiblings=this.preloadSiblings,i.terrainProvider=this.terrainProvider,i.lightingFadeOutDistance=this.lightingFadeOutDistance,i.lightingFadeInDistance=this.lightingFadeInDistance,i.nightFadeOutDistance=this.nightFadeOutDistance,i.nightFadeInDistance=this.nightFadeInDistance,i.zoomedOutOceanSpecularIntensity=u===SceneMode$1.SCENE3D?this._zoomedOutOceanSpecularIntensity:0,i.hasWaterMask=n,i.oceanNormalMap=this._oceanNormalMap,i.enableLighting=this.enableLighting,i.dynamicAtmosphereLighting=this.dynamicAtmosphereLighting,i.dynamicAtmosphereLightingFromSun=this.dynamicAtmosphereLightingFromSun,i.showGroundAtmosphere=this.showGroundAtmosphere,i.shadows=this.shadows,i.hueShift=this.atmosphereHueShift,i.saturationShift=this.atmosphereSaturationShift,i.brightnessShift=this.atmosphereBrightnessShift,i.fillHighlightColor=this.fillHighlightColor,i.showSkirts=this.showSkirts,i.backFaceCulling=this.backFaceCulling,e.beginFrame(t))},Globe.prototype.render=function(e){this.show&&(defined(this._material)&&this._material.update(e.context),this._surface.render(e))},Globe.prototype.endFrame=function(e){this.show&&e.passes.render&&this._surface.endFrame(e)},Globe.prototype.isDestroyed=function(){return!1},Globe.prototype.destroy=function(){return this._surfaceShaderSet=this._surfaceShaderSet&&this._surfaceShaderSet.destroy(),this._surface=this._surface&&this._surface.destroy(),this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy(),destroyObject(this)};var PassThrough="uniform sampler2D colorTexture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\ngl_FragColor = texture2D(colorTexture, v_textureCoordinates);\n}\n",PassThroughDepth="uniform sampler2D u_depthTexture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\ngl_FragColor = czm_packDepth(texture2D(u_depthTexture, v_textureCoordinates).r);\n}\n";function GlobeDepth(){this._globeColorTexture=void 0,this._primitiveColorTexture=void 0,this._depthStencilTexture=void 0,this._globeDepthTexture=void 0,this._tempGlobeDepthTexture=void 0,this._tempCopyDepthTexture=void 0,this._globeColorFramebuffer=void 0,this._primitiveColorFramebuffer=void 0,this._copyDepthFramebuffer=void 0,this._tempCopyDepthFramebuffer=void 0,this._updateDepthFramebuffer=void 0,this._clearGlobeColorCommand=void 0,this._clearPrimitiveColorCommand=void 0,this._copyColorCommand=void 0,this._copyDepthCommand=void 0,this._tempCopyDepthCommand=void 0,this._updateDepthCommand=void 0,this._mergeColorCommand=void 0,this._viewport=new BoundingRectangle,this._rs=void 0,this._rsBlend=void 0,this._rsUpdate=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useLogDepth=void 0,this._useHdr=void 0,this._clearGlobeDepth=void 0,this._debugGlobeDepthViewportCommand=void 0}function executeDebugGlobeDepth(e,t,i,r){if(!defined(e._debugGlobeDepthViewportCommand)||r!==e._useLogDepth){var n=new ShaderSource({defines:[r?"LOG_DEPTH":""],sources:["uniform sampler2D u_depthTexture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\n float z_window = czm_unpackDepth(texture2D(u_depthTexture, v_textureCoordinates));\n z_window = czm_reverseLogDepth(z_window); \n float n_range = czm_depthRange.near;\n float f_range = czm_depthRange.far;\n float z_ndc = (2.0 * z_window - n_range - f_range) / (f_range - n_range);\n float scale = pow(z_ndc * 0.5 + 0.5, 8.0);\n gl_FragColor = vec4(mix(vec3(0.0), vec3(1.0), scale), 1.0);\n}\n"]});e._debugGlobeDepthViewportCommand=t.createViewportQuadCommand(n,{uniformMap:{u_depthTexture:function(){return e._globeDepthTexture}},owner:e}),e._useLogDepth=r}e._debugGlobeDepthViewportCommand.execute(t,i)}function destroyTextures$2(e){e._globeColorTexture=e._globeColorTexture&&!e._globeColorTexture.isDestroyed()&&e._globeColorTexture.destroy(),e._depthStencilTexture=e._depthStencilTexture&&!e._depthStencilTexture.isDestroyed()&&e._depthStencilTexture.destroy(),e._globeDepthTexture=e._globeDepthTexture&&!e._globeDepthTexture.isDestroyed()&&e._globeDepthTexture.destroy()}function destroyFramebuffers$1(e){e._globeColorFramebuffer=e._globeColorFramebuffer&&!e._globeColorFramebuffer.isDestroyed()&&e._globeColorFramebuffer.destroy(),e._copyDepthFramebuffer=e._copyDepthFramebuffer&&!e._copyDepthFramebuffer.isDestroyed()&&e._copyDepthFramebuffer.destroy()}function destroyUpdateDepthResources(e){e._tempCopyDepthFramebuffer=e._tempCopyDepthFramebuffer&&!e._tempCopyDepthFramebuffer.isDestroyed()&&e._tempCopyDepthFramebuffer.destroy(),e._updateDepthFramebuffer=e._updateDepthFramebuffer&&!e._updateDepthFramebuffer.isDestroyed()&&e._updateDepthFramebuffer.destroy(),e._tempGlobeDepthTexture=e._tempGlobeDepthTexture&&!e._tempGlobeDepthTexture.isDestroyed()&&e._tempGlobeDepthTexture.destroy()}function createUpdateDepthResources(e,t,i,r,n){e._tempGlobeDepthTexture=new Texture({context:t,width:i,height:r,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:PixelDatatype$1.UNSIGNED_BYTE,sampler:Sampler.NEAREST}),e._tempCopyDepthFramebuffer=new Framebuffer({context:t,colorTextures:[e._tempGlobeDepthTexture],destroyAttachments:!1}),e._updateDepthFramebuffer=new Framebuffer({context:t,colorTextures:[e._globeDepthTexture],depthStencilTexture:n.framebuffer.depthStencilTexture,destroyAttachments:!1})}function createTextures$3(e,t,i,r,n){var a=n?t.halfFloatingPointTexture?PixelDatatype$1.HALF_FLOAT:PixelDatatype$1.FLOAT:PixelDatatype$1.UNSIGNED_BYTE;e._globeColorTexture=new Texture({context:t,width:i,height:r,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:a,sampler:Sampler.NEAREST}),e._depthStencilTexture=new Texture({context:t,width:i,height:r,pixelFormat:PixelFormat$1.DEPTH_STENCIL,pixelDatatype:PixelDatatype$1.UNSIGNED_INT_24_8}),e._globeDepthTexture=new Texture({context:t,width:i,height:r,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:PixelDatatype$1.UNSIGNED_BYTE,sampler:Sampler.NEAREST})}function createFramebuffers$1(e,t){e._globeColorFramebuffer=new Framebuffer({context:t,colorTextures:[e._globeColorTexture],depthStencilTexture:e._depthStencilTexture,destroyAttachments:!1}),e._copyDepthFramebuffer=new Framebuffer({context:t,colorTextures:[e._globeDepthTexture],destroyAttachments:!1})}function createPrimitiveFramebuffer(e,t,i,r,n){var a=n?t.halfFloatingPointTexture?PixelDatatype$1.HALF_FLOAT:PixelDatatype$1.FLOAT:PixelDatatype$1.UNSIGNED_BYTE;e._primitiveColorTexture=new Texture({context:t,width:i,height:r,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:a,sampler:Sampler.NEAREST}),e._primitiveColorFramebuffer=new Framebuffer({context:t,colorTextures:[e._primitiveColorTexture],depthStencilTexture:e._depthStencilTexture,destroyAttachments:!1})}function destroyPrimitiveFramebuffer(e){e._primitiveColorTexture=e._primitiveColorTexture&&!e._primitiveColorTexture.isDestroyed()&&e._primitiveColorTexture.destroy(),e._primitiveColorFramebuffer=e._primitiveColorFramebuffer&&!e._primitiveColorFramebuffer.isDestroyed()&&e._primitiveColorFramebuffer.destroy()}function updateFramebuffers(e,t,i,r,n,a){var o=e._globeColorTexture,s=!defined(o)||o.width!==i||o.height!==r||n!==e._useHdr;s&&(destroyTextures$2(e),destroyFramebuffers$1(e),createTextures$3(e,t,i,r,n),createFramebuffers$1(e,t)),!s&&a===e._clearGlobeDepth||(destroyPrimitiveFramebuffer(e),a&&createPrimitiveFramebuffer(e,t,i,r,n))}function updateCopyCommands(e,t,i,r,n){e._viewport.width=i,e._viewport.height=r;var a=!BoundingRectangle.equals(e._viewport,n.viewport),o=a!==e._useScissorTest;e._useScissorTest=a,BoundingRectangle.equals(e._scissorRectangle,n.viewport)||(e._scissorRectangle=BoundingRectangle.clone(n.viewport,e._scissorRectangle),o=!0),defined(e._rs)&&BoundingRectangle.equals(e._viewport,e._rs.viewport)&&!o||(e._rs=RenderState.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}}),e._rsBlend=RenderState.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:BlendingState$1.ALPHA_BLEND}),e._rsUpdate=RenderState.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:StencilFunction$1.EQUAL,frontOperation:{fail:StencilOperation$1.KEEP,zFail:StencilOperation$1.KEEP,zPass:StencilOperation$1.KEEP},backFunction:StencilFunction$1.NEVER,reference:StencilConstants$1.CESIUM_3D_TILE_MASK,mask:StencilConstants$1.CESIUM_3D_TILE_MASK}})),defined(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(PassThroughDepth,{uniformMap:{u_depthTexture:function(){return e._depthStencilTexture}},owner:e})),e._copyDepthCommand.framebuffer=e._copyDepthFramebuffer,e._copyDepthCommand.renderState=e._rs,defined(e._copyColorCommand)||(e._copyColorCommand=t.createViewportQuadCommand(PassThrough,{uniformMap:{colorTexture:function(){return e._globeColorTexture}},owner:e})),e._copyColorCommand.renderState=e._rs,defined(e._tempCopyDepthCommand)||(e._tempCopyDepthCommand=t.createViewportQuadCommand(PassThroughDepth,{uniformMap:{u_depthTexture:function(){return e._tempCopyDepthTexture}},owner:e})),e._tempCopyDepthCommand.framebuffer=e._tempCopyDepthFramebuffer,e._tempCopyDepthCommand.renderState=e._rs,defined(e._updateDepthCommand)||(e._updateDepthCommand=t.createViewportQuadCommand(PassThrough,{uniformMap:{colorTexture:function(){return e._tempGlobeDepthTexture}},owner:e})),e._updateDepthCommand.framebuffer=e._updateDepthFramebuffer,e._updateDepthCommand.renderState=e._rsUpdate,defined(e._clearGlobeColorCommand)||(e._clearGlobeColorCommand=new ClearCommand({color:new Color(0,0,0,0),stencil:0,owner:e})),e._clearGlobeColorCommand.framebuffer=e._globeColorFramebuffer,defined(e._clearPrimitiveColorCommand)||(e._clearPrimitiveColorCommand=new ClearCommand({color:new Color(0,0,0,0),stencil:0,owner:e})),e._clearPrimitiveColorCommand.framebuffer=e._primitiveColorFramebuffer,defined(e._mergeColorCommand)||(e._mergeColorCommand=t.createViewportQuadCommand(PassThrough,{uniformMap:{colorTexture:function(){return e._primitiveColorTexture}},owner:e})),e._mergeColorCommand.framebuffer=e._globeColorFramebuffer,e._mergeColorCommand.renderState=e._rsBlend}function GoogleEarthEnterpriseDiscardPolicy(){this._image=new Image}function GoogleEarthEnterpriseImageryProvider(e){var i;if(defined((e=defaultValue(e,defaultValue.EMPTY_OBJECT)).metadata))i=e.metadata;else{var t=Resource.createIfNeeded(e.url);i=new GoogleEarthEnterpriseMetadata(t)}this._metadata=i,this._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=new GeographicTilingScheme({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new Rectangle(-CesiumMath.PI,-CesiumMath.PI,CesiumMath.PI,CesiumMath.PI),ellipsoid:e.ellipsoid});var r=e.credit;"string"==typeof r&&(r=new Credit(r)),this._credit=r,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=23,defined(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new GoogleEarthEnterpriseDiscardPolicy),this._errorEvent=new Event,this._ready=!1;var n,a=this;this._readyPromise=i.readyPromise.then(function(e){if(i.imageryPresent)return TileProviderError.handleSuccess(n),a._ready=e;var t=new RuntimeError("The server "+i.url+" doesn't have imagery");return n=TileProviderError.handleError(n,a,a._errorEvent,t.message,void 0,void 0,void 0,t),when.reject(t)}).otherwise(function(e){return n=TileProviderError.handleError(n,a,a._errorEvent,e.message,void 0,void 0,void 0,e),when.reject(e)})}function buildImageResource$3(e,t,i,r,n,a){var o=GoogleEarthEnterpriseMetadata.tileXYToQuadKey(i,r,n),s=t.imageryVersion;return s=defined(s)&&0<s?s:1,e._metadata.resource.getDerivedResource({url:"flatfile?f1-0"+o+"-i."+s.toString(),request:a})}function getImageType(e){var t="JFIF";if(e[6]===t.charCodeAt(0)&&e[7]===t.charCodeAt(1)&&e[8]===t.charCodeAt(2)&&e[9]===t.charCodeAt(3))return"image/jpeg";return e[1]==="PNG".charCodeAt(0)&&e[2]==="PNG".charCodeAt(1)&&e[3]==="PNG".charCodeAt(2)?"image/png":void 0}function decodeEarthImageryPacket(e){for(var t=protobuf.Reader.create(e),i=t.len,r={};t.pos<i;){var n=t.uint32();switch(n>>>3){case 1:r.imageType=t.uint32();break;case 2:r.imageData=t.bytes();break;case 3:r.alphaType=t.uint32();break;case 4:r.imageAlpha=t.bytes();break;case 5:var a=r.copyrightIds;if(defined(a)||(a=r.copyrightIds=[]),2==(7&n))for(var o=t.uint32()+t.pos;t.pos<o;)a.push(t.uint32());else a.push(t.uint32());break;default:t.skipType(7&n)}}var s=r.imageType;if(defined(s))switch(s){case 0:r.imageType="image/jpeg";break;case 4:r.imageType="image/png";break;default:throw new RuntimeError("GoogleEarthEnterpriseImageryProvider: Unsupported image type.")}var l=r.alphaType;return defined(l)&&0!==l&&(console.log("GoogleEarthEnterpriseImageryProvider: External alpha not supported."),delete r.alphaType,delete r.imageAlpha),r}Object.defineProperties(GlobeDepth.prototype,{framebuffer:{get:function(){return this._globeColorFramebuffer}},primitiveFramebuffer:{get:function(){return this._primitiveColorFramebuffer}}}),GlobeDepth.prototype.executeDebugGlobeDepth=function(e,t,i){executeDebugGlobeDepth(this,e,t,i)},GlobeDepth.prototype.update=function(e,t,i,r,n){var a=i.width,o=i.height;updateFramebuffers(this,e,a,o,r,n),updateCopyCommands(this,e,a,o,t),e.uniformState.globeDepthTexture=void 0,this._useHdr=r,this._clearGlobeDepth=n},GlobeDepth.prototype.executeCopyDepth=function(e,t){defined(this._copyDepthCommand)&&(this._copyDepthCommand.execute(e,t),e.uniformState.globeDepthTexture=this._globeDepthTexture)},GlobeDepth.prototype.executeUpdateDepth=function(e,t,i){var r=t.framebuffer.depthStencilTexture;if(i||r!==this._depthStencilTexture){if(defined(this._updateDepthCommand)){if(!defined(this._updateDepthFramebuffer)||this._updateDepthFramebuffer.depthStencilTexture!==r||this._updateDepthFramebuffer.getColorTexture(0)!==this._globeDepthTexture){var n=this._globeDepthTexture.width,a=this._globeDepthTexture.height;destroyUpdateDepthResources(this),createUpdateDepthResources(this,e,n,a,t),updateCopyCommands(this,e,n,a,t)}this._tempCopyDepthTexture=r,this._tempCopyDepthCommand.execute(e,t),this._updateDepthCommand.execute(e,t)}}else defined(this._copyDepthCommand)&&this._copyDepthCommand.execute(e,t)},GlobeDepth.prototype.executeCopyColor=function(e,t){defined(this._copyColorCommand)&&this._copyColorCommand.execute(e,t)},GlobeDepth.prototype.executeMergeColor=function(e,t){defined(this._mergeColorCommand)&&this._mergeColorCommand.execute(e,t)},GlobeDepth.prototype.clear=function(e,t,i){var r=this._clearGlobeColorCommand;defined(r)&&(Color.clone(i,r.color),r.execute(e,t)),defined(r=this._clearPrimitiveColorCommand)&&defined(this._primitiveColorFramebuffer)&&r.execute(e,t)},GlobeDepth.prototype.isDestroyed=function(){return!1},GlobeDepth.prototype.destroy=function(){return destroyTextures$2(this),destroyFramebuffers$1(this),destroyPrimitiveFramebuffer(this),destroyUpdateDepthResources(this),defined(this._copyColorCommand)&&(this._copyColorCommand.shaderProgram=this._copyColorCommand.shaderProgram.destroy()),defined(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=this._copyDepthCommand.shaderProgram.destroy()),defined(this._tempCopyDepthCommand)&&(this._tempCopyDepthCommand.shaderProgram=this._tempCopyDepthCommand.shaderProgram.destroy()),defined(this._updateDepthCommand)&&(this._updateDepthCommand.shaderProgram=this._updateDepthCommand.shaderProgram.destroy()),defined(this._mergeColorCommand)&&(this._mergeColorCommand.shaderProgram=this._mergeColorCommand.shaderProgram.destroy()),defined(this._debugGlobeDepthViewportCommand)&&(this._debugGlobeDepthViewportCommand.shaderProgram=this._debugGlobeDepthViewportCommand.shaderProgram.destroy()),destroyObject(this)},GoogleEarthEnterpriseDiscardPolicy.prototype.isReady=function(){return!0},GoogleEarthEnterpriseDiscardPolicy.prototype.shouldDiscardImage=function(e){return e===this._image},Object.defineProperties(GoogleEarthEnterpriseImageryProvider.prototype,{url:{get:function(){return this._metadata.url}},proxy:{get:function(){return this._metadata.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!1}}}),GoogleEarthEnterpriseImageryProvider.prototype.getTileCredits=function(e,t,i){var r=this._metadata,n=r.getTileInformation(e,t,i);if(defined(n)){var a=r.providers[n.imageryProvider];if(defined(a))return[a]}},GoogleEarthEnterpriseImageryProvider.prototype.requestImage=function(e,t,i,r){var a=this._tileDiscardPolicy._image,o=this._metadata,n=GoogleEarthEnterpriseMetadata.tileXYToQuadKey(e,t,i),s=o.getTileInformation(e,t,i);if(!defined(s)){if(o.isValid(n)){var l=new Request({throttle:r.throttle,throttleByServer:r.throttleByServer,type:r.type,priorityFunction:r.priorityFunction});return void o.populateSubtree(e,t,i,l)}return a}if(!s.hasImagery())return a;var u=buildImageResource$3(this,s,e,t,i,r).fetchArrayBuffer();return defined(u)?u.then(function(e){decodeGoogleEarthEnterpriseData(o.key,e);var t,i=new Uint8Array(e),r=o.protoImagery;if(defined(r)&&r||(t=getImageType(i)),!defined(t)&&(!defined(r)||r)){var n=decodeEarthImageryPacket(i);t=n.imageType,i=n.imageData}return defined(t)&&defined(i)?loadImageFromTypedArray({uint8Array:i,format:t,flipY:!0}):a}):void 0},GoogleEarthEnterpriseImageryProvider.prototype.pickFeatures=function(e,t,i,r,n){};var defaultColor$9=new Color(1,1,1,.4),defaultGlowColor=new Color(0,1,0,.05),defaultBackgroundColor$1=new Color(0,.5,0,.2);function GridImageryProvider(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this._tilingScheme=defined(e.tilingScheme)?e.tilingScheme:new GeographicTilingScheme({ellipsoid:e.ellipsoid}),this._cells=defaultValue(e.cells,8),this._color=defaultValue(e.color,defaultColor$9),this._glowColor=defaultValue(e.glowColor,defaultGlowColor),this._glowWidth=defaultValue(e.glowWidth,6),this._backgroundColor=defaultValue(e.backgroundColor,defaultBackgroundColor$1),this._errorEvent=new Event,this._tileWidth=defaultValue(e.tileWidth,256),this._tileHeight=defaultValue(e.tileHeight,256),this._canvasSize=defaultValue(e.canvasSize,256),this._canvas=this._createGridCanvas(),this._readyPromise=when.resolve(!0)}function InvertClassification(){this.previousFramebuffer=void 0,this._previousFramebuffer=void 0,this._texture=void 0,this._classifiedTexture=void 0,this._depthStencilTexture=void 0,this._fbo=void 0,this._fboClassified=void 0,this._rsUnclassified=void 0,this._rsClassified=void 0,this._unclassifiedCommand=void 0,this._classifiedCommand=void 0,this._translucentCommand=void 0,this._clearColorCommand=new ClearCommand({color:new Color(0,0,0,0),owner:this}),this._clearCommand=new ClearCommand({color:new Color(0,0,0,0),depth:1,stencil:0});var e=this;this._uniformMap={colorTexture:function(){return e._texture},depthTexture:function(){return e._depthStencilTexture},classifiedTexture:function(){return e._classifiedTexture}}}Object.defineProperties(GridImageryProvider.prototype,{proxy:{get:function(){}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){}},minimumLevel:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return!0}},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}}}),GridImageryProvider.prototype._drawGrid=function(e){for(var t=this._canvasSize,i=0;i<=this._cells;++i){var r=1+i/this._cells*(t-1);e.moveTo(r,0),e.lineTo(r,t),e.moveTo(0,r),e.lineTo(t,r)}e.stroke()},GridImageryProvider.prototype._createGridCanvas=function(){var e=document.createElement("canvas");e.width=this._canvasSize,e.height=this._canvasSize;var t=this._canvasSize,i=e.getContext("2d"),r=this._backgroundColor.toCssColorString();i.fillStyle=r,i.fillRect(0,0,t,t);var n=this._glowColor.toCssColorString();i.strokeStyle=n,i.lineWidth=this._glowWidth,i.strokeRect(0,0,t,t),this._drawGrid(i),i.lineWidth=.5*this._glowWidth,i.strokeRect(0,0,t,t),this._drawGrid(i);var a=this._color.toCssColorString();return i.strokeStyle=a,i.lineWidth=2,i.strokeRect(0,0,t,t),i.lineWidth=1,this._drawGrid(i),e},GridImageryProvider.prototype.getTileCredits=function(e,t,i){},GridImageryProvider.prototype.requestImage=function(e,t,i,r){return this._canvas},GridImageryProvider.prototype.pickFeatures=function(e,t,i,r,n){},Object.defineProperties(InvertClassification.prototype,{unclassifiedCommand:{get:function(){return this._unclassifiedCommand}}}),InvertClassification.isTranslucencySupported=function(e){return e.depthTexture&&e.fragmentDepth};var rsUnclassified={depthMask:!1,stencilTest:{enabled:!0,frontFunction:StencilFunction$1.EQUAL,frontOperation:{fail:StencilOperation$1.KEEP,zFail:StencilOperation$1.KEEP,zPass:StencilOperation$1.KEEP},backFunction:StencilFunction$1.NEVER,reference:0,mask:StencilConstants$1.CLASSIFICATION_MASK},blending:BlendingState$1.ALPHA_BLEND},rsClassified={depthMask:!1,stencilTest:{enabled:!0,frontFunction:StencilFunction$1.NOT_EQUAL,frontOperation:{fail:StencilOperation$1.KEEP,zFail:StencilOperation$1.KEEP,zPass:StencilOperation$1.KEEP},backFunction:StencilFunction$1.NEVER,reference:0,mask:StencilConstants$1.CLASSIFICATION_MASK},blending:BlendingState$1.ALPHA_BLEND},rsDefault={depthMask:!0,depthTest:{enabled:!0},stencilTest:StencilConstants$1.setCesium3DTileBit(),stencilMask:StencilConstants$1.CESIUM_3D_TILE_MASK,blending:BlendingState$1.ALPHA_BLEND},translucentFS="#extension GL_EXT_frag_depth : enable\nuniform sampler2D colorTexture;\nuniform sampler2D depthTexture;\nuniform sampler2D classifiedTexture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\n vec4 color = texture2D(colorTexture, v_textureCoordinates);\n if (color.a == 0.0)\n {\n discard;\n }\n bool isClassified = all(equal(texture2D(classifiedTexture, v_textureCoordinates), vec4(0.0)));\n#ifdef UNCLASSIFIED\n vec4 highlightColor = czm_invertClassificationColor;\n if (isClassified)\n {\n discard;\n }\n#else\n vec4 highlightColor = vec4(1.0);\n if (!isClassified)\n {\n discard;\n }\n#endif\n gl_FragColor = color * highlightColor;\n gl_FragDepthEXT = texture2D(depthTexture, v_textureCoordinates).r;\n}\n",opaqueFS="uniform sampler2D colorTexture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\n vec4 color = texture2D(colorTexture, v_textureCoordinates);\n if (color.a == 0.0)\n {\n discard;\n }\n#ifdef UNCLASSIFIED\n gl_FragColor = color * czm_invertClassificationColor;\n#else\n gl_FragColor = color;\n#endif\n}\n";function JobTypeBudget(e){this._total=e,this.usedThisFrame=0,this.stolenFromMeThisFrame=0,this.starvedThisFrame=!1,this.starvedLastFrame=!1}function JobScheduler(e){var t=new Array(JobType$1.NUMBER_OF_JOB_TYPES);t[JobType$1.TEXTURE]=new JobTypeBudget(defined(e)?e[JobType$1.TEXTURE]:10),t[JobType$1.PROGRAM]=new JobTypeBudget(defined(e)?e[JobType$1.PROGRAM]:10),t[JobType$1.BUFFER]=new JobTypeBudget(defined(e)?e[JobType$1.BUFFER]:30);var i,r=t.length,n=0;for(i=0;i<r;++i)n+=t[i].total;var a=new Array(r);for(i=0;i<r;++i)a[i]=!1;this._totalBudget=n,this._totalUsedThisFrame=0,this._budgets=t,this._executedThisFrame=a}function Light(){}InvertClassification.prototype.update=function(e){var t=this._texture,i=!defined(t)||this.previousFramebuffer!==this._previousFramebuffer;this._previousFramebuffer=this.previousFramebuffer;var r,n,a=e.drawingBufferWidth,o=e.drawingBufferHeight,s=!defined(t)||t.width!==a||t.height!==o;(s||i)&&(this._texture=this._texture&&this._texture.destroy(),this._classifiedTexture=this._classifiedTexture&&this._classifiedTexture.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._texture=new Texture({context:e,width:a,height:o,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:PixelDatatype$1.UNSIGNED_BYTE,sampler:new Sampler({wrapS:TextureWrap$1.CLAMP_TO_EDGE,wrapT:TextureWrap$1.CLAMP_TO_EDGE,minificationFilter:TextureMinificationFilter$1.LINEAR,magnificationFilter:TextureMagnificationFilter$1.LINEAR})}),defined(this._previousFramebuffer)||(this._classifiedTexture=new Texture({context:e,width:a,height:o,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:PixelDatatype$1.UNSIGNED_BYTE,sampler:new Sampler({wrapS:TextureWrap$1.CLAMP_TO_EDGE,wrapT:TextureWrap$1.CLAMP_TO_EDGE,minificationFilter:TextureMinificationFilter$1.LINEAR,magnificationFilter:TextureMagnificationFilter$1.LINEAR})}),this._depthStencilTexture=new Texture({context:e,width:a,height:o,pixelFormat:PixelFormat$1.DEPTH_STENCIL,pixelDatatype:PixelDatatype$1.UNSIGNED_INT_24_8}))),defined(this._fbo)&&!s&&!i||(this._fbo=this._fbo&&this._fbo.destroy(),this._fboClassified=this._fboClassified&&this._fboClassified.destroy(),defined(this._previousFramebuffer)?(r=this._previousFramebuffer.depthStencilTexture,n=this._previousFramebuffer.depthStencilRenderbuffer):r=this._depthStencilTexture,this._fbo=new Framebuffer({context:e,colorTextures:[this._texture],depthStencilTexture:r,depthStencilRenderbuffer:n,destroyAttachments:!1}),defined(this._previousFramebuffer)||(this._fboClassified=new Framebuffer({context:e,colorTextures:[this._classifiedTexture],depthStencilTexture:r,destroyAttachments:!1})));if(defined(this._rsUnclassified)||(this._rsUnclassified=RenderState.fromCache(rsUnclassified),this._rsClassified=RenderState.fromCache(rsClassified),this._rsDefault=RenderState.fromCache(rsDefault)),!defined(this._unclassifiedCommand)||i){defined(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy());var l=defined(this._previousFramebuffer)?opaqueFS:translucentFS,u=new ShaderSource({defines:["UNCLASSIFIED"],sources:[l]}),c=new ShaderSource({sources:[l]});this._unclassifiedCommand=e.createViewportQuadCommand(u,{renderState:defined(this._previousFramebuffer)?this._rsUnclassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),this._classifiedCommand=e.createViewportQuadCommand(c,{renderState:defined(this._previousFramebuffer)?this._rsClassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),defined(this._translucentCommand)&&(this._translucentCommand.shaderProgram=this._translucentCommand.shaderProgram&&this._translucentCommand.shaderProgram.destroy()),defined(this._previousFramebuffer)||(this._translucentCommand=e.createViewportQuadCommand(PassThrough,{renderState:this._rsUnclassified,uniformMap:this._uniformMap,owner:this}))}},InvertClassification.prototype.clear=function(e,t){var i=t.framebuffer;defined(this._previousFramebuffer)?(t.framebuffer=this._fbo,this._clearColorCommand.execute(e,t)):(t.framebuffer=this._fbo,this._clearCommand.execute(e,t),t.framebuffer=this._fboClassified,this._clearCommand.execute(e,t)),t.framebuffer=i},InvertClassification.prototype.executeClassified=function(e,t){if(!defined(this._previousFramebuffer)){var i=t.framebuffer;t.framebuffer=this._fboClassified,this._translucentCommand.execute(e,t),t.framebuffer=i}this._classifiedCommand.execute(e,t)},InvertClassification.prototype.executeUnclassified=function(e,t){this._unclassifiedCommand.execute(e,t)},InvertClassification.prototype.isDestroyed=function(){return!1},InvertClassification.prototype.destroy=function(){return this._fbo=this._fbo&&this._fbo.destroy(),this._texture=this._texture&&this._texture.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),defined(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy()),destroyObject(this)},Object.defineProperties(JobTypeBudget.prototype,{total:{get:function(){return this._total}}}),JobScheduler.getTimestamp=getTimestamp$1,Object.defineProperties(JobScheduler.prototype,{totalBudget:{get:function(){return this._totalBudget}}}),JobScheduler.prototype.disableThisFrame=function(){this._totalUsedThisFrame=this._totalBudget},JobScheduler.prototype.resetBudgets=function(){for(var e=this._budgets,t=e.length,i=0;i<t;++i){var r=e[i];r.starvedLastFrame=r.starvedThisFrame,r.starvedThisFrame=!1,r.usedThisFrame=0,r.stolenFromMeThisFrame=0}this._totalUsedThisFrame=0},JobScheduler.prototype.execute=function(e,t){var i,r=this._budgets,n=r[t],a=this._executedThisFrame[t];if(this._totalUsedThisFrame>=this._totalBudget&&a)return!(n.starvedThisFrame=!0);if(n.usedThisFrame+n.stolenFromMeThisFrame>=n.total){var o,s=r.length;for(o=0;o<s&&(!((i=r[o]).usedThisFrame+i.stolenFromMeThisFrame<i.total)||i.starvedLastFrame);++o);if(o===s&&a)return!1;a&&(n.starvedThisFrame=!0)}var l=JobScheduler.getTimestamp();e.execute();var u=JobScheduler.getTimestamp()-l;return this._totalUsedThisFrame+=u,i?i.stolenFromMeThisFrame+=u:n.usedThisFrame+=u,this._executedThisFrame[t]=!0},Object.defineProperties(Light.prototype,{color:{get:DeveloperError.throwInstantiationError},intensity:{get:DeveloperError.throwInstantiationError}});var trailingSlashRegex$1=/\/$/,defaultCredit$2=new Credit('© <a href="https://www.mapbox.com/about/maps/">Mapbox</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/">Improve this map</a></strong>');function MapboxStyleImageryProvider(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).styleId,i=Resource.createIfNeeded(defaultValue(e.url,"https://api.mapbox.com/styles/v1/")),r=MapboxApi.getAccessToken(e.accessToken);this._styleId=t,this._accessToken=r,this._accessTokenErrorCredit=Credit.clone(MapboxApi.getErrorCredit(e.accessToken));var n=defaultValue(e.tilesize,512);this._tilesize=n;var a=defaultValue(e.username,"mapbox");this._username=a;var o,s=defined(e.scaleFactor)?"@2x":"",l=i.getUrlComponent();trailingSlashRegex$1.test(l)||(l+="/"),l+=this._username+"/"+t+"/tiles/"+this._tilesize+"/{z}/{x}/{y}"+s,i.url=l,i.setQueryParameters({access_token:r}),defined(e.credit)?"string"==typeof(o=e.credit)&&(o=new Credit(o)):o=defaultCredit$2,this._resource=i,this._imageryProvider=new UrlTemplateImageryProvider({url:i,credit:o,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}function Moon(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).textureUrl;defined(t)||(t=buildModuleUrl("Assets/Textures/moonSmall.jpg")),this.show=defaultValue(e.show,!0),this.textureUrl=t,this._ellipsoid=defaultValue(e.ellipsoid,Ellipsoid.MOON),this.onlySunLighting=defaultValue(e.onlySunLighting,!0),this._ellipsoidPrimitive=new EllipsoidPrimitive({radii:this.ellipsoid.radii,material:Material.fromType(Material.ImageType),depthTestEnabled:!1,_owner:this}),this._ellipsoidPrimitive.material.translucent=!1,this._axes=new IauOrientationAxes}Object.defineProperties(MapboxStyleImageryProvider.prototype,{url:{get:function(){return this._imageryProvider.url}},ready:{get:function(){return this._imageryProvider.ready}},readyPromise:{get:function(){return this._imageryProvider.readyPromise}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._imageryProvider.errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},proxy:{get:function(){return this._imageryProvider.proxy}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}}}),MapboxStyleImageryProvider.prototype.getTileCredits=function(e,t,i){if(defined(this._accessTokenErrorCredit))return[this._accessTokenErrorCredit]},MapboxStyleImageryProvider.prototype.requestImage=function(e,t,i,r){return this._imageryProvider.requestImage(e,t,i,r)},MapboxStyleImageryProvider.prototype.pickFeatures=function(e,t,i,r,n){return this._imageryProvider.pickFeatures(e,t,i,r,n)},MapboxStyleImageryProvider._defaultCredit=defaultCredit$2,Object.defineProperties(Moon.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var icrfToFixed=new Matrix3,rotationScratch$1=new Matrix3,translationScratch=new Cartesian3,scratchCommandList$1=[];function NeverTileDiscardPolicy(e){}Moon.prototype.update=function(e){if(this.show){var t=this._ellipsoidPrimitive;t.material.uniforms.image=this.textureUrl,t.onlySunLighting=this.onlySunLighting;var i=e.time;defined(Transforms.computeIcrfToFixedMatrix(i,icrfToFixed))||Transforms.computeTemeToPseudoFixedMatrix(i,icrfToFixed);var r=this._axes.evaluate(i,rotationScratch$1);Matrix3.transpose(r,r),Matrix3.multiply(icrfToFixed,r,r);var n=Simon1994PlanetaryPositions.computeMoonPositionInEarthInertialFrame(i,translationScratch);Matrix3.multiplyByVector(icrfToFixed,n,n),Matrix4.fromRotationTranslation(r,n,t.modelMatrix);var a=e.commandList;return(e.commandList=scratchCommandList$1).length=0,t.update(e),e.commandList=a,1===scratchCommandList$1.length?scratchCommandList$1[0]:void 0}},Moon.prototype.isDestroyed=function(){return!1},Moon.prototype.destroy=function(){return this._ellipsoidPrimitive=this._ellipsoidPrimitive&&this._ellipsoidPrimitive.destroy(),destroyObject(this)},NeverTileDiscardPolicy.prototype.isReady=function(){return!0},NeverTileDiscardPolicy.prototype.shouldDiscardImage=function(e){return!1};var AdjustTranslucentFS="#ifdef MRT\n#extension GL_EXT_draw_buffers : enable\n#endif\nuniform vec4 u_bgColor;\nuniform sampler2D u_depthTexture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nif (texture2D(u_depthTexture, v_textureCoordinates).r < 1.0)\n{\n#ifdef MRT\ngl_FragData[0] = u_bgColor;\ngl_FragData[1] = vec4(u_bgColor.a);\n#else\ngl_FragColor = u_bgColor;\n#endif\nreturn;\n}\ndiscard;\n}\n",CompositeOITFS="uniform sampler2D u_opaque;\nuniform sampler2D u_accumulation;\nuniform sampler2D u_revealage;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nvec4 opaque = texture2D(u_opaque, v_textureCoordinates);\nvec4 accum = texture2D(u_accumulation, v_textureCoordinates);\nfloat r = texture2D(u_revealage, v_textureCoordinates).r;\n#ifdef MRT\nvec4 transparent = vec4(accum.rgb / clamp(r, 1e-4, 5e4), accum.a);\n#else\nvec4 transparent = vec4(accum.rgb / clamp(accum.a, 1e-4, 5e4), r);\n#endif\ngl_FragColor = (1.0 - transparent.a) * transparent + transparent.a * opaque;\nif (opaque != czm_backgroundColor)\n{\ngl_FragColor.a = 1.0;\n}\n}\n";function OIT(e){this._translucentMultipassSupport=!1,this._translucentMRTSupport=!1;var t=e.colorBufferFloat&&e.depthTexture;this._translucentMRTSupport=e.drawBuffers&&t,this._translucentMultipassSupport=!this._translucentMRTSupport&&t,this._opaqueFBO=void 0,this._opaqueTexture=void 0,this._depthStencilTexture=void 0,this._accumulationTexture=void 0,this._translucentFBO=void 0,this._alphaFBO=void 0,this._adjustTranslucentFBO=void 0,this._adjustAlphaFBO=void 0,this._opaqueClearCommand=new ClearCommand({color:new Color(0,0,0,0),owner:this}),this._translucentMRTClearCommand=new ClearCommand({color:new Color(0,0,0,1),owner:this}),this._translucentMultipassClearCommand=new ClearCommand({color:new Color(0,0,0,0),owner:this}),this._alphaClearCommand=new ClearCommand({color:new Color(1,1,1,1),owner:this}),this._translucentRenderStateCache={},this._alphaRenderStateCache={},this._compositeCommand=void 0,this._adjustTranslucentCommand=void 0,this._adjustAlphaCommand=void 0,this._viewport=new BoundingRectangle,this._rs=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHDR=!1}function destroyTextures$3(e){e._accumulationTexture=e._accumulationTexture&&!e._accumulationTexture.isDestroyed()&&e._accumulationTexture.destroy(),e._revealageTexture=e._revealageTexture&&!e._revealageTexture.isDestroyed()&&e._revealageTexture.destroy()}function destroyFramebuffers$2(e){e._translucentFBO=e._translucentFBO&&!e._translucentFBO.isDestroyed()&&e._translucentFBO.destroy(),e._alphaFBO=e._alphaFBO&&!e._alphaFBO.isDestroyed()&&e._alphaFBO.destroy(),e._adjustTranslucentFBO=e._adjustTranslucentFBO&&!e._adjustTranslucentFBO.isDestroyed()&&e._adjustTranslucentFBO.destroy(),e._adjustAlphaFBO=e._adjustAlphaFBO&&!e._adjustAlphaFBO.isDestroyed()&&e._adjustAlphaFBO.destroy()}function destroyResources(e){destroyTextures$3(e),destroyFramebuffers$2(e)}function updateTextures(e,t,i,r){destroyTextures$3(e),e._accumulationTexture=new Texture({context:t,width:i,height:r,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:PixelDatatype$1.FLOAT});var n=new Float32Array(i*r*4);e._revealageTexture=new Texture({context:t,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:PixelDatatype$1.FLOAT,source:{arrayBufferView:n,width:i,height:r},flipY:!1})}function updateFramebuffers$1(e,t){destroyFramebuffers$2(e);var i=WebGLConstants$1.FRAMEBUFFER_COMPLETE,r=!0;if(e._translucentMRTSupport&&(e._translucentFBO=new Framebuffer({context:t,colorTextures:[e._accumulationTexture,e._revealageTexture],depthStencilTexture:e._depthStencilTexture,destroyAttachments:!1}),e._adjustTranslucentFBO=new Framebuffer({context:t,colorTextures:[e._accumulationTexture,e._revealageTexture],destroyAttachments:!1}),e._translucentFBO.status===i&&e._adjustTranslucentFBO.status===i||(destroyFramebuffers$2(e),e._translucentMRTSupport=!1)),!e._translucentMRTSupport){e._translucentFBO=new Framebuffer({context:t,colorTextures:[e._accumulationTexture],depthStencilTexture:e._depthStencilTexture,destroyAttachments:!1}),e._alphaFBO=new Framebuffer({context:t,colorTextures:[e._revealageTexture],depthStencilTexture:e._depthStencilTexture,destroyAttachments:!1}),e._adjustTranslucentFBO=new Framebuffer({context:t,colorTextures:[e._accumulationTexture],destroyAttachments:!1}),e._adjustAlphaFBO=new Framebuffer({context:t,colorTextures:[e._revealageTexture],destroyAttachments:!1});var n=e._translucentFBO.status===i,a=e._alphaFBO.status===i,o=e._adjustTranslucentFBO.status===i,s=e._adjustAlphaFBO.status===i;n&&a&&o&&s||(destroyResources(e),r=e._translucentMultipassSupport=!1)}return r}OIT.prototype.update=function(e,t,i,r){if(this.isSupported()){this._opaqueFBO=i,this._opaqueTexture=i.getColorTexture(0),this._depthStencilTexture=i.depthStencilTexture;var n=this._opaqueTexture.width,a=this._opaqueTexture.height,o=this._accumulationTexture,s=!defined(o)||o.width!==n||o.height!==a||r!==this._useHDR;if(s&&updateTextures(this,e,n,a),defined(this._translucentFBO)&&!s||updateFramebuffers$1(this,e)){this._useHDR=r;var l,u,c=this;defined(this._compositeCommand)||(l=new ShaderSource({sources:[CompositeOITFS]}),this._translucentMRTSupport&&l.defines.push("MRT"),u={u_opaque:function(){return c._opaqueTexture},u_accumulation:function(){return c._accumulationTexture},u_revealage:function(){return c._revealageTexture}},this._compositeCommand=e.createViewportQuadCommand(l,{uniformMap:u,owner:this})),defined(this._adjustTranslucentCommand)||(this._translucentMRTSupport?(l=new ShaderSource({defines:["MRT"],sources:[AdjustTranslucentFS]}),u={u_bgColor:function(){return c._translucentMRTClearCommand.color},u_depthTexture:function(){return c._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(l,{uniformMap:u,owner:this})):this._translucentMultipassSupport&&(l=new ShaderSource({sources:[AdjustTranslucentFS]}),u={u_bgColor:function(){return c._translucentMultipassClearCommand.color},u_depthTexture:function(){return c._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(l,{uniformMap:u,owner:this}),u={u_bgColor:function(){return c._alphaClearCommand.color},u_depthTexture:function(){return c._depthStencilTexture}},this._adjustAlphaCommand=e.createViewportQuadCommand(l,{uniformMap:u,owner:this}))),this._viewport.width=n,this._viewport.height=a;var d=!BoundingRectangle.equals(this._viewport,t.viewport),h=d!==this._useScissorTest;this._useScissorTest=d,BoundingRectangle.equals(this._scissorRectangle,t.viewport)||(this._scissorRectangle=BoundingRectangle.clone(t.viewport,this._scissorRectangle),h=!0),defined(this._rs)&&BoundingRectangle.equals(this._viewport,this._rs.viewport)&&!h||(this._rs=RenderState.fromCache({viewport:this._viewport,scissorTest:{enabled:this._useScissorTest,rectangle:this._scissorRectangle}})),defined(this._compositeCommand)&&(this._compositeCommand.renderState=this._rs),this._adjustTranslucentCommand&&(this._adjustTranslucentCommand.renderState=this._rs),defined(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.renderState=this._rs)}}};var translucentMRTBlend={enabled:!0,color:new Color(0,0,0,0),equationRgb:BlendEquation$1.ADD,equationAlpha:BlendEquation$1.ADD,functionSourceRgb:BlendFunction$1.ONE,functionDestinationRgb:BlendFunction$1.ONE,functionSourceAlpha:BlendFunction$1.ZERO,functionDestinationAlpha:BlendFunction$1.ONE_MINUS_SOURCE_ALPHA},translucentColorBlend={enabled:!0,color:new Color(0,0,0,0),equationRgb:BlendEquation$1.ADD,equationAlpha:BlendEquation$1.ADD,functionSourceRgb:BlendFunction$1.ONE,functionDestinationRgb:BlendFunction$1.ONE,functionSourceAlpha:BlendFunction$1.ONE,functionDestinationAlpha:BlendFunction$1.ONE},translucentAlphaBlend={enabled:!0,color:new Color(0,0,0,0),equationRgb:BlendEquation$1.ADD,equationAlpha:BlendEquation$1.ADD,functionSourceRgb:BlendFunction$1.ZERO,functionDestinationRgb:BlendFunction$1.ONE_MINUS_SOURCE_ALPHA,functionSourceAlpha:BlendFunction$1.ZERO,functionDestinationAlpha:BlendFunction$1.ONE_MINUS_SOURCE_ALPHA};function getTranslucentRenderState$2(e,t,i,r){var n=i[r.id];if(!defined(n)){var a=RenderState.getState(r);a.depthMask=!1,a.blending=t,n=RenderState.fromCache(a),i[r.id]=n}return n}function getTranslucentMRTRenderState(e,t,i){return getTranslucentRenderState$2(t,translucentMRTBlend,e._translucentRenderStateCache,i)}function getTranslucentColorRenderState(e,t,i){return getTranslucentRenderState$2(t,translucentColorBlend,e._translucentRenderStateCache,i)}function getTranslucentAlphaRenderState(e,t,i){return getTranslucentRenderState$2(t,translucentAlphaBlend,e._alphaRenderStateCache,i)}var mrtShaderSource=" vec3 Ci = czm_gl_FragColor.rgb * czm_gl_FragColor.a;\n float ai = czm_gl_FragColor.a;\n float wzi = czm_alphaWeight(ai);\n gl_FragData[0] = vec4(Ci * wzi, ai);\n gl_FragData[1] = vec4(ai * wzi);\n",colorShaderSource=" vec3 Ci = czm_gl_FragColor.rgb * czm_gl_FragColor.a;\n float ai = czm_gl_FragColor.a;\n float wzi = czm_alphaWeight(ai);\n gl_FragColor = vec4(Ci, ai) * wzi;\n",alphaShaderSource=" float ai = czm_gl_FragColor.a;\n gl_FragColor = vec4(ai);\n";function getTranslucentShaderProgram(e,t,i,r){var n=e.shaderCache.getDerivedShaderProgram(t,i);if(!defined(n)){var a=t._attributeLocations,o=t.fragmentShaderSource.clone();o.sources=o.sources.map(function(e){return e=(e=(e=(e=ShaderSource.replaceMain(e,"czm_translucent_main")).replace(/gl_FragColor/g,"czm_gl_FragColor")).replace(/\bdiscard\b/g,"czm_discard = true")).replace(/czm_phong/g,"czm_translucentPhong")}),o.sources.splice(0,0,(-1!==r.indexOf("gl_FragData")?"#extension GL_EXT_draw_buffers : enable \n":"")+"vec4 czm_gl_FragColor;\nbool czm_discard = false;\n"),o.sources.push("void main()\n{\n czm_translucent_main();\n if (czm_discard)\n {\n discard;\n }\n"+r+"}\n"),n=e.shaderCache.createDerivedShaderProgram(t,i,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:o,attributeLocations:a})}return n}function getTranslucentMRTShaderProgram(e,t){return getTranslucentShaderProgram(e,t,"translucentMRT",mrtShaderSource)}function getTranslucentColorShaderProgram(e,t){return getTranslucentShaderProgram(e,t,"translucentMultipass",colorShaderSource)}function getTranslucentAlphaShaderProgram(e,t){return getTranslucentShaderProgram(e,t,"alphaMultipass",alphaShaderSource)}function executeTranslucentCommandsSortedMultipass(e,t,i,r,n,a){var o,s,l=t.context,u=t.frameState.useLogDepth,c=t._hdr,d=r.framebuffer,h=n.length,p=t.frameState.shadowState.lightShadowsEnabled;r.framebuffer=e._adjustTranslucentFBO,e._adjustTranslucentCommand.execute(l,r),r.framebuffer=e._adjustAlphaFBO,e._adjustAlphaCommand.execute(l,r);var f=e._opaqueFBO;for(r.framebuffer=e._translucentFBO,s=0;s<h;++s)o=n[s],o=u?o.derivedCommands.logDepth.command:o,o=c?o.derivedCommands.hdr.command:o,i(p&&o.receiveShadows?o.derivedCommands.oit.shadows.translucentCommand:o.derivedCommands.oit.translucentCommand,t,l,r,f);for(defined(a)&&(o=a.unclassifiedCommand,i(p&&o.receiveShadows?o.derivedCommands.oit.shadows.translucentCommand:o.derivedCommands.oit.translucentCommand,t,l,r,f)),r.framebuffer=e._alphaFBO,s=0;s<h;++s)o=n[s],o=u?o.derivedCommands.logDepth.command:o,o=c?o.derivedCommands.hdr.command:o,i(p&&o.receiveShadows?o.derivedCommands.oit.shadows.alphaCommand:o.derivedCommands.oit.alphaCommand,t,l,r,f);defined(a)&&(o=a.unclassifiedCommand,i(p&&o.receiveShadows?o.derivedCommands.oit.shadows.alphaCommand:o.derivedCommands.oit.alphaCommand,t,l,r,f)),r.framebuffer=d}function executeTranslucentCommandsSortedMRT(e,t,i,r,n,a){var o=t.context,s=t.frameState.useLogDepth,l=t._hdr,u=r.framebuffer,c=n.length,d=t.frameState.shadowState.lightShadowsEnabled;r.framebuffer=e._adjustTranslucentFBO,e._adjustTranslucentCommand.execute(o,r);var h,p=e._opaqueFBO;r.framebuffer=e._translucentFBO;for(var f=0;f<c;++f)h=n[f],h=s?h.derivedCommands.logDepth.command:h,h=l?h.derivedCommands.hdr.command:h,i(d&&h.receiveShadows?h.derivedCommands.oit.shadows.translucentCommand:h.derivedCommands.oit.translucentCommand,t,o,r,p);defined(a)&&(h=a.unclassifiedCommand,i(d&&h.receiveShadows?h.derivedCommands.oit.shadows.translucentCommand:h.derivedCommands.oit.translucentCommand,t,o,r,p)),r.framebuffer=u}OIT.prototype.createDerivedCommands=function(e,t,i){var r,n,a,o,s,l;(defined(i)||(i={}),this._translucentMRTSupport)?(defined(i.translucentCommand)&&(r=i.translucentCommand.shaderProgram,n=i.translucentCommand.renderState),i.translucentCommand=DrawCommand.shallowClone(e,i.translucentCommand),defined(r)&&i.shaderProgramId===e.shaderProgram.id?(i.translucentCommand.shaderProgram=r,i.translucentCommand.renderState=n):(i.translucentCommand.shaderProgram=getTranslucentMRTShaderProgram(t,e.shaderProgram),i.translucentCommand.renderState=getTranslucentMRTRenderState(this,t,e.renderState),i.shaderProgramId=e.shaderProgram.id)):(defined(i.translucentCommand)&&(a=i.translucentCommand.shaderProgram,o=i.translucentCommand.renderState,s=i.alphaCommand.shaderProgram,l=i.alphaCommand.renderState),i.translucentCommand=DrawCommand.shallowClone(e,i.translucentCommand),i.alphaCommand=DrawCommand.shallowClone(e,i.alphaCommand),defined(a)&&i.shaderProgramId===e.shaderProgram.id?(i.translucentCommand.shaderProgram=a,i.translucentCommand.renderState=o,i.alphaCommand.shaderProgram=s,i.alphaCommand.renderState=l):(i.translucentCommand.shaderProgram=getTranslucentColorShaderProgram(t,e.shaderProgram),i.translucentCommand.renderState=getTranslucentColorRenderState(this,t,e.renderState),i.alphaCommand.shaderProgram=getTranslucentAlphaShaderProgram(t,e.shaderProgram),i.alphaCommand.renderState=getTranslucentAlphaRenderState(this,t,e.renderState),i.shaderProgramId=e.shaderProgram.id));return i},OIT.prototype.executeCommands=function(e,t,i,r,n){this._translucentMRTSupport?executeTranslucentCommandsSortedMRT(this,e,t,i,r,n):executeTranslucentCommandsSortedMultipass(this,e,t,i,r,n)},OIT.prototype.execute=function(e,t){this._compositeCommand.execute(e,t)},OIT.prototype.clear=function(e,t,i){var r=t.framebuffer;t.framebuffer=this._opaqueFBO,Color.clone(i,this._opaqueClearCommand.color),this._opaqueClearCommand.execute(e,t),t.framebuffer=this._translucentFBO,(this._translucentMRTSupport?this._translucentMRTClearCommand:this._translucentMultipassClearCommand).execute(e,t),this._translucentMultipassSupport&&(t.framebuffer=this._alphaFBO,this._alphaClearCommand.execute(e,t)),t.framebuffer=r},OIT.prototype.isSupported=function(){return this._translucentMRTSupport||this._translucentMultipassSupport},OIT.prototype.isDestroyed=function(){return!1},OIT.prototype.destroy=function(){return destroyResources(this),defined(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),defined(this._adjustTranslucentCommand)&&(this._adjustTranslucentCommand.shaderProgram=this._adjustTranslucentCommand.shaderProgram&&this._adjustTranslucentCommand.shaderProgram.destroy()),defined(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.shaderProgram=this._adjustAlphaCommand.shaderProgram&&this._adjustAlphaCommand.shaderProgram.destroy()),destroyObject(this)};var defaultCredit$3=new Credit("MapQuest, Open Street Map and contributors, CC-BY-SA");function OpenStreetMapImageryProvider(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT);var t=Resource.createIfNeeded(defaultValue(e.url,"https://a.tile.openstreetmap.org/"));t.appendForwardSlash(),t.url+="{z}/{x}/{y}."+defaultValue(e.fileExtension,"png");var i=new WebMercatorTilingScheme({ellipsoid:e.ellipsoid}),r=defaultValue(e.minimumLevel,0),n=e.maximumLevel,a=defaultValue(e.rectangle,i.rectangle),o=i.positionToTileXY(Rectangle.southwest(a),r),s=i.positionToTileXY(Rectangle.northeast(a),r),l=(Math.abs(s.x-o.x),Math.abs(s.y-o.y),defaultValue(e.credit,defaultCredit$3));"string"==typeof l&&(l=new Credit(l)),UrlTemplateImageryProvider.call(this,{url:t,credit:l,tilingScheme:i,tileWidth:256,tileHeight:256,minimumLevel:r,maximumLevel:n,rectangle:a})}defined(Object.create)&&(OpenStreetMapImageryProvider.prototype=Object.create(UrlTemplateImageryProvider.prototype),OpenStreetMapImageryProvider.prototype.constructor=OpenStreetMapImageryProvider);var defaultSize=new Cartesian2(1,1);function Particle(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this.mass=defaultValue(e.mass,1),this.position=Cartesian3.clone(defaultValue(e.position,Cartesian3.ZERO)),this.velocity=Cartesian3.clone(defaultValue(e.velocity,Cartesian3.ZERO)),this.life=defaultValue(e.life,Number.MAX_VALUE),this.image=e.image,this.startColor=Color.clone(defaultValue(e.startColor,Color.WHITE)),this.endColor=Color.clone(defaultValue(e.endColor,Color.WHITE)),this.startScale=defaultValue(e.startScale,1),this.endScale=defaultValue(e.endScale,1),this.imageSize=Cartesian2.clone(defaultValue(e.imageSize,defaultSize)),this._age=0,this._normalizedAge=0,this._billboard=void 0}Object.defineProperties(Particle.prototype,{age:{get:function(){return this._age}},normalizedAge:{get:function(){return this._normalizedAge}}});var deltaScratch=new Cartesian3;function ParticleBurst(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this.time=defaultValue(e.time,0),this.minimum=defaultValue(e.minimum,0),this.maximum=defaultValue(e.maximum,50),this._complete=!1}function ParticleEmitter(e){}Particle.prototype.update=function(e,t){return Cartesian3.multiplyByScalar(this.velocity,e,deltaScratch),Cartesian3.add(this.position,deltaScratch,this.position),defined(t)&&t(this,e),this._age+=e,this.life===Number.MAX_VALUE?this._normalizedAge=0:this._normalizedAge=this._age/this.life,this._age<=this.life},Object.defineProperties(ParticleBurst.prototype,{complete:{get:function(){return this._complete}}}),ParticleEmitter.prototype.emit=function(e){DeveloperError.throwInstantiationError()};var defaultImageSize=new Cartesian2(1,1);function ParticleSystem(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this.show=defaultValue(e.show,!0),this.updateCallback=e.updateCallback,this.loop=defaultValue(e.loop,!0),this.image=defaultValue(e.image,void 0);var t=e.emitter;defined(t)||(t=new CircleEmitter(.5)),this._emitter=t,this._bursts=e.bursts,this._modelMatrix=Matrix4.clone(defaultValue(e.modelMatrix,Matrix4.IDENTITY)),this._emitterModelMatrix=Matrix4.clone(defaultValue(e.emitterModelMatrix,Matrix4.IDENTITY)),this._matrixDirty=!0,this._combinedMatrix=new Matrix4,this._startColor=Color.clone(defaultValue(e.color,defaultValue(e.startColor,Color.WHITE))),this._endColor=Color.clone(defaultValue(e.color,defaultValue(e.endColor,Color.WHITE))),this._startScale=defaultValue(e.scale,defaultValue(e.startScale,1)),this._endScale=defaultValue(e.scale,defaultValue(e.endScale,1)),this._emissionRate=defaultValue(e.emissionRate,5),this._minimumSpeed=defaultValue(e.speed,defaultValue(e.minimumSpeed,1)),this._maximumSpeed=defaultValue(e.speed,defaultValue(e.maximumSpeed,1)),this._minimumParticleLife=defaultValue(e.particleLife,defaultValue(e.minimumParticleLife,5)),this._maximumParticleLife=defaultValue(e.particleLife,defaultValue(e.maximumParticleLife,5)),this._minimumMass=defaultValue(e.mass,defaultValue(e.minimumMass,1)),this._maximumMass=defaultValue(e.mass,defaultValue(e.maximumMass,1)),this._minimumImageSize=Cartesian2.clone(defaultValue(e.imageSize,defaultValue(e.minimumImageSize,defaultImageSize))),this._maximumImageSize=Cartesian2.clone(defaultValue(e.imageSize,defaultValue(e.maximumImageSize,defaultImageSize))),this._sizeInMeters=defaultValue(e.sizeInMeters,!1),this._lifetime=defaultValue(e.lifetime,Number.MAX_VALUE),this._billboardCollection=void 0,this._particles=[],this._particlePool=[],this._previousTime=void 0,this._currentTime=0,this._carryOver=0,this._complete=new Event,this._isComplete=!1,this._updateParticlePool=!0,this._particleEstimate=0}function updateParticlePool(e){var t=e._emissionRate,i=e._maximumParticleLife,r=0,n=e._bursts;if(defined(n))for(var a=n.length,o=0;o<a;++o)r+=n[o].maximum;for(var s=e._billboardCollection,l=e.image,u=Math.ceil(t*i+r),c=e._particles,d=e._particlePool,h=Math.max(u-c.length-d.length,0),p=0;p<h;++p){var f=new Particle;f._billboard=s.add({image:l}),d.push(f)}e._particleEstimate=u}function getOrCreateParticle(e){var t=e._particlePool.pop();return defined(t)||(t=new Particle),t}function addParticleToPool(e,t){e._particlePool.push(t)}function freeParticlePool(e){for(var t=e._particles,i=e._particlePool,r=e._billboardCollection,n=t.length,a=i.length,o=e._particleEstimate,s=a-Math.max(o-n-a,0),l=s;l<a;++l){var u=i[l];r.remove(u._billboard)}i.length=s}function removeBillboard(e){defined(e._billboard)&&(e._billboard.show=!1)}function updateBillboard(e,t){var i=t._billboard;defined(i)||(i=t._billboard=e._billboardCollection.add({image:t.image})),i.width=t.imageSize.x,i.height=t.imageSize.y,i.position=t.position,i.sizeInMeters=e.sizeInMeters,i.show=!0;var r=CesiumMath.lerp(t.startColor.red,t.endColor.red,t.normalizedAge),n=CesiumMath.lerp(t.startColor.green,t.endColor.green,t.normalizedAge),a=CesiumMath.lerp(t.startColor.blue,t.endColor.blue,t.normalizedAge),o=CesiumMath.lerp(t.startColor.alpha,t.endColor.alpha,t.normalizedAge);i.color=new Color(r,n,a,o),i.scale=CesiumMath.lerp(t.startScale,t.endScale,t.normalizedAge)}function addParticle(e,t){t.startColor=Color.clone(e._startColor,t.startColor),t.endColor=Color.clone(e._endColor,t.endColor),t.startScale=e._startScale,t.endScale=e._endScale,t.image=e.image,t.life=CesiumMath.randomBetween(e._minimumParticleLife,e._maximumParticleLife),t.mass=CesiumMath.randomBetween(e._minimumMass,e._maximumMass),t.imageSize.x=CesiumMath.randomBetween(e._minimumImageSize.x,e._maximumImageSize.x),t.imageSize.y=CesiumMath.randomBetween(e._minimumImageSize.y,e._maximumImageSize.y),t._normalizedAge=0,t._age=0;var i=CesiumMath.randomBetween(e._minimumSpeed,e._maximumSpeed);Cartesian3.multiplyByScalar(t.velocity,i,t.velocity),e._particles.push(t)}function calculateNumberToEmit(e,t){if(e._isComplete)return 0;var i=(t=CesiumMath.mod(t,e._lifetime))*e._emissionRate,r=Math.floor(i);if(e._carryOver+=i-r,1<e._carryOver&&(r++,e._carryOver-=1),defined(e.bursts))for(var n=e.bursts.length,a=0;a<n;a++){var o=e.bursts[a],s=e._currentTime;defined(o)&&!o._complete&&s>o.time&&(r+=CesiumMath.randomBetween(o.minimum,o.maximum),o._complete=!0)}return r}Object.defineProperties(ParticleSystem.prototype,{emitter:{get:function(){return this._emitter},set:function(e){this._emitter=e}},bursts:{get:function(){return this._bursts},set:function(e){this._bursts=e,this._updateParticlePool=!0}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._matrixDirty=this._matrixDirty||!Matrix4.equals(this._modelMatrix,e),Matrix4.clone(e,this._modelMatrix)}},emitterModelMatrix:{get:function(){return this._emitterModelMatrix},set:function(e){this._matrixDirty=this._matrixDirty||!Matrix4.equals(this._emitterModelMatrix,e),Matrix4.clone(e,this._emitterModelMatrix)}},startColor:{get:function(){return this._startColor},set:function(e){Color.clone(e,this._startColor)}},endColor:{get:function(){return this._endColor},set:function(e){Color.clone(e,this._endColor)}},startScale:{get:function(){return this._startScale},set:function(e){this._startScale=e}},endScale:{get:function(){return this._endScale},set:function(e){this._endScale=e}},emissionRate:{get:function(){return this._emissionRate},set:function(e){this._emissionRate=e,this._updateParticlePool=!0}},minimumSpeed:{get:function(){return this._minimumSpeed},set:function(e){this._minimumSpeed=e}},maximumSpeed:{get:function(){return this._maximumSpeed},set:function(e){this._maximumSpeed=e}},minimumParticleLife:{get:function(){return this._minimumParticleLife},set:function(e){this._minimumParticleLife=e}},maximumParticleLife:{get:function(){return this._maximumParticleLife},set:function(e){this._maximumParticleLife=e,this._updateParticlePool=!0}},minimumMass:{get:function(){return this._minimumMass},set:function(e){this._minimumMass=e}},maximumMass:{get:function(){return this._maximumMass},set:function(e){this._maximumMass=e}},minimumImageSize:{get:function(){return this._minimumImageSize},set:function(e){this._minimumImageSize=e}},maximumImageSize:{get:function(){return this._maximumImageSize},set:function(e){this._maximumImageSize=e}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters=e}},lifetime:{get:function(){return this._lifetime},set:function(e){this._lifetime=e}},complete:{get:function(){return this._complete}},isComplete:{get:function(){return this._isComplete}}});var rotatedVelocityScratch=new Cartesian3;function getElement(e){"string"==typeof e&&(e=document.getElementById(e));return e}function PerformanceDisplay(e){var t=getElement((e=defaultValue(e,defaultValue.EMPTY_OBJECT)).container);this._container=t;var i=document.createElement("div");i.className="cesium-performanceDisplay";var r=document.createElement("div");r.className="cesium-performanceDisplay-fps",this._fpsText=document.createTextNode(""),r.appendChild(this._fpsText);var n=document.createElement("div");n.className="cesium-performanceDisplay-ms",this._msText=document.createTextNode(""),n.appendChild(this._msText),i.appendChild(n),i.appendChild(r),this._container.appendChild(i),this._lastFpsSampleTime=getTimestamp$1(),this._lastMsSampleTime=getTimestamp$1(),this._fpsFrameCount=0,this._msFrameCount=0,this._throttled=!1;var a=document.createElement("div");a.className="cesium-performanceDisplay-throttled",this._throttledText=document.createTextNode(""),a.appendChild(this._throttledText),i.appendChild(a)}function PickDepth(){this._framebuffer=void 0,this._depthTexture=void 0,this._textureToCopy=void 0,this._copyDepthCommand=void 0,this._useLogDepth=void 0,this._debugPickDepthViewportCommand=void 0}function executeDebugPickDepth(e,t,i,r){if(!defined(e._debugPickDepthViewportCommand)||r!==e._useLogDepth){var n=new ShaderSource({defines:[r?"LOG_DEPTH":""],sources:["uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\n float z_window = czm_unpackDepth(texture2D(u_texture, v_textureCoordinates));\n z_window = czm_reverseLogDepth(z_window); \n float n_range = czm_depthRange.near;\n float f_range = czm_depthRange.far;\n float z_ndc = (2.0 * z_window - n_range - f_range) / (f_range - n_range);\n float scale = pow(z_ndc * 0.5 + 0.5, 8.0);\n gl_FragColor = vec4(mix(vec3(0.0), vec3(1.0), scale), 1.0);\n}\n"]});e._debugPickDepthViewportCommand=t.createViewportQuadCommand(n,{uniformMap:{u_texture:function(){return e._depthTexture}},owner:e}),e._useLogDepth=r}e._debugPickDepthViewportCommand.execute(t,i)}function destroyTextures$4(e){e._depthTexture=e._depthTexture&&!e._depthTexture.isDestroyed()&&e._depthTexture.destroy()}function destroyFramebuffers$3(e){e._framebuffer=e._framebuffer&&!e._framebuffer.isDestroyed()&&e._framebuffer.destroy()}function createTextures$4(e,t,i,r){e._depthTexture=new Texture({context:t,width:i,height:r,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:PixelDatatype$1.UNSIGNED_BYTE})}function createFramebuffers$2(e,t,i,r){destroyTextures$4(e),destroyFramebuffers$3(e),createTextures$4(e,t,i,r),e._framebuffer=new Framebuffer({context:t,colorTextures:[e._depthTexture],destroyAttachments:!1})}function updateFramebuffers$2(e,t,i){var r=i.width,n=i.height,a=e._depthTexture,o=!defined(a)||a.width!==r||a.height!==n;defined(e._framebuffer)&&!o||createFramebuffers$2(e,t,r,n)}function updateCopyCommands$1(e,t,i){if(!defined(e._copyDepthCommand)){e._copyDepthCommand=t.createViewportQuadCommand("uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\n gl_FragColor = czm_packDepth(texture2D(u_texture, v_textureCoordinates).r);\n}\n",{renderState:RenderState.fromCache(),uniformMap:{u_texture:function(){return e._textureToCopy}},owner:e})}e._textureToCopy=i,e._copyDepthCommand.framebuffer=e._framebuffer}ParticleSystem.prototype.update=function(e){if(this.show){defined(this._billboardCollection)||(this._billboardCollection=new BillboardCollection),this._updateParticlePool&&(updateParticlePool(this),this._updateParticlePool=!1);var t=0;this._previousTime&&(t=JulianDate.secondsDifference(e.time,this._previousTime)),t<0&&(t=0);var i,r,n=this._particles,a=this._emitter,o=this.updateCallback,s=n.length;for(i=0;i<s;++i)(r=n[i]).update(t,o)?updateBillboard(this,r):(removeBillboard(r),addParticleToPool(this,r),n[i]=n[s-1],--i,--s);n.length=s;var l=calculateNumberToEmit(this,t);if(0<l&&defined(a)){this._matrixDirty&&(this._combinedMatrix=Matrix4.multiply(this.modelMatrix,this.emitterModelMatrix,this._combinedMatrix),this._matrixDirty=!1);var u=this._combinedMatrix;for(i=0;i<l;i++)r=getOrCreateParticle(this),this._emitter.emit(r),Cartesian3.add(r.position,r.velocity,rotatedVelocityScratch),Matrix4.multiplyByPoint(u,rotatedVelocityScratch,rotatedVelocityScratch),r.position=Matrix4.multiplyByPoint(u,r.position,r.position),Cartesian3.subtract(rotatedVelocityScratch,r.position,r.velocity),Cartesian3.normalize(r.velocity,r.velocity),addParticle(this,r),updateBillboard(this,r)}if(this._billboardCollection.update(e),this._previousTime=JulianDate.clone(e.time,this._previousTime),this._currentTime+=t,this._lifetime!==Number.MAX_VALUE&&this._currentTime>this._lifetime)if(this.loop){if(this._currentTime=CesiumMath.mod(this._currentTime,this._lifetime),this.bursts){var c=this.bursts.length;for(i=0;i<c;i++)this.bursts[i]._complete=!1}}else this._isComplete=!0,this._complete.raiseEvent(this);e.frameNumber%120==0&&freeParticlePool(this)}},ParticleSystem.prototype.isDestroyed=function(){return!1},ParticleSystem.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),destroyObject(this)},Object.defineProperties(PerformanceDisplay.prototype,{throttled:{get:function(){return this._throttled},set:function(e){this._throttled!==e&&(this._throttledText.nodeValue=e?"(throttled)":"",this._throttled=e)}}}),PerformanceDisplay.prototype.update=function(e){var t=getTimestamp$1(),i=defaultValue(e,!0);this._fpsFrameCount++;var r=t-this._lastFpsSampleTime;if(1e3<r){var n="N/A";i&&(n=1e3*this._fpsFrameCount/r|0),this._fpsText.nodeValue=n+" FPS",this._lastFpsSampleTime=t,this._fpsFrameCount=0}this._msFrameCount++;var a=t-this._lastMsSampleTime;if(200<a){var o="N/A";i&&(o=(a/this._msFrameCount).toFixed(2)),this._msText.nodeValue=o+" MS",this._lastMsSampleTime=t,this._msFrameCount=0}},PerformanceDisplay.prototype.destroy=function(){return destroyObject(this)},PickDepth.prototype.executeDebugPickDepth=function(e,t,i){executeDebugPickDepth(this,e,t,i)},PickDepth.prototype.update=function(e,t){updateFramebuffers$2(this,e,t),updateCopyCommands$1(this,e,t)};var scratchPackedDepth=new Cartesian4,packedDepthScale=new Cartesian4(1,1/255,1/65025,1/16581375);function PickDepthFramebuffer(){this._depthStencilTexture=void 0,this._framebuffer=void 0,this._passState=void 0}function destroyResources$1(e){e._framebuffer=e._framebuffer&&e._framebuffer.destroy(),e._depthStencilTexture=e._depthStencilTexture&&e._depthStencilTexture.destroy()}function createResources$5(e,t){var i=t.drawingBufferWidth,r=t.drawingBufferHeight;e._depthStencilTexture=new Texture({context:t,width:i,height:r,pixelFormat:PixelFormat$1.DEPTH_STENCIL,pixelDatatype:PixelDatatype$1.UNSIGNED_INT_24_8}),e._framebuffer=new Framebuffer({context:t,depthStencilTexture:e._depthStencilTexture,destroyAttachments:!1});var n=new PassState(t);n.blendingEnabled=!1,n.scissorTest={enabled:!0,rectangle:new BoundingRectangle},n.viewport=new BoundingRectangle,e._passState=n}function PickFramebuffer(e){var t=new PassState(e);t.blendingEnabled=!1,t.scissorTest={enabled:!0,rectangle:new BoundingRectangle},t.viewport=new BoundingRectangle,this._context=e,this._fb=void 0,this._passState=t,this._width=0,this._height=0}PickDepth.prototype.getDepth=function(e,t,i){var r=e.readPixels({x:t,y:i,width:1,height:1,framebuffer:this._framebuffer}),n=Cartesian4.unpack(r,0,scratchPackedDepth);return Cartesian4.divideByScalar(n,255,n),Cartesian4.dot(n,packedDepthScale)},PickDepth.prototype.executeCopyDepth=function(e,t){this._copyDepthCommand.execute(e,t)},PickDepth.prototype.isDestroyed=function(){return!1},PickDepth.prototype.destroy=function(){return destroyTextures$4(this),destroyFramebuffers$3(this),this._copyDepthCommand.shaderProgram=defined(this._copyDepthCommand.shaderProgram)&&this._copyDepthCommand.shaderProgram.destroy(),destroyObject(this)},PickDepthFramebuffer.prototype.update=function(e,t,i){var r=i.width,n=i.height;defined(this._framebuffer)&&r===this._depthStencilTexture.width&&n===this._depthStencilTexture.height||(destroyResources$1(this),createResources$5(this,e));var a=this._framebuffer,o=this._passState;return o.framebuffer=a,o.viewport.width=r,o.viewport.height=n,o.scissorTest.rectangle.x=t.x,o.scissorTest.rectangle.y=n-t.y,o.scissorTest.rectangle.width=1,o.scissorTest.rectangle.height=1,o},PickDepthFramebuffer.prototype.isDestroyed=function(){return!1},PickDepthFramebuffer.prototype.destroy=function(){return destroyResources$1(this),destroyObject(this)},PickFramebuffer.prototype.begin=function(e,t){var i=this._context,r=t.width,n=t.height;return BoundingRectangle.clone(e,this._passState.scissorTest.rectangle),defined(this._fb)&&this._width===r&&this._height===n||(this._width=r,this._height=n,this._fb=this._fb&&this._fb.destroy(),this._fb=new Framebuffer({context:i,colorTextures:[new Texture({context:i,width:r,height:n})],depthStencilRenderbuffer:new Renderbuffer({context:i,width:r,height:n,format:RenderbufferFormat$1.DEPTH_STENCIL})}),this._passState.framebuffer=this._fb),this._passState.viewport.width=r,this._passState.viewport.height=n,this._passState};var colorScratch$7=new Color;function SceneFramebuffer(){this._colorTexture=void 0,this._idTexture=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this._framebuffer=void 0,this._idFramebuffer=void 0,this._idClearColor=new Color(0,0,0,0),this._useHdr=void 0,this._clearCommand=new ClearCommand({color:new Color(0,0,0,0),depth:1,owner:this})}function destroyResources$2(e){e._framebuffer=e._framebuffer&&e._framebuffer.destroy(),e._idFramebuffer=e._idFramebuffer&&e._idFramebuffer.destroy(),e._colorTexture=e._colorTexture&&e._colorTexture.destroy(),e._idTexture=e._idTexture&&e._idTexture.destroy(),e._depthStencilTexture=e._depthStencilTexture&&e._depthStencilTexture.destroy(),e._depthStencilRenderbuffer=e._depthStencilRenderbuffer&&e._depthStencilRenderbuffer.destroy(),e._depthStencilIdTexture=e._depthStencilIdTexture&&e._depthStencilIdTexture.destroy(),e._depthStencilIdRenderbuffer=e._depthStencilIdRenderbuffer&&e._depthStencilIdRenderbuffer.destroy(),e._framebuffer=void 0,e._idFramebuffer=void 0,e._colorTexture=void 0,e._idTexture=void 0,e._depthStencilTexture=void 0,e._depthStencilRenderbuffer=void 0,e._depthStencilIdTexture=void 0,e._depthStencilIdRenderbuffer=void 0}function ShadowMapShader(){}function ShadowMap(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).context;this._enabled=defaultValue(e.enabled,!0),this._softShadows=defaultValue(e.softShadows,!1),this._normalOffset=defaultValue(e.normalOffset,!0),this.dirty=!0,this.fromLightSource=defaultValue(e.fromLightSource,!0),this.darkness=defaultValue(e.darkness,.3),this._darkness=this.darkness,this.maximumDistance=defaultValue(e.maximumDistance,5e3),this._outOfView=!1,this._outOfViewPrevious=!1;var i,r=this._needsUpdate=!0;(FeatureDetection$1.isInternetExplorer()||FeatureDetection$1.isEdge()||(FeatureDetection$1.isChrome()||FeatureDetection$1.isFirefox())&&FeatureDetection$1.isWindows()&&!t.depthTexture)&&(r=!1),this._polygonOffsetSupported=r,this._terrainBias={polygonOffset:r,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.5,normalShading:!0,normalShadingSmooth:.3,depthBias:1e-4},this._primitiveBias={polygonOffset:r,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.1,normalShading:!0,normalShadingSmooth:.05,depthBias:2e-5},this._pointBias={polygonOffset:!1,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:0,normalShading:!0,normalShadingSmooth:.1,depthBias:5e-4},this._depthAttachment=void 0,this._colorAttachment=void 0,this._shadowMapMatrix=new Matrix4,this._shadowMapTexture=void 0,this._lightDirectionEC=new Cartesian3,this._lightPositionEC=new Cartesian4,this._distance=0,this._lightCamera=e.lightCamera,this._shadowMapCamera=new ShadowMapCamera$4,this._shadowMapCullingVolume=void 0,this._sceneCamera=void 0,this._boundingSphere=new BoundingSphere,this._isPointLight=defaultValue(e.isPointLight,!1),this._pointLightRadius=defaultValue(e.pointLightRadius,100),this._cascadesEnabled=!this._isPointLight&&defaultValue(e.cascadesEnabled,!0),this._numberOfCascades=this._cascadesEnabled?defaultValue(e.numberOfCascades,4):0,this._fitNearFar=!0,this._maximumCascadeDistances=[25,150,700,Number.MAX_VALUE],this._textureSize=new Cartesian2,this._isSpotLight=!1,this._cascadesEnabled?this._shadowMapCamera.frustum=new OrthographicOffCenterFrustum:defined(this._lightCamera.frustum.fov)&&(this._isSpotLight=!0),this._cascadeSplits=[new Cartesian4,new Cartesian4],this._cascadeMatrices=[new Matrix4,new Matrix4,new Matrix4,new Matrix4],this._cascadeDistances=new Cartesian4,i=this._isPointLight?6:this._cascadesEnabled?this._numberOfCascades:1,this._passes=new Array(i);for(var n=0;n<i;++n)this._passes[n]=new ShadowPass$4(t);this.debugShow=!1,this.debugFreezeFrame=!1,this._debugFreezeFrame=!1,this._debugCascadeColors=!1,this._debugLightFrustum=void 0,this._debugCameraFrustum=void 0,this._debugCascadeFrustums=new Array(this._numberOfCascades),this._debugShadowViewCommand=void 0,this._usesDepthTexture=t.depthTexture,this._isPointLight&&(this._usesDepthTexture=!1),this._primitiveRenderState=void 0,this._terrainRenderState=void 0,this._pointRenderState=void 0,createRenderStates$a(this),this._clearCommand=new ClearCommand({depth:1,color:new Color}),this._clearPassState=new PassState(t),this._size=defaultValue(e.size,2048),this.size=this._size}function ShadowPass$4(e){this.camera=new ShadowMapCamera$4,this.passState=new PassState(e),this.framebuffer=void 0,this.textureOffsets=void 0,this.commandList=[],this.cullingVolume=void 0}function createRenderState$5(e,t){return RenderState.fromCache({cull:{enabled:!0,face:CullFace$1.BACK},depthTest:{enabled:!0},colorMask:{red:e,green:e,blue:e,alpha:e},depthMask:!0,polygonOffset:{enabled:t.polygonOffset,factor:t.polygonOffsetFactor,units:t.polygonOffsetUnits}})}function createRenderStates$a(e){var t=!e._usesDepthTexture;e._primitiveRenderState=createRenderState$5(t,e._primitiveBias),e._terrainRenderState=createRenderState$5(t,e._terrainBias),e._pointRenderState=createRenderState$5(t,e._pointBias)}function destroyFramebuffer$7(e){for(var t=e._passes.length,i=0;i<t;++i){var r=e._passes[i],n=r.framebuffer;defined(n)&&!n.isDestroyed()&&n.destroy(),r.framebuffer=void 0}e._depthAttachment=e._depthAttachment&&e._depthAttachment.destroy(),e._colorAttachment=e._colorAttachment&&e._colorAttachment.destroy()}function createFramebufferColor$2(e,t){for(var i=new Renderbuffer({context:t,width:e._textureSize.x,height:e._textureSize.y,format:RenderbufferFormat$1.DEPTH_COMPONENT16}),r=new Texture({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:PixelDatatype$1.UNSIGNED_BYTE,sampler:Sampler.NEAREST}),n=new Framebuffer({context:t,depthRenderbuffer:i,colorTextures:[r],destroyAttachments:!1}),a=e._passes.length,o=0;o<a;++o){var s=e._passes[o];s.framebuffer=n,s.passState.framebuffer=n}e._shadowMapTexture=r,e._depthAttachment=i,e._colorAttachment=r}function createFramebufferDepth$2(e,t){for(var i=new Texture({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:PixelFormat$1.DEPTH_STENCIL,pixelDatatype:PixelDatatype$1.UNSIGNED_INT_24_8,sampler:Sampler.NEAREST}),r=new Framebuffer({context:t,depthStencilTexture:i,destroyAttachments:!1}),n=e._passes.length,a=0;a<n;++a){var o=e._passes[a];o.framebuffer=r,o.passState.framebuffer=r}e._shadowMapTexture=i,e._depthAttachment=i}function createFramebufferCube$2(e,t){for(var i=new Renderbuffer({context:t,width:e._textureSize.x,height:e._textureSize.y,format:RenderbufferFormat$1.DEPTH_COMPONENT16}),r=new CubeMap({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:PixelDatatype$1.UNSIGNED_BYTE,sampler:Sampler.NEAREST}),n=[r.negativeX,r.negativeY,r.negativeZ,r.positiveX,r.positiveY,r.positiveZ],a=0;a<6;++a){var o=new Framebuffer({context:t,depthRenderbuffer:i,colorTextures:[n[a]],destroyAttachments:!1}),s=e._passes[a];s.framebuffer=o,s.passState.framebuffer=o}e._shadowMapTexture=r,e._depthAttachment=i,e._colorAttachment=r}function createFramebuffer$7(e,t){e._isPointLight?createFramebufferCube$2(e,t):e._usesDepthTexture?createFramebufferDepth$2(e,t):createFramebufferColor$2(e,t)}function checkFramebuffer$2(e,t){e._usesDepthTexture&&e._passes[0].framebuffer.status!==WebGLConstants$1.FRAMEBUFFER_COMPLETE&&(e._usesDepthTexture=!1,createRenderStates$a(e),destroyFramebuffer$7(e),createFramebuffer$7(e,t))}function updateFramebuffer$2(e,t){defined(e._passes[0].framebuffer)&&e._shadowMapTexture.width===e._textureSize.x||(destroyFramebuffer$7(e),createFramebuffer$7(e,t),checkFramebuffer$2(e,t),clearFramebuffer$4(e,t))}function clearFramebuffer$4(e,t,i){i=defaultValue(i,0),!e._isPointLight&&0!==i||(e._clearCommand.framebuffer=e._passes[i].framebuffer,e._clearCommand.execute(t,e._clearPassState))}function resize$4(e,t){e._size=t;var i=e._passes,r=i.length,n=e._textureSize;if(e._isPointLight){t=ContextLimits.maximumCubeMapSize>=t?t:ContextLimits.maximumCubeMapSize,n.x=t;var a=new BoundingRectangle(0,0,n.y=t,t);i[0].passState.viewport=a,i[1].passState.viewport=a,i[2].passState.viewport=a,i[3].passState.viewport=a,i[4].passState.viewport=a,i[5].passState.viewport=a}else 1===r?(t=ContextLimits.maximumTextureSize>=t?t:ContextLimits.maximumTextureSize,n.x=t,n.y=t,i[0].passState.viewport=new BoundingRectangle(0,0,t,t)):4===r&&(t=ContextLimits.maximumTextureSize>=2*t?t:ContextLimits.maximumTextureSize/2,n.x=2*t,n.y=2*t,i[0].passState.viewport=new BoundingRectangle(0,0,t,t),i[1].passState.viewport=new BoundingRectangle(t,0,t,t),i[2].passState.viewport=new BoundingRectangle(0,t,t,t),i[3].passState.viewport=new BoundingRectangle(t,t,t,t));e._clearPassState.viewport=new BoundingRectangle(0,0,n.x,n.y);for(var o=0;o<r;++o){var s=i[o],l=s.passState.viewport,u=l.x/n.x,c=l.y/n.y,d=l.width/n.x,h=l.height/n.y;s.textureOffsets=new Matrix4(d,0,0,u,0,h,0,c,0,0,1,0,0,0,0,1)}}PickFramebuffer.prototype.end=function(e){for(var t=defaultValue(e.width,1),i=defaultValue(e.height,1),r=this._context,n=r.readPixels({x:e.x,y:e.y,width:t,height:i,framebuffer:this._fb}),a=Math.max(t,i),o=a*a,s=Math.floor(.5*t),l=Math.floor(.5*i),u=0,c=0,d=0,h=-1,p=0;p<o;++p){if(-s<=u&&u<=s&&-l<=c&&c<=l){var f=4*((l-c)*t+u+s);colorScratch$7.red=Color.byteToFloat(n[f]),colorScratch$7.green=Color.byteToFloat(n[1+f]),colorScratch$7.blue=Color.byteToFloat(n[2+f]),colorScratch$7.alpha=Color.byteToFloat(n[3+f]);var m=r.getObjectByPickColor(colorScratch$7);if(defined(m))return m}if(u===c||u<0&&-u===c||0<u&&u===1-c){var g=d;d=-h,h=g}u+=d,c+=h}},PickFramebuffer.prototype.isDestroyed=function(){return!1},PickFramebuffer.prototype.destroy=function(){return this._fb=this._fb&&this._fb.destroy(),destroyObject(this)},SceneFramebuffer.prototype.update=function(e,t,i){var r=t.width,n=t.height,a=this._colorTexture;if(!defined(a)||a.width!==r||a.height!==n||i!==this._useHdr){destroyResources$2(this);var o=(this._useHdr=i)?e.halfFloatingPointTexture?PixelDatatype$1.HALF_FLOAT:PixelDatatype$1.FLOAT:PixelDatatype$1.UNSIGNED_BYTE;this._colorTexture=new Texture({context:e,width:r,height:n,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:o,sampler:Sampler.NEAREST}),this._idTexture=new Texture({context:e,width:r,height:n,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:PixelDatatype$1.UNSIGNED_BYTE,sampler:Sampler.NEAREST}),e.depthTexture?(this._depthStencilTexture=new Texture({context:e,width:r,height:n,pixelFormat:PixelFormat$1.DEPTH_STENCIL,pixelDatatype:PixelDatatype$1.UNSIGNED_INT_24_8,sampler:Sampler.NEAREST}),this._depthStencilIdTexture=new Texture({context:e,width:r,height:n,pixelFormat:PixelFormat$1.DEPTH_STENCIL,pixelDatatype:PixelDatatype$1.UNSIGNED_INT_24_8,sampler:Sampler.NEAREST})):(this._depthStencilRenderbuffer=new Renderbuffer({context:e,width:r,height:n,format:RenderbufferFormat$1.DEPTH_STENCIL}),this._depthStencilIdRenderbuffer=new Renderbuffer({context:e,width:r,height:n,format:RenderbufferFormat$1.DEPTH_STENCIL})),this._framebuffer=new Framebuffer({context:e,colorTextures:[this._colorTexture],depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1}),this._idFramebuffer=new Framebuffer({context:e,colorTextures:[this._idTexture],depthStencilTexture:this._depthStencilIdTexture,depthStencilRenderbuffer:this._depthStencilIdRenderbuffer,destroyAttachments:!1})}},SceneFramebuffer.prototype.clear=function(e,t,i){var r=t.framebuffer;t.framebuffer=this._framebuffer,Color.clone(i,this._clearCommand.color),this._clearCommand.execute(e,t),t.framebuffer=this._idFramebuffer,Color.clone(this._idClearColor,this._clearCommand.color),this._clearCommand.execute(e,t),t.framebuffer=r},SceneFramebuffer.prototype.getFramebuffer=function(){return this._framebuffer},SceneFramebuffer.prototype.getIdFramebuffer=function(){return this._idFramebuffer},SceneFramebuffer.prototype.isDestroyed=function(){return!1},SceneFramebuffer.prototype.destroy=function(){return destroyResources$2(this),destroyObject(this)},ShadowMapShader.getShadowCastShaderKeyword=function(e,t,i,r){return"castShadow "+e+" "+t+" "+i+" "+r},ShadowMapShader.createShadowCastVertexShader=function(e,t,i){var r=e.defines.slice(0),n=e.sources.slice(0);r.push("SHADOW_MAP"),i&&r.push("GENERATE_POSITION");var a=defined(ShaderSource.findPositionVarying(e));if(t&&!a){for(var o=n.length,s=0;s<o;++s)n[s]=ShaderSource.replaceMain(n[s],"czm_shadow_cast_main");n.push("varying vec3 v_positionEC; \nvoid main() \n{ \n czm_shadow_cast_main(); \n v_positionEC = (czm_inverseProjection * gl_Position).xyz; \n}")}return new ShaderSource({defines:r,sources:n})},ShadowMapShader.createShadowCastFragmentShader=function(e,t,i,r){var n=e.defines.slice(0),a=e.sources.slice(0),o=ShaderSource.findPositionVarying(e),s=defined(o);s||(o="v_positionEC");for(var l=a.length,u=0;u<l;++u)a[u]=ShaderSource.replaceMain(a[u],"czm_shadow_cast_main");var c="";return t&&(s||(c+="varying vec3 v_positionEC; \n"),c+="uniform vec4 shadowMap_lightPositionEC; \n"),c+=r?"void main() \n{ \n":"void main() \n{ \n czm_shadow_cast_main(); \n if (gl_FragColor.a == 0.0) \n { \n discard; \n } \n",c+=t?" float distance = length("+o+"); \n if (distance >= shadowMap_lightPositionEC.w) \n { \n discard; \n } \n distance /= shadowMap_lightPositionEC.w; // radius \n gl_FragColor = czm_packDepth(distance); \n":i?" gl_FragColor = vec4(1.0); \n":" gl_FragColor = czm_packDepth(gl_FragCoord.z); \n",c+="} \n",a.push(c),new ShaderSource({defines:n,sources:a})},ShadowMapShader.getShadowReceiveShaderKeyword=function(e,t,i,r){return"receiveShadow "+e._usesDepthTexture+e._polygonOffsetSupported+e._isPointLight+e._isSpotLight+(1<e._numberOfCascades)+e.debugCascadeColors+e.softShadows+t+i+r},ShadowMapShader.createShadowReceiveVertexShader=function(e,t,i){var r=e.defines.slice(0),n=e.sources.slice(0);return r.push("SHADOW_MAP"),t&&(i?r.push("GENERATE_POSITION_AND_NORMAL"):r.push("GENERATE_POSITION")),new ShaderSource({defines:r,sources:n})},ShadowMapShader.createShadowReceiveFragmentShader=function(e,t,i,r,n){for(var a=ShaderSource.findNormalVarying(e),o=!r&&defined(a)||r&&n,s=ShaderSource.findPositionVarying(e),l=defined(s),u=t._usesDepthTexture,c=t._polygonOffsetSupported,d=t._isPointLight,h=t._isSpotLight,p=1<t._numberOfCascades,f=t.debugCascadeColors,m=t.softShadows,g=d?t._pointBias:r?t._terrainBias:t._primitiveBias,y=e.defines.slice(0),v=e.sources.slice(0),_=v.length,C=0;C<_;++C)v[C]=ShaderSource.replaceMain(v[C],"czm_shadow_receive_main");d?y.push("USE_CUBE_MAP_SHADOW"):u&&y.push("USE_SHADOW_DEPTH_TEXTURE"),m&&!d&&y.push("USE_SOFT_SHADOWS"),p&&i&&r&&(o?y.push("ENABLE_VERTEX_LIGHTING"):y.push("ENABLE_DAYNIGHT_SHADING")),i&&g.normalShading&&o&&(y.push("USE_NORMAL_SHADING"),0<g.normalShadingSmooth&&y.push("USE_NORMAL_SHADING_SMOOTH"));var x="";return x+=d?"uniform samplerCube shadowMap_textureCube; \n":"uniform sampler2D shadowMap_texture; \n",x+="uniform mat4 shadowMap_matrix; \nuniform vec3 shadowMap_lightDirectionEC; \nuniform vec4 shadowMap_lightPositionEC; \nuniform vec4 shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness; \nuniform vec4 shadowMap_texelSizeDepthBiasAndNormalShadingSmooth; \n#ifdef LOG_DEPTH \nvarying vec3 v_logPositionEC; \n#endif \nvec4 getPositionEC() \n{ \n"+(l?" return vec4("+s+", 1.0); \n":"#ifndef LOG_DEPTH \n return czm_windowToEyeCoordinates(gl_FragCoord); \n#else \n return vec4(v_logPositionEC, 1.0); \n#endif \n")+"} \nvec3 getNormalEC() \n{ \n"+(o?" return normalize("+a+"); \n":" return vec3(1.0); \n")+"} \nvoid applyNormalOffset(inout vec4 positionEC, vec3 normalEC, float nDotL) \n{ \n"+(g.normalOffset&&o?" float normalOffset = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.x; \n float normalOffsetScale = 1.0 - nDotL; \n vec3 offset = normalOffset * normalOffsetScale * normalEC; \n positionEC.xyz += offset; \n":"")+"} \n",x+="void main() \n{ \n czm_shadow_receive_main(); \n vec4 positionEC = getPositionEC(); \n vec3 normalEC = getNormalEC(); \n float depth = -positionEC.z; \n",x+=" czm_shadowParameters shadowParameters; \n shadowParameters.texelStepSize = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.xy; \n shadowParameters.depthBias = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.z; \n shadowParameters.normalShadingSmooth = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.w; \n shadowParameters.darkness = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.w; \n",r?x+=" shadowParameters.depthBias *= max(depth * 0.01, 1.0); \n":c||(x+=" shadowParameters.depthBias *= mix(1.0, 100.0, depth * 0.0015); \n"),x+=d?" vec3 directionEC = positionEC.xyz - shadowMap_lightPositionEC.xyz; \n float distance = length(directionEC); \n directionEC = normalize(directionEC); \n float radius = shadowMap_lightPositionEC.w; \n // Stop early if the fragment is beyond the point light radius \n if (distance > radius) \n { \n return; \n } \n vec3 directionWC = czm_inverseViewRotation * directionEC; \n shadowParameters.depth = distance / radius; \n shadowParameters.nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0); \n shadowParameters.texCoords = directionWC; \n float visibility = czm_shadowVisibility(shadowMap_textureCube, shadowParameters); \n":h?" vec3 directionEC = normalize(positionEC.xyz - shadowMap_lightPositionEC.xyz); \n float nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0); \n applyNormalOffset(positionEC, normalEC, nDotL); \n vec4 shadowPosition = shadowMap_matrix * positionEC; \n // Spot light uses a perspective projection, so perform the perspective divide \n shadowPosition /= shadowPosition.w; \n // Stop early if the fragment is not in the shadow bounds \n if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0)))) \n { \n return; \n } \n shadowParameters.texCoords = shadowPosition.xy; \n shadowParameters.depth = shadowPosition.z; \n shadowParameters.nDotL = nDotL; \n float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); \n":p?" float maxDepth = shadowMap_cascadeSplits[1].w; \n // Stop early if the eye depth exceeds the last cascade \n if (depth > maxDepth) \n { \n return; \n } \n // Get the cascade based on the eye-space depth \n vec4 weights = czm_cascadeWeights(depth); \n // Apply normal offset \n float nDotL = clamp(dot(normalEC, shadowMap_lightDirectionEC), 0.0, 1.0); \n applyNormalOffset(positionEC, normalEC, nDotL); \n // Transform position into the cascade \n vec4 shadowPosition = czm_cascadeMatrix(weights) * positionEC; \n // Get visibility \n shadowParameters.texCoords = shadowPosition.xy; \n shadowParameters.depth = shadowPosition.z; \n shadowParameters.nDotL = nDotL; \n float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); \n // Fade out shadows that are far away \n float shadowMapMaximumDistance = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.z; \n float fade = max((depth - shadowMapMaximumDistance * 0.8) / (shadowMapMaximumDistance * 0.2), 0.0); \n visibility = mix(visibility, 1.0, fade); \n"+(f?" // Draw cascade colors for debugging \n gl_FragColor *= czm_cascadeColor(weights); \n":""):" float nDotL = clamp(dot(normalEC, shadowMap_lightDirectionEC), 0.0, 1.0); \n applyNormalOffset(positionEC, normalEC, nDotL); \n vec4 shadowPosition = shadowMap_matrix * positionEC; \n // Stop early if the fragment is not in the shadow bounds \n if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0)))) \n { \n return; \n } \n shadowParameters.texCoords = shadowPosition.xy; \n shadowParameters.depth = shadowPosition.z; \n shadowParameters.nDotL = nDotL; \n float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); \n",x+=" gl_FragColor.rgb *= visibility; \n} \n",v.push(x),new ShaderSource({defines:y,sources:v})},ShadowMap.MAXIMUM_DISTANCE=2e4,ShadowMap.prototype.debugCreateRenderStates=function(){createRenderStates$a(this)},Object.defineProperties(ShadowMap.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this.dirty=this._enabled!==e,this._enabled=e}},normalOffset:{get:function(){return this._normalOffset},set:function(e){this.dirty=this._normalOffset!==e,this._normalOffset=e,this._terrainBias.normalOffset=e,this._primitiveBias.normalOffset=e,this._pointBias.normalOffset=e}},softShadows:{get:function(){return this._softShadows},set:function(e){this.dirty=this._softShadows!==e,this._softShadows=e}},size:{get:function(){return this._size},set:function(e){resize$4(this,e)}},outOfView:{get:function(){return this._outOfView}},shadowMapCullingVolume:{get:function(){return this._shadowMapCullingVolume}},passes:{get:function(){return this._passes}},isPointLight:{get:function(){return this._isPointLight}},debugCascadeColors:{get:function(){return this._debugCascadeColors},set:function(e){this.dirty=this._debugCascadeColors!==e,this._debugCascadeColors=e}}});var scratchViewport$6=new BoundingRectangle;function createDebugShadowViewCommand$4(e,t){var i;i=e._isPointLight?"uniform samplerCube shadowMap_textureCube; \nvarying vec2 v_textureCoordinates; \nvoid main() \n{ \n vec2 uv = v_textureCoordinates; \n vec3 dir; \n \n if (uv.y < 0.5) \n { \n if (uv.x < 0.333) \n { \n dir.x = -1.0; \n dir.y = uv.x * 6.0 - 1.0; \n dir.z = uv.y * 4.0 - 1.0; \n } \n else if (uv.x < 0.666) \n { \n dir.y = -1.0; \n dir.x = uv.x * 6.0 - 3.0; \n dir.z = uv.y * 4.0 - 1.0; \n } \n else \n { \n dir.z = -1.0; \n dir.x = uv.x * 6.0 - 5.0; \n dir.y = uv.y * 4.0 - 1.0; \n } \n } \n else \n { \n if (uv.x < 0.333) \n { \n dir.x = 1.0; \n dir.y = uv.x * 6.0 - 1.0; \n dir.z = uv.y * 4.0 - 3.0; \n } \n else if (uv.x < 0.666) \n { \n dir.y = 1.0; \n dir.x = uv.x * 6.0 - 3.0; \n dir.z = uv.y * 4.0 - 3.0; \n } \n else \n { \n dir.z = 1.0; \n dir.x = uv.x * 6.0 - 5.0; \n dir.y = uv.y * 4.0 - 3.0; \n } \n } \n \n float shadow = czm_unpackDepth(textureCube(shadowMap_textureCube, dir)); \n gl_FragColor = vec4(vec3(shadow), 1.0); \n} \n":"uniform sampler2D shadowMap_texture; \nvarying vec2 v_textureCoordinates; \nvoid main() \n{ \n"+(e._usesDepthTexture?" float shadow = texture2D(shadowMap_texture, v_textureCoordinates).r; \n":" float shadow = czm_unpackDepth(texture2D(shadowMap_texture, v_textureCoordinates)); \n")+" gl_FragColor = vec4(vec3(shadow), 1.0); \n} \n";var r=t.createViewportQuadCommand(i,{uniformMap:{shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture}}});return r.pass=Pass$1.OVERLAY,r}function updateDebugShadowViewCommand$4(e,t){var i=t.context,r=t.context.drawingBufferWidth,n=t.context.drawingBufferHeight,a=.3*Math.min(r,n),o=scratchViewport$6;o.x=r-a,o.y=0,o.width=a,o.height=a;var s=e._debugShadowViewCommand;defined(s)||(s=createDebugShadowViewCommand$4(e,i),e._debugShadowViewCommand=s),defined(s.renderState)&&BoundingRectangle.equals(s.renderState.viewport,o)||(s.renderState=RenderState.fromCache({viewport:BoundingRectangle.clone(o)})),t.commandList.push(e._debugShadowViewCommand)}var frustumCornersNDC$5=new Array(8);frustumCornersNDC$5[0]=new Cartesian4(-1,-1,-1,1),frustumCornersNDC$5[1]=new Cartesian4(1,-1,-1,1),frustumCornersNDC$5[2]=new Cartesian4(1,1,-1,1),frustumCornersNDC$5[3]=new Cartesian4(-1,1,-1,1),frustumCornersNDC$5[4]=new Cartesian4(-1,-1,1,1),frustumCornersNDC$5[5]=new Cartesian4(1,-1,1,1),frustumCornersNDC$5[6]=new Cartesian4(1,1,1,1),frustumCornersNDC$5[7]=new Cartesian4(-1,1,1,1);for(var scratchMatrix$8=new Matrix4,scratchFrustumCorners$5=new Array(8),i$9=0;i$9<8;++i$9)scratchFrustumCorners$5[i$9]=new Cartesian4;function createDebugPointLight$4(e,t){return new Primitive({geometryInstances:[new GeometryInstance({geometry:new BoxOutlineGeometry({minimum:new Cartesian3(-.5,-.5,-.5),maximum:new Cartesian3(.5,.5,.5)}),attributes:{color:ColorGeometryInstanceAttribute.fromColor(t)}}),new GeometryInstance({geometry:new SphereOutlineGeometry({radius:.5}),attributes:{color:ColorGeometryInstanceAttribute.fromColor(t)}})],appearance:new PerInstanceColorAppearance({translucent:!1,flat:!0}),asynchronous:!1,modelMatrix:e})}var debugOutlineColors$4=[Color.RED,Color.GREEN,Color.BLUE,Color.MAGENTA],scratchScale$c=new Cartesian3;function applyDebugSettings$5(e,t){updateDebugShadowViewCommand$4(e,t);var i=e.debugFreezeFrame&&!e._debugFreezeFrame;if(e._debugFreezeFrame=e.debugFreezeFrame,e.debugFreezeFrame&&(i&&(e._debugCameraFrustum=e._debugCameraFrustum&&e._debugCameraFrustum.destroy(),e._debugCameraFrustum=new DebugCameraPrimitive({camera:e._sceneCamera,color:Color.CYAN,updateOnChange:!1})),e._debugCameraFrustum.update(t)),e._cascadesEnabled){if(e.debugFreezeFrame){i&&(e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=new DebugCameraPrimitive({camera:e._shadowMapCamera,color:Color.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t);for(var r=0;r<e._numberOfCascades;++r)i&&(e._debugCascadeFrustums[r]=e._debugCascadeFrustums[r]&&e._debugCascadeFrustums[r].destroy(),e._debugCascadeFrustums[r]=new DebugCameraPrimitive({camera:e._passes[r].camera,color:debugOutlineColors$4[r],updateOnChange:!1})),e._debugCascadeFrustums[r].update(t)}}else if(e._isPointLight){if(!defined(e._debugLightFrustum)||e._needsUpdate){var n=e._shadowMapCamera.positionWC,a=Quaternion.IDENTITY,o=2*e._pointLightRadius,s=Cartesian3.fromElements(o,o,o,scratchScale$c),l=Matrix4.fromTranslationQuaternionRotationScale(n,a,s,scratchMatrix$8);e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=createDebugPointLight$4(l,Color.YELLOW)}e._debugLightFrustum.update(t)}else defined(e._debugLightFrustum)&&!e._needsUpdate||(e._debugLightFrustum=new DebugCameraPrimitive({camera:e._shadowMapCamera,color:Color.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t)}function ShadowMapCamera$4(){this.viewMatrix=new Matrix4,this.inverseViewMatrix=new Matrix4,this.frustum=void 0,this.positionCartographic=new Cartographic,this.positionWC=new Cartesian3,this.directionWC=Cartesian3.clone(Cartesian3.UNIT_Z),this.upWC=Cartesian3.clone(Cartesian3.UNIT_Y),this.rightWC=Cartesian3.clone(Cartesian3.UNIT_X),this.viewProjectionMatrix=new Matrix4}ShadowMapCamera$4.prototype.clone=function(e){Matrix4.clone(e.viewMatrix,this.viewMatrix),Matrix4.clone(e.inverseViewMatrix,this.inverseViewMatrix),this.frustum=e.frustum.clone(this.frustum),Cartographic.clone(e.positionCartographic,this.positionCartographic),Cartesian3.clone(e.positionWC,this.positionWC),Cartesian3.clone(e.directionWC,this.directionWC),Cartesian3.clone(e.upWC,this.upWC),Cartesian3.clone(e.rightWC,this.rightWC)};var scaleBiasMatrix$4=new Matrix4(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);ShadowMapCamera$4.prototype.getViewProjection=function(){var e=this.viewMatrix,t=this.frustum.projectionMatrix;return Matrix4.multiply(t,e,this.viewProjectionMatrix),Matrix4.multiply(scaleBiasMatrix$4,this.viewProjectionMatrix,this.viewProjectionMatrix),this.viewProjectionMatrix};var scratchSplits$6=new Array(5),scratchFrustum$4=new PerspectiveFrustum,scratchCascadeDistances$4=new Array(4),scratchMin$7=new Cartesian3,scratchMax$7=new Cartesian3;function computeCascades$4(e,t){var i,r=e._shadowMapCamera,n=e._sceneCamera,a=n.frustum.near,o=n.frustum.far,s=e._numberOfCascades,l=o-a,u=o/a,c=.9,d=!1;t.shadowState.closestObjectSize<200&&(d=!0,c=.9);var h=scratchCascadeDistances$4,p=scratchSplits$6;for(p[0]=a,p[s]=o,i=0;i<s;++i){var f=(i+1)/s,m=a*Math.pow(u,f),g=a+l*f,y=CesiumMath.lerp(g,m,c);p[i+1]=y,h[i]=y-p[i]}if(d){for(i=0;i<s;++i)h[i]=Math.min(h[i],e._maximumCascadeDistances[i]);var v=p[0];for(i=0;i<s-1;++i)v+=h[i],p[i+1]=v}Cartesian4.unpack(p,0,e._cascadeSplits[0]),Cartesian4.unpack(p,1,e._cascadeSplits[1]),Cartesian4.unpack(h,0,e._cascadeDistances);var _=r.frustum,C=_.left,x=_.right,b=_.bottom,A=_.top,S=_.near,w=_.far,E=r.positionWC,T=r.directionWC,P=r.upWC,M=n.frustum.clone(scratchFrustum$4),D=r.getViewProjection();for(i=0;i<s;++i){M.near=p[i],M.far=p[i+1];for(var I=Matrix4.multiply(M.projectionMatrix,n.viewMatrix,scratchMatrix$8),O=Matrix4.inverse(I,scratchMatrix$8),R=Matrix4.multiply(D,O,scratchMatrix$8),L=Cartesian3.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,scratchMin$7),N=Cartesian3.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,scratchMax$7),k=0;k<8;++k){var B=Cartesian4.clone(frustumCornersNDC$5[k],scratchFrustumCorners$5[k]);Matrix4.multiplyByVector(R,B,B),Cartesian3.divideByScalar(B,B.w,B),Cartesian3.minimumByComponent(B,L,L),Cartesian3.maximumByComponent(B,N,N)}L.x=Math.max(L.x,0),L.y=Math.max(L.y,0),L.z=0,N.x=Math.min(N.x,1),N.y=Math.min(N.y,1),N.z=Math.min(N.z,1);var F=e._passes[i],V=F.camera;V.clone(r);var z=V.frustum;z.left=C+L.x*(x-C),z.right=C+N.x*(x-C),z.bottom=b+L.y*(A-b),z.top=b+N.y*(A-b),z.near=S+L.z*(w-S),z.far=S+N.z*(w-S),F.cullingVolume=V.frustum.computeCullingVolume(E,T,P);var U=e._cascadeMatrices[i];Matrix4.multiply(V.getViewProjection(),n.inverseViewMatrix,U),Matrix4.multiply(F.textureOffsets,U,U)}}var scratchLightView$4=new Matrix4,scratchRight$7=new Cartesian3,scratchUp$4=new Cartesian3,scratchTranslation$5=new Cartesian3;function fitShadowMapToScene$4(e,t){var i=e._shadowMapCamera,r=e._sceneCamera,n=Matrix4.multiply(r.frustum.projectionMatrix,r.viewMatrix,scratchMatrix$8),a=Matrix4.inverse(n,scratchMatrix$8),o=i.directionWC,s=r.directionWC;Cartesian3.equalsEpsilon(o,s,CesiumMath.EPSILON10)&&(s=r.upWC);var l=Cartesian3.cross(o,s,scratchRight$7);s=Cartesian3.cross(l,o,scratchUp$4),Cartesian3.normalize(s,s),Cartesian3.normalize(l,l);for(var u=Cartesian3.fromElements(0,0,0,scratchTranslation$5),c=Matrix4.computeView(u,o,s,l,scratchLightView$4),d=Matrix4.multiply(c,a,scratchMatrix$8),h=Cartesian3.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,scratchMin$7),p=Cartesian3.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,scratchMax$7),f=0;f<8;++f){var m=Cartesian4.clone(frustumCornersNDC$5[f],scratchFrustumCorners$5[f]);Matrix4.multiplyByVector(d,m,m),Cartesian3.divideByScalar(m,m.w,m),Cartesian3.minimumByComponent(m,h,h),Cartesian3.maximumByComponent(m,p,p)}p.z+=1e3,h.z-=10;var g=scratchTranslation$5;g.x=-.5*(h.x+p.x),g.y=-.5*(h.y+p.y),g.z=-p.z;var y=Matrix4.fromTranslation(g,scratchMatrix$8);c=Matrix4.multiply(y,c,c);var v=.5*(p.x-h.x),_=.5*(p.y-h.y),C=p.z-h.z,x=i.frustum;x.left=-v,x.right=v,x.bottom=-_,x.top=_,x.near=.01,x.far=C,Matrix4.clone(c,i.viewMatrix),Matrix4.inverse(c,i.inverseViewMatrix),Matrix4.getTranslation(i.inverseViewMatrix,i.positionWC),t.mapProjection.ellipsoid.cartesianToCartographic(i.positionWC,i.positionCartographic),Cartesian3.clone(o,i.directionWC),Cartesian3.clone(s,i.upWC),Cartesian3.clone(l,i.rightWC)}var directions$4=[new Cartesian3(-1,0,0),new Cartesian3(0,-1,0),new Cartesian3(0,0,-1),new Cartesian3(1,0,0),new Cartesian3(0,1,0),new Cartesian3(0,0,1)],ups$4=[new Cartesian3(0,-1,0),new Cartesian3(0,0,-1),new Cartesian3(0,-1,0),new Cartesian3(0,-1,0),new Cartesian3(0,0,1),new Cartesian3(0,-1,0)],rights$4=[new Cartesian3(0,0,1),new Cartesian3(1,0,0),new Cartesian3(-1,0,0),new Cartesian3(0,0,-1),new Cartesian3(1,0,0),new Cartesian3(1,0,0)];function computeOmnidirectional$4(e,t){var i=new PerspectiveFrustum;i.fov=CesiumMath.PI_OVER_TWO,i.near=1,i.far=e._pointLightRadius,i.aspectRatio=1;for(var r=0;r<6;++r){var n=e._passes[r].camera;n.positionWC=e._shadowMapCamera.positionWC,n.positionCartographic=t.mapProjection.ellipsoid.cartesianToCartographic(n.positionWC,n.positionCartographic),n.directionWC=directions$4[r],n.upWC=ups$4[r],n.rightWC=rights$4[r],Matrix4.computeView(n.positionWC,n.directionWC,n.upWC,n.rightWC,n.viewMatrix),Matrix4.inverse(n.viewMatrix,n.inverseViewMatrix),n.frustum=i}}var scratchCartesian1$c=new Cartesian3,scratchCartesian2$f=new Cartesian3,scratchBoundingSphere$9=new BoundingSphere,scratchCenter$9=scratchBoundingSphere$9.center;function checkVisibility$4(e,t){var i=e._sceneCamera,r=e._shadowMapCamera,n=scratchBoundingSphere$9;if(e._cascadesEnabled){if(i.frustum.near>=e.maximumDistance)return e._outOfView=!0,void(e._needsUpdate=!1);var a=t.mapProjection.ellipsoid.geodeticSurfaceNormal(i.positionWC,scratchCartesian1$c),o=Cartesian3.negate(r.directionWC,scratchCartesian2$f),s=Cartesian3.dot(a,o),l=CesiumMath.clamp(s/.1,0,1);if(e._darkness=CesiumMath.lerp(1,e.darkness,l),s<0)return e._outOfView=!0,void(e._needsUpdate=!1);e._needsUpdate=!0,e._outOfView=!1}else if(e._isPointLight)n.center=r.positionWC,n.radius=e._pointLightRadius,e._outOfView=t.cullingVolume.computeVisibility(n)===Intersect$1.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(n),BoundingSphere.clone(n,e._boundingSphere);else{var u=r.frustum.far/2,c=Cartesian3.add(r.positionWC,Cartesian3.multiplyByScalar(r.directionWC,u,scratchCenter$9),scratchCenter$9);n.center=c,n.radius=u,e._outOfView=t.cullingVolume.computeVisibility(n)===Intersect$1.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(n),BoundingSphere.clone(n,e._boundingSphere)}}function updateCameras$4(e,t){var i=t.camera,r=e._lightCamera,n=e._sceneCamera,a=e._shadowMapCamera;e._cascadesEnabled?Cartesian3.clone(r.directionWC,a.directionWC):e._isPointLight?Cartesian3.clone(r.positionWC,a.positionWC):a.clone(r);var o,s,l=e._lightDirectionEC;Matrix4.multiplyByPointAsVector(i.viewMatrix,a.directionWC,l),Cartesian3.normalize(l,l),Cartesian3.negate(l,l),Matrix4.multiplyByPoint(i.viewMatrix,a.positionWC,e._lightPositionEC),e._lightPositionEC.w=e._pointLightRadius,s=e._fitNearFar?(o=Math.min(t.shadowState.nearPlane,e.maximumDistance),Math.min(t.shadowState.farPlane,e.maximumDistance+1)):(o=i.frustum.near,e.maximumDistance),e._sceneCamera=Camera.clone(i,n),i.frustum.clone(e._sceneCamera.frustum),e._sceneCamera.frustum.near=o,e._sceneCamera.frustum.far=s,e._distance=s-o,checkVisibility$4(e,t),!e._outOfViewPrevious&&e._outOfView&&(e._needsUpdate=!0),e._outOfViewPrevious=e._outOfView}ShadowMap.prototype.update=function(e){if(updateCameras$4(this,e),this._needsUpdate)if(updateFramebuffer$2(this,e.context),this._isPointLight&&computeOmnidirectional$4(this,e),this._cascadesEnabled&&(fitShadowMapToScene$4(this,e),1<this._numberOfCascades&&computeCascades$4(this,e)),this._isPointLight)this._shadowMapCullingVolume=CullingVolume.fromBoundingSphere(this._boundingSphere);else{var t=this._shadowMapCamera,i=t.positionWC,r=t.directionWC,n=t.upWC;this._shadowMapCullingVolume=t.frustum.computeCullingVolume(i,r,n),1===this._passes.length&&this._passes[0].camera.clone(t)}if(1===this._passes.length){var a=this._sceneCamera.inverseViewMatrix;Matrix4.multiply(this._shadowMapCamera.getViewProjection(),a,this._shadowMapMatrix)}this.debugShow&&applyDebugSettings$5(this,e)},ShadowMap.prototype.updatePass=function(e,t){clearFramebuffer$4(this,e,t)};var scratchTexelStepSize$4=new Cartesian2;function combineUniforms$4(t,e,i){var r=t._isPointLight?t._pointBias:i?t._terrainBias:t._primitiveBias;return combine(e,{shadowMap_texture:function(){return t._shadowMapTexture},shadowMap_textureCube:function(){return t._shadowMapTexture},shadowMap_matrix:function(){return t._shadowMapMatrix},shadowMap_cascadeSplits:function(){return t._cascadeSplits},shadowMap_cascadeMatrices:function(){return t._cascadeMatrices},shadowMap_lightDirectionEC:function(){return t._lightDirectionEC},shadowMap_lightPositionEC:function(){return t._lightPositionEC},shadowMap_cascadeDistances:function(){return t._cascadeDistances},shadowMap_texelSizeDepthBiasAndNormalShadingSmooth:function(){var e=scratchTexelStepSize$4;return e.x=1/t._textureSize.x,e.y=1/t._textureSize.y,Cartesian4.fromElements(e.x,e.y,r.depthBias,r.normalShadingSmooth,this.combinedUniforms1)},shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness:function(){return Cartesian4.fromElements(r.normalOffsetScale,t._distance,t.maximumDistance,t._darkness,this.combinedUniforms2)},combinedUniforms1:new Cartesian4,combinedUniforms2:new Cartesian4},!1)}function createCastDerivedCommand$2(e,t,i,r,n,a){var o,s,l;if(defined(a)&&(o=a.shaderProgram,s=a.renderState,l=a.uniformMap),(a=DrawCommand.shallowClone(i,a)).castShadows=!0,a.receiveShadows=!1,!defined(o)||n!==i.shaderProgram.id||t){var u=i.shaderProgram,c=i.pass===Pass$1.GLOBE,d=i.pass!==Pass$1.TRANSLUCENT,h=e._isPointLight,p=e._usesDepthTexture,f=ShadowMapShader.getShadowCastShaderKeyword(h,c,p,d);if(!defined(o=r.shaderCache.getDerivedShaderProgram(u,f))){var m=u.vertexShaderSource,g=u.fragmentShaderSource,y=ShadowMapShader.createShadowCastVertexShader(m,h,c),v=ShadowMapShader.createShadowCastFragmentShader(g,h,p,d);o=r.shaderCache.createDerivedShaderProgram(u,f,{vertexShaderSource:y,fragmentShaderSource:v,attributeLocations:u._attributeLocations})}s=e._primitiveRenderState,h?s=e._pointRenderState:c&&(s=e._terrainRenderState),i.renderState.cull.enabled||((s=clone(s,!1)).cull=clone(s.cull,!1),s.cull.enabled=!1,s=RenderState.fromCache(s)),l=combineUniforms$4(e,i.uniformMap,c)}return a.shaderProgram=o,a.renderState=s,a.uniformMap=l,a}function View(e,t,i){var r,n,a=e.context,o=[],s=t.frustum.near,l=t.frustum.far,u=e.logarithmicDepthBuffer?e.logarithmicDepthFarToNearRatio:e.farToNearRatio;updateFrustums(s,l,u,Math.ceil(Math.log(l/s)/Math.log(u)),e.logarithmicDepthBuffer,o,!1,void 0),a.depthTexture&&(r=new GlobeDepth),e._useOIT&&a.depthTexture&&(n=new OIT(a));var c=new PassState(a);c.viewport=BoundingRectangle.clone(i),this.camera=t,this._cameraClone=Camera.clone(t),this._cameraStartFired=!1,this._cameraMovedTime=void 0,this.viewport=i,this.passState=c,this.pickFramebuffer=new PickFramebuffer(a),this.pickDepthFramebuffer=new PickDepthFramebuffer,this.sceneFramebuffer=new SceneFramebuffer,this.globeDepth=r,this.oit=n,this.pickDepths=[],this.debugGlobeDepths=[],this.frustumCommandsList=o,this.debugFrustumStatistics=void 0,this.updateFrustums=!1}ShadowMap.createReceiveDerivedCommand=function(e,t,i,r,n){defined(n)||(n={});var a=0<e.length,o=t.shaderProgram,s=o.vertexShaderSource,l=o.fragmentShaderSource,u=t.pass===Pass$1.GLOBE,c=!1;if(u&&(c=t.owner.data.renderedMesh.encoding.hasVertexNormals),t.receiveShadows&&a){var d,h;defined(n.receiveCommand)&&(d=n.receiveCommand.shaderProgram,h=n.receiveCommand.uniformMap),n.receiveCommand=DrawCommand.shallowClone(t,n.receiveCommand),n.castShadows=!1,n.receiveShadows=!0;var p=n.receiveShaderCastShadows!==t.castShadows,f=n.receiveShaderProgramId!==t.shaderProgram.id;if(!defined(d)||f||i||p){var m=ShadowMapShader.getShadowReceiveShaderKeyword(e[0],t.castShadows,u,c);if(!defined(d=r.shaderCache.getDerivedShaderProgram(o,m))){var g=ShadowMapShader.createShadowReceiveVertexShader(s,u,c),y=ShadowMapShader.createShadowReceiveFragmentShader(l,e[0],t.castShadows,u,c);d=r.shaderCache.createDerivedShaderProgram(o,m,{vertexShaderSource:g,fragmentShaderSource:y,attributeLocations:o._attributeLocations})}h=combineUniforms$4(e[0],t.uniformMap,u)}n.receiveCommand.shaderProgram=d,n.receiveCommand.uniformMap=h,n.receiveShaderProgramId=t.shaderProgram.id,n.receiveShaderCastShadows=t.castShadows}return n},ShadowMap.createCastDerivedCommand=function(e,t,i,r,n){if(defined(n)||(n={}),t.castShadows){var a=n.castCommands;defined(a)||(a=n.castCommands=[]);var o=n.castShaderProgramId,s=e.length;a.length=s;for(var l=0;l<s;++l)a[l]=createCastDerivedCommand$2(e[l],i,t,r,o,a[l]);n.castShaderProgramId=t.shaderProgram.id}return n},ShadowMap.prototype.isDestroyed=function(){return!1},ShadowMap.prototype.destroy=function(){destroyFramebuffer$7(this),this._debugLightFrustum=this._debugLightFrustum&&this._debugLightFrustum.destroy(),this._debugCameraFrustum=this._debugCameraFrustum&&this._debugCameraFrustum.destroy(),this._debugShadowViewCommand=this._debugShadowViewCommand&&this._debugShadowViewCommand.shaderProgram&&this._debugShadowViewCommand.shaderProgram.destroy();for(var e=0;e<this._numberOfCascades;++e)this._debugCascadeFrustums[e]=this._debugCascadeFrustums[e]&&this._debugCascadeFrustums[e].destroy();return destroyObject(this)};var scratchPosition0=new Cartesian3,scratchPosition1=new Cartesian3;function maxComponent(e,t){var i=Math.max(Math.abs(e.x),Math.abs(t.x)),r=Math.max(Math.abs(e.y),Math.abs(t.y)),n=Math.max(Math.abs(e.z),Math.abs(t.z));return Math.max(Math.max(i,r),n)}function cameraEqual(e,t,i){var r=1/Math.max(1,maxComponent(e.position,t.position));return Cartesian3.multiplyByScalar(e.position,r,scratchPosition0),Cartesian3.multiplyByScalar(t.position,r,scratchPosition1),Cartesian3.equalsEpsilon(scratchPosition0,scratchPosition1,i)&&Cartesian3.equalsEpsilon(e.direction,t.direction,i)&&Cartesian3.equalsEpsilon(e.up,t.up,i)&&Cartesian3.equalsEpsilon(e.right,t.right,i)&&Matrix4.equalsEpsilon(e.transform,t.transform,i)&&e.frustum.equalsEpsilon(t.frustum,i)}function updateFrustums(e,t,i,r,n,a,o,s){a.length=r;for(var l=0;l<r;++l){var u,c;o?(u=Math.min(t-s,e+l*s),c=Math.min(t,u+s)):(c=i*(u=Math.max(e,Math.pow(i,l)*e)),n||(c=Math.min(t,c)));var d=a[l];defined(d)?(d.near=u,d.far=c):d=a[l]=new FrustumCommands(u,c)}}function insertIntoBin(e,t,i,r){e.debugShowFrustums&&(i.debugOverlappingFrustums=0);for(var n=t.frustumCommandsList,a=n.length,o=0;o<a;++o){var s=n[o],l=s.near,u=s.far;if(!(r.start>u)){if(r.stop<l)break;var c=i.pass,d=s.indices[c]++;if(s.commands[c][d]=i,e.debugShowFrustums&&(i.debugOverlappingFrustums|=1<<o),i.executeInClosestFrustum)break}}if(e.debugShowFrustums){var h=t.debugFrustumStatistics.commandsInFrustums;h[i.debugOverlappingFrustums]=defined(h[i.debugOverlappingFrustums])?h[i.debugOverlappingFrustums]+1:1,++t.debugFrustumStatistics.totalCommands}e.updateDerivedCommands(i)}View.prototype.checkForCameraUpdates=function(e){var t=this.camera,i=this._cameraClone;return cameraEqual(t,i,CesiumMath.EPSILON15)?(this._cameraStartFired&&getTimestamp$1()-this._cameraMovedTime>e.cameraEventWaitTime&&(t.moveEnd.raiseEvent(),this._cameraStartFired=!1),!1):(this._cameraStartFired||(t.moveStart.raiseEvent(),this._cameraStartFired=!0),this._cameraMovedTime=getTimestamp$1(),Camera.clone(t,i),!0)};var scratchCullingVolume=new CullingVolume,distances=new Interval;View.prototype.createPotentiallyVisibleSet=function(e){var t=e.frameState,i=t.camera,r=i.directionWC,n=i.positionWC,a=e._computeCommandList,o=e._overlayCommandList,s=t.commandList;e.debugShowFrustums&&(this.debugFrustumStatistics={totalCommands:0,commandsInFrustums:{}});for(var l=this.frustumCommandsList,u=l.length,c=Pass$1.NUMBER_OF_PASSES,d=0;d<u;++d)for(var h=0;h<c;++h)l[d].indices[h]=0;a.length=0,o.length=0;for(var p=Number.MAX_VALUE,f=-Number.MAX_VALUE,m=!1,g=t.shadowState.shadowsEnabled,y=Number.MAX_VALUE,v=-Number.MAX_VALUE,_=Number.MAX_VALUE,C=t.mode===SceneMode$1.SCENE3D?t.occluder:void 0,x=t.cullingVolume,b=scratchCullingVolume.planes,A=0;A<5;++A)b[A]=x.planes[A];x=scratchCullingVolume;for(var S=s.length,w=0;w<S;++w){var E=s[w],T=E.pass;if(T===Pass$1.COMPUTE)a.push(E);else if(T===Pass$1.OVERLAY)o.push(E);else{var P=E.boundingVolume;if(defined(P)){if(!e.isVisible(E,x,C))continue;if(distances=P.computePlaneDistances(n,r,distances),p=Math.min(p,distances.start),f=Math.max(f,distances.stop),g&&E.receiveShadows&&distances.start<ShadowMap.MAXIMUM_DISTANCE&&!(T===Pass$1.GLOBE&&distances.start<-100&&100<distances.stop)){var M=distances.stop-distances.start;T!==Pass$1.GLOBE&&distances.start<100&&(_=Math.min(_,M)),y=Math.min(y,distances.start),v=Math.max(v,distances.stop)}}else distances.start=i.frustum.near,distances.stop=i.frustum.far,m=m||!(E instanceof ClearCommand);insertIntoBin(e,this,E,distances)}}m?(p=i.frustum.near,f=i.frustum.far):(p=Math.min(Math.max(p,i.frustum.near),i.frustum.far),f=Math.max(Math.min(f,i.frustum.far),p),g&&(y=Math.min(Math.max(y,i.frustum.near),i.frustum.far),v=Math.max(Math.min(v,i.frustum.far),y))),g&&(t.shadowState.nearPlane=y,t.shadowState.farPlane=v,t.shadowState.closestObjectSize=_);var D,I=e.mode===SceneMode$1.SCENE2D,O=t.useLogDepth,R=O?e.logarithmicDepthFarToNearRatio:e.farToNearRatio;D=I?(f=Math.min(f,i.position.z+e.nearToFarDistance2D),p=Math.min(p,f),Math.ceil(Math.max(1,f-p)/e.nearToFarDistance2D)):Math.ceil(Math.log(f/p)/Math.log(R)),(this.updateFrustums||p!==Number.MAX_VALUE&&(D!==u||0!==l.length&&(p<l[0].near||f>l[u-1].far&&(O||!CesiumMath.equalsEpsilon(f,l[u-1].far,CesiumMath.EPSILON8)))))&&(this.updateFrustums=!1,updateFrustums(p,f,R,D,O,l,I,e.nearToFarDistance2D),this.createPotentiallyVisibleSet(e));var L=t.frustumSplits;L.length=D+1;for(var N=0;N<D;++N)L[N]=l[N].near,N===D-1&&(L[N+1]=l[N].far)},View.prototype.destroy=function(){var e,t;this.pickFramebuffer=this.pickFramebuffer&&this.pickFramebuffer.destroy(),this.pickDepthFramebuffer=this.pickDepthFramebuffer&&this.pickDepthFramebuffer.destroy(),this.sceneFramebuffer=this.sceneFramebuffer&&this.sceneFramebuffer.destroy(),this.globeDepth=this.globeDepth&&this.globeDepth.destroy(),this.oit=this.oit&&this.oit.destroy();var i=this.pickDepths,r=this.debugGlobeDepths;for(t=i.length,e=0;e<t;++e)i[e].destroy();for(t=r.length,e=0;e<t;++e)r[e].destroy()};var offscreenDefaultWidth=.1,mostDetailedPreloadTilesetPassState=new Cesium3DTilePassState({pass:Cesium3DTilePass$1.MOST_DETAILED_PRELOAD}),mostDetailedPickTilesetPassState=new Cesium3DTilePassState({pass:Cesium3DTilePass$1.MOST_DETAILED_PICK}),pickTilesetPassState=new Cesium3DTilePassState({pass:Cesium3DTilePass$1.PICK});function Picking(e){this._mostDetailedRayPicks=[],this.pickRenderStateCache={},this._pickPositionCache={},this._pickPositionCacheDirty=!1;var t=new BoundingRectangle(0,0,1,1),i=new Camera(e);i.frustum=new OrthographicFrustum({width:offscreenDefaultWidth,aspectRatio:1,near:.1}),this._pickOffscreenView=new View(e,i,t)}Picking.prototype.update=function(){this._pickPositionCacheDirty=!0},Picking.prototype.getPickDepth=function(e,t){var i=e.view.pickDepths,r=i[t];return defined(r)||(r=new PickDepth,i[t]=r),r};var scratchOrthoPickingFrustum=new OrthographicOffCenterFrustum,scratchOrthoOrigin=new Cartesian3,scratchOrthoDirection=new Cartesian3,scratchOrthoPixelSize=new Cartesian2,scratchOrthoPickVolumeMatrix4=new Matrix4;function getPickOrthographicCullingVolume(e,t,i,r,n){var a=e.camera,o=a.frustum;defined(o._offCenterFrustum)&&(o=o._offCenterFrustum);var s=2*(t.x-n.x)/n.width-1;s*=.5*(o.right-o.left);var l=2*(n.height-t.y-n.y)/n.height-1;l*=.5*(o.top-o.bottom);var u=Matrix4.clone(a.transform,scratchOrthoPickVolumeMatrix4);a._setTransform(Matrix4.IDENTITY);var c=Cartesian3.clone(a.position,scratchOrthoOrigin);Cartesian3.multiplyByScalar(a.right,s,scratchOrthoDirection),Cartesian3.add(scratchOrthoDirection,c,c),Cartesian3.multiplyByScalar(a.up,l,scratchOrthoDirection),Cartesian3.add(scratchOrthoDirection,c,c),a._setTransform(u),e.mode===SceneMode$1.SCENE2D&&Cartesian3.fromElements(c.z,c.x,c.y,c);var d=o.getPixelDimensions(n.width,n.height,1,1,scratchOrthoPixelSize),h=scratchOrthoPickingFrustum;return h.right=.5*d.x,h.left=-h.right,h.top=.5*d.y,h.bottom=-h.top,h.near=o.near,h.far=o.far,h.computeCullingVolume(c,a.directionWC,a.upWC)}var scratchPerspPickingFrustum=new PerspectiveOffCenterFrustum,scratchPerspPixelSize=new Cartesian2;function getPickPerspectiveCullingVolume(e,t,i,r,n){var a=e.camera,o=a.frustum,s=o.near,l=Math.tan(.5*o.fovy),u=o.aspectRatio*l,c=(2*(t.x-n.x)/n.width-1)*s*u,d=(2*(n.height-t.y-n.y)/n.height-1)*s*l,h=o.getPixelDimensions(n.width,n.height,1,1,scratchPerspPixelSize),p=h.x*i*.5,f=h.y*r*.5,m=scratchPerspPickingFrustum;return m.top=d+f,m.bottom=d-f,m.right=c+p,m.left=c-p,m.near=s,m.far=o.far,m.computeCullingVolume(a.positionWC,a.directionWC,a.upWC)}function getPickCullingVolume(e,t,i,r,n){var a=e.camera.frustum;return a instanceof OrthographicFrustum||a instanceof OrthographicOffCenterFrustum?getPickOrthographicCullingVolume(e,t,i,r,n):getPickPerspectiveCullingVolume(e,t,i,r,n)}var scratchRectangleWidth=3,scratchRectangleHeight=3,scratchRectangle$7=new BoundingRectangle(0,0,scratchRectangleWidth,scratchRectangleHeight),scratchPosition$c=new Cartesian2,scratchColorZero=new Color(0,0,0,0);function renderTranslucentDepthForPick(e,t){var i=e.context,r=e.frameState,n=e.environmentState,a=e.defaultView,o=(e.view=a).viewport;o.x=0,o.y=0,o.width=i.drawingBufferWidth,o.height=i.drawingBufferHeight;var s=a.passState;s.viewport=BoundingRectangle.clone(o,s.viewport),e.clearPasses(r.passes),r.passes.pick=!0,r.passes.depth=!0,r.cullingVolume=getPickCullingVolume(e,t,1,1,o),r.tilesetPassState=pickTilesetPassState,e.updateEnvironment(),n.renderTranslucentDepthForPick=!0,s=a.pickDepthFramebuffer.update(i,t,o),e.updateAndExecuteCommands(s,scratchColorZero),e.resolveFramebuffers(s),i.endFrame()}Picking.prototype.pick=function(e,t,i,r){scratchRectangleWidth=defaultValue(i,3),scratchRectangleHeight=defaultValue(r,scratchRectangleWidth);var n=e.context,a=n.uniformState,o=e.frameState,s=e.defaultView,l=(e.view=s).viewport;l.x=0,l.y=0,l.width=n.drawingBufferWidth,l.height=n.drawingBufferHeight;var u=s.passState;u.viewport=BoundingRectangle.clone(l,u.viewport);var c=SceneTransforms.transformWindowToDrawingBuffer(e,t,scratchPosition$c);e.jobScheduler.disableThisFrame(),e.updateFrameState(),o.cullingVolume=getPickCullingVolume(e,c,scratchRectangleWidth,scratchRectangleHeight,l),o.invertClassification=!1,o.passes.pick=!0,o.tilesetPassState=pickTilesetPassState,a.update(o),e.updateEnvironment(),scratchRectangle$7.x=c.x-.5*(scratchRectangleWidth-1),scratchRectangle$7.y=e.drawingBufferHeight-c.y-.5*(scratchRectangleHeight-1),scratchRectangle$7.width=scratchRectangleWidth,scratchRectangle$7.height=scratchRectangleHeight,u=s.pickFramebuffer.begin(scratchRectangle$7,s.viewport),e.updateAndExecuteCommands(u,scratchColorZero),e.resolveFramebuffers(u);var d=s.pickFramebuffer.end(scratchRectangle$7);return n.endFrame(),d};var scratchPerspectiveFrustum=new PerspectiveFrustum,scratchPerspectiveOffCenterFrustum=new PerspectiveOffCenterFrustum,scratchOrthographicFrustum=new OrthographicFrustum,scratchOrthographicOffCenterFrustum=new OrthographicOffCenterFrustum;Picking.prototype.pickPositionWorldCoordinates=function(e,t,i){if(e.useDepthPicking){var r=t.toString();if(this._pickPositionCacheDirty)this._pickPositionCache={},this._pickPositionCacheDirty=!1;else if(this._pickPositionCache.hasOwnProperty(r))return Cartesian3.clone(this._pickPositionCache[r],i);var n=e.frameState,a=e.context,o=a.uniformState,s=e.defaultView;e.view=s;var l=SceneTransforms.transformWindowToDrawingBuffer(e,t,scratchPosition$c);e.pickTranslucentDepth?renderTranslucentDepthForPick(e,l):(e.updateFrameState(),o.update(n),e.updateEnvironment()),l.y=e.drawingBufferHeight-l.y;var u,c=e.camera;u=defined(c.frustum.fov)?c.frustum.clone(scratchPerspectiveFrustum):defined(c.frustum.infiniteProjectionMatrix)?c.frustum.clone(scratchPerspectiveOffCenterFrustum):defined(c.frustum.width)?c.frustum.clone(scratchOrthographicFrustum):c.frustum.clone(scratchOrthographicOffCenterFrustum);for(var d=s.frustumCommandsList,h=d.length,p=0;p<h;++p){var f=this.getPickDepth(e,p).getDepth(a,l.x,l.y);if(0<f&&f<1){var m,g=d[p];return e.mode===SceneMode$1.SCENE2D?(m=c.position.z,c.position.z=m-g.near+1,u.far=Math.max(1,g.far-g.near),u.near=1,o.update(n)):(u.near=g.near*(0!==p?e.opaqueFrustumNearOffset:1),u.far=g.far),o.updateFrustum(u),i=SceneTransforms.drawingBufferToWgs84Coordinates(e,l,f,i),e.mode===SceneMode$1.SCENE2D&&(c.position.z=m,o.update(n)),this._pickPositionCache[r]=Cartesian3.clone(i),i}}this._pickPositionCache[r]=void 0}};var scratchPickPositionCartographic=new Cartographic;function drillPick(e,t){var i,r,n=[],a=[],o=[],s=[];defined(e)||(e=Number.MAX_VALUE);for(var l=t();defined(l);){var u=l.object,c=l.position,d=l.exclude;if(defined(c)&&!defined(u)){n.push(l);break}if(!defined(u)||!defined(u.primitive))break;if(!d&&(n.push(l),--e<=0))break;var h=u.primitive,p=!1;"function"==typeof h.getGeometryInstanceAttributes&&defined(u.id)&&defined(r=h.getGeometryInstanceAttributes(u.id))&&defined(r.show)&&(p=!0,r.show=ShowGeometryInstanceAttribute.toValue(!1,r.show),o.push(r)),u instanceof Cesium3DTileFeature&&(p=!0,u.show=!1,s.push(u)),p||(h.show=!1,a.push(h)),l=t()}for(i=0;i<a.length;++i)a[i].show=!0;for(i=0;i<o.length;++i)(r=o[i]).show=ShowGeometryInstanceAttribute.toValue(!0,r.show);for(i=0;i<s.length;++i)s[i].show=!0;return n}Picking.prototype.pickPosition=function(e,t,i){if(defined(i=this.pickPositionWorldCoordinates(e,t,i))&&e.mode!==SceneMode$1.SCENE3D){Cartesian3.fromElements(i.y,i.z,i.x,i);var r=e.mapProjection,n=r.ellipsoid,a=r.unproject(i,scratchPickPositionCartographic);n.cartographicToCartesian(a,i)}return i},Picking.prototype.drillPick=function(t,i,e,r,n){var a=this;return drillPick(e,function(){var e=a.pick(t,i,r,n);if(defined(e))return{object:e,position:void 0,exclude:!1}}).map(function(e){return e.object})};var scratchRight$8=new Cartesian3,scratchUp$5=new Cartesian3;function MostDetailedRayPick(e,t,i){this.ray=e,this.width=t,this.tilesets=i,this.ready=!1,this.deferred=when.defer(),this.promise=this.deferred.promise}function updateOffscreenCameraFromRay(e,t,i,r){var n=t.direction,a=Cartesian3.mostOrthogonalAxis(n,scratchRight$8),o=Cartesian3.cross(n,a,scratchRight$8),s=Cartesian3.cross(n,o,scratchUp$5);return r.position=t.origin,r.direction=n,r.up=s,r.right=o,r.frustum.width=defaultValue(i,offscreenDefaultWidth),r.frustum.computeCullingVolume(r.positionWC,r.directionWC,r.upWC)}function updateMostDetailedRayPick(e,t,i){var r=t.frameState,n=i.ray,a=i.width,o=i.tilesets,s=e._pickOffscreenView.camera,l=updateOffscreenCameraFromRay(e,n,a,s),u=mostDetailedPreloadTilesetPassState;u.camera=s,u.cullingVolume=l;for(var c=!0,d=o.length,h=0;h<d;++h){var p=o[h];p.show&&t.primitives.contains(p)&&(p.updateForPass(r,u),c=c&&u.ready)}return c&&i.deferred.resolve(),c}function getTilesets(e,t,i){for(var r=e.length,n=0;n<r;++n){var a=e.get(n);a.show&&(defined(a.isCesium3DTileset)?defined(t)&&-1!==t.indexOf(a)||i.push(a):a instanceof PrimitiveCollection&&getTilesets(a,t,i))}}function launchMostDetailedRayPick(e,t,i,r,n,a){var o=[];if(getTilesets(t.primitives,r,o),0===o.length)return when.resolve(a());var s=new MostDetailedRayPick(i,n,o);return e._mostDetailedRayPicks.push(s),s.promise.then(function(){return a()})}function isExcluded(e,t){return!(!defined(e)||!defined(t)||0===t.length)&&(-1<t.indexOf(e)||-1<t.indexOf(e.primitive)||-1<t.indexOf(e.id))}function getRayIntersection(e,t,i,r,n,a,o){var s=t.context,l=s.uniformState,u=t.frameState,c=e._pickOffscreenView;updateOffscreenCameraFromRay(e,i,n,(t.view=c).camera),scratchRectangle$7=BoundingRectangle.clone(c.viewport,scratchRectangle$7);var d,h=c.pickFramebuffer.begin(scratchRectangle$7,c.viewport);t.jobScheduler.disableThisFrame(),t.updateFrameState(),u.invertClassification=!1,u.passes.pick=!0,u.passes.offscreen=!0,u.tilesetPassState=o?mostDetailedPickTilesetPassState:pickTilesetPassState,l.update(u),t.updateEnvironment(),t.updateAndExecuteCommands(h,scratchColorZero),t.resolveFramebuffers(h);var p=c.pickFramebuffer.end(s);if(t.context.depthTexture)for(var f=c.frustumCommandsList.length,m=0;m<f;++m){var g=e.getPickDepth(t,m).getDepth(s,0,0);if(0<g&&g<1){var y=c.frustumCommandsList[m],v=y.near*(0!==m?t.opaqueFrustumNearOffset:1),_=v+g*(y.far-v);d=Ray.getPoint(i,_);break}}if(t.view=t.defaultView,s.endFrame(),defined(p)||defined(d))return{object:p,position:d,exclude:!defined(d)&&a||isExcluded(p,r)}}function getRayIntersections(e,t,i,r,n,a,o,s){return drillPick(r,function(){return getRayIntersection(e,t,i,n,a,o,s)})}function pickFromRay(e,t,i,r,n,a,o){var s=getRayIntersections(e,t,i,1,r,n,a,o);if(0<s.length)return s[0]}function drillPickFromRay(e,t,i,r,n,a,o,s){return getRayIntersections(e,t,i,r,n,a,o,s)}function deferPromiseUntilPostRender(i,e){var r=when.defer();return e.then(function(e){var t=i.postRender.addEventListener(function(){r.resolve(e),t()});i.requestRender()}).otherwise(function(e){r.reject(e)}),r.promise}Picking.prototype.updateMostDetailedRayPicks=function(e){for(var t=this._mostDetailedRayPicks,i=0;i<t.length;++i)updateMostDetailedRayPick(this,e,t[i])&&t.splice(i--,1)},Picking.prototype.pickFromRay=function(e,t,i,r){return pickFromRay(this,e,t,i,r,!1,!1)},Picking.prototype.drillPickFromRay=function(e,t,i,r,n){return drillPickFromRay(this,e,t,i,r,n,!1,!1)},Picking.prototype.pickFromRayMostDetailed=function(e,t,i,r){var n=this;return t=Ray.clone(t),i=defined(i)?i.slice():i,deferPromiseUntilPostRender(e,launchMostDetailedRayPick(n,e,t,i,r,function(){return pickFromRay(n,e,t,i,r,!1,!0)}))},Picking.prototype.drillPickFromRayMostDetailed=function(e,t,i,r,n){var a=this;return t=Ray.clone(t),r=defined(r)?r.slice():r,deferPromiseUntilPostRender(e,launchMostDetailedRayPick(a,e,t,r,n,function(){return drillPickFromRay(a,e,t,i,r,n,!1,!0)}))};var scratchSurfacePosition=new Cartesian3,scratchSurfaceNormal=new Cartesian3,scratchSurfaceRay=new Ray,scratchCartographic$g=new Cartographic;function getRayForSampleHeight(e,t){var i=e.globe,r=defined(i)?i.ellipsoid:e.mapProjection.ellipsoid,n=ApproximateTerrainHeights._defaultMaxTerrainHeight,a=r.geodeticSurfaceNormalCartographic(t,scratchSurfaceNormal),o=Cartographic.toCartesian(t,r,scratchSurfacePosition),s=scratchSurfaceRay;s.origin=o,s.direction=a;var l=new Ray;return Ray.getPoint(s,n,l.origin),Cartesian3.negate(a,l.direction),l}function getRayForClampToHeight(e,t){var i=e.globe,r=defined(i)?i.ellipsoid:e.mapProjection.ellipsoid;return getRayForSampleHeight(e,Cartographic.fromCartesian(t,r,scratchCartographic$g))}function getHeightFromCartesian(e,t){var i=e.globe,r=defined(i)?i.ellipsoid:e.mapProjection.ellipsoid;return Cartographic.fromCartesian(t,r,scratchCartographic$g).height}function sampleHeightMostDetailed(t,i,e,r,n){var a=getRayForSampleHeight(i,e);return launchMostDetailedRayPick(t,i,a,r,n,function(){var e=pickFromRay(t,i,a,r,n,!0,!0);if(defined(e))return getHeightFromCartesian(i,e.position)})}function clampToHeightMostDetailed(t,i,e,r,n,a){var o=getRayForClampToHeight(i,e);return launchMostDetailedRayPick(t,i,o,r,n,function(){var e=pickFromRay(t,i,o,r,n,!0,!0);if(defined(e))return Cartesian3.clone(e.position,a)})}Picking.prototype.sampleHeight=function(e,t,i,r){var n=pickFromRay(this,e,getRayForSampleHeight(e,t),i,r,!0,!1);if(defined(n))return getHeightFromCartesian(e,n.position)},Picking.prototype.clampToHeight=function(e,t,i,r,n){var a=pickFromRay(this,e,getRayForClampToHeight(e,t),i,r,!0,!1);if(defined(a))return Cartesian3.clone(a.position,n)},Picking.prototype.sampleHeightMostDetailed=function(e,r,t,i){t=defined(t)?t.slice():t;for(var n=r.length,a=new Array(n),o=0;o<n;++o)a[o]=sampleHeightMostDetailed(this,e,r[o],t,i);return deferPromiseUntilPostRender(e,when.all(a).then(function(e){for(var t=e.length,i=0;i<t;++i)r[i].height=e[i];return r}))},Picking.prototype.clampToHeightMostDetailed=function(e,r,t,i){t=defined(t)?t.slice():t;for(var n=r.length,a=new Array(n),o=0;o<n;++o)a[o]=clampToHeightMostDetailed(this,e,r[o],t,i,r[o]);return deferPromiseUntilPostRender(e,when.all(a).then(function(e){for(var t=e.length,i=0;i<t;++i)r[i]=e[i];return r}))},Picking.prototype.destroy=function(){this._pickOffscreenView=this._pickOffscreenView&&this._pickOffscreenView.destroy()};var PostProcessStageSampleMode={NEAREST:0,LINEAR:1},SunVisibleVS="attribute vec2 direction;\nuniform float u_size;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nvec4 position;\nif (czm_morphTime == 1.0)\n{\nposition = vec4(czm_sunPositionWC, 1.0);\n}\nelse\n{\nposition = vec4(czm_sunPositionColumbusView.zxy, 1.0);\n}\nvec4 positionEC = czm_view * position;\nvec4 positionWC = czm_eyeToWindowCoordinates(positionEC);\nvec2 halfSize = vec2(u_size * 0.5);\nhalfSize *= ((direction * 2.0) - 1.0);\ngl_Position = czm_viewportOrthographic * vec4(positionWC.xy + halfSize, -positionWC.z, 1.0);\nv_textureCoordinates.x = (gl_Position.x + 1.0) / 2.0;\nv_textureCoordinates.y = (gl_Position.y + 1.0) / 2.0;\n}\n";function PostProcessStage(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).fragmentShader,i=defaultValue(e.textureScale,1),r=defaultValue(e.pixelFormat,PixelFormat$1.RGBA);this._fragmentShader=t,this._uniforms=e.uniforms,this._textureScale=i,this._forcePowerOfTwo=defaultValue(e.forcePowerOfTwo,!1),this._sampleMode=defaultValue(e.sampleMode,PostProcessStageSampleMode.NEAREST),this._pixelFormat=r,this._pixelDatatype=defaultValue(e.pixelDatatype,PixelDatatype$1.UNSIGNED_BYTE),this._clearColor=defaultValue(e.clearColor,Color.BLACK),this._uniformMap=void 0,this._command=void 0,this._colorTexture=void 0,this._depthTexture=void 0,this._idTexture=void 0,this._actualUniforms={},this._dirtyUniforms=[],this._texturesToRelease=[],this._texturesToCreate=[],this._texturePromise=void 0;var n=new PassState;n.scissorTest={enabled:!0,rectangle:defined(e.scissorRectangle)?BoundingRectangle.clone(e.scissorRectangle):new BoundingRectangle},this._passState=n,this._ready=!1;var a=e.name;defined(a)||(a=createGuid()),this._name=a,this._logDepthChanged=void 0,this._useLogDepth=void 0,this._selectedIdTexture=void 0,this._selected=void 0,this._selectedShadow=void 0,this._parentSelected=void 0,this._parentSelectedShadow=void 0,this._combinedSelected=void 0,this._combinedSelectedShadow=void 0,this._selectedLength=0,this._parentSelectedLength=0,this._selectedDirty=!0,this._textureCache=void 0,this._index=void 0,this.enabled=!0,this._enabled=!0,this._isShaft=defaultValue(e.isShaft,!1),this._sunUsize=210,this._sunBoundingVolume=new BoundingSphere,this._sunScissorRectangle=new BoundingRectangle}Object.defineProperties(PostProcessStage.prototype,{isShaft:{get:function(){return this._isShaft},set:function(e){this._isShaft=e}},ready:{get:function(){return this._ready}},name:{get:function(){return this._name}},fragmentShader:{get:function(){return this._fragmentShader}},uniforms:{get:function(){return this._uniforms}},textureScale:{get:function(){return this._textureScale}},forcePowerOfTwo:{get:function(){return this._forcePowerOfTwo}},sampleMode:{get:function(){return this._sampleMode}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},clearColor:{get:function(){return this._clearColor}},scissorRectangle:{get:function(){return this._passState.scissorTest.rectangle}},outputTexture:{get:function(){if(defined(this._textureCache)){var e=this._textureCache.getFramebuffer(this._name);if(defined(e))return e.getColorTexture(0)}}},selected:{get:function(){return this._selected},set:function(e){this._selected=e}},parentSelected:{get:function(){return this._parentSelected},set:function(e){this._parentSelected=e}}});var depthTextureRegex=/uniform\s+sampler2D\s+depthTexture/g;function getUniformValueGetterAndSetter(n,a,o){var e=a[o];return("string"==typeof e||e instanceof HTMLCanvasElement||e instanceof HTMLImageElement||e instanceof HTMLVideoElement||e instanceof ImageData)&&n._dirtyUniforms.push(o),{get:function(){return a[o]},set:function(e){var t=a[o];a[o]=e;var i=n._actualUniforms,r=i[o];defined(r)&&r!==t&&r instanceof Texture&&!defined(n._textureCache.getStageByName(o))&&(n._texturesToRelease.push(r),delete i[o],delete i[o+"Dimensions"]),t instanceof Texture&&n._texturesToRelease.push(t),"string"==typeof e||e instanceof HTMLCanvasElement||e instanceof HTMLImageElement||e instanceof HTMLVideoElement||e instanceof ImageData?n._dirtyUniforms.push(o):i[o]=e}}}function getUniformMapFunction(t,i){return function(){var e=t._actualUniforms[i];return"function"==typeof e?e():e}}function getUniformMapDimensionsFunction(t,i){return function(){var e=t[i]();if(defined(e))return e.dimensions}}function createUniformMap$5(e){if(!defined(e._uniformMap)){var t={},i={},r=e._uniforms,n=e._actualUniforms;for(var a in r)if(r.hasOwnProperty(a)){"function"!=typeof r[a]?(t[a]=getUniformMapFunction(e,a),i[a]=getUniformValueGetterAndSetter(e,r,a)):(t[a]=r[a],i[a]=r[a]),n[a]=r[a];var o=t[a]();("string"==typeof o||o instanceof Texture||o instanceof HTMLImageElement||o instanceof HTMLCanvasElement||o instanceof HTMLVideoElement)&&(t[a+"Dimensions"]=getUniformMapDimensionsFunction(t,a))}e._uniforms={},Object.defineProperties(e._uniforms,i),e._uniformMap=combine(t,{colorTexture:function(){return e._colorTexture},colorTextureDimensions:function(){return e._colorTexture.dimensions},depthTexture:function(){return e._depthTexture},depthTextureDimensions:function(){return e._depthTexture.dimensions},czm_idTexture:function(){return e._idTexture},czm_selectedIdTexture:function(){return e._selectedIdTexture},czm_selectedIdTextureStep:function(){return 1/e._selectedIdTexture.width}})}}function createDrawCommand(e,t){if(!defined(e._command)||e._logDepthChanged||e._selectedDirty){var i=e._fragmentShader;if(defined(e._selectedIdTexture))i="#define CZM_SELECTED_FEATURE \nuniform sampler2D czm_idTexture; \nuniform sampler2D czm_selectedIdTexture; \nuniform float czm_selectedIdTextureStep; \nvarying vec2 v_textureCoordinates; \nbool czm_selected(vec2 offset) \n{ \n bool selected = false;\n vec4 id = texture2D(czm_idTexture, v_textureCoordinates + offset); \n for (int i = 0; i < "+e._selectedIdTexture.width+"; ++i) \n { \n vec4 selectedId = texture2D(czm_selectedIdTexture, vec2((float(i) + 0.5) * czm_selectedIdTextureStep, 0.5)); \n if (all(equal(id, selectedId))) \n { \n return true; \n } \n } \n return false; \n} \n\nbool czm_selected() \n{ \n return czm_selected(vec2(0.0)); \n} \n\n"+(i=i.replace(/varying\s+vec2\s+v_textureCoordinates;/g,""));var r=new ShaderSource({defines:[e._useLogDepth?"LOG_DEPTH":""],sources:[i]});if(e._isShaft){if(defined(e._command)&&defined(e._command.vertexArray))return;var n=new Uint8Array(8);n[0]=0,n[1]=0,n[2]=255,n[3]=0,n[4]=255,n[5]=255,n[6]=0,n[7]=255;var a=new VertexArray({context:t,attributes:[{index:0,vertexBuffer:Buffer$1.createVertexBuffer({context:t,typedArray:n,usage:BufferUsage$1.STATIC_DRAW}),componentsPerAttribute:2,normalize:!0,componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE}],indexBuffer:Buffer$1.createIndexBuffer({context:t,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:BufferUsage$1.STATIC_DRAW,indexDatatype:IndexDatatype$1.UNSIGNED_SHORT})}),o=new Geometry({attributes:{position:new GeometryAttribute({componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE,componentsPerAttribute:2,values:[0,0,255,0,255,255,0,255]})},indices:new Uint16Array([0,1,2,0,2,3]),primitiveType:PrimitiveType$1.TRIANGLES}),s={direction:0},l=(VertexArray.fromGeometry({context:t,geometry:o,attributeLocations:s,bufferUsage:BufferUsage$1.STATIC_DRAW,interleave:!0}),RenderState.fromCache({blending:BlendingState$1.ALPHA_BLEND}));e._command=new DrawCommand({vertexArray:a,primitiveType:PrimitiveType$1.TRIANGLES,renderState:l,shaderProgram:ShaderProgram.fromCache({context:t,vertexShaderSource:SunVisibleVS,fragmentShaderSource:r,attributeLocations:s}),uniformMap:e._uniformMap,owner:e,framebuffer:e.framebuffer,boundingVolume:new BoundingSphere,pass:e.pass})}else e._command=t.createViewportQuadCommand(r,{uniformMap:e._uniformMap,owner:e})}}function createSampler$1(e){var t,i;i=e._sampleMode===PostProcessStageSampleMode.LINEAR?(t=TextureMinificationFilter$1.LINEAR,TextureMagnificationFilter$1.LINEAR):(t=TextureMinificationFilter$1.NEAREST,TextureMagnificationFilter$1.NEAREST);var r=e._sampler;defined(r)&&r.minificationFilter===t&&r.magnificationFilter===i||(e._sampler=new Sampler({wrapS:TextureWrap$1.CLAMP_TO_EDGE,wrapT:TextureWrap$1.CLAMP_TO_EDGE,minificationFilter:t,magnificationFilter:i}))}function createLoadImageFunction(t,i){return function(e){t._texturesToCreate.push({name:i,source:e})}}function createStageOutputTextureFunction(e,t){return function(){return e._textureCache.getOutputTexture(t)}}function updateUniformTextures(e,t){var i,r,n,a=e._texturesToRelease,o=a.length;for(i=0;i<o;++i)r=(r=a[i])&&r.destroy();a.length=0;var s=e._texturesToCreate;for(o=s.length,i=0;i<o;++i){var l=s[i];n=l.name;var u=l.source;e._actualUniforms[n]=new Texture({context:t,source:u})}s.length=0;var c=e._dirtyUniforms;if(0!==c.length||defined(e._texturePromise)){if(0!==c.length&&!defined(e._texturePromise)){o=c.length;var d=e._uniforms,h=[];for(i=0;i<o;++i){var p=d[n=c[i]];if(defined(e._textureCache.getStageByName(p)))e._actualUniforms[n]=createStageOutputTextureFunction(e,p);else if("string"==typeof p){var f=new Resource({url:p});h.push(f.fetchImage().then(createLoadImageFunction(e,n)))}else e._texturesToCreate.push({name:n,source:p})}(c.length=0)<h.length?(e._ready=!1,e._texturePromise=when.all(h).then(function(){e._ready=!0,e._texturePromise=void 0})):e._ready=!0}}else e._ready=!0}function releaseResources(e){defined(e._command)&&(e._command.shaderProgram=e._command.shaderProgram&&e._command.shaderProgram.destroy(),e._command=void 0),e._selectedIdTexture=e._selectedIdTexture&&e._selectedIdTexture.destroy();var t=e._textureCache;if(defined(t)){var i=e._uniforms,r=e._actualUniforms;for(var n in r)r.hasOwnProperty(n)&&r[n]instanceof Texture&&(defined(t.getStageByName(i[n]))||r[n].destroy(),e._dirtyUniforms.push(n))}}function isSelectedTextureDirty(e){var t=defined(e._selected)?e._selected.length:0,i=defined(e._parentSelected)?e._parentSelected:0,r=e._selected!==e._selectedShadow||t!==e._selectedLength;if(r=r||e._parentSelected!==e._parentSelectedShadow||i!==e._parentSelectedLength,defined(e._selected)&&defined(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):defined(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!r&&defined(e._combinedSelected)){if(!defined(e._combinedSelectedShadow))return!0;t=e._combinedSelected.length;for(var n=0;n<t;++n)if(e._combinedSelected[n]!==e._combinedSelectedShadow[n])return!0}return r}function createSelectedTexture(e,t){if(e._selectedDirty){e._selectedIdTexture=e._selectedIdTexture&&e._selectedIdTexture.destroy(),e._selectedIdTexture=void 0;var i=e._combinedSelected;if(defined(i)){var r,n,a,o=0,s=i.length;for(r=0;r<s;++r)defined((n=i[r]).pickIds)?o+=n.pickIds.length:defined(n.pickId)&&++o;if(0===s||0===o){var l=new Uint8Array(4);return l[0]=255,l[1]=255,l[2]=255,l[3]=255,void(e._selectedIdTexture=new Texture({context:t,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:PixelDatatype$1.UNSIGNED_BYTE,source:{arrayBufferView:l,width:1,height:1},sampler:Sampler.NEAREST}))}var u=0,c=new Uint8Array(4*o);for(r=0;r<s;++r)if(defined((n=i[r]).pickIds))for(var d=n.pickIds,h=d.length,p=0;p<h;++p)a=d[p].color,c[u]=Color.floatToByte(a.red),c[u+1]=Color.floatToByte(a.green),c[u+2]=Color.floatToByte(a.blue),c[u+3]=Color.floatToByte(a.alpha),u+=4;else defined(n.pickId)&&(a=n.pickId.color,c[u]=Color.floatToByte(a.red),c[u+1]=Color.floatToByte(a.green),c[u+2]=Color.floatToByte(a.blue),c[u+3]=Color.floatToByte(a.alpha),u+=4);e._selectedIdTexture=new Texture({context:t,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:PixelDatatype$1.UNSIGNED_BYTE,source:{arrayBufferView:c,width:o,height:1},sampler:Sampler.NEAREST})}}}PostProcessStage.prototype._isSupported=function(e){return!depthTextureRegex.test(this._fragmentShader)||e.depthTexture},PostProcessStage.prototype.update=function(e,t){if(this.enabled===this._enabled||this.enabled||releaseResources(this),this._enabled=this.enabled,this._enabled&&(this._logDepthChanged=t!==this._useLogDepth,this._useLogDepth=t,this._selectedDirty=isSelectedTextureDirty(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=defined(this._selected)?this._selected.length:0,this._parentSelectedLength=defined(this._parentSelected)?this._parentSelected.length:0,createSelectedTexture(this,e),createUniformMap$5(this),updateUniformTextures(this,e),createDrawCommand(this,e),createSampler$1(this),this._isShaft&&(BoundingSphere.clone(this._sunBoundingVolume,this._command.boundingVolume),BoundingRectangle.clone(this._sunScissorRectangle,this.scissorRectangle)),this._selectedDirty=!1,this._ready)){var i=this._textureCache.getFramebuffer(this._name);if(defined(this._command.framebuffer=i)){var r,n=i.getColorTexture(0);n.width===e.drawingBufferWidth&&n.height===e.drawingBufferHeight||defined(r=this._renderState)&&n.width===r.viewport.width&&n.height===r.viewport.height||(this._renderState=RenderState.fromCache({viewport:new BoundingRectangle(0,0,n.width,n.height)})),this._command.renderState=r}}},PostProcessStage.prototype.execute=function(e,t,i,r){if(defined(this._command)&&defined(this._command.framebuffer)&&this._ready&&this._enabled){this._colorTexture=t,this._depthTexture=i,this._idTexture=r,Sampler.equals(this._colorTexture.sampler,this._sampler)||(this._colorTexture.sampler=this._sampler);var n=0<this.scissorRectangle.width&&0<this.scissorRectangle.height?this._passState:void 0;defined(n)&&(n.context=e),this._command.execute(e,n)}},PostProcessStage.prototype.isDestroyed=function(){return!1},PostProcessStage.prototype.destroy=function(){return releaseResources(this),destroyObject(this)};var AcesTonemapping="uniform sampler2D colorTexture;\nvarying vec2 v_textureCoordinates;\n#ifdef AUTO_EXPOSURE\nuniform sampler2D autoExposure;\n#endif\nvoid main()\n{\nvec4 fragmentColor = texture2D(colorTexture, v_textureCoordinates);\nvec3 color = fragmentColor.rgb;\n#ifdef AUTO_EXPOSURE\ncolor /= texture2D(autoExposure, vec2(0.5)).r;\n#endif\ncolor = czm_acesTonemapping(color);\ncolor = czm_inverseGamma(color);\ngl_FragColor = vec4(color, fragmentColor.a);\n}\n",AmbientOcclusionGenerate="uniform sampler2D randomTexture;\nuniform sampler2D depthTexture;\nuniform float intensity;\nuniform float bias;\nuniform float lengthCap;\nuniform float stepSize;\nuniform float frustumLength;\nvarying vec2 v_textureCoordinates;\nvec4 clipToEye(vec2 uv, float depth)\n{\nvec2 xy = vec2((uv.x * 2.0 - 1.0), ((1.0 - uv.y) * 2.0 - 1.0));\nvec4 posEC = czm_inverseProjection * vec4(xy, depth, 1.0);\nposEC = posEC / posEC.w;\nreturn posEC;\n}\nvec3 getNormalXEdge(vec3 posInCamera, float depthU, float depthD, float depthL, float depthR, vec2 pixelSize)\n{\nvec4 posInCameraUp = clipToEye(v_textureCoordinates - vec2(0.0, pixelSize.y), depthU);\nvec4 posInCameraDown = clipToEye(v_textureCoordinates + vec2(0.0, pixelSize.y), depthD);\nvec4 posInCameraLeft = clipToEye(v_textureCoordinates - vec2(pixelSize.x, 0.0), depthL);\nvec4 posInCameraRight = clipToEye(v_textureCoordinates + vec2(pixelSize.x, 0.0), depthR);\nvec3 up = posInCamera.xyz - posInCameraUp.xyz;\nvec3 down = posInCameraDown.xyz - posInCamera.xyz;\nvec3 left = posInCamera.xyz - posInCameraLeft.xyz;\nvec3 right = posInCameraRight.xyz - posInCamera.xyz;\nvec3 DX = length(left) < length(right) ? left : right;\nvec3 DY = length(up) < length(down) ? up : down;\nreturn normalize(cross(DY, DX));\n}\nvoid main(void)\n{\nfloat depth = czm_readDepth(depthTexture, v_textureCoordinates);\nvec4 posInCamera = clipToEye(v_textureCoordinates, depth);\nif (posInCamera.z > frustumLength)\n{\ngl_FragColor = vec4(1.0);\nreturn;\n}\nvec2 pixelSize = czm_pixelRatio / czm_viewport.zw;\nfloat depthU = czm_readDepth(depthTexture, v_textureCoordinates - vec2(0.0, pixelSize.y));\nfloat depthD = czm_readDepth(depthTexture, v_textureCoordinates + vec2(0.0, pixelSize.y));\nfloat depthL = czm_readDepth(depthTexture, v_textureCoordinates - vec2(pixelSize.x, 0.0));\nfloat depthR = czm_readDepth(depthTexture, v_textureCoordinates + vec2(pixelSize.x, 0.0));\nvec3 normalInCamera = getNormalXEdge(posInCamera.xyz, depthU, depthD, depthL, depthR, pixelSize);\nfloat ao = 0.0;\nvec2 sampleDirection = vec2(1.0, 0.0);\nfloat gapAngle = 90.0 * czm_radiansPerDegree;\nfloat randomVal = texture2D(randomTexture, v_textureCoordinates).x;\nfor (int i = 0; i < 4; i++)\n{\nfloat newGapAngle = gapAngle * (float(i) + randomVal);\nfloat cosVal = cos(newGapAngle);\nfloat sinVal = sin(newGapAngle);\nvec2 rotatedSampleDirection = vec2(cosVal * sampleDirection.x - sinVal * sampleDirection.y, sinVal * sampleDirection.x + cosVal * sampleDirection.y);\nfloat localAO = 0.0;\nfloat localStepSize = stepSize;\nfor (int j = 0; j < 6; j++)\n{\nvec2 newCoords = v_textureCoordinates + rotatedSampleDirection * localStepSize * pixelSize;\nif(newCoords.x > 1.0 || newCoords.y > 1.0 || newCoords.x < 0.0 || newCoords.y < 0.0)\n{\nbreak;\n}\nfloat stepDepthInfo = czm_readDepth(depthTexture, newCoords);\nvec4 stepPosInCamera = clipToEye(newCoords, stepDepthInfo);\nvec3 diffVec = stepPosInCamera.xyz - posInCamera.xyz;\nfloat len = length(diffVec);\nif (len > lengthCap)\n{\nbreak;\n}\nfloat dotVal = clamp(dot(normalInCamera, normalize(diffVec)), 0.0, 1.0 );\nfloat weight = len / lengthCap;\nweight = 1.0 - weight * weight;\nif (dotVal < bias)\n{\ndotVal = 0.0;\n}\nlocalAO = max(localAO, dotVal * weight);\nlocalStepSize += stepSize;\n}\nao += localAO;\n}\nao /= 4.0;\nao = 1.0 - clamp(ao, 0.0, 1.0);\nao = pow(ao, intensity);\ngl_FragColor = vec4(vec3(ao), 1.0);\n}\n",AmbientOcclusionModulate="uniform sampler2D colorTexture;\nuniform sampler2D ambientOcclusionTexture;\nuniform bool ambientOcclusionOnly;\nvarying vec2 v_textureCoordinates;\nvoid main(void)\n{\nvec3 color = texture2D(colorTexture, v_textureCoordinates).rgb;\nvec3 ao = texture2D(ambientOcclusionTexture, v_textureCoordinates).rgb;\ngl_FragColor.rgb = ambientOcclusionOnly ? ao : ao * color;\n}\n",BlackAndWhite="uniform sampler2D colorTexture;\nuniform float gradations;\nvarying vec2 v_textureCoordinates;\nvoid main(void)\n{\nvec3 rgb = texture2D(colorTexture, v_textureCoordinates).rgb;\n#ifdef CZM_SELECTED_FEATURE\nif (czm_selected()) {\ngl_FragColor = vec4(rgb, 1.0);\nreturn;\n}\n#endif\nfloat luminance = czm_luminance(rgb);\nfloat darkness = luminance * gradations;\ndarkness = (darkness - fract(darkness)) / gradations;\ngl_FragColor = vec4(vec3(darkness), 1.0);\n}\n",BloomComposite="uniform sampler2D colorTexture;\nuniform sampler2D bloomTexture;\nuniform bool glowOnly;\nvarying vec2 v_textureCoordinates;\nvoid main(void)\n{\nvec4 color = texture2D(colorTexture, v_textureCoordinates);\n#ifdef CZM_SELECTED_FEATURE\nif (czm_selected()) {\ngl_FragColor = color;\nreturn;\n}\n#endif\nvec4 bloom = texture2D(bloomTexture, v_textureCoordinates);\ngl_FragColor = glowOnly ? bloom : bloom + color;\n}\n",Brightness="uniform sampler2D colorTexture;\nuniform float brightness;\nvarying vec2 v_textureCoordinates;\nvoid main(void)\n{\nvec3 rgb = texture2D(colorTexture, v_textureCoordinates).rgb;\nvec3 target = vec3(0.0);\ngl_FragColor = vec4(mix(target, rgb, brightness), 1.0);\n}\n",ContrastBias="uniform sampler2D colorTexture;\nuniform float contrast;\nuniform float brightness;\nvarying vec2 v_textureCoordinates;\nvoid main(void)\n{\nvec3 sceneColor = texture2D(colorTexture, v_textureCoordinates).xyz;\nsceneColor = czm_RGBToHSB(sceneColor);\nsceneColor.z += brightness;\nsceneColor = czm_HSBToRGB(sceneColor);\nfloat factor = (259.0 * (contrast + 255.0)) / (255.0 * (259.0 - contrast));\nsceneColor = factor * (sceneColor - vec3(0.5)) + vec3(0.5);\ngl_FragColor = vec4(sceneColor, 1.0);\n}\n",DepthOfField="uniform sampler2D colorTexture;\nuniform sampler2D blurTexture;\nuniform sampler2D depthTexture;\nuniform float focalDistance;\nvarying vec2 v_textureCoordinates;\nvec4 toEye(vec2 uv, float depth)\n{\nvec2 xy = vec2((uv.x * 2.0 - 1.0), ((1.0 - uv.y) * 2.0 - 1.0));\nvec4 posInCamera = czm_inverseProjection * vec4(xy, depth, 1.0);\nposInCamera = posInCamera / posInCamera.w;\nreturn posInCamera;\n}\nfloat computeDepthBlur(float depth)\n{\nfloat f;\nif (depth < focalDistance)\n{\nf = (focalDistance - depth) / (focalDistance - czm_currentFrustum.x);\n}\nelse\n{\nf = (depth - focalDistance) / (czm_currentFrustum.y - focalDistance);\nf = pow(f, 0.1);\n}\nf *= f;\nf = clamp(f, 0.0, 1.0);\nreturn pow(f, 0.5);\n}\nvoid main(void)\n{\nfloat depth = czm_readDepth(depthTexture, v_textureCoordinates);\nvec4 posInCamera = toEye(v_textureCoordinates, depth);\nfloat d = computeDepthBlur(-posInCamera.z);\ngl_FragColor = mix(texture2D(colorTexture, v_textureCoordinates), texture2D(blurTexture, v_textureCoordinates), d);\n}\n",DepthView="uniform sampler2D depthTexture;\nvarying vec2 v_textureCoordinates;\nvoid main(void)\n{\nfloat depth = czm_readDepth(depthTexture, v_textureCoordinates);\ngl_FragColor = vec4(vec3(depth), 1.0);\n}\n",EdgeDetection="uniform sampler2D depthTexture;\nuniform float length;\nuniform vec4 color;\nvarying vec2 v_textureCoordinates;\nvoid main(void)\n{\nfloat directions[3];\ndirections[0] = -1.0;\ndirections[1] = 0.0;\ndirections[2] = 1.0;\nfloat scalars[3];\nscalars[0] = 3.0;\nscalars[1] = 10.0;\nscalars[2] = 3.0;\nfloat padx = czm_pixelRatio / czm_viewport.z;\nfloat pady = czm_pixelRatio / czm_viewport.w;\n#ifdef CZM_SELECTED_FEATURE\nbool selected = false;\nfor (int i = 0; i < 3; ++i)\n{\nfloat dir = directions[i];\nselected = selected || czm_selected(vec2(-padx, dir * pady));\nselected = selected || czm_selected(vec2(padx, dir * pady));\nselected = selected || czm_selected(vec2(dir * padx, -pady));\nselected = selected || czm_selected(vec2(dir * padx, pady));\nif (selected)\n{\nbreak;\n}\n}\nif (!selected)\n{\ngl_FragColor = vec4(color.rgb, 0.0);\nreturn;\n}\n#endif\nfloat horizEdge = 0.0;\nfloat vertEdge = 0.0;\nfor (int i = 0; i < 3; ++i)\n{\nfloat dir = directions[i];\nfloat scale = scalars[i];\nhorizEdge -= texture2D(depthTexture, v_textureCoordinates + vec2(-padx, dir * pady)).x * scale;\nhorizEdge += texture2D(depthTexture, v_textureCoordinates + vec2(padx, dir * pady)).x * scale;\nvertEdge -= texture2D(depthTexture, v_textureCoordinates + vec2(dir * padx, -pady)).x * scale;\nvertEdge += texture2D(depthTexture, v_textureCoordinates + vec2(dir * padx, pady)).x * scale;\n}\nfloat len = sqrt(horizEdge * horizEdge + vertEdge * vertEdge);\ngl_FragColor = vec4(color.rgb, len > length ? color.a : 0.0);\n}\n",FilmicTonemapping="uniform sampler2D colorTexture;\nvarying vec2 v_textureCoordinates;\n#ifdef AUTO_EXPOSURE\nuniform sampler2D autoExposure;\n#endif\nvoid main()\n{\nvec4 fragmentColor = texture2D(colorTexture, v_textureCoordinates);\nvec3 color = fragmentColor.rgb;\n#ifdef AUTO_EXPOSURE\nfloat exposure = texture2D(autoExposure, vec2(0.5)).r;\ncolor /= exposure;\n#endif\nconst float A = 0.22;\nconst float B = 0.30;\nconst float C = 0.10;\nconst float D = 0.20;\nconst float E = 0.01;\nconst float F = 0.30;\nconst float white = 11.2;\nvec3 c = ((color * (A * color + C * B) + D * E) / (color * ( A * color + B) + D * F)) - E / F;\nfloat w = ((white * (A * white + C * B) + D * E) / (white * ( A * white + B) + D * F)) - E / F;\nc = czm_inverseGamma(c / w);\ngl_FragColor = vec4(c, fragmentColor.a);\n}\n",FXAA="varying vec2 v_textureCoordinates;\nuniform sampler2D colorTexture;\nconst float fxaaQualitySubpix = 0.5;\nconst float fxaaQualityEdgeThreshold = 0.125;\nconst float fxaaQualityEdgeThresholdMin = 0.0833;\nvoid main()\n{\nvec2 fxaaQualityRcpFrame = vec2(1.0) / czm_viewport.zw;\nvec4 color = FxaaPixelShader(\nv_textureCoordinates,\ncolorTexture,\nfxaaQualityRcpFrame,\nfxaaQualitySubpix,\nfxaaQualityEdgeThreshold,\nfxaaQualityEdgeThresholdMin);\nfloat alpha = texture2D(colorTexture, v_textureCoordinates).a;\ngl_FragColor = vec4(color.rgb, alpha);\n}\n",GaussianBlur1D="#define SAMPLES 8\nuniform float delta;\nuniform float sigma;\nuniform float direction;\nuniform sampler2D colorTexture;\n#ifdef USE_STEP_SIZE\nuniform float stepSize;\n#else\nuniform vec2 step;\n#endif\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nvec2 st = v_textureCoordinates;\nvec2 dir = vec2(1.0 - direction, direction);\n#ifdef USE_STEP_SIZE\nvec2 step = vec2(stepSize * (czm_pixelRatio / czm_viewport.zw));\n#else\nvec2 step = step;\n#endif\nvec3 g;\ng.x = 1.0 / (sqrt(czm_twoPi) * sigma);\ng.y = exp((-0.5 * delta * delta) / (sigma * sigma));\ng.z = g.y * g.y;\nvec4 result = texture2D(colorTexture, st) * g.x;\nfor (int i = 1; i < SAMPLES; ++i)\n{\ng.xy *= g.yz;\nvec2 offset = float(i) * dir * step;\nresult += texture2D(colorTexture, st - offset) * g.x;\nresult += texture2D(colorTexture, st + offset) * g.x;\n}\ngl_FragColor = result;\n}\n",LensFlare="uniform sampler2D colorTexture;\nuniform sampler2D dirtTexture;\nuniform sampler2D starTexture;\nuniform vec2 dirtTextureDimensions;\nuniform float distortion;\nuniform float ghostDispersal;\nuniform float haloWidth;\nuniform float dirtAmount;\nuniform float earthRadius;\nuniform float intensity;\nvarying vec2 v_textureCoordinates;\n#define DISTANCE_TO_SPACE 6500000.0\nvec4 getNDCFromWC(vec3 WC, float earthRadius)\n{\nvec4 positionEC = czm_view * vec4(WC, 1.0);\npositionEC = vec4(positionEC.x + earthRadius, positionEC.y, positionEC.z, 1.0);\nvec4 positionWC = czm_eyeToWindowCoordinates(positionEC);\nreturn czm_viewportOrthographic * vec4(positionWC.xy, -positionWC.z, 1.0);\n}\nfloat isInEarth(vec2 texcoord, vec2 sceneSize)\n{\nvec2 NDC = texcoord * 2.0 - 1.0;\nvec4 earthPosSC = getNDCFromWC(vec3(0.0), 0.0);\nvec4 earthPosSCEdge = getNDCFromWC(vec3(0.0), earthRadius * 1.5);\nNDC.xy -= earthPosSC.xy;\nfloat X = abs(NDC.x) * sceneSize.x;\nfloat Y = abs(NDC.y) * sceneSize.y;\nreturn clamp(0.0, 1.0, max(sqrt(X * X + Y * Y) / max(abs(earthPosSCEdge.x * sceneSize.x), 1.0) - 0.8 , 0.0));\n}\nvec4 textureDistorted(sampler2D tex, vec2 texcoord, vec2 direction, vec3 distortion, bool isSpace)\n{\nvec2 sceneSize = czm_viewport.zw;\nvec3 color;\nif(isSpace)\n{\ncolor.r = isInEarth(texcoord + direction * distortion.r, sceneSize) * texture2D(tex, texcoord + direction * distortion.r).r;\ncolor.g = isInEarth(texcoord + direction * distortion.g, sceneSize) * texture2D(tex, texcoord + direction * distortion.g).g;\ncolor.b = isInEarth(texcoord + direction * distortion.b, sceneSize) * texture2D(tex, texcoord + direction * distortion.b).b;\n}\nelse\n{\ncolor.r = texture2D(tex, texcoord + direction * distortion.r).r;\ncolor.g = texture2D(tex, texcoord + direction * distortion.g).g;\ncolor.b = texture2D(tex, texcoord + direction * distortion.b).b;\n}\nreturn vec4(clamp(color, 0.0, 1.0), 0.0);\n}\nvoid main(void)\n{\nvec4 originalColor = texture2D(colorTexture, v_textureCoordinates);\nvec3 rgb = originalColor.rgb;\nbool isSpace = length(czm_viewerPositionWC.xyz) > DISTANCE_TO_SPACE;\nvec4 sunPos = czm_morphTime == 1.0 ? vec4(czm_sunPositionWC, 1.0) : vec4(czm_sunPositionColumbusView.zxy, 1.0);\nvec4 sunPositionEC = czm_view * sunPos;\nvec4 sunPositionWC = czm_eyeToWindowCoordinates(sunPositionEC);\nsunPos = czm_viewportOrthographic * vec4(sunPositionWC.xy, -sunPositionWC.z, 1.0);\nif(!isSpace || !((sunPos.x >= -1.1 && sunPos.x <= 1.1) && (sunPos.y >= -1.1 && sunPos.y <= 1.1)))\n{\ngl_FragColor = originalColor;\nreturn;\n}\nvec2 texcoord = vec2(1.0) - v_textureCoordinates;\nvec2 pixelSize = czm_pixelRatio / czm_viewport.zw;\nvec2 invPixelSize = 1.0 / pixelSize;\nvec3 distortionVec = pixelSize.x * vec3(-distortion, 0.0, distortion);\nvec2 ghostVec = (vec2(0.5) - texcoord) * ghostDispersal;\nvec3 direction = normalize(vec3(ghostVec, 0.0));\nvec4 result = vec4(0.0);\nvec4 ghost = vec4(0.0);\nfor (int i = 0; i < 4; ++i)\n{\nvec2 offset = fract(texcoord + ghostVec * float(i));\nghost += textureDistorted(colorTexture, offset, direction.xy, distortionVec, isSpace);\n}\nresult += ghost;\nvec2 haloVec = normalize(ghostVec) * haloWidth;\nfloat weightForHalo = length(vec2(0.5) - fract(texcoord + haloVec)) / length(vec2(0.5));\nweightForHalo = pow(1.0 - weightForHalo, 5.0);\nresult += textureDistorted(colorTexture, texcoord + haloVec, direction.xy, distortionVec, isSpace) * weightForHalo * 1.5;\nvec2 dirtTexCoords = (v_textureCoordinates * invPixelSize) / dirtTextureDimensions;\nif (dirtTexCoords.x > 1.0)\n{\ndirtTexCoords.x = mod(floor(dirtTexCoords.x), 2.0) == 1.0 ? 1.0 - fract(dirtTexCoords.x) : fract(dirtTexCoords.x);\n}\nif (dirtTexCoords.y > 1.0)\n{\ndirtTexCoords.y = mod(floor(dirtTexCoords.y), 2.0) == 1.0 ? 1.0 - fract(dirtTexCoords.y) : fract(dirtTexCoords.y);\n}\nresult += dirtAmount * texture2D(dirtTexture, dirtTexCoords);\nfloat camrot = czm_view[0].z + czm_view[1].y;\nfloat cosValue = cos(camrot);\nfloat sinValue = sin(camrot);\nmat3 rotation = mat3(\ncosValue, -sinValue, 0.0,\nsinValue, cosValue, 0.0,\n0.0, 0.0, 1.0\n);\nvec3 st1 = vec3(v_textureCoordinates * 2.0 - vec2(1.0), 1.0);\nvec3 st2 = vec3((rotation * st1).xy, 1.0);\nvec3 st3 = st2 * 0.5 + vec3(0.5);\nvec2 lensStarTexcoord = st3.xy;\nfloat weightForLensFlare = length(vec3(sunPos.xy, 0.0));\nfloat oneMinusWeightForLensFlare = max(1.0 - weightForLensFlare, 0.0);\nif (!isSpace)\n{\nresult *= oneMinusWeightForLensFlare * intensity * 0.2;\n}\nelse\n{\nresult *= oneMinusWeightForLensFlare * intensity;\nresult *= texture2D(starTexture, lensStarTexcoord) * pow(weightForLensFlare, 1.0) * max((1.0 - length(vec3(st1.xy, 0.0))), 0.0) * 2.0;\n}\nresult += texture2D(colorTexture, v_textureCoordinates);\ngl_FragColor = result;\n}\n",ModifiedReinhardTonemapping="uniform sampler2D colorTexture;\nuniform vec3 white;\nvarying vec2 v_textureCoordinates;\n#ifdef AUTO_EXPOSURE\nuniform sampler2D autoExposure;\n#endif\nvoid main()\n{\nvec4 fragmentColor = texture2D(colorTexture, v_textureCoordinates);\nvec3 color = fragmentColor.rgb;\n#ifdef AUTO_EXPOSURE\nfloat exposure = texture2D(autoExposure, vec2(0.5)).r;\ncolor /= exposure;\n#endif\ncolor = (color * (1.0 + color / white)) / (1.0 + color);\ncolor = czm_inverseGamma(color);\ngl_FragColor = vec4(color, fragmentColor.a);\n}\n",NightVision="uniform sampler2D colorTexture;\nvarying vec2 v_textureCoordinates;\nfloat rand(vec2 co)\n{\nreturn fract(sin(dot(co.xy ,vec2(12.9898, 78.233))) * 43758.5453);\n}\nvoid main(void)\n{\nfloat noiseValue = rand(v_textureCoordinates + sin(czm_frameNumber)) * 0.1;\nvec3 rgb = texture2D(colorTexture, v_textureCoordinates).rgb;\nvec3 green = vec3(0.0, 1.0, 0.0);\ngl_FragColor = vec4((noiseValue + rgb) * green, 1.0);\n}\n",ReinhardTonemapping="uniform sampler2D colorTexture;\nvarying vec2 v_textureCoordinates;\n#ifdef AUTO_EXPOSURE\nuniform sampler2D autoExposure;\n#endif\nvoid main()\n{\nvec4 fragmentColor = texture2D(colorTexture, v_textureCoordinates);\nvec3 color = fragmentColor.rgb;\n#ifdef AUTO_EXPOSURE\nfloat exposure = texture2D(autoExposure, vec2(0.5)).r;\ncolor /= exposure;\n#endif\ncolor = color / (1.0 + color);\ncolor = czm_inverseGamma(color);\ngl_FragColor = vec4(color, fragmentColor.a);\n}\n",Silhouette="uniform sampler2D colorTexture;\nuniform sampler2D silhouetteTexture;\nvarying vec2 v_textureCoordinates;\nvoid main(void)\n{\nvec4 silhouetteColor = texture2D(silhouetteTexture, v_textureCoordinates);\nvec4 color = texture2D(colorTexture, v_textureCoordinates);\ngl_FragColor = mix(color, silhouetteColor, silhouetteColor.a);\n}\n",FXAA3_11="#if (FXAA_QUALITY_PRESET == 10)\n#define FXAA_QUALITY_PS 3\n#define FXAA_QUALITY_P0 1.5\n#define FXAA_QUALITY_P1 3.0\n#define FXAA_QUALITY_P2 12.0\n#endif\n#if (FXAA_QUALITY_PRESET == 11)\n#define FXAA_QUALITY_PS 4\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 3.0\n#define FXAA_QUALITY_P3 12.0\n#endif\n#if (FXAA_QUALITY_PRESET == 12)\n#define FXAA_QUALITY_PS 5\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 4.0\n#define FXAA_QUALITY_P4 12.0\n#endif\n#if (FXAA_QUALITY_PRESET == 13)\n#define FXAA_QUALITY_PS 6\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 2.0\n#define FXAA_QUALITY_P4 4.0\n#define FXAA_QUALITY_P5 12.0\n#endif\n#if (FXAA_QUALITY_PRESET == 14)\n#define FXAA_QUALITY_PS 7\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 2.0\n#define FXAA_QUALITY_P4 2.0\n#define FXAA_QUALITY_P5 4.0\n#define FXAA_QUALITY_P6 12.0\n#endif\n#if (FXAA_QUALITY_PRESET == 15)\n#define FXAA_QUALITY_PS 8\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 2.0\n#define FXAA_QUALITY_P4 2.0\n#define FXAA_QUALITY_P5 2.0\n#define FXAA_QUALITY_P6 4.0\n#define FXAA_QUALITY_P7 12.0\n#endif\n#if (FXAA_QUALITY_PRESET == 20)\n#define FXAA_QUALITY_PS 3\n#define FXAA_QUALITY_P0 1.5\n#define FXAA_QUALITY_P1 2.0\n#define FXAA_QUALITY_P2 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 21)\n#define FXAA_QUALITY_PS 4\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 22)\n#define FXAA_QUALITY_PS 5\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 2.0\n#define FXAA_QUALITY_P4 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 23)\n#define FXAA_QUALITY_PS 6\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 2.0\n#define FXAA_QUALITY_P4 2.0\n#define FXAA_QUALITY_P5 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 24)\n#define FXAA_QUALITY_PS 7\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 2.0\n#define FXAA_QUALITY_P4 2.0\n#define FXAA_QUALITY_P5 3.0\n#define FXAA_QUALITY_P6 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 25)\n#define FXAA_QUALITY_PS 8\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 2.0\n#define FXAA_QUALITY_P4 2.0\n#define FXAA_QUALITY_P5 2.0\n#define FXAA_QUALITY_P6 4.0\n#define FXAA_QUALITY_P7 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 26)\n#define FXAA_QUALITY_PS 9\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 2.0\n#define FXAA_QUALITY_P4 2.0\n#define FXAA_QUALITY_P5 2.0\n#define FXAA_QUALITY_P6 2.0\n#define FXAA_QUALITY_P7 4.0\n#define FXAA_QUALITY_P8 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 27)\n#define FXAA_QUALITY_PS 10\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 2.0\n#define FXAA_QUALITY_P4 2.0\n#define FXAA_QUALITY_P5 2.0\n#define FXAA_QUALITY_P6 2.0\n#define FXAA_QUALITY_P7 2.0\n#define FXAA_QUALITY_P8 4.0\n#define FXAA_QUALITY_P9 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 28)\n#define FXAA_QUALITY_PS 11\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 2.0\n#define FXAA_QUALITY_P4 2.0\n#define FXAA_QUALITY_P5 2.0\n#define FXAA_QUALITY_P6 2.0\n#define FXAA_QUALITY_P7 2.0\n#define FXAA_QUALITY_P8 2.0\n#define FXAA_QUALITY_P9 4.0\n#define FXAA_QUALITY_P10 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 29)\n#define FXAA_QUALITY_PS 12\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 2.0\n#define FXAA_QUALITY_P4 2.0\n#define FXAA_QUALITY_P5 2.0\n#define FXAA_QUALITY_P6 2.0\n#define FXAA_QUALITY_P7 2.0\n#define FXAA_QUALITY_P8 2.0\n#define FXAA_QUALITY_P9 2.0\n#define FXAA_QUALITY_P10 4.0\n#define FXAA_QUALITY_P11 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 39)\n#define FXAA_QUALITY_PS 12\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.0\n#define FXAA_QUALITY_P2 1.0\n#define FXAA_QUALITY_P3 1.0\n#define FXAA_QUALITY_P4 1.0\n#define FXAA_QUALITY_P5 1.5\n#define FXAA_QUALITY_P6 2.0\n#define FXAA_QUALITY_P7 2.0\n#define FXAA_QUALITY_P8 2.0\n#define FXAA_QUALITY_P9 2.0\n#define FXAA_QUALITY_P10 4.0\n#define FXAA_QUALITY_P11 8.0\n#endif\n#define FxaaBool bool\n#define FxaaFloat float\n#define FxaaFloat2 vec2\n#define FxaaFloat3 vec3\n#define FxaaFloat4 vec4\n#define FxaaHalf float\n#define FxaaHalf2 vec2\n#define FxaaHalf3 vec3\n#define FxaaHalf4 vec4\n#define FxaaInt2 vec2\n#define FxaaTex sampler2D\n#define FxaaSat(x) clamp(x, 0.0, 1.0)\n#define FxaaTexTop(t, p) texture2D(t, p)\n#define FxaaTexOff(t, p, o, r) texture2D(t, p + (o * r))\nFxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.y; }\nFxaaFloat4 FxaaPixelShader(\nFxaaFloat2 pos,\nFxaaTex tex,\nFxaaFloat2 fxaaQualityRcpFrame,\nFxaaFloat fxaaQualitySubpix,\nFxaaFloat fxaaQualityEdgeThreshold,\nFxaaFloat fxaaQualityEdgeThresholdMin\n) {\nFxaaFloat2 posM;\nposM.x = pos.x;\nposM.y = pos.y;\nFxaaFloat4 rgbyM = FxaaTexTop(tex, posM);\n#define lumaM rgbyM.y\nFxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0, 1), fxaaQualityRcpFrame.xy));\nFxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 0), fxaaQualityRcpFrame.xy));\nFxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0,-1), fxaaQualityRcpFrame.xy));\nFxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 0), fxaaQualityRcpFrame.xy));\nFxaaFloat maxSM = max(lumaS, lumaM);\nFxaaFloat minSM = min(lumaS, lumaM);\nFxaaFloat maxESM = max(lumaE, maxSM);\nFxaaFloat minESM = min(lumaE, minSM);\nFxaaFloat maxWN = max(lumaN, lumaW);\nFxaaFloat minWN = min(lumaN, lumaW);\nFxaaFloat rangeMax = max(maxWN, maxESM);\nFxaaFloat rangeMin = min(minWN, minESM);\nFxaaFloat rangeMaxScaled = rangeMax * fxaaQualityEdgeThreshold;\nFxaaFloat range = rangeMax - rangeMin;\nFxaaFloat rangeMaxClamped = max(fxaaQualityEdgeThresholdMin, rangeMaxScaled);\nFxaaBool earlyExit = range < rangeMaxClamped;\nif(earlyExit)\nreturn rgbyM;\nFxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1,-1), fxaaQualityRcpFrame.xy));\nFxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 1), fxaaQualityRcpFrame.xy));\nFxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1,-1), fxaaQualityRcpFrame.xy));\nFxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));\nFxaaFloat lumaNS = lumaN + lumaS;\nFxaaFloat lumaWE = lumaW + lumaE;\nFxaaFloat subpixRcpRange = 1.0/range;\nFxaaFloat subpixNSWE = lumaNS + lumaWE;\nFxaaFloat edgeHorz1 = (-2.0 * lumaM) + lumaNS;\nFxaaFloat edgeVert1 = (-2.0 * lumaM) + lumaWE;\nFxaaFloat lumaNESE = lumaNE + lumaSE;\nFxaaFloat lumaNWNE = lumaNW + lumaNE;\nFxaaFloat edgeHorz2 = (-2.0 * lumaE) + lumaNESE;\nFxaaFloat edgeVert2 = (-2.0 * lumaN) + lumaNWNE;\nFxaaFloat lumaNWSW = lumaNW + lumaSW;\nFxaaFloat lumaSWSE = lumaSW + lumaSE;\nFxaaFloat edgeHorz4 = (abs(edgeHorz1) * 2.0) + abs(edgeHorz2);\nFxaaFloat edgeVert4 = (abs(edgeVert1) * 2.0) + abs(edgeVert2);\nFxaaFloat edgeHorz3 = (-2.0 * lumaW) + lumaNWSW;\nFxaaFloat edgeVert3 = (-2.0 * lumaS) + lumaSWSE;\nFxaaFloat edgeHorz = abs(edgeHorz3) + edgeHorz4;\nFxaaFloat edgeVert = abs(edgeVert3) + edgeVert4;\nFxaaFloat subpixNWSWNESE = lumaNWSW + lumaNESE;\nFxaaFloat lengthSign = fxaaQualityRcpFrame.x;\nFxaaBool horzSpan = edgeHorz >= edgeVert;\nFxaaFloat subpixA = subpixNSWE * 2.0 + subpixNWSWNESE;\nif(!horzSpan) lumaN = lumaW;\nif(!horzSpan) lumaS = lumaE;\nif(horzSpan) lengthSign = fxaaQualityRcpFrame.y;\nFxaaFloat subpixB = (subpixA * (1.0/12.0)) - lumaM;\nFxaaFloat gradientN = lumaN - lumaM;\nFxaaFloat gradientS = lumaS - lumaM;\nFxaaFloat lumaNN = lumaN + lumaM;\nFxaaFloat lumaSS = lumaS + lumaM;\nFxaaBool pairN = abs(gradientN) >= abs(gradientS);\nFxaaFloat gradient = max(abs(gradientN), abs(gradientS));\nif(pairN) lengthSign = -lengthSign;\nFxaaFloat subpixC = FxaaSat(abs(subpixB) * subpixRcpRange);\nFxaaFloat2 posB;\nposB.x = posM.x;\nposB.y = posM.y;\nFxaaFloat2 offNP;\noffNP.x = (!horzSpan) ? 0.0 : fxaaQualityRcpFrame.x;\noffNP.y = ( horzSpan) ? 0.0 : fxaaQualityRcpFrame.y;\nif(!horzSpan) posB.x += lengthSign * 0.5;\nif( horzSpan) posB.y += lengthSign * 0.5;\nFxaaFloat2 posN;\nposN.x = posB.x - offNP.x * FXAA_QUALITY_P0;\nposN.y = posB.y - offNP.y * FXAA_QUALITY_P0;\nFxaaFloat2 posP;\nposP.x = posB.x + offNP.x * FXAA_QUALITY_P0;\nposP.y = posB.y + offNP.y * FXAA_QUALITY_P0;\nFxaaFloat subpixD = ((-2.0)*subpixC) + 3.0;\nFxaaFloat lumaEndN = FxaaLuma(FxaaTexTop(tex, posN));\nFxaaFloat subpixE = subpixC * subpixC;\nFxaaFloat lumaEndP = FxaaLuma(FxaaTexTop(tex, posP));\nif(!pairN) lumaNN = lumaSS;\nFxaaFloat gradientScaled = gradient * 1.0/4.0;\nFxaaFloat lumaMM = lumaM - lumaNN * 0.5;\nFxaaFloat subpixF = subpixD * subpixE;\nFxaaBool lumaMLTZero = lumaMM < 0.0;\nlumaEndN -= lumaNN * 0.5;\nlumaEndP -= lumaNN * 0.5;\nFxaaBool doneN = abs(lumaEndN) >= gradientScaled;\nFxaaBool doneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P1;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P1;\nFxaaBool doneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P1;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P1;\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P2;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P2;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P2;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P2;\n#if (FXAA_QUALITY_PS > 3)\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P3;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P3;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P3;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P3;\n#if (FXAA_QUALITY_PS > 4)\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P4;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P4;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P4;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P4;\n#if (FXAA_QUALITY_PS > 5)\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P5;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P5;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P5;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P5;\n#if (FXAA_QUALITY_PS > 6)\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P6;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P6;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P6;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P6;\n#if (FXAA_QUALITY_PS > 7)\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P7;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P7;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P7;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P7;\n#if (FXAA_QUALITY_PS > 8)\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P8;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P8;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P8;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P8;\n#if (FXAA_QUALITY_PS > 9)\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P9;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P9;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P9;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P9;\n#if (FXAA_QUALITY_PS > 10)\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P10;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P10;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P10;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P10;\n#if (FXAA_QUALITY_PS > 11)\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P11;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P11;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P11;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P11;\n#if (FXAA_QUALITY_PS > 12)\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P12;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P12;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P12;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P12;\n}\n#endif\n}\n#endif\n}\n#endif\n}\n#endif\n}\n#endif\n}\n#endif\n}\n#endif\n}\n#endif\n}\n#endif\n}\n#endif\n}\nFxaaFloat dstN = posM.x - posN.x;\nFxaaFloat dstP = posP.x - posM.x;\nif(!horzSpan) dstN = posM.y - posN.y;\nif(!horzSpan) dstP = posP.y - posM.y;\nFxaaBool goodSpanN = (lumaEndN < 0.0) != lumaMLTZero;\nFxaaFloat spanLength = (dstP + dstN);\nFxaaBool goodSpanP = (lumaEndP < 0.0) != lumaMLTZero;\nFxaaFloat spanLengthRcp = 1.0/spanLength;\nFxaaBool directionN = dstN < dstP;\nFxaaFloat dst = min(dstN, dstP);\nFxaaBool goodSpan = directionN ? goodSpanN : goodSpanP;\nFxaaFloat subpixG = subpixF * subpixF;\nFxaaFloat pixelOffset = (dst * (-spanLengthRcp)) + 0.5;\nFxaaFloat subpixH = subpixG * fxaaQualitySubpix;\nFxaaFloat pixelOffsetGood = goodSpan ? pixelOffset : 0.0;\nFxaaFloat pixelOffsetSubpix = max(pixelOffsetGood, subpixH);\nif(!horzSpan) posM.x += pixelOffsetSubpix * lengthSign;\nif( horzSpan) posM.y += pixelOffsetSubpix * lengthSign;\nreturn FxaaFloat4(FxaaTexTop(tex, posM).xyz, lumaM);\n}\n";function PostProcessStageComposite(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this._stages=e.stages,this._inputPreviousStageTexture=defaultValue(e.inputPreviousStageTexture,!0);var t=e.name;defined(t)||(t=createGuid()),this._name=t,this._uniforms=e.uniforms,this._textureCache=void 0,this._index=void 0,this._selected=void 0,this._selectedShadow=void 0,this._parentSelected=void 0,this._parentSelectedShadow=void 0,this._combinedSelected=void 0,this._combinedSelectedShadow=void 0,this._selectedLength=0,this._parentSelectedLength=0,this._selectedDirty=!0}function isSelectedTextureDirty$1(e){var t=defined(e._selected)?e._selected.length:0,i=defined(e._parentSelected)?e._parentSelected:0,r=e._selected!==e._selectedShadow||t!==e._selectedLength;if(r=r||e._parentSelected!==e._parentSelectedShadow||i!==e._parentSelectedLength,defined(e._selected)&&defined(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):defined(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!r&&defined(e._combinedSelected)){if(!defined(e._combinedSelectedShadow))return!0;t=e._combinedSelected.length;for(var n=0;n<t;++n)if(e._combinedSelected[n]!==e._combinedSelectedShadow[n])return!0}return r}Object.defineProperties(PostProcessStageComposite.prototype,{ready:{get:function(){for(var e=this._stages,t=e.length,i=0;i<t;++i)if(!e[i].ready)return!1;return!0}},name:{get:function(){return this._name}},enabled:{get:function(){return this._stages[0].enabled},set:function(e){for(var t=this._stages,i=t.length,r=0;r<i;++r)t[r].enabled=e}},uniforms:{get:function(){return this._uniforms}},inputPreviousStageTexture:{get:function(){return this._inputPreviousStageTexture}},length:{get:function(){return this._stages.length}},selected:{get:function(){return this._selected},set:function(e){this._selected=e}},parentSelected:{get:function(){return this._parentSelected},set:function(e){this._parentSelected=e}}}),PostProcessStageComposite.prototype._isSupported=function(e){for(var t=this._stages,i=t.length,r=0;r<i;++r)if(!t[r]._isSupported(e))return!1;return!0},PostProcessStageComposite.prototype.get=function(e){return this._stages[e]},PostProcessStageComposite.prototype.update=function(e,t){this._selectedDirty=isSelectedTextureDirty$1(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=defined(this._selected)?this._selected.length:0,this._parentSelectedLength=defined(this._parentSelected)?this._parentSelected.length:0;for(var i=this._stages,r=i.length,n=0;n<r;++n){var a=i[n];this._selectedDirty&&(a.parentSelected=this._combinedSelected),a.update(e,t)}},PostProcessStageComposite.prototype.isDestroyed=function(){return!1},PostProcessStageComposite.prototype.destroy=function(){for(var e=this._stages,t=e.length,i=0;i<t;++i)e[i].destroy();return destroyObject(this)};var SunShaftModulate="varying vec2 v_textureCoordinates;\nuniform sampler2D sunShaftTexture;\nuniform sampler2D colorTexture;\nconst float exposure = 1.0;\nvoid main()\n{\nconst float gamma = 2.2;\nvec3 hdrColor = texture2D(colorTexture, v_textureCoordinates).rgb;\nvec3 bloomColor = texture2D(sunShaftTexture, v_textureCoordinates).rgb;\nhdrColor += bloomColor;\ngl_FragColor = vec4(hdrColor, 1.0);\n}\n",GaussianBlur1DSun="#define SAMPLES 8\nuniform float delta;\nuniform float sigma;\nuniform float direction;\nuniform sampler2D sunTexture;\n#ifdef USE_STEP_SIZE\nuniform float stepSize;\n#else\nuniform vec2 step;\n#endif\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nvec2 st = v_textureCoordinates;\nvec2 dir = vec2(1.0 - direction, direction);\n#ifdef USE_STEP_SIZE\nvec2 step = vec2(stepSize / czm_viewport.zw);\n#else\nvec2 step = step;\n#endif\nvec3 g;\ng.x = 1.0 / (sqrt(czm_twoPi) * sigma);\ng.y = exp((-0.5 * delta * delta) / (sigma * sigma));\ng.z = g.y * g.y;\nvec4 result = texture2D(sunTexture, st) * g.x;\nfor (int i = 1; i < SAMPLES; ++i)\n{\ng.xy *= g.yz;\nvec2 offset = float(i) * dir * step;\nresult += texture2D(sunTexture, st - offset) * g.x;\nresult += texture2D(sunTexture, st + offset) * g.x;\n}\ngl_FragColor = result;\n}\n",SunVisibleFS="uniform sampler2D depthTexture;\nuniform sampler2D colorTexture;\nvarying vec2 v_textureCoordinates;\nconst float threshold = 0.95;\nconst float exposure = 1.0;\nconst float gamma = 2.2;\nvoid main(void)\n{\nfloat depth = czm_readDepth(depthTexture, v_textureCoordinates);\nif(depth < 1.0)\n{\ngl_FragColor = vec4(vec3(0.0), 1.0);\n}\nelse\n{\nvec4 color = texture2D(colorTexture, v_textureCoordinates);\ncolor = czm_gammaCorrect(color);\nfloat brightness = dot(color.rgb, vec3(0.2126, 0.7152, 0.0722));\ngl_FragColor = brightness > threshold ? vec4(color.rgb * 1.1, 1.0) : vec4(0.0, 0.0, 0.0, 1.0);\n}\n}\n",SunVisibleShaft="varying vec2 v_textureCoordinates;\nuniform sampler2D colorTexture;\nuniform sampler2D sunVisibleTexture;\nconst float _BlurRadius = 0.04;\nconst float _Iteration = 26.0;\nconst float nFrag = 1.0 / 30.0;\nconst float _SunScreenRadius = 0.1;\nconst float exposure = 1.0;\nconst float gamma = 2.2;\nconst float strength = 0.1;\nfloat rnd(vec3 scale, float seed)\n{\nreturn fract(sin(dot(gl_FragCoord.stp + seed, scale)) * 43758.5453 + seed);\n}\nvec4 fragRadialBlur(vec2 p, vec2 sunCoord)\n{\nvec2 fc = p;\nvec2 fcc = fc - sunCoord;\nvec3 destColor = vec3(0.0);\nfloat random = rnd(vec3(12.9898, 78.233, 151.7182), 0.0);\nfloat totalWeight = 0.0;\nfor (float i = 0.0; i <= _Iteration; i++) {\nfloat percent = (i + random) * nFrag;\nfloat weight = percent - percent * percent;\nvec2 t = fc - fcc * percent * strength * nFrag;\ndestColor += texture2D(sunVisibleTexture, t).rgb * weight;\ntotalWeight += weight;\n}\nreturn vec4(destColor / totalWeight, 1.0);\n}\nvec2 getCenter(vec2 sunCoord)\n{\nvec4 sunColor = texture2D(sunVisibleTexture, sunCoord);\nif(sunColor.x > 0.0)\n{\nreturn sunCoord;\n}\nvec2 step = vec2(0.0, 0.02);\nvec2 tmp = vec2(0.0, 0.0);\nfor(float i = 0.0; i < 1.0; i += 0.02)\n{\ntmp = vec2(sunCoord.x, sunCoord.y + i);\nif(texture2D(sunVisibleTexture, tmp).r > 0.0 || tmp.y >= 1.0)\n{\nbreak;\n}\n}\nvec2 low = vec2(0.0, 0.0);\nif(texture2D(sunVisibleTexture, tmp).r > 0.0)\n{\nlow = tmp;\n}\nelse\n{\nreturn sunCoord;\n}\nfor(float i = 0.0; i < 1.0; i += 0.02)\n{\ntmp = vec2(low.x, low.y + i);\nif(texture2D(sunVisibleTexture, tmp).r > 0.0 || tmp.y >= 1.0)\n{\nbreak;\n}\n}\nvec2 high;\nif(texture2D(sunVisibleTexture, tmp).r > 0.0)\n{\nhigh = tmp;\n}\nelse\n{\nreturn sunCoord;\n}\nreturn (low + high) / 2.0;\n}\nvec4 getColor(vec2 p, vec2 sunCoord)\n{\nvec2 blurVector = (sunCoord - p) * _BlurRadius;\nvec4 acumulateColor = vec4(0, 0, 0, 0);\nvec2 texcoord = p;\nfor (int j = 0; j < int(_Iteration); j ++)\n{\nacumulateColor += texture2D(sunVisibleTexture, texcoord);\ntexcoord += blurVector;\n}\nvec4 color = acumulateColor / float(_Iteration);\nreturn color;\n}\nvoid main()\n{\nvec4 sunPos = czm_morphTime == 1.0 ? vec4(czm_sunPositionWC, 1.0) : vec4(czm_sunPositionColumbusView.zxy, 1.0);\nvec4 sunPositionEC = czm_view * sunPos;\nvec4 sunPositionWC = czm_eyeToWindowCoordinates(sunPositionEC);\nsunPos = czm_viewportOrthographic * vec4(sunPositionWC.xy, -sunPositionWC.z, 1.0);\nvec2 sunTexcoord = sunPos.xy * 0.5 + vec2(0.5);\nvec2 center = getCenter(sunTexcoord);\ngl_FragColor = getColor(v_textureCoordinates, center);\n}\n",PostProcessStageLibrary={};function createBlur(e){var t="#define USE_STEP_SIZE\n"+GaussianBlur1D,r=new PostProcessStage({name:e+"_x_direction",fragmentShader:t,uniforms:{delta:1,sigma:2,stepSize:1,direction:0},sampleMode:PostProcessStageSampleMode.LINEAR}),n=new PostProcessStage({name:e+"_y_direction",fragmentShader:t,uniforms:{delta:1,sigma:2,stepSize:1,direction:1},sampleMode:PostProcessStageSampleMode.LINEAR}),i={};return Object.defineProperties(i,{delta:{get:function(){return r.uniforms.delta},set:function(e){var t=r.uniforms,i=n.uniforms;t.delta=i.delta=e}},sigma:{get:function(){return r.uniforms.sigma},set:function(e){var t=r.uniforms,i=n.uniforms;t.sigma=i.sigma=e}},stepSize:{get:function(){return r.uniforms.stepSize},set:function(e){var t=r.uniforms,i=n.uniforms;t.stepSize=i.stepSize=e}}}),new PostProcessStageComposite({name:e,stages:[r,n],uniforms:i})}function getSilhouetteEdgeDetection(e){if(!defined(e))return PostProcessStageLibrary.createEdgeDetectionStage();for(var t=new PostProcessStageComposite({name:"czm_edge_detection_multiple",stages:e,inputPreviousStageTexture:!1}),i={},r="",n="",a=0;a<e.length;++a)r+="uniform sampler2D edgeTexture"+a+"; \n",n+=" vec4 edge"+a+" = texture2D(edgeTexture"+a+", v_textureCoordinates); \n if (edge"+a+".a > 0.0) \n { \n color = edge"+a+"; \n break; \n } \n",i["edgeTexture"+a]=e[a].name;return new PostProcessStageComposite({name:"czm_edge_detection_composite",stages:[t,new PostProcessStage({name:"czm_edge_detection_combine",fragmentShader:r+"varying vec2 v_textureCoordinates; \nvoid main() { \n vec4 color = vec4(0.0); \n for (int i = 0; i < "+e.length+"; i++) \n { \n"+n+" } \n gl_FragColor = color; \n} \n",uniforms:i})]})}PostProcessStageLibrary.createBlurStage=function(){return createBlur("czm_blur")},PostProcessStageLibrary.createDepthOfFieldStage=function(){var t=createBlur("czm_depth_of_field_blur"),i=new PostProcessStage({name:"czm_depth_of_field_composite",fragmentShader:DepthOfField,uniforms:{focalDistance:5,blurTexture:t.name}}),e={};return Object.defineProperties(e,{focalDistance:{get:function(){return i.uniforms.focalDistance},set:function(e){i.uniforms.focalDistance=e}},delta:{get:function(){return t.uniforms.delta},set:function(e){t.uniforms.delta=e}},sigma:{get:function(){return t.uniforms.sigma},set:function(e){t.uniforms.sigma=e}},stepSize:{get:function(){return t.uniforms.stepSize},set:function(e){t.uniforms.stepSize=e}}}),new PostProcessStageComposite({name:"czm_depth_of_field",stages:[t,i],inputPreviousStageTexture:!1,uniforms:e})},PostProcessStageLibrary.isDepthOfFieldSupported=function(e){return e.context.depthTexture},PostProcessStageLibrary.createEdgeDetectionStage=function(){return new PostProcessStage({name:"czm_edge_detection_"+createGuid(),fragmentShader:EdgeDetection,uniforms:{length:.25,color:Color.clone(Color.BLACK)}})},PostProcessStageLibrary.isEdgeDetectionSupported=function(e){return e.context.depthTexture},PostProcessStageLibrary.createSilhouetteStage=function(e){var t=getSilhouetteEdgeDetection(e);return new PostProcessStageComposite({name:"czm_silhouette",stages:[t,new PostProcessStage({name:"czm_silhouette_color_edges",fragmentShader:Silhouette,uniforms:{silhouetteTexture:t.name}})],inputPreviousStageTexture:!1,uniforms:t.uniforms})},PostProcessStageLibrary.isSilhouetteSupported=function(e){return e.context.depthTexture},PostProcessStageLibrary.createBloomStage=function(){var t=new PostProcessStage({name:"czm_bloom_contrast_bias",fragmentShader:ContrastBias,uniforms:{contrast:128,brightness:-.3}}),i=createBlur("czm_bloom_blur"),e=new PostProcessStageComposite({name:"czm_bloom_contrast_bias_blur",stages:[t,i]}),r=new PostProcessStage({name:"czm_bloom_generate_composite",fragmentShader:BloomComposite,uniforms:{glowOnly:!1,bloomTexture:e.name}}),n={};return Object.defineProperties(n,{glowOnly:{get:function(){return r.uniforms.glowOnly},set:function(e){r.uniforms.glowOnly=e}},contrast:{get:function(){return t.uniforms.contrast},set:function(e){t.uniforms.contrast=e}},brightness:{get:function(){return t.uniforms.brightness},set:function(e){t.uniforms.brightness=e}},delta:{get:function(){return i.uniforms.delta},set:function(e){i.uniforms.delta=e}},sigma:{get:function(){return i.uniforms.sigma},set:function(e){i.uniforms.sigma=e}},stepSize:{get:function(){return i.uniforms.stepSize},set:function(e){i.uniforms.stepSize=e}}}),new PostProcessStageComposite({name:"czm_bloom",stages:[e,r],inputPreviousStageTexture:!1,uniforms:n})},PostProcessStageLibrary.createAmbientOcclusionStage=function(){var t=new PostProcessStage({name:"czm_ambient_occlusion_generate",fragmentShader:AmbientOcclusionGenerate,uniforms:{intensity:3,bias:.1,lengthCap:.26,stepSize:1.95,frustumLength:1e3,randomTexture:void 0}}),i=createBlur("czm_ambient_occlusion_blur");i.uniforms.stepSize=.86;var e=new PostProcessStageComposite({name:"czm_ambient_occlusion_generate_blur",stages:[t,i]}),r=new PostProcessStage({name:"czm_ambient_occlusion_composite",fragmentShader:AmbientOcclusionModulate,uniforms:{ambientOcclusionOnly:!1,ambientOcclusionTexture:e.name}}),n={};return Object.defineProperties(n,{intensity:{get:function(){return t.uniforms.intensity},set:function(e){t.uniforms.intensity=e}},bias:{get:function(){return t.uniforms.bias},set:function(e){t.uniforms.bias=e}},lengthCap:{get:function(){return t.uniforms.lengthCap},set:function(e){t.uniforms.lengthCap=e}},stepSize:{get:function(){return t.uniforms.stepSize},set:function(e){t.uniforms.stepSize=e}},frustumLength:{get:function(){return t.uniforms.frustumLength},set:function(e){t.uniforms.frustumLength=e}},randomTexture:{get:function(){return t.uniforms.randomTexture},set:function(e){t.uniforms.randomTexture=e}},delta:{get:function(){return i.uniforms.delta},set:function(e){i.uniforms.delta=e}},sigma:{get:function(){return i.uniforms.sigma},set:function(e){i.uniforms.sigma=e}},blurStepSize:{get:function(){return i.uniforms.stepSize},set:function(e){i.uniforms.stepSize=e}},ambientOcclusionOnly:{get:function(){return r.uniforms.ambientOcclusionOnly},set:function(e){r.uniforms.ambientOcclusionOnly=e}}}),new PostProcessStageComposite({name:"czm_ambient_occlusion",stages:[e,r],inputPreviousStageTexture:!1,uniforms:n})},PostProcessStageLibrary.isAmbientOcclusionSupported=function(e){return e.context.depthTexture};var fxaaFS="#define FXAA_QUALITY_PRESET 39 \n"+FXAA3_11+"\n"+FXAA;function PostProcessStageTextureCache(e){this._collection=e,this._framebuffers=[],this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0,this._updateDependencies=!1}function getLastStageName(e){for(;defined(e.length);)e=e.get(e.length-1);return e.name}function getStageDependencies(e,t,i,r,n){if(!r.enabled||!r._isSupported(t))return n;var a=i[r.name]={};defined(n)&&(a[getLastStageName(e.getStageByName(n))]=!0);var o=r.uniforms;if(defined(o))for(var s=Object.getOwnPropertyNames(o),l=s.length,u=0;u<l;++u){var c=o[s[u]];if("string"==typeof c){var d=e.getStageByName(c);defined(d)&&(a[getLastStageName(d)]=!0)}}return r.name}function getCompositeDependencies(e,t,i,r,n){if(defined(r.enabled)&&!r.enabled||defined(r._isSupported)&&!r._isSupported(t))return n;for(var a,o,s=n,l=!defined(r.inputPreviousStageTexture)||r.inputPreviousStageTexture,u=n,c=r.length,d=0;d<c;++d){var h=r.get(d);u=defined(h.length)?getCompositeDependencies(e,t,i,h,n):getStageDependencies(e,t,i,h,n),l&&(n=u)}if(l)for(a=1;a<c;++a)defined(i[o=getLastStageName(r.get(a))])||(i[o]={}),i[o][s]=!0;else for(a=1;a<c;++a)for(var p=i[o=getLastStageName(r.get(a))],f=0;f<a;++f)p[getLastStageName(r.get(f))]=!0;return u}function getDependencies(e,t){var i={};if(defined(e.ambientOcclusion)){var r=e.ambientOcclusion,n=e.bloom,a=e._tonemapping,o=e.fxaa,s=getCompositeDependencies(e,t,i,r,void 0);s=getStageDependencies(e,t,i,a,s=getCompositeDependencies(e,t,i,n,s)),getStageDependencies(e,t,i,o,s=getCompositeDependencies(e,t,i,e,s=getCompositeDependencies(e,t,i,e.sunShaft,s)))}else getCompositeDependencies(e,t,i,e,void 0);return i}function getFramebuffer(e,t,i){var r,n,a=e._collection.getStageByName(t),o=a._textureScale,s=a._forcePowerOfTwo,l=a._pixelFormat,u=a._pixelDatatype,c=a._clearColor,d=e._framebuffers,h=d.length;for(r=0;r<h;++r)if(o===(n=d[r]).textureScale&&s===n.forcePowerOfTwo&&l===n.pixelFormat&&u===n.pixelDatatype&&Color.equals(c,n.clearColor)){for(var p=n.stages,f=p.length,m=!1,g=0;g<f;++g)if(i[p[g]]){m=!0;break}if(!m)break}return defined(n)&&r<h?n.stages.push(t):(n={textureScale:o,forcePowerOfTwo:s,pixelFormat:l,pixelDatatype:u,clearColor:c,stages:[t],buffer:void 0,clear:void 0},d.push(n)),n}function createFramebuffers$3(e,t){var i=getDependencies(e._collection,t);for(var r in i)i.hasOwnProperty(r)&&(e._stageNameToFramebuffer[r]=getFramebuffer(e,r,i[r]))}function releaseResources$1(e){for(var t=e._framebuffers,i=t.length,r=0;r<i;++r){var n=t[r];n.buffer=n.buffer&&n.buffer.destroy(),n.buffer=void 0}}function updateFramebuffers$3(e,t){for(var i=e._width,r=e._height,n=e._framebuffers,a=n.length,o=0;o<a;++o){var s=n[o],l=s.textureScale,u=Math.ceil(i*l),c=Math.ceil(r*l),d=Math.min(u,c);s.forcePowerOfTwo&&(CesiumMath.isPowerOfTwo(d)||(d=CesiumMath.nextPowerOfTwo(d)),c=u=d),s.buffer=new Framebuffer({context:t,colorTextures:[new Texture({context:t,width:u,height:c,pixelFormat:s.pixelFormat,pixelDatatype:s.pixelDatatype})]}),s.clear=new ClearCommand({color:s.clearColor,framebuffer:s.buffer})}}PostProcessStageLibrary.createFXAAStage=function(){return new PostProcessStage({name:"czm_FXAA",fragmentShader:fxaaFS,sampleMode:PostProcessStageSampleMode.LINEAR})},PostProcessStageLibrary.createAcesTonemappingStage=function(e){var t=e?"#define AUTO_EXPOSURE\n":"";return new PostProcessStage({name:"czm_aces",fragmentShader:t+=AcesTonemapping,uniforms:{autoExposure:void 0}})},PostProcessStageLibrary.createFilmicTonemappingStage=function(e){var t=e?"#define AUTO_EXPOSURE\n":"";return new PostProcessStage({name:"czm_filmic",fragmentShader:t+=FilmicTonemapping,uniforms:{autoExposure:void 0}})},PostProcessStageLibrary.createReinhardTonemappingStage=function(e){var t=e?"#define AUTO_EXPOSURE\n":"";return new PostProcessStage({name:"czm_reinhard",fragmentShader:t+=ReinhardTonemapping,uniforms:{autoExposure:void 0}})},PostProcessStageLibrary.createModifiedReinhardTonemappingStage=function(e){var t=e?"#define AUTO_EXPOSURE\n":"";return new PostProcessStage({name:"czm_modified_reinhard",fragmentShader:t+=ModifiedReinhardTonemapping,uniforms:{white:Color.WHITE,autoExposure:void 0}})},PostProcessStageLibrary.createAutoExposureStage=function(){return new AutoExposure},PostProcessStageLibrary.createBlackAndWhiteStage=function(){return new PostProcessStage({name:"czm_black_and_white",fragmentShader:BlackAndWhite,uniforms:{gradations:5}})},PostProcessStageLibrary.createBrightnessStage=function(){return new PostProcessStage({name:"czm_brightness",fragmentShader:Brightness,uniforms:{brightness:.5}})},PostProcessStageLibrary.createNightVisionStage=function(){return new PostProcessStage({name:"czm_night_vision",fragmentShader:NightVision})},PostProcessStageLibrary.createDepthViewStage=function(){return new PostProcessStage({name:"czm_depth_view",fragmentShader:DepthView})},PostProcessStageLibrary.createLensFlareStage=function(){return new PostProcessStage({name:"czm_lens_flare",fragmentShader:LensFlare,uniforms:{dirtTexture:buildModuleUrl("Assets/Textures/LensFlare/DirtMask.jpg"),starTexture:buildModuleUrl("Assets/Textures/LensFlare/StarBurst.jpg"),intensity:2,distortion:10,ghostDispersal:.4,haloWidth:.4,dirtAmount:.4,earthRadius:Ellipsoid.WGS84.maximumRadius}})},PostProcessStageLibrary.createSunShaftStage=function(){var t=new PostProcessStage({name:"czm_SunVisible",fragmentShader:SunVisibleFS,isShaft:!0,sampleMode:PostProcessStageSampleMode.LINEAR,uniforms:{u_size:210}}),e=new PostProcessStage({name:"czm_SunVisibleShaft",fragmentShader:SunVisibleShaft,sampleMode:PostProcessStageSampleMode.LINEAR,uniforms:{sunVisibleTexture:t.name}}),i="#define USE_STEP_SIZE\n"+GaussianBlur1DSun,r=new PostProcessStage({name:"czm_sun_shaft_x_direction",fragmentShader:i,uniforms:{delta:1,sigma:2,stepSize:1,direction:0,sunTexture:e.name},sampleMode:PostProcessStageSampleMode.LINEAR}),n=new PostProcessStage({name:"czm_sun_shaft_y_direction",fragmentShader:i,uniforms:{delta:1,sigma:2,stepSize:1,direction:1,sunTexture:r.name},sampleMode:PostProcessStageSampleMode.LINEAR}),a=new PostProcessStage({name:"czm_SunShaft_Modulate",fragmentShader:SunShaftModulate,uniforms:{exposure:1,sunShaftTexture:n.name}}),o={};return Object.defineProperties(o,{exposure:{get:function(){return a.uniforms.exposure},set:function(e){a.uniforms.exposure=e}},u_size:{get:function(){return t.uniforms.u_size},set:function(e){t.uniforms.u_size=e}},delta:{get:function(){return r.uniforms.delta},set:function(e){var t=r.uniforms,i=n.uniforms;t.delta=i.delta=e}},sigma:{get:function(){return r.uniforms.sigma},set:function(e){var t=r.uniforms,i=n.uniforms;t.sigma=i.sigma=e}},stepSize:{get:function(){return r.uniforms.stepSize},set:function(e){var t=r.uniforms,i=n.uniforms;t.stepSize=i.stepSize=e}}}),new PostProcessStageComposite({name:"czm_SunShaft_All",inputPreviousStageTexture:!1,stages:[t,e,r,n,a],uniforms:o})},PostProcessStageTextureCache.prototype.updateDependencies=function(){this._updateDependencies=!0},PostProcessStageTextureCache.prototype.update=function(e){var t=this._collection,i=this._updateDependencies,r=defined(t.ambientOcclusion)&&t.ambientOcclusion.enabled&&t.ambientOcclusion._isSupported(e),n=defined(t.bloom)&&t.bloom.enabled&&t.bloom._isSupported(e),a=defined(t._tonemapping)&&t._tonemapping.enabled&&t._tonemapping._isSupported(e),o=defined(t.fxaa)&&t.fxaa.enabled&&t.fxaa._isSupported(e),s=defined(t.sunShaft)&&t.sunShaft.enabled&&t.sunShaft._isSupported(e),l=!defined(t._activeStages)||0<t._activeStages.length||r||n||a||o||s;if((i||!l&&0<this._framebuffers.length)&&(releaseResources$1(this),this._framebuffers.length=0,this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0),i||l){0===this._framebuffers.length&&createFramebuffers$3(this,e);var u=e.drawingBufferWidth,c=e.drawingBufferHeight,d=this._width!==u||this._height!==c;(i||d)&&(this._width=u,this._height=c,this._updateDependencies=!1,releaseResources$1(this),updateFramebuffers$3(this,e))}},PostProcessStageTextureCache.prototype.clear=function(e){for(var t=this._framebuffers,i=0;i<t.length;++i)t[i].clear.execute(e)},PostProcessStageTextureCache.prototype.getStageByName=function(e){return this._collection.getStageByName(e)},PostProcessStageTextureCache.prototype.getOutputTexture=function(e){return this._collection.getOutputTexture(e)},PostProcessStageTextureCache.prototype.getFramebuffer=function(e){var t=this._stageNameToFramebuffer[e];if(defined(t))return t.buffer},PostProcessStageTextureCache.prototype.isDestroyed=function(){return!1},PostProcessStageTextureCache.prototype.destroy=function(){return releaseResources$1(this),destroyObject(this)};var Tonemapper={REINHARD:0,MODIFIED_REINHARD:1,FILMIC:2,ACES:3,validate:function(e){return e===Tonemapper.REINHARD||e===Tonemapper.MODIFIED_REINHARD||e===Tonemapper.FILMIC||e===Tonemapper.ACES}},Tonemapper$1=Object.freeze(Tonemapper),stackScratch=[];function PostProcessStageCollection(){var e=PostProcessStageLibrary.createFXAAStage(),t=PostProcessStageLibrary.createAmbientOcclusionStage(),i=PostProcessStageLibrary.createBloomStage(),r=PostProcessStageLibrary.createSunShaftStage();this._autoExposureEnabled=!1,this._autoExposure=PostProcessStageLibrary.createAutoExposureStage(),this._tonemapping=void 0,this._tonemapper=void 0,this.tonemapper=Tonemapper$1.ACES;var n=this._tonemapping;e.enabled=!1,t.enabled=!1,i.enabled=!1,n.enabled=!1,r.enabled=!1;var a=new PostProcessStageTextureCache(this),o={},s=stackScratch;for(s.push(e,t,i,n,r);0<s.length;){var l=s.pop();(o[l.name]=l)._textureCache=a;var u=l.length;if(defined(u))for(var c=0;c<u;++c)s.push(l.get(c))}this._stages=[],this._activeStages=[],this._previousActiveStages=[],this._randomTexture=void 0;var d=this;t.uniforms.randomTexture=function(){return d._randomTexture},this._ao=t,this._bloom=i,this._fxaa=e,this._sunShaft=r,this._lastLength=void 0,this._aoEnabled=void 0,this._bloomEnabled=void 0,this._tonemappingEnabled=void 0,this._fxaaEnabled=void 0,this._sunShaftEnabled=void 0,this._stagesRemoved=!1,this._textureCacheDirty=!1,this._stageNames=o,this._textureCache=a}function removeStages(e){if(e._stagesRemoved){e._stagesRemoved=!1;for(var t=[],i=e._stages,r=i.length,n=0,a=0;n<r;++n){var o=i[n];o&&(o._index=a++,t.push(o))}e._stages=t}}function getOutputTexture(e){for(;defined(e.length);)e=e.get(e.length-1);return e.outputTexture}function execute(e,t,i,r,n){if(defined(e.execute))e.execute(t,i,r,n);else{var a,o=e.length;if(e.inputPreviousStageTexture)for(execute(e.get(0),t,i,r,n),a=1;a<o;++a)execute(e.get(a),t,getOutputTexture(e.get(a-1)),r,n);else for(a=0;a<o;++a)execute(e.get(a),t,i,r,n)}}function QuadtreeTileProvider(){DeveloperError.throwInstantiationError()}function SceneTransitioner(e){this._scene=e,this._currentTweens=[],this._morphHandler=void 0,this._morphCancelled=!1,this._completeMorph=void 0,this._morphToOrthographic=!1}Object.defineProperties(PostProcessStageCollection.prototype,{ready:{get:function(){for(var e=!1,t=this._stages,i=t.length-1;0<=i;--i){var r=t[i];e=e||r.ready&&r.enabled}var n=this._fxaa,a=this._ao,o=this._bloom,s=this._tonemapping,l=this._sunShaft;return e=(e=(e=(e=(e=e||n.ready&&n.enabled)||a.ready&&a.enabled)||o.ready&&o.enabled)||s.ready&&s.enabled)||l.ready&&l.enabled}},fxaa:{get:function(){return this._fxaa}},sunShaft:{get:function(){return this._sunShaft}},ambientOcclusion:{get:function(){return this._ao}},bloom:{get:function(){return this._bloom}},length:{get:function(){return removeStages(this),this._stages.length}},outputTexture:{get:function(){var e=this._fxaa;if(e.enabled&&e.ready)return this.getOutputTexture(e.name);for(var t=this._stages,i=t.length-1;0<=i;--i){var r=t[i];if(defined(r)&&r.ready&&r.enabled)return this.getOutputTexture(r.name)}var n=this._tonemapping;if(n.enabled&&n.ready)return this.getOutputTexture(n.name);var a=this._bloom;if(a.enabled&&a.ready)return this.getOutputTexture(a.name);var o=this._ao;if(o.enabled&&o.ready)return this.getOutputTexture(o.name);var s=this._sunShaft;return s.enabled&&s.ready?this.getOutputTexture(s.name):void 0}},hasSelected:{get:function(){for(var e=arraySlice(this._stages);0<e.length;){var t=e.pop();if(defined(t)){if(defined(t.selected))return!0;var i=t.length;if(defined(i))for(var r=0;r<i;++r)e.push(t.get(r))}}return!1}},tonemapper:{get:function(){return this._tonemapper},set:function(e){if(this._tonemapper!==e){defined(this._tonemapping)&&(delete this._stageNames[this._tonemapping.name],this._tonemapping.destroy());var t,i=this._autoExposureEnabled;switch(e){case Tonemapper$1.REINHARD:t=PostProcessStageLibrary.createReinhardTonemappingStage(i);break;case Tonemapper$1.MODIFIED_REINHARD:t=PostProcessStageLibrary.createModifiedReinhardTonemappingStage(i);break;case Tonemapper$1.FILMIC:t=PostProcessStageLibrary.createFilmicTonemappingStage(i);break;default:t=PostProcessStageLibrary.createAcesTonemappingStage(i)}if(i){var r=this._autoExposure;t.uniforms.autoExposure=function(){return r.outputTexture}}this._tonemapper=e,this._tonemapping=t,defined(this._stageNames)&&((this._stageNames[t.name]=t)._textureCache=this._textureCache),this._textureCacheDirty=!0}}}}),PostProcessStageCollection.prototype.add=function(e){var t=this._stageNames,i=stackScratch;for(i.push(e);0<i.length;){var r=i.pop();(t[r.name]=r)._textureCache=this._textureCache;var n=r.length;if(defined(n))for(var a=0;a<n;++a)i.push(r.get(a))}var o=this._stages;return e._index=o.length,o.push(e),this._textureCacheDirty=!0,e},PostProcessStageCollection.prototype.remove=function(e){if(!this.contains(e))return!1;var t=this._stageNames,i=stackScratch;for(i.push(e);0<i.length;){var r=i.pop();delete t[r.name];var n=r.length;if(defined(n))for(var a=0;a<n;++a)i.push(r.get(a))}return this._stages[e._index]=void 0,this._stagesRemoved=!0,this._textureCacheDirty=!0,e._index=void 0,e._textureCache=void 0,e.destroy(),!0},PostProcessStageCollection.prototype.contains=function(e){return defined(e)&&defined(e._index)&&e._textureCache===this._textureCache},PostProcessStageCollection.prototype.get=function(e){return removeStages(this),this._stages[e]},PostProcessStageCollection.prototype.removeAll=function(){for(var e=this._stages,t=e.length,i=0;i<t;++i)this.remove(e[i]);e.length=0},PostProcessStageCollection.prototype.getStageByName=function(e){return this._stageNames[e]},PostProcessStageCollection.prototype.update=function(e,t,i){removeStages(this);var r=this._activeStages,n=this._activeStages=this._previousActiveStages;this._previousActiveStages=r;var a,o,s=this._stages,l=n.length=s.length,u=0;for(a=0;a<l;++a)(o=s[a]).ready&&o.enabled&&o._isSupported(e)&&(n[u++]=o);var c=(n.length=u)!==r.length;if(!c)for(a=0;a<u;++a)if(n[a]!==r[a]){c=!0;break}var d=this._ao,h=this._bloom,p=this._autoExposure,f=this._tonemapping,m=this._fxaa,g=this._sunShaft;f.enabled=i;var y=d.enabled&&d._isSupported(e),v=h.enabled&&h._isSupported(e),_=f.enabled&&f._isSupported(e),C=m.enabled&&m._isSupported(e),x=g.enabled&&g._isSupported(e);if((c||this._textureCacheDirty||u!==this._lastLength||y!==this._aoEnabled||v!==this._bloomEnabled||_!==this._tonemappingEnabled||C!==this._fxaaEnabled||x!==this._sunShaftEnabled)&&(this._textureCache.updateDependencies(),this._lastLength=u,this._aoEnabled=y,this._bloomEnabled=v,this._tonemappingEnabled=_,this._fxaaEnabled=C,this._sunShaftEnabled=x,this._textureCacheDirty=!1),defined(this._randomTexture)&&!y&&(this._randomTexture.destroy(),this._randomTexture=void 0),!defined(this._randomTexture)&&y){l=196608;var b=new Uint8Array(l);for(a=0;a<l;a+=3)b[a]=Math.floor(255*CesiumMath.nextRandomNumber());this._randomTexture=new Texture({context:e,pixelFormat:PixelFormat$1.RGB,pixelDatatype:PixelDatatype$1.UNSIGNED_BYTE,source:{arrayBufferView:b,width:256,height:256},sampler:new Sampler({wrapS:TextureWrap$1.REPEAT,wrapT:TextureWrap$1.REPEAT,minificationFilter:TextureMinificationFilter$1.NEAREST,magnificationFilter:TextureMagnificationFilter$1.NEAREST})})}for(this._textureCache.update(e),m.update(e,t),x&&g.update(e,t),d.update(e,t),h.update(e,t),f.update(e,t),this._autoExposureEnabled&&p.update(e,t),l=s.length,a=0;a<l;++a)s[a].update(e,t)},PostProcessStageCollection.prototype.clear=function(e){this._textureCache.clear(e),this._autoExposureEnabled&&this._autoExposure.clear(e)},PostProcessStageCollection.prototype.getOutputTexture=function(e){var t=this.getStageByName(e);if(defined(t))return getOutputTexture(t)},PostProcessStageCollection.prototype.execute=function(e,t,i,r){var n=this._activeStages,a=n.length,o=this._fxaa,s=this._ao,l=this._bloom,u=this._autoExposure,c=this._tonemapping,d=this._sunShaft,h=s.enabled&&s._isSupported(e),p=l.enabled&&l._isSupported(e),f=this._autoExposureEnabled,m=c.enabled&&c._isSupported(e),g=o.enabled&&o._isSupported(e),y=d.enabled&&d._isSupported(e);if(y||g||h||p||m||0!==a){var v=t;y&&d.ready&&(execute(d,e,v,i,r),v=getOutputTexture(d)),h&&s.ready&&(execute(s,e,v,i,r),v=getOutputTexture(s)),p&&l.ready&&(execute(l,e,v,i,r),v=getOutputTexture(l)),f&&u.ready&&execute(u,e,v,i,r),m&&c.ready&&(execute(c,e,v,i,r),v=getOutputTexture(c));var _=v;if(0<a){execute(n[0],e,v,i,r);for(var C=1;C<a;++C)execute(n[C],e,getOutputTexture(n[C-1]),i,r);_=getOutputTexture(n[a-1])}g&&o.ready&&execute(o,e,_,i,r)}},PostProcessStageCollection.prototype.copy=function(e,t){if(!defined(this._copyColorCommand)){var i=this;this._copyColorCommand=e.createViewportQuadCommand(PassThrough,{uniformMap:{colorTexture:function(){return i.outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)},PostProcessStageCollection.prototype.isDestroyed=function(){return!1},PostProcessStageCollection.prototype.destroy=function(){return this._fxaa.destroy(),this._sunShaft.destroy(),this._ao.destroy(),this._bloom.destroy(),this._autoExposure.destroy(),this._tonemapping.destroy(),this.removeAll(),this._textureCache=this._textureCache&&this._textureCache.destroy(),destroyObject(this)},QuadtreeTileProvider.computeDefaultLevelZeroMaximumGeometricError=function(e){return 2*e.ellipsoid.maximumRadius*Math.PI*.25/(65*e.getNumberOfXTilesAtLevel(0))},Object.defineProperties(QuadtreeTileProvider.prototype,{quadtree:{get:DeveloperError.throwInstantiationError,set:DeveloperError.throwInstantiationError},ready:{get:DeveloperError.throwInstantiationError},tilingScheme:{get:DeveloperError.throwInstantiationError},errorEvent:{get:DeveloperError.throwInstantiationError}}),QuadtreeTileProvider.prototype.update=DeveloperError.throwInstantiationError,QuadtreeTileProvider.prototype.beginUpdate=DeveloperError.throwInstantiationError,QuadtreeTileProvider.prototype.endUpdate=DeveloperError.throwInstantiationError,QuadtreeTileProvider.prototype.getLevelMaximumGeometricError=DeveloperError.throwInstantiationError,QuadtreeTileProvider.prototype.loadTile=DeveloperError.throwInstantiationError,QuadtreeTileProvider.prototype.computeTileVisibility=DeveloperError.throwInstantiationError,QuadtreeTileProvider.prototype.showTileThisFrame=DeveloperError.throwInstantiationError,QuadtreeTileProvider.prototype.computeDistanceToTile=DeveloperError.throwInstantiationError,QuadtreeTileProvider.prototype.isDestroyed=DeveloperError.throwInstantiationError,QuadtreeTileProvider.prototype.destroy=DeveloperError.throwInstantiationError,SceneTransitioner.prototype.completeMorph=function(){defined(this._completeMorph)&&this._completeMorph()},SceneTransitioner.prototype.morphTo2D=function(e,t){defined(this._completeMorph)&&this._completeMorph();var i=this._scene;this._previousMode=i.mode,this._morphToOrthographic=i.camera.frustum instanceof OrthographicFrustum,this._previousMode!==SceneMode$1.SCENE2D&&this._previousMode!==SceneMode$1.MORPHING&&(this._scene.morphStart.raiseEvent(this,this._previousMode,SceneMode$1.SCENE2D,!0),i._mode=SceneMode$1.MORPHING,i.camera._setTransform(Matrix4.IDENTITY),this._previousMode===SceneMode$1.COLUMBUS_VIEW?morphFromColumbusViewTo2D(this,e):morphFrom3DTo2D(this,e,t),0===e&&defined(this._completeMorph)&&this._completeMorph())};var scratchToCVPosition=new Cartesian3,scratchToCVDirection=new Cartesian3,scratchToCVUp=new Cartesian3,scratchToCVPosition2D=new Cartesian3,scratchToCVDirection2D=new Cartesian3,scratchToCVUp2D=new Cartesian3,scratchToCVSurfacePosition=new Cartesian3,scratchToCVCartographic=new Cartographic,scratchToCVToENU=new Matrix4,scratchToCVFrustumPerspective=new PerspectiveFrustum,scratchToCVFrustumOrthographic=new OrthographicFrustum,scratchToCVCamera={position:void 0,direction:void 0,up:void 0,position2D:void 0,direction2D:void 0,up2D:void 0,frustum:void 0};SceneTransitioner.prototype.morphToColumbusView=function(e,t){defined(this._completeMorph)&&this._completeMorph();var i=this._scene;if(this._previousMode=i.mode,this._previousMode!==SceneMode$1.COLUMBUS_VIEW&&this._previousMode!==SceneMode$1.MORPHING){this._scene.morphStart.raiseEvent(this,this._previousMode,SceneMode$1.COLUMBUS_VIEW,!0),i.camera._setTransform(Matrix4.IDENTITY);var r,n=scratchToCVPosition,a=scratchToCVDirection,o=scratchToCVUp;if(0<e)n.x=0,n.y=-1,n.z=1,n=Cartesian3.multiplyByScalar(Cartesian3.normalize(n,n),5*t.maximumRadius,n),Cartesian3.negate(Cartesian3.normalize(n,a),a),Cartesian3.cross(Cartesian3.UNIT_X,a,o);else{var s=i.camera;if(this._previousMode===SceneMode$1.SCENE2D)Cartesian3.clone(s.position,n),n.z=s.frustum.right-s.frustum.left,Cartesian3.negate(Cartesian3.UNIT_Z,a),Cartesian3.clone(Cartesian3.UNIT_Y,o);else{Cartesian3.clone(s.positionWC,n),Cartesian3.clone(s.directionWC,a),Cartesian3.clone(s.upWC,o);var l=t.scaleToGeodeticSurface(n,scratchToCVSurfacePosition),u=Transforms.eastNorthUpToFixedFrame(l,t,scratchToCVToENU);Matrix4.inverseTransformation(u,u),i.mapProjection.project(t.cartesianToCartographic(n,scratchToCVCartographic),n),Matrix4.multiplyByPointAsVector(u,a,a),Matrix4.multiplyByPointAsVector(u,o,o)}}this._morphToOrthographic?((r=scratchToCVFrustumOrthographic).width=i.camera.frustum.right-i.camera.frustum.left,r.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight):((r=scratchToCVFrustumPerspective).aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,r.fov=CesiumMath.toRadians(60));var c=scratchToCVCamera;c.position=n,c.direction=a,c.up=o,c.frustum=r;var d=completeColumbusViewCallback(c);createMorphHandler(this,d),this._previousMode===SceneMode$1.SCENE2D?morphFrom2DToColumbusView(this,e,c,d):(c.position2D=Matrix4.multiplyByPoint(Camera.TRANSFORM_2D,n,scratchToCVPosition2D),c.direction2D=Matrix4.multiplyByPointAsVector(Camera.TRANSFORM_2D,a,scratchToCVDirection2D),c.up2D=Matrix4.multiplyByPointAsVector(Camera.TRANSFORM_2D,o,scratchToCVUp2D),i._mode=SceneMode$1.MORPHING,morphFrom3DToColumbusView(this,e,c,d)),0===e&&defined(this._completeMorph)&&this._completeMorph()}};var scratchCVTo3DCamera={position:new Cartesian3,direction:new Cartesian3,up:new Cartesian3,frustum:void 0},scratch2DTo3DFrustumPersp=new PerspectiveFrustum;function createMorphHandler(e,t){if(e._scene.completeMorphOnUserInput){e._morphHandler=new ScreenSpaceEventHandler(e._scene.canvas);var i=function(){e._morphCancelled=!0,e._scene.camera.cancelFlight(),t(e)};e._completeMorph=i,e._morphHandler.setInputAction(i,ScreenSpaceEventType$1.LEFT_DOWN),e._morphHandler.setInputAction(i,ScreenSpaceEventType$1.MIDDLE_DOWN),e._morphHandler.setInputAction(i,ScreenSpaceEventType$1.RIGHT_DOWN),e._morphHandler.setInputAction(i,ScreenSpaceEventType$1.WHEEL)}}function destroyMorphHandler(e){for(var t=e._currentTweens,i=0;i<t.length;++i)t[i].cancelTween();e._currentTweens.length=0,e._morphHandler=e._morphHandler&&e._morphHandler.destroy()}SceneTransitioner.prototype.morphTo3D=function(e,t){defined(this._completeMorph)&&this._completeMorph();var i=this._scene;if(this._previousMode=i.mode,this._previousMode!==SceneMode$1.SCENE3D&&this._previousMode!==SceneMode$1.MORPHING){if(this._scene.morphStart.raiseEvent(this,this._previousMode,SceneMode$1.SCENE3D,!0),i._mode=SceneMode$1.MORPHING,i.camera._setTransform(Matrix4.IDENTITY),this._previousMode===SceneMode$1.SCENE2D)morphFrom2DTo3D(this,e,t);else{var r,n;0<e?(r=scratchCVTo3DCamera,Cartesian3.fromDegrees(0,0,5*t.maximumRadius,t,r.position),Cartesian3.negate(r.position,r.direction),Cartesian3.normalize(r.direction,r.direction),Cartesian3.clone(Cartesian3.UNIT_Z,r.up)):r=getColumbusViewTo3DCamera(this,t);var a=i.camera;a.frustum instanceof OrthographicFrustum?n=a.frustum.clone():((n=scratch2DTo3DFrustumPersp).aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,n.fov=CesiumMath.toRadians(60)),r.frustum=n;var o=complete3DCallback(r);createMorphHandler(this,o),morphFromColumbusViewTo3D(this,e,r,o)}0===e&&defined(this._completeMorph)&&this._completeMorph()}},SceneTransitioner.prototype.isDestroyed=function(){return!1},SceneTransitioner.prototype.destroy=function(){return destroyMorphHandler(this),destroyObject(this)};var scratchCVTo3DCartographic=new Cartographic,scratchCVTo3DSurfacePoint=new Cartesian3,scratchCVTo3DFromENU=new Matrix4;function getColumbusViewTo3DCamera(e,t){var i=e._scene,r=i.camera,n=scratchCVTo3DCamera,a=n.position,o=n.direction,s=n.up,l=i.mapProjection.unproject(r.position,scratchCVTo3DCartographic);t.cartographicToCartesian(l,a);var u=t.scaleToGeodeticSurface(a,scratchCVTo3DSurfacePoint),c=Transforms.eastNorthUpToFixedFrame(u,t,scratchCVTo3DFromENU);return Matrix4.multiplyByPointAsVector(c,r.direction,o),Matrix4.multiplyByPointAsVector(c,r.up,s),n}var scratchCVTo3DStartPos=new Cartesian3,scratchCVTo3DStartDir=new Cartesian3,scratchCVTo3DStartUp=new Cartesian3,scratchCVTo3DEndPos=new Cartesian3,scratchCVTo3DEndDir=new Cartesian3,scratchCVTo3DEndUp=new Cartesian3;function morphFromColumbusViewTo3D(e,t,i,r){t*=.5;var n=e._scene,a=n.camera,o=Cartesian3.clone(a.position,scratchCVTo3DStartPos),s=Cartesian3.clone(a.direction,scratchCVTo3DStartDir),l=Cartesian3.clone(a.up,scratchCVTo3DStartUp),u=Matrix4.multiplyByPoint(Camera.TRANSFORM_2D_INVERSE,i.position,scratchCVTo3DEndPos),c=Matrix4.multiplyByPointAsVector(Camera.TRANSFORM_2D_INVERSE,i.direction,scratchCVTo3DEndDir),d=Matrix4.multiplyByPointAsVector(Camera.TRANSFORM_2D_INVERSE,i.up,scratchCVTo3DEndUp);var h=n.tweens.add({duration:t,easingFunction:EasingFunction$1.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:function(e){columbusViewMorph(o,u,e.time,a.position),columbusViewMorph(s,c,e.time,a.direction),columbusViewMorph(l,d,e.time,a.up),Cartesian3.cross(a.direction,a.up,a.right),Cartesian3.normalize(a.right,a.right)},complete:function(){addMorphTimeAnimations(e,n,0,1,t,r)}});e._currentTweens.push(h)}var scratch2DTo3DFrustumOrtho=new OrthographicFrustum,scratch3DToCVStartPos=new Cartesian3,scratch3DToCVStartDir=new Cartesian3,scratch3DToCVStartUp=new Cartesian3,scratch3DToCVEndPos=new Cartesian3,scratch3DToCVEndDir=new Cartesian3,scratch3DToCVEndUp=new Cartesian3;function morphFrom2DTo3D(e,t,i){t/=3;var r,n,a=e._scene,o=a.camera;0<t?(r=scratchCVTo3DCamera,Cartesian3.fromDegrees(0,0,5*i.maximumRadius,i,r.position),Cartesian3.negate(r.position,r.direction),Cartesian3.normalize(r.direction,r.direction),Cartesian3.clone(Cartesian3.UNIT_Z,r.up)):(o.position.z=o.frustum.right-o.frustum.left,r=getColumbusViewTo3DCamera(e,i)),e._morphToOrthographic?((n=scratch2DTo3DFrustumOrtho).aspectRatio=a.drawingBufferWidth/a.drawingBufferHeight,n.width=o.frustum.right-o.frustum.left):((n=scratch2DTo3DFrustumPersp).aspectRatio=a.drawingBufferWidth/a.drawingBufferHeight,n.fov=CesiumMath.toRadians(60)),r.frustum=n;var s,l=complete3DCallback(r);createMorphHandler(e,l),s=e._morphToOrthographic?function(){morphFromColumbusViewTo3D(e,t,r,l)}:function(){morphOrthographicToPerspective(e,t,r,function(){morphFromColumbusViewTo3D(e,t,r,l)})},0<t?(a._mode=SceneMode$1.SCENE2D,o.flyTo({duration:t,destination:Cartesian3.fromDegrees(0,0,5*i.maximumRadius,i,scratch3DToCVEndPos),complete:function(){a._mode=SceneMode$1.MORPHING,s()}})):s()}function columbusViewMorph(e,t,i,r){return Cartesian3.lerp(e,t,i,r)}function morphPerspectiveToOrthographic(e,t,i,r,n){var a=e._scene,o=a.camera;if(!(o.frustum instanceof OrthographicFrustum)){var s=o.frustum.fov,l=.5*CesiumMath.RADIANS_PER_DEGREE,u=i.position.z*Math.tan(.5*s);o.frustum.far=u/Math.tan(.5*l)+1e7;var c=a.tweens.add({duration:t,easingFunction:EasingFunction$1.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:function(e){o.frustum.fov=CesiumMath.lerp(s,l,e.time);var t=u/Math.tan(.5*o.frustum.fov);r(o,t)},complete:function(){o.frustum=i.frustum.clone(),n(e)}});e._currentTweens.push(c)}}var scratchCVTo2DStartPos=new Cartesian3,scratchCVTo2DStartDir=new Cartesian3,scratchCVTo2DStartUp=new Cartesian3,scratchCVTo2DEndPos=new Cartesian3,scratchCVTo2DEndDir=new Cartesian3,scratchCVTo2DEndUp=new Cartesian3,scratchCVTo2DFrustum=new OrthographicOffCenterFrustum,scratchCVTo2DRay=new Ray,scratchCVTo2DPickPos=new Cartesian3,scratchCVTo2DCamera={position:void 0,direction:void 0,up:void 0,frustum:void 0};function morphFromColumbusViewTo2D(e,t){t*=.5;var i=e._scene,r=i.camera,n=Cartesian3.clone(r.position,scratchCVTo2DStartPos),a=Cartesian3.clone(r.direction,scratchCVTo2DStartDir),o=Cartesian3.clone(r.up,scratchCVTo2DStartUp),s=Cartesian3.negate(Cartesian3.UNIT_Z,scratchCVTo2DEndDir),l=Cartesian3.clone(Cartesian3.UNIT_Y,scratchCVTo2DEndUp),u=scratchCVTo2DEndPos;if(0<t)Cartesian3.clone(Cartesian3.ZERO,scratchCVTo2DEndPos),u.z=5*i.mapProjection.ellipsoid.maximumRadius;else{Cartesian3.clone(n,scratchCVTo2DEndPos);var c=scratchCVTo2DRay;Matrix4.multiplyByPoint(Camera.TRANSFORM_2D,n,c.origin),Matrix4.multiplyByPointAsVector(Camera.TRANSFORM_2D,a,c.direction);var d=i.globe;if(defined(d)){var h=d.pickWorldCoordinates(c,i,scratchCVTo2DPickPos);defined(h)&&(Matrix4.multiplyByPoint(Camera.TRANSFORM_2D_INVERSE,h,u),u.z+=Cartesian3.distance(n,u))}}var p=scratchCVTo2DFrustum;p.right=.5*u.z,p.left=-p.right,p.top=p.right*(i.drawingBufferHeight/i.drawingBufferWidth),p.bottom=-p.top;var f=scratchCVTo2DCamera;f.position=u,f.direction=s,f.up=l,f.frustum=p;var m=complete2DCallback(f);function g(e,t){e.position.z=t}createMorphHandler(e,m);var y=i.tweens.add({duration:t,easingFunction:EasingFunction$1.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:function(e){columbusViewMorph(n,u,e.time,r.position),columbusViewMorph(a,s,e.time,r.direction),columbusViewMorph(o,l,e.time,r.up),Cartesian3.cross(r.direction,r.up,r.right),Cartesian3.normalize(r.right,r.right),r._adjustOrthographicFrustum(!0)},complete:function(){morphPerspectiveToOrthographic(e,t,f,g,m)}});e._currentTweens.push(y)}var scratch3DTo2DCartographic=new Cartographic,scratch3DTo2DCamera={position:new Cartesian3,direction:new Cartesian3,up:new Cartesian3,position2D:new Cartesian3,direction2D:new Cartesian3,up2D:new Cartesian3,frustum:new OrthographicOffCenterFrustum},scratch3DTo2DEndCamera={position:new Cartesian3,direction:new Cartesian3,up:new Cartesian3,frustum:void 0},scratch3DTo2DPickPosition=new Cartesian3,scratch3DTo2DRay=new Ray,scratch3DTo2DToENU=new Matrix4,scratch3DTo2DSurfacePoint=new Cartesian3;function morphFrom3DTo2D(e,t,i){t*=.5;var r=e._scene,n=r.camera,a=scratch3DTo2DCamera;if(0<t)Cartesian3.clone(Cartesian3.ZERO,a.position),a.position.z=5*i.maximumRadius,Cartesian3.negate(Cartesian3.UNIT_Z,a.direction),Cartesian3.clone(Cartesian3.UNIT_Y,a.up);else{i.cartesianToCartographic(n.positionWC,scratch3DTo2DCartographic),r.mapProjection.project(scratch3DTo2DCartographic,a.position),Cartesian3.negate(Cartesian3.UNIT_Z,a.direction),Cartesian3.clone(Cartesian3.UNIT_Y,a.up);var o=scratch3DTo2DRay;Cartesian3.clone(a.position2D,o.origin);var s=Cartesian3.clone(n.directionWC,o.direction),l=i.scaleToGeodeticSurface(n.positionWC,scratch3DTo2DSurfacePoint),u=Transforms.eastNorthUpToFixedFrame(l,i,scratch3DTo2DToENU);Matrix4.inverseTransformation(u,u),Matrix4.multiplyByPointAsVector(u,s,s),Matrix4.multiplyByPointAsVector(Camera.TRANSFORM_2D,s,s);var c=r.globe;if(defined(c)){var d=c.pickWorldCoordinates(o,r,scratch3DTo2DPickPosition);if(defined(d)){var h=Cartesian3.distance(a.position2D,d);d.x+=h,Cartesian3.clone(d,a.position2D)}}}function p(e,t){e.position.x=t}Matrix4.multiplyByPoint(Camera.TRANSFORM_2D,a.position,a.position2D),Matrix4.multiplyByPointAsVector(Camera.TRANSFORM_2D,a.direction,a.direction2D),Matrix4.multiplyByPointAsVector(Camera.TRANSFORM_2D,a.up,a.up2D);var f=a.frustum;f.right=.5*a.position.z,f.left=-f.right,f.top=f.right*(r.drawingBufferHeight/r.drawingBufferWidth),f.bottom=-f.top;var m=scratch3DTo2DEndCamera;Matrix4.multiplyByPoint(Camera.TRANSFORM_2D_INVERSE,a.position2D,m.position),Cartesian3.clone(a.direction,m.direction),Cartesian3.clone(a.up,m.up),m.frustum=f;var g=complete2DCallback(m);createMorphHandler(e,g),morphFrom3DToColumbusView(e,t,a,function(){morphPerspectiveToOrthographic(e,t,a,p,g)})}function morphOrthographicToPerspective(e,t,i,r){var n=e._scene,a=n.camera,o=a.frustum.right-a.frustum.left;a.frustum=i.frustum.clone();var s=a.frustum.fov,l=.5*CesiumMath.RADIANS_PER_DEGREE,u=o*Math.tan(.5*s);a.frustum.far=u/Math.tan(.5*l)+1e7,a.frustum.fov=l;var c=n.tweens.add({duration:t,easingFunction:EasingFunction$1.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:function(e){a.frustum.fov=CesiumMath.lerp(l,s,e.time),a.position.z=u/Math.tan(.5*a.frustum.fov)},complete:function(){r(e)}});e._currentTweens.push(c)}function morphFrom2DToColumbusView(n,a,o,s){a*=.5;var l=n._scene,u=l.camera,c=Cartesian3.clone(o.position,scratch3DToCVEndPos),d=Cartesian3.clone(o.direction,scratch3DToCVEndDir),h=Cartesian3.clone(o.up,scratch3DToCVEndUp);function e(){u.frustum=o.frustum.clone();var t=Cartesian3.clone(u.position,scratch3DToCVStartPos),i=Cartesian3.clone(u.direction,scratch3DToCVStartDir),r=Cartesian3.clone(u.up,scratch3DToCVStartUp);t.z=c.z;var e=l.tweens.add({duration:a,easingFunction:EasingFunction$1.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:function(e){columbusViewMorph(t,c,e.time,u.position),columbusViewMorph(i,d,e.time,u.direction),columbusViewMorph(r,h,e.time,u.up),Cartesian3.cross(u.direction,u.up,u.right),Cartesian3.normalize(u.right,u.right)},complete:function(){s(n)}});n._currentTweens.push(e)}l._mode=SceneMode$1.MORPHING,n._morphToOrthographic?e():morphOrthographicToPerspective(n,0,o,e)}function morphFrom3DToColumbusView(e,t,i,r){var n=e._scene,a=n.camera,o=Cartesian3.clone(a.position,scratch3DToCVStartPos),s=Cartesian3.clone(a.direction,scratch3DToCVStartDir),l=Cartesian3.clone(a.up,scratch3DToCVStartUp),u=Cartesian3.clone(i.position2D,scratch3DToCVEndPos),c=Cartesian3.clone(i.direction2D,scratch3DToCVEndDir),d=Cartesian3.clone(i.up2D,scratch3DToCVEndUp);var h=n.tweens.add({duration:t,easingFunction:EasingFunction$1.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:function(e){columbusViewMorph(o,u,e.time,a.position),columbusViewMorph(s,c,e.time,a.direction),columbusViewMorph(l,d,e.time,a.up),Cartesian3.cross(a.direction,a.up,a.right),Cartesian3.normalize(a.right,a.right),a._adjustOrthographicFrustum(!0)},complete:function(){addMorphTimeAnimations(e,n,1,0,t,r)}});e._currentTweens.push(h)}function addMorphTimeAnimations(e,t,i,r,n,a){var o={object:t,property:"morphTime",startValue:i,stopValue:r,duration:n,easingFunction:EasingFunction$1.QUARTIC_OUT};defined(a)&&(o.complete=function(){a(e)});var s=t.tweens.addProperty(o);e._currentTweens.push(s)}function complete3DCallback(a){return function(e){var t=e._scene;t._mode=SceneMode$1.SCENE3D,t.morphTime=SceneMode$1.getMorphTime(SceneMode$1.SCENE3D),destroyMorphHandler(e);var i=t.camera;e._previousMode===SceneMode$1.MORPHING&&!e._morphCancelled||(e._morphCancelled=!1,Cartesian3.clone(a.position,i.position),Cartesian3.clone(a.direction,i.direction),Cartesian3.clone(a.up,i.up),Cartesian3.cross(i.direction,i.up,i.right),Cartesian3.normalize(i.right,i.right),i.frustum=a.frustum.clone());var r=i.frustum;t.frameState.useLogDepth&&(r.near=.1,r.far=1e10);var n=defined(e._completeMorph);e._completeMorph=void 0,t.camera.update(t.mode),e._scene.morphComplete.raiseEvent(e,e._previousMode,SceneMode$1.SCENE3D,n)}}function complete2DCallback(n){return function(e){var t=e._scene;t._mode=SceneMode$1.SCENE2D,t.morphTime=SceneMode$1.getMorphTime(SceneMode$1.SCENE2D),destroyMorphHandler(e);var i=t.camera;Cartesian3.clone(n.position,i.position),i.position.z=2*t.mapProjection.ellipsoid.maximumRadius,Cartesian3.clone(n.direction,i.direction),Cartesian3.clone(n.up,i.up),Cartesian3.cross(i.direction,i.up,i.right),Cartesian3.normalize(i.right,i.right),i.frustum=n.frustum.clone();var r=defined(e._completeMorph);e._completeMorph=void 0,t.camera.update(t.mode),e._scene.morphComplete.raiseEvent(e,e._previousMode,SceneMode$1.SCENE2D,r)}}function completeColumbusViewCallback(a){return function(e){var t=e._scene;t._mode=SceneMode$1.COLUMBUS_VIEW,t.morphTime=SceneMode$1.getMorphTime(SceneMode$1.COLUMBUS_VIEW),destroyMorphHandler(e);var i=t.camera;e._previousModeMode===SceneMode$1.MORPHING&&!e._morphCancelled||(e._morphCancelled=!1,Cartesian3.clone(a.position,i.position),Cartesian3.clone(a.direction,i.direction),Cartesian3.clone(a.up,i.up),Cartesian3.cross(i.direction,i.up,i.right),Cartesian3.normalize(i.right,i.right));var r=i.frustum;t.frameState.useLogDepth&&(r.near=.1,r.far=1e10);var n=defined(e._completeMorph);e._completeMorph=void 0,t.camera.update(t.mode),e._scene.morphComplete.raiseEvent(e,e._previousMode,SceneMode$1.COLUMBUS_VIEW,n)}}function Tween(e,t,i,r,n,a,o,s,l,u){this._tweens=e,this._tweenjs=t,this._startObject=clone(i),this._stopObject=clone(r),this._duration=n,this._delay=a,this._easingFunction=o,this._update=s,this._complete=l,this.cancel=u,this.needsStart=!0}function TweenCollection(){this._tweens=[]}function ScreenSpaceCameraController(e){this.enableInputs=!0,this.enableTranslate=!0,this.enableZoom=!0,this.enableRotate=!0,this.enableTilt=!0,this.enableLook=!0,this.inertiaSpin=.9,this.inertiaTranslate=.9,this.inertiaZoom=.8,this.maximumMovementRatio=.1,this.bounceAnimationTime=3,this.minimumZoomDistance=1,this.maximumZoomDistance=Number.POSITIVE_INFINITY,this.translateEventTypes=CameraEventType$1.LEFT_DRAG,this.zoomEventTypes=[CameraEventType$1.RIGHT_DRAG,CameraEventType$1.WHEEL,CameraEventType$1.PINCH],this.rotateEventTypes=CameraEventType$1.LEFT_DRAG,this.tiltEventTypes=[CameraEventType$1.MIDDLE_DRAG,CameraEventType$1.PINCH,{eventType:CameraEventType$1.LEFT_DRAG,modifier:KeyboardEventModifier$1.CTRL},{eventType:CameraEventType$1.RIGHT_DRAG,modifier:KeyboardEventModifier$1.CTRL}],this.lookEventTypes={eventType:CameraEventType$1.LEFT_DRAG,modifier:KeyboardEventModifier$1.SHIFT},this.minimumPickingTerrainHeight=15e4,this._minimumPickingTerrainHeight=this.minimumPickingTerrainHeight,this.minimumCollisionTerrainHeight=15e3,this._minimumCollisionTerrainHeight=this.minimumCollisionTerrainHeight,this.minimumTrackBallHeight=75e5,this._minimumTrackBallHeight=this.minimumTrackBallHeight,this.enableCollisionDetection=!0,this.enableModelCollisionDetection=!1,this.enableGroundRoaming=!1,this.enableModelGroundCollisionDetection=!1,this.defaultGroundRoamingHeight=1.8,this.defaultCollisionRayWidth=.5,this._scene=e,this._globe=void 0,this._ellipsoid=void 0,this._aggregator=new CameraEventAggregator(e.canvas),this._lastInertiaSpinMovement=void 0,this._lastInertiaZoomMovement=void 0,this._lastInertiaTranslateMovement=void 0,this._lastInertiaTiltMovement=void 0,this._tweens=new TweenCollection,this._tween=void 0,this._horizontalRotationAxis=void 0,this._tiltCenterMousePosition=new Cartesian2(-1,-1),this._tiltCenter=new Cartesian3,this._rotateMousePosition=new Cartesian2(-1,-1),this._rotateStartPosition=new Cartesian3,this._strafeStartPosition=new Cartesian3,this._zoomMouseStart=new Cartesian2(-1,-1),this._zoomWorldPosition=new Cartesian3,this._useZoomWorldPosition=!1,this._tiltCVOffMap=!1,this._looking=!1,this._rotating=!1,this._strafing=!1,this._zoomingOnVector=!1,this._rotatingZoom=!1,this._adjustedHeightForTerrain=!1;var t=e.mapProjection;this._maxCoord=t.project(new Cartographic(Math.PI,CesiumMath.PI_OVER_TWO)),this._zoomFactor=5,this._rotateFactor=void 0,this._rotateRateRangeAdjustment=void 0,this._maximumRotateRate=1.77,this._minimumRotateRate=2e-4,this._minimumZoomRate=20,this._maximumZoomRate=5906376272e3}function decay(e,t){if(e<0)return 0;var i=25*(1-t);return Math.exp(-i*e)}function sameMousePosition(e){return Cartesian2.equalsEpsilon(e.startPosition,e.endPosition,CesiumMath.EPSILON14)}Object.defineProperties(Tween.prototype,{startObject:{get:function(){return this._startObject}},stopObject:{get:function(){return this._stopObject}},duration:{get:function(){return this._duration}},delay:{get:function(){return this._delay}},easingFunction:{get:function(){return this._easingFunction}},update:{get:function(){return this._update}},complete:{get:function(){return this._complete}},tweenjs:{get:function(){return this._tweenjs}}}),Tween.prototype.cancelTween=function(){this._tweens.remove(this)},Object.defineProperties(TweenCollection.prototype,{length:{get:function(){return this._tweens.length}}}),TweenCollection.prototype.add=function(e){if(0===(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).duration)return defined(e.complete)&&e.complete(),new Tween(this);var t=e.duration/TimeConstants$1.SECONDS_PER_MILLISECOND,i=defaultValue(e.delay,0),r=i/TimeConstants$1.SECONDS_PER_MILLISECOND,n=defaultValue(e.easingFunction,EasingFunction$1.LINEAR_NONE),a=e.startObject,o=new TWEEN.Tween(a);o.to(clone(e.stopObject),t),o.delay(r),o.easing(n),defined(e.update)&&o.onUpdate(function(){e.update(a)}),o.onComplete(defaultValue(e.complete,null)),o.repeat(defaultValue(e._repeat,0));var s=new Tween(this,o,e.startObject,e.stopObject,e.duration,i,n,e.update,e.complete,e.cancel);return this._tweens.push(s),s},TweenCollection.prototype.addProperty=function(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).object,i=e.property,r=e.startValue,n=e.stopValue;return this.add({startObject:{value:r},stopObject:{value:n},duration:defaultValue(e.duration,3),delay:e.delay,easingFunction:e.easingFunction,update:function(e){t[i]=e.value},complete:e.complete,cancel:e.cancel,_repeat:e._repeat})},TweenCollection.prototype.addAlpha=function(e){var r=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).material,n=[];for(var t in r.uniforms)r.uniforms.hasOwnProperty(t)&&defined(r.uniforms[t])&&defined(r.uniforms[t].alpha)&&n.push(t);return this.add({startObject:{alpha:defaultValue(e.startValue,0)},stopObject:{alpha:defaultValue(e.stopValue,1)},duration:defaultValue(e.duration,3),delay:e.delay,easingFunction:e.easingFunction,update:function(e){for(var t=n.length,i=0;i<t;++i)r.uniforms[n[i]].alpha=e.alpha},complete:e.complete,cancel:e.cancel})},TweenCollection.prototype.addOffsetIncrement=function(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).material.uniforms;return this.addProperty({object:t,property:"offset",startValue:t.offset,stopValue:t.offset+1,duration:e.duration,delay:e.delay,easingFunction:e.easingFunction,update:e.update,cancel:e.cancel,_repeat:1/0})},TweenCollection.prototype.remove=function(e){if(!defined(e))return!1;var t=this._tweens.indexOf(e);return-1!==t&&(e.tweenjs.stop(),defined(e.cancel)&&e.cancel(),this._tweens.splice(t,1),!0)},TweenCollection.prototype.removeAll=function(){for(var e=this._tweens,t=0;t<e.length;++t){var i=e[t];i.tweenjs.stop(),defined(i.cancel)&&i.cancel()}e.length=0},TweenCollection.prototype.contains=function(e){return defined(e)&&-1!==this._tweens.indexOf(e)},TweenCollection.prototype.get=function(e){return this._tweens[e]},TweenCollection.prototype.update=function(e){var t=this._tweens,i=0;for(e=defined(e)?e/TimeConstants$1.SECONDS_PER_MILLISECOND:getTimestamp$1();i<t.length;){var r=t[i],n=r.tweenjs;r.needsStart?(r.needsStart=!1,n.start(e)):n.update(e)?i++:(n.stop(),t.splice(i,1))}};var inertiaMaxClickTimeThreshold=.4;function maintainInertia(e,t,i,r,n,a,o){var s=a[o];defined(s)||(s=a[o]={startPosition:new Cartesian2,endPosition:new Cartesian2,motion:new Cartesian2,active:!1});var l=e.getButtonPressTime(t,i),u=e.getButtonReleaseTime(t,i),c=l&&u&&(u.getTime()-l.getTime())/1e3,d=new Date,h=u&&(d.getTime()-u.getTime())/1e3;if(l&&u&&c<inertiaMaxClickTimeThreshold){var p=decay(h,r);if(s.active)s.startPosition=Cartesian2.clone(s.endPosition,s.startPosition),s.endPosition=Cartesian2.multiplyByScalar(s.motion,p,s.endPosition),s.endPosition=Cartesian2.add(s.startPosition,s.endPosition,s.endPosition),s.motion=Cartesian2.clone(Cartesian2.ZERO,s.motion);else{var f=e.getLastMovement(t,i);if(!defined(f)||sameMousePosition(f))return;s.motion.x=.5*(f.endPosition.x-f.startPosition.x),s.motion.y=.5*(f.endPosition.y-f.startPosition.y),s.startPosition=Cartesian2.clone(f.startPosition,s.startPosition),s.endPosition=Cartesian2.multiplyByScalar(s.motion,p,s.endPosition),s.endPosition=Cartesian2.add(s.startPosition,s.endPosition,s.endPosition),s.active=!0}if(isNaN(s.endPosition.x)||isNaN(s.endPosition.y)||Cartesian2.distance(s.startPosition,s.endPosition)<.5)return void(s.active=!1);if(!e.isButtonDown(t,i))n(a,e.getStartMousePosition(t,i),s)}else s.active=!1}var scratchEventTypeArray=[];function reactToInput(e,t,i,r,n,a){if(defined(i)){var o=e._aggregator;Array.isArray(i)||(scratchEventTypeArray[0]=i,i=scratchEventTypeArray);for(var s=i.length,l=0;l<s;++l){var u=i[l],c=defined(u.eventType)?u.eventType:u,d=u.modifier,h=o.isMoving(c,d)&&o.getMovement(c,d),p=o.getStartMousePosition(c,d);e.enableInputs&&t&&(h?r(e,p,h):n<1&&maintainInertia(o,c,d,n,r,e,a))}}}var scratchZoomPickRay=new Ray,scratchPickCartesian=new Cartesian3,scratchZoomOffset=new Cartesian2,scratchZoomDirection=new Cartesian3,scratchCenterPixel=new Cartesian2,scratchCenterPosition=new Cartesian3,scratchPositionNormal$2=new Cartesian3,scratchPickNormal=new Cartesian3,scratchZoomAxis=new Cartesian3,scratchCameraPositionNormal=new Cartesian3,scratchTargetNormal=new Cartesian3,scratchCameraPosition$1=new Cartesian3,scratchCameraUpNormal=new Cartesian3,scratchCameraRightNormal=new Cartesian3,scratchForwardNormal=new Cartesian3,scratchPositionToTarget=new Cartesian3,scratchPositionToTargetNormal=new Cartesian3,scratchPan=new Cartesian3,scratchCenterMovement=new Cartesian3,scratchCenter$a=new Cartesian3,scratchCartesian$a=new Cartesian3,scratchCartesianTwo=new Cartesian3,scratchCartesianThree=new Cartesian3,scratchZoomViewOptions={orientation:new HeadingPitchRoll};function handleZoom(e,t,i,r,n,a){var o=1;defined(a)&&(o=CesiumMath.clamp(Math.abs(a),.25,1));var s=e.minimumZoomDistance*o,l=e.maximumZoomDistance,u=r*(n-s);u=CesiumMath.clamp(u,e._minimumZoomRate,e._maximumZoomRate);var c=(i.endPosition.y-i.startPosition.y)/e._scene.canvas.clientHeight,d=u*(c=Math.min(c,e.maximumMovementRatio));if(!(0<d&&Math.abs(n-s)<1||d<0&&Math.abs(n-l)<1)){n-d<s?d=n-s-1:l<n-d&&(d=n-l);var h=e._scene,p=h.camera,f=h.mode,m=scratchZoomViewOptions.orientation;if(m.heading=p.heading,m.pitch=p.pitch,m.roll=p.roll,p.frustum instanceof OrthographicFrustum)0<Math.abs(d)&&(p.zoomIn(d),p._adjustOrthographicFrustum());else{var g,y=Cartesian2.equals(t,e._zoomMouseStart),v=e._zoomingOnVector,_=e._rotatingZoom;if(y||(e._zoomMouseStart=Cartesian2.clone(t,e._zoomMouseStart),defined(e._globe)&&(g=f===SceneMode$1.SCENE2D?(g=p.getPickRay(t,scratchZoomPickRay).origin,Cartesian3.fromElements(g.y,g.z,g.x)):pickGlobe(e,t,scratchPickCartesian)),defined(g)?(e._useZoomWorldPosition=!0,e._zoomWorldPosition=Cartesian3.clone(g,e._zoomWorldPosition)):e._useZoomWorldPosition=!1,v=e._zoomingOnVector=!1,_=e._rotatingZoom=!1),e._useZoomWorldPosition){var C=f===SceneMode$1.COLUMBUS_VIEW;if(p.positionCartographic.height<2e6&&(_=!0),!y||_){if(f===SceneMode$1.SCENE2D){var x=e._zoomWorldPosition,b=p.position;if(!Cartesian3.equals(x,b)&&p.positionCartographic.height<2*e._maxCoord.x){var A=p.position.x,S=Cartesian3.subtract(x,b,scratchZoomDirection);Cartesian3.normalize(S,S);var w=Cartesian3.distance(x,b)*d/(.5*p.getMagnitude());p.move(S,.5*w),(p.position.x<0&&0<A||0<p.position.x&&A<0)&&(g=p.getPickRay(t,scratchZoomPickRay).origin,g=Cartesian3.fromElements(g.y,g.z,g.x),e._zoomWorldPosition=Cartesian3.clone(g,e._zoomWorldPosition))}}else if(f===SceneMode$1.SCENE3D){var E=Cartesian3.normalize(p.position,scratchCameraPositionNormal);if(p.positionCartographic.height<3e3&&Math.abs(Cartesian3.dot(p.direction,E))<.6)C=!0;else{var T=h.canvas,P=scratchCenterPixel;P.x=T.clientWidth/2,P.y=T.clientHeight/2;var M=pickGlobe(e,P,scratchCenterPosition);if(defined(M)&&p.positionCartographic.height<1e6){var D=scratchCameraPosition$1;Cartesian3.clone(p.position,D);var I=e._zoomWorldPosition,O=scratchTargetNormal;if(O=Cartesian3.normalize(I,O),Cartesian3.dot(O,E)<0)return;var R=scratchCenter$a,L=scratchForwardNormal;Cartesian3.clone(p.direction,L),Cartesian3.add(D,Cartesian3.multiplyByScalar(L,1e3,scratchCartesian$a),R);var N=scratchPositionToTarget,k=scratchPositionToTargetNormal;Cartesian3.subtract(I,D,N),Cartesian3.normalize(N,k);var B=Cartesian3.dot(E,k);if(0<=B)return void(e._zoomMouseStart.x=-1);var F=Math.acos(-B),V=Cartesian3.magnitude(D),z=Cartesian3.magnitude(I),U=V-d,G=Cartesian3.magnitude(N),$=Math.asin(CesiumMath.clamp(G/z*Math.sin(F),-1,1))-Math.asin(CesiumMath.clamp(U/z*Math.sin(F),-1,1))+F,H=scratchCameraUpNormal;Cartesian3.normalize(D,H);var W=scratchCameraRightNormal;W=Cartesian3.cross(k,H,W),W=Cartesian3.normalize(W,W),Cartesian3.normalize(Cartesian3.cross(H,W,scratchCartesian$a),L),Cartesian3.multiplyByScalar(Cartesian3.normalize(R,scratchCartesian$a),Cartesian3.magnitude(R)-d,R),Cartesian3.normalize(D,D),Cartesian3.multiplyByScalar(D,U,D);var j=scratchPan;Cartesian3.multiplyByScalar(Cartesian3.add(Cartesian3.multiplyByScalar(H,Math.cos($)-1,scratchCartesianTwo),Cartesian3.multiplyByScalar(L,Math.sin($),scratchCartesianThree),scratchCartesian$a),U,j),Cartesian3.add(D,j,D),Cartesian3.normalize(R,H),Cartesian3.normalize(Cartesian3.cross(H,W,scratchCartesian$a),L);var q=scratchCenterMovement;return Cartesian3.multiplyByScalar(Cartesian3.add(Cartesian3.multiplyByScalar(H,Math.cos($)-1,scratchCartesianTwo),Cartesian3.multiplyByScalar(L,Math.sin($),scratchCartesianThree),scratchCartesian$a),Cartesian3.magnitude(R),q),Cartesian3.add(R,q,R),Cartesian3.clone(D,p.position),Cartesian3.normalize(Cartesian3.subtract(R,D,scratchCartesian$a),p.direction),Cartesian3.clone(p.direction,p.direction),Cartesian3.cross(p.direction,p.up,p.right),Cartesian3.cross(p.right,p.direction,p.up),void p.setView(scratchZoomViewOptions)}if(defined(M)){var Q=Cartesian3.normalize(M,scratchPositionNormal$2),Y=Cartesian3.normalize(e._zoomWorldPosition,scratchPickNormal),X=Cartesian3.dot(Y,Q);if(0<X&&X<1){var Z=CesiumMath.acosClamped(X),J=Cartesian3.cross(Y,Q,scratchZoomAxis),K=d/(Math.abs(Z)>CesiumMath.toRadians(20)?.75*p.positionCartographic.height:p.positionCartographic.height-d);p.rotate(J,Z*K)}}else C=!0}}e._rotatingZoom=!C}if(!y&&C||v){var ee=SceneTransforms.wgs84ToWindowCoordinates(h,e._zoomWorldPosition,scratchZoomOffset),te=(f!==SceneMode$1.COLUMBUS_VIEW&&Cartesian2.equals(t,e._zoomMouseStart)&&defined(ee)?p.getPickRay(ee,scratchZoomPickRay):p.getPickRay(t,scratchZoomPickRay)).direction;f!==SceneMode$1.COLUMBUS_VIEW&&f!==SceneMode$1.SCENE2D||Cartesian3.fromElements(te.y,te.z,te.x,te),p.move(te,d),e._zoomingOnVector=!0}else p.zoomIn(d);p.setView(scratchZoomViewOptions)}else p.zoomIn(d)}}}var translate2DStart=new Ray,translate2DEnd=new Ray,scratchTranslateP0=new Cartesian3;function translate2D(e,t,i){var r=e._scene.camera,n=r.getPickRay(i.startPosition,translate2DStart).origin,a=r.getPickRay(i.endPosition,translate2DEnd).origin;n=Cartesian3.fromElements(n.y,n.z,n.x,n),a=Cartesian3.fromElements(a.y,a.z,a.x,a);var o=Cartesian3.subtract(n,a,scratchTranslateP0),s=Cartesian3.magnitude(o);0<s&&(Cartesian3.normalize(o,o),r.move(o,s))}function zoom2D$2(e,t,i){defined(i.distance)&&(i=i.distance);var r=e._scene.camera;handleZoom(e,t,i,e._zoomFactor,r.getMagnitude())}var twist2DStart=new Cartesian2,twist2DEnd=new Cartesian2;function twist2D(e,t,i){if(defined(i.angleAndHeight))singleAxisTwist2D(e,t,i.angleAndHeight);else{var r=e._scene,n=r.camera,a=r.canvas,o=a.clientWidth,s=a.clientHeight,l=twist2DStart;l.x=2/o*i.startPosition.x-1,l.y=2/s*(s-i.startPosition.y)-1,l=Cartesian2.normalize(l,l);var u=twist2DEnd;u.x=2/o*i.endPosition.x-1,u.y=2/s*(s-i.endPosition.y)-1,u=Cartesian2.normalize(u,u);var c=CesiumMath.acosClamped(l.x);l.y<0&&(c=CesiumMath.TWO_PI-c);var d=CesiumMath.acosClamped(u.x);u.y<0&&(d=CesiumMath.TWO_PI-d);var h=d-c;n.twistRight(h)}}function singleAxisTwist2D(e,t,i){var r=e._rotateFactor*e._rotateRateRangeAdjustment;r>e._maximumRotateRate&&(r=e._maximumRotateRate),r<e._minimumRotateRate&&(r=e._minimumRotateRate);var n=e._scene,a=n.camera,o=n.canvas,s=(i.endPosition.x-i.startPosition.x)/o.clientWidth,l=r*(s=Math.min(s,e.maximumMovementRatio))*Math.PI*4;a.twistRight(l)}function update2D(e){var t=e._scene.mapMode2D===MapMode2D$1.ROTATE;Matrix4.equals(Matrix4.IDENTITY,e._scene.camera.transform)?(reactToInput(e,e.enableTranslate,e.translateEventTypes,translate2D,e.inertiaTranslate,"_lastInertiaTranslateMovement"),reactToInput(e,e.enableZoom,e.zoomEventTypes,zoom2D$2,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&reactToInput(e,e.enableRotate,e.tiltEventTypes,twist2D,e.inertiaSpin,"_lastInertiaTiltMovement")):(reactToInput(e,e.enableZoom,e.zoomEventTypes,zoom2D$2,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&reactToInput(e,e.enableRotate,e.translateEventTypes,twist2D,e.inertiaSpin,"_lastInertiaSpinMovement"))}var pickGlobeScratchRay$2=new Ray,scratchDepthIntersection$2=new Cartesian3,scratchRayIntersection$2=new Cartesian3;function pickGlobe(e,t,i){var r=e._scene,n=e._globe,a=r.camera;if(defined(n)){var o;r.pickPositionSupported&&(o=r.pickPositionWorldCoordinates(t,scratchDepthIntersection$2));var s=a.getPickRay(t,pickGlobeScratchRay$2),l=n.pickWorldCoordinates(s,r,scratchRayIntersection$2);return(defined(o)?Cartesian3.distance(o,a.positionWC):Number.POSITIVE_INFINITY)<(defined(l)?Cartesian3.distance(l,a.positionWC):Number.POSITIVE_INFINITY)?Cartesian3.clone(o,i):Cartesian3.clone(l,i)}}var translateCVStartRay=new Ray,translateCVEndRay=new Ray,translateCVStartPos=new Cartesian3,translateCVEndPos=new Cartesian3,translatCVDifference=new Cartesian3,translateCVOrigin=new Cartesian3,translateCVPlane=new Plane(Cartesian3.UNIT_X,0),translateCVStartMouse=new Cartesian2,translateCVEndMouse=new Cartesian2;function translateCV(e,t,i){if(Cartesian3.equals(t,e._translateMousePosition)||(e._looking=!1),Cartesian3.equals(t,e._strafeMousePosition)||(e._strafing=!1),e._looking)look3D(e,t,i);else if(e._strafing)strafe(e,t,i);else{var r,n=e._scene.camera,a=Cartesian2.clone(i.startPosition,translateCVStartMouse),o=Cartesian2.clone(i.endPosition,translateCVEndMouse),s=n.getPickRay(a,translateCVStartRay),l=Cartesian3.clone(Cartesian3.ZERO,translateCVOrigin),u=Cartesian3.UNIT_X;if(n.position.z<e._minimumPickingTerrainHeight&&defined(r=pickGlobe(e,a,translateCVStartPos))&&(l.x=r.x),l.x>n.position.z&&defined(r))return Cartesian3.clone(r,e._strafeStartPosition),e._strafing=!0,strafe(e,t,i),void(e._strafeMousePosition=Cartesian2.clone(t,e._strafeMousePosition));var c=Plane.fromPointNormal(l,u,translateCVPlane);s=n.getPickRay(a,translateCVStartRay);var d=IntersectionTests.rayPlane(s,c,translateCVStartPos),h=n.getPickRay(o,translateCVEndRay),p=IntersectionTests.rayPlane(h,c,translateCVEndPos);if(!defined(d)||!defined(p))return e._looking=!0,look3D(e,t,i),void Cartesian2.clone(t,e._translateMousePosition);var f=Cartesian3.subtract(d,p,translatCVDifference),m=f.x;f.x=f.y,f.y=f.z,f.z=m;var g=Cartesian3.magnitude(f);g>CesiumMath.EPSILON6&&(Cartesian3.normalize(f,f),n.move(f,g))}}var rotateCVWindowPos=new Cartesian2,rotateCVWindowRay=new Ray,rotateCVCenter=new Cartesian3,rotateCVVerticalCenter=new Cartesian3,rotateCVTransform=new Matrix4,rotateCVVerticalTransform=new Matrix4,rotateCVOrigin=new Cartesian3,rotateCVPlane=new Plane(Cartesian3.UNIT_X,0),rotateCVCartesian3=new Cartesian3,rotateCVCart=new Cartographic,rotateCVOldTransform=new Matrix4,rotateCVQuaternion=new Quaternion,rotateCVMatrix=new Matrix3,tilt3DCartesian3=new Cartesian3;function rotateCV(e,t,i){if(defined(i.angleAndHeight)&&(i=i.angleAndHeight),Cartesian2.equals(t,e._tiltCenterMousePosition)||(e._tiltCVOffMap=!1,e._looking=!1),e._looking)look3D(e,t,i);else{var r=e._scene.camera;e._tiltCVOffMap||!e.onMap()||r.position.z>e._minimumPickingTerrainHeight?(e._tiltCVOffMap=!0,rotateCVOnPlane(e,t,i)):rotateCVOnTerrain(e,t,i)}}function rotateCVOnPlane(e,t,i){var r=e._scene,n=r.camera,a=r.canvas,o=rotateCVWindowPos;o.x=a.clientWidth/2,o.y=a.clientHeight/2;var s,l=n.getPickRay(o,rotateCVWindowRay),u=Cartesian3.UNIT_X,c=l.origin,d=l.direction,h=Cartesian3.dot(u,d);if(Math.abs(h)>CesiumMath.EPSILON6&&(s=-Cartesian3.dot(u,c)/h),!defined(s)||s<=0)return e._looking=!0,look3D(e,t,i),void Cartesian2.clone(t,e._tiltCenterMousePosition);var p=Cartesian3.multiplyByScalar(d,s,rotateCVCenter);Cartesian3.add(c,p,p);var f=r.mapProjection,m=f.ellipsoid;Cartesian3.fromElements(p.y,p.z,p.x,p);var g=f.unproject(p,rotateCVCart);m.cartographicToCartesian(g,p);var y=Transforms.eastNorthUpToFixedFrame(p,m,rotateCVTransform),v=e._globe,_=e._ellipsoid;e._globe=void 0,e._ellipsoid=Ellipsoid.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;var C=Matrix4.clone(n.transform,rotateCVOldTransform);n._setTransform(y),rotate3D(e,t,i,Cartesian3.UNIT_Z),n._setTransform(C),e._globe=v;var x=(e._ellipsoid=_).maximumRadius;e._rotateFactor=1/x,e._rotateRateRangeAdjustment=x}function rotateCVOnTerrain(e,t,i){var r,n,a=e._scene,o=a.camera,s=Cartesian3.UNIT_X;if(Cartesian2.equals(t,e._tiltCenterMousePosition))r=Cartesian3.clone(e._tiltCenter,rotateCVCenter);else{if(o.position.z<e._minimumPickingTerrainHeight&&(r=pickGlobe(e,t,rotateCVCenter)),!defined(r)){var l,u=(n=o.getPickRay(t,rotateCVWindowRay)).origin,c=n.direction,d=Cartesian3.dot(s,c);if(Math.abs(d)>CesiumMath.EPSILON6&&(l=-Cartesian3.dot(s,u)/d),!defined(l)||l<=0)return e._looking=!0,look3D(e,t,i),void Cartesian2.clone(t,e._tiltCenterMousePosition);r=Cartesian3.multiplyByScalar(c,l,rotateCVCenter),Cartesian3.add(u,r,r)}Cartesian2.clone(t,e._tiltCenterMousePosition),Cartesian3.clone(r,e._tiltCenter)}var h=a.canvas,p=rotateCVWindowPos;p.x=h.clientWidth/2,p.y=e._tiltCenterMousePosition.y,n=o.getPickRay(p,rotateCVWindowRay);var f=Cartesian3.clone(Cartesian3.ZERO,rotateCVOrigin);f.x=r.x;var m=Plane.fromPointNormal(f,s,rotateCVPlane),g=IntersectionTests.rayPlane(n,m,rotateCVVerticalCenter),y=o._projection,v=y.ellipsoid;Cartesian3.fromElements(r.y,r.z,r.x,r);var _=y.unproject(r,rotateCVCart);v.cartographicToCartesian(_,r);var C,x=Transforms.eastNorthUpToFixedFrame(r,v,rotateCVTransform);C=defined(g)?(Cartesian3.fromElements(g.y,g.z,g.x,g),_=y.unproject(g,rotateCVCart),v.cartographicToCartesian(_,g),Transforms.eastNorthUpToFixedFrame(g,v,rotateCVVerticalTransform)):x;var b=e._globe,A=e._ellipsoid;e._globe=void 0,e._ellipsoid=Ellipsoid.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;var S=Cartesian3.UNIT_Z,w=Matrix4.clone(o.transform,rotateCVOldTransform);o._setTransform(x);var E=Cartesian3.cross(Cartesian3.UNIT_Z,Cartesian3.normalize(o.position,rotateCVCartesian3),rotateCVCartesian3),T=Cartesian3.dot(o.right,E);if(rotate3D(e,t,i,S,!1,!0),o._setTransform(C),T<0){i.startPosition.y>i.endPosition.y&&(S=void 0);var P=o.constrainedAxis;rotate3D(e,t,i,S,!(o.constrainedAxis=void 0),!1),o.constrainedAxis=P}else rotate3D(e,t,i,S,!0,!1);if(defined(o.constrainedAxis)){var M=Cartesian3.cross(o.direction,o.constrainedAxis,tilt3DCartesian3);Cartesian3.equalsEpsilon(M,Cartesian3.ZERO,CesiumMath.EPSILON6)||(Cartesian3.dot(M,o.right)<0&&Cartesian3.negate(M,M),Cartesian3.cross(M,o.direction,o.up),Cartesian3.cross(o.direction,o.up,o.right),Cartesian3.normalize(o.up,o.up),Cartesian3.normalize(o.right,o.right))}o._setTransform(w),e._globe=b;var D=(e._ellipsoid=A).maximumRadius;e._rotateFactor=1/D,e._rotateRateRangeAdjustment=D;var I=Cartesian3.clone(o.positionWC,rotateCVCartesian3);if(e.enableCollisionDetection&&adjustHeightForTerrain(e),!Cartesian3.equals(o.positionWC,I)){o._setTransform(C),o.worldToCameraCoordinatesPoint(I,I);var O=Cartesian3.magnitudeSquared(I);Cartesian3.magnitudeSquared(o.position)>O&&(Cartesian3.normalize(o.position,o.position),Cartesian3.multiplyByScalar(o.position,Math.sqrt(O),o.position));var R=Cartesian3.angleBetween(I,o.position),L=Cartesian3.cross(I,o.position,I);Cartesian3.normalize(L,L);var N=Quaternion.fromAxisAngle(L,R,rotateCVQuaternion),k=Matrix3.fromQuaternion(N,rotateCVMatrix);Matrix3.multiplyByVector(k,o.direction,o.direction),Matrix3.multiplyByVector(k,o.up,o.up),Cartesian3.cross(o.direction,o.up,o.right),Cartesian3.cross(o.right,o.direction,o.up),o._setTransform(w)}}var zoomCVWindowPos=new Cartesian2,zoomCVWindowRay=new Ray,zoomCVIntersection=new Cartesian3;function zoomCV(e,t,i){defined(i.distance)&&(i=i.distance);var r=e._scene,n=r.camera,a=r.canvas,o=zoomCVWindowPos;o.x=a.clientWidth/2,o.y=a.clientHeight/2;var s,l,u=n.getPickRay(o,zoomCVWindowRay);if(n.position.z<e._minimumPickingTerrainHeight&&(s=pickGlobe(e,o,zoomCVIntersection)),defined(s))l=Cartesian3.distance(u.origin,s);else{var c=Cartesian3.UNIT_X,d=u.origin,h=u.direction;l=-Cartesian3.dot(c,d)/Cartesian3.dot(c,h)}handleZoom(e,t,i,e._zoomFactor,l)}function updateCV(e){var t=e._scene.camera;if(Matrix4.equals(Matrix4.IDENTITY,t.transform)){var i=e._tweens;if(e._aggregator.anyButtonDown&&i.removeAll(),reactToInput(e,e.enableTilt,e.tiltEventTypes,rotateCV,e.inertiaSpin,"_lastInertiaTiltMovement"),reactToInput(e,e.enableTranslate,e.translateEventTypes,translateCV,e.inertiaTranslate,"_lastInertiaTranslateMovement"),reactToInput(e,e.enableZoom,e.zoomEventTypes,zoomCV,e.inertiaZoom,"_lastInertiaZoomMovement"),reactToInput(e,e.enableLook,e.lookEventTypes,look3D),!(e._aggregator.anyButtonDown||defined(e._lastInertiaZoomMovement)&&e._lastInertiaZoomMovement.active||defined(e._lastInertiaTranslateMovement)&&e._lastInertiaTranslateMovement.active||i.contains(e._tween))){var r=t.createCorrectPositionTween(e.bounceAnimationTime);defined(r)&&(e._tween=i.add(r))}i.update()}else reactToInput(e,e.enableRotate,e.rotateEventTypes,rotate3D,e.inertiaSpin,"_lastInertiaSpinMovement"),reactToInput(e,e.enableZoom,e.zoomEventTypes,zoom3D$2,e.inertiaZoom,"_lastInertiaZoomMovement")}var scratchStrafeRay=new Ray,scratchStrafePlane=new Plane(Cartesian3.UNIT_X,0),scratchStrafeIntersection=new Cartesian3,scratchStrafeDirection=new Cartesian3,scratchMousePos=new Cartesian3;function strafe(e,t,i){var r=e._scene,n=r.camera,a=pickGlobe(e,i.startPosition,scratchMousePos);if(defined(a)){var o=i.endPosition,s=n.getPickRay(o,scratchStrafeRay),l=Cartesian3.clone(n.direction,scratchStrafeDirection);r.mode===SceneMode$1.COLUMBUS_VIEW&&Cartesian3.fromElements(l.z,l.x,l.y,l);var u=Plane.fromPointNormal(a,l,scratchStrafePlane),c=IntersectionTests.rayPlane(s,u,scratchStrafeIntersection);defined(c)&&(l=Cartesian3.subtract(a,c,l),r.mode===SceneMode$1.COLUMBUS_VIEW&&Cartesian3.fromElements(l.y,l.z,l.x,l),Cartesian3.add(n.position,l,n.position))}}var spin3DPick=new Cartesian3,scratchCartographic$h=new Cartographic,scratchRadii$2=new Cartesian3,scratchEllipsoid$e=new Ellipsoid,scratchLookUp=new Cartesian3;function spin3D(e,t,i){var r=e._scene.camera;if(Matrix4.equals(r.transform,Matrix4.IDENTITY)){var n,a,o,s=e._ellipsoid.geodeticSurfaceNormal(r.position,scratchLookUp),l=e._ellipsoid.cartesianToCartographic(r.positionWC,scratchCartographic$h).height,u=e._globe;if(defined(u)&&l<e._minimumPickingTerrainHeight&&defined(o=pickGlobe(e,i.startPosition,scratchMousePos))){var c=r.getPickRay(i.startPosition,pickGlobeScratchRay$2),d=e._ellipsoid.geodeticSurfaceNormal(o);Math.abs(Cartesian3.dot(c.direction,d))<.05&&!e._looking&&(e._rotating=!1,e._strafing=!0)}Cartesian2.equals(t,e._rotateMousePosition)?e._looking?look3D(e,t,i,s):e._rotating?rotate3D(e,t,i):e._strafing?(Cartesian3.clone(o,e._strafeStartPosition),strafe(e,t,i)):(n=Cartesian3.magnitude(e._rotateStartPosition),(a=scratchRadii$2).x=a.y=a.z=n,pan3D(e,t,i,Ellipsoid.fromCartesian3(a,scratchEllipsoid$e))):(e._looking=!1,e._rotating=!1,e._strafing=!1,defined(u)&&l<e._minimumPickingTerrainHeight?defined(o)?Cartesian3.magnitude(r.position)<Cartesian3.magnitude(o)?(Cartesian3.clone(o,e._strafeStartPosition),e._strafing=!0,strafe(e,t,i)):(n=Cartesian3.magnitude(o),(a=scratchRadii$2).x=a.y=a.z=n,pan3D(e,t,i,Ellipsoid.fromCartesian3(a,scratchEllipsoid$e)),Cartesian3.clone(o,e._rotateStartPosition)):(e._looking=!0,look3D(e,t,i,s)):defined(r.pickEllipsoid(i.startPosition,e._ellipsoid,spin3DPick))?(pan3D(e,t,i,e._ellipsoid),Cartesian3.clone(spin3DPick,e._rotateStartPosition)):l>e._minimumTrackBallHeight?(e._rotating=!0,rotate3D(e,t,i)):(e._looking=!0,look3D(e,t,i,s)),Cartesian2.clone(t,e._rotateMousePosition))}else rotate3D(e,t,i)}function rotate3D(e,t,i,r,n,a){n=defaultValue(n,!1),a=defaultValue(a,!1);var o=e._scene,s=o.camera,l=o.canvas,u=s.constrainedAxis;defined(r)&&(s.constrainedAxis=r);var c=Cartesian3.magnitude(s.position),d=e._rotateFactor*(c-e._rotateRateRangeAdjustment);d>e._maximumRotateRate&&(d=e._maximumRotateRate),d<e._minimumRotateRate&&(d=e._minimumRotateRate);var h=(i.startPosition.x-i.endPosition.x)/l.clientWidth,p=(i.startPosition.y-i.endPosition.y)/l.clientHeight;h=Math.min(h,e.maximumMovementRatio),p=Math.min(p,e.maximumMovementRatio);var f=d*h*Math.PI*2,m=d*p*Math.PI;n||s.rotateRight(f),a||s.rotateUp(m),s.constrainedAxis=u}var pan3DP0=Cartesian4.clone(Cartesian4.UNIT_W),pan3DP1=Cartesian4.clone(Cartesian4.UNIT_W),pan3DTemp0=new Cartesian3,pan3DTemp1=new Cartesian3,pan3DTemp2=new Cartesian3,pan3DTemp3=new Cartesian3,pan3DStartMousePosition=new Cartesian2,pan3DEndMousePosition=new Cartesian2;function pan3D(e,t,i,r){var n=e._scene.camera,a=Cartesian2.clone(i.startPosition,pan3DStartMousePosition),o=Cartesian2.clone(i.endPosition,pan3DEndMousePosition),s=n.pickEllipsoid(a,r,pan3DP0),l=n.pickEllipsoid(o,r,pan3DP1);if(!defined(s)||!defined(l))return e._rotating=!0,void rotate3D(e,t,i);if(s=n.worldToCameraCoordinates(s,s),l=n.worldToCameraCoordinates(l,l),defined(n.constrainedAxis)){var u=n.constrainedAxis,c=Cartesian3.mostOrthogonalAxis(u,pan3DTemp0);Cartesian3.cross(c,u,c),Cartesian3.normalize(c,c);var d=Cartesian3.cross(u,c,pan3DTemp1),h=Cartesian3.magnitude(s),p=Cartesian3.dot(u,s),f=Math.acos(p/h),m=Cartesian3.multiplyByScalar(u,p,pan3DTemp2);Cartesian3.subtract(s,m,m),Cartesian3.normalize(m,m);var g=Cartesian3.magnitude(l),y=Cartesian3.dot(u,l),v=Math.acos(y/g),_=Cartesian3.multiplyByScalar(u,y,pan3DTemp3);Cartesian3.subtract(l,_,_),Cartesian3.normalize(_,_);var C=Math.acos(Cartesian3.dot(m,c));Cartesian3.dot(m,d)<0&&(C=CesiumMath.TWO_PI-C);var x=Math.acos(Cartesian3.dot(_,c));Cartesian3.dot(_,d)<0&&(x=CesiumMath.TWO_PI-x);var b,A=C-x;b=Cartesian3.equalsEpsilon(u,n.position,CesiumMath.EPSILON2)?n.right:Cartesian3.cross(u,n.position,pan3DTemp0);var S,w=Cartesian3.cross(u,b,pan3DTemp0),E=Cartesian3.dot(w,Cartesian3.subtract(s,u,pan3DTemp1)),T=Cartesian3.dot(w,Cartesian3.subtract(l,u,pan3DTemp1));S=0<E&&0<T?v-f:0<E&&T<=0?0<Cartesian3.dot(n.position,u)?-f-v:f+v:f-v,n.rotateRight(A),n.rotateUp(S)}else{Cartesian3.normalize(s,s),Cartesian3.normalize(l,l);var P=Cartesian3.dot(s,l),M=Cartesian3.cross(s,l,pan3DTemp0);if(P<1&&!Cartesian3.equalsEpsilon(M,Cartesian3.ZERO,CesiumMath.EPSILON14)){var D=Math.acos(P);n.rotate(M,D)}}}var zoom3DUnitPosition=new Cartesian3,zoom3DCartographic=new Cartographic;function zoom3D$2(e,t,i){defined(i.distance)&&(i=i.distance);var r=e._ellipsoid,n=e._scene,a=n.camera,o=n.canvas,s=zoomCVWindowPos;s.x=o.clientWidth/2,s.y=o.clientHeight/2;var l,u,c=a.getPickRay(s,zoomCVWindowRay),d=r.cartesianToCartographic(a.position,zoom3DCartographic).height;d<e._minimumPickingTerrainHeight&&(l=pickGlobe(e,s,zoomCVIntersection)),u=defined(l)?Cartesian3.distance(c.origin,l):d;var h=Cartesian3.normalize(a.position,zoom3DUnitPosition);handleZoom(e,t,i,e._zoomFactor,u,Cartesian3.dot(h,a.direction))}var tilt3DWindowPos=new Cartesian2,tilt3DRay=new Ray,tilt3DCenter=new Cartesian3,tilt3DVerticalCenter=new Cartesian3,tilt3DTransform=new Matrix4,tilt3DVerticalTransform=new Matrix4,tilt3DOldTransform=new Matrix4,tilt3DQuaternion=new Quaternion,tilt3DMatrix=new Matrix3,tilt3DCart=new Cartographic,tilt3DLookUp=new Cartesian3;function tilt3D(e,t,i){var r=e._scene.camera;if(Matrix4.equals(r.transform,Matrix4.IDENTITY))if(defined(i.angleAndHeight)&&(i=i.angleAndHeight),Cartesian2.equals(t,e._tiltCenterMousePosition)||(e._tiltOnEllipsoid=!1,e._looking=!1),e._looking){var n=e._ellipsoid.geodeticSurfaceNormal(r.position,tilt3DLookUp);look3D(e,t,i,n)}else{var a=e._ellipsoid.cartesianToCartographic(r.position,tilt3DCart);e._tiltOnEllipsoid||a.height>e._minimumCollisionTerrainHeight?(e._tiltOnEllipsoid=!0,tilt3DOnEllipsoid(e,t,i)):tilt3DOnTerrain(e,t,i)}}var tilt3DOnEllipsoidCartographic=new Cartographic;function tilt3DOnEllipsoid(e,t,i){var r=e._ellipsoid,n=e._scene,a=n.camera,o=.25*e.minimumZoomDistance,s=r.cartesianToCartographic(a.positionWC,tilt3DOnEllipsoidCartographic).height;if(!(s-o-1<CesiumMath.EPSILON3&&i.endPosition.y-i.startPosition.y<0)){var l=n.canvas,u=tilt3DWindowPos;u.x=l.clientWidth/2,u.y=l.clientHeight/2;var c,d=a.getPickRay(u,tilt3DRay),h=IntersectionTests.rayEllipsoid(d,r);if(defined(h))c=Ray.getPoint(d,h.start,tilt3DCenter);else{if(!(s>e._minimumTrackBallHeight)){e._looking=!0;var p=e._ellipsoid.geodeticSurfaceNormal(a.position,tilt3DLookUp);return look3D(e,t,i,p),void Cartesian2.clone(t,e._tiltCenterMousePosition)}var f=IntersectionTests.grazingAltitudeLocation(d,r);if(!defined(f))return;var m=r.cartesianToCartographic(f,tilt3DCart);m.height=0,c=r.cartographicToCartesian(m,tilt3DCenter)}var g=Transforms.eastNorthUpToFixedFrame(c,r,tilt3DTransform),y=e._globe,v=e._ellipsoid;e._globe=void 0,e._ellipsoid=Ellipsoid.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;var _=Matrix4.clone(a.transform,tilt3DOldTransform);a._setTransform(g),rotate3D(e,t,i,Cartesian3.UNIT_Z),a._setTransform(_),e._globe=y;var C=(e._ellipsoid=v).maximumRadius;e._rotateFactor=1/C,e._rotateRateRangeAdjustment=C}}function tilt3DOnTerrain(e,t,i){var r,n,a,o=e._ellipsoid,s=e._scene,l=s.camera;if(Cartesian2.equals(t,e._tiltCenterMousePosition))r=Cartesian3.clone(e._tiltCenter,tilt3DCenter);else{if(!defined(r=pickGlobe(e,t,tilt3DCenter))){if(n=l.getPickRay(t,tilt3DRay),!defined(a=IntersectionTests.rayEllipsoid(n,o))){if(o.cartesianToCartographic(l.position,tilt3DCart).height<=e._minimumTrackBallHeight){e._looking=!0;var u=e._ellipsoid.geodeticSurfaceNormal(l.position,tilt3DLookUp);look3D(e,t,i,u),Cartesian2.clone(t,e._tiltCenterMousePosition)}return}r=Ray.getPoint(n,a.start,tilt3DCenter)}Cartesian2.clone(t,e._tiltCenterMousePosition),Cartesian3.clone(r,e._tiltCenter)}var c=s.canvas,d=tilt3DWindowPos;d.x=c.clientWidth/2,d.y=e._tiltCenterMousePosition.y,n=l.getPickRay(d,tilt3DRay);var h=Cartesian3.magnitude(r),p=Cartesian3.fromElements(h,h,h,scratchRadii$2),f=Ellipsoid.fromCartesian3(p,scratchEllipsoid$e);if(defined(a=IntersectionTests.rayEllipsoid(n,f))){var m=Cartesian3.magnitude(n.origin)>h?a.start:a.stop,g=Ray.getPoint(n,m,tilt3DVerticalCenter),y=Transforms.eastNorthUpToFixedFrame(r,o,tilt3DTransform),v=Transforms.eastNorthUpToFixedFrame(g,f,tilt3DVerticalTransform),_=e._globe,C=e._ellipsoid;e._globe=void 0,e._ellipsoid=Ellipsoid.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;var x=Cartesian3.UNIT_Z,b=Matrix4.clone(l.transform,tilt3DOldTransform);l._setTransform(y);var A=Cartesian3.cross(g,l.positionWC,tilt3DCartesian3),S=Cartesian3.dot(l.rightWC,A);if(rotate3D(e,t,i,x,!1,!0),l._setTransform(v),S<0){i.startPosition.y>i.endPosition.y&&(x=void 0);var w=l.constrainedAxis;rotate3D(e,t,i,x,!(l.constrainedAxis=void 0),!1),l.constrainedAxis=w}else rotate3D(e,t,i,x,!0,!1);if(defined(l.constrainedAxis)){var E=Cartesian3.cross(l.direction,l.constrainedAxis,tilt3DCartesian3);Cartesian3.equalsEpsilon(E,Cartesian3.ZERO,CesiumMath.EPSILON6)||(Cartesian3.dot(E,l.right)<0&&Cartesian3.negate(E,E),Cartesian3.cross(E,l.direction,l.up),Cartesian3.cross(l.direction,l.up,l.right),Cartesian3.normalize(l.up,l.up),Cartesian3.normalize(l.right,l.right))}l._setTransform(b),e._globe=_;var T=(e._ellipsoid=C).maximumRadius;e._rotateFactor=1/T,e._rotateRateRangeAdjustment=T;var P=Cartesian3.clone(l.positionWC,tilt3DCartesian3);if(e.enableCollisionDetection&&adjustHeightForTerrain(e),!Cartesian3.equals(l.positionWC,P)){l._setTransform(v),l.worldToCameraCoordinatesPoint(P,P);var M=Cartesian3.magnitudeSquared(P);Cartesian3.magnitudeSquared(l.position)>M&&(Cartesian3.normalize(l.position,l.position),Cartesian3.multiplyByScalar(l.position,Math.sqrt(M),l.position));var D=Cartesian3.angleBetween(P,l.position),I=Cartesian3.cross(P,l.position,P);Cartesian3.normalize(I,I);var O=Quaternion.fromAxisAngle(I,D,tilt3DQuaternion),R=Matrix3.fromQuaternion(O,tilt3DMatrix);Matrix3.multiplyByVector(R,l.direction,l.direction),Matrix3.multiplyByVector(R,l.up,l.up),Cartesian3.cross(l.direction,l.up,l.right),Cartesian3.cross(l.right,l.direction,l.up),l._setTransform(b)}}}var look3DStartPos=new Cartesian2,look3DEndPos=new Cartesian2,look3DStartRay=new Ray,look3DEndRay=new Ray,look3DNegativeRot=new Cartesian3,look3DTan=new Cartesian3;function look3D(e,t,i,r){var n=e._scene.camera,a=look3DStartPos;a.x=i.startPosition.x,a.y=0;var o=look3DEndPos;o.x=i.endPosition.x,o.y=0;var s,l,u=n.getPickRay(a,look3DStartRay),c=n.getPickRay(o,look3DEndRay),d=0;n.frustum instanceof OrthographicFrustum?(s=u.origin,l=c.origin,Cartesian3.add(n.direction,s,s),Cartesian3.add(n.direction,l,l),Cartesian3.subtract(s,n.position,s),Cartesian3.subtract(l,n.position,l),Cartesian3.normalize(s,s),Cartesian3.normalize(l,l)):(s=u.direction,l=c.direction);var h=Cartesian3.dot(s,l);h<1&&(d=Math.acos(h)),d=i.startPosition.x>i.endPosition.x?-d:d;var p=e._horizontalRotationAxis;if(defined(r)?n.look(r,-d):defined(p)?n.look(p,-d):n.lookLeft(d),a.x=0,a.y=i.startPosition.y,o.x=0,o.y=i.endPosition.y,u=n.getPickRay(a,look3DStartRay),c=n.getPickRay(o,look3DEndRay),d=0,n.frustum instanceof OrthographicFrustum?(s=u.origin,l=c.origin,Cartesian3.add(n.direction,s,s),Cartesian3.add(n.direction,l,l),Cartesian3.subtract(s,n.position,s),Cartesian3.subtract(l,n.position,l),Cartesian3.normalize(s,s),Cartesian3.normalize(l,l)):(s=u.direction,l=c.direction),(h=Cartesian3.dot(s,l))<1&&(d=Math.acos(h)),d=i.startPosition.y>i.endPosition.y?-d:d,defined(r=defaultValue(r,p))){var f=n.direction,m=Cartesian3.negate(r,look3DNegativeRot),g=Cartesian3.equalsEpsilon(f,r,CesiumMath.EPSILON2),y=Cartesian3.equalsEpsilon(f,m,CesiumMath.EPSILON2);if(g||y)(g&&d<0||y&&0<d)&&n.look(n.right,-d);else{h=Cartesian3.dot(f,r);var v=CesiumMath.acosClamped(h);0<d&&v<d&&(d=v-CesiumMath.EPSILON4),h=Cartesian3.dot(f,m),v=CesiumMath.acosClamped(h),d<0&&v<-d&&(d=-v+CesiumMath.EPSILON4);var _=Cartesian3.cross(r,f,look3DTan);n.look(_,d)}}else n.lookUp(d)}function update3D(e){reactToInput(e,e.enableRotate,e.rotateEventTypes,spin3D,e.inertiaSpin,"_lastInertiaSpinMovement"),reactToInput(e,e.enableZoom,e.zoomEventTypes,zoom3D$2,e.inertiaZoom,"_lastInertiaZoomMovement"),reactToInput(e,e.enableTilt,e.tiltEventTypes,tilt3D,e.inertiaSpin,"_lastInertiaTiltMovement"),reactToInput(e,e.enableLook,e.lookEventTypes,look3D)}var scratchAdjustHeightTransform=new Matrix4,scratchAdjustHeightCartographic=new Cartographic;function adjustHeightForTerrain(e){e._adjustedHeightForTerrain=!0;var t=e._scene,i=t.mode,r=t.globe;if(defined(r)&&i!==SceneMode$1.SCENE2D&&i!==SceneMode$1.MORPHING){var n,a,o=t.camera,s=r.ellipsoid,l=t.mapProjection;Matrix4.equals(o.transform,Matrix4.IDENTITY)||(n=Matrix4.clone(o.transform,scratchAdjustHeightTransform),a=Cartesian3.magnitude(o.position),o._setTransform(Matrix4.IDENTITY));var u=scratchAdjustHeightCartographic;i===SceneMode$1.SCENE3D?s.cartesianToCartographic(o.position,u):l.unproject(o.position,u);var c=!1;if(u.height<e._minimumCollisionTerrainHeight){var d=r.getHeight(u);defined(d)&&(d+=e.minimumZoomDistance,u.height<d&&(u.height=d,i===SceneMode$1.SCENE3D?s.cartographicToCartesian(u,o.position):l.project(u,o.position),c=!0))}defined(n)&&(o._setTransform(n),c&&(Cartesian3.normalize(o.position,o.position),Cartesian3.negate(o.position,o.direction),Cartesian3.multiplyByScalar(o.position,Math.max(a,e.minimumZoomDistance),o.position),Cartesian3.normalize(o.direction,o.direction),Cartesian3.cross(o.direction,o.up,o.right),Cartesian3.cross(o.right,o.direction,o.up)))}}ScreenSpaceCameraController.prototype.onMap=function(){var e=this._scene,t=e.mode,i=e.camera;return t!==SceneMode$1.COLUMBUS_VIEW||Math.abs(i.position.x)-this._maxCoord.x<0&&Math.abs(i.position.y)-this._maxCoord.y<0};var scratchPreviousPosition=new Cartesian3,scratchPreviousDirection=new Cartesian3;ScreenSpaceCameraController.prototype.update=function(){var e=this._scene.camera;Matrix4.equals(e.transform,Matrix4.IDENTITY)?(this._globe=this._scene.globe,this._ellipsoid=defined(this._globe)?this._globe.ellipsoid:this._scene.mapProjection.ellipsoid):(this._globe=void 0,this._ellipsoid=Ellipsoid.UNIT_SPHERE),this._minimumCollisionTerrainHeight=this.minimumCollisionTerrainHeight*this._scene.terrainExaggeration,this._minimumPickingTerrainHeight=this.minimumPickingTerrainHeight*this._scene.terrainExaggeration,this._minimumTrackBallHeight=this.minimumTrackBallHeight*this._scene.terrainExaggeration;var t=this._ellipsoid.maximumRadius;this._rotateFactor=1/t,this._rotateRateRangeAdjustment=t,this._adjustedHeightForTerrain=!1;var i=Cartesian3.clone(e.positionWC,scratchPreviousPosition),r=Cartesian3.clone(e.directionWC,scratchPreviousDirection),n=this._scene.mode;n===SceneMode$1.SCENE2D?update2D(this):n===SceneMode$1.COLUMBUS_VIEW?(this._horizontalRotationAxis=Cartesian3.UNIT_Z,updateCV(this)):n===SceneMode$1.SCENE3D&&(this._horizontalRotationAxis=void 0,update3D(this)),this.enableCollisionDetection&&!this._adjustedHeightForTerrain&&(Cartesian3.equals(i,e.positionWC)&&Cartesian3.equals(r,e.directionWC)||adjustHeightForTerrain(this));this._aggregator.reset()},ScreenSpaceCameraController.prototype.adjustedHeightForTerrain=function(){return this._adjustedHeightForTerrain},ScreenSpaceCameraController.prototype.isDestroyed=function(){return!1},ScreenSpaceCameraController.prototype.destroy=function(){return this._tweens.removeAll(),this._aggregator=this._aggregator&&this._aggregator.destroy(),destroyObject(this)};var AdditiveBlend="uniform sampler2D colorTexture;\nuniform sampler2D colorTexture2;\nuniform vec2 center;\nuniform float radius;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nvec4 color0 = texture2D(colorTexture, v_textureCoordinates);\nvec4 color1 = texture2D(colorTexture2, v_textureCoordinates);\nfloat x = length(gl_FragCoord.xy - center) / radius;\nfloat t = smoothstep(0.5, 0.8, x);\ngl_FragColor = mix(color0 + color1, color1, t);\n}\n",BrightPass="uniform sampler2D colorTexture;\nuniform float avgLuminance;\nuniform float threshold;\nuniform float offset;\nvarying vec2 v_textureCoordinates;\nfloat key(float avg)\n{\nfloat guess = 1.5 - (1.5 / (avg * 0.1 + 1.0));\nreturn max(0.0, guess) + 0.1;\n}\nvoid main()\n{\nvec4 color = texture2D(colorTexture, v_textureCoordinates);\nvec3 xyz = czm_RGBToXYZ(color.rgb);\nfloat luminance = xyz.r;\nfloat scaledLum = key(avgLuminance) * luminance / avgLuminance;\nfloat brightLum = max(scaledLum - threshold, 0.0);\nfloat brightness = brightLum / (offset + brightLum);\nxyz.r = brightness;\ngl_FragColor = vec4(czm_XYZToRGB(xyz), 1.0);\n}\n";function SunPostProcess(){this._sceneFramebuffer=new SceneFramebuffer;var e=new Array(6);e[0]=new PostProcessStage({fragmentShader:PassThrough,textureScale:.25,forcePowerOfTwo:!0,sampleMode:PostProcessStageSampleMode.LINEAR});var t=e[1]=new PostProcessStage({fragmentShader:BrightPass,uniforms:{avgLuminance:.5,threshold:.25,offset:.1},textureScale:.25,forcePowerOfTwo:!0}),i=this;this._delta=1,this._sigma=2,this._blurStep=new Cartesian2,e[2]=new PostProcessStage({fragmentShader:GaussianBlur1D,uniforms:{step:function(){return i._blurStep.x=i._blurStep.y=1/t.outputTexture.width,i._blurStep},delta:function(){return i._delta},sigma:function(){return i._sigma},direction:0},textureScale:.25,forcePowerOfTwo:!0}),e[3]=new PostProcessStage({fragmentShader:GaussianBlur1D,uniforms:{step:function(){return i._blurStep.x=i._blurStep.y=1/t.outputTexture.width,i._blurStep},delta:function(){return i._delta},sigma:function(){return i._sigma},direction:1},textureScale:.25,forcePowerOfTwo:!0}),e[4]=new PostProcessStage({fragmentShader:PassThrough,sampleMode:PostProcessStageSampleMode.LINEAR}),this._uCenter=new Cartesian2,this._uRadius=void 0,e[5]=new PostProcessStage({fragmentShader:AdditiveBlend,uniforms:{center:function(){return i._uCenter},radius:function(){return i._uRadius},colorTexture2:function(){return i._sceneFramebuffer.getFramebuffer().getColorTexture(0)}}}),this._stages=new PostProcessStageComposite({stages:e});for(var r=new PostProcessStageTextureCache(this),n=e.length,a=0;a<n;++a)e[a]._textureCache=r;this._textureCache=r,this.length=e.length}SunPostProcess.prototype.get=function(e){return this._stages.get(e)},SunPostProcess.prototype.getStageByName=function(e){for(var t=this._stages.length,i=0;i<t;++i){var r=this._stages.get(i);if(r.name===e)return r}};var sunPositionECScratch=new Cartesian4,sunPositionWCScratch=new Cartesian2,sizeScratch=new Cartesian2,postProcessMatrix4Scratch=new Matrix4;function updateSunPosition(e,t,i){var r=t.uniformState,n=r.sunPositionWC,a=r.view,o=r.viewProjection,s=r.projection,l=Matrix4.computeViewportTransformation(i,0,1,postProcessMatrix4Scratch),u=Matrix4.multiplyByPoint(a,n,sunPositionECScratch),c=Transforms.pointToGLWindowCoordinates(o,l,n,sunPositionWCScratch);u.x+=CesiumMath.SOLAR_RADIUS;var d=Transforms.pointToGLWindowCoordinates(s,l,u,u),h=30*Cartesian2.magnitude(Cartesian2.subtract(d,c,d))*2,p=sizeScratch;p.x=h,p.y=h,e._uCenter=Cartesian2.clone(c,e._uCenter),e._uRadius=.15*Math.max(p.x,p.y);var f=t.drawingBufferWidth,m=t.drawingBufferHeight,g=e._stages,y=g.get(0),v=y.outputTexture.width,_=y.outputTexture.height,C=new BoundingRectangle;C.width=v,C.height=_,l=Matrix4.computeViewportTransformation(C,0,1,postProcessMatrix4Scratch),c=Transforms.pointToGLWindowCoordinates(o,l,n,sunPositionWCScratch),p.x*=v/f,p.y*=_/m;var x=y.scissorRectangle;x.x=Math.max(c.x-.5*p.x,0),x.y=Math.max(c.y-.5*p.y,0),x.width=Math.min(p.x,f),x.height=Math.min(p.y,m);for(var b=1;b<4;++b)BoundingRectangle.clone(x,g.get(b).scissorRectangle)}SunPostProcess.prototype.clear=function(e,t,i){this._sceneFramebuffer.clear(e,t,i),this._textureCache.clear(e)},SunPostProcess.prototype.update=function(e){var t=e.context,i=e.viewport,r=this._sceneFramebuffer;r.update(t,i);var n=r.getFramebuffer();return this._textureCache.update(t),this._stages.update(t,!1),updateSunPosition(this,t,i),n},SunPostProcess.prototype.execute=function(e){var t=this._sceneFramebuffer.getFramebuffer().getColorTexture(0),i=this._stages,r=i.length;i.get(0).execute(e,t);for(var n=1;n<r;++n)i.get(n).execute(e,i.get(n-1).outputTexture)},SunPostProcess.prototype.copy=function(e,t){if(!defined(this._copyColorCommand)){var i=this;this._copyColorCommand=e.createViewportQuadCommand(PassThrough,{uniformMap:{colorTexture:function(){return i._stages.get(i._stages.length-1).outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)},SunPostProcess.prototype.isDestroyed=function(){return!1},SunPostProcess.prototype.destroy=function(){return this._textureCache.destroy(),this._stages.destroy(),destroyObject(this)};var requestRenderAfterFrame=function(e){return function(){e.frameState.afterRender.push(function(){e.requestRender()})}};function Scene(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).canvas,i=e.creditContainer,r=e.creditViewport,n=clone(e.contextOptions);defined(n)||(n={}),defined(n.webgl)||(n.webgl={}),n.webgl.powerPreference=defaultValue(n.webgl.powerPreference,"high-performance");var a=defined(i),o=new Context(t,n);a||((i=document.createElement("div")).style.position="absolute",i.style.bottom="0",i.style["text-shadow"]="0 0 2px #000000",i.style.color="#ffffff",i.style["font-size"]="10px",i.style["padding-right"]="5px",t.parentNode.appendChild(i)),defined(r)||(r=t.parentNode),this._id=createGuid(),this._jobScheduler=new JobScheduler,this._frameState=new FrameState(o,new CreditDisplay(i," • ",r),this._jobScheduler),this._frameState.scene3DOnly=defaultValue(e.scene3DOnly,!1),this._removeCreditContainer=!a,this._creditContainer=i,this._canvas=t,this._context=o,this._computeEngine=new ComputeEngine(o),this._globe=void 0,this._primitives=new PrimitiveCollection,this._groundPrimitives=new PrimitiveCollection,this._logDepthBuffer=o.fragmentDepth,this._logDepthBufferDirty=!0,this._tweens=new TweenCollection,this._shaderFrameCount=0,this._sunPostProcess=void 0,this._computeCommandList=[],this._overlayCommandList=[],this._useOIT=defaultValue(e.orderIndependentTranslucency,!0),this._executeOITFunction=void 0,this._depthPlane=new DepthPlane,this._clearColorCommand=new ClearCommand({color:new Color,stencil:0,owner:this}),this._depthClearCommand=new ClearCommand({depth:1,owner:this}),this._stencilClearCommand=new ClearCommand({stencil:0}),this._classificationStencilClearCommand=new ClearCommand({stencil:0,renderState:RenderState.fromCache({stencilMask:StencilConstants$1.CLASSIFICATION_MASK})}),this._depthOnlyRenderStateCache={},this._transitioner=new SceneTransitioner(this),this._preUpdate=new Event,this._postUpdate=new Event,this._renderError=new Event,this._preRender=new Event,this._postRender=new Event,this._minimumDisableDepthTestDistance=0,this._sunShaftEnabled=!1,this.rethrowRenderErrors=!1,this.completeMorphOnUserInput=!0,this.morphStart=new Event,this.morphComplete=new Event,this.skyBox=void 0,this.skyAtmosphere=void 0,this.sun=void 0,this.sunBloom=!0,this._sunBloom=void 0,this.moon=void 0,this.backgroundColor=Color.clone(Color.BLACK),this._mode=SceneMode$1.SCENE3D,this._mapProjection=defined(e.mapProjection)?e.mapProjection:new GeographicProjection,this.morphTime=1,this.farToNearRatio=1e3,this.logarithmicDepthFarToNearRatio=1e9,this.nearToFarDistance2D=175e4,this.debugCommandFilter=void 0,this.debugShowCommands=!1,this.debugShowFrustums=!1,this.debugShowFramesPerSecond=!1,this.debugShowGlobeDepth=!1,this.debugShowDepthFrustum=1,this.debugShowFrustumPlanes=!1,this._debugShowFrustumPlanes=!1,this._debugFrustumPlanes=void 0,this.useDepthPicking=!0,this.pickTranslucentDepth=!1,this.cameraEventWaitTime=500,this.fog=new Fog,this._shadowMapCamera=new Camera(this),this.shadowMap=new ShadowMap({context:o,lightCamera:this._shadowMapCamera,enabled:defaultValue(e.shadows,!1)}),this.textureProjectionMapList=new Array,this.viewShedMapList=[],this.invertClassification=!1,this.invertClassificationColor=Color.clone(Color.WHITE),this._actualInvertClassificationColor=Color.clone(this._invertClassificationColor),this._invertClassification=new InvertClassification,this.focalLength=void 0,this.eyeSeparation=void 0,this.postProcessStages=new PostProcessStageCollection,this._brdfLutGenerator=new BrdfLutGenerator,this._terrainExaggeration=defaultValue(e.terrainExaggeration,1),this._performanceDisplay=void 0,this._debugVolume=void 0,this._screenSpaceCameraController=new ScreenSpaceCameraController(this),this._cameraUnderground=!1,this._mapMode2D=defaultValue(e.mapMode2D,MapMode2D$1.INFINITE_SCROLL),this._environmentState={skyBoxCommand:void 0,skyAtmosphereCommand:void 0,sunDrawCommand:void 0,sunComputeCommand:void 0,moonCommand:void 0,isSunVisible:!1,isMoonVisible:!1,isReadyForAtmosphere:!1,isSkyAtmosphereVisible:!1,clearGlobeDepth:!1,useDepthPlane:!1,renderTranslucentDepthForPick:!1,originalFramebuffer:void 0,useGlobeDepthFramebuffer:!1,separatePrimitiveFramebuffer:!1,useOIT:!1,useInvertClassification:!1,usePostProcess:!1,usePostProcessSelected:!1,useWebVR:!1},this._useWebVR=!1,this._cameraVR=void 0,this._aspectRatioVR=void 0,this.requestRenderMode=defaultValue(e.requestRenderMode,!1),this._renderRequested=!0,this.maximumRenderTimeChange=defaultValue(e.maximumRenderTimeChange,0),this._lastRenderTime=void 0,this._frameRateMonitor=void 0,this._removeRequestListenerCallback=RequestScheduler.requestCompletedEvent.addEventListener(requestRenderAfterFrame(this)),this._removeTaskProcessorListenerCallback=TaskProcessor.taskCompletedEvent.addEventListener(requestRenderAfterFrame(this)),this._removeGlobeCallbacks=[];var s=new BoundingRectangle(0,0,o.drawingBufferWidth,o.drawingBufferHeight),l=new Camera(this);this._logDepthBuffer&&(l.frustum.near=.1,l.frustum.far=1e10),this.preloadFlightCamera=new Camera(this),this.preloadFlightCullingVolume=void 0,this._picking=new Picking(this),this._defaultView=new View(this,l,s),this._view=this._defaultView,this._hdr=void 0,this._hdrDirty=void 0,this.highDynamicRange=!1,this.gamma=2.2,this._sunColor=new Cartesian3(2.3,2.35,2.5),this.sphericalHarmonicCoefficients=void 0,this.specularEnvironmentMaps=void 0,this._specularEnvironmentMapAtlas=void 0,this.light=new SunLight,this._loadPrimitiveFirst=!1,updateFrameNumber(this,0,JulianDate.now()),this.updateFrameState(),this.initializeFrame()}function updateGlobeListeners(e,t){for(var i=0;i<e._removeGlobeCallbacks.length;++i)e._removeGlobeCallbacks[i]();e._removeGlobeCallbacks.length=0;var r=[];defined(t)&&(r.push(t.imageryLayersUpdatedEvent.addEventListener(requestRenderAfterFrame(e))),r.push(t.terrainProviderChanged.addEventListener(requestRenderAfterFrame(e)))),e._removeGlobeCallbacks=r}var scratchSunColor=new Cartesian4;function TextureProjectionMap_createDerivedCommands(e,t,i,r,n,a,o,s,l){t?e.perspectivesWithDepth=PerspectiveProjectionMapWithDepth.createDerivedCommands(i,t,r,n,a,o,s,e.perspectivesWithDepth):e.perspectives=PerspectiveProjectionMap.createDerivedCommands(i,r,n,a,o,s,e.perspectives),e.fisheyes=FisheyeProjectionMap.createDerivedCommands(i,r,n,a,o,e.fisheyes)}function updateDerivedCommands_impl(e,t,i,r,n,a){var o=e._frameState,s=e._context,l=e._view.oit,u=o.shadowState.lightShadowMaps,c=o.shadowState.lightShadowsEnabled,d=t.derivedCommands;defined(t.pickId)&&(d.picking=DerivedCommand.createPickDerivedCommand(e,t,s,d.picking)),t.pickOnly||(d.depth=DerivedCommand.createDepthOnlyDerivedCommand(e,t,s,d.depth)),d.originalCommand=t,e._hdr&&(d.hdr=DerivedCommand.createHdrCommand(t,s,d.hdr),d=(t=d.hdr.command).derivedCommands),c&&t.receiveShadows&&(d.shadows=ShadowMap.createReceiveDerivedCommand(u,t,i,s,d.shadows)),t.pass===Pass$1.TRANSLUCENT&&defined(l)&&l.isSupported()&&(c&&t.receiveShadows?(d.oit=defined(d.oit)?d.oit:{},d.perspectivesWithDepth&&(d.oit.shadows=l.createDerivedCommands(d.perspectivesWithDepth.receiveCommand,s,d.oit.shadows))):d.oit=l.createDerivedCommands(t,s,d.oit))}function updateDerivedCommands_viewShed(e,t,i){var r=e._frameState,n=e._context,a=e._view.oit,o=r.viewShedState.lightShadowMaps,s=r.viewShedState.lightShadowsEnabled,l=t.derivedCommands;defined(t.pickId)&&(l.picking=DerivedCommand.createPickDerivedCommand(e,t,n,l.picking)),t.pickOnly||(l.depth=DerivedCommand.createDepthOnlyDerivedCommand(e,t,n,l.depth)),l.originalCommand=t,e._hdr&&(l.hdr=DerivedCommand.createHdrCommand(t,n,l.hdr),l=(t=l.hdr.command).derivedCommands),s&&t.receiveShadows&&(l.viewShedMaps=ViewShedMap.createReceiveDerivedCommand(o,t,i,n,l.viewShedMaps)),t.pass===Pass$1.TRANSLUCENT&&defined(a)&&a.isSupported()&&(s&&t.receiveShadows?l.oit=defined(l.oit)?l.oit:{}:l.oit=a.createDerivedCommands(t,n,l.oit))}function updateDerivedCommands(e,t,i){var r=e._frameState,n=e._context,a=e._view.oit,o=r.shadowState.lightShadowMaps,s=r.shadowState.lightShadowsEnabled,l=t.derivedCommands;defined(t.pickId)&&(l.picking=DerivedCommand.createPickDerivedCommand(e,t,n,l.picking)),t.pickOnly||(l.depth=DerivedCommand.createDepthOnlyDerivedCommand(e,t,n,l.depth)),l.originalCommand=t,e._hdr&&(l.hdr=DerivedCommand.createHdrCommand(t,n,l.hdr),l=(t=l.hdr.command).derivedCommands),s&&t.receiveShadows&&(l.shadows=ShadowMap.createReceiveDerivedCommand(o,t,i,n,l.shadows)),t.pass===Pass$1.TRANSLUCENT&&defined(a)&&a.isSupported()&&(s&&t.receiveShadows?(l.oit=defined(l.oit)?l.oit:{},l.oit.shadows=a.createDerivedCommands(l.shadows.receiveCommand,n,l.oit.shadows)):l.oit=a.createDerivedCommands(t,n,l.oit))}Object.defineProperties(Scene.prototype,{canvas:{get:function(){return this._canvas}},drawingBufferHeight:{get:function(){return this._context.drawingBufferHeight}},drawingBufferWidth:{get:function(){return this._context.drawingBufferWidth}},maximumAliasedLineWidth:{get:function(){return ContextLimits.maximumAliasedLineWidth}},maximumCubeMapSize:{get:function(){return ContextLimits.maximumCubeMapSize}},pickPositionSupported:{get:function(){return this._context.depthTexture}},sampleHeightSupported:{get:function(){return this._context.depthTexture}},clampToHeightSupported:{get:function(){return this._context.depthTexture}},invertClassificationSupported:{get:function(){return this._context.depthTexture}},specularEnvironmentMapsSupported:{get:function(){return OctahedralProjectedCubeMap.isSupported(this._context)}},globe:{get:function(){return this._globe},set:function(e){this._globe=this._globe&&this._globe.destroy(),this._globe=e,updateGlobeListeners(this,e)}},primitives:{get:function(){return this._primitives}},groundPrimitives:{get:function(){return this._groundPrimitives}},camera:{get:function(){return this._view.camera},set:function(e){this._view.camera=e}},view:{get:function(){return this._view},set:function(e){this._view=e}},defaultView:{get:function(){return this._defaultView}},picking:{get:function(){return this._picking}},screenSpaceCameraController:{get:function(){return this._screenSpaceCameraController}},mapProjection:{get:function(){return this._mapProjection}},jobScheduler:{get:function(){return this._jobScheduler}},frameState:{get:function(){return this._frameState}},environmentState:{get:function(){return this._environmentState}},tweens:{get:function(){return this._tweens}},imageryLayers:{get:function(){if(defined(this.globe))return this.globe.imageryLayers}},terrainProvider:{get:function(){if(defined(this.globe))return this.globe.terrainProvider},set:function(e){defined(this.globe)&&(this.globe.terrainProvider=e)}},terrainProviderChanged:{get:function(){if(defined(this.globe))return this.globe.terrainProviderChanged}},preUpdate:{get:function(){return this._preUpdate}},postUpdate:{get:function(){return this._postUpdate}},renderError:{get:function(){return this._renderError}},preRender:{get:function(){return this._preRender}},postRender:{get:function(){return this._postRender}},lastRenderTime:{get:function(){return this._lastRenderTime}},context:{get:function(){return this._context}},debugFrustumStatistics:{get:function(){return this._view.debugFrustumStatistics}},scene3DOnly:{get:function(){return this._frameState.scene3DOnly}},orderIndependentTranslucency:{get:function(){return this._useOIT}},id:{get:function(){return this._id}},mode:{get:function(){return this._mode},set:function(e){e===SceneMode$1.SCENE2D?this.morphTo2D(0):e===SceneMode$1.SCENE3D?this.morphTo3D(0):e===SceneMode$1.COLUMBUS_VIEW&&this.morphToColumbusView(0),this._mode=e}},frustumCommandsList:{get:function(){return this._view.frustumCommandsList}},numberOfFrustums:{get:function(){return this._view.frustumCommandsList.length}},terrainExaggeration:{get:function(){return this._terrainExaggeration}},useWebVR:{get:function(){return this._useWebVR},set:function(e){this._useWebVR=e,this._useWebVR?(this._frameState.creditDisplay.container.style.visibility="hidden",this._cameraVR=new Camera(this),defined(this._deviceOrientationCameraController)||(this._deviceOrientationCameraController=new DeviceOrientationCameraController(this)),this._aspectRatioVR=this.camera.frustum.aspectRatio):(this._frameState.creditDisplay.container.style.visibility="visible",this._cameraVR=void 0,this._deviceOrientationCameraController=this._deviceOrientationCameraController&&!this._deviceOrientationCameraController.isDestroyed()&&this._deviceOrientationCameraController.destroy(),this.camera.frustum.aspectRatio=this._aspectRatioVR,this.camera.frustum.xOffset=0)}},mapMode2D:{get:function(){return this._mapMode2D}},imagerySplitPosition:{get:function(){return this._frameState.imagerySplitPosition},set:function(e){this._frameState.imagerySplitPosition=e}},minimumDisableDepthTestDistance:{get:function(){return this._minimumDisableDepthTestDistance},set:function(e){this._minimumDisableDepthTestDistance=e}},logarithmicDepthBuffer:{get:function(){return this._logDepthBuffer},set:function(e){e=this._context.fragmentDepth&&e,this._logDepthBuffer!==e&&(this._logDepthBuffer=e,this._logDepthBufferDirty=!0,this._defaultView.updateFrustums=!0)}},gamma:{get:function(){return this._context.uniformState.gamma},set:function(e){this._context.uniformState.gamma=e}},highDynamicRange:{get:function(){return this._hdr},set:function(e){var t=this._context,i=e&&t.depthTexture&&(t.colorBufferFloat||t.colorBufferHalfFloat);this._hdrDirty=i!==this._hdr,this._hdr=i}},highDynamicRangeSupported:{get:function(){var e=this._context;return e.depthTexture&&(e.colorBufferFloat||e.colorBufferHalfFloat)}},sunColor:{get:function(){return deprecationWarning("sun-color-removed","scene.sunColor will be removed in Cesium 1.69. Use scene.light.color and scene.light.intensity instead."),this.light.color},set:function(e){deprecationWarning("sun-color-removed","scene.sunColor will be removed in Cesium 1.69. Use scene.light.color and scene.light.intensity instead.");var t=Cartesian3.maximumComponent(e),i=Cartesian4.fromElements(e.x,e.y,e.z,1,scratchSunColor),r=1;1<t&&(Cartesian3.divideByScalar(i,t,i),r=t),this.light.color=Color.fromCartesian4(i,this.light.color),this.light.intensity=r}},pixelRatio:{get:function(){return this._frameState.pixelRatio},set:function(e){this._frameState.pixelRatio=e}},opaqueFrustumNearOffset:{get:function(){return this._frameState.useLogDepth?.9:.9999}},sunShaftEnabled:{get:function(){return this._sunShaftEnabled},set:function(e){this._sunShaftEnabled=e}},loadPrimitiveFirst:{get:function(){return this._loadPrimitiveFirst},set:function(e){this._loadPrimitiveFirst=e}}}),Scene.prototype.getCompressedTextureFormatSupported=function(e){var t=this.context;return("WEBGL_compressed_texture_s3tc"===e||"s3tc"===e)&&t.s3tc||("WEBGL_compressed_texture_pvrtc"===e||"pvrtc"===e)&&t.pvrtc||("WEBGL_compressed_texture_etc1"===e||"etc1"===e)&&t.etc1},Scene.prototype.updateDerivedCommands=function(e){if(defined(e.derivedCommands)){var t=this._frameState,i=this._context,r=e.derivedCommands,n=t.useLogDepth,a=defined(r.logDepth),o=n&&!a,s=t.textureProjecitonHints.shadowsEnabled,l=t.textureProjecitonHints.shadowMaps,u=t.textureProjecitonHints.lightShadowMaps;if(s&&defined(r)){var c=[],d=[];for(var h in l){var p=l[h];p._useDepth?d.push(p):c.push(p)}var f=!1;if(0<c.length&&defined(e.receiveTextureProjectionList)&&0<e.receiveTextureProjectionList.length&&((a||o)&&(r.logDepth=DerivedCommand.createLogDepthCommand(e,i,r.logDepth),TextureProjectionMap_createDerivedCommands(r.logDepth.command.derivedCommands,!1,l,u,r.logDepth.command,A,i,this._camera),updateDerivedCommands_impl(this,r.logDepth.command,A)),f=!0),0<d.length&&((a||o)&&(r.logDepth=DerivedCommand.createLogDepthCommand(e,i,r.logDepth),TextureProjectionMap_createDerivedCommands(r.logDepth.command.derivedCommands,!0,l,u,e,A,i,this._camera),e.castShadows&&(r.perspectivesWithDepth=r.logDepth.command.derivedCommands.perspectivesWithDepth),updateDerivedCommands_impl(this,r.logDepth.command,A)),f=!0),f)return}var m=!1,g=t.viewShedState.lastDirtyTime;e.lastDirtyTime!==g&&(e.lastDirtyTime=g,m=e.dirty=!0);var y=this._hdr,v=defined(r.hdr),_=defined(r.originalCommand),C=y&&!v,x=!(n&&y||_);if(e.dirty=e.dirty||o||C||x,e.dirty){e.dirty=!1;var b=t.viewShedState.shadowMaps;t.viewShedState.shadowsEnabled&&e.castShadows&&(r.viewShedMaps=ViewShedMap.createCastDerivedCommand(b,e,m,i,r.viewShedMaps)),(a||o)&&(r.logDepth=DerivedCommand.createLogDepthCommand(e,i,r.logDepth),updateDerivedCommands_viewShed(this,r.logDepth.command,m)),(_||x)&&updateDerivedCommands_viewShed(this,e,m)}var A=!1,S=t.shadowState.lastDirtyTime;if(e.lastDirtyTime!==S&&(e.lastDirtyTime=S,A=e.dirty=!0),e.dirty=e.dirty||o||C||x,e.dirty){e.dirty=!1;var w=t.shadowState.shadowMaps;t.shadowState.shadowsEnabled&&e.castShadows&&(r.shadows=ShadowMap.createCastDerivedCommand(w,e,A,i,r.shadows)),(a||o)&&(r.logDepth=DerivedCommand.createLogDepthCommand(e,i,r.logDepth),updateDerivedCommands(this,r.logDepth.command,A)),(_||x)&&updateDerivedCommands(this,e,A)}}};var renderTilesetPassState=new Cesium3DTilePassState({pass:Cesium3DTilePass$1.RENDER}),preloadTilesetPassState=new Cesium3DTilePassState({pass:Cesium3DTilePass$1.PRELOAD}),preloadFlightTilesetPassState=new Cesium3DTilePassState({pass:Cesium3DTilePass$1.PRELOAD_FLIGHT}),requestRenderModeDeferCheckPassState=new Cesium3DTilePassState({pass:Cesium3DTilePass$1.REQUEST_RENDER_MODE_DEFER_CHECK}),scratchOccluderBoundingSphere=new BoundingSphere,scratchOccluder;function getOccluder(e){var t=e.globe;if(e._mode===SceneMode$1.SCENE3D&&defined(t)&&t.show&&!e._cameraUnderground){var i=t.ellipsoid,r=e.frameState.minimumTerrainHeight;return scratchOccluderBoundingSphere.radius=i.minimumRadius+r,scratchOccluder=Occluder.fromBoundingSphere(scratchOccluderBoundingSphere,e.camera.positionWC,scratchOccluder)}}function updateFrameNumber(e,t,i){var r=e._frameState;r.frameNumber=t,r.time=JulianDate.clone(i,r.time)}function getAttributeLocations$2(e){var t={},i=e.vertexAttributes;for(var r in i)i.hasOwnProperty(r)&&(t[r]=i[r].index);return t}function createDebugFragmentShaderProgram(e,t,i){var r=t.context,n=defaultValue(i,e.shaderProgram),a=n.fragmentShaderSource.clone(),o=[];a.sources=a.sources.map(function(e){e=ShaderSource.replaceMain(e,"czm_Debug_main");for(var t,i=/gl_FragData\[(\d+)\]/g;null!==(t=i.exec(e));)-1===o.indexOf(t[1])&&o.push(t[1]);return e});var s,l=o.length,u="void main() \n{ \n czm_Debug_main(); \n";if(t.debugShowCommands){defined(e._debugColor)||(e._debugColor=Color.fromRandom());var c=e._debugColor;if(0<l)for(s=0;s<l;++s)u+=" gl_FragData["+o[s]+"].rgb *= vec3("+c.red+", "+c.green+", "+c.blue+"); \n";else u+=" gl_FragColor.rgb *= vec3("+c.red+", "+c.green+", "+c.blue+"); \n"}if(t.debugShowFrustums){var d=1&e.debugOverlappingFrustums?"1.0":"0.0",h=2&e.debugOverlappingFrustums?"1.0":"0.0",p=4&e.debugOverlappingFrustums?"1.0":"0.0";if(0<l)for(s=0;s<l;++s)u+=" gl_FragData["+o[s]+"].rgb *= vec3("+d+", "+h+", "+p+"); \n";else u+=" gl_FragColor.rgb *= vec3("+d+", "+h+", "+p+"); \n"}u+="}",a.sources.push(u);var f=getAttributeLocations$2(n);return ShaderProgram.fromCache({context:r,vertexShaderSource:n.vertexShaderSource,fragmentShaderSource:a,attributeLocations:f})}function executeDebugCommand(e,t,i){var r=DrawCommand.shallowClone(e);r.shaderProgram=createDebugFragmentShaderProgram(e,t),r.execute(t.context,i),r.shaderProgram.destroy()}Scene.prototype.clearPasses=function(e){e.render=!1,e.pick=!1,e.depth=!1,e.postProcess=!1,e.offscreen=!1},Scene.prototype.updateFrameState=function(){var e=this.camera,t=this._frameState;t.commandList.length=0,t.shadowMaps.length=0,t.textureProjectionMaps.length=0,t.viewShedMaps.length=0,t.brdfLutGenerator=this._brdfLutGenerator,t.environmentMap=this.skyBox&&this.skyBox._cubeMap,t.mode=this._mode,t.morphTime=this.morphTime,t.mapProjection=this.mapProjection,t.camera=e,t.cullingVolume=e.frustum.computeCullingVolume(e.positionWC,e.directionWC,e.upWC),t.occluder=getOccluder(this),t.terrainExaggeration=this._terrainExaggeration,t.minimumTerrainHeight=0,t.minimumDisableDepthTestDistance=this._minimumDisableDepthTestDistance,t.invertClassification=this.invertClassification,t.useLogDepth=this._logDepthBuffer&&!(this.camera.frustum instanceof OrthographicFrustum||this.camera.frustum instanceof OrthographicOffCenterFrustum),t.sunColor=this._sunColor,t.light=this.light,t.cameraUnderground=this._cameraUnderground,defined(this._specularEnvironmentMapAtlas)&&this._specularEnvironmentMapAtlas.ready?(t.specularEnvironmentMaps=this._specularEnvironmentMapAtlas.texture,t.specularEnvironmentMapsMaximumLOD=this._specularEnvironmentMapAtlas.maximumMipmapLevel):(t.specularEnvironmentMaps=void 0,t.specularEnvironmentMapsMaximumLOD=void 0),t.sphericalHarmonicCoefficients=this.sphericalHarmonicCoefficients,this._actualInvertClassificationColor=Color.clone(this.invertClassificationColor,this._actualInvertClassificationColor),InvertClassification.isTranslucencySupported(this._context)||(this._actualInvertClassificationColor.alpha=1),t.invertClassificationColor=this._actualInvertClassificationColor,defined(this.globe)?t.maximumScreenSpaceError=this.globe.maximumScreenSpaceError:t.maximumScreenSpaceError=2,this.clearPasses(t.passes),t.tilesetPassState=void 0},Scene.prototype.isVisible=function(e,t,i){return defined(e)&&(!defined(e.boundingVolume)||!e.cull||t.computeVisibility(e.boundingVolume)!==Intersect$1.OUTSIDE&&(!defined(i)||!e.occlude||!e.boundingVolume.isOccluded(i)))};var transformFrom2D=new Matrix4(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);function debugShowBoundingVolume(e,t,i,r){var n,a=t._frameState,o=a.context,s=e.boundingVolume;defined(t._debugVolume)&&t._debugVolume.destroy();var l=Cartesian3.clone(s.center);if(a.mode!==SceneMode$1.SCENE3D){l=Matrix4.multiplyByPoint(transformFrom2D,l,l);var u=a.mapProjection,c=u.unproject(l);l=u.ellipsoid.cartographicToCartesian(c)}if(defined(s.radius)){var d=s.radius;n=GeometryPipeline.toWireframe(EllipsoidGeometry.createGeometry(new EllipsoidGeometry({radii:new Cartesian3(d,d,d),vertexFormat:PerInstanceColorAppearance.FLAT_VERTEX_FORMAT}))),t._debugVolume=new Primitive({geometryInstances:new GeometryInstance({geometry:n,modelMatrix:Matrix4.fromTranslation(l),attributes:{color:new ColorGeometryInstanceAttribute(1,0,0,1)}}),appearance:new PerInstanceColorAppearance({flat:!0,translucent:!1}),asynchronous:!1})}else{var h=s.halfAxes;n=GeometryPipeline.toWireframe(BoxGeometry.createGeometry(BoxGeometry.fromDimensions({dimensions:new Cartesian3(2,2,2),vertexFormat:PerInstanceColorAppearance.FLAT_VERTEX_FORMAT}))),t._debugVolume=new Primitive({geometryInstances:new GeometryInstance({geometry:n,modelMatrix:Matrix4.fromRotationTranslation(h,l,new Matrix4),attributes:{color:new ColorGeometryInstanceAttribute(1,0,0,1)}}),appearance:new PerInstanceColorAppearance({flat:!0,translucent:!1}),asynchronous:!1})}var p,f=a.commandList,m=a.commandList=[];t._debugVolume.update(a),e=m[0],a.useLogDepth&&(e=DerivedCommand.createLogDepthCommand(e,o).command);defined(r)&&(p=i.framebuffer,i.framebuffer=r),e.execute(o,i),defined(p)&&(i.framebuffer=p),a.commandList=f}function executeCommand(e,t,i,r,n){var a=t._frameState;if(!defined(t.debugCommandFilter)||t.debugCommandFilter(e))if(e instanceof ClearCommand)e.execute(i,r);else{e.debugShowBoundingVolume&&defined(e.boundingVolume)&&debugShowBoundingVolume(e,t,r,n),a.useLogDepth&&defined(e.derivedCommands.logDepth)&&(e=e.derivedCommands.logDepth.command);var o=a.passes;if(!o.pick&&t._hdr&&defined(e.derivedCommands)&&defined(e.derivedCommands.hdr)&&(e=e.derivedCommands.hdr.command),o.pick||o.depth){if(o.pick&&!o.depth&&defined(e.derivedCommands.picking))return void(e=e.derivedCommands.picking.pickCommand).execute(i,r);if(defined(e.derivedCommands.depth))return void(e=e.derivedCommands.depth.depthOnlyCommand).execute(i,r)}if(t.debugShowCommands||t.debugShowFrustums)executeDebugCommand(e,t,r);else{var s=t.frameState.textureProjecitonHints.shadowsEnabled&&0<t.frameState.textureProjecitonHints.lightShadowMaps.length,l=defined(e.derivedCommands.fisheyes),u=defined(e.derivedCommands.perspectives),c=defined(e.derivedCommands.perspectivesWithDepth);s&&(l||u||c)?(u&&e.derivedCommands.perspectives.receiveCommand.execute(i,r),c&&e.derivedCommands.perspectivesWithDepth.receiveCommand.execute(i,r),l&&e.derivedCommands.fisheyes.receiveCommand.execute(i,r)):a.viewShedState.lightShadowsEnabled&&defined(e.derivedCommands.viewShedMaps)?e.derivedCommands.viewShedMaps.receiveCommand.execute(i,r):a.shadowState.lightShadowsEnabled&&e.receiveShadows&&defined(e.derivedCommands.shadows)?e.derivedCommands.shadows.receiveCommand.execute(i,r):e.execute(i,r)}}}function executeIdCommand(e,t,i,r){var n=t._frameState,a=e.derivedCommands;defined(a)&&(n.useLogDepth&&defined(a.logDepth)&&(e=a.logDepth.command),defined((a=e.derivedCommands).picking)?(e=a.picking.pickCommand).execute(i,r):defined(a.depth)&&(e=a.depth.depthOnlyCommand).execute(i,r))}function backToFront(e,t,i){return t.boundingVolume.distanceSquaredTo(i)-e.boundingVolume.distanceSquaredTo(i)}function frontToBack(e,t,i){return e.boundingVolume.distanceSquaredTo(i)-t.boundingVolume.distanceSquaredTo(i)+CesiumMath.EPSILON12}function executeTranslucentCommandsBackToFront(e,t,i,r,n){var a=e.context;mergeSort(r,backToFront,e.camera.positionWC),defined(n)&&t(n.unclassifiedCommand,e,a,i);for(var o=r.length,s=0;s<o;++s)t(r[s],e,a,i)}function executeTranslucentCommandsFrontToBack(e,t,i,r,n){var a=e.context;mergeSort(r,frontToBack,e.camera.positionWC),defined(n)&&t(n.unclassifiedCommand,e,a,i);for(var o=r.length,s=0;s<o;++s)t(r[s],e,a,i)}function getDebugGlobeDepth(e,t){var i=e._view.debugGlobeDepths,r=i[t];return!defined(r)&&e.context.depthTexture&&(r=new GlobeDepth,i[t]=r),r}transformFrom2D=Matrix4.inverseTransformation(transformFrom2D,transformFrom2D);var scratchPerspectiveFrustum$1=new PerspectiveFrustum,scratchPerspectiveOffCenterFrustum$1=new PerspectiveOffCenterFrustum,scratchOrthographicFrustum$1=new OrthographicFrustum,scratchOrthographicOffCenterFrustum$1=new OrthographicOffCenterFrustum;function executeCommands(e,t){var i,r=e.camera,n=e.context,a=n.uniformState;a.updateCamera(r),(i=defined(r.frustum.fov)?r.frustum.clone(scratchPerspectiveFrustum$1):defined(r.frustum.infiniteProjectionMatrix)?r.frustum.clone(scratchPerspectiveOffCenterFrustum$1):defined(r.frustum.width)?r.frustum.clone(scratchOrthographicFrustum$1):r.frustum.clone(scratchOrthographicOffCenterFrustum$1)).near=r.frustum.near,i.far=r.frustum.far,a.updateFrustum(i),a.updatePass(Pass$1.ENVIRONMENT);var o,s=e._frameState.passes,l=s.pick,u=e._environmentState,c=e._view,d=u.renderTranslucentDepthForPick,h=u.useWebVR;if(!l){var p,f=u.skyBoxCommand;if(defined(f)&&executeCommand(f,e,n,t),u.isSkyAtmosphereVisible&&executeCommand(u.skyAtmosphereCommand,e,n,t),u.isSunVisible)if(u.sunDrawCommand.execute(n,t),e.sunBloom&&!h)p=u.useGlobeDepthFramebuffer?c.globeDepth.framebuffer:u.usePostProcess?c.sceneFramebuffer.getFramebuffer():u.originalFramebuffer,e._sunPostProcess.execute(n),e._sunPostProcess.copy(n,p),t.framebuffer=p;u.isMoonVisible&&u.moonCommand.execute(n,t)}o=u.useOIT?(defined(e._executeOITFunction)||(e._executeOITFunction=function(e,t,i,r,n){c.oit.executeCommands(e,t,i,r,n)}),e._executeOITFunction):s.render?executeTranslucentCommandsBackToFront:executeTranslucentCommandsFrontToBack;for(var m,g=c.frustumCommandsList,y=g.length,v=u.clearGlobeDepth,_=u.useDepthPlane,C=u.separatePrimitiveFramebuffer=!1,x=e._depthClearCommand,b=e._stencilClearCommand,A=e._classificationStencilClearCommand,S=e._depthPlane,w=u.usePostProcessSelected,E=r.position.z,T=0;T<y;++T){var P=y-T-1,M=g[P];e.mode===SceneMode$1.SCENE2D?(r.position.z=E-M.near+1,i.far=Math.max(1,M.far-M.near),i.near=1,a.update(e.frameState)):(i.near=0!=P?M.near*e.opaqueFrustumNearOffset:M.near,i.far=M.far),a.updateFrustum(i);var D,I=e.debugShowGlobeDepth?getDebugGlobeDepth(e,P):c.globeDepth;C&&(t.framebuffer=I.framebuffer),e.debugShowGlobeDepth&&defined(I)&&u.useGlobeDepthFramebuffer&&(I.update(n,t,c.viewport,e._hdr,v),I.clear(n,t,e._clearColorCommand.color),D=t.framebuffer,t.framebuffer=I.framebuffer),x.execute(n,t),n.stencilBuffer&&b.execute(n,t),a.updatePass(Pass$1.GLOBE);var O,R=M.commands[Pass$1.GLOBE],L=M.indices[Pass$1.GLOBE];for(m=0;m<L;++m)executeCommand(R[m],e,n,t);for(defined(I)&&u.useGlobeDepthFramebuffer&&I.executeCopyDepth(n,t),e.debugShowGlobeDepth&&defined(I)&&u.useGlobeDepthFramebuffer&&(t.framebuffer=D),a.updatePass(Pass$1.TERRAIN_CLASSIFICATION),R=M.commands[Pass$1.TERRAIN_CLASSIFICATION],L=M.indices[Pass$1.TERRAIN_CLASSIFICATION],m=0;m<L;++m)executeCommand(R[m],e,n,t);if(v&&(x.execute(n,t),_&&S.execute(n,t)),C&&(t.framebuffer=I.primitiveFramebuffer),!u.useInvertClassification||l){for(a.updatePass(Pass$1.CESIUM_3D_TILE),R=M.commands[Pass$1.CESIUM_3D_TILE],L=M.indices[Pass$1.CESIUM_3D_TILE],m=0;m<L;++m)executeCommand(R[m],e,n,t);if(0<L)for(defined(I)&&u.useGlobeDepthFramebuffer&&I.executeUpdateDepth(n,t,v),a.updatePass(Pass$1.CESIUM_3D_TILE_CLASSIFICATION),R=M.commands[Pass$1.CESIUM_3D_TILE_CLASSIFICATION],L=M.indices[Pass$1.CESIUM_3D_TILE_CLASSIFICATION],m=0;m<L;++m)executeCommand(R[m],e,n,t)}else{e._invertClassification.clear(n,t);var N=t.framebuffer;for(t.framebuffer=e._invertClassification._fbo,a.updatePass(Pass$1.CESIUM_3D_TILE),R=M.commands[Pass$1.CESIUM_3D_TILE],L=M.indices[Pass$1.CESIUM_3D_TILE],m=0;m<L;++m)executeCommand(R[m],e,n,t);for(defined(I)&&u.useGlobeDepthFramebuffer&&I.executeUpdateDepth(n,t,v),a.updatePass(Pass$1.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW),R=M.commands[Pass$1.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW],L=M.indices[Pass$1.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW],m=0;m<L;++m)executeCommand(R[m],e,n,t);for(t.framebuffer=N,e._invertClassification.executeClassified(n,t),1===e.frameState.invertClassificationColor.alpha&&e._invertClassification.executeUnclassified(n,t),0<L&&n.stencilBuffer&&A.execute(n,t),a.updatePass(Pass$1.CESIUM_3D_TILE_CLASSIFICATION),R=M.commands[Pass$1.CESIUM_3D_TILE_CLASSIFICATION],L=M.indices[Pass$1.CESIUM_3D_TILE_CLASSIFICATION],m=0;m<L;++m)executeCommand(R[m],e,n,t)}for(0<L&&n.stencilBuffer&&b.execute(n,t),a.updatePass(Pass$1.OPAQUE),R=M.commands[Pass$1.OPAQUE],L=M.indices[Pass$1.OPAQUE],m=0;m<L;++m)executeCommand(R[m],e,n,t);if(0!=P&&e.mode!==SceneMode$1.SCENE2D&&(i.near=M.near,a.updateFrustum(i)),!l&&u.useInvertClassification&&e.frameState.invertClassificationColor.alpha<1&&(O=e._invertClassification),a.updatePass(Pass$1.TRANSLUCENT),(R=M.commands[Pass$1.TRANSLUCENT]).length=M.indices[Pass$1.TRANSLUCENT],o(e,executeCommand,t,R,O),n.depthTexture&&e.useDepthPicking&&(u.useGlobeDepthFramebuffer||d)){var k=d?t.framebuffer.depthStencilTexture:I.framebuffer.depthStencilTexture,B=e._picking.getPickDepth(e,P);B.update(n,k),B.executeCopyDepth(n,t)}if(C&&(t.framebuffer=I.framebuffer),!l&&w){var F=t.framebuffer;for(t.framebuffer=c.sceneFramebuffer.getIdFramebuffer(),i.near=0!=P?M.near*e.opaqueFrustumNearOffset:M.near,i.far=M.far,a.updateFrustum(i),a.updatePass(Pass$1.GLOBE),R=M.commands[Pass$1.GLOBE],L=M.indices[Pass$1.GLOBE],m=0;m<L;++m)executeIdCommand(R[m],e,n,t);for(v&&(x.framebuffer=t.framebuffer,x.execute(n,t),x.framebuffer=void 0),v&&_&&S.execute(n,t),a.updatePass(Pass$1.CESIUM_3D_TILE),R=M.commands[Pass$1.CESIUM_3D_TILE],L=M.indices[Pass$1.CESIUM_3D_TILE],m=0;m<L;++m)executeIdCommand(R[m],e,n,t);for(a.updatePass(Pass$1.OPAQUE),R=M.commands[Pass$1.OPAQUE],L=M.indices[Pass$1.OPAQUE],m=0;m<L;++m)executeIdCommand(R[m],e,n,t);for(a.updatePass(Pass$1.TRANSLUCENT),R=M.commands[Pass$1.TRANSLUCENT],L=M.indices[Pass$1.TRANSLUCENT],m=0;m<L;++m)executeIdCommand(R[m],e,n,t);t.framebuffer=F}}}function executeComputeCommands(e){e.context.uniformState.updatePass(Pass$1.COMPUTE);var t=e._environmentState.sunComputeCommand;defined(t)&&t.execute(e._computeEngine);for(var i=e._computeCommandList,r=i.length,n=0;n<r;++n)i[n].execute(e._computeEngine)}function executeOverlayCommands(e,t){e.context.uniformState.updatePass(Pass$1.OVERLAY);for(var i=e.context,r=e._overlayCommandList,n=r.length,a=0;a<n;++a)r[a].execute(i,t)}function insertShadowCastCommands(e,t,i){for(var r=i.shadowMapCullingVolume,n=i.isPointLight,a=i.passes,o=a.length,s=t.length,l=0;l<s;++l){var u=t[l];if(e.updateDerivedCommands(u),u.castShadows&&(u.pass===Pass$1.GLOBE||u.pass===Pass$1.CESIUM_3D_TILE||u.pass===Pass$1.OPAQUE||u.pass===Pass$1.TRANSLUCENT)&&e.isVisible(u,r))if(n)for(var c=0;c<o;++c)a[c].commandList.push(u);else if(1===o)a[0].commandList.push(u);else for(var d=!1,h=o-1;0<=h;--h){var p=a[h].cullingVolume;if(e.isVisible(u,p))a[h].commandList.push(u),d=!0;else if(d)break}}}function executeShadowMapCastCommands(e){var t=e.frameState,i=t.shadowState.shadowMaps,r=i.length;if(t.shadowState.shadowsEnabled)for(var n=e.context,a=n.uniformState,o=0;o<r;++o){var s=i[o];if(!s.outOfView){var l,u=s.passes,c=u.length;for(l=0;l<c;++l)u[l].commandList.length=0;for(insertShadowCastCommands(e,e.frameState.commandList,s),l=0;l<c;++l){var d=s.passes[l];a.updateCamera(d.camera),s.updatePass(n,l);for(var h=d.commandList.length,p=0;p<h;++p){var f=d.commandList[p];a.updatePass(f.pass),executeCommand(f.derivedCommands.shadows.castCommands[o],e,n,d.passState)}}}}}function executeViewShedMapCastCommands(e){var t=e.frameState,i=[];for(var r in t.viewShedState.shadowMaps){var n=t.viewShedState.shadowMaps[r];i.push(n)}var a=i.length;if(t.viewShedState.shadowsEnabled)for(var o=e.context,s=o.uniformState,l=0;l<a;++l){if(!(n=i[l]).outOfView){var u,c=n.passes,d=c.length;for(u=0;u<d;++u)c[u].commandList.length=0;for(insertShadowCastCommands(e,e.frameState.commandList,n),u=0;u<d;++u){var h=n.passes[u];s.updateCamera(h.camera),n.updatePass(o,u);for(var p=h.commandList.length,f=0;f<p;++f){var m=h.commandList[f];defined(m.derivedCommands.viewShedMaps)&&(m.derivedCommands.viewShedMaps.castCommands.length<a||(s.updatePass(m.pass),executeCommand(m.derivedCommands.viewShedMaps.castCommands[l],e,o,h.passState)))}}}}}function executeShadowMapCastInProjectionTextureCommands(e){var t=e.frameState,i=[];for(var r in t.textureProjecitonHints.shadowMaps){!0===(l=t.textureProjecitonHints.shadowMaps[r])._useDepth&&i.push(l)}var n=i.length;if(t.textureProjecitonHints.shadowsEnabled)for(var a=e.context,o=a.uniformState,s=0;s<n;++s){var l;if(!(l=i[s]).outOfView){var u,c=l.passes,d=c.length;for(u=0;u<d;++u)c[u].commandList.length=0;for(insertShadowCastCommands(e,e.frameState.commandList,l),u=0;u<d;++u){var h=l.passes[u];o.updateCamera(h.camera),l.updatePass(a,u);for(var p=h.commandList.length,f=0;f<p;++f){var m=h.commandList[f];defined(m.derivedCommands.perspectivesWithDepth)&&(m.derivedCommands.perspectivesWithDepth.castCommands.length<n||(o.updatePass(m.pass),executeCommand(m.derivedCommands.perspectivesWithDepth.castCommands[s],e,a,h.passState)))}}}}}var scratchEyeTranslation=new Cartesian3;function executeWebVRCommands(e,t,i){var r=e._view,n=r.camera,a=e._environmentState.renderTranslucentDepthForPick;updateAndClearFramebuffers(e,t,i),a||updateAndRenderPrimitives(e),r.createPotentiallyVisibleSet(e),a||(executeComputeCommands(e),executeShadowMapCastCommands(e),executeShadowMapCastInProjectionTextureCommands(e),executeViewShedMapCastCommands(e));var o=t.viewport;o.x=0,o.y=0,o.width=.5*o.width;var s=Camera.clone(n,e._cameraVR);s.frustum=n.frustum;var l=n.frustum.near,u=l*defaultValue(e.focalLength,5),c=defaultValue(e.eyeSeparation,u/30),d=Cartesian3.multiplyByScalar(s.right,.5*c,scratchEyeTranslation);n.frustum.aspectRatio=o.width/o.height;var h=.5*c*l/u;Cartesian3.add(s.position,d,n.position),n.frustum.xOffset=h,executeCommands(e,t),o.x=o.width,Cartesian3.subtract(s.position,d,n.position),n.frustum.xOffset=-h,executeCommands(e,t),Camera.clone(s,n)}Scene.prototype.updateAndExecuteCommands=function(e,t){var i=this._frameState.mode;this._environmentState.useWebVR?executeWebVRCommands(this,e,t):i!==SceneMode$1.SCENE2D||this._mapMode2D===MapMode2D$1.ROTATE?executeCommandsInViewport(!0,this,e,t):(updateAndClearFramebuffers(this,e,t),execute2DViewportCommands(this,e))};var scratch2DViewportCartographic=new Cartographic(Math.PI,CesiumMath.PI_OVER_TWO),scratch2DViewportMaxCoord=new Cartesian3,scratch2DViewportSavedPosition=new Cartesian3,scratch2DViewportTransform=new Matrix4,scratch2DViewportCameraTransform=new Matrix4,scratch2DViewportEyePoint=new Cartesian3,scratch2DViewportWindowCoords=new Cartesian3,scratch2DViewport=new BoundingRectangle;function execute2DViewportCommands(e,t){var i=e.context,r=e.frameState,n=e.camera,a=t.viewport,o=BoundingRectangle.clone(a,scratch2DViewport);t.viewport=o;var s=scratch2DViewportCartographic,l=scratch2DViewportMaxCoord;e.mapProjection.project(s,l);var u=Cartesian3.clone(n.position,scratch2DViewportSavedPosition),c=Matrix4.clone(n.transform,scratch2DViewportCameraTransform),d=n.frustum.clone();n._setTransform(Matrix4.IDENTITY);var h=Matrix4.computeViewportTransformation(o,0,1,scratch2DViewportTransform),p=n.frustum.projectionMatrix,f=n.positionWC.y,m=Cartesian3.fromElements(CesiumMath.sign(f)*l.x-f,0,-n.positionWC.x,scratch2DViewportEyePoint),g=Transforms.pointToGLWindowCoordinates(p,h,m,scratch2DViewportWindowCoords);g.x=Math.floor(g.x);var y=o.x,v=o.width;if(0===f||g.x<=y||g.x>=y+v)executeCommandsInViewport(!0,e,t);else if(Math.abs(y+.5*v-g.x)<1)o.width=g.x-o.x,n.position.x*=CesiumMath.sign(n.position.x),n.frustum.right=0,r.cullingVolume=n.frustum.computeCullingVolume(n.positionWC,n.directionWC,n.upWC),i.uniformState.update(r),executeCommandsInViewport(!0,e,t),o.x=g.x,n.position.x=-n.position.x,n.frustum.right=-n.frustum.left,n.frustum.left=0,r.cullingVolume=n.frustum.computeCullingVolume(n.positionWC,n.directionWC,n.upWC),i.uniformState.update(r),executeCommandsInViewport(!1,e,t);else if(g.x>y+.5*v){o.width=g.x-y;var _=n.frustum.right;n.frustum.right=l.x-f,r.cullingVolume=n.frustum.computeCullingVolume(n.positionWC,n.directionWC,n.upWC),i.uniformState.update(r),executeCommandsInViewport(!0,e,t),o.x=g.x,o.width=y+v-g.x,n.position.x=-n.position.x,n.frustum.left=-n.frustum.right,n.frustum.right=_-2*n.frustum.right,r.cullingVolume=n.frustum.computeCullingVolume(n.positionWC,n.directionWC,n.upWC),i.uniformState.update(r),executeCommandsInViewport(!1,e,t)}else{o.x=g.x,o.width=y+v-g.x;var C=n.frustum.left;n.frustum.left=-l.x-f,r.cullingVolume=n.frustum.computeCullingVolume(n.positionWC,n.directionWC,n.upWC),i.uniformState.update(r),executeCommandsInViewport(!0,e,t),o.x=y,o.width=g.x-y,n.position.x=-n.position.x,n.frustum.right=-n.frustum.left,n.frustum.left=C-2*n.frustum.left,r.cullingVolume=n.frustum.computeCullingVolume(n.positionWC,n.directionWC,n.upWC),i.uniformState.update(r),executeCommandsInViewport(!1,e,t)}n._setTransform(c),Cartesian3.clone(u,n.position),n.frustum=d.clone(),t.viewport=a}function executeCommandsInViewport(e,t,i,r){var n=t._environmentState,a=t._view,o=n.renderTranslucentDepthForPick;e||o||(t.frameState.commandList.length=0),o||updateAndRenderPrimitives(t),a.createPotentiallyVisibleSet(t),e&&(defined(r)&&updateAndClearFramebuffers(t,i,r),o||(executeComputeCommands(t),executeShadowMapCastCommands(t),executeShadowMapCastInProjectionTextureCommands(t),executeViewShedMapCastCommands(t))),executeCommands(t,i)}var scratchCullingVolume$1=new CullingVolume;function updateDebugFrustumPlanes(e){var t=e._frameState;e.debugShowFrustumPlanes!==e._debugShowFrustumPlanes&&(e.debugShowFrustumPlanes?e._debugFrustumPlanes=new DebugCameraPrimitive({camera:e.camera,updateOnChange:!1}):e._debugFrustumPlanes=e._debugFrustumPlanes&&e._debugFrustumPlanes.destroy(),e._debugShowFrustumPlanes=e.debugShowFrustumPlanes),defined(e._debugFrustumPlanes)&&e._debugFrustumPlanes.update(t)}function updateShadowMaps(e){var t=e._frameState,i=t.shadowMaps,r=i.length,n=0<r&&!t.passes.pick&&e.mode===SceneMode$1.SCENE3D;if(n!==t.shadowState.shadowsEnabled&&(++t.shadowState.lastDirtyTime,t.shadowState.shadowsEnabled=n),t.shadowState.lightShadowsEnabled=!1,n){for(var a=0;a<r;++a)if(i[a]!==t.shadowState.shadowMaps[a]){++t.shadowState.lastDirtyTime;break}t.shadowState.shadowMaps.length=0;for(var o=t.shadowState.lightShadowMaps.length=0;o<r;++o){var s=i[o];s.update(t),t.shadowState.shadowMaps.push(s),s.fromLightSource&&(t.shadowState.lightShadowMaps.push(s),t.shadowState.lightShadowsEnabled=!0),s.dirty&&(++t.shadowState.lastDirtyTime,s.dirty=!1)}}}function updateTextureProjectionMaps(e){var t=e._frameState,i=t.textureProjectionMaps,r=i.length,n=0<r&&!t.passes.pick&&e.mode===SceneMode$1.SCENE3D;if(n!==t.textureProjecitonHints.shadowsEnabled&&(++t.textureProjecitonHints.lastDirtyTime,t.textureProjecitonHints.shadowsEnabled=n),n){for(var a=0;a<r;++a)if(i[a]!==t.textureProjecitonHints.shadowMaps[a]){++t.textureProjecitonHints.lastDirtyTime;break}t.textureProjecitonHints.shadowMaps.length=0;for(var o=t.textureProjecitonHints.lightShadowMaps.length=0;o<r;++o){var s=i[o];s.update(t),t.textureProjecitonHints.shadowMaps.push(s),s.fromLightSource&&t.textureProjecitonHints.lightShadowMaps.push(s),s.dirty&&(++t.textureProjecitonHints.lastDirtyTime,s.dirty=!1)}}}function updateViewShedMaps(e){var t=e._frameState,i=t.viewShedMaps,r=i.length,n=0<r&&!t.passes.pick&&e.mode===SceneMode$1.SCENE3D;if(n!==t.viewShedState.shadowsEnabled&&(++t.viewShedState.lastDirtyTime,t.viewShedState.shadowsEnabled=n),t.viewShedState.lightShadowsEnabled=!1,n){for(var a=0;a<r;++a)if(i[a]!==t.viewShedState.shadowMaps[a]){++t.viewShedState.lastDirtyTime;break}t.viewShedState.shadowMaps.length=0;for(var o=t.viewShedState.lightShadowMaps.length=0;o<r;++o){var s=i[o];s.update(t),t.viewShedState.shadowMaps.push(s),t.viewShedState.lightShadowMaps.push(s),t.viewShedState.lightShadowsEnabled=!0,s.dirty&&(++t.viewShedState.lastDirtyTime,s.dirty=!1)}}}function updateAndRenderPrimitives(e){var t=e._frameState;e.loadPrimitiveFirst?(e._primitives.update(t),e._groundPrimitives.update(t)):(e._groundPrimitives.update(t),e._primitives.update(t)),updateDebugFrustumPlanes(e),updateShadowMaps(e),updateTextureProjectionMaps(e),updateViewShedMaps(e),e._globe&&e._globe.render(t)}function updateAndClearFramebuffers(e,t,i){var r=e._context,n=e._frameState,a=e._environmentState,o=e._view,s=e._frameState.passes.pick,l=a.useWebVR;a.originalFramebuffer=t.framebuffer,defined(e.sun)&&e.sunBloom!==e._sunBloom?(e.sunBloom&&!l?e._sunPostProcess=new SunPostProcess:defined(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy()),e._sunBloom=e.sunBloom):!defined(e.sun)&&defined(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy(),e._sunBloom=!1);var u=e._clearColorCommand;Color.clone(i,u.color),u.execute(r,t);var c=a.useGlobeDepthFramebuffer=defined(o.globeDepth);c&&(o.globeDepth.update(r,t,o.viewport,e._hdr,a.clearGlobeDepth),o.globeDepth.clear(r,t,i));var d=o.oit,h=a.useOIT=!s&&defined(d)&&d.isSupported();h&&(d.update(r,t,o.globeDepth.framebuffer,e._hdr),d.clear(r,t,i),a.useOIT=d.isSupported());var p=e.postProcessStages;e._sunShaftEnabled&&a.isSunVisible?p.sunShaft.enabled=!0:p.sunShaft.enabled=!1;var f,m=a.usePostProcess=!s&&(e._hdr||0<p.length||p.ambientOcclusion.enabled||p.fxaa.enabled||p.bloom.enabled||p.sunShaft.enabled);if(a.usePostProcessSelected=!1,m){if(o.sceneFramebuffer.update(r,o.viewport,e._hdr),o.sceneFramebuffer.clear(r,t,i),p.sunShaft.enabled){p.sunShaft.uniforms.u_size=e.sun._size;var g=n.mode;g===SceneMode$1.SCENE3D?BoundingSphere.clone(e.sun._boundingVolume,p.sunShaft._sunBoundingVolume):g===SceneMode$1.COLUMBUS_VIEW&&BoundingSphere.clone(e.sun._boundingVolume2D,p.sunShaft._sunBoundingVolume)}p.update(r,n.useLogDepth,e._hdr),p.clear(r),m=a.usePostProcess=p.ready,a.usePostProcessSelected=m&&p.hasSelected}if(a.isSunVisible&&e.sunBloom&&!l?(t.framebuffer=e._sunPostProcess.update(t),e._sunPostProcess.clear(r,t,i)):c?t.framebuffer=o.globeDepth.framebuffer:m&&(t.framebuffer=o.sceneFramebuffer.getFramebuffer()),defined(t.framebuffer)&&u.execute(r,t),a.useInvertClassification=!s&&defined(t.framebuffer)&&e.invertClassification)if(1===e.frameState.invertClassificationColor.alpha&&a.useGlobeDepthFramebuffer&&(f=o.globeDepth.framebuffer),defined(f)||r.depthTexture){if(e._invertClassification.previousFramebuffer=f,e._invertClassification.update(r),e._invertClassification.clear(r,t),e.frameState.invertClassificationColor.alpha<1&&h){var y=e._invertClassification.unclassifiedCommand,v=y.derivedCommands;v.oit=d.createDerivedCommands(y,r,v.oit)}}else a.useInvertClassification=!1}function callAfterRenderFunctions(e){for(var t=e._frameState.afterRender,i=0,r=t.length;i<r;++i)t[i](),e.requestRender();t.length=0}function isCameraUnderground(e){var t=e.camera,i=e._mode,r=e.globe,n=e._screenSpaceCameraController,a=t.positionCartographic;if(!n.onMap()&&a.height<0)return!0;if(!defined(r)||!r.show||i===SceneMode$1.SCENE2D||i===SceneMode$1.MORPHING)return!1;if(n.adjustedHeightForTerrain())return!1;var o=r.getHeight(a);return!!(defined(o)&&a.height<o)}function updateDebugShowFramesPerSecond(e,t){if(e.debugShowFramesPerSecond){if(!defined(e._performanceDisplay)){var i=document.createElement("div");i.className="geoworld-performanceDisplay-defaultContainer",e._canvas.parentNode.appendChild(i);var r=new PerformanceDisplay({container:i});e._performanceDisplay=r,e._performanceContainer=i}e._performanceDisplay.throttled=e.requestRenderMode,e._performanceDisplay.update(t)}else defined(e._performanceDisplay)&&(e._performanceDisplay=e._performanceDisplay&&e._performanceDisplay.destroy(),e._performanceContainer.parentNode.removeChild(e._performanceContainer))}function prePassesUpdate(e){e._jobScheduler.resetBudgets();var t=e._frameState;e.primitives.prePassesUpdate(t),defined(e.globe)&&e.globe.update(t),e._picking.update(),t.creditDisplay.update()}function postPassesUpdate(e){var t=e._frameState;e.primitives.postPassesUpdate(t),RequestScheduler.update()}Scene.prototype.updateEnvironment=function(){var e=this._frameState,t=this._view,i=this._environmentState,r=e.passes.render,n=e.passes.offscreen,a=this.skyAtmosphere,o=this.globe;if(!r||this._mode!==SceneMode$1.SCENE2D&&t.camera.frustum instanceof OrthographicFrustum||this._cameraUnderground)i.skyAtmosphereCommand=void 0,i.skyBoxCommand=void 0,i.sunDrawCommand=void 0,i.sunComputeCommand=void 0,i.moonCommand=void 0;else{defined(a)?(defined(o)&&(a.setDynamicAtmosphereColor(o.enableLighting&&o.dynamicAtmosphereLighting,o.dynamicAtmosphereLightingFromSun),i.isReadyForAtmosphere=i.isReadyForAtmosphere||0<o._surface._tilesToRender.length),i.skyAtmosphereCommand=a.update(e)):i.skyAtmosphereCommand=void 0,i.skyBoxCommand=defined(this.skyBox)?this.skyBox.update(e,this._hdr):void 0;var s=defined(this.sun)?this.sun.update(e,t.passState,this._hdr):void 0;i.sunDrawCommand=defined(s)?s.drawCommand:void 0,i.sunComputeCommand=defined(s)?s.computeCommand:void 0,i.moonCommand=defined(this.moon)?this.moon.update(e):void 0}var l=i.clearGlobeDepth=defined(o)&&(!o.depthTestAgainstTerrain||this.mode===SceneMode$1.SCENE2D);(i.useDepthPlane=l&&this.mode===SceneMode$1.SCENE3D&&!this._cameraUnderground)&&this._depthPlane.update(e),i.renderTranslucentDepthForPick=!1,i.useWebVR=this._useWebVR&&this.mode!==SceneMode$1.SCENE2D&&!n;for(var u=e.mode===SceneMode$1.SCENE3D?e.occluder:void 0,c=e.cullingVolume,d=scratchCullingVolume$1.planes,h=0;h<5;++h)d[h]=c.planes[h];c=scratchCullingVolume$1,i.isSkyAtmosphereVisible=defined(i.skyAtmosphereCommand)&&i.isReadyForAtmosphere,i.isSunVisible=this.isVisible(i.sunDrawCommand,c,u),i.isMoonVisible=this.isVisible(i.moonCommand,c,u);var p=this.specularEnvironmentMaps,f=this._specularEnvironmentMapAtlas;!defined(p)||defined(f)&&f.url===p?!defined(p)&&defined(f)&&(f.destroy(),this._specularEnvironmentMapAtlas=void 0):(f=f&&f.destroy(),this._specularEnvironmentMapAtlas=new OctahedralProjectedCubeMap(p)),defined(this._specularEnvironmentMapAtlas)&&this._specularEnvironmentMapAtlas.update(e)},Scene.prototype.resolveFramebuffers=function(e){var t=this._context,i=this._frameState,r=this._environmentState,n=this._view,a=n.globeDepth,o=r.useOIT,s=r.useGlobeDepthFramebuffer,l=r.usePostProcess,u=r.originalFramebuffer,c=s?a.framebuffer:void 0,d=n.sceneFramebuffer.getFramebuffer(),h=n.sceneFramebuffer.getIdFramebuffer();if(r.separatePrimitiveFramebuffer&&a.executeMergeColor(t,e),o&&(e.framebuffer=l?d:u,n.oit.execute(t,e)),r.isSunVisible){var p,f=this.camera,m=t.uniformState;m.updateCamera(f),(p=defined(f.frustum.fov)?f.frustum.clone(scratchPerspectiveFrustum$1):defined(f.frustum.infiniteProjectionMatrix)?f.frustum.clone(scratchPerspectiveOffCenterFrustum$1):defined(f.frustum.width)?f.frustum.clone(scratchOrthographicFrustum$1):f.frustum.clone(scratchOrthographicOffCenterFrustum$1)).near=f.frustum.near,p.far=f.frustum.far,m.updateFrustum(p)}if(l){var g=d;s&&!o&&(g=c);var y=this.postProcessStages,v=g.getColorTexture(0),_=h.getColorTexture(0),C=defaultValue(c,d).depthStencilTexture;y.execute(t,v,C,_),y.copy(t,u)}o||l||!s||(e.framebuffer=u,a.executeCopyColor(t,e));var x=i.useLogDepth;this.debugShowGlobeDepth&&s&&getDebugGlobeDepth(this,this.debugShowDepthFrustum-1).executeDebugGlobeDepth(t,e,x);this.debugShowPickDepth&&s&&this._picking.getPickDepth(this,this.debugShowDepthFrustum-1).executeDebugPickDepth(t,e,x)},Scene.prototype.initializeFrame=function(){120==this._shaderFrameCount++&&(this._shaderFrameCount=0,this._context.shaderCache.destroyReleasedShaderPrograms(),this._context.textureCache.destroyReleasedTextures()),this._tweens.update(),this._screenSpaceCameraController.update(),defined(this._deviceOrientationCameraController)&&this._deviceOrientationCameraController.update(),this.camera.update(this._mode),this.camera._updateCameraChanged(),this._cameraUnderground=isCameraUnderground(this)};var scratchBackgroundColor=new Color;function render(e){var t=e._frameState,i=e.context,r=i.uniformState,n=e._defaultView;e._view=n,e.updateFrameState(),t.passes.render=!0,t.passes.postProcess=e.postProcessStages.hasSelected,t.tilesetPassState=renderTilesetPassState;var a=defaultValue(e.backgroundColor,Color.BLACK);e._hdr&&((a=Color.clone(a,scratchBackgroundColor)).red=Math.pow(a.red,e.gamma),a.green=Math.pow(a.green,e.gamma),a.blue=Math.pow(a.blue,e.gamma)),t.backgroundColor=a,e.fog.update(t),r.update(t);var o=e.shadowMap;defined(o)&&o.enabled&&(!defined(e.light)||e.light instanceof SunLight?Cartesian3.negate(r.sunDirectionWC,e._shadowMapCamera.direction):Cartesian3.clone(e.light.direction,e._shadowMapCamera.direction),t.shadowMaps.push(o));var s=e.textureProjectionMapList;if(0<s.length)for(var l=0;l<s.length;l++){var u=s[l];u.enabled&&t.textureProjectionMaps.push(u)}var c=e.viewShedMapList;for(l=0;l<c.length;l++){var d=c[l];d.enabled&&t.viewShedMaps.push(d)}e._computeCommandList.length=0,e._overlayCommandList.length=0;var h=n.viewport;h.x=0,h.y=0,h.width=i.drawingBufferWidth,h.height=i.drawingBufferHeight;var p=n.passState;p.framebuffer=void 0,p.blendingEnabled=void 0,p.scissorTest=void 0,p.viewport=BoundingRectangle.clone(h,p.viewport),defined(e.globe)&&e.globe.beginFrame(t),e.updateEnvironment(),e.updateAndExecuteCommands(p,a),e.resolveFramebuffers(p),p.framebuffer=void 0,executeOverlayCommands(e,p),defined(e.globe)&&(e.globe.endFrame(t),e.globe.tilesLoaded||(e._renderRequested=!0)),i.endFrame()}function tryAndCatchError(t,e){try{e(t)}catch(e){if(t._renderError.raiseEvent(t,e),t.rethrowRenderErrors)throw e}}function updateMostDetailedRayPicks(e){return e._picking.updateMostDetailedRayPicks(e)}function updatePreloadPass(e){var t=e._frameState;preloadTilesetPassState.camera=t.camera,preloadTilesetPassState.cullingVolume=t.cullingVolume,e.primitives.updateForPass(t,preloadTilesetPassState)}function updatePreloadFlightPass(e){var t=e._frameState;t.camera.canPreloadFlight()&&(preloadFlightTilesetPassState.camera=e.preloadFlightCamera,preloadFlightTilesetPassState.cullingVolume=e.preloadFlightCullingVolume,e.primitives.updateForPass(t,preloadFlightTilesetPassState))}function updateRequestRenderModeDeferCheckPass(e){e.primitives.updateForPass(e._frameState,requestRenderModeDeferCheckPassState)}Scene.prototype.render=function(e){this._preUpdate.raiseEvent(this,e);var t=this._frameState;t.newFrame=!1,defined(e)||(e=JulianDate.now());var i=this._view.checkForCameraUpdates(this),r=!this.requestRenderMode||this._renderRequested||i||this._logDepthBufferDirty||this._hdrDirty||this.mode===SceneMode$1.MORPHING;if(!r&&defined(this.maximumRenderTimeChange)&&defined(this._lastRenderTime)){var n=Math.abs(JulianDate.secondsDifference(this._lastRenderTime,e));r=r||n>this.maximumRenderTimeChange}r&&(this._lastRenderTime=JulianDate.clone(e,this._lastRenderTime),this._renderRequested=!1,this._logDepthBufferDirty=!1,this._hdrDirty=!1,updateFrameNumber(this,CesiumMath.incrementWrap(t.frameNumber,15e6,1),e),t.newFrame=!0);tryAndCatchError(this,prePassesUpdate),this.primitives.show&&(tryAndCatchError(this,updateMostDetailedRayPicks),tryAndCatchError(this,updatePreloadPass),tryAndCatchError(this,updatePreloadFlightPass),r||tryAndCatchError(this,updateRequestRenderModeDeferCheckPass)),this._postUpdate.raiseEvent(this,e),r&&(this._preRender.raiseEvent(this,e),tryAndCatchError(this,render)),updateDebugShowFramesPerSecond(this,r),tryAndCatchError(this,postPassesUpdate),callAfterRenderFunctions(this),r&&this._postRender.raiseEvent(this,e)},Scene.prototype.forceRender=function(e){this._renderRequested=!0,this.render(e)},Scene.prototype.requestRender=function(){this._renderRequested=!0},Scene.prototype.clampLineWidth=function(e){return Math.max(ContextLimits.minimumAliasedLineWidth,Math.min(e,ContextLimits.maximumAliasedLineWidth))},Scene.prototype.pick=function(e,t,i){return this._picking.pick(this,e,t,i)},Scene.prototype.pickPositionWorldCoordinates=function(e,t){return this._picking.pickPositionWorldCoordinates(this,e,t)},Scene.prototype.pickPosition=function(e,t){return this._picking.pickPosition(this,e,t)},Scene.prototype.drillPick=function(e,t,i,r){return this._picking.drillPick(this,e,t,i,r)},Scene.prototype.pickFromRay=function(e,t,i){return this._picking.pickFromRay(this,e,t,i)},Scene.prototype.drillPickFromRay=function(e,t,i,r){return this._picking.drillPickFromRay(this,e,t,i,r)},Scene.prototype.pickFromRayMostDetailed=function(e,t,i){return this._picking.pickFromRayMostDetailed(this,e,t,i)},Scene.prototype.drillPickFromRayMostDetailed=function(e,t,i,r){return this._picking.drillPickFromRayMostDetailed(this,e,t,i,r)},Scene.prototype.sampleHeight=function(e,t,i){return this._picking.sampleHeight(this,e,t,i)},Scene.prototype.clampToHeight=function(e,t,i,r){return this._picking.clampToHeight(this,e,t,i,r)},Scene.prototype.sampleHeightMostDetailed=function(e,t,i){return this._picking.sampleHeightMostDetailed(this,e,t,i)},Scene.prototype.clampToHeightMostDetailed=function(e,t,i){return this._picking.clampToHeightMostDetailed(this,e,t,i)},Scene.prototype.cartesianToCanvasCoordinates=function(e,t){return SceneTransforms.wgs84ToWindowCoordinates(this,e,t)},Scene.prototype.completeMorph=function(){this._transitioner.completeMorph()},Scene.prototype.morphTo2D=function(e){var t,i=this.globe;t=defined(i)?i.ellipsoid:this.mapProjection.ellipsoid,e=defaultValue(e,2),this._transitioner.morphTo2D(e,t)},Scene.prototype.morphToColumbusView=function(e){var t,i=this.globe;t=defined(i)?i.ellipsoid:this.mapProjection.ellipsoid,e=defaultValue(e,2),this._transitioner.morphToColumbusView(e,t)},Scene.prototype.morphTo3D=function(e){var t,i=this.globe;t=defined(i)?i.ellipsoid:this.mapProjection.ellipsoid,e=defaultValue(e,2),this._transitioner.morphTo3D(e,t)},Scene.prototype.isDestroyed=function(){return!1},Scene.prototype.destroy=function(){this._tweens.removeAll(),this._computeEngine=this._computeEngine&&this._computeEngine.destroy(),this._screenSpaceCameraController=this._screenSpaceCameraController&&this._screenSpaceCameraController.destroy(),this._deviceOrientationCameraController=this._deviceOrientationCameraController&&!this._deviceOrientationCameraController.isDestroyed()&&this._deviceOrientationCameraController.destroy(),this._primitives=this._primitives&&this._primitives.destroy(),this._groundPrimitives=this._groundPrimitives&&this._groundPrimitives.destroy(),this._globe=this._globe&&this._globe.destroy(),this.skyBox=this.skyBox&&this.skyBox.destroy(),this.skyAtmosphere=this.skyAtmosphere&&this.skyAtmosphere.destroy(),this._debugSphere=this._debugSphere&&this._debugSphere.destroy(),this.sun=this.sun&&this.sun.destroy(),this._sunPostProcess=this._sunPostProcess&&this._sunPostProcess.destroy(),this._depthPlane=this._depthPlane&&this._depthPlane.destroy(),this._transitioner=this._transitioner&&this._transitioner.destroy(),this._debugFrustumPlanes=this._debugFrustumPlanes&&this._debugFrustumPlanes.destroy(),this._brdfLutGenerator=this._brdfLutGenerator&&this._brdfLutGenerator.destroy(),this._picking=this._picking&&this._picking.destroy(),this._defaultView=this._defaultView&&this._defaultView.destroy(),this._view=void 0,this._removeCreditContainer&&this._canvas.parentNode.removeChild(this._creditContainer),this.postProcessStages=this.postProcessStages&&this.postProcessStages.destroy(),this._context=this._context&&this._context.destroy(),this._frameState.creditDisplay=this._frameState.creditDisplay&&this._frameState.creditDisplay.destroy(),defined(this._performanceDisplay)&&(this._performanceDisplay=this._performanceDisplay&&this._performanceDisplay.destroy(),this._performanceContainer.parentNode.removeChild(this._performanceContainer)),this._removeRequestListenerCallback(),this._removeTaskProcessorListenerCallback();for(var e=0;e<this._removeGlobeCallbacks.length;++e)this._removeGlobeCallbacks[e]();return this._removeGlobeCallbacks.length=0,destroyObject(this)};var SkyAtmosphereFS="#ifdef COLOR_CORRECT\nuniform vec3 u_hsbShift;\n#endif\nuniform vec4 u_cameraAndRadiiAndDynamicAtmosphereColor;\nconst float g = -0.95;\nconst float g2 = g * g;\nvarying vec3 v_rayleighColor;\nvarying vec3 v_mieColor;\nvarying vec3 v_toCamera;\nvarying vec3 v_positionEC;\nvoid main (void)\n{\nfloat lightEnum = u_cameraAndRadiiAndDynamicAtmosphereColor.w;\nvec3 lightDirection =\nczm_viewerPositionWC * float(lightEnum == 0.0) +\nczm_lightDirectionWC * float(lightEnum == 1.0) +\nczm_sunDirectionWC * float(lightEnum == 2.0);\nlightDirection = normalize(lightDirection);\nfloat cosAngle = dot(lightDirection, normalize(v_toCamera)) / length(v_toCamera);\nfloat rayleighPhase = 0.75 * (1.0 + cosAngle * cosAngle);\nfloat miePhase = 1.5 * ((1.0 - g2) / (2.0 + g2)) * (1.0 + cosAngle * cosAngle) / pow(1.0 + g2 - 2.0 * g * cosAngle, 1.5);\nvec3 rgb = rayleighPhase * v_rayleighColor + miePhase * v_mieColor;\n#ifndef HDR\nconst float exposure = 2.0;\nrgb = vec3(1.0) - exp(-exposure * rgb);\n#endif\n#ifdef COLOR_CORRECT\nvec3 hsb = czm_RGBToHSB(rgb);\nhsb.x += u_hsbShift.x;\nhsb.y = clamp(hsb.y + u_hsbShift.y, 0.0, 1.0);\nhsb.z = hsb.z > czm_epsilon7 ? hsb.z + u_hsbShift.z : 0.0;\nrgb = czm_HSBToRGB(hsb);\n#endif\nfloat atmosphereAlpha = clamp((u_cameraAndRadiiAndDynamicAtmosphereColor.y - u_cameraAndRadiiAndDynamicAtmosphereColor.x) / (u_cameraAndRadiiAndDynamicAtmosphereColor.y - u_cameraAndRadiiAndDynamicAtmosphereColor.z), 0.0, 1.0);\nfloat nightAlpha = (lightEnum != 0.0) ? clamp(dot(normalize(czm_viewerPositionWC), lightDirection), 0.0, 1.0) : 1.0;\natmosphereAlpha *= pow(nightAlpha, 0.5);\ngl_FragColor = vec4(rgb, mix(rgb.b, 1.0, atmosphereAlpha) * smoothstep(0.0, 1.0, czm_morphTime));\n}\n",SkyAtmosphereVS="attribute vec4 position;\nuniform vec4 u_cameraAndRadiiAndDynamicAtmosphereColor;\nconst float Kr = 0.0025;\nconst float Kr4PI = Kr * 4.0 * czm_pi;\nconst float Km = 0.0015;\nconst float Km4PI = Km * 4.0 * czm_pi;\nconst float ESun = 15.0;\nconst float KmESun = Km * ESun;\nconst float KrESun = Kr * ESun;\nconst vec3 InvWavelength = vec3(\n5.60204474633241,\n9.473284437923038,\n19.643802610477206);\nconst float rayleighScaleDepth = 0.25;\nconst int nSamples = 2;\nconst float fSamples = 2.0;\nvarying vec3 v_rayleighColor;\nvarying vec3 v_mieColor;\nvarying vec3 v_toCamera;\nfloat scale(float cosAngle)\n{\nfloat x = 1.0 - cosAngle;\nreturn rayleighScaleDepth * exp(-0.00287 + x*(0.459 + x*(3.83 + x*(-6.80 + x*5.25))));\n}\nvoid main(void)\n{\nfloat cameraHeight = u_cameraAndRadiiAndDynamicAtmosphereColor.x;\nfloat outerRadius = u_cameraAndRadiiAndDynamicAtmosphereColor.y;\nfloat innerRadius = u_cameraAndRadiiAndDynamicAtmosphereColor.z;\nvec3 positionV3 = position.xyz;\nvec3 ray = positionV3 - czm_viewerPositionWC;\nfloat far = length(ray);\nray /= far;\nfloat atmosphereScale = 1.0 / (outerRadius - innerRadius);\n#ifdef SKY_FROM_SPACE\nfloat B = 2.0 * dot(czm_viewerPositionWC, ray);\nfloat C = cameraHeight * cameraHeight - outerRadius * outerRadius;\nfloat det = max(0.0, B*B - 4.0 * C);\nfloat near = 0.5 * (-B - sqrt(det));\nvec3 start = czm_viewerPositionWC + ray * near;\nfar -= near;\nfloat startAngle = dot(ray, start) / outerRadius;\nfloat startDepth = exp(-1.0 / rayleighScaleDepth );\nfloat startOffset = startDepth*scale(startAngle);\n#else // SKY_FROM_ATMOSPHERE\nvec3 start = czm_viewerPositionWC;\nfloat height = length(start);\nfloat depth = exp((atmosphereScale / rayleighScaleDepth ) * (innerRadius - cameraHeight));\nfloat startAngle = dot(ray, start) / height;\nfloat startOffset = depth*scale(startAngle);\n#endif\nfloat lightEnum = u_cameraAndRadiiAndDynamicAtmosphereColor.w;\nvec3 lightDirection =\nczm_viewerPositionWC * float(lightEnum == 0.0) +\nczm_lightDirectionWC * float(lightEnum == 1.0) +\nczm_sunDirectionWC * float(lightEnum == 2.0);\nlightDirection = normalize(lightDirection);\nfloat sampleLength = far / fSamples;\nfloat scaledLength = sampleLength * atmosphereScale;\nvec3 sampleRay = ray * sampleLength;\nvec3 samplePoint = start + sampleRay * 0.5;\nvec3 frontColor = vec3(0.0, 0.0, 0.0);\nfor(int i=0; i<nSamples; i++)\n{\nfloat height = length(samplePoint);\nfloat depth = exp((atmosphereScale / rayleighScaleDepth ) * (innerRadius - height));\nfloat fLightAngle = dot(lightDirection, samplePoint) / height;\nfloat fCameraAngle = dot(ray, samplePoint) / height;\nfloat fScatter = (startOffset + depth*(scale(fLightAngle) - scale(fCameraAngle)));\nvec3 attenuate = exp(-fScatter * (InvWavelength * Kr4PI + Km4PI));\nfrontColor += attenuate * (depth * scaledLength);\nsamplePoint += sampleRay;\n}\nv_mieColor = frontColor * KmESun;\nv_rayleighColor = frontColor * (InvWavelength * KrESun);\nv_toCamera = czm_viewerPositionWC - positionV3;\ngl_Position = czm_modelViewProjection * position;\n}\n";function SkyAtmosphere(e){e=defaultValue(e,Ellipsoid.WGS84),this.show=!0,this._ellipsoid=e,this._command=new DrawCommand({owner:this}),this._spSkyFromSpace=void 0,this._spSkyFromAtmosphere=void 0,this._spSkyFromSpaceColorCorrect=void 0,this._spSkyFromAtmosphereColorCorrect=void 0,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this._hueSaturationBrightness=new Cartesian3;var t=new Cartesian4;t.w=0,t.y=Cartesian3.maximumComponent(Cartesian3.multiplyByScalar(e.radii,1.025,new Cartesian3)),t.z=e.maximumRadius,this._cameraAndRadiiAndDynamicAtmosphereColor=t;var i=this;this._command.uniformMap={u_cameraAndRadiiAndDynamicAtmosphereColor:function(){return i._cameraAndRadiiAndDynamicAtmosphereColor},u_hsbShift:function(){return i._hueSaturationBrightness.x=i.hueShift,i._hueSaturationBrightness.y=i.saturationShift,i._hueSaturationBrightness.z=i.brightnessShift,i._hueSaturationBrightness}}}function colorCorrect(e){return!(CesiumMath.equalsEpsilon(e.hueShift,0,CesiumMath.EPSILON7)&&CesiumMath.equalsEpsilon(e.saturationShift,0,CesiumMath.EPSILON7)&&CesiumMath.equalsEpsilon(e.brightnessShift,0,CesiumMath.EPSILON7))}Object.defineProperties(SkyAtmosphere.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),SkyAtmosphere.prototype.setDynamicAtmosphereColor=function(e,t){this._cameraAndRadiiAndDynamicAtmosphereColor.w=e?t?2:1:0},SkyAtmosphere.prototype.update=function(e){if(this.show){var t=e.mode;if((t===SceneMode$1.SCENE3D||t===SceneMode$1.MORPHING)&&e.passes.render){var i=this._command;if(!defined(i.vertexArray)){var r=e.context,n=EllipsoidGeometry.createGeometry(new EllipsoidGeometry({radii:Cartesian3.multiplyByScalar(this._ellipsoid.radii,1.025,new Cartesian3),slicePartitions:256,stackPartitions:256,vertexFormat:VertexFormat.POSITION_ONLY}));i.vertexArray=VertexArray.fromGeometry({context:r,geometry:n,attributeLocations:GeometryPipeline.createAttributeLocations(n),bufferUsage:BufferUsage$1.STATIC_DRAW}),i.renderState=RenderState.fromCache({cull:{enabled:!0,face:CullFace$1.FRONT},blending:BlendingState$1.ALPHA_BLEND,depthMask:!1});var a=new ShaderSource({defines:["SKY_FROM_SPACE"],sources:[SkyAtmosphereVS]});this._spSkyFromSpace=ShaderProgram.fromCache({context:r,vertexShaderSource:a,fragmentShaderSource:SkyAtmosphereFS}),a=new ShaderSource({defines:["SKY_FROM_ATMOSPHERE"],sources:[SkyAtmosphereVS]}),this._spSkyFromAtmosphere=ShaderProgram.fromCache({context:r,vertexShaderSource:a,fragmentShaderSource:SkyAtmosphereFS})}var o=colorCorrect(this);if(o&&(!defined(this._spSkyFromSpaceColorCorrect)||!defined(this._spSkyFromAtmosphereColorCorrect))){var s=e.context,l=new ShaderSource({defines:["SKY_FROM_SPACE"],sources:[SkyAtmosphereVS]}),u=new ShaderSource({defines:["COLOR_CORRECT"],sources:[SkyAtmosphereFS]});this._spSkyFromSpaceColorCorrect=ShaderProgram.fromCache({context:s,vertexShaderSource:l,fragmentShaderSource:u}),l=new ShaderSource({defines:["SKY_FROM_ATMOSPHERE"],sources:[SkyAtmosphereVS]}),this._spSkyFromAtmosphereColorCorrect=ShaderProgram.fromCache({context:s,vertexShaderSource:l,fragmentShaderSource:u})}var c=e.camera.positionWC,d=Cartesian3.magnitude(c);return(this._cameraAndRadiiAndDynamicAtmosphereColor.x=d)>this._cameraAndRadiiAndDynamicAtmosphereColor.y?i.shaderProgram=o?this._spSkyFromSpaceColorCorrect:this._spSkyFromSpace:i.shaderProgram=o?this._spSkyFromAtmosphereColorCorrect:this._spSkyFromAtmosphere,i}}},SkyAtmosphere.prototype.isDestroyed=function(){return!1},SkyAtmosphere.prototype.destroy=function(){var e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),this._spSkyFromSpace=this._spSkyFromSpace&&this._spSkyFromSpace.destroy(),this._spSkyFromAtmosphere=this._spSkyFromAtmosphere&&this._spSkyFromAtmosphere.destroy(),this._spSkyFromSpaceColorCorrect=this._spSkyFromSpaceColorCorrect&&this._spSkyFromSpaceColorCorrect.destroy(),this._spSkyFromAtmosphereColorCorrect=this._spSkyFromAtmosphereColorCorrect&&this._spSkyFromAtmosphereColorCorrect.destroy(),destroyObject(this)};var SkyBoxFS="uniform samplerCube u_cubeMap;\nvarying vec3 v_texCoord;\nvoid main()\n{\nvec4 color = textureCube(u_cubeMap, normalize(v_texCoord));\ngl_FragColor = vec4(czm_gammaCorrect(color).rgb, czm_morphTime);\n}\n",SkyBoxVS="attribute vec3 position;\nvarying vec3 v_texCoord;\nvoid main()\n{\nvec3 p = czm_viewRotation * (czm_temeToPseudoFixed * (czm_entireFrustum.y * position));\ngl_Position = czm_projection * vec4(p, 1.0);\nv_texCoord = position.xyz;\n}\n";function SkyBox(e){this.sources=e.sources,this._sources=void 0,this.show=defaultValue(e.show,!0),this._command=new DrawCommand({modelMatrix:Matrix4.clone(Matrix4.IDENTITY),owner:this}),this._cubeMap=void 0,this._attributeLocations=void 0,this._useHdr=void 0}function SphereEmitter(e){e=defaultValue(e,1),this._radius=defaultValue(e,1)}function StyleExpression(){}SkyBox.prototype.update=function(e,t){var i=this;if(this.show&&(e.mode===SceneMode$1.SCENE3D||e.mode===SceneMode$1.MORPHING)&&e.passes.render){var r=e.context;if(this._sources!==this.sources){this._sources=this.sources;var n=this.sources;"string"==typeof n.positiveX?loadCubeMap(r,this._sources).then(function(e){i._cubeMap=i._cubeMap&&i._cubeMap.destroy(),i._cubeMap=e}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new CubeMap({context:r,source:n}))}var a=this._command;if(!defined(a.vertexArray)){a.uniformMap={u_cubeMap:function(){return i._cubeMap}};var o=BoxGeometry.createGeometry(BoxGeometry.fromDimensions({dimensions:new Cartesian3(2,2,2),vertexFormat:VertexFormat.POSITION_ONLY})),s=this._attributeLocations=GeometryPipeline.createAttributeLocations(o);a.vertexArray=VertexArray.fromGeometry({context:r,geometry:o,attributeLocations:s,bufferUsage:BufferUsage$1.STATIC_DRAW}),a.renderState=RenderState.fromCache({blending:BlendingState$1.ALPHA_BLEND})}if(!defined(a.shaderProgram)||this._useHdr!==t){var l=new ShaderSource({defines:[t?"HDR":""],sources:[SkyBoxFS]});a.shaderProgram=ShaderProgram.fromCache({context:r,vertexShaderSource:SkyBoxVS,fragmentShaderSource:l,attributeLocations:this._attributeLocations}),this._useHdr=t}if(defined(this._cubeMap))return a}},SkyBox.prototype.isDestroyed=function(){return!1},SkyBox.prototype.destroy=function(){var e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),destroyObject(this)},Object.defineProperties(SphereEmitter.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}}),SphereEmitter.prototype.emit=function(e){var t=CesiumMath.randomBetween(0,CesiumMath.TWO_PI),i=CesiumMath.randomBetween(0,CesiumMath.PI),r=CesiumMath.randomBetween(0,this._radius),n=r*Math.cos(t)*Math.sin(i),a=r*Math.sin(t)*Math.sin(i),o=r*Math.cos(i);e.position=Cartesian3.fromElements(n,a,o,e.position),e.velocity=Cartesian3.normalize(e.position,e.velocity)},StyleExpression.prototype.evaluate=function(e,t){DeveloperError.throwInstantiationError()},StyleExpression.prototype.evaluateColor=function(e,t){DeveloperError.throwInstantiationError()},StyleExpression.prototype.getShaderFunction=function(e,t,i,r){DeveloperError.throwInstantiationError()};var SunFS="uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nvec4 color = texture2D(u_texture, v_textureCoordinates);\ngl_FragColor = czm_gammaCorrect(color);\n}\n",SunTextureFS="uniform float u_radiusTS;\nvarying vec2 v_textureCoordinates;\nvec2 rotate(vec2 p, vec2 direction)\n{\nreturn vec2(p.x * direction.x - p.y * direction.y, p.x * direction.y + p.y * direction.x);\n}\nvec4 addBurst(vec2 position, vec2 direction, float lengthScalar)\n{\nvec2 rotatedPosition = rotate(position, direction) * vec2(25.0, 0.75);\nfloat radius = length(rotatedPosition) * lengthScalar;\nfloat burst = 1.0 - smoothstep(0.0, 0.55, radius);\nreturn vec4(burst);\n}\nvoid main()\n{\nfloat lengthScalar = 2.0 / sqrt(2.0);\nvec2 position = v_textureCoordinates - vec2(0.5);\nfloat radius = length(position) * lengthScalar;\nfloat surface = step(radius, u_radiusTS);\nvec4 color = vec4(vec2(1.0), surface + 0.2, surface);\nfloat glow = 1.0 - smoothstep(0.0, 0.55, radius);\ncolor.ba += mix(vec2(0.0), vec2(1.0), glow) * 0.75;\nvec4 burst = vec4(0.0);\nburst += 0.4 * addBurst(position, vec2(0.38942, 0.92106), lengthScalar);\nburst += 0.4 * addBurst(position, vec2(0.99235, 0.12348), lengthScalar);\nburst += 0.4 * addBurst(position, vec2(0.60327, -0.79754), lengthScalar);\nburst += 0.3 * addBurst(position, vec2(0.31457, 0.94924), lengthScalar);\nburst += 0.3 * addBurst(position, vec2(0.97931, 0.20239), lengthScalar);\nburst += 0.3 * addBurst(position, vec2(0.66507, -0.74678), lengthScalar);\ncolor += clamp(burst, vec4(0.0), vec4(1.0)) * 0.15;\ngl_FragColor = clamp(color, vec4(0.0), vec4(1.0));\n}\n",SunVS="attribute vec2 direction;\nuniform float u_size;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nvec4 position;\nif (czm_morphTime == 1.0)\n{\nposition = vec4(czm_sunPositionWC, 1.0);\n}\nelse\n{\nposition = vec4(czm_sunPositionColumbusView.zxy, 1.0);\n}\nvec4 positionEC = czm_view * position;\nvec4 positionWC = czm_eyeToWindowCoordinates(positionEC);\nvec2 halfSize = vec2(u_size * 0.5);\nhalfSize *= ((direction * 2.0) - 1.0);\ngl_Position = czm_viewportOrthographic * vec4(positionWC.xy + halfSize, -positionWC.z, 1.0);\nv_textureCoordinates = direction;\n}\n",SunTextureFS_v2="uniform float u_radiusTS;\nvarying vec2 v_textureCoordinates;\nconst float _BlurRadius = 0.3;\nconst int _Iteration = 30;\nvec4 getColor(vec2 p)\n{\nfloat lengthScalar = 2.0 / sqrt(2.0);\nvec2 position = p - vec2(0.5);\nfloat radius = length(position) * lengthScalar;\nfloat surface = step(radius, u_radiusTS);\nvec4 color = vec4(vec2(1.0), surface + 0.2, surface);\nfloat glow = 1.0 - smoothstep(0.0, 0.55, radius);\ncolor.ba += mix(vec2(0.0), vec2(1.0), glow) * 0.75;\nreturn color;\n}\nvoid main()\n{\nvec2 blurVector = (v_textureCoordinates - vec2(0.5)) * _BlurRadius;\nvec4 acumulateColor = vec4(0, 0, 0, 0);\nvec2 texcoord = v_textureCoordinates;\ngl_FragColor = getColor(texcoord);\n}\n";function Sun(){this.show=!0,this._drawCommand=new DrawCommand({primitiveType:PrimitiveType$1.TRIANGLES,boundingVolume:new BoundingSphere,owner:this}),this._commands={drawCommand:this._drawCommand,computeCommand:void 0},this._boundingVolume=new BoundingSphere,this._boundingVolume2D=new BoundingSphere,this._texture=void 0,this._drawingBufferWidth=void 0,this._drawingBufferHeight=void 0,this._radiusTS=void 0,this._size=void 0,this.glowFactor=1,this._glowFactorDirty=!1,this._useHdr=void 0;var e=this;this._uniformMap={u_texture:function(){return e._texture},u_size:function(){return e._size}}}Object.defineProperties(Sun.prototype,{glowFactor:{get:function(){return this._glowFactor},set:function(e){e=Math.max(e,0),this._glowFactor=e,this._glowFactorDirty=!0}}});var scratchPositionWC=new Cartesian2,scratchLimbWC=new Cartesian2,scratchPositionEC=new Cartesian4,scratchCartesian4$6=new Cartesian4;function TileBoundingVolume(){}function TileCoordinatesImageryProvider(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this._tilingScheme=defined(e.tilingScheme)?e.tilingScheme:new GeographicTilingScheme({ellipsoid:e.ellipsoid}),this._color=defaultValue(e.color,Color.YELLOW),this._errorEvent=new Event,this._tileWidth=defaultValue(e.tileWidth,256),this._tileHeight=defaultValue(e.tileHeight,256),this._readyPromise=when.resolve(!0)}function TileDiscardPolicy(e){DeveloperError.throwInstantiationError()}Sun.prototype.update=function(e,t,i){if(this.show){var r=e.mode;if(r!==SceneMode$1.SCENE2D&&r!==SceneMode$1.MORPHING&&e.passes.render){var n=e.context,a=t.viewport.width,o=t.viewport.height;if(!defined(this._texture)||a!==this._drawingBufferWidth||o!==this._drawingBufferHeight||this._glowFactorDirty||i!==this._useHdr){this._texture=this._texture&&this._texture.destroy(),this._drawingBufferWidth=a,this._drawingBufferHeight=o,this._glowFactorDirty=!1,this._useHdr=i;var s=Math.max(a,o);s=Math.pow(2,Math.ceil(Math.log(s)/Math.log(2))-2),s=Math.max(1,s);var l=i?n.halfFloatingPointTexture?PixelDatatype$1.HALF_FLOAT:PixelDatatype$1.FLOAT:PixelDatatype$1.UNSIGNED_BYTE;this._texture=new Texture({context:n,width:s,height:s,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:l}),this._glowLengthTS=5*this._glowFactor,this._radiusTS=1/(1+2*this._glowLengthTS)*.5;var u=this,c={u_radiusTS:function(){return u._radiusTS}};this._commands.computeCommand=new ComputeCommand({fragmentShaderSource:SunTextureFS_v2,outputTexture:this._texture,uniformMap:c,persists:!1,owner:this,postExecute:function(){u._commands.computeCommand=void 0}})}var d=this._drawCommand;if(!defined(d.vertexArray)){var h={direction:0},p=new Uint8Array(8);p[0]=0,p[1]=0,p[2]=255,p[3]=0,p[4]=255,p[5]=255,p[6]=0,p[7]=255;var f=Buffer$1.createVertexBuffer({context:n,typedArray:p,usage:BufferUsage$1.STATIC_DRAW}),m=[{index:h.direction,vertexBuffer:f,componentsPerAttribute:2,normalize:!0,componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE}],g=Buffer$1.createIndexBuffer({context:n,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:BufferUsage$1.STATIC_DRAW,indexDatatype:IndexDatatype$1.UNSIGNED_SHORT});d.vertexArray=new VertexArray({context:n,attributes:m,indexBuffer:g}),d.shaderProgram=ShaderProgram.fromCache({context:n,vertexShaderSource:SunVS,fragmentShaderSource:SunFS,attributeLocations:h}),d.renderState=RenderState.fromCache({blending:BlendingState$1.ALPHA_BLEND}),d.uniformMap=this._uniformMap}var y=n.uniformState.sunPositionWC,v=n.uniformState.sunPositionColumbusView,_=this._boundingVolume,C=this._boundingVolume2D;Cartesian3.clone(y,_.center),C.center.x=v.z,C.center.y=v.x,C.center.z=v.y,_.radius=CesiumMath.SOLAR_RADIUS+CesiumMath.SOLAR_RADIUS*this._glowLengthTS,C.radius=_.radius,r===SceneMode$1.SCENE3D?BoundingSphere.clone(_,d.boundingVolume):r===SceneMode$1.COLUMBUS_VIEW&&BoundingSphere.clone(C,d.boundingVolume);var x=SceneTransforms.computeActualWgs84Position(e,y,scratchCartesian4$6),b=Cartesian3.magnitude(Cartesian3.subtract(x,e.camera.position,scratchCartesian4$6)),A=n.uniformState.projection,S=scratchPositionEC;S.x=0,S.y=0,S.z=-b,S.w=1;var w=Matrix4.multiplyByVector(A,S,scratchCartesian4$6),E=SceneTransforms.clipToGLWindowCoordinates(t.viewport,w,scratchPositionWC);S.x=CesiumMath.SOLAR_RADIUS;var T=Matrix4.multiplyByVector(A,S,scratchCartesian4$6),P=SceneTransforms.clipToGLWindowCoordinates(t.viewport,T,scratchLimbWC);return this._size=Cartesian2.magnitude(Cartesian2.subtract(P,E,scratchCartesian4$6)),this._size=2*this._size*(1+2*this._glowLengthTS),this._size=Math.ceil(this._size),this._commands}}},Sun.prototype.isDestroyed=function(){return!1},Sun.prototype.destroy=function(){var e=this._drawCommand;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._texture=this._texture&&this._texture.destroy(),destroyObject(this)},TileBoundingVolume.prototype.boundingVolume=void 0,TileBoundingVolume.prototype.boundingSphere=void 0,TileBoundingVolume.prototype.distanceToCamera=function(e){DeveloperError.throwInstantiationError()},TileBoundingVolume.prototype.intersectPlane=function(e){DeveloperError.throwInstantiationError()},TileBoundingVolume.prototype.createDebugVolume=function(e){DeveloperError.throwInstantiationError()},Object.defineProperties(TileCoordinatesImageryProvider.prototype,{proxy:{get:function(){}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){}},minimumLevel:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return!0}},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}}}),TileCoordinatesImageryProvider.prototype.getTileCredits=function(e,t,i){},TileCoordinatesImageryProvider.prototype.requestImage=function(e,t,i,r){var n=document.createElement("canvas");n.width=256,n.height=256;var a=n.getContext("2d"),o=this._color.toCssColorString();return a.strokeStyle=o,a.lineWidth=2,a.strokeRect(1,1,255,255),a.font="bold 25px Arial",a.textAlign="center",a.fillStyle=o,a.fillText("L: "+i,124,86),a.fillText("X: "+e,124,136),a.fillText("Y: "+t,124,186),n},TileCoordinatesImageryProvider.prototype.pickFeatures=function(e,t,i,r,n){},TileDiscardPolicy.prototype.isReady=DeveloperError.throwInstantiationError,TileDiscardPolicy.prototype.shouldDiscardImage=DeveloperError.throwInstantiationError;var TileState={START:0,LOADING:1,READY:2,UPSAMPLED_ONLY:3},TileState$1=Object.freeze(TileState);function TimeDynamicPointCloud(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this.show=defaultValue(e.show,!0),this.modelMatrix=Matrix4.clone(defaultValue(e.modelMatrix,Matrix4.IDENTITY)),this.shadows=defaultValue(e.shadows,ShadowMode$1.ENABLED),this.maximumMemoryUsage=defaultValue(e.maximumMemoryUsage,256),this.shading=new PointCloudShading(e.shading),this.style=e.style,this.frameFailed=new Event,this.frameChanged=new Event,this._clock=e.clock,this._intervals=e.intervals,this._clippingPlanes=void 0,this.clippingPlanes=e.clippingPlanes,this._pointCloudEyeDomeLighting=new PointCloudEyeDomeLighting,this._loadTimestamp=void 0,this._clippingPlanesState=0,this._styleDirty=!1,this._pickId=void 0,this._totalMemoryUsageInBytes=0,this._frames=[],this._previousInterval=void 0,this._nextInterval=void 0,this._lastRenderedFrame=void 0,this._clockMultiplier=0,this._readyPromise=when.defer(),this._runningSum=0,this._runningLength=0,this._runningIndex=0,this._runningSamples=arrayFill(new Array(5),0),this._runningAverage=0}function getFragmentShaderLoaded$1(e){return"uniform vec4 czm_pickColor;\n"+e}function getUniformMapLoaded$1(t){return function(e){return combine(e,{czm_pickColor:function(){return t._pickId.color}})}}function getPickIdLoaded$1(){return"czm_pickColor"}Object.defineProperties(TimeDynamicPointCloud.prototype,{clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){ClippingPlaneCollection.setOwner(e,this,"_clippingPlanes")}},totalMemoryUsageInBytes:{get:function(){return this._totalMemoryUsageInBytes}},boundingSphere:{get:function(){if(defined(this._lastRenderedFrame))return this._lastRenderedFrame.pointCloud.boundingSphere}},readyPromise:{get:function(){return this._readyPromise.promise}}}),TimeDynamicPointCloud.prototype.makeStyleDirty=function(){this._styleDirty=!0},TimeDynamicPointCloud.prototype._getAverageLoadTime=function(){return 0===this._runningLength?.05:this._runningAverage};var scratchDate$1=new JulianDate;function getClockMultiplier(e){var t=e._clock,i=t.canAnimate&&t.shouldAnimate,r=t.multiplier;return i?r:0}function getIntervalIndex(e,t){return e._intervals.indexOf(t.start)}function getNextInterval(e,t){var i=e._intervals,r=e._clock,n=getClockMultiplier(e);if(0!==n){var a=e._getAverageLoadTime(),o=JulianDate.addSeconds(r.currentTime,a*n,scratchDate$1),s=i.indexOf(o);return s===getIntervalIndex(e,t)&&(0<=n?++s:--s),i.get(s)}}function getCurrentInterval(e){var t=e._intervals,i=e._clock.currentTime,r=t.indexOf(i);return t.get(r)}function reachedInterval(e,t,i){var r=getClockMultiplier(e),n=getIntervalIndex(e,t),a=getIntervalIndex(e,i);return 0<=r?a<=n:n<=a}function handleFrameFailure(i,r){return function(e){var t=defined(e.message)?e.message:e.toString();0<i.frameFailed.numberOfListeners?i.frameFailed.raiseEvent({uri:r,message:t}):(console.log("A frame failed to load: "+r),console.log("Error: "+t))}}function requestFrame(t,e,i){var r=getIntervalIndex(t,e),n=t._frames,a=n[r];if(!defined(a)){var o=e.data.transform,s=defined(o)?Matrix4.fromArray(o):void 0,l=e.data.uri;a={pointCloud:void 0,transform:s,timestamp:getTimestamp$1(),sequential:!0,ready:!1,touchedFrameNumber:i.frameNumber},n[r]=a,Resource.fetchArrayBuffer({url:l}).then(function(e){return a.pointCloud=new PointCloud({arrayBuffer:e,cull:!0,fragmentShaderLoaded:getFragmentShaderLoaded$1,uniformMapLoaded:getUniformMapLoaded$1(t),pickIdLoaded:getPickIdLoaded$1}),a.pointCloud.readyPromise}).otherwise(handleFrameFailure(t,l))}return a}function updateAverageLoadTime(e,t){e._runningSum+=t,e._runningSum-=e._runningSamples[e._runningIndex],e._runningSamples[e._runningIndex]=t,e._runningLength=Math.min(e._runningLength+1,e._runningSamples.length),e._runningIndex=(e._runningIndex+1)%e._runningSamples.length,e._runningAverage=e._runningSum/e._runningLength}function prepareFrame(e,t,i,r){t.touchedFrameNumber<r.frameNumber-1&&(t.sequential=!1);var n=t.pointCloud;if(defined(n)&&!t.ready){var a=r.commandList,o=a.length;if(renderFrame(e,t,i,r),n.ready)if(t.ready=!0,e._totalMemoryUsageInBytes+=n.geometryByteLength,a.length=o,t.sequential)updateAverageLoadTime(e,(getTimestamp$1()-t.timestamp)/1e3)}t.touchedFrameNumber=r.frameNumber}var scratchModelMatrix=new Matrix4;function getGeometricError$1(e,t){var i=e.shading;return defined(i)&&defined(i.baseResolution)?i.baseResolution:defined(t.boundingSphere)?CesiumMath.cbrt(t.boundingSphere.volume()/t.pointsLength):0}function getMaximumAttenuation(e){var t=e.shading;return defined(t)&&defined(t.maximumAttenuation)?t.maximumAttenuation:10}var defaultShading$1=new PointCloudShading;function renderFrame(e,t,i,r){var n=defaultValue(e.shading,defaultShading$1),a=t.pointCloud,o=defaultValue(t.transform,Matrix4.IDENTITY);a.modelMatrix=Matrix4.multiplyTransformation(e.modelMatrix,o,scratchModelMatrix),a.style=e.style,a.time=i.timeSinceLoad,a.shadows=e.shadows,a.clippingPlanes=e._clippingPlanes,a.isClipped=i.isClipped,a.attenuation=n.attenuation,a.backFaceCulling=n.backFaceCulling,a.normalShading=n.normalShading,a.geometricError=getGeometricError$1(e,a),a.geometricErrorScale=n.geometricErrorScale,a.maximumAttenuation=getMaximumAttenuation(e),a.update(r),t.touchedFrameNumber=r.frameNumber}function loadFrame(e,t,i,r){prepareFrame(e,requestFrame(e,t,r),i,r)}function getUnloadCondition(t){return function(e){return e.touchedFrameNumber<t.frameNumber}}function unloadFrames(e,t){for(var i=e._frames,r=i.length,n=0;n<r;++n){var a=i[n];if(defined(a)&&(!defined(t)||t(a))){var o=a.pointCloud;a.ready&&(e._totalMemoryUsageInBytes-=o.geometryByteLength),defined(o)&&o.destroy(),a===e._lastRenderedFrame&&(e._lastRenderedFrame=void 0),i[n]=void 0}}}function getFrame(e,t){var i=getIntervalIndex(e,t),r=e._frames[i];if(defined(r)&&r.ready)return r}function updateInterval(e,t,i,r,n){return!!defined(i)&&(!!i.ready||(loadFrame(e,t,r,n),i.ready))}function getNearestReadyInterval(e,t,i,r,n){var a,o,s=e._intervals,l=e._frames,u=getIntervalIndex(e,i),c=getIntervalIndex(e,t);if(c<=u){for(a=u;c<=a;--a)if(updateInterval(e,o=s.get(a),l[a],r,n))return o}else for(a=u;a<=c;++a)if(updateInterval(e,o=s.get(a),l[a],r,n))return o;return t}function setFramesDirty(e,t,i){for(var r=e._frames,n=r.length,a=0;a<n;++a){var o=r[a];defined(o)&&defined(o.pointCloud)&&(o.pointCloud.clippingPlanesDirty=t,o.pointCloud.styleDirty=i)}}var updateState={timeSinceLoad:0,isClipped:!1,clippingPlanesDirty:!1};TimeDynamicPointCloud.prototype.update=function(e){if(e.mode!==SceneMode$1.MORPHING&&this.show){defined(this._pickId)||(this._pickId=e.context.createPickId({primitive:this})),defined(this._loadTimestamp)||(this._loadTimestamp=JulianDate.clone(e.time));var t=Math.max(1e3*JulianDate.secondsDifference(e.time,this._loadTimestamp),0),i=this._clippingPlanes,r=0,n=!1,a=defined(i)&&i.enabled;a&&(i.update(e),r=i.clippingPlanesState),this._clippingPlanesState!==r&&(this._clippingPlanesState=r,n=!0);var o=this._styleDirty;this._styleDirty=!1,(n||o)&&setFramesDirty(this,n,o),updateState.timeSinceLoad=t,updateState.isClipped=a;var s=this.shading,l=this._pointCloudEyeDomeLighting,u=e.commandList,c=u.length,d=this._previousInterval,h=this._nextInterval,p=getCurrentInterval(this);if(defined(p)){var f=!1,m=getClockMultiplier(this),g=0===m;m!==this._clockMultiplier&&(f=!0,this._clockMultiplier=m),defined(d)&&!g||(d=p),defined(h)&&!f&&!reachedInterval(this,p,h)||(h=getNextInterval(this,p));var y=getFrame(this,d=getNearestReadyInterval(this,d,p,updateState,e));defined(y)||(loadFrame(this,d,updateState,e),y=this._lastRenderedFrame),defined(y)&&renderFrame(this,y,updateState,e),defined(h)&&loadFrame(this,h,updateState,e);var v=this;defined(y)&&!defined(this._lastRenderedFrame)&&e.afterRender.push(function(){v._readyPromise.resolve(v)}),defined(y)&&y!==this._lastRenderedFrame&&0<v.frameChanged.numberOfListeners&&e.afterRender.push(function(){v.frameChanged.raiseEvent(v)}),this._previousInterval=d,this._nextInterval=h,this._lastRenderedFrame=y;var _=this._totalMemoryUsageInBytes;1024*this.maximumMemoryUsage*1024<_&&unloadFrames(this,getUnloadCondition(e));var C=u.length-c;defined(s)&&s.attenuation&&s.eyeDomeLighting&&0<C&&l.update(e,c,s,this.boundingSphere)}}},TimeDynamicPointCloud.prototype.isDestroyed=function(){return!1},TimeDynamicPointCloud.prototype.destroy=function(){return unloadFrames(this),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),destroyObject(this)};var ViewportQuadFS="varying vec2 v_textureCoordinates;\nvoid main()\n{\nczm_materialInput materialInput;\nmaterialInput.s = v_textureCoordinates.s;\nmaterialInput.st = v_textureCoordinates;\nmaterialInput.str = vec3(v_textureCoordinates, 0.0);\nmaterialInput.normalEC = vec3(0.0, 0.0, -1.0);\nczm_material material = czm_getMaterial(materialInput);\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n}\n";function ViewportQuad(e,t){this.show=!0,defined(e)||(e=new BoundingRectangle),this.rectangle=BoundingRectangle.clone(e),defined(t)||(t=Material.fromType(Material.ColorType,{color:new Color(1,1,1,1)})),this.material=t,this._material=void 0,this._overlayCommand=void 0,this._rs=void 0}ViewportQuad.prototype.update=function(e){if(this.show){var t=this._rs;if(defined(t)&&BoundingRectangle.equals(t.viewport,this.rectangle)||(this._rs=RenderState.fromCache({blending:BlendingState$1.ALPHA_BLEND,viewport:this.rectangle})),e.passes.render){var i=e.context;if(this._material!==this.material||!defined(this._overlayCommand)){this._material=this.material,defined(this._overlayCommand)&&this._overlayCommand.shaderProgram.destroy();var r=new ShaderSource({sources:[this._material.shaderSource,ViewportQuadFS]});this._overlayCommand=i.createViewportQuadCommand(r,{renderState:this._rs,uniformMap:this._material._uniforms,owner:this}),this._overlayCommand.pass=Pass$1.OVERLAY}this._material.update(i),this._overlayCommand.uniformMap=this._material._uniforms,e.commandList.push(this._overlayCommand)}}},ViewportQuad.prototype.isDestroyed=function(){return!1},ViewportQuad.prototype.destroy=function(){return defined(this._overlayCommand)&&(this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.destroy()),destroyObject(this)};var tmp$a={},nDx,oDx;nDx=tmp$a,oDx=function(i,r){return o={},n.m=a=[function(e,t,i){i(1);var r=i(7);e.exports=r},function(e,t,i){var r;void 0===(r=function(e){return i(2).registerCoordinateSystem("GLMap",i(3)),i(5),i(6),i(2).registerAction({type:"GLMapRoam",event:"GLMapRoam",update:"updateLayout"},function(e,t){}),{version:"1.0.0"}}.call(t,i,t,e))||(e.exports=r)},function(e,t){e.exports=i},function(e,t,i){var r;void 0===(r=function(e){var n=i(2);function a(e,t){this._GLMap=e,this.dimensions=["lng","lat"],this._mapOffset=[0,0],this._api=t}return a.prototype.dimensions=["lng","lat"],a.prototype.setMapOffset=function(e){this._mapOffset=e},a.prototype.getBMap=function(){return this._GLMap},a.prototype.dataToPoint=function(e){var t=CesiumMath.toRadians(80),i=[99999,99999],r=Cartesian3.fromDegrees(e[0],e[1]);if(!r)return i;var n=this._GLMap.cartesianToCanvasCoordinates(r);if(!n)return i;var a=this._GLMap;return!(a.mode===SceneMode$1.SCENE3D&&Cartesian3.angleBetween(a.camera.position,r)>t)&&[n.x-this._mapOffset[0],n.y-this._mapOffset[1]]},a.prototype.pointToData=function(e){var t=this._mapOffset;return[(e=this._bmap.project([e[0]+t[0],e[1]+t[1]])).lng,e.lat]},a.prototype.getViewRect=function(){var e=this._api;return new n.graphic.BoundingRect(0,0,e.getWidth(),e.getHeight())},a.prototype.getRoamTransform=function(){return n.matrix.create()},a.dimensions=a.prototype.dimensions,a.create=function(e,i){var r;e.eachComponent("GLMap",function(e){i.getZr().painter.getViewportRoot();var t=n.glMap;(r=new a(t,i)).setMapOffset(e.__mapOffset||[0,0]),e.coordinateSystem=r}),e.eachSeries(function(e){"GLMap"===e.get("coordinateSystem")&&(e.coordinateSystem=r)})},a}.call(t,i,t,e))||(e.exports=r)},function(e,t){e.exports=r},function(e,t,i){var r;void 0===(r=function(e){return i(2).extendComponentModel({type:"GLMap",getBMap:function(){return this.__GLMap},defaultOption:{roam:!1}})}.call(t,i,t,e))||(e.exports=r)},function(e,t,i){var r;void 0===(r=function(e){return i(2).extendComponentView({type:"GLMap",init:function(e,t){this.api=t,echarts.glMap.postRender.addEventListener(this.moveHandler,this)},moveHandler:function(){this.api.dispatchAction({type:"GLMapRoam"})},render:function(e,t,i){},dispose:function(e,t){echarts.glMap.postRender.removeEventListener(this.moveHandler,this)}})}.call(t,i,t,e))||(e.exports=r)},function(e,t){function i(e,t){this._mapContainer=e,this._overlay=this._createChartOverlay(),this._overlay.setOption(t)}i.prototype._createChartOverlay=function(){var e=this._mapContainer.scene;e.canvas.setAttribute("tabIndex",0);var t=document.createElement("div");return t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.width=e.canvas.width+"px",t.style.height=e.canvas.height+"px",t.style.pointerEvents="none",t.setAttribute("id","echarts"),t.setAttribute("class","echartMap"),this._mapContainer.container.appendChild(t),this._echartsContainer=t,echarts.glMap=e,echarts.init(t)},i.prototype.dispose=function(){this._echartsContainer&&(this._mapContainer.container.removeChild(this._echartsContainer),this._echartsContainer=null),this._overlay&&(this._overlay.dispose(),this._overlay=null)},i.prototype.destroy=function(){this.dispose()},i.prototype.updateOverlay=function(e){this._overlay&&this._overlay.setOption(e)},i.prototype.getMap=function(){return this._mapContainer},i.prototype.getOverlay=function(){return this._overlay},e.exports=i}],n.c=o,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0);function n(e){if(o[e])return o[e].exports;var t=o[e]={i:e,l:!1,exports:{}};return a[e].call(t.exports,t,t.exports,n),t.l=!0,t.exports}var a,o},nDx.FlowEcharts=oDx(echarts,nDx.Geoworld);var FlowEcharts=tmp$a.FlowEcharts,oldValue;"undefined"!=typeof ko&&(oldValue=ko),function(O){var C=this||(0,eval)("this"),x=C.document,b=C.navigator,A=C.jQuery,S=C.JSON;A||"undefined"==typeof jQuery||(A=jQuery),function(e,r){function i(e,t){return(null===e||typeof e in l)&&e===t}function a(e,t){var i;return function(){i=i||I.a.setTimeout(function(){i=O,e()},t)}}function o(e,t){var i;return function(){clearTimeout(i),i=I.a.setTimeout(e,t)}}function u(e,t){t&&"change"!==t?"beforeChange"===t?this.pc(e):this.gb(e,t):this.qc(e)}function n(e,t){null!==t&&t.s&&t.s()}function s(e,t){var i=this.qd,r=i[p];r.ra||(this.Qb&&this.mb[t]?(i.uc(t,e,this.mb[t]),this.mb[t]=null,--this.Qb):r.I[t]||i.uc(t,e,r.J?{da:e}:i.$c(e)),e.Ja&&e.gd())}var I=void 0!==e?e:{};I.b=function(e,t){for(var i=e.split("."),r=I,n=0;n<i.length-1;n++)r=r[i[n]];r[i[i.length-1]]=t},I.L=function(e,t,i){e[t]=i},I.version="3.5.1",I.b("version",I.version),I.options={deferUpdates:!1,useOnlyNativeEvents:!1,foreachHidesDestroyed:!1},I.a=function(){function d(e,t){for(var i in e)a.call(e,i)&&t(i,e[i])}function e(e,t){if(t)for(var i in t)a.call(t,i)&&(e[i]=t[i]);return e}function t(e,t){return e.__proto__=t,e}function n(e,t,i,r){var n=e[t].match(h)||[];I.a.D(i.match(h),function(e){I.a.Na(n,e,r)}),e[t]=n.join(" ")}var a=Object.prototype.hasOwnProperty,i={__proto__:[]}instanceof Array,r="function"==typeof Symbol,o={},s={};o[b&&/Firefox\/2/i.test(b.userAgent)?"KeyboardEvent":"UIEvents"]=["keyup","keydown","keypress"],o.MouseEvents="click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" "),d(o,function(e,t){if(t.length)for(var i=0,r=t.length;i<r;i++)s[t[i]]=e});var l,u={propertychange:!0},c=x&&function(){for(var e=3,t=x.createElement("div"),i=t.getElementsByTagName("i");t.innerHTML="\x3c!--[if gt IE "+ ++e+"]><i></i><![endif]--\x3e",i[0];);return 4<e?e:O}(),h=/\S+/g;return{Jc:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],D:function(e,t,i){for(var r=0,n=e.length;r<n;r++)t.call(i,e[r],r,e)},A:"function"==typeof Array.prototype.indexOf?function(e,t){return Array.prototype.indexOf.call(e,t)}:function(e,t){for(var i=0,r=e.length;i<r;i++)if(e[i]===t)return i;return-1},Lb:function(e,t,i){for(var r=0,n=e.length;r<n;r++)if(t.call(i,e[r],r,e))return e[r];return O},Pa:function(e,t){var i=I.a.A(e,t);0<i?e.splice(i,1):0===i&&e.shift()},wc:function(e){var t=[];return e&&I.a.D(e,function(e){I.a.A(t,e)<0&&t.push(e)}),t},Mb:function(e,t,i){var r=[];if(e)for(var n=0,a=e.length;n<a;n++)r.push(t.call(i,e[n],n));return r},jb:function(e,t,i){var r=[];if(e)for(var n=0,a=e.length;n<a;n++)t.call(i,e[n],n)&&r.push(e[n]);return r},Nb:function(e,t){if(t instanceof Array)e.push.apply(e,t);else for(var i=0,r=t.length;i<r;i++)e.push(t[i]);return e},Na:function(e,t,i){var r=I.a.A(I.a.bc(e),t);r<0?i&&e.push(t):i||e.splice(r,1)},Ba:i,extend:e,setPrototypeOf:t,Ab:i?t:e,P:d,Ga:function(e,t,i){if(!e)return e;var r,n={};for(r in e)a.call(e,r)&&(n[r]=t.call(i,e[r],r,e));return n},Tb:function(e){for(;e.firstChild;)I.removeNode(e.firstChild)},Yb:function(e){for(var t=((e=I.a.la(e))[0]&&e[0].ownerDocument||x).createElement("div"),i=0,r=e.length;i<r;i++)t.appendChild(I.oa(e[i]));return t},Ca:function(e,t){for(var i=0,r=e.length,n=[];i<r;i++){var a=e[i].cloneNode(!0);n.push(t?I.oa(a):a)}return n},va:function(e,t){if(I.a.Tb(e),t)for(var i=0,r=t.length;i<r;i++)e.appendChild(t[i])},Xc:function(e,t){var i=e.nodeType?[e]:e;if(0<i.length){for(var r=i[0],n=r.parentNode,a=0,o=t.length;a<o;a++)n.insertBefore(t[a],r);for(a=0,o=i.length;a<o;a++)I.removeNode(i[a])}},Ua:function(e,t){if(e.length){for(t=8===t.nodeType&&t.parentNode||t;e.length&&e[0].parentNode!==t;)e.splice(0,1);for(;1<e.length&&e[e.length-1].parentNode!==t;)e.length--;if(1<e.length){var i=e[0],r=e[e.length-1];for(e.length=0;i!==r;)e.push(i),i=i.nextSibling;e.push(r)}}return e},Zc:function(e,t){c<7?e.setAttribute("selected",t):e.selected=t},Db:function(e){return null===e||e===O?"":e.trim?e.trim():e.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},Ud:function(e,t){return e=e||"",!(t.length>e.length)&&e.substring(0,t.length)===t},vd:function(e,t){if(e===t)return!0;if(11===e.nodeType)return!1;if(t.contains)return t.contains(1!==e.nodeType?e.parentNode:e);if(t.compareDocumentPosition)return 16==(16&t.compareDocumentPosition(e));for(;e&&e!=t;)e=e.parentNode;return!!e},Sb:function(e){return I.a.vd(e,e.ownerDocument.documentElement)},kd:function(e){return!!I.a.Lb(e,I.a.Sb)},R:function(e){return e&&e.tagName&&e.tagName.toLowerCase()},Ac:function(e){return I.onError?function(){try{return e.apply(this,arguments)}catch(e){throw I.onError&&I.onError(e),e}}:e},setTimeout:function(e,t){return setTimeout(I.a.Ac(e),t)},Gc:function(e){setTimeout(function(){throw I.onError&&I.onError(e),e},0)},B:function(t,e,i){var r=I.a.Ac(i);if(i=u[e],I.options.useOnlyNativeEvents||i||!A)if(i||"function"!=typeof t.addEventListener){if(void 0===t.attachEvent)throw Error("Browser doesn't support addEventListener or attachEvent");var n=function(e){r.call(t,e)},a="on"+e;t.attachEvent(a,n),I.a.K.za(t,function(){t.detachEvent(a,n)})}else t.addEventListener(e,r,!1);else l=l||("function"==typeof A(t).on?"on":"bind"),A(t)[l](e,r)},Fb:function(e,t){if(!e||!e.nodeType)throw Error("element must be a DOM node when calling triggerEvent");var i;if(i=!("input"!==I.a.R(e)||!e.type||"click"!=t.toLowerCase()||"checkbox"!=(i=e.type)&&"radio"!=i),I.options.useOnlyNativeEvents||!A||i)if("function"==typeof x.createEvent){if("function"!=typeof e.dispatchEvent)throw Error("The supplied element doesn't support dispatchEvent");(i=x.createEvent(s[t]||"HTMLEvents")).initEvent(t,!0,!0,C,0,0,0,0,0,!1,!1,!1,!1,0,e),e.dispatchEvent(i)}else if(i&&e.click)e.click();else{if(void 0===e.fireEvent)throw Error("Browser doesn't support triggering events");e.fireEvent("on"+t)}else A(e).trigger(t)},f:function(e){return I.O(e)?e():e},bc:function(e){return I.O(e)?e.v():e},Eb:function(t,e,i){var r;e&&("object"==typeof t.classList?(r=t.classList[i?"add":"remove"],I.a.D(e.match(h),function(e){r.call(t.classList,e)})):"string"==typeof t.className.baseVal?n(t.className,"baseVal",e,i):n(t,"className",e,i))},Bb:function(e,t){var i=I.a.f(t);null!==i&&i!==O||(i="");var r=I.h.firstChild(e);!r||3!=r.nodeType||I.h.nextSibling(r)?I.h.va(e,[e.ownerDocument.createTextNode(i)]):r.data=i,I.a.Ad(e)},Yc:function(e,t){if(e.name=t,c<=7)try{var i=e.name.replace(/[&<>'"]/g,function(e){return"&#"+e.charCodeAt(0)+";"});e.mergeAttributes(x.createElement("<input name='"+i+"'/>"),!1)}catch(e){}},Ad:function(e){9<=c&&(e=1==e.nodeType?e:e.parentNode).style&&(e.style.zoom=e.style.zoom)},wd:function(e){if(c){var t=e.style.width;e.style.width=0,e.style.width=t}},Pd:function(e,t){e=I.a.f(e),t=I.a.f(t);for(var i=[],r=e;r<=t;r++)i.push(r);return i},la:function(e){for(var t=[],i=0,r=e.length;i<r;i++)t.push(e[i]);return t},Da:function(e){return r?Symbol(e):e},Zd:6===c,$d:7===c,W:c,Lc:function(e,t){for(var i=I.a.la(e.getElementsByTagName("input")).concat(I.a.la(e.getElementsByTagName("textarea"))),r="string"==typeof t?function(e){return e.name===t}:function(e){return t.test(e.name)},n=[],a=i.length-1;0<=a;a--)r(i[a])&&n.push(i[a]);return n},Nd:function(e){return"string"==typeof e&&(e=I.a.Db(e))?S&&S.parse?S.parse(e):new Function("return "+e)():null},hc:function(e,t,i){if(!S||!S.stringify)throw Error("Cannot find JSON.stringify(). Some browsers (e.g., IE < 8) don't support it natively, but you can overcome this by adding a script reference to json2.js, downloadable from http://www.json.org/json2.js");return S.stringify(I.a.f(e),t,i)},Od:function(e,t,i){var r=(i=i||{}).params||{},n=i.includeFields||this.Jc,a=e;if("object"==typeof e&&"form"===I.a.R(e))for(var a=e.action,o=n.length-1;0<=o;o--)for(var s=I.a.Lc(e,n[o]),l=s.length-1;0<=l;l--)r[s[l].name]=s[l].value;t=I.a.f(t);var u=x.createElement("form");for(var c in u.style.display="none",u.action=a,u.method="post",t)(e=x.createElement("input")).type="hidden",e.name=c,e.value=I.a.hc(I.a.f(t[c])),u.appendChild(e);d(r,function(e,t){var i=x.createElement("input");i.type="hidden",i.name=e,i.value=t,u.appendChild(i)}),x.body.appendChild(u),i.submitter?i.submitter(u):u.submit(),setTimeout(function(){u.parentNode.removeChild(u)},0)}}}(),I.b("utils",I.a),I.b("utils.arrayForEach",I.a.D),I.b("utils.arrayFirst",I.a.Lb),I.b("utils.arrayFilter",I.a.jb),I.b("utils.arrayGetDistinctValues",I.a.wc),I.b("utils.arrayIndexOf",I.a.A),I.b("utils.arrayMap",I.a.Mb),I.b("utils.arrayPushAll",I.a.Nb),I.b("utils.arrayRemoveItem",I.a.Pa),I.b("utils.cloneNodes",I.a.Ca),I.b("utils.createSymbolOrString",I.a.Da),I.b("utils.extend",I.a.extend),I.b("utils.fieldsIncludedWithJsonPost",I.a.Jc),I.b("utils.getFormFields",I.a.Lc),I.b("utils.objectMap",I.a.Ga),I.b("utils.peekObservable",I.a.bc),I.b("utils.postJson",I.a.Od),I.b("utils.parseJson",I.a.Nd),I.b("utils.registerEventHandler",I.a.B),I.b("utils.stringifyJson",I.a.hc),I.b("utils.range",I.a.Pd),I.b("utils.toggleDomNodeCssClass",I.a.Eb),I.b("utils.triggerEvent",I.a.Fb),I.b("utils.unwrapObservable",I.a.f),I.b("utils.objectForEach",I.a.P),I.b("utils.addOrRemoveItem",I.a.Na),I.b("utils.setTextContent",I.a.Bb),I.b("unwrap",I.a.f),Function.prototype.bind||(Function.prototype.bind=function(t){var i=this;if(1===arguments.length)return function(){return i.apply(t,arguments)};var r=Array.prototype.slice.call(arguments,1);return function(){var e=r.slice(0);return e.push.apply(e,arguments),i.apply(t,e)}}),I.a.g=new function(){var r,n=0,a="__ko__"+(new Date).getTime(),o={};return{get:function(e,t){var i=r(e,!1);return i&&i[t]},set:function(e,t,i){(e=r(e,i!==O))&&(e[t]=i)},Ub:function(e,t,i){return(e=r(e,!0))[t]||(e[t]=i)},clear:I.a.W?(r=function(e,t){var i=e[a];if(!i||"null"===i||!o[i]){if(!t)return O;i=e[a]="ko"+n++,o[i]={}}return o[i]},function(e){var t=e[a];return!(!t||(delete o[t],e[a]=null))}):(r=function(e,t){var i=e[a];return!i&&t&&(i=e[a]={}),i},function(e){return!!e[a]&&(delete e[a],!0)}),Z:function(){return n+++a}}},I.b("utils.domData",I.a.g),I.b("utils.domData.clear",I.a.g.clear),I.a.K=new function(){function r(e,t){var i=I.a.g.get(e,o);return i===O&&t&&(i=[],I.a.g.set(e,o,i)),i}function a(e){var t=r(e,!1);if(t)for(var t=t.slice(0),i=0;i<t.length;i++)t[i](e);I.a.g.clear(e),I.a.K.cleanExternalData(e),s[e.nodeType]&&n(e.childNodes,!0)}function n(e,t){for(var i,r=[],n=0;n<e.length;n++)if((!t||8===e[n].nodeType)&&(a(r[r.length]=i=e[n]),e[n]!==i))for(;n--&&-1==I.a.A(r,e[n]););}var o=I.a.g.Z(),t={1:!0,8:!0,9:!0},s={1:!0,9:!0};return{za:function(e,t){if("function"!=typeof t)throw Error("Callback must be a function");r(e,!0).push(t)},yb:function(e,t){var i=r(e,!1);i&&(I.a.Pa(i,t),0==i.length&&I.a.g.set(e,o,O))},oa:function(e){return I.u.G(function(){t[e.nodeType]&&(a(e),s[e.nodeType]&&n(e.getElementsByTagName("*")))}),e},removeNode:function(e){I.oa(e),e.parentNode&&e.parentNode.removeChild(e)},cleanExternalData:function(e){A&&"function"==typeof A.cleanData&&A.cleanData([e])}}},I.oa=I.a.K.oa,I.removeNode=I.a.K.removeNode,I.b("cleanNode",I.oa),I.b("removeNode",I.removeNode),I.b("utils.domNodeDisposal",I.a.K),I.b("utils.domNodeDisposal.addDisposeCallback",I.a.K.za),I.b("utils.domNodeDisposal.removeDisposeCallback",I.a.K.yb),function(){var s=[0,"",""],e=[1,"<table>","</table>"],t=[3,"<table><tbody><tr>","</tr></tbody></table>"],i=[1,"<select multiple='multiple'>","</select>"],l={thead:e,tbody:e,tfoot:e,tr:[2,"<table><tbody>","</tbody></table>"],td:t,th:t,option:i,optgroup:i},u=I.a.W<=8;I.a.ua=function(e,t){var i;if(A){if(A.parseHTML)i=A.parseHTML(e,t)||[];else if((i=A.clean([e],t))&&i[0]){for(var r=i[0];r.parentNode&&11!==r.parentNode.nodeType;)r=r.parentNode;r.parentNode&&r.parentNode.removeChild(r)}}else{(i=t)||(i=x);var n,r=i.parentWindow||i.defaultView||C,a=I.a.Db(e).toLowerCase(),o=i.createElement("div");for(a=(n=(a=a.match(/^(?:\x3c!--.*?--\x3e\s*?)*?<([a-z]+)[\s>]/))&&l[a[1]]||s)[0],n="ignored<div>"+n[1]+e+n[2]+"</div>","function"==typeof r.innerShiv?o.appendChild(r.innerShiv(n)):(u&&i.body.appendChild(o),o.innerHTML=n,u&&o.parentNode.removeChild(o));a--;)o=o.lastChild;i=I.a.la(o.lastChild.childNodes)}return i},I.a.Md=function(e,t){var i=I.a.ua(e,t);return i.length&&i[0].parentElement||I.a.Yb(i)},I.a.fc=function(e,t){if(I.a.Tb(e),null!==(t=I.a.f(t))&&t!==O)if("string"!=typeof t&&(t=t.toString()),A)A(e).html(t);else for(var i=I.a.ua(t,e.ownerDocument),r=0;r<i.length;r++)e.appendChild(i[r])}}(),I.b("utils.parseHtmlFragment",I.a.ua),I.b("utils.setHtml",I.a.fc),I.aa=function(){var r={};return{Xb:function(e){if("function"!=typeof e)throw Error("You can only pass a function to ko.memoization.memoize()");var t=(4294967296*(1+Math.random())|0).toString(16).substring(1)+(4294967296*(1+Math.random())|0).toString(16).substring(1);return r[t]=e,"\x3c!--[ko_memo:"+t+"]--\x3e"},bd:function(e,t){var i=r[e];if(i===O)throw Error("Couldn't find any memo with ID "+e+". Perhaps it's already been unmemoized.");try{return i.apply(null,t||[]),!0}finally{delete r[e]}},cd:function(e,t){var i=[];!function e(t,i){if(t)if(8==t.nodeType){var r=I.aa.Uc(t.nodeValue);null!=r&&i.push({ud:t,Kd:r})}else if(1==t.nodeType)for(var r=0,n=t.childNodes,a=n.length;r<a;r++)e(n[r],i)}(e,i);for(var r=0,n=i.length;r<n;r++){var a=i[r].ud,o=[a];t&&I.a.Nb(o,t),I.aa.bd(i[r].Kd,o),a.nodeValue="",a.parentNode&&a.parentNode.removeChild(a)}},Uc:function(e){return(e=e.match(/^\[ko_memo\:(.*?)\]$/))?e[1]:null}}}(),I.b("memoization",I.aa),I.b("memoization.memoize",I.aa.Xb),I.b("memoization.unmemoize",I.aa.bd),I.b("memoization.parseMemoText",I.aa.Uc),I.b("memoization.unmemoizeDomNodeAndDescendants",I.aa.cd),I.na=function(){function e(){if(n)for(var e,t=n,i=0;a<n;)if(e=r[a++]){if(t<a){if(5e3<=++i){a=n,I.a.Gc(Error("'Too much recursion' after processing "+i+" task groups."));break}t=n}try{e()}catch(e){I.a.Gc(e)}}}function t(){e(),a=n=r.length=0}var r=[],n=0,i=1,a=0;return{scheduler:C.MutationObserver?function(e){var t=x.createElement("div");return new MutationObserver(e).observe(t,{attributes:!0}),function(){t.classList.toggle("foo")}}(t):x&&"onreadystatechange"in x.createElement("script")?function(e){var t=x.createElement("script");t.onreadystatechange=function(){t.onreadystatechange=null,x.documentElement.removeChild(t),t=null,e()},x.documentElement.appendChild(t)}:function(e){setTimeout(e,0)},zb:function(e){return n||I.na.scheduler(t),r[n++]=e,i++},cancel:function(e){a<=(e-=i-n)&&e<n&&(r[e]=null)},resetForTesting:function(){var e=n-a;return a=n=r.length=0,e},Sd:e}}(),I.b("tasks",I.na),I.b("tasks.schedule",I.na.zb),I.b("tasks.runEarly",I.na.Sd),I.Ta={throttle:function(t,i){t.throttleEvaluation=i;var r=null;return I.$({read:t,write:function(e){clearTimeout(r),r=I.a.setTimeout(function(){t(e)},i)}})},rateLimit:function(e,t){var i,r,n;"number"==typeof t?i=t:(i=t.timeout,r=t.method),e.Hb=!1,n="function"==typeof r?r:"notifyWhenChangesStop"==r?o:a,e.ub(function(e){return n(e,i,t)})},deferred:function(r,e){if(!0!==e)throw Error("The 'deferred' extender only accepts the value 'true', because it is not supported to turn deferral off once enabled.");r.Hb||(r.Hb=!0,r.ub(function(e){var t,i=!1;return function(){if(!i){I.na.cancel(t),t=I.na.zb(e);try{i=!0,r.notifySubscribers(O,"dirty")}finally{i=!1}}}}))},notify:function(e,t){e.equalityComparer="always"==t?null:i}};var l={undefined:1,boolean:1,number:1,string:1};I.b("extenders",I.Ta),I.ic=function(e,t,i){this.da=e,this.lc=t,this.mc=i,this.Ib=!1,this.fb=this.Jb=null,I.L(this,"dispose",this.s),I.L(this,"disposeWhenNodeIsRemoved",this.l)},I.ic.prototype.s=function(){this.Ib||(this.fb&&I.a.K.yb(this.Jb,this.fb),this.Ib=!0,this.mc(),this.da=this.lc=this.mc=this.Jb=this.fb=null)},I.ic.prototype.l=function(e){this.Jb=e,I.a.K.za(e,this.fb=this.s.bind(this))},I.T=function(){I.a.Ab(this,t),t.qb(this)};var t={qb:function(e){e.U={change:[]},e.sc=1},subscribe:function(e,t,i){var r=this;i=i||"change";var n=new I.ic(r,t?e.bind(t):e,function(){I.a.Pa(r.U[i],n),r.hb&&r.hb(i)});return r.Qa&&r.Qa(i),r.U[i]||(r.U[i]=[]),r.U[i].push(n),n},notifySubscribers:function(e,t){if("change"===(t=t||"change")&&this.Gb(),this.Wa(t)){var i="change"===t&&this.ed||this.U[t].slice(0);try{I.u.xc();for(var r,n=0;r=i[n];++n)r.Ib||r.lc(e)}finally{I.u.end()}}},ob:function(){return this.sc},Dd:function(e){return this.ob()!==e},Gb:function(){++this.sc},ub:function(e){var i,t,r,n,a,o=this,s=I.O(o);o.gb||(o.gb=o.notifySubscribers,o.notifySubscribers=u);var l=e(function(){o.Ja=!1,s&&n===o&&(n=o.nc?o.nc():o());var e=t||a&&o.sb(r,n);a=t=i=!1,e&&o.gb(r=n)});o.qc=function(e,t){t&&o.Ja||(a=!t),o.ed=o.U.change.slice(0),o.Ja=i=!0,n=e,l()},o.pc=function(e){i||(r=e,o.gb(e,"beforeChange"))},o.rc=function(){a=!0},o.gd=function(){o.sb(r,o.v(!0))&&(t=!0)}},Wa:function(e){return this.U[e]&&this.U[e].length},Bd:function(e){if(e)return this.U[e]&&this.U[e].length||0;var i=0;return I.a.P(this.U,function(e,t){"dirty"!==e&&(i+=t.length)}),i},sb:function(e,t){return!this.equalityComparer||!this.equalityComparer(e,t)},toString:function(){return"[object Object]"},extend:function(e){var r=this;return e&&I.a.P(e,function(e,t){var i=I.Ta[e];"function"==typeof i&&(r=i(r,t)||r)}),r}};I.L(t,"init",t.qb),I.L(t,"subscribe",t.subscribe),I.L(t,"extend",t.extend),I.L(t,"getSubscriptionsCount",t.Bd),I.a.Ba&&I.a.setPrototypeOf(t,Function.prototype),I.T.fn=t,I.Qc=function(e){return null!=e&&"function"==typeof e.subscribe&&"function"==typeof e.notifySubscribers},I.b("subscribable",I.T),I.b("isSubscribable",I.Qc),I.S=I.u=function(){function r(e){i.push(t),t=e}function n(){t=i.pop()}var t,i=[],a=0;return{xc:r,end:n,cc:function(e){if(t){if(!I.Qc(e))throw Error("Only subscribable things can act as dependencies");t.od.call(t.pd,e,e.fd||(e.fd=++a))}},G:function(e,t,i){try{return r(),e.apply(t,i||[])}finally{n()}},qa:function(){if(t)return t.o.qa()},Va:function(){if(t)return t.o.Va()},Ya:function(){if(t)return t.Ya},o:function(){if(t)return t.o}}}(),I.b("computedContext",I.S),I.b("computedContext.getDependenciesCount",I.S.qa),I.b("computedContext.getDependencies",I.S.Va),I.b("computedContext.isInitial",I.S.Ya),I.b("computedContext.registerDependency",I.S.cc),I.b("ignoreDependencies",I.Yd=I.u.G);var c=I.a.Da("_latestValue");I.ta=function(e){function t(){return 0<arguments.length?(t.sb(t[c],arguments[0])&&(t.ya(),t[c]=arguments[0],t.xa()),this):(I.u.cc(t),t[c])}return t[c]=e,I.a.Ba||I.a.extend(t,I.T.fn),I.T.fn.qb(t),I.a.Ab(t,d),I.options.deferUpdates&&I.Ta.deferred(t,!0),t};var d={equalityComparer:i,v:function(){return this[c]},xa:function(){this.notifySubscribers(this[c],"spectate"),this.notifySubscribers(this[c])},ya:function(){this.notifySubscribers(this[c],"beforeChange")}};I.a.Ba&&I.a.setPrototypeOf(d,I.T.fn);var h=I.ta.Ma="__ko_proto__";d[h]=I.ta,I.O=function(e){if((e="function"==typeof e&&e[h])&&e!==d[h]&&e!==I.o.fn[h])throw Error("Invalid object that looks like an observable; possibly from another Knockout instance");return!!e},I.Za=function(e){return"function"==typeof e&&(e[h]===d[h]||e[h]===I.o.fn[h]&&e.Nc)},I.b("observable",I.ta),I.b("isObservable",I.O),I.b("isWriteableObservable",I.Za),I.b("isWritableObservable",I.Za),I.b("observable.fn",d),I.L(d,"peek",d.v),I.L(d,"valueHasMutated",d.xa),I.L(d,"valueWillMutate",d.ya),I.Ha=function(e){if("object"!=typeof(e=e||[])||!("length"in e))throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");return e=I.ta(e),I.a.Ab(e,I.Ha.fn),e.extend({trackArrayChanges:!0})},I.Ha.fn={remove:function(t){for(var e=this.v(),i=[],r="function"!=typeof t||I.O(t)?function(e){return e===t}:t,n=0;n<e.length;n++){var a=e[n];if(r(a)){if(0===i.length&&this.ya(),e[n]!==a)throw Error("Array modified during remove; cannot remove item");i.push(a),e.splice(n,1),n--}}return i.length&&this.xa(),i},removeAll:function(t){if(t!==O)return t?this.remove(function(e){return 0<=I.a.A(t,e)}):[];var e=this.v(),i=e.slice(0);return this.ya(),e.splice(0,e.length),this.xa(),i},destroy:function(t){var e=this.v(),i="function"!=typeof t||I.O(t)?function(e){return e===t}:t;this.ya();for(var r=e.length-1;0<=r;r--){var n=e[r];i(n)&&(n._destroy=!0)}this.xa()},destroyAll:function(t){return t===O?this.destroy(function(){return!0}):t?this.destroy(function(e){return 0<=I.a.A(t,e)}):[]},indexOf:function(e){var t=this();return I.a.A(t,e)},replace:function(e,t){var i=this.indexOf(e);0<=i&&(this.ya(),this.v()[i]=t,this.xa())},sorted:function(e){var t=this().slice(0);return e?t.sort(e):t.sort()},reversed:function(){return this().slice(0).reverse()}},I.a.Ba&&I.a.setPrototypeOf(I.Ha.fn,I.ta.fn),I.a.D("pop push reverse shift sort splice unshift".split(" "),function(i){I.Ha.fn[i]=function(){var e=this.v();this.ya(),this.zc(e,i,arguments);var t=e[i].apply(e,arguments);return this.xa(),t===e?this:t}}),I.a.D(["slice"],function(t){I.Ha.fn[t]=function(){var e=this();return e[t].apply(e,arguments)}}),I.Pc=function(e){return I.O(e)&&"function"==typeof e.remove&&"function"==typeof e.push},I.b("observableArray",I.Ha),I.b("isObservableArray",I.Pc),I.Ta.trackArrayChanges=function(i,e){if(i.Ob={},e&&"object"==typeof e&&I.a.extend(i.Ob,e),i.Ob.sparse=!0,!i.zc){var t,r,n,d=!1,h=null,p=0,a=i.Qa,o=i.hb;i.Qa=function(e){a&&a.call(i,e),"arrayChange"===e&&function(){function e(){if(p){var e,t=[].concat(i.v()||[]);i.Wa("arrayChange")&&((!h||1<p)&&(h=I.a.Pb(n,t,i.Ob)),e=h),n=t,h=null,p=0,e&&e.length&&i.notifySubscribers(e,"arrayChange")}}d?e():(d=!0,r=i.subscribe(function(){++p},null,"spectate"),n=[].concat(i.v()||[]),h=null,t=i.subscribe(e))}()},i.hb=function(e){o&&o.call(i,e),"arrayChange"!==e||i.Wa("arrayChange")||(t&&t.s(),r&&r.s(),r=t=null,d=!1,n=O)},i.zc=function(e,t,i){function r(e,t,i){return n[n.length]={status:e,value:t,index:i}}if(d&&!p){var n=[],a=e.length,o=i.length,s=0;switch(t){case"push":s=a;case"unshift":for(t=0;t<o;t++)r("added",i[t],s+t);break;case"pop":s=a-1;case"shift":a&&r("deleted",e[s],s);break;case"splice":t=Math.min(Math.max(0,i[0]<0?a+i[0]:i[0]),a);for(var a=1===o?a:Math.min(t+(i[1]||0),a),o=t+o-2,s=Math.max(a,o),l=[],u=[],c=2;t<s;++t,++c)t<a&&u.push(r("deleted",e[t],t)),t<o&&l.push(r("added",i[c],t));I.a.Kc(u,l);break;default:return}h=n}}}};var p=I.a.Da("_state");I.o=I.$=function(e,t,i){function r(){if(0<arguments.length){if("function"!=typeof n)throw Error("Cannot write a value to a ko.computed unless you specify a 'write' option. If you wish to read the current value, don't pass any parameters.");return n.apply(a.nb,arguments),this}return a.ra||I.u.cc(r),(a.ka||a.J&&r.Xa())&&r.ha(),a.X}if("object"==typeof e?i=e:(i=i||{},e&&(i.read=e)),"function"!=typeof i.read)throw Error("Pass a function that returns the value of the ko.computed");var n=i.write,a={X:O,sa:!0,ka:!0,rb:!1,jc:!1,ra:!1,wb:!1,J:!1,Wc:i.read,nb:t||i.owner,l:i.disposeWhenNodeIsRemoved||i.l||null,Sa:i.disposeWhen||i.Sa,Rb:null,I:{},V:0,Ic:null};return r[p]=a,r.Nc="function"==typeof n,I.a.Ba||I.a.extend(r,I.T.fn),I.T.fn.qb(r),I.a.Ab(r,f),i.pure?(a.wb=!0,a.J=!0,I.a.extend(r,m)):i.deferEvaluation&&I.a.extend(r,g),I.options.deferUpdates&&I.Ta.deferred(r,!0),a.l&&(a.jc=!0,a.l.nodeType||(a.l=null)),a.J||i.deferEvaluation||r.ha(),a.l&&r.ja()&&I.a.K.za(a.l,a.Rb=function(){r.s()}),r};var f={equalityComparer:i,qa:function(){return this[p].V},Va:function(){var i=[];return I.a.P(this[p].I,function(e,t){i[t.Ka]=t.da}),i},Vb:function(t){if(!this[p].V)return!1;var e=this.Va();return-1!==I.a.A(e,t)||!!I.a.Lb(e,function(e){return e.Vb&&e.Vb(t)})},uc:function(e,t,i){if(this[p].wb&&t===this)throw Error("A 'pure' computed must not be called recursively");(this[p].I[e]=i).Ka=this[p].V++,i.La=t.ob()},Xa:function(){var e,t,i=this[p].I;for(e in i)if(Object.prototype.hasOwnProperty.call(i,e)&&(t=i[e],this.Ia&&t.da.Ja||t.da.Dd(t.La)))return!0},Jd:function(){this.Ia&&!this[p].rb&&this.Ia(!1)},ja:function(){var e=this[p];return e.ka||0<e.V},Rd:function(){this.Ja?this[p].ka&&(this[p].sa=!0):this.Hc()},$c:function(e){if(e.Hb){var t=e.subscribe(this.Jd,this,"dirty"),i=e.subscribe(this.Rd,this);return{da:e,s:function(){t.s(),i.s()}}}return e.subscribe(this.Hc,this)},Hc:function(){var e=this,t=e.throttleEvaluation;t&&0<=t?(clearTimeout(this[p].Ic),this[p].Ic=I.a.setTimeout(function(){e.ha(!0)},t)):e.Ia?e.Ia(!0):e.ha(!0)},ha:function(e){var t=this[p],i=t.Sa,r=!1;if(!t.rb&&!t.ra){if(t.l&&!I.a.Sb(t.l)||i&&i()){if(!t.jc)return void this.s()}else t.jc=!1;t.rb=!0;try{r=this.zd(e)}finally{t.rb=!1}return r}},zd:function(e){var t=this[p],i=!1,r=t.wb?O:!t.V,i={qd:this,mb:t.I,Qb:t.V};I.u.xc({pd:i,od:s,o:this,Ya:r}),t.I={},t.V=0;var n=this.yd(t,i);return(i=t.V?this.sb(t.X,n):(this.s(),!0))&&(t.J?this.Gb():this.notifySubscribers(t.X,"beforeChange"),t.X=n,this.notifySubscribers(t.X,"spectate"),!t.J&&e&&this.notifySubscribers(t.X),this.rc&&this.rc()),r&&this.notifySubscribers(t.X,"awake"),i},yd:function(e,t){try{var i=e.Wc;return e.nb?i.call(e.nb):i()}finally{I.u.end(),t.Qb&&!e.J&&I.a.P(t.mb,n),e.sa=e.ka=!1}},v:function(e){var t=this[p];return(t.ka&&(e||!t.V)||t.J&&this.Xa())&&this.ha(),t.X},ub:function(e){I.T.fn.ub.call(this,e),this.nc=function(){return this[p].J||(this[p].sa?this.ha():this[p].ka=!1),this[p].X},this.Ia=function(e){this.pc(this[p].X),this[p].ka=!0,e&&(this[p].sa=!0),this.qc(this,!e)}},s:function(){var e=this[p];!e.J&&e.I&&I.a.P(e.I,function(e,t){t.s&&t.s()}),e.l&&e.Rb&&I.a.K.yb(e.l,e.Rb),e.I=O,e.V=0,e.ra=!0,e.sa=!1,e.ka=!1,e.J=!1,e.l=O,e.Sa=O,e.Wc=O,this.Nc||(e.nb=O)}},m={Qa:function(e){var n=this,a=n[p];if(!a.ra&&a.J&&"change"==e){if(a.J=!1,a.sa||n.Xa())a.I=null,a.V=0,n.ha()&&n.Gb();else{var i=[];I.a.P(a.I,function(e,t){i[t.Ka]=e}),I.a.D(i,function(e,t){var i=a.I[e],r=n.$c(i.da);r.Ka=t,r.La=i.La,a.I[e]=r}),n.Xa()&&n.ha()&&n.Gb()}a.ra||n.notifySubscribers(a.X,"awake")}},hb:function(e){var i=this[p];i.ra||"change"!=e||this.Wa("change")||(I.a.P(i.I,function(e,t){t.s&&(i.I[e]={da:t.da,Ka:t.Ka,La:t.La},t.s())}),i.J=!0,this.notifySubscribers(O,"asleep"))},ob:function(){var e=this[p];return e.J&&(e.sa||this.Xa())&&this.ha(),I.T.fn.ob.call(this)}},g={Qa:function(e){"change"!=e&&"beforeChange"!=e||this.v()}};I.a.Ba&&I.a.setPrototypeOf(f,I.T.fn);var y=I.ta.Ma;f[y]=I.o,I.Oc=function(e){return"function"==typeof e&&e[y]===f[y]},I.Fd=function(e){return I.Oc(e)&&e[p]&&e[p].wb},I.b("computed",I.o),I.b("dependentObservable",I.o),I.b("isComputed",I.Oc),I.b("isPureComputed",I.Fd),I.b("computed.fn",f),I.L(f,"peek",f.v),I.L(f,"dispose",f.s),I.L(f,"isActive",f.ja),I.L(f,"getDependenciesCount",f.qa),I.L(f,"getDependencies",f.Va),I.xb=function(e,t){return"function"==typeof e?I.o(e,t,{pure:!0}):((e=I.a.extend({},e)).pure=!0,I.o(e,t))},I.b("pureComputed",I.xb),function(){function s(r,n,a){if(a=a||new e,"object"!=typeof(r=n(r))||null===r||r===O||r instanceof RegExp||r instanceof Date||r instanceof String||r instanceof Number||r instanceof Boolean)return r;var o=r instanceof Array?[]:{};return a.save(r,o),function(e,t){if(e instanceof Array){for(var i=0;i<e.length;i++)t(i);"function"==typeof e.toJSON&&t("toJSON")}else for(i in e)t(i)}(r,function(e){var t=n(r[e]);switch(typeof t){case"boolean":case"number":case"string":case"function":o[e]=t;break;case"object":case"undefined":var i=a.get(t);o[e]=i!==O?i:s(t,n,a)}}),o}function e(){this.keys=[],this.values=[]}I.ad=function(e){if(0==arguments.length)throw Error("When calling ko.toJS, pass the object you want to convert.");return s(e,function(e){for(var t=0;I.O(e)&&t<10;t++)e=e();return e})},I.toJSON=function(e,t,i){return e=I.ad(e),I.a.hc(e,t,i)},e.prototype={constructor:e,save:function(e,t){var i=I.a.A(this.keys,e);0<=i?this.values[i]=t:(this.keys.push(e),this.values.push(t))},get:function(e){return 0<=(e=I.a.A(this.keys,e))?this.values[e]:O}}}(),I.b("toJS",I.ad),I.b("toJSON",I.toJSON),I.Wd=function(r,e,n){function t(t){var e=I.xb(r,n).extend({ma:"always"}),i=e.subscribe(function(e){e&&(i.s(),t(e))});return e.notifySubscribers(e.v()),i}return"function"!=typeof Promise||e?t(e.bind(n)):new Promise(t)},I.b("when",I.Wd),I.w={M:function(e){switch(I.a.R(e)){case"option":return!0===e.__ko__hasDomDataOptionValue__?I.a.g.get(e,I.c.options.$b):I.a.W<=7?e.getAttributeNode("value")&&e.getAttributeNode("value").specified?e.value:e.text:e.value;case"select":return 0<=e.selectedIndex?I.w.M(e.options[e.selectedIndex]):O;default:return e.value}},cb:function(e,t,i){switch(I.a.R(e)){case"option":"string"==typeof t?(I.a.g.set(e,I.c.options.$b,O),"__ko__hasDomDataOptionValue__"in e&&delete e.__ko__hasDomDataOptionValue__,e.value=t):(I.a.g.set(e,I.c.options.$b,t),e.__ko__hasDomDataOptionValue__=!0,e.value="number"==typeof t?t:"");break;case"select":""!==t&&null!==t||(t=O);for(var r,n=-1,a=0,o=e.options.length;a<o;++a)if((r=I.w.M(e.options[a]))==t||""===r&&t===O){n=a;break}(i||0<=n||t===O&&1<e.size)&&(e.selectedIndex=n,6===I.a.W&&I.a.setTimeout(function(){e.selectedIndex=n},0));break;default:null!==t&&t!==O||(t=""),e.value=t}}},I.b("selectExtensions",I.w),I.b("selectExtensions.readValue",I.w.M),I.b("selectExtensions.writeValue",I.w.cb),I.m=function(){function r(e){123===(e=I.a.Db(e)).charCodeAt(0)&&(e=e.slice(1,-1));var t,i=[],r=(e+="\n,").match(d),n=[],a=0;if(1<r.length){for(var o,s=0;o=r[s];++s){var l=o.charCodeAt(0);if(44===l){if(a<=0){i.push(t&&n.length?{key:t,value:n.join("")}:{unknown:t||n.join("")}),t=a=0,n=[];continue}}else if(58===l){if(!a&&!t&&1===n.length){t=n.pop();continue}}else{if(47===l&&1<o.length&&(47===o.charCodeAt(1)||42===o.charCodeAt(1)))continue;47===l&&s&&1<o.length?(l=r[s-1].match(h))&&!p[l[0]]&&(e=e.substr(e.indexOf(o)+1),r=e.match(d),s=-1,o="/"):40===l||123===l||91===l?++a:41===l||125===l||93===l?--a:t||n.length||34!==l&&39!==l||(o=o.slice(1,-1))}n.push(o)}if(0<a)throw Error("Unbalanced parentheses, braces, or brackets")}return i}var u=["true","false","null","undefined"],c=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i,d=RegExp("\"(?:\\\\.|[^\"])*\"|'(?:\\\\.|[^'])*'|`(?:\\\\.|[^`])*`|/\\*(?:[^*]|\\*+[^*/])*\\*+/|//.*\n|/(?:\\\\.|[^/])+/w*|[^\\s:,/][^,\"'`{}()/:[\\]]*[^\\s,\"'`{}()/:[\\]]|[^\\s]","g"),h=/[\])"'A-Za-z0-9_$]+$/,p={in:1,return:1,typeof:1},f={};return{Ra:[],wa:f,ac:r,vb:function(e,t){function n(e,t){var i;if(!l){var r=I.getBindingHandler(e);if(r&&r.preprocess&&!(t=r.preprocess(t,e,n)))return;(r=f[e])&&(i=t,r=i=!(0<=I.a.A(u,i))&&null!==(r=i.match(c))&&(r[1]?"Object("+r[1]+")"+r[2]:i)),r&&o.push("'"+("string"==typeof f[e]?f[e]:e)+"':function(_z){"+i+"=_z}")}s&&(t="function(){return "+t+" }"),a.push("'"+e+"':"+t)}var a=[],o=[],s=(t=t||{}).valueAccessors,l=t.bindingParams,i="string"==typeof e?r(e):e;return I.a.D(i,function(e){n(e.key||e.unknown,e.value)}),o.length&&n("_ko_property_writers","{"+o.join(",")+" }"),a.join(",")},Id:function(e,t){for(var i=0;i<e.length;i++)if(e[i].key==t)return!0;return!1},eb:function(e,t,i,r,n){e&&I.O(e)?!I.Za(e)||n&&e.v()===r||e(r):(e=t.get("_ko_property_writers"))&&e[i]&&e[i](r)}}}(),I.b("expressionRewriting",I.m),I.b("expressionRewriting.bindingRewriteValidators",I.m.Ra),I.b("expressionRewriting.parseObjectLiteral",I.m.ac),I.b("expressionRewriting.preProcessBindings",I.m.vb),I.b("expressionRewriting._twoWayBindings",I.m.wa),I.b("jsonExpressionRewriting",I.m),I.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",I.m.vb),function(){function a(e){return 8==e.nodeType&&i.test(t?e.text:e.nodeValue)}function o(e){return 8==e.nodeType&&n.test(t?e.text:e.nodeValue)}function r(e,t){for(var i=e,r=1,n=[];i=i.nextSibling;){if(o(i)&&(I.a.g.set(i,u,!0),0==--r))return n;n.push(i),a(i)&&r++}if(!t)throw Error("Cannot find closing comment tag to match: "+e.nodeValue);return null}function s(e,t){var i=r(e,t);return i?0<i.length?i[i.length-1].nextSibling:e.nextSibling:null}var t=x&&"\x3c!--test--\x3e"===x.createComment("test").text,i=t?/^\x3c!--\s*ko(?:\s+([\s\S]+))?\s*--\x3e$/:/^\s*ko(?:\s+([\s\S]+))?\s*$/,n=t?/^\x3c!--\s*\/ko\s*--\x3e$/:/^\s*\/ko\s*$/,l={ul:!0,ol:!0},u="__ko_matchedEndComment__";I.h={ea:{},childNodes:function(e){return a(e)?r(e):e.childNodes},Ea:function(e){if(a(e)){e=I.h.childNodes(e);for(var t=0,i=e.length;t<i;t++)I.removeNode(e[t])}else I.a.Tb(e)},va:function(e,t){if(a(e)){I.h.Ea(e);for(var i=e.nextSibling,r=0,n=t.length;r<n;r++)i.parentNode.insertBefore(t[r],i)}else I.a.va(e,t)},Vc:function(e,t){var i;a(e)?(i=e.nextSibling,e=e.parentNode):i=e.firstChild,i?t!==i&&e.insertBefore(t,i):e.appendChild(t)},Wb:function(e,t,i){i?(i=i.nextSibling,a(e)&&(e=e.parentNode),i?t!==i&&e.insertBefore(t,i):e.appendChild(t)):I.h.Vc(e,t)},firstChild:function(e){if(a(e))return!e.nextSibling||o(e.nextSibling)?null:e.nextSibling;if(e.firstChild&&o(e.firstChild))throw Error("Found invalid end comment, as the first child of "+e);return e.firstChild},nextSibling:function(e){if(a(e)&&(e=s(e)),e.nextSibling&&o(e.nextSibling)){var t=e.nextSibling;if(o(t)&&!I.a.g.get(t,u))throw Error("Found end comment without a matching opening comment, as child of "+e);return null}return e.nextSibling},Cd:a,Vd:function(e){return(e=(t?e.text:e.nodeValue).match(i))?e[1]:null},Sc:function(e){if(l[I.a.R(e)]){var t=e.firstChild;if(t)do{if(1===t.nodeType){var i;i=t.firstChild;var r=null;if(i)do{if(r)r.push(i);else if(a(i)){var n=s(i,!0);n?i=n:r=[i]}else o(i)&&(r=[i])}while(i=i.nextSibling);if(i=r)for(r=t.nextSibling,n=0;n<i.length;n++)r?e.insertBefore(i[n],r):e.appendChild(i[n])}}while(t=t.nextSibling)}}}}(),I.b("virtualElements",I.h),I.b("virtualElements.allowedBindings",I.h.ea),I.b("virtualElements.emptyNode",I.h.Ea),I.b("virtualElements.insertAfter",I.h.Wb),I.b("virtualElements.prepend",I.h.Vc),I.b("virtualElements.setDomNodeChildren",I.h.va),I.ga=function(){this.nd={}},I.a.extend(I.ga.prototype,{nodeHasBindings:function(e){switch(e.nodeType){case 1:return null!=e.getAttribute("data-bind")||I.j.getComponentNameForNode(e);case 8:return I.h.Cd(e);default:return!1}},getBindings:function(e,t){var i=this.getBindingsString(e,t),i=i?this.parseBindingsString(i,t,e):null;return I.j.tc(i,e,t,!1)},getBindingAccessors:function(e,t){var i=this.getBindingsString(e,t),i=i?this.parseBindingsString(i,t,e,{valueAccessors:!0}):null;return I.j.tc(i,e,t,!0)},getBindingsString:function(e){switch(e.nodeType){case 1:return e.getAttribute("data-bind");case 8:return I.h.Vd(e);default:return null}},parseBindingsString:function(t,e,i,r){try{var n,a=this.nd,o=t+(r&&r.valueAccessors||"");if(!(n=a[o])){var s,l="with($context){with($data||{}){return{"+I.m.vb(t,r)+"}}}";s=new Function("$context","$element",l),n=a[o]=s}return n(e,i)}catch(e){throw e.message="Unable to parse bindings.\nBindings value: "+t+"\nMessage: "+e.message,e}}}),I.ga.instance=new I.ga,I.b("bindingProvider",I.ga),function(){function r(e){var t=(e=I.a.g.get(e,v))&&e.N;t&&(e.N=null,t.Tc())}function n(e,t,i){this.node=e,this.yc=t,this.kb=[],this.H=!1,t.N||I.a.K.za(e,r),i&&i.N&&(i.N.kb.push(e),this.Kb=i)}function a(e){return function(){return e}}function p(e){return e()}function o(i){return I.a.Ga(I.u.G(i),function(e,t){return function(){return i()[t]}})}function f(e,t){return o(this.getBindings.bind(this,e,t))}function s(e,t){var i=I.h.firstChild(t);if(i){var r,n=I.ga.instance,a=n.preprocessNode;if(a){for(;r=i;)i=I.h.nextSibling(r),a.call(n,r);i=I.h.firstChild(t)}for(;r=i;)i=I.h.nextSibling(r),l(e,r)}I.i.ma(t,I.i.H)}function l(e,t){var i=e,r=1===t.nodeType;r&&I.h.Sc(t),(r||I.ga.instance.nodeHasBindings(t))&&(i=u(t,null,e).bindingContextForDescendants),i&&!d[I.a.R(t)]&&s(i,t)}function u(n,e,t){var a,i=I.a.g.Ub(n,v,{}),r=i.hd;if(!e){if(r)throw Error("You cannot apply bindings multiple times to the same element.");i.hd=!0}if(r||(i.context=t),i.Zb||(i.Zb={}),e&&"function"!=typeof e)a=e;else{var o=I.ga.instance,s=o.getBindingAccessors||f,l=I.$(function(){return(a=e?e(t,n):s.call(o,n,t))&&(t[m]&&t[m](),t[g]&&t[g]()),a},null,{l:n});a&&l.ja()||(l=null)}var u,c=t;if(a){var d=function(){return I.a.Ga(l?l():a,p)},h=l?function(e){return function(){return p(l()[e])}}:function(e){return a[e]};d.get=function(e){return a[e]&&p(h(e))},d.has=function(e){return e in a},I.i.H in a&&I.i.subscribe(n,I.i.H,function(){var e=(0,a[I.i.H])();if(e){var t=I.h.childNodes(n);t.length&&e(t,I.Ec(t[0]))}}),I.i.pa in a&&(c=I.i.Cb(n,t),I.i.subscribe(n,I.i.pa,function(){var e=(0,a[I.i.pa])();e&&I.h.firstChild(n)&&e(n)})),i=function(r){var n=[],a={},o=[];return I.a.P(r,function t(e){if(!a[e]){var i=I.getBindingHandler(e);i&&(i.after&&(o.push(e),I.a.D(i.after,function(e){if(r[e]){if(-1!==I.a.A(o,e))throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+o.join(", "));t(e)}}),o.length--),n.push({key:e,Mc:i})),a[e]=!0}}),n}(a),I.a.D(i,function(e){var t=e.Mc.init,i=e.Mc.update,r=e.key;if(8===n.nodeType&&!I.h.ea[r])throw Error("The binding '"+r+"' cannot be used with virtual elements");try{"function"==typeof t&&I.u.G(function(){var e=t(n,h(r),d,c.$data,c);if(e&&e.controlsDescendantBindings){if(u!==O)throw Error("Multiple bindings ("+u+" and "+r+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");u=r}}),"function"==typeof i&&I.$(function(){i(n,h(r),d,c.$data,c)},null,{l:n})}catch(e){throw e.message='Unable to process binding "'+r+": "+a[r]+'"\nMessage: '+e.message,e}})}return{shouldBindDescendants:i=u===O,bindingContextForDescendants:i&&c}}function c(e,t){return e&&e instanceof I.fa?e:new I.fa(e,O,O,t)}var m=I.a.Da("_subscribable"),h=I.a.Da("_ancestorBindingInfo"),g=I.a.Da("_dataDependency");I.c={};var d={script:!0,textarea:!0,template:!0};I.getBindingHandler=function(e){return I.c[e]};var y={};I.fa=function(e,i,r,n,t){function a(){var e=c?u():u,t=I.a.f(e);return i?(I.a.extend(s,i),h in i&&(s[h]=i[h])):(s.$parents=[],s.$root=t,s.ko=I),s[m]=o,l?t=s.$data:(s.$rawData=e,s.$data=t),r&&(s[r]=t),n&&n(s,i,t),i&&i[m]&&!I.S.o().Vb(i[m])&&i[m](),d&&(s[g]=d),s.$data}var o,s=this,l=e===y,u=l?O:e,c="function"==typeof u&&!I.O(u),d=t&&t.dataDependency;t&&t.exportDependencies?a():((o=I.xb(a)).v(),o.ja()?o.equalityComparer=null:s[m]=O)},I.fa.prototype.createChildContext=function(t,i,r,e){if(!e&&i&&"object"==typeof i&&(i=(e=i).as,r=e.extend),i&&e&&e.noChildContext){var n="function"==typeof t&&!I.O(t);return new I.fa(y,this,null,function(e){r&&r(e),e[i]=n?t():t},e)}return new I.fa(t,this,i,function(e,t){e.$parentContext=t,e.$parent=t.$data,e.$parents=(t.$parents||[]).slice(0),e.$parents.unshift(e.$parent),r&&r(e)},e)},I.fa.prototype.extend=function(t,e){return new I.fa(y,this,null,function(e){I.a.extend(e,"function"==typeof t?t(e):t)},e)};var v=I.a.g.Z();n.prototype.Tc=function(){this.Kb&&this.Kb.N&&this.Kb.N.sd(this.node)},n.prototype.sd=function(e){I.a.Pa(this.kb,e),!this.kb.length&&this.H&&this.Cc()},n.prototype.Cc=function(){this.H=!0,this.yc.N&&!this.kb.length&&(this.yc.N=null,I.a.K.yb(this.node,r),I.i.ma(this.node,I.i.pa),this.Tc())},I.i={H:"childrenComplete",pa:"descendantsComplete",subscribe:function(e,t,i,r,n){var a=I.a.g.Ub(e,v,{});return a.Fa||(a.Fa=new I.T),n&&n.notifyImmediately&&a.Zb[t]&&I.u.G(i,r,[e]),a.Fa.subscribe(i,r,t)},ma:function(e,t){var i=I.a.g.get(e,v);if(i&&(i.Zb[t]=!0,i.Fa&&i.Fa.notifySubscribers(e,t),t==I.i.H))if(i.N)i.N.Cc();else if(i.N===O&&i.Fa&&i.Fa.Wa(I.i.pa))throw Error("descendantsComplete event not supported for bindings on this node")},Cb:function(e,t){var i=I.a.g.Ub(e,v,{});return i.N||(i.N=new n(e,i,t[h])),t[h]==i?t:t.extend(function(e){e[h]=i})}},I.Td=function(e){return(e=I.a.g.get(e,v))&&e.context},I.ib=function(e,t,i){return 1===e.nodeType&&I.h.Sc(e),u(e,t,c(i))},I.ld=function(e,t,i){return i=c(i),I.ib(e,function(e,t,i){return"function"==typeof e?o(e.bind(null,t,i)):I.a.Ga(e,a)}(t,i,e),i)},I.Oa=function(e,t){1!==t.nodeType&&8!==t.nodeType||s(c(e),t)},I.vc=function(e,t,i){if(!A&&C.jQuery&&(A=C.jQuery),arguments.length<2){if(!(t=x.body))throw Error("ko.applyBindings: could not find document.body; has the document been loaded?")}else if(!t||1!==t.nodeType&&8!==t.nodeType)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");l(c(e,i),t)},I.Dc=function(e){return!e||1!==e.nodeType&&8!==e.nodeType?O:I.Td(e)},I.Ec=function(e){return(e=I.Dc(e))?e.$data:O},I.b("bindingHandlers",I.c),I.b("bindingEvent",I.i),I.b("bindingEvent.subscribe",I.i.subscribe),I.b("bindingEvent.startPossiblyAsyncContentBinding",I.i.Cb),I.b("applyBindings",I.vc),I.b("applyBindingsToDescendants",I.Oa),I.b("applyBindingAccessorsToNode",I.ib),I.b("applyBindingsToNode",I.ld),I.b("contextFor",I.Dc),I.b("dataFor",I.Ec)}(),function(s){function r(r,e){var n,a=Object.prototype.hasOwnProperty.call(o,r)?o[r]:s;a?a.subscribe(e):((a=o[r]=new I.T).subscribe(e),function(e,i){l("getConfig",[e],function(t){t?l("loadComponent",[e,t],function(e){i(e,t)}):i(null,null)})}(r,function(e,t){var i=!(!t||!t.synchronous);u[r]={definition:e,Gd:i},delete o[r],n||i?a.notifySubscribers(e):I.na.zb(function(){a.notifySubscribers(e)})}),n=!0)}function l(t,i,r,n){var e=(n=n||I.j.loaders.slice(0)).shift();if(e){var a=e[t];if(a){var o=!1;if(a.apply(e,i.concat(function(e){o?r(null):null!==e?r(e):l(t,i,r,n)}))!==s&&(o=!0,!e.suppressLoaderExceptions))throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.")}else l(t,i,r,n)}else r(null)}var o={},u={};I.j={get:function(e,t){var i=Object.prototype.hasOwnProperty.call(u,e)?u[e]:s;i?i.Gd?I.u.G(function(){t(i.definition)}):I.na.zb(function(){t(i.definition)}):r(e,t)},Bc:function(e){delete u[e]},oc:l},I.j.loaders=[],I.b("components",I.j),I.b("components.get",I.j.get),I.b("components.clearCachedDefinition",I.j.Bc)}(),function(){function n(e){switch(I.a.R(e)){case"script":return I.a.ua(e.text);case"textarea":return I.a.ua(e.value);case"template":if(a(e.content))return I.a.Ca(e.content.childNodes)}return I.a.Ca(e.childNodes)}function a(e){return C.DocumentFragment?e instanceof DocumentFragment:e&&11===e.nodeType}function l(e,t,i){"string"==typeof t.require?r||C.require?(r||C.require)([t.require],function(e){e&&"object"==typeof e&&e.Xd&&e.default&&(e=e.default),i(e)}):e("Uses require, but no AMD loader is present"):i(t)}function o(t){return function(e){throw Error("Component '"+t+"': "+e)}}var i={};I.j.register=function(e,t){if(!t)throw Error("Invalid configuration for "+e);if(I.j.tb(e))throw Error("Component "+e+" is already registered");i[e]=t},I.j.tb=function(e){return Object.prototype.hasOwnProperty.call(i,e)},I.j.unregister=function(e){delete i[e],I.j.Bc(e)},I.j.Fc={getConfig:function(e,t){t(I.j.tb(e)?i[e]:null)},loadComponent:function(t,e,i){var r=o(t);l(r,e,function(e){!function(t,e,i,r){function n(){0==--o&&r(a)}var a={},o=2,s=i.template;i=i.viewModel,s?l(e,s,function(e){I.j.oc("loadTemplate",[t,e],function(e){a.template=e,n()})}):n(),i?l(e,i,function(e){I.j.oc("loadViewModel",[t,e],function(e){a[u]=e,n()})}):n()}(t,r,e,i)})},loadTemplate:function(e,t,i){if(e=o(e),"string"==typeof t)i(I.a.ua(t));else if(t instanceof Array)i(t);else if(a(t))i(I.a.la(t.childNodes));else if(t.element)if(t=t.element,C.HTMLElement?t instanceof HTMLElement:t&&t.tagName&&1===t.nodeType)i(n(t));else if("string"==typeof t){var r=x.getElementById(t);r?i(n(r)):e("Cannot find element with ID "+t)}else e("Unknown element type: "+t);else e("Unknown template value: "+t)},loadViewModel:function(e,t,i){!function e(t,i,r){if("function"==typeof i)r(function(e){return new i(e)});else if("function"==typeof i[u])r(i[u]);else if("instance"in i){var n=i.instance;r(function(){return n})}else"viewModel"in i?e(t,i.viewModel,r):t("Unknown viewModel value: "+i)}(o(e),t,i)}};var u="createViewModel";I.b("components.register",I.j.register),I.b("components.isRegistered",I.j.tb),I.b("components.unregister",I.j.unregister),I.b("components.defaultLoader",I.j.Fc),I.j.loaders.push(I.j.Fc),I.j.dd=i}(),function(){I.j.getComponentNameForNode=function(e){var t=I.a.R(e);if(I.j.tb(t)&&(-1!=t.indexOf("-")||"[object HTMLUnknownElement]"==""+e||I.a.W<=8&&e.tagName===t))return t},I.j.tc=function(e,t,i,r){if(1===t.nodeType){var n=I.j.getComponentNameForNode(t);if(n){if((e=e||{}).component)throw Error('Cannot use the "component" binding on a custom element matching a component');var a={name:n,params:function(i,e){if(t=i.getAttribute("params")){var t=o.parseBindingsString(t,e,i,{valueAccessors:!0,bindingParams:!0}),r=(t=I.a.Ga(t,function(e){return I.o(e,null,{l:i})}),I.a.Ga(t,function(t){var e=t.v();return t.ja()?I.o({read:function(){return I.a.f(t())},write:I.Za(e)&&function(e){t()(e)},l:i}):e}));return Object.prototype.hasOwnProperty.call(r,"$raw")||(r.$raw=t),r}return{$raw:{}}}(t,i)};e.component=r?function(){return a}:a}}return e};var o=new I.ga;I.a.W<9&&(I.j.register=function(t){return function(e){return t.apply(this,arguments)}}(I.j.register),x.createDocumentFragment=function(t){return function(){var e=t();return I.j.dd,e}}(x.createDocumentFragment))}(),function(){var p=0;I.c.component={init:function(o,t,e,i,s){function l(){var e=u&&u.dispose;"function"==typeof e&&e.call(u),d&&d.s(),c=u=d=null}var u,c,d,h=I.a.la(I.h.childNodes(o));return I.h.Ea(o),I.a.K.za(o,l),I.o(function(){var i,r,e=I.a.f(t());if("string"==typeof e?i=e:(i=I.a.f(e.name),r=I.a.f(e.params)),!i)throw Error("No component name specified");var n=I.i.Cb(o,s),a=c=++p;I.j.get(i,function(e){if(c===a){if(l(),!e)throw Error("Unknown component '"+i+"'");!function(e,t,i){if(!(t=t.template))throw Error("Component '"+e+"' has no template");e=I.a.Ca(t),I.h.va(i,e)}(i,e,o);var t=function(e,t,i){var r=e.createViewModel;return r?r.call(e,t,i):t}(e,r,{element:o,templateNodes:h});e=n.createChildContext(t,{extend:function(e){e.$component=t,e.$componentTemplateNodes=h}}),t&&t.koDescendantsComplete&&(d=I.i.subscribe(o,I.i.pa,t.koDescendantsComplete,t)),u=t,I.Oa(e,o)}})},null,{l:o}),{controlsDescendantBindings:!0}}},I.h.ea.component=!0}();var v={class:"className",for:"htmlFor"};I.c.attr={update:function(n,e){var t=I.a.f(e())||{};I.a.P(t,function(e,t){t=I.a.f(t);var i=e.indexOf(":"),i="lookupNamespaceURI"in n&&0<i&&n.lookupNamespaceURI(e.substr(0,i)),r=!1===t||null===t||t===O;r?i?n.removeAttributeNS(i,e):n.removeAttribute(e):t=t.toString(),I.a.W<=8&&e in v?(e=v[e],r?n.removeAttribute(e):n[e]=t):r||(i?n.setAttributeNS(i,e,t):n.setAttribute(e,t)),"name"===e&&I.a.Yc(n,r?"":t)})}},I.c.checked={after:["value","attr"],init:function(a,o,s){function e(){var e=a.checked,t=l();if(!I.S.Ya()&&(e||!c&&!I.S.qa())){var i=I.u.G(o);if(d){var r=h?i.v():i,n=p;n!==(p=t)?e&&(I.a.Na(r,t,!0),I.a.Na(r,n,!1)):I.a.Na(r,t,e),h&&I.Za(i)&&i(r)}else u&&(t===O?t=e:e||(t=O)),I.m.eb(i,s,"checked",t,!0)}}var l=I.xb(function(){return s.has("checkedValue")?I.a.f(s.get("checkedValue")):i?s.has("value")?I.a.f(s.get("value")):a.value:void 0}),u="checkbox"==a.type,c="radio"==a.type;if(u||c){var t=o(),d=u&&I.a.f(t)instanceof Array,h=!(d&&t.push&&t.splice),i=c||d,p=d?l():O;c&&!a.name&&I.c.uniqueName.init(a,function(){return!0}),I.o(e,null,{l:a}),I.a.B(a,"click",e),I.o(function(){var e=I.a.f(o()),t=l();d?(a.checked=0<=I.a.A(e,t),p=t):a.checked=u&&t===O?!!e:l()===e},null,{l:a}),t=O}}},I.m.wa.checked=!0,I.c.checkedValue={update:function(e,t){e.value=I.a.f(t())}},I.c.class={update:function(e,t){var i=I.a.Db(I.a.f(t()));I.a.Eb(e,e.__ko__cssValue,!1),e.__ko__cssValue=i,I.a.Eb(e,i,!0)}},I.c.css={update:function(i,e){var t=I.a.f(e());null!==t&&"object"==typeof t?I.a.P(t,function(e,t){t=I.a.f(t),I.a.Eb(i,e,t)}):I.c.class.update(i,e)}},I.c.enable={update:function(e,t){var i=I.a.f(t());i&&e.disabled?e.removeAttribute("disabled"):i||e.disabled||(e.disabled=!0)}},I.c.disable={update:function(e,t){I.c.enable.update(e,function(){return!I.a.f(t())})}},I.c.event={init:function(e,a,o,s,l){var t=a()||{};I.a.P(t,function(n){"string"==typeof n&&I.a.B(e,n,function(e){var t,i=a()[n];if(i){try{var r=I.a.la(arguments);s=l.$data,r.unshift(s),t=i.apply(s,r)}finally{!0!==t&&(e.preventDefault?e.preventDefault():e.returnValue=!1)}!1===o.get(n+"Bubble")&&(e.cancelBubble=!0,e.stopPropagation&&e.stopPropagation())}})})}},I.c.foreach={Rc:function(i){return function(){var e=i(),t=I.a.bc(e);return t&&"number"!=typeof t.length?(I.a.f(e),{foreach:t.data,as:t.as,noChildContext:t.noChildContext,includeDestroyed:t.includeDestroyed,afterAdd:t.afterAdd,beforeRemove:t.beforeRemove,afterRender:t.afterRender,beforeMove:t.beforeMove,afterMove:t.afterMove,templateEngine:I.ba.Ma}):{foreach:e,templateEngine:I.ba.Ma}}},init:function(e,t){return I.c.template.init(e,I.c.foreach.Rc(t))},update:function(e,t,i,r,n){return I.c.template.update(e,I.c.foreach.Rc(t),i,r,n)}},I.m.Ra.foreach=!1,I.h.ea.foreach=!0,I.c.hasfocus={init:function(r,n,a){function e(e){r.__ko_hasfocusUpdating=!0;var t=r.ownerDocument;if("activeElement"in t){var i;try{i=t.activeElement}catch(e){i=t.body}e=i===r}t=n(),I.m.eb(t,a,"hasfocus",e,!0),r.__ko_hasfocusLastValue=e,r.__ko_hasfocusUpdating=!1}var t=e.bind(null,!0),i=e.bind(null,!1);I.a.B(r,"focus",t),I.a.B(r,"focusin",t),I.a.B(r,"blur",i),I.a.B(r,"focusout",i),r.__ko_hasfocusLastValue=!1},update:function(e,t){var i=!!I.a.f(t());e.__ko_hasfocusUpdating||e.__ko_hasfocusLastValue===i||(i?e.focus():e.blur(),!i&&e.__ko_hasfocusLastValue&&e.ownerDocument.body.focus(),I.u.G(I.a.Fb,null,[e,i?"focusin":"focusout"]))}},I.m.wa.hasfocus=!0,I.c.hasFocus=I.c.hasfocus,I.m.wa.hasFocus="hasfocus",I.c.html={init:function(){return{controlsDescendantBindings:!0}},update:function(e,t){I.a.fc(e,t())}},function(){function e(e,p,f){I.c[e]={init:function(n,a,e,t,o){var s,l,u,c,d,h={};if(p){t=e.get("as");var i=e.get("noChildContext");h={as:t,noChildContext:i,exportDependencies:d=!(t&&i)}}return c=(u="render"==e.get("completeOn"))||e.has(I.i.pa),I.o(function(){var e,t=I.a.f(a()),i=!f!=!t,r=!l;!d&&i===s||(c&&(o=I.i.Cb(n,o)),i&&(p&&!d||(h.dataDependency=I.S.o()),e=p?o.createChildContext("function"==typeof t?t:a,h):I.S.qa()?o.extend(null,h):o),r&&I.S.qa()&&(l=I.a.Ca(I.h.childNodes(n),!0)),i?(r||I.h.va(n,I.a.Ca(l)),I.Oa(e,n)):(I.h.Ea(n),u||I.i.ma(n,I.i.H)),s=i)},null,{l:n}),{controlsDescendantBindings:!0}}},I.m.Ra[e]=!1,I.h.ea[e]=!0}e("if"),e("ifnot",!1,!0),e("with",!0)}(),I.c.let={init:function(e,t,i,r,n){return t=n.extend(t),I.Oa(t,e),{controlsDescendantBindings:!0}}},I.h.ea.let=!0;var _={};I.c.options={init:function(e){if("select"!==I.a.R(e))throw Error("options binding applies only to SELECT elements");for(;0<e.length;)e.remove(0);return{controlsDescendantBindings:!0}},update:function(r,e,n){function t(){return I.a.jb(r.options,function(e){return e.selected})}function a(e,t,i){var r=typeof t;return"function"==r?t(e):"string"==r?e[t]:i}function i(e,t){if(p&&u)I.i.ma(r,I.i.H);else if(h.length){var i=0<=I.a.A(h,I.w.M(t[0]));I.a.Zc(t[0],i),p&&!i&&I.u.G(I.a.Fb,null,[r,"change"])}}var o=r.multiple,s=0!=r.length&&o?r.scrollTop:null,l=I.a.f(e()),u=n.get("valueAllowUnset")&&n.has("value"),c=n.get("optionsIncludeDestroyed");e={};var d,h=[];u||(o?h=I.a.Mb(t(),I.w.M):0<=r.selectedIndex&&h.push(I.w.M(r.options[r.selectedIndex]))),l&&(void 0===l.length&&(l=[l]),d=I.a.jb(l,function(e){return c||e===O||null===e||!I.a.f(e._destroy)}),!n.has("optionsCaption")||null!==(l=I.a.f(n.get("optionsCaption")))&&l!==O&&d.unshift(_));var p=!1;e.beforeRemove=function(e){r.removeChild(e)},l=i,n.has("optionsAfterRender")&&"function"==typeof n.get("optionsAfterRender")&&(l=function(e,t){i(0,t),I.u.G(n.get("optionsAfterRender"),null,[t[0],e!==_?e:O])}),I.a.ec(r,d,function(e,t,i){return i.length&&(h=!u&&i[0].selected?[I.w.M(i[0])]:[],p=!0),t=r.ownerDocument.createElement("option"),e===_?(I.a.Bb(t,n.get("optionsCaption")),I.w.cb(t,O)):(i=a(e,n.get("optionsValue"),e),I.w.cb(t,I.a.f(i)),e=a(e,n.get("optionsText"),i),I.a.Bb(t,e)),[t]},e,l),u||(o?h.length&&t().length<h.length:h.length&&0<=r.selectedIndex?I.w.M(r.options[r.selectedIndex])!==h[0]:h.length||0<=r.selectedIndex)&&I.u.G(I.a.Fb,null,[r,"change"]),(u||I.S.Ya())&&I.i.ma(r,I.i.H),I.a.wd(r),s&&20<Math.abs(s-r.scrollTop)&&(r.scrollTop=s)}},I.c.options.$b=I.a.g.Z(),I.c.selectedOptions={init:function(r,n,i){function e(){var e=n(),t=[];I.a.D(r.getElementsByTagName("option"),function(e){e.selected&&t.push(I.w.M(e))}),I.m.eb(e,i,"selectedOptions",t)}function t(){var i=I.a.f(n()),e=r.scrollTop;i&&"number"==typeof i.length&&I.a.D(r.getElementsByTagName("option"),function(e){var t=0<=I.a.A(i,I.w.M(e));e.selected!=t&&I.a.Zc(e,t)}),r.scrollTop=e}if("select"!=I.a.R(r))throw Error("selectedOptions binding applies only to SELECT elements");var a;I.i.subscribe(r,I.i.H,function(){a?e():(I.a.B(r,"change",e),a=I.o(t,null,{l:r}))},null,{notifyImmediately:!0})},update:function(){}},I.m.wa.selectedOptions=!0,I.c.style={update:function(r,e){var t=I.a.f(e()||{});I.a.P(t,function(e,t){if(null!==(t=I.a.f(t))&&t!==O&&!1!==t||(t=""),A)A(r).css(e,t);else if(/^--/.test(e))r.style.setProperty(e,t);else{e=e.replace(/-(\w)/g,function(e,t){return t.toUpperCase()});var i=r.style[e];(r.style[e]=t)===i||r.style[e]!=i||isNaN(t)||(r.style[e]=t+"px")}})}},I.c.submit={init:function(r,n,e,t,a){if("function"!=typeof n())throw Error("The value for a submit binding must be a function");I.a.B(r,"submit",function(e){var t,i=n();try{t=i.call(a.$data,r)}finally{!0!==t&&(e.preventDefault?e.preventDefault():e.returnValue=!1)}})}},I.c.text={init:function(){return{controlsDescendantBindings:!0}},update:function(e,t){I.a.Bb(e,t())}},I.h.ea.text=!0,function(){if(C&&C.navigator){var d,h,p,f,m,e=function(e){if(e)return parseFloat(e[1])},t=C.navigator.userAgent;(d=C.opera&&C.opera.version&&parseInt(C.opera.version()))||(m=e(t.match(/Edge\/([^ ]+)$/)))||e(t.match(/Chrome\/([^ ]+)/))||(h=e(t.match(/Version\/([^ ]+) Safari/)))||(p=e(t.match(/Firefox\/([^ ]+)/)))||(f=I.a.W||e(t.match(/MSIE ([^ ]+)/)))||(f=e(t.match(/rv:([^ )]+)/)))}if(8<=f&&f<10)var r=I.a.g.Z(),n=I.a.g.Z(),a=function(e){var t=this.activeElement;(t=t&&I.a.g.get(t,n))&&t(e)},g=function(e,t){var i=e.ownerDocument;I.a.g.get(i,r)||(I.a.g.set(i,r,!0),I.a.B(i,"selectionchange",a)),I.a.g.set(e,n,t)};I.c.textInput={init:function(i,r,t){function e(e,t){I.a.B(i,e,t)}function n(){o||(s=i.value,o=I.a.setTimeout(a,4))}function a(){clearTimeout(o),s=o=O;var e=i.value;l!==e&&(l=e,I.m.eb(r(),t,"textInput",e))}var o,s,l=i.value,u=9==I.a.W?n:a,c=!1;f&&e("keypress",a),f<11&&e("propertychange",function(e){c||"value"!==e.propertyName||u(e)}),8==f&&(e("keyup",a),e("keydown",a)),g&&(g(i,u),e("dragend",n)),(!f||9<=f)&&e("input",u),h<5&&"textarea"===I.a.R(i)?(e("keydown",n),e("paste",n),e("cut",n)):d<11?e("keydown",n):p<4?(e("DOMAutoComplete",a),e("dragdrop",a),e("drop",a)):m&&"number"===i.type&&e("keydown",n),e("change",a),e("blur",a),I.o(function e(){var t=I.a.f(r());null!==t&&t!==O||(t=""),s!==O&&t===s?I.a.setTimeout(e,4):i.value!==t&&(c=!0,i.value=t,c=!1,l=i.value)},null,{l:i})}},I.m.wa.textInput=!0,I.c.textinput={preprocess:function(e,t,i){i("textInput",e)}}}(),I.c.uniqueName={init:function(e,t){if(t()){var i="ko_unique_"+ ++I.c.uniqueName.rd;I.a.Yc(e,i)}}},I.c.uniqueName.rd=0,I.c.using={init:function(e,t,i,r,n){var a;return i.has("as")&&(a={as:i.get("as"),noChildContext:i.get("noChildContext")}),t=n.createChildContext(t,a),I.Oa(t,e),{controlsDescendantBindings:!0}}},I.h.ea.using=!0,I.c.value={init:function(i,r,n){var a=I.a.R(i),e="input"==a;if(!e||"checkbox"!=i.type&&"radio"!=i.type){var t=[],o=n.get("valueUpdate"),s=!1,l=null;o&&(t="string"==typeof o?[o]:I.a.wc(o),I.a.Pa(t,"change"));var u,c,d=function(){l=null,s=!1;var e=r(),t=I.w.M(i);I.m.eb(e,n,"value",t)};!I.a.W||!e||"text"!=i.type||"off"==i.autocomplete||i.form&&"off"==i.form.autocomplete||-1!=I.a.A(t,"propertychange")||(I.a.B(i,"propertychange",function(){s=!0}),I.a.B(i,"focus",function(){s=!1}),I.a.B(i,"blur",function(){s&&d()})),I.a.D(t,function(e){var t=d;I.a.Ud(e,"after")&&(t=function(){l=I.w.M(i),I.a.setTimeout(d,0)},e=e.substring(5)),I.a.B(i,e,t)}),u=e&&"file"==i.type?function(){var e=I.a.f(r());null===e||e===O||""===e?i.value="":I.u.G(d)}:function(){var e=I.a.f(r()),t=I.w.M(i);null!==l&&e===l?I.a.setTimeout(u,0):e===t&&t!==O||("select"===a?(t=n.get("valueAllowUnset"),I.w.cb(i,e,t),t||e===I.w.M(i)||I.u.G(d)):I.w.cb(i,e))},"select"===a?I.i.subscribe(i,I.i.H,function(){c?n.get("valueAllowUnset")?u():d():(I.a.B(i,"change",d),c=I.o(u,null,{l:i}))},null,{notifyImmediately:!0}):(I.a.B(i,"change",d),I.o(u,null,{l:i}))}else I.ib(i,{checkedValue:r})},update:function(){}},I.m.wa.value=!0,I.c.visible={update:function(e,t){var i=I.a.f(t()),r="none"!=e.style.display;i&&!r?e.style.display="":!i&&r&&(e.style.display="none")}},I.c.hidden={update:function(e,t){I.c.visible.update(e,function(){return!I.a.f(t())})}},I.c.click={init:function(e,t,i,r,n){return I.c.event.init.call(this,e,function(){var e={};return e.click=t(),e},i,r,n)}},I.ca=function(){},I.ca.prototype.renderTemplateSource=function(){throw Error("Override renderTemplateSource")},I.ca.prototype.createJavaScriptEvaluatorBlock=function(){throw Error("Override createJavaScriptEvaluatorBlock")},I.ca.prototype.makeTemplateSource=function(e,t){if("string"==typeof e){var i=(t=t||x).getElementById(e);if(!i)throw Error("Cannot find template with ID "+e);return new I.C.F(i)}if(1==e.nodeType||8==e.nodeType)return new I.C.ia(e);throw Error("Unknown template type: "+e)},I.ca.prototype.renderTemplate=function(e,t,i,r){return e=this.makeTemplateSource(e,r),this.renderTemplateSource(e,t,i,r)},I.ca.prototype.isTemplateRewritten=function(e,t){return!1===this.allowTemplateRewriting||this.makeTemplateSource(e,t).data("isRewritten")},I.ca.prototype.rewriteTemplate=function(e,t,i){e=this.makeTemplateSource(e,i),t=t(e.text()),e.text(t),e.data("isRewritten",!0)},I.b("templateEngine",I.ca),I.kc=function(){function o(e,t,i,r){e=I.m.ac(e);for(var n=I.m.Ra,a=0;a<e.length;a++){var o=e[a].key;if(Object.prototype.hasOwnProperty.call(n,o)){var s=n[o];if("function"==typeof s){if(o=s(e[a].value))throw Error(o)}else if(!s)throw Error("This template engine does not support the '"+o+"' binding within its templates")}}return i="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+I.m.vb(e,{valueAccessors:!0})+" } })()},'"+i.toLowerCase()+"')",r.createJavaScriptEvaluatorBlock(i)+t}var t=/(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'|[^>]*))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,i=/\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;return{xd:function(e,t,i){t.isTemplateRewritten(e,i)||t.rewriteTemplate(e,function(e){return I.kc.Ld(e,t)},i)},Ld:function(e,a){return e.replace(t,function(e,t,i,r,n){return o(n,t,i,a)}).replace(i,function(e,t){return o(t,"\x3c!-- ko --\x3e","#comment",a)})},md:function(r,n){return I.aa.Xb(function(e,t){var i=e.nextSibling;i&&i.nodeName.toLowerCase()===n&&I.ib(i,r,t)})}}}(),I.b("__tr_ambtns",I.kc.md),function(){I.C={},I.C.F=function(e){if(this.F=e){var t=I.a.R(e);this.ab="script"===t?1:"textarea"===t?2:"template"==t&&e.content&&11===e.content.nodeType?3:4}},I.C.F.prototype.text=function(){var e=1===this.ab?"text":2===this.ab?"value":"innerHTML";if(0==arguments.length)return this.F[e];var t=arguments[0];"innerHTML"==e?I.a.fc(this.F,t):this.F[e]=t};var t=I.a.g.Z()+"_";I.C.F.prototype.data=function(e){if(1===arguments.length)return I.a.g.get(this.F,t+e);I.a.g.set(this.F,t+e,arguments[1])};var n=I.a.g.Z();I.C.F.prototype.nodes=function(){var e=this.F;if(0==arguments.length){var t=I.a.g.get(e,n)||{},i=t.lb||(3===this.ab?e.content:4===this.ab?e:O);if(!i||t.jd){var r=this.text();r&&r!==t.bb&&(i=I.a.Md(r,e.ownerDocument),I.a.g.set(e,n,{lb:i,bb:r,jd:!0}))}return i}t=arguments[0],this.ab!==O&&this.text(""),I.a.g.set(e,n,{lb:t})},I.C.ia=function(e){this.F=e},I.C.ia.prototype=new I.C.F,I.C.ia.prototype.constructor=I.C.ia,I.C.ia.prototype.text=function(){if(0==arguments.length){var e=I.a.g.get(this.F,n)||{};return e.bb===O&&e.lb&&(e.bb=e.lb.innerHTML),e.bb}I.a.g.set(this.F,n,{bb:arguments[0]})},I.b("templateSources",I.C),I.b("templateSources.domElement",I.C.F),I.b("templateSources.anonymousTemplate",I.C.ia)}(),function(){function r(e,t,i){var r;for(t=I.h.nextSibling(t);e&&(r=e)!==t;)e=I.h.nextSibling(r),i(r,e)}function h(e,t){if(e.length){var n=e[0],a=e[e.length-1],i=n.parentNode,o=I.ga.instance,s=o.preprocessNode;if(s){if(r(n,a,function(e,t){var i=e.previousSibling,r=s.call(o,e);r&&(e===n&&(n=r[0]||t),e===a&&(a=r[r.length-1]||i))}),e.length=0,!n)return;n===a?e.push(n):(e.push(n,a),I.a.Ua(e,i))}r(n,a,function(e){1!==e.nodeType&&8!==e.nodeType||I.vc(t,e)}),r(n,a,function(e){1!==e.nodeType&&8!==e.nodeType||I.aa.cd(e,[t])}),I.a.Ua(e,i)}}function l(e){return e.nodeType?e:0<e.length?e[0]:null}function p(e,t,i,r,n){n=n||{};var a=(e&&l(e)||i||{}).ownerDocument,o=n.templateEngine||u;if(I.kc.xd(i,o,a),"number"!=typeof(i=o.renderTemplate(i,r,n,a)).length||0<i.length&&"number"!=typeof i[0].nodeType)throw Error("Template engine must return an array of DOM nodes");switch(a=!1,t){case"replaceChildren":I.h.va(e,i),a=!0;break;case"replaceNode":I.a.Xc(e,i),a=!0;break;case"ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+t)}return a&&(h(i,r),n.afterRender&&I.u.G(n.afterRender,null,[i,r[n.as||"$data"]]),"replaceChildren"==t&&I.i.ma(e,I.i.H)),i}function f(e,t,i){return I.O(e)?e():"function"==typeof e?e(t,i):e}var u;I.gc=function(e){if(e!=O&&!(e instanceof I.ca))throw Error("templateEngine must inherit from ko.templateEngine");u=e},I.dc=function(i,r,n,a,o){if(((n=n||{}).templateEngine||u)==O)throw Error("Set a template engine before calling renderTemplate");if(o=o||"replaceChildren",a){var s=l(a);return I.$(function(){var e=r&&r instanceof I.fa?r:new I.fa(r,null,null,null,{exportDependencies:!0}),t=f(i,e.$data,e),e=p(a,o,t,e,n);"replaceNode"==o&&(s=l(a=e))},null,{Sa:function(){return!s||!I.a.Sb(s)},l:s&&"replaceNode"==o?s.parentNode:s})}return I.aa.Xb(function(e){I.dc(i,r,n,e,"replaceNode")})},I.Qd=function(r,t,n,a,o){function i(e,t){I.u.G(I.a.ec,null,[a,e,l,n,s,t]),I.i.ma(a,I.i.H)}function s(e,t){h(t,u),n.afterRender&&n.afterRender(t,e),u=null}function l(e,t){u=o.createChildContext(e,{as:c,noChildContext:n.noChildContext,extend:function(e){e.$index=t,c&&(e[c+"Index"]=t)}});var i=f(r,e,u);return p(a,"ignoreTargetNode",i,u,n)}var u,c=n.as,d=!1===n.includeDestroyed||I.options.foreachHidesDestroyed&&!n.includeDestroyed;if(d||n.beforeRemove||!I.Pc(t))return I.$(function(){var e=I.a.f(t)||[];void 0===e.length&&(e=[e]),d&&(e=I.a.jb(e,function(e){return e===O||null===e||!I.a.f(e._destroy)})),i(e)},null,{l:a});i(t.v());var e=t.subscribe(function(e){i(t(),e)},null,"arrayChange");return e.l(a),e};var o=I.a.g.Z(),n=I.a.g.Z();I.c.template={init:function(e,t){var i=I.a.f(t());if("string"==typeof i||"name"in i)I.h.Ea(e);else if("nodes"in i){if(i=i.nodes||[],I.O(i))throw Error('The "nodes" option must be a plain, non-observable array.');var r=i[0]&&i[0].parentNode;r&&I.a.g.get(r,n)||(r=I.a.Yb(i),I.a.g.set(r,n,!0)),new I.C.ia(e).nodes(r)}else{if(!(0<(i=I.h.childNodes(e)).length))throw Error("Anonymous template defined, but no template content was provided");r=I.a.Yb(i),new I.C.ia(e).nodes(r)}return{controlsDescendantBindings:!0}},update:function(e,t,i,r,n){var a=t();t=I.a.f(a),i=!0,r=null,"string"==typeof t?t={}:(a="name"in t?t.name:e,"if"in t&&(i=I.a.f(t.if)),i&&"ifnot"in t&&(i=!I.a.f(t.ifnot)),i&&!a&&(i=!1)),"foreach"in t?r=I.Qd(a,i&&t.foreach||[],t,e,n):i?(i=n,"data"in t&&(i=n.createChildContext(t.data,{as:t.as,noChildContext:t.noChildContext,exportDependencies:!0})),r=I.dc(a,i,t,e)):I.h.Ea(e),n=r,(t=I.a.g.get(e,o))&&"function"==typeof t.s&&t.s(),I.a.g.set(e,o,!n||n.ja&&!n.ja()?O:n)}},I.m.Ra.template=function(e){return 1==(e=I.m.ac(e)).length&&e[0].unknown||I.m.Id(e,"name")?null:"This template engine does not support anonymous templates nested within its templates"},I.h.ea.template=!0}(),I.b("setTemplateEngine",I.gc),I.b("renderTemplate",I.dc),I.a.Kc=function(e,t,i){var r,n,a,o,s;if(e.length&&t.length)for(r=n=0;(!i||r<i)&&(o=e[n]);++n){for(a=0;s=t[a];++a)if(o.value===s.value){o.moved=s.index,s.moved=o.index,t.splice(a,1),r=a=0;break}r+=a}},I.a.Pb=function(){function r(e,t,i,r,n){var a,o,s,l,u,c=Math.min,d=Math.max,h=[],p=e.length,f=t.length,m=f-p||1,g=p+f+1;for(a=0;a<=p;a++)for(l=s,h.push(s=[]),u=c(f,a+m),o=d(0,a-1);o<=u;o++)s[o]=o?a?e[a-1]===t[o-1]?l[o-1]:c(l[o]||g,s[o-1]||g)+1:o+1:a+1;for(c=[],d=[],m=[],a=p,o=f;a||o;)f=h[a][o]-1,o&&f===h[a][o-1]?d.push(c[c.length]={status:i,value:t[--o],index:o}):a&&f===h[a-1][o]?m.push(c[c.length]={status:r,value:e[--a],index:a}):(--o,--a,n.sparse||c.push({status:"retained",value:t[o]}));return I.a.Kc(m,d,!n.dontLimitMoves&&10*p),c.reverse()}return function(e,t,i){return i="boolean"==typeof i?{dontLimitMoves:i}:i||{},(e=e||[]).length<(t=t||[]).length?r(e,t,"added","deleted",i):r(t,e,"deleted","added",i)}}(),I.b("utils.compareArrays",I.a.Pb),function(){function P(t,i,r,n,a){var o=[],e=I.$(function(){var e=i(r,a,I.a.Ua(o,t))||[];0<o.length&&(I.a.Xc(o,e),n&&I.u.G(n,null,[r,e,a])),o.length=0,I.a.Nb(o,e)},null,{l:t,Sa:function(){return!I.a.kd(o)}});return{Y:o,$:e.ja()?e:O}}var M=I.a.g.Z(),D=I.a.g.Z();I.a.ec=function(t,e,i,r,n,a){function o(e){u={Aa:e,pb:I.ta(y++)},m.push(u),f||b.push(u)}function s(e){u=p[e],y!==u.pb.v()&&x.push(u),u.pb(y++),I.a.Ua(u.Y,t),m.push(u)}function l(t,i){if(t)for(var r=0,e=i.length;r<e;r++)I.a.D(i[r].Y,function(e){t(e,r,i[r].Aa)})}void 0===(e=e||[]).length&&(e=[e]),r=r||{};var u,c,d,h,p=I.a.g.get(t,M),f=!p,m=[],g=0,y=0,v=[],_=[],C=[],x=[],b=[],A=0;if(f)I.a.D(e,o);else{if(!a||p&&p._countWaitingForRemove){var S=I.a.Mb(p,function(e){return e.Aa});a=I.a.Pb(S,e,{dontLimitMoves:r.dontLimitMoves,sparse:!0})}for(var w,E,T,S=0;w=a[S];S++)switch(E=w.moved,T=w.index,w.status){case"deleted":for(;g<T;)s(g++);E===O&&((u=p[g]).$&&(u.$.s(),u.$=O),I.a.Ua(u.Y,t).length&&(r.beforeRemove&&(m.push(u),A++,u.Aa===D?u=null:C.push(u)),u&&v.push.apply(v,u.Y))),g++;break;case"added":for(;y<T;)s(g++);E!==O?(_.push(m.length),s(E)):o(w.value)}for(;y<e.length;)s(g++);m._countWaitingForRemove=A}I.a.g.set(t,M,m),l(r.beforeMove,x),I.a.D(v,r.beforeRemove?I.oa:I.removeNode);try{h=t.ownerDocument.activeElement}catch(e){}if(_.length)for(;(S=_.shift())!=O;){for(u=m[S],c=O;S;)if((d=m[--S].Y)&&d.length){c=d[d.length-1];break}for(e=0;g=u.Y[e];c=g,e++)I.h.Wb(t,g,c)}for(S=0;u=m[S];S++){for(u.Y||I.a.extend(u,P(t,i,u.Aa,n,u.pb)),e=0;g=u.Y[e];c=g,e++)I.h.Wb(t,g,c);!u.Ed&&n&&(n(u.Aa,u.Y,u.pb),u.Ed=!0,c=u.Y[u.Y.length-1])}for(h&&t.ownerDocument.activeElement!=h&&h.focus(),l(r.beforeRemove,C),S=0;S<C.length;++S)C[S].Aa=D;l(r.afterMove,x),l(r.afterAdd,b)}}(),I.b("utils.setDomNodeChildrenFromArrayMapping",I.a.ec),I.ba=function(){this.allowTemplateRewriting=!1},I.ba.prototype=new I.ca,I.ba.prototype.constructor=I.ba,I.ba.prototype.renderTemplateSource=function(e,t,i,r){return(t=I.a.W<9||!e.nodes?null:e.nodes())?I.a.la(t.cloneNode(!0).childNodes):(e=e.text(),I.a.ua(e,r))},I.ba.Ma=new I.ba,I.gc(I.ba.Ma),I.b("nativeTemplateEngine",I.ba),function(){I.$a=function(){var a=this.Hd=function(){if(!A||!A.tmpl)return 0;try{if(0<=A.tmpl.tag.tmpl.open.toString().indexOf("__"))return 2}catch(e){}return 1}();this.renderTemplateSource=function(e,t,i,r){if(r=r||x,i=i||{},a<2)throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");var n=e.data("precompiled");return n||(n=e.text()||"",n=A.template(null,"{{ko_with $item.koBindingContext}}"+n+"{{/ko_with}}"),e.data("precompiled",n)),e=[t.$data],t=A.extend({koBindingContext:t},i.templateOptions),(t=A.tmpl(n,e,t)).appendTo(r.createElement("div")),A.fragments={},t},this.createJavaScriptEvaluatorBlock=function(e){return"{{ko_code ((function() { return "+e+" })()) }}"},this.addTemplate=function(e,t){x.write("<script type='text/html' id='"+e+"'>"+t+"<\/script>")},0<a&&(A.tmpl.tag.ko_code={open:"__.push($1 || '');"},A.tmpl.tag.ko_with={open:"with($1) {",close:"} "})},I.$a.prototype=new I.ca,I.$a.prototype.constructor=I.$a;var e=new I.$a;0<e.Hd&&I.gc(e),I.b("jqueryTmplTemplateEngine",I.$a)}()}(C.ko={})}();var knockout=ko;"undefined"!=typeof window?(ko=window.ko,void 0!==oldValue?window.ko=oldValue:delete window.ko):(ko=global.ko,void 0!==oldValue?global.ko=oldValue:delete global.ko);var OBSERVABLES_PROPERTY="__knockoutObservables",SUBSCRIBABLE_PROPERTY="__knockoutSubscribable";function track(n,e){if(!n)throw new Error("When calling ko.track, you must pass an object as the first parameter.");var a=this,o=getAllObservablesForObject(n,!0);return(e=e||Object.getOwnPropertyNames(n)).forEach(function(e){if(e!==OBSERVABLES_PROPERTY&&e!==SUBSCRIBABLE_PROPERTY&&!(e in o)){var t=n[e],i=t instanceof Array,r=a.isObservable(t)?t:i?a.observableArray(t):a.observable(t);Object.defineProperty(n,e,{configurable:!0,enumerable:!0,get:r,set:a.isWriteableObservable(r)?r:void 0}),o[e]=r,i&¬ifyWhenPresentOrFutureArrayValuesMutate(a,r)}}),n}function getAllObservablesForObject(e,t){var i=e[OBSERVABLES_PROPERTY];return!i&&t&&(i={},Object.defineProperty(e,OBSERVABLES_PROPERTY,{value:i})),i}function defineComputedProperty(e,t,i){var r={owner:e,deferEvaluation:!0};if("function"==typeof i)r.read=i;else{if("value"in i)throw new Error('For ko.defineProperty, you must not specify a "value" for the property. You must provide a "get" function.');if("function"!=typeof i.get)throw new Error('For ko.defineProperty, the third parameter must be either an evaluator function, or an options object containing a function called "get".');r.read=i.get,r.write=i.set}return e[t]=this.computed(r),track.call(this,e,[t]),e}function notifyWhenPresentOrFutureArrayValuesMutate(t,i){var r=null;t.computed(function(){r&&(r.dispose(),r=null);var e=i();e instanceof Array&&(r=startWatchingArrayInstance(t,i,e))})}function startWatchingArrayInstance(e,t,i){return getSubscribableForArray(e,i).subscribe(t)}function getSubscribableForArray(e,t){var i=t[SUBSCRIBABLE_PROPERTY];if(!i){i=new e.subscribable,Object.defineProperty(t,SUBSCRIBABLE_PROPERTY,{value:i});var r={};wrapStandardArrayMutators(t,i,r),addKnockoutArrayMutators(e,t,i,r)}return i}function wrapStandardArrayMutators(i,r,n){["pop","push","reverse","shift","sort","splice","unshift"].forEach(function(e){var t=i[e];i[e]=function(){var e=t.apply(this,arguments);return!0!==n.pause&&r.notifySubscribers(this),e}})}function addKnockoutArrayMutators(i,r,n,a){["remove","removeAll","destroy","destroyAll","replace"].forEach(function(t){Object.defineProperty(r,t,{enumerable:!1,value:function(){var e;a.pause=!0;try{e=i.observableArray.fn[t].apply(i.observableArray(r),arguments)}finally{a.pause=!1}return n.notifySubscribers(r),e}})})}function getObservable(e,t){if(!e)return null;var i=getAllObservablesForObject(e,!1);return i&&i[t]||null}function valueHasMutated(e,t){var i=getObservable(e,t);i&&i.valueHasMutated()}function attachToKo(e){e.track=track,e.getObservable=getObservable,e.valueHasMutated=valueHasMutated,e.defineProperty=defineComputedProperty}var knockout_es5={attachToKo:attachToKo},svgNS="http://www.w3.org/2000/svg",svgClassName="geoworld-svgPath-svg",SvgPathBindingHandler={register:function(o){o.bindingHandlers.geoworldSvgPath={init:function(e,r){var n=document.createElementNS(svgNS,"svg:svg");n.setAttribute("class",svgClassName);var a=document.createElementNS(svgNS,"path");return n.appendChild(a),o.virtualElements.setDomNodeChildren(e,[n]),o.computed({read:function(){var e=o.unwrap(r());a.setAttribute("d",o.unwrap(e.path));var t=o.unwrap(e.width),i=o.unwrap(e.height);n.setAttribute("width",t),n.setAttribute("height",i),n.setAttribute("viewBox","0 0 "+t+" "+i),e.css&&n.setAttribute("class",svgClassName+" "+o.unwrap(e.css))},disposeWhenNodeIsRemoved:e}),{controlsDescendantBindings:!0}}},o.virtualElements.allowedBindings.geoworldSvgPath=!0}};knockout_es5.attachToKo(knockout),SvgPathBindingHandler.register(knockout);var tmp$b={},p4x,q4x,r4x,s4x,t4x,u4x,_5x_unstuff,_5x_unstuffLUT,_5x_unstuff2,_5x_unstuffLUT2,_5x_originalUnstuff,_5x_originalUnstuff2,a6x,b6x,tcy,ucy,l4x,m4x,n4x,o4x;p4x={defaultNoDataValue:-34027999387901484e22,decode:function(e,t){var i=(t=t||{}).encodedMaskData||null===t.encodedMaskData,r=t4x(e,t.inputOffset||0,i),n=null!==t.noDataValue?t.noDataValue:p4x.defaultNoDataValue,a=q4x(r,t.pixelType||Float32Array,t.encodedMaskData,n,t.returnMask),o={width:r.width,height:r.height,pixelData:a.resultPixels,minValue:a.minValue,maxValue:r.pixels.maxValue,noDataValue:n};return a.resultMask&&(o.maskData=a.resultMask),t.returnEncodedMask&&r.mask&&(o.encodedMaskData=r.mask.bitset?r.mask.bitset:null),t.returnFileInfo&&(o.fileInfo=r4x(r),t.computeUsedBitDepths&&(o.fileInfo.bitDepths=s4x(r))),o}},q4x=function(e,t,i,r,n){var a,o,s,l=0,u=e.pixels.numBlocksX,c=e.pixels.numBlocksY,d=Math.floor(e.width/u),h=Math.floor(e.height/c),p=2*e.maxZError,f=Number.MAX_VALUE;i=i||(e.mask?e.mask.bitset:null),o=new t(e.width*e.height),n&&i&&(s=new Uint8Array(e.width*e.height));for(var m,g,y=new Float32Array(d*h),v=0;v<=c;v++){var _=v!==c?h:e.height%c;if(0!==_)for(var C=0;C<=u;C++){var x=C!==u?d:e.width%u;if(0!==x){var b,A,S,w,E=v*e.width*h+C*d,T=e.width-x,P=e.pixels.blocks[l];if(P.encoding<2?(b=0===P.encoding?P.rawData:(u4x(P.stuffedData,P.bitsPerPixel,P.numValidPixels,P.offset,p,y,e.pixels.maxValue),y),A=0):S=2===P.encoding?0:P.offset,i)for(g=0;g<_;g++){for(7&E&&(w=i[E>>3],w<<=7&E),m=0;m<x;m++)7&E||(w=i[E>>3]),128&w?(s&&(s[E]=1),f=(a=P.encoding<2?b[A++]:S)<f?a:f,o[E++]=a):(s&&(s[E]=0),o[E++]=r),w<<=1;E+=T}else if(P.encoding<2)for(g=0;g<_;g++){for(m=0;m<x;m++)f=(a=b[A++])<f?a:f,o[E++]=a;E+=T}else for(f=S<f?S:f,g=0;g<_;g++){for(m=0;m<x;m++)o[E++]=S;E+=T}if(1===P.encoding&&A!==P.numValidPixels)throw"Block and Mask do not match";l++}}}return{resultPixels:o,resultMask:s,minValue:f}},r4x=function(e){return{fileIdentifierString:e.fileIdentifierString,fileVersion:e.fileVersion,imageType:e.imageType,height:e.height,width:e.width,maxZError:e.maxZError,eofOffset:e.eofOffset,mask:e.mask?{numBlocksX:e.mask.numBlocksX,numBlocksY:e.mask.numBlocksY,numBytes:e.mask.numBytes,maxValue:e.mask.maxValue}:null,pixels:{numBlocksX:e.pixels.numBlocksX,numBlocksY:e.pixels.numBlocksY,numBytes:e.pixels.numBytes,maxValue:e.pixels.maxValue,noDataValue:e.noDataValue}}},s4x=function(e){for(var t=e.pixels.numBlocksX*e.pixels.numBlocksY,i={},r=0;r<t;r++){var n=e.pixels.blocks[r];0===n.encoding?i.float32=!0:1===n.encoding?i[n.bitsPerPixel]=!0:i[0]=!0}return Object.keys(i)},t4x=function(e,t,i){var r={},n=new Uint8Array(e,t,10);if(r.fileIdentifierString=String.fromCharCode.apply(null,n),"CntZImage"!==r.fileIdentifierString.trim())throw"Unexpected file identifier string: "+r.fileIdentifierString;t+=10;var a=new DataView(e,t,24);if(r.fileVersion=a.getInt32(0,!0),r.imageType=a.getInt32(4,!0),r.height=a.getUint32(8,!0),r.width=a.getUint32(12,!0),r.maxZError=a.getFloat64(16,!0),t+=24,!i)if(a=new DataView(e,t,16),r.mask={},r.mask.numBlocksY=a.getUint32(0,!0),r.mask.numBlocksX=a.getUint32(4,!0),r.mask.numBytes=a.getUint32(8,!0),r.mask.maxValue=a.getFloat32(12,!0),t+=16,0<r.mask.numBytes){var o=new Uint8Array(Math.ceil(r.width*r.height/8)),s=(a=new DataView(e,t,r.mask.numBytes)).getInt16(0,!0),l=2,u=0;do{if(0<s)for(;s--;)o[u++]=a.getUint8(l++);else{var c=a.getUint8(l++);for(s=-s;s--;)o[u++]=c}s=a.getInt16(l,!0),l+=2}while(l<r.mask.numBytes);if(-32768!==s||u<o.length)throw"Unexpected end of mask RLE encoding";r.mask.bitset=o,t+=r.mask.numBytes}else 0==(r.mask.numBytes|r.mask.numBlocksY|r.mask.maxValue)&&(r.mask.bitset=new Uint8Array(Math.ceil(r.width*r.height/8)));a=new DataView(e,t,16),r.pixels={},r.pixels.numBlocksY=a.getUint32(0,!0),r.pixels.numBlocksX=a.getUint32(4,!0),r.pixels.numBytes=a.getUint32(8,!0),r.pixels.maxValue=a.getFloat32(12,!0),t+=16;var d=r.pixels.numBlocksX,h=r.pixels.numBlocksY,p=d+(0<r.width%d?1:0),f=h+(0<r.height%h?1:0);r.pixels.blocks=new Array(p*f);for(var m=0,g=0;g<f;g++)for(var y=0;y<p;y++){var v=0,_=e.byteLength-t;a=new DataView(e,t,Math.min(10,_));var C={};r.pixels.blocks[m++]=C;var x=a.getUint8(0);if(v++,C.encoding=63&x,3<C.encoding)throw"Invalid block encoding ("+C.encoding+")";if(2!==C.encoding){if(0!==x&&2!==x){if(x>>=6,2===(C.offsetType=x))C.offset=a.getInt8(1),v++;else if(1===x)C.offset=a.getInt16(1,!0),v+=2;else{if(0!==x)throw"Invalid block offset type";C.offset=a.getFloat32(1,!0),v+=4}if(1===C.encoding)if(x=a.getUint8(v),v++,C.bitsPerPixel=63&x,x>>=6,2===(C.numValidPixelsType=x))C.numValidPixels=a.getUint8(v),v++;else if(1===x)C.numValidPixels=a.getUint16(v,!0),v+=2;else{if(0!==x)throw"Invalid valid pixel count type";C.numValidPixels=a.getUint32(v,!0),v+=4}}var b;if(t+=v,3!==C.encoding)if(0===C.encoding){var A=(r.pixels.numBytes-1)/4;if(A!==Math.floor(A))throw"uncompressed block has invalid length";b=new ArrayBuffer(4*A),new Uint8Array(b).set(new Uint8Array(e,t,4*A));var S=new Float32Array(b);C.rawData=S,t+=4*A}else if(1===C.encoding){var w=Math.ceil(C.numValidPixels*C.bitsPerPixel/8),E=Math.ceil(w/4);b=new ArrayBuffer(4*E),new Uint8Array(b).set(new Uint8Array(e,t,w)),C.stuffedData=new Uint32Array(b),t+=w}}else t++}return r.eofOffset=t,r},u4x=function(e,t,i,r,n,a,o){var s,l,u,c=(1<<t)-1,d=0,h=0,p=Math.ceil((o-r)/n),f=4*e.length-Math.ceil(t*i/8);for(e[e.length-1]<<=8*f,s=0;s<i;s++){if(0===h&&(u=e[d++],h=32),t<=h)l=u>>>h-t&c,h-=t;else{var m=t-h;l=(u&c)<<m&c,l+=(u=e[d++])>>>(h=32-m)}a[s]=l<p?r+l*n:o}return a},l4x=p4x,_5x_unstuff=function(e,t,i,r,n,a,o,s){var l,u,c,d,h,p=(1<<i)-1,f=0,m=0,g=4*e.length-Math.ceil(i*r/8);if(e[e.length-1]<<=8*g,n)for(l=0;l<r;l++)0===m&&(c=e[f++],m=32),i<=m?(u=c>>>m-i&p,m-=i):(u=(c&p)<<(d=i-m)&p,u+=(c=e[f++])>>>(m=32-d)),t[l]=n[u];else for(h=Math.ceil((s-a)/o),l=0;l<r;l++)0===m&&(c=e[f++],m=32),i<=m?(u=c>>>m-i&p,m-=i):(u=(c&p)<<(d=i-m)&p,u+=(c=e[f++])>>>(m=32-d)),t[l]=u<h?a+u*o:s},_5x_unstuffLUT=function(e,t,i,r,n,a){var o,s=(1<<t)-1,l=0,u=0,c=0,d=0,h=0,p=[],f=4*e.length-Math.ceil(t*i/8);e[e.length-1]<<=8*f;var m=Math.ceil((a-r)/n);for(u=0;u<i;u++)0===d&&(o=e[l++],d=32),t<=d?(h=o>>>d-t&s,d-=t):(h=(o&s)<<(c=t-d)&s,h+=(o=e[l++])>>>(d=32-c)),p[u]=h<m?r+h*n:a;return p.unshift(r),p},_5x_unstuff2=function(e,t,i,r,n,a,o,s){var l,u,c,d,h=(1<<i)-1,p=0,f=0,m=0;if(n)for(l=0;l<r;l++)0===f&&(c=e[p++],f=32,m=0),i<=f?(u=c>>>m&h,f-=i,m+=i):(u=c>>>m&h,f=32-(d=i-f),u|=((c=e[p++])&(1<<d)-1)<<i-d,m=d),t[l]=n[u];else{var g=Math.ceil((s-a)/o);for(l=0;l<r;l++)0===f&&(c=e[p++],f=32,m=0),i<=f?(u=c>>>m&h,f-=i,m+=i):(u=c>>>m&h,f=32-(d=i-f),u|=((c=e[p++])&(1<<d)-1)<<i-d,m=d),t[l]=u<g?a+u*o:s}return t},_5x_unstuffLUT2=function(e,t,i,r,n,a){var o,s=(1<<t)-1,l=0,u=0,c=0,d=0,h=0,p=0,f=[],m=Math.ceil((a-r)/n);for(u=0;u<i;u++)0===d&&(o=e[l++],d=32,p=0),t<=d?(h=o>>>p&s,d-=t,p+=t):(h=o>>>p&s,d=32-(c=t-d),h|=((o=e[l++])&(1<<c)-1)<<t-c,p=c),f[u]=h<m?r+h*n:a;return f.unshift(r),f},_5x_originalUnstuff=function(e,t,i,r){var n,a,o,s,l=(1<<i)-1,u=0,c=0,d=4*e.length-Math.ceil(i*r/8);for(e[e.length-1]<<=8*d,n=0;n<r;n++)0===c&&(o=e[u++],c=32),i<=c?(a=o>>>c-i&l,c-=i):(a=(o&l)<<(s=i-c)&l,a+=(o=e[u++])>>>(c=32-s)),t[n]=a;return t},_5x_originalUnstuff2=function(e,t,i,r){var n,a,o,s,l=(1<<i)-1,u=0,c=0,d=0;for(n=0;n<r;n++)0===c&&(o=e[u++],c=32,d=0),i<=c?(a=o>>>d&l,c-=i,d+=i):(a=o>>>d&l,c=32-(s=i-c),a|=((o=e[u++])&(1<<s)-1)<<i-s,d=s),t[n]=a;return t},a6x={HUFFMAN_LUT_BITS_MAX:12,computeChecksumFletcher32:function(e){for(var t=65535,i=65535,r=e.length,n=Math.floor(r/2),a=0;n;){var o=359<=n?359:n;for(n-=o;t+=e[a++]<<8,i+=t+=e[a++],--o;);t=(65535&t)+(t>>>16),i=(65535&i)+(i>>>16)}return 1&r&&(i+=t+=e[a]<<8),((i=(65535&i)+(i>>>16))<<16|(t=(65535&t)+(t>>>16)))>>>0},readHeaderInfo:function(e,t){var i=t.ptr,r=new Uint8Array(e,i,6),n={};if(n.fileIdentifierString=String.fromCharCode.apply(null,r),0!==n.fileIdentifierString.lastIndexOf("Lerc2",0))throw"Unexpected file identifier string (expect Lerc2 ): "+n.fileIdentifierString;i+=6;var a,o=new DataView(e,i,8),s=o.getInt32(0,!0);if(i+=4,3<=(n.fileVersion=s)&&(n.checksum=o.getUint32(4,!0),i+=4),o=new DataView(e,i,12),n.height=o.getUint32(0,!0),n.width=o.getUint32(4,!0),i+=8,4<=s?(n.numDims=o.getUint32(8,!0),i+=4):n.numDims=1,o=new DataView(e,i,40),n.numValidPixel=o.getUint32(0,!0),n.microBlockSize=o.getInt32(4,!0),n.blobSize=o.getInt32(8,!0),n.imageType=o.getInt32(12,!0),n.maxZError=o.getFloat64(16,!0),n.zMin=o.getFloat64(24,!0),n.zMax=o.getFloat64(32,!0),i+=40,t.headerInfo=n,t.ptr=i,3<=s&&(a=4<=s?52:48,this.computeChecksumFletcher32(new Uint8Array(e,i-a,n.blobSize-14))!==n.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(e,t){var i=t.headerInfo,r=this.getDataTypeArray(i.imageType),n=i.numDims*this.getDataTypeSize(i.imageType),a=this.readSubArray(e,t.ptr,r,n),o=this.readSubArray(e,t.ptr+n,r,n);t.ptr+=2*n;var s,l=!0;for(s=0;s<i.numDims;s++)if(a[s]!==o[s]){l=!1;break}return i.minValues=a,i.maxValues=o,l},readSubArray:function(e,t,i,r){var n;if(i===Uint8Array)n=new Uint8Array(e,t,r);else{var a=new ArrayBuffer(r);new Uint8Array(a).set(new Uint8Array(e,t,r)),n=new i(a)}return n},readMask:function(e,t){var i,r,n=t.ptr,a=t.headerInfo,o=a.width*a.height,s=a.numValidPixel,l=new DataView(e,n,4),u={};if(u.numBytes=l.getUint32(0,!0),n+=4,(0===s||o===s)&&0!==u.numBytes)throw"invalid mask";if(0===s)i=new Uint8Array(Math.ceil(o/8)),u.bitset=i,r=new Uint8Array(o),t.pixels.resultMask=r,n+=u.numBytes;else if(0<u.numBytes){i=new Uint8Array(Math.ceil(o/8));var c=(l=new DataView(e,n,u.numBytes)).getInt16(0,!0),d=2,h=0,p=0;do{if(0<c)for(;c--;)i[h++]=l.getUint8(d++);else for(p=l.getUint8(d++),c=-c;c--;)i[h++]=p;c=l.getInt16(d,!0),d+=2}while(d<u.numBytes);if(-32768!==c||h<i.length)throw"Unexpected end of mask RLE encoding";r=new Uint8Array(o);var f=0,m=0;for(m=0;m<o;m++)7&m?(f=i[m>>3],f<<=7&m):f=i[m>>3],128&f&&(r[m]=1);t.pixels.resultMask=r,u.bitset=i,n+=u.numBytes}return t.ptr=n,t.mask=u,!0},readDataOneSweep:function(e,t,i){var r,n=t.ptr,a=t.headerInfo,o=a.numDims,s=a.width*a.height,l=a.imageType,u=a.numValidPixel*a6x.getDataTypeSize(l)*o,c=t.pixels.resultMask;if(i===Uint8Array)r=new Uint8Array(e,n,u);else{var d=new ArrayBuffer(u);new Uint8Array(d).set(new Uint8Array(e,n,u)),r=new i(d)}if(r.length===s*o)t.pixels.resultPixels=r;else{t.pixels.resultPixels=new i(s*o);var h=0,p=0,f=0,m=0;if(1<o)for(f=0;f<o;f++)for(m=f*s,p=0;p<s;p++)c[p]&&(t.pixels.resultPixels[m+p]=r[h++]);else for(p=0;p<s;p++)c[p]&&(t.pixels.resultPixels[p]=r[h++])}return n+=u,t.ptr=n,!0},readHuffmanTree:function(e,t){var i=this.HUFFMAN_LUT_BITS_MAX,r=new DataView(e,t.ptr,16);if(t.ptr+=16,r.getInt32(0,!0)<2)throw"unsupported Huffman version";var n=r.getInt32(4,!0),a=r.getInt32(8,!0),o=r.getInt32(12,!0);if(o<=a)return!1;var s=new Uint32Array(o-a);a6x.decodeBits(e,t,s);var l,u,c,d,h=[];for(l=a;l<o;l++)h[u=l-(l<n?0:n)]={first:s[l-a],second:null};var p=e.byteLength-t.ptr,f=Math.ceil(p/4),m=new ArrayBuffer(4*f);new Uint8Array(m).set(new Uint8Array(e,t.ptr,p));var g,y=new Uint32Array(m),v=0,_=0;for(g=y[0],l=a;l<o;l++)0<(d=h[u=l-(l<n?0:n)].first)&&(h[u].second=g<<v>>>32-d,d<=32-v?32===(v+=d)&&(v=0,g=y[++_]):(v+=d-32,g=y[++_],h[u].second|=g>>>32-v));var C=0,x=0,b=new b6x;for(l=0;l<h.length;l++)void 0!==h[l]&&(C=Math.max(C,h[l].first));x=i<=C?i:C,30<=C&&console.log("WARning, large NUM LUT BITS IS "+C);var A,S,w,E,T,P=[];for(l=a;l<o;l++)if(0<(d=h[u=l-(l<n?0:n)].first))if(A=[d,u],d<=x)for(S=h[u].second<<x-d,w=1<<x-d,c=0;c<w;c++)P[S|c]=A;else for(S=h[u].second,T=b,E=d-1;0<=E;E--)T=S>>>E&1?(T.right||(T.right=new b6x),T.right):(T.left||(T.left=new b6x),T.left),0!==E||T.val||(T.val=A[1]);return{decodeLut:P,numBitsLUTQick:x,numBitsLUT:C,tree:b,stuffedData:y,srcPtr:_,bitPos:v}},readHuffman:function(e,t,i){var r,n,a,o,s,l,u,c,d,h=t.headerInfo,p=h.numDims,f=t.headerInfo.height,m=t.headerInfo.width,g=m*f,y=this.readHuffmanTree(e,t),v=y.decodeLut,_=y.tree,C=y.stuffedData,x=y.srcPtr,b=y.bitPos,A=y.numBitsLUTQick,S=y.numBitsLUT,w=0===t.headerInfo.imageType?128:0,E=t.pixels.resultMask,T=0;0<b&&(x++,b=0);var P,M=C[x],D=1===t.encodeMode,I=new i(g*p),O=I;for(P=0;P<h.numDims;P++){if(1<p&&(O=new i(I.buffer,g*P,g),T=0),t.headerInfo.numValidPixel===m*f)for(l=c=0;l<f;l++)for(u=0;u<m;u++,c++){if(n=0,s=o=M<<b>>>32-A,32-b<A&&(s=o|=C[x+1]>>>64-b-A),v[s])n=v[s][1],b+=v[s][0];else for(s=o=M<<b>>>32-S,32-b<S&&(s=o|=C[x+1]>>>64-b-S),r=_,d=0;d<S;d++)if(!(r=o>>>S-d-1&1?r.right:r.left).left&&!r.right){n=r.val,b=b+d+1;break}32<=b&&(b-=32,M=C[++x]),a=n-w,D?(a+=0<u?T:0<l?O[c-m]:T,a&=255,T=O[c]=a):O[c]=a}else for(l=c=0;l<f;l++)for(u=0;u<m;u++,c++)if(E[c]){if(n=0,s=o=M<<b>>>32-A,32-b<A&&(s=o|=C[x+1]>>>64-b-A),v[s])n=v[s][1],b+=v[s][0];else for(s=o=M<<b>>>32-S,32-b<S&&(s=o|=C[x+1]>>>64-b-S),r=_,d=0;d<S;d++)if(!(r=o>>>S-d-1&1?r.right:r.left).left&&!r.right){n=r.val,b=b+d+1;break}32<=b&&(b-=32,M=C[++x]),a=n-w,D?(0<u&&E[c-1]?a+=T:0<l&&E[c-m]?a+=O[c-m]:a+=T,a&=255,T=O[c]=a):O[c]=a}t.ptr=t.ptr+4*(x+1)+(0<b?4:0)}t.pixels.resultPixels=I},decodeBits:function(e,t,i,r,n){var a=t.headerInfo,o=a.fileVersion,s=0,l=5<=e.byteLength-t.ptr?5:e.byteLength-t.ptr,u=new DataView(e,t.ptr,l),c=u.getUint8(0);s++;var d=c>>6,h=0==d?4:3-d,p=0<(32&c),f=31&c,m=0;if(1==h)m=u.getUint8(s),s++;else if(2==h)m=u.getUint16(s,!0),s+=2;else{if(4!=h)throw"Invalid valid pixel count type";m=u.getUint32(s,!0),s+=4}var g,y,v,_,C,x,b,A,S,w=2*a.maxZError,E=1<a.numDims?a.maxValues[n]:a.zMax;if(p){for(t.counter.lut++,A=u.getUint8(s),s++,_=Math.ceil((A-1)*f/8),C=Math.ceil(_/4),y=new ArrayBuffer(4*C),v=new Uint8Array(y),t.ptr+=s,v.set(new Uint8Array(e,t.ptr,_)),b=new Uint32Array(y),t.ptr+=_,S=0;A-1>>>S;)S++;_=Math.ceil(m*S/8),C=Math.ceil(_/4),y=new ArrayBuffer(4*C),(v=new Uint8Array(y)).set(new Uint8Array(e,t.ptr,_)),g=new Uint32Array(y),t.ptr+=_,x=3<=o?_5x_unstuffLUT2(b,f,A-1,r,w,E):_5x_unstuffLUT(b,f,A-1,r,w,E),3<=o?_5x_unstuff2(g,i,S,m,x):_5x_unstuff(g,i,S,m,x)}else t.counter.bitstuffer++,S=f,t.ptr+=s,0<S&&(_=Math.ceil(m*S/8),C=Math.ceil(_/4),y=new ArrayBuffer(4*C),(v=new Uint8Array(y)).set(new Uint8Array(e,t.ptr,_)),g=new Uint32Array(y),t.ptr+=_,3<=o?null===r?_5x_originalUnstuff2(g,i,S,m):_5x_unstuff2(g,i,S,m,!1,r,w,E):null===r?_5x_originalUnstuff(g,i,S,m):_5x_unstuff(g,i,S,m,!1,r,w,E))},readTiles:function(e,t,i){var r=t.headerInfo,n=r.width,a=r.height,o=r.microBlockSize,s=r.imageType,l=a6x.getDataTypeSize(s),u=Math.ceil(n/o),c=Math.ceil(a/o);t.pixels.numBlocksY=c,t.pixels.numBlocksX=u;var d,h,p,f,m,g,y,v,_=t.pixels.ptr=0,C=0,x=0,b=0,A=0,S=0,w=0,E=0,T=0,P=0,M=0,D=0,I=0,O=0,R=0,L=new i(o*o),N=a%o||o,k=n%o||o,B=r.numDims,F=t.pixels.resultMask,V=t.pixels.resultPixels;for(x=0;x<c;x++)for(A=x!==c-1?o:N,b=0;b<u;b++)for(P=x*n*o+b*o,M=n-(S=b!==u-1?o:k),v=0;v<B;v++){if(1<B&&(V=new i(t.pixels.resultPixels.buffer,n*a*v*l,n*a)),w=e.byteLength-t.ptr,h={},R=0,R++,T=(E=(d=new DataView(e,t.ptr,Math.min(10,w))).getUint8(0))>>6&255,(E>>2&15)!==(b*o>>3&15))throw"integrity issue";if(3<(m=3&E))throw t.ptr+=R,"Invalid block encoding ("+m+")";if(2!=m)if(0==m){if(t.counter.uncompressed++,t.ptr+=R,D=(D=A*S*l)<(I=e.byteLength-t.ptr)?D:I,p=new ArrayBuffer(D%l==0?D:D+l-D%l),new Uint8Array(p).set(new Uint8Array(e,t.ptr,D)),f=new i(p),O=0,F)for(_=0;_<A;_++){for(C=0;C<S;C++)F[P]&&(V[P]=f[O++]),P++;P+=M}else for(_=0;_<A;_++){for(C=0;C<S;C++)V[P++]=f[O++];P+=M}t.ptr+=O*l}else if(g=a6x.getDataTypeUsed(s,T),y=a6x.getOnePixel(h,R,g,d),R+=a6x.getDataTypeSize(g),3==m)if(t.ptr+=R,t.counter.constantoffset++,F)for(_=0;_<A;_++){for(C=0;C<S;C++)F[P]&&(V[P]=y),P++;P+=M}else for(_=0;_<A;_++){for(C=0;C<S;C++)V[P++]=y;P+=M}else if(t.ptr+=R,a6x.decodeBits(e,t,L,y,v),R=0,F)for(_=0;_<A;_++){for(C=0;C<S;C++)F[P]&&(V[P]=L[R++]),P++;P+=M}else for(_=0;_<A;_++){for(C=0;C<S;C++)V[P++]=L[R++];P+=M}else t.counter.constant++,t.ptr+=R}},formatFileInfo:function(e){return{fileIdentifierString:e.headerInfo.fileIdentifierString,fileVersion:e.headerInfo.fileVersion,imageType:e.headerInfo.imageType,height:e.headerInfo.height,width:e.headerInfo.width,numValidPixel:e.headerInfo.numValidPixel,microBlockSize:e.headerInfo.microBlockSize,blobSize:e.headerInfo.blobSize,maxZError:e.headerInfo.maxZError,pixelType:a6x.getPixelType(e.headerInfo.imageType),eofOffset:e.eofOffset,mask:e.mask?{numBytes:e.mask.numBytes}:null,pixels:{numBlocksX:e.pixels.numBlocksX,numBlocksY:e.pixels.numBlocksY,maxValue:e.headerInfo.zMax,minValue:e.headerInfo.zMin,noDataValue:e.noDataValue}}},constructConstantSurface:function(e){var t=e.headerInfo.zMax,i=e.headerInfo.numDims,r=e.headerInfo.height*e.headerInfo.width,n=r*i,a=0,o=0,s=0,l=e.pixels.resultMask;if(l)if(1<i)for(a=0;a<i;a++)for(s=a*r,o=0;o<r;o++)l[o]&&(e.pixels.resultPixels[s+o]=t);else for(o=0;o<r;o++)l[o]&&(e.pixels.resultPixels[o]=t);else if(e.pixels.resultPixels.fill)e.pixels.resultPixels.fill(t);else for(o=0;o<n;o++)e.pixels.resultPixels[o]=t},getDataTypeArray:function(e){var t;switch(e){case 0:t=Int8Array;break;case 1:t=Uint8Array;break;case 2:t=Int16Array;break;case 3:t=Uint16Array;break;case 4:t=Int32Array;break;case 5:t=Uint32Array;break;case 6:t=Float32Array;break;case 7:t=Float64Array;break;default:t=Float32Array}return t},getPixelType:function(e){var t;switch(e){case 0:t="S8";break;case 1:t="U8";break;case 2:t="S16";break;case 3:t="U16";break;case 4:t="S32";break;case 5:t="U32";break;case 6:t="F32";break;case 7:t="F64";break;default:t="F32"}return t},isValidPixelValue:function(e,t){if(null===t)return!1;var i;switch(e){case 0:i=-128<=t&&t<=127;break;case 1:i=0<=t&&t<=255;break;case 2:i=-32768<=t&&t<=32767;break;case 3:i=0<=t&&t<=65536;break;case 4:i=-2147483648<=t&&t<=2147483647;break;case 5:i=0<=t&&t<=4294967296;break;case 6:i=-34027999387901484e22<=t&&t<=34027999387901484e22;break;case 7:i=5e-324<=t&&t<=17976931348623157e292;break;default:i=!1}return i},getDataTypeSize:function(e){var t=0;switch(e){case 0:case 1:t=1;break;case 2:case 3:t=2;break;case 4:case 5:case 6:t=4;break;case 7:t=8;break;default:t=e}return t},getDataTypeUsed:function(e,t){var i=e;switch(e){case 2:case 4:i=e-t;break;case 3:case 5:i=e-2*t;break;case 6:i=0===t?e:1===t?2:1;break;case 7:i=0===t?e:e-2*t+1;break;default:i=e}return i},getOnePixel:function(e,t,i,r){var n=0;switch(i){case 0:n=r.getInt8(t);break;case 1:n=r.getUint8(t);break;case 2:n=r.getInt16(t,!0);break;case 3:n=r.getUint16(t,!0);break;case 4:n=r.getInt32(t,!0);break;case 5:n=r.getUInt32(t,!0);break;case 6:n=r.getFloat32(t,!0);break;case 7:n=r.getFloat64(t,!0);break;default:throw"the decoder does not understand this pixel type"}return n}},b6x=function(e,t,i){this.val=e,this.left=t,this.right=i},m4x={decode:function(e,t){var i=(t=t||{}).noDataValue,r=0,n={};if(n.ptr=t.inputOffset||0,n.pixels={},a6x.readHeaderInfo(e,n)){var a=n.headerInfo,o=a.fileVersion,s=a6x.getDataTypeArray(a.imageType);a6x.readMask(e,n),a.numValidPixel===a.width*a.height||n.pixels.resultMask||(n.pixels.resultMask=t.maskData);var l,u=a.width*a.height;if(n.pixels.resultPixels=new s(u*a.numDims),n.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0},0!==a.numValidPixel)if(a.zMax===a.zMin)a6x.constructConstantSurface(n);else if(4<=o&&a6x.checkMinMaxRanges(e,n))a6x.constructConstantSurface(n);else{var c=new DataView(e,n.ptr,2),d=c.getUint8(0);if(n.ptr++,d)a6x.readDataOneSweep(e,n,s);else if(1<o&&a.imageType<=1&&Math.abs(a.maxZError-.5)<1e-5){var h=c.getUint8(1);if(n.ptr++,2<(n.encodeMode=h)||o<4&&1<h)throw"Invalid Huffman flag "+h;h?a6x.readHuffman(e,n,s):a6x.readTiles(e,n,s)}else a6x.readTiles(e,n,s)}n.eofOffset=n.ptr,t.inputOffset?(l=n.headerInfo.blobSize+t.inputOffset-n.ptr,1<=Math.abs(l)&&(n.eofOffset=t.inputOffset+n.headerInfo.blobSize)):(l=n.headerInfo.blobSize-n.ptr,1<=Math.abs(l)&&(n.eofOffset=n.headerInfo.blobSize));var p={width:a.width,height:a.height,pixelData:n.pixels.resultPixels,minValue:a.zMin,maxValue:a.zMax,validPixelCount:a.numValidPixel,dimCount:a.numDims,dimStats:{minValues:a.minValues,maxValues:a.maxValues},maskData:n.pixels.resultMask};if(n.pixels.resultMask&&a6x.isValidPixelValue(a.imageType,i)){var f=n.pixels.resultMask;for(r=0;r<u;r++)f[r]||(p.pixelData[r]=i);p.noDataValue=i}return n.noDataValue=i,t.returnFileInfo&&(p.fileInfo=a6x.formatFileInfo(n)),p}},getBandCount:function(e){for(var t=0,i=0,r={ptr:0,pixels:{}};i<e.byteLength-58;)a6x.readHeaderInfo(e,r),i+=r.headerInfo.blobSize,t++,r.ptr=i;return t}},tcy=new ArrayBuffer(4),ucy=new Uint8Array(tcy),n4x=(new Uint32Array(tcy)[0]=1)===ucy[0],o4x={decode:function(e,t){if(!n4x)throw"Big endian system is not supported.";var i,r,n=(t=t||{}).inputOffset||0,a=new Uint8Array(e,n,10),o=String.fromCharCode.apply(null,a);if("CntZImage"===o.trim())i=l4x,r=1;else{if("Lerc2"!==o.substring(0,5))throw"Unexpected file identifier string: "+o;i=m4x,r=2}for(var s,l,u,c,d,h,p=0,f=e.byteLength-10,m=[],g={width:0,height:0,pixels:[],pixelType:t.pixelType,mask:null,statistics:[]};n<f;){var y=i.decode(e,{inputOffset:n,encodedMaskData:s,maskData:u,returnMask:0===p,returnEncodedMask:0===p,returnFileInfo:!0,pixelType:t.pixelType||null,noDataValue:t.noDataValue||null});n=y.fileInfo.eofOffset,0===p&&(s=y.encodedMaskData,u=y.maskData,g.width=y.width,g.height=y.height,g.dimCount=y.dimCount||1,g.pixelType=y.pixelType||y.fileInfo.pixelType,g.mask=y.maskData),1<r&&y.fileInfo.mask&&0<y.fileInfo.mask.numBytes&&m.push(y.maskData),p++,g.pixels.push(y.pixelData),g.statistics.push({minValue:y.minValue,maxValue:y.maxValue,noDataValue:y.noDataValue,dimStats:y.dimStats})}if(1<r&&1<m.length){for(h=g.width*g.height,g.bandMasks=m,(u=new Uint8Array(h)).set(m[0]),c=1;c<m.length;c++)for(l=m[c],d=0;d<h;d++)u[d]=u[d]&l[d];g.maskData=u}return g}},tmp$b.Lerc=o4x;var LercDecode=tmp$b.Lerc,tmp$c={},Pcy,Qcy;Pcy=tmp$c,Qcy=function(){return n={},r.m=i=[function(e,t,i){var r=function(e,t,i){return t&&n(e.prototype,t),i&&n(e,i),e};function n(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var a=i(1),o=a.webm,s=a.mp4,l="undefined"!=typeof navigator&&parseFloat((""+(/CPU.*OS ([0-9_]{3,4})[0-9_]{0,1}|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent)||[0,""])[1]).replace("undefined","3_2").replace("_",".").replace("_",""))<10&&!window.MSStream,u=(r(c,[{key:"_addSourceToVideo",value:function(e,t,i){var r=document.createElement("source");r.src=i,r.type="video/"+t,e.appendChild(r)}},{key:"enable",value:function(){l?(this.disable(),console.warn("\n NoSleep enabled for older iOS devices. This can interrupt\n active or long-running network requests from completing successfully.\n See https://github.com/richtr/NoSleep.js/issues/15 for more details.\n "),this.noSleepTimer=window.setInterval(function(){document.hidden||(window.location.href=window.location.href.split("#")[0],window.setTimeout(window.stop,0))},15e3)):this.noSleepVideo.play()}},{key:"disable",value:function(){l?this.noSleepTimer&&(console.warn("\n NoSleep now disabled for older iOS devices.\n "),window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):this.noSleepVideo.pause()}}]),c);function c(){var e=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c),l?this.noSleepTimer=null:(this.noSleepVideo=document.createElement("video"),this.noSleepVideo.setAttribute("muted",""),this.noSleepVideo.setAttribute("title","No Sleep"),this.noSleepVideo.setAttribute("playsinline",""),this._addSourceToVideo(this.noSleepVideo,"webm",o),this._addSourceToVideo(this.noSleepVideo,"mp4",s),this.noSleepVideo.addEventListener("loadedmetadata",function(){e.noSleepVideo.duration<=1?e.noSleepVideo.setAttribute("loop",""):e.noSleepVideo.addEventListener("timeupdate",function(){.5<e.noSleepVideo.currentTime&&(e.noSleepVideo.currentTime=Math.random())})}))}e.exports=u},function(e,t,i){e.exports={webm:"data:video/webm;base64,GkXfo0AgQoaBAUL3gQFC8oEEQvOBCEKCQAR3ZWJtQoeBAkKFgQIYU4BnQI0VSalmQCgq17FAAw9CQE2AQAZ3aGFtbXlXQUAGd2hhbW15RIlACECPQAAAAAAAFlSua0AxrkAu14EBY8WBAZyBACK1nEADdW5khkAFVl9WUDglhohAA1ZQOIOBAeBABrCBCLqBCB9DtnVAIueBAKNAHIEAAIAwAQCdASoIAAgAAUAmJaQAA3AA/vz0AAA=",mp4:"data:video/mp4;base64,AAAAIGZ0eXBtcDQyAAACAGlzb21pc28yYXZjMW1wNDEAAAAIZnJlZQAACKBtZGF0AAAC8wYF///v3EXpvebZSLeWLNgg2SPu73gyNjQgLSBjb3JlIDE0MiByMjQ3OSBkZDc5YTYxIC0gSC4yNjQvTVBFRy00IEFWQyBjb2RlYyAtIENvcHlsZWZ0IDIwMDMtMjAxNCAtIGh0dHA6Ly93d3cudmlkZW9sYW4ub3JnL3gyNjQuaHRtbCAtIG9wdGlvbnM6IGNhYmFjPTEgcmVmPTEgZGVibG9jaz0xOjA6MCBhbmFseXNlPTB4MToweDExMSBtZT1oZXggc3VibWU9MiBwc3k9MSBwc3lfcmQ9MS4wMDowLjAwIG1peGVkX3JlZj0wIG1lX3JhbmdlPTE2IGNocm9tYV9tZT0xIHRyZWxsaXM9MCA4eDhkY3Q9MCBjcW09MCBkZWFkem9uZT0yMSwxMSBmYXN0X3Bza2lwPTEgY2hyb21hX3FwX29mZnNldD0wIHRocmVhZHM9NiBsb29rYWhlYWRfdGhyZWFkcz0xIHNsaWNlZF90aHJlYWRzPTAgbnI9MCBkZWNpbWF0ZT0xIGludGVybGFjZWQ9MCBibHVyYXlfY29tcGF0PTAgY29uc3RyYWluZWRfaW50cmE9MCBiZnJhbWVzPTMgYl9weXJhbWlkPTIgYl9hZGFwdD0xIGJfYmlhcz0wIGRpcmVjdD0xIHdlaWdodGI9MSBvcGVuX2dvcD0wIHdlaWdodHA9MSBrZXlpbnQ9MzAwIGtleWludF9taW49MzAgc2NlbmVjdXQ9NDAgaW50cmFfcmVmcmVzaD0wIHJjX2xvb2thaGVhZD0xMCByYz1jcmYgbWJ0cmVlPTEgY3JmPTIwLjAgcWNvbXA9MC42MCBxcG1pbj0wIHFwbWF4PTY5IHFwc3RlcD00IHZidl9tYXhyYXRlPTIwMDAwIHZidl9idWZzaXplPTI1MDAwIGNyZl9tYXg9MC4wIG5hbF9ocmQ9bm9uZSBmaWxsZXI9MCBpcF9yYXRpbz0xLjQwIGFxPTE6MS4wMACAAAAAOWWIhAA3//p+C7v8tDDSTjf97w55i3SbRPO4ZY+hkjD5hbkAkL3zpJ6h/LR1CAABzgB1kqqzUorlhQAAAAxBmiQYhn/+qZYADLgAAAAJQZ5CQhX/AAj5IQADQGgcIQADQGgcAAAACQGeYUQn/wALKCEAA0BoHAAAAAkBnmNEJ/8ACykhAANAaBwhAANAaBwAAAANQZpoNExDP/6plgAMuSEAA0BoHAAAAAtBnoZFESwr/wAI+SEAA0BoHCEAA0BoHAAAAAkBnqVEJ/8ACykhAANAaBwAAAAJAZ6nRCf/AAsoIQADQGgcIQADQGgcAAAADUGarDRMQz/+qZYADLghAANAaBwAAAALQZ7KRRUsK/8ACPkhAANAaBwAAAAJAZ7pRCf/AAsoIQADQGgcIQADQGgcAAAACQGe60Qn/wALKCEAA0BoHAAAAA1BmvA0TEM//qmWAAy5IQADQGgcIQADQGgcAAAAC0GfDkUVLCv/AAj5IQADQGgcAAAACQGfLUQn/wALKSEAA0BoHCEAA0BoHAAAAAkBny9EJ/8ACyghAANAaBwAAAANQZs0NExDP/6plgAMuCEAA0BoHAAAAAtBn1JFFSwr/wAI+SEAA0BoHCEAA0BoHAAAAAkBn3FEJ/8ACyghAANAaBwAAAAJAZ9zRCf/AAsoIQADQGgcIQADQGgcAAAADUGbeDRMQz/+qZYADLkhAANAaBwAAAALQZ+WRRUsK/8ACPghAANAaBwhAANAaBwAAAAJAZ+1RCf/AAspIQADQGgcAAAACQGft0Qn/wALKSEAA0BoHCEAA0BoHAAAAA1Bm7w0TEM//qmWAAy4IQADQGgcAAAAC0Gf2kUVLCv/AAj5IQADQGgcAAAACQGf+UQn/wALKCEAA0BoHCEAA0BoHAAAAAkBn/tEJ/8ACykhAANAaBwAAAANQZvgNExDP/6plgAMuSEAA0BoHCEAA0BoHAAAAAtBnh5FFSwr/wAI+CEAA0BoHAAAAAkBnj1EJ/8ACyghAANAaBwhAANAaBwAAAAJAZ4/RCf/AAspIQADQGgcAAAADUGaJDRMQz/+qZYADLghAANAaBwAAAALQZ5CRRUsK/8ACPkhAANAaBwhAANAaBwAAAAJAZ5hRCf/AAsoIQADQGgcAAAACQGeY0Qn/wALKSEAA0BoHCEAA0BoHAAAAA1Bmmg0TEM//qmWAAy5IQADQGgcAAAAC0GehkUVLCv/AAj5IQADQGgcIQADQGgcAAAACQGepUQn/wALKSEAA0BoHAAAAAkBnqdEJ/8ACyghAANAaBwAAAANQZqsNExDP/6plgAMuCEAA0BoHCEAA0BoHAAAAAtBnspFFSwr/wAI+SEAA0BoHAAAAAkBnulEJ/8ACyghAANAaBwhAANAaBwAAAAJAZ7rRCf/AAsoIQADQGgcAAAADUGa8DRMQz/+qZYADLkhAANAaBwhAANAaBwAAAALQZ8ORRUsK/8ACPkhAANAaBwAAAAJAZ8tRCf/AAspIQADQGgcIQADQGgcAAAACQGfL0Qn/wALKCEAA0BoHAAAAA1BmzQ0TEM//qmWAAy4IQADQGgcAAAAC0GfUkUVLCv/AAj5IQADQGgcIQADQGgcAAAACQGfcUQn/wALKCEAA0BoHAAAAAkBn3NEJ/8ACyghAANAaBwhAANAaBwAAAANQZt4NExC//6plgAMuSEAA0BoHAAAAAtBn5ZFFSwr/wAI+CEAA0BoHCEAA0BoHAAAAAkBn7VEJ/8ACykhAANAaBwAAAAJAZ+3RCf/AAspIQADQGgcAAAADUGbuzRMQn/+nhAAYsAhAANAaBwhAANAaBwAAAAJQZ/aQhP/AAspIQADQGgcAAAACQGf+UQn/wALKCEAA0BoHCEAA0BoHCEAA0BoHCEAA0BoHCEAA0BoHCEAA0BoHAAACiFtb292AAAAbG12aGQAAAAA1YCCX9WAgl8AAAPoAAAH/AABAAABAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAAGGlvZHMAAAAAEICAgAcAT////v7/AAAF+XRyYWsAAABcdGtoZAAAAAPVgIJf1YCCXwAAAAEAAAAAAAAH0AAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAygAAAMoAAAAAACRlZHRzAAAAHGVsc3QAAAAAAAAAAQAAB9AAABdwAAEAAAAABXFtZGlhAAAAIG1kaGQAAAAA1YCCX9WAgl8AAV+QAAK/IFXEAAAAAAAtaGRscgAAAAAAAAAAdmlkZQAAAAAAAAAAAAAAAFZpZGVvSGFuZGxlcgAAAAUcbWluZgAAABR2bWhkAAAAAQAAAAAAAAAAAAAAJGRpbmYAAAAcZHJlZgAAAAAAAAABAAAADHVybCAAAAABAAAE3HN0YmwAAACYc3RzZAAAAAAAAAABAAAAiGF2YzEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAygDKAEgAAABIAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY//8AAAAyYXZjQwFNQCj/4QAbZ01AKOyho3ySTUBAQFAAAAMAEAAr8gDxgxlgAQAEaO+G8gAAABhzdHRzAAAAAAAAAAEAAAA8AAALuAAAABRzdHNzAAAAAAAAAAEAAAABAAAB8GN0dHMAAAAAAAAAPAAAAAEAABdwAAAAAQAAOpgAAAABAAAXcAAAAAEAAAAAAAAAAQAAC7gAAAABAAA6mAAAAAEAABdwAAAAAQAAAAAAAAABAAALuAAAAAEAADqYAAAAAQAAF3AAAAABAAAAAAAAAAEAAAu4AAAAAQAAOpgAAAABAAAXcAAAAAEAAAAAAAAAAQAAC7gAAAABAAA6mAAAAAEAABdwAAAAAQAAAAAAAAABAAALuAAAAAEAADqYAAAAAQAAF3AAAAABAAAAAAAAAAEAAAu4AAAAAQAAOpgAAAABAAAXcAAAAAEAAAAAAAAAAQAAC7gAAAABAAA6mAAAAAEAABdwAAAAAQAAAAAAAAABAAALuAAAAAEAADqYAAAAAQAAF3AAAAABAAAAAAAAAAEAAAu4AAAAAQAAOpgAAAABAAAXcAAAAAEAAAAAAAAAAQAAC7gAAAABAAA6mAAAAAEAABdwAAAAAQAAAAAAAAABAAALuAAAAAEAADqYAAAAAQAAF3AAAAABAAAAAAAAAAEAAAu4AAAAAQAAOpgAAAABAAAXcAAAAAEAAAAAAAAAAQAAC7gAAAABAAA6mAAAAAEAABdwAAAAAQAAAAAAAAABAAALuAAAAAEAAC7gAAAAAQAAF3AAAAABAAAAAAAAABxzdHNjAAAAAAAAAAEAAAABAAAAAQAAAAEAAAEEc3RzegAAAAAAAAAAAAAAPAAAAzQAAAAQAAAADQAAAA0AAAANAAAAEQAAAA8AAAANAAAADQAAABEAAAAPAAAADQAAAA0AAAARAAAADwAAAA0AAAANAAAAEQAAAA8AAAANAAAADQAAABEAAAAPAAAADQAAAA0AAAARAAAADwAAAA0AAAANAAAAEQAAAA8AAAANAAAADQAAABEAAAAPAAAADQAAAA0AAAARAAAADwAAAA0AAAANAAAAEQAAAA8AAAANAAAADQAAABEAAAAPAAAADQAAAA0AAAARAAAADwAAAA0AAAANAAAAEQAAAA8AAAANAAAADQAAABEAAAANAAAADQAAAQBzdGNvAAAAAAAAADwAAAAwAAADZAAAA3QAAAONAAADoAAAA7kAAAPQAAAD6wAAA/4AAAQXAAAELgAABEMAAARcAAAEbwAABIwAAAShAAAEugAABM0AAATkAAAE/wAABRIAAAUrAAAFQgAABV0AAAVwAAAFiQAABaAAAAW1AAAFzgAABeEAAAX+AAAGEwAABiwAAAY/AAAGVgAABnEAAAaEAAAGnQAABrQAAAbPAAAG4gAABvUAAAcSAAAHJwAAB0AAAAdTAAAHcAAAB4UAAAeeAAAHsQAAB8gAAAfjAAAH9gAACA8AAAgmAAAIQQAACFQAAAhnAAAIhAAACJcAAAMsdHJhawAAAFx0a2hkAAAAA9WAgl/VgIJfAAAAAgAAAAAAAAf8AAAAAAAAAAAAAAABAQAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAACsm1kaWEAAAAgbWRoZAAAAADVgIJf1YCCXwAArEQAAWAAVcQAAAAAACdoZGxyAAAAAAAAAABzb3VuAAAAAAAAAAAAAAAAU3RlcmVvAAAAAmNtaW5mAAAAEHNtaGQAAAAAAAAAAAAAACRkaW5mAAAAHGRyZWYAAAAAAAAAAQAAAAx1cmwgAAAAAQAAAidzdGJsAAAAZ3N0c2QAAAAAAAAAAQAAAFdtcDRhAAAAAAAAAAEAAAAAAAAAAAACABAAAAAArEQAAAAAADNlc2RzAAAAAAOAgIAiAAIABICAgBRAFQAAAAADDUAAAAAABYCAgAISEAaAgIABAgAAABhzdHRzAAAAAAAAAAEAAABYAAAEAAAAABxzdHNjAAAAAAAAAAEAAAABAAAAAQAAAAEAAAAUc3RzegAAAAAAAAAGAAAAWAAAAXBzdGNvAAAAAAAAAFgAAAOBAAADhwAAA5oAAAOtAAADswAAA8oAAAPfAAAD5QAAA/gAAAQLAAAEEQAABCgAAAQ9AAAEUAAABFYAAARpAAAEgAAABIYAAASbAAAErgAABLQAAATHAAAE3gAABPMAAAT5AAAFDAAABR8AAAUlAAAFPAAABVEAAAVXAAAFagAABX0AAAWDAAAFmgAABa8AAAXCAAAFyAAABdsAAAXyAAAF+AAABg0AAAYgAAAGJgAABjkAAAZQAAAGZQAABmsAAAZ+AAAGkQAABpcAAAauAAAGwwAABskAAAbcAAAG7wAABwYAAAcMAAAHIQAABzQAAAc6AAAHTQAAB2QAAAdqAAAHfwAAB5IAAAeYAAAHqwAAB8IAAAfXAAAH3QAAB/AAAAgDAAAICQAACCAAAAg1AAAIOwAACE4AAAhhAAAIeAAACH4AAAiRAAAIpAAACKoAAAiwAAAItgAACLwAAAjCAAAAFnVkdGEAAAAObmFtZVN0ZXJlbwAAAHB1ZHRhAAAAaG1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAAO2lsc3QAAAAzqXRvbwAAACtkYXRhAAAAAQAAAABIYW5kQnJha2UgMC4xMC4yIDIwMTUwNjExMDA="}}],r.c=n,r.d=function(e,t,i){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:i})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0);function r(e){if(n[e])return n[e].exports;var t=n[e]={i:e,l:!1,exports:{}};return i[e].call(t.exports,t,t.exports,r),t.l=!0,t.exports}var i,n},Pcy.NoSleep=Qcy();var NoSleep=tmp$c.NoSleep;function ClockViewModel(t){defined(t)||(t=new Clock),this._clock=t,this._eventHelper=new EventHelper,this._eventHelper.add(t.onTick,this.synchronize,this),this.systemTime=knockout.observable(JulianDate.now()),this.systemTime.equalityComparer=JulianDate.equals,this.startTime=knockout.observable(t.startTime),this.startTime.equalityComparer=JulianDate.equals,this.startTime.subscribe(function(e){t.startTime=e,this.synchronize()},this),this.stopTime=knockout.observable(t.stopTime),this.stopTime.equalityComparer=JulianDate.equals,this.stopTime.subscribe(function(e){t.stopTime=e,this.synchronize()},this),this.currentTime=knockout.observable(t.currentTime),this.currentTime.equalityComparer=JulianDate.equals,this.currentTime.subscribe(function(e){t.currentTime=e,this.synchronize()},this),this.multiplier=knockout.observable(t.multiplier),this.multiplier.subscribe(function(e){t.multiplier=e,this.synchronize()},this),this.clockStep=knockout.observable(t.clockStep),this.clockStep.subscribe(function(e){t.clockStep=e,this.synchronize()},this),this.clockRange=knockout.observable(t.clockRange),this.clockRange.subscribe(function(e){t.clockRange=e,this.synchronize()},this),this.canAnimate=knockout.observable(t.canAnimate),this.canAnimate.subscribe(function(e){t.canAnimate=e,this.synchronize()},this),this.shouldAnimate=knockout.observable(t.shouldAnimate),this.shouldAnimate.subscribe(function(e){t.shouldAnimate=e,this.synchronize()},this),knockout.track(this,["systemTime","startTime","stopTime","currentTime","multiplier","clockStep","clockRange","canAnimate","shouldAnimate"])}function Command(){this.canExecute=void 0,this.beforeExecute=void 0,this.afterExecute=void 0,DeveloperError.throwInstantiationError()}function createCommand$2(i,e){e=defaultValue(e,!0);var r=new Event,n=new Event;function t(){var e,t={args:arguments,cancel:!1};return r.raiseEvent(t),t.cancel||(e=i.apply(null,arguments),n.raiseEvent(e)),e}return t.canExecute=e,knockout.track(t,["canExecute"]),Object.defineProperties(t,{beforeExecute:{value:r},afterExecute:{value:n}}),t}Object.defineProperties(ClockViewModel.prototype,{clock:{get:function(){return this._clock}}}),ClockViewModel.prototype.synchronize=function(){var e=this._clock;this.systemTime=JulianDate.now(),this.startTime=e.startTime,this.stopTime=e.stopTime,this.currentTime=e.currentTime,this.multiplier=e.multiplier,this.clockStep=e.clockStep,this.clockRange=e.clockRange,this.canAnimate=e.canAnimate,this.shouldAnimate=e.shouldAnimate},ClockViewModel.prototype.isDestroyed=function(){return!1},ClockViewModel.prototype.destroy=function(){this._eventHelper.removeAll(),destroyObject(this)};var InspectorShared={};function subscribeAndEvaluate(e,t,i,r,n){return i.call(r,e[t]),knockout.getObservable(e,t).subscribe(i,r,n)}function ToggleButtonViewModel(e,t){this._command=e,t=defaultValue(t,defaultValue.EMPTY_OBJECT),this.toggled=defaultValue(t.toggled,!1),this.tooltip=defaultValue(t.tooltip,""),knockout.track(this,["toggled","tooltip"])}InspectorShared.createCheckbox=function(e,t,i){var r=document.createElement("div"),n=document.createElement("label"),a=document.createElement("input");a.type="checkbox";var o="checked: "+t;return defined(i)&&(o+=", enable: "+i),a.setAttribute("data-bind",o),n.appendChild(a),n.appendChild(document.createTextNode(e)),r.appendChild(n),r},InspectorShared.createSection=function(e,t,i,r){var n=document.createElement("div");n.className="cesium-cesiumInspector-section",n.setAttribute("data-bind",'css: { "cesium-cesiumInspector-section-collapsed": !'+i+" }"),e.appendChild(n);var a=document.createElement("h3");a.className="cesium-cesiumInspector-sectionHeader",a.appendChild(document.createTextNode(t)),a.setAttribute("data-bind","click: "+r),n.appendChild(a);var o=document.createElement("div");return o.className="cesium-cesiumInspector-sectionContent",n.appendChild(o),o},Object.defineProperties(ToggleButtonViewModel.prototype,{command:{get:function(){return this._command}}});var createFragmentFromTemplate=function(e){var t=document.createElement("div");t.innerHTML=e;for(var i=document.createDocumentFragment();t.firstChild;)i.appendChild(t.firstChild);return i},Knockout=knockout,loadView=function(e,t,i){t=getElement(t);var r,n=createFragmentFromTemplate(e),a=[];for(r=0;r<n.childNodes.length;++r)a.push(n.childNodes[r]);for(t.appendChild(n),r=0;r<a.length;++r){var o=a[r];1!==o.nodeType&&8!==o.nodeType||Knockout.applyBindings(i,o)}return a},Knockout$1=knockout,DistanceLegendViewModel=function(e){if(!defined(e)||!defined(e.terria))throw new DeveloperError("options.terria is required.");this.terria=e.terria,this._removeSubscription=void 0,this._lastLegendUpdate=void 0,this.eventHelper=new EventHelper,this.distanceLabel=void 0,this.barWidth=void 0,this.enableDistanceLegend=!defined(e.enableDistanceLegend)||e.enableDistanceLegend,Knockout$1.track(this,["distanceLabel","barWidth"]),this.eventHelper.add(this.terria.afterWidgetChanged,function(){defined(this._removeSubscription)&&(this._removeSubscription(),this._removeSubscription=void 0)},this);var t=this;function i(){if(defined(t.terria)){var e=t.terria.scene;t._removeSubscription=e.postRender.addEventListener(function(){updateDistanceLegendCesium(this,e)},t)}}i(),this.eventHelper.add(this.terria.afterWidgetChanged,function(){i()},this)};DistanceLegendViewModel.prototype.destroy=function(){this.eventHelper.removeAll()},DistanceLegendViewModel.prototype.show=function(e){var t;t=this.enableDistanceLegend?'<div class="distance-legend" data-bind="visible: distanceLabel && barWidth"><div class="distance-legend-label" data-bind="text: distanceLabel"></div><div class="distance-legend-scale-bar" data-bind="style: { width: barWidth + \'px\', left: (5 + (125 - barWidth) / 2) + \'px\' }"></div></div>':'<div class="distance-legend" style="display: none;" data-bind="visible: distanceLabel && barWidth"><div class="distance-legend-label" data-bind="text: distanceLabel"></div><div class="distance-legend-scale-bar" data-bind="style: { width: barWidth + \'px\', left: (5 + (125 - barWidth) / 2) + \'px\' }"></div></div>',loadView(t,e,this)},DistanceLegendViewModel.create=function(e){var t=new DistanceLegendViewModel(e);return t.show(e.container),t};var geodesic=new EllipsoidGeodesic,distances$1=[1,2,3,5,10,20,30,50,100,200,300,500,1e3,2e3,3e3,5e3,1e4,2e4,3e4,5e4,1e5,2e5,3e5,5e5,1e6,2e6,3e6,5e6,1e7,2e7,3e7,5e7];function updateDistanceLegendCesium(e,t){if(!e.enableDistanceLegend)return e.barWidth=void 0,void(e.distanceLabel=void 0);var i=getTimestamp$1();if(!(i<e._lastLegendUpdate+250)){e._lastLegendUpdate=i;var r=t.canvas.clientWidth,n=t.canvas.clientHeight,a=t.camera.getPickRay(new Cartesian2(r/2|0,n-1)),o=t.camera.getPickRay(new Cartesian2(1+r/2|0,n-1)),s=t.globe,l=s.pick(a,t),u=s.pick(o,t);if(!defined(l)||!defined(u))return e.barWidth=void 0,void(e.distanceLabel=void 0);var c=s.ellipsoid.cartesianToCartographic(l),d=s.ellipsoid.cartesianToCartographic(u);geodesic.setEndPoints(c,d);for(var h,p,f=geodesic.surfaceDistance,m=distances$1.length-1;!defined(h)&&0<=m;--m)distances$1[m]/f<100&&(h=distances$1[m]);if(defined(h))p=1e3<=h?(h/1e3).toString()+" km":h.toString()+" m",e.barWidth=h/f|0,e.distanceLabel=p;else e.barWidth=void 0,e.distanceLabel=void 0}}var svgReset="M 7.5,0 C 3.375,0 0,3.375 0,7.5 0,11.625 3.375,15 7.5,15 c 3.46875,0 6.375,-2.4375 7.21875,-5.625 l -1.96875,0 C 12,11.53125 9.9375,13.125 7.5,13.125 4.40625,13.125 1.875,10.59375 1.875,7.5 1.875,4.40625 4.40625,1.875 7.5,1.875 c 1.59375,0 2.90625,0.65625 3.9375,1.6875 l -3,3 6.5625,0 L 15,0 12.75,2.25 C 11.4375,0.84375 9.5625,0 7.5,0 z",Knockout$2=knockout,UserInterfaceControl=function(e){if(!defined(e))throw new DeveloperError("terria is required");this._terria=e,this.name="Unnamed Control",this.text=void 0,this.svgIcon=void 0,this.svgHeight=void 0,this.svgWidth=void 0,this.cssClass=void 0,this.isActive=!1,Knockout$2.track(this,["name","svgIcon","svgHeight","svgWidth","cssClass","isActive"])};Object.defineProperties(UserInterfaceControl.prototype,{terria:{get:function(){return this._terria}},hasText:{get:function(){return defined(this.text)&&"string"==typeof this.text}}}),UserInterfaceControl.prototype.activate=function(){throw new DeveloperError("activate must be implemented in the derived class.")};var NavigationControl=function(e){UserInterfaceControl.apply(this,arguments)};NavigationControl.prototype=Object.create(UserInterfaceControl.prototype);var ResetViewNavigationControl=function(e){NavigationControl.apply(this,arguments),this.name="重置视图",this.navigationLocked=!1,this.svgIcon=svgReset,this.svgHeight=15,this.svgWidth=15,this.cssClass="navigation-control-icon-reset"};ResetViewNavigationControl.prototype=Object.create(NavigationControl.prototype),ResetViewNavigationControl.prototype.setNavigationLocked=function(e){this.navigationLocked=e},ResetViewNavigationControl.prototype.resetView=function(){if(!this.navigationLocked){var e=this.terria.scene;if(e.screenSpaceCameraController.enableInputs){this.isActive=!0;var t=e.camera;if(defined(this.terria.trackedEntity)){var i=this.terria.trackedEntity;this.terria.trackedEntity=void 0,this.terria.trackedEntity=i}else if(this.terria.options.defaultResetView){if(this.terria.options.defaultResetView&&this.terria.options.defaultResetView instanceof Cartographic)t.flyTo({destination:e.globe.ellipsoid.cartographicToCartesian(this.terria.options.defaultResetView)});else if(this.terria.options.defaultResetView&&this.terria.options.defaultResetView instanceof Rectangle)try{Rectangle.validate(this.terria.options.defaultResetView),t.flyTo({destination:this.terria.options.defaultResetView})}catch(e){console.log("Cesium-navigation/ResetViewNavigationControl: options.defaultResetView Cesium rectangle is invalid!")}}else"function"==typeof t.flyHome?t.flyHome(1):t.flyTo({destination:Camera.DEFAULT_VIEW_RECTANGLE,duration:1});this.isActive=!1}}},ResetViewNavigationControl.prototype.activate=function(){this.resetView()};var NavigationUtils={},unprojectedScratch=new Cartographic,rayScratch$1=new Ray;NavigationUtils.getCameraFocus=function(e,t,i){var r=e.scene,n=r.camera;if(r.mode!==SceneMode$1.MORPHING&&(defined(i)||(i=new Cartesian3),defined(i=defined(e.trackedEntity)?e.trackedEntity.position.getValue(e.clock.currentTime,i):(rayScratch$1.origin=n.positionWC,rayScratch$1.direction=n.directionWC,r.globe.pick(rayScratch$1,r,i)))))return r.mode===SceneMode$1.SCENE2D||r.mode===SceneMode$1.COLUMBUS_VIEW?(i=n.worldToCameraCoordinatesPoint(i,i),t&&(i=r.globe.ellipsoid.cartographicToCartesian(r.mapProjection.unproject(i,unprojectedScratch),i))):t||(i=n.worldToCameraCoordinatesPoint(i,i)),i};var ZoomNavigationControl=function(e,t){NavigationControl.apply(this,arguments),this.name="Zoom "+(t?"In":"Out"),this.text=t?"+":"-",this.cssClass="navigation-control-icon-zoom-"+(t?"in":"out"),this.relativeAmount=2,t&&(this.relativeAmount=1/this.relativeAmount)};ZoomNavigationControl.prototype.relativeAmount=1,ZoomNavigationControl.prototype=Object.create(NavigationControl.prototype),ZoomNavigationControl.prototype.activate=function(){this.zoom(this.relativeAmount)};var cartesian3Scratch$3=new Cartesian3;ZoomNavigationControl.prototype.zoom=function(e){if(this.isActive=!0,defined(this.terria)){var t=this.terria.scene,i=t.screenSpaceCameraController;if(!i.enableInputs||!i.enableZoom)return;var r,n=t.camera;switch(t.mode){case SceneMode$1.MORPHING:break;case SceneMode$1.SCENE2D:n.zoomIn(n.positionCartographic.height*(1-this.relativeAmount));break;default:var a;if(defined(a=defined(this.terria.trackedEntity)?new Cartesian3:NavigationUtils.getCameraFocus(this.terria,!1)))r={direction:n.direction,up:n.up};else{var o=new Ray(n.worldToCameraCoordinatesPoint(t.globe.ellipsoid.cartographicToCartesian(n.positionCartographic)),n.directionWC);a=IntersectionTests.grazingAltitudeLocation(o,t.globe.ellipsoid),r={heading:n.heading,pitch:n.pitch,roll:n.roll}}var s=Cartesian3.subtract(n.position,a,cartesian3Scratch$3),l=Cartesian3.multiplyByScalar(s,e,s),u=Cartesian3.add(a,l,a);if(defined(this.terria.trackedEntity)||t.mode===SceneMode$1.COLUMBUS_VIEW)n.position=u;else{if(.5===e&&!1===Geoworld.defaultValue(n.undergroundMode,!1)&&n.positionCartographic.height<1)return;n.flyTo({destination:u,orientation:r,duration:.5,convert:!1})}}}this.isActive=!1};var svgCompassOuterRing="m 66.5625,0 0,15.15625 3.71875,0 0,-10.40625 5.5,10.40625 4.375,0 0,-15.15625 -3.71875,0 0,10.40625 L 70.9375,0 66.5625,0 z M 72.5,20.21875 c -28.867432,0 -52.28125,23.407738 -52.28125,52.28125 0,28.87351 23.413818,52.3125 52.28125,52.3125 28.86743,0 52.28125,-23.43899 52.28125,-52.3125 0,-28.873512 -23.41382,-52.28125 -52.28125,-52.28125 z m 0,1.75 c 13.842515,0 26.368948,5.558092 35.5,14.5625 l -11.03125,11 0.625,0.625 11.03125,-11 c 8.9199,9.108762 14.4375,21.579143 14.4375,35.34375 0,13.764606 -5.5176,26.22729 -14.4375,35.34375 l -11.03125,-11 -0.625,0.625 11.03125,11 c -9.130866,9.01087 -21.658601,14.59375 -35.5,14.59375 -13.801622,0 -26.321058,-5.53481 -35.4375,-14.5 l 11.125,-11.09375 c 6.277989,6.12179 14.857796,9.90625 24.3125,9.90625 19.241896,0 34.875,-15.629154 34.875,-34.875 0,-19.245847 -15.633104,-34.84375 -34.875,-34.84375 -9.454704,0 -18.034511,3.760884 -24.3125,9.875 L 37.0625,36.4375 C 46.179178,27.478444 58.696991,21.96875 72.5,21.96875 z m -0.875,0.84375 0,13.9375 1.75,0 0,-13.9375 -1.75,0 z M 36.46875,37.0625 47.5625,48.15625 C 41.429794,54.436565 37.65625,63.027539 37.65625,72.5 c 0,9.472461 3.773544,18.055746 9.90625,24.34375 L 36.46875,107.9375 c -8.96721,-9.1247 -14.5,-21.624886 -14.5,-35.4375 0,-13.812615 5.53279,-26.320526 14.5,-35.4375 z M 72.5,39.40625 c 18.297686,0 33.125,14.791695 33.125,33.09375 0,18.302054 -14.827314,33.125 -33.125,33.125 -18.297687,0 -33.09375,-14.822946 -33.09375,-33.125 0,-18.302056 14.796063,-33.09375 33.09375,-33.09375 z M 22.84375,71.625 l 0,1.75 13.96875,0 0,-1.75 -13.96875,0 z m 85.5625,0 0,1.75 14,0 0,-1.75 -14,0 z M 71.75,108.25 l 0,13.9375 1.71875,0 0,-13.9375 -1.71875,0 z",svgCompassGyro="m 72.71875,54.375 c -0.476702,0 -0.908208,0.245402 -1.21875,0.5625 -0.310542,0.317098 -0.551189,0.701933 -0.78125,1.1875 -0.172018,0.363062 -0.319101,0.791709 -0.46875,1.25 -6.91615,1.075544 -12.313231,6.656514 -13,13.625 -0.327516,0.117495 -0.661877,0.244642 -0.9375,0.375 -0.485434,0.22959 -0.901634,0.471239 -1.21875,0.78125 -0.317116,0.310011 -0.5625,0.742111 -0.5625,1.21875 l 0.03125,0 c 0,0.476639 0.245384,0.877489 0.5625,1.1875 0.317116,0.310011 0.702066,0.58291 1.1875,0.8125 0.35554,0.168155 0.771616,0.32165 1.21875,0.46875 1.370803,6.10004 6.420817,10.834127 12.71875,11.8125 0.146999,0.447079 0.30025,0.863113 0.46875,1.21875 0.230061,0.485567 0.470708,0.870402 0.78125,1.1875 0.310542,0.317098 0.742048,0.5625 1.21875,0.5625 0.476702,0 0.876958,-0.245402 1.1875,-0.5625 0.310542,-0.317098 0.582439,-0.701933 0.8125,-1.1875 0.172018,-0.363062 0.319101,-0.791709 0.46875,-1.25 6.249045,-1.017063 11.256351,-5.7184 12.625,-11.78125 0.447134,-0.1471 0.86321,-0.300595 1.21875,-0.46875 0.485434,-0.22959 0.901633,-0.502489 1.21875,-0.8125 0.317117,-0.310011 0.5625,-0.710861 0.5625,-1.1875 l -0.03125,0 c 0,-0.476639 -0.245383,-0.908739 -0.5625,-1.21875 C 89.901633,71.846239 89.516684,71.60459 89.03125,71.375 88.755626,71.244642 88.456123,71.117495 88.125,71 87.439949,64.078341 82.072807,58.503735 75.21875,57.375 c -0.15044,-0.461669 -0.326927,-0.884711 -0.5,-1.25 -0.230061,-0.485567 -0.501958,-0.870402 -0.8125,-1.1875 -0.310542,-0.317098 -0.710798,-0.5625 -1.1875,-0.5625 z m -0.0625,1.40625 c 0.03595,-0.01283 0.05968,0 0.0625,0 0.0056,0 0.04321,-0.02233 0.1875,0.125 0.144288,0.147334 0.34336,0.447188 0.53125,0.84375 0.06385,0.134761 0.123901,0.309578 0.1875,0.46875 -0.320353,-0.01957 -0.643524,-0.0625 -0.96875,-0.0625 -0.289073,0 -0.558569,0.04702 -0.84375,0.0625 C 71.8761,57.059578 71.936151,56.884761 72,56.75 c 0.18789,-0.396562 0.355712,-0.696416 0.5,-0.84375 0.07214,-0.07367 0.120304,-0.112167 0.15625,-0.125 z m 0,2.40625 c 0.448007,0 0.906196,0.05436 1.34375,0.09375 0.177011,0.592256 0.347655,1.271044 0.5,2.03125 0.475097,2.370753 0.807525,5.463852 0.9375,8.9375 -0.906869,-0.02852 -1.834463,-0.0625 -2.78125,-0.0625 -0.92298,0 -1.802327,0.03537 -2.6875,0.0625 0.138529,-3.473648 0.493653,-6.566747 0.96875,-8.9375 0.154684,-0.771878 0.320019,-1.463985 0.5,-2.0625 0.405568,-0.03377 0.804291,-0.0625 1.21875,-0.0625 z m -2.71875,0.28125 c -0.129732,0.498888 -0.259782,0.987558 -0.375,1.5625 -0.498513,2.487595 -0.838088,5.693299 -0.96875,9.25 -3.21363,0.15162 -6.119596,0.480068 -8.40625,0.9375 -0.682394,0.136509 -1.275579,0.279657 -1.84375,0.4375 0.799068,-6.135482 5.504716,-11.036454 11.59375,-12.1875 z M 75.5,58.5 c 6.043169,1.18408 10.705093,6.052712 11.5,12.15625 -0.569435,-0.155806 -1.200273,-0.302525 -1.875,-0.4375 -2.262525,-0.452605 -5.108535,-0.783809 -8.28125,-0.9375 -0.130662,-3.556701 -0.470237,-6.762405 -0.96875,-9.25 C 75.761959,59.467174 75.626981,58.990925 75.5,58.5 z m -2.84375,12.09375 c 0.959338,0 1.895843,0.03282 2.8125,0.0625 C 75.48165,71.267751 75.5,71.871028 75.5,72.5 c 0,1.228616 -0.01449,2.438313 -0.0625,3.59375 -0.897358,0.0284 -1.811972,0.0625 -2.75,0.0625 -0.927373,0 -1.831062,-0.03473 -2.71875,-0.0625 -0.05109,-1.155437 -0.0625,-2.365134 -0.0625,-3.59375 0,-0.628972 0.01741,-1.232249 0.03125,-1.84375 0.895269,-0.02827 1.783025,-0.0625 2.71875,-0.0625 z M 68.5625,70.6875 c -0.01243,0.60601 -0.03125,1.189946 -0.03125,1.8125 0,1.22431 0.01541,2.407837 0.0625,3.5625 -3.125243,-0.150329 -5.92077,-0.471558 -8.09375,-0.90625 -0.784983,-0.157031 -1.511491,-0.316471 -2.125,-0.5 -0.107878,-0.704096 -0.1875,-1.422089 -0.1875,-2.15625 0,-0.115714 0.02849,-0.228688 0.03125,-0.34375 0.643106,-0.20284 1.389577,-0.390377 2.25,-0.5625 2.166953,-0.433487 4.97905,-0.75541 8.09375,-0.90625 z m 8.3125,0.03125 c 3.075121,0.15271 5.824455,0.446046 7.96875,0.875 0.857478,0.171534 1.630962,0.360416 2.28125,0.5625 0.0027,0.114659 0,0.228443 0,0.34375 0,0.735827 -0.07914,1.450633 -0.1875,2.15625 -0.598568,0.180148 -1.29077,0.34562 -2.0625,0.5 -2.158064,0.431708 -4.932088,0.754666 -8.03125,0.90625 0.04709,-1.154663 0.0625,-2.33819 0.0625,-3.5625 0,-0.611824 -0.01924,-1.185379 -0.03125,-1.78125 z M 57.15625,72.5625 c 0.0023,0.572772 0.06082,1.131112 0.125,1.6875 -0.125327,-0.05123 -0.266577,-0.10497 -0.375,-0.15625 -0.396499,-0.187528 -0.665288,-0.387337 -0.8125,-0.53125 -0.147212,-0.143913 -0.15625,-0.182756 -0.15625,-0.1875 0,-0.0047 -0.02221,-0.07484 0.125,-0.21875 0.147212,-0.143913 0.447251,-0.312472 0.84375,-0.5 0.07123,-0.03369 0.171867,-0.06006 0.25,-0.09375 z m 31.03125,0 c 0.08201,0.03503 0.175941,0.05872 0.25,0.09375 0.396499,0.187528 0.665288,0.356087 0.8125,0.5 0.14725,0.14391 0.15625,0.21405 0.15625,0.21875 0,0.0047 -0.009,0.04359 -0.15625,0.1875 -0.147212,0.143913 -0.416001,0.343722 -0.8125,0.53125 -0.09755,0.04613 -0.233314,0.07889 -0.34375,0.125 0.06214,-0.546289 0.09144,-1.094215 0.09375,-1.65625 z m -29.5,3.625 c 0.479308,0.123125 0.983064,0.234089 1.53125,0.34375 2.301781,0.460458 5.229421,0.787224 8.46875,0.9375 0.167006,2.84339 0.46081,5.433176 0.875,7.5 0.115218,0.574942 0.245268,1.063612 0.375,1.5625 -5.463677,-1.028179 -9.833074,-5.091831 -11.25,-10.34375 z m 27.96875,0 C 85.247546,81.408945 80.919274,85.442932 75.5,86.5 c 0.126981,-0.490925 0.261959,-0.967174 0.375,-1.53125 0.41419,-2.066824 0.707994,-4.65661 0.875,-7.5 3.204493,-0.15162 6.088346,-0.480068 8.375,-0.9375 0.548186,-0.109661 1.051942,-0.220625 1.53125,-0.34375 z M 70.0625,77.53125 c 0.865391,0.02589 1.723666,0.03125 2.625,0.03125 0.912062,0 1.782843,-0.0048 2.65625,-0.03125 -0.165173,2.736408 -0.453252,5.207651 -0.84375,7.15625 -0.152345,0.760206 -0.322989,1.438994 -0.5,2.03125 -0.437447,0.03919 -0.895856,0.0625 -1.34375,0.0625 -0.414943,0 -0.812719,-0.02881 -1.21875,-0.0625 -0.177011,-0.592256 -0.347655,-1.271044 -0.5,-2.03125 -0.390498,-1.948599 -0.700644,-4.419842 -0.875,-7.15625 z m 1.75,10.28125 c 0.284911,0.01545 0.554954,0.03125 0.84375,0.03125 0.325029,0 0.648588,-0.01171 0.96875,-0.03125 -0.05999,0.148763 -0.127309,0.31046 -0.1875,0.4375 -0.18789,0.396562 -0.386962,0.696416 -0.53125,0.84375 -0.144288,0.147334 -0.181857,0.125 -0.1875,0.125 -0.0056,0 -0.07446,0.02233 -0.21875,-0.125 C 72.355712,88.946416 72.18789,88.646562 72,88.25 71.939809,88.12296 71.872486,87.961263 71.8125,87.8125 z",svgCompassRotationMarker="M 72.46875,22.03125 C 59.505873,22.050338 46.521615,27.004287 36.6875,36.875 L 47.84375,47.96875 C 61.521556,34.240041 83.442603,34.227389 97.125,47.90625 l 11.125,-11.125 C 98.401629,26.935424 85.431627,22.012162 72.46875,22.03125 z",Knockout$3=knockout,NavigationViewModel=function(e){this.terria=e.terria,this.eventHelper=new EventHelper,this.enableZoomControls=!defined(e.enableZoomControls)||e.enableZoomControls,this.enableCompass=!defined(e.enableCompass)||e.enableCompass,this.navigationLocked=!1,this.controls=e.controls,defined(this.controls)||(this.controls=[new ZoomNavigationControl(this.terria,!0),new ResetViewNavigationControl(this.terria),new ZoomNavigationControl(this.terria,!1)]),this.svgCompassOuterRing=svgCompassOuterRing,this.svgCompassGyro=svgCompassGyro,this.svgCompassRotationMarker=svgCompassRotationMarker,this.showCompass=defined(this.terria)&&this.enableCompass,this.heading=this.showCompass?this.terria.scene.camera.heading:0,this.isOrbiting=!1,this.orbitCursorAngle=0,this.orbitCursorOpacity=0,this.orbitLastTimestamp=0,this.orbitFrame=void 0,this.orbitIsLook=!1,this.orbitMouseMoveFunction=void 0,this.orbitMouseUpFunction=void 0,this.isRotating=!1,this.rotateInitialCursorAngle=void 0,this.rotateFrame=void 0,this.rotateIsLook=!1,this.rotateMouseMoveFunction=void 0,this.rotateMouseUpFunction=void 0,this._unsubcribeFromPostRender=void 0,Knockout$3.track(this,["controls","showCompass","heading","isOrbiting","orbitCursorAngle","isRotating"]);var t=this;function i(){defined(t.terria)?(t._unsubcribeFromPostRender&&(t._unsubcribeFromPostRender(),t._unsubcribeFromPostRender=void 0),t.showCompass=t.enableCompass,t._unsubcribeFromPostRender=t.terria.scene.postRender.addEventListener(function(){t.heading=t.terria.scene.camera.heading})):(t._unsubcribeFromPostRender&&(t._unsubcribeFromPostRender(),t._unsubcribeFromPostRender=void 0),t.showCompass=!1)}NavigationViewModel.prototype.setNavigationLocked=function(e){this.navigationLocked=e,this.controls&&1<this.controls.length&&this.controls[1].setNavigationLocked(this.navigationLocked)},this.eventHelper.add(this.terria.afterWidgetChanged,i,this),i()};NavigationViewModel.prototype.destroy=function(){this.eventHelper.removeAll()},NavigationViewModel.prototype.show=function(e){var t;this.enableZoomControls&&this.enableCompass?t='<div class="compass" title="" data-bind="visible: showCompass, event: { mousedown: handleMouseDown, dblclick: handleDoubleClick }"><div class="compass-outer-ring-background"></div>'+" <div class=\"compass-rotation-marker\" data-bind=\"visible: isOrbiting, style: { transform: 'rotate(-' + orbitCursorAngle + 'rad)', '-webkit-transform': 'rotate(-' + orbitCursorAngle + 'rad)', opacity: orbitCursorOpacity }, geoworldSvgPath: { path: svgCompassRotationMarker, width: 145, height: 145 }\"></div> <div class=\"compass-outer-ring\" title=\"\" data-bind=\"style: { transform: 'rotate(-' + heading + 'rad)', '-webkit-transform': 'rotate(-' + heading + 'rad)' }, geoworldSvgPath: { path: svgCompassOuterRing, width: 145, height: 145 }\"></div> <div class=\"compass-gyro-background\"></div> <div class=\"compass-gyro\" data-bind=\"geoworldSvgPath: { path: svgCompassGyro, width: 145, height: 145 }, css: { 'compass-gyro-active': isOrbiting }\"></div></div><div class=\"navigation-controls\">\x3c!-- ko foreach: controls --\x3e<div data-bind=\"click: activate, attr: { title: $data.name }, css: $root.isLastControl($data) ? 'navigation-control-last' : 'navigation-control' \"> \x3c!-- ko if: $data.hasText --\x3e <div data-bind=\"text: $data.text, css: $data.isActive ? 'navigation-control-icon-active ' + $data.cssClass : $data.cssClass\"></div> \x3c!-- /ko --\x3e \x3c!-- ko ifnot: $data.hasText --\x3e <div data-bind=\"geoworldSvgPath: { path: $data.svgIcon, width: $data.svgWidth, height: $data.svgHeight }, css: $data.isActive ? 'navigation-control-icon-active ' + $data.cssClass : $data.cssClass\"></div> \x3c!-- /ko --\x3e </div> \x3c!-- /ko --\x3e</div>":!this.enableZoomControls&&this.enableCompass?t='<div class="compass" title="" data-bind="visible: showCompass, event: { mousedown: handleMouseDown, dblclick: handleDoubleClick }"><div class="compass-outer-ring-background"></div> <div class="compass-rotation-marker" data-bind="visible: isOrbiting, style: { transform: \'rotate(-\' + orbitCursorAngle + \'rad)\', \'-webkit-transform\': \'rotate(-\' + orbitCursorAngle + \'rad)\', opacity: orbitCursorOpacity }, geoworldSvgPath: { path: svgCompassRotationMarker, width: 145, height: 145 }"></div> <div class="compass-outer-ring" title="" data-bind="style: { transform: \'rotate(-\' + heading + \'rad)\', \'-webkit-transform\': \'rotate(-\' + heading + \'rad)\' }, geoworldSvgPath: { path: svgCompassOuterRing, width: 145, height: 145 }"></div> <div class="compass-gyro-background"></div> <div class="compass-gyro" data-bind="geoworldSvgPath: { path: svgCompassGyro, width: 145, height: 145 }, css: { \'compass-gyro-active\': isOrbiting }"></div></div><div class="navigation-controls" style="display: none;" >\x3c!-- ko foreach: controls --\x3e<div data-bind="click: activate, attr: { title: $data.name }, css: $root.isLastControl($data) ? \'navigation-control-last\' : \'navigation-control\' "> \x3c!-- ko if: $data.hasText --\x3e <div data-bind="text: $data.text, css: $data.isActive ? \'navigation-control-icon-active \' + $data.cssClass : $data.cssClass"></div> \x3c!-- /ko --\x3e \x3c!-- ko ifnot: $data.hasText --\x3e <div data-bind="geoworldSvgPath: { path: $data.svgIcon, width: $data.svgWidth, height: $data.svgHeight }, css: $data.isActive ? \'navigation-control-icon-active \' + $data.cssClass : $data.cssClass"></div> \x3c!-- /ko --\x3e </div> \x3c!-- /ko --\x3e</div>':this.enableZoomControls&&!this.enableCompass?t='<div class="compass" style="display: none;" title="" data-bind="visible: showCompass, event: { mousedown: handleMouseDown, dblclick: handleDoubleClick }"><div class="compass-outer-ring-background"></div>'+" <div class=\"compass-rotation-marker\" data-bind=\"visible: isOrbiting, style: { transform: 'rotate(-' + orbitCursorAngle + 'rad)', '-webkit-transform': 'rotate(-' + orbitCursorAngle + 'rad)', opacity: orbitCursorOpacity }, geoworldSvgPath: { path: svgCompassRotationMarker, width: 145, height: 145 }\"></div> <div class=\"compass-outer-ring\" title=\"\" data-bind=\"style: { transform: 'rotate(-' + heading + 'rad)', '-webkit-transform': 'rotate(-' + heading + 'rad)' }, geoworldSvgPath: { path: svgCompassOuterRing, width: 145, height: 145 }\"></div> <div class=\"compass-gyro-background\"></div> <div class=\"compass-gyro\" data-bind=\"geoworldSvgPath: { path: svgCompassGyro, width: 145, height: 145 }, css: { 'compass-gyro-active': isOrbiting }\"></div></div><div class=\"navigation-controls\" >\x3c!-- ko foreach: controls --\x3e<div data-bind=\"click: activate, attr: { title: $data.name }, css: $root.isLastControl($data) ? 'navigation-control-last' : 'navigation-control' \"> \x3c!-- ko if: $data.hasText --\x3e <div data-bind=\"text: $data.text, css: $data.isActive ? 'navigation-control-icon-active ' + $data.cssClass : $data.cssClass\"></div> \x3c!-- /ko --\x3e \x3c!-- ko ifnot: $data.hasText --\x3e <div data-bind=\"geoworldSvgPath: { path: $data.svgIcon, width: $data.svgWidth, height: $data.svgHeight }, css: $data.isActive ? 'navigation-control-icon-active ' + $data.cssClass : $data.cssClass\"></div> \x3c!-- /ko --\x3e </div> \x3c!-- /ko --\x3e</div>":this.enableZoomControls||this.enableCompass||(t='<div class="compass" style="display: none;" title="" data-bind="visible: showCompass, event: { mousedown: handleMouseDown, dblclick: handleDoubleClick }"><div class="compass-outer-ring-background"></div> <div class="compass-rotation-marker" data-bind="visible: isOrbiting, style: { transform: \'rotate(-\' + orbitCursorAngle + \'rad)\', \'-webkit-transform\': \'rotate(-\' + orbitCursorAngle + \'rad)\', opacity: orbitCursorOpacity }, geoworldSvgPath: { path: svgCompassRotationMarker, width: 145, height: 145 }"></div> <div class="compass-outer-ring" title="" data-bind="style: { transform: \'rotate(-\' + heading + \'rad)\', \'-webkit-transform\': \'rotate(-\' + heading + \'rad)\' }, geoworldSvgPath: { path: svgCompassOuterRing, width: 145, height: 145 }"></div> <div class="compass-gyro-background"></div> <div class="compass-gyro" data-bind="geoworldSvgPath: { path: svgCompassGyro, width: 145, height: 145 }, css: { \'compass-gyro-active\': isOrbiting }"></div></div><div class="navigation-controls" style="display: none;" >\x3c!-- ko foreach: controls --\x3e<div data-bind="click: activate, attr: { title: $data.name }, css: $root.isLastControl($data) ? \'navigation-control-last\' : \'navigation-control\' "> \x3c!-- ko if: $data.hasText --\x3e <div data-bind="text: $data.text, css: $data.isActive ? \'navigation-control-icon-active \' + $data.cssClass : $data.cssClass"></div> \x3c!-- /ko --\x3e \x3c!-- ko ifnot: $data.hasText --\x3e <div data-bind="geoworldSvgPath: { path: $data.svgIcon, width: $data.svgWidth, height: $data.svgHeight }, css: $data.isActive ? \'navigation-control-icon-active \' + $data.cssClass : $data.cssClass"></div> \x3c!-- /ko --\x3e </div> \x3c!-- /ko --\x3e</div>'),loadView(t,e,this)},NavigationViewModel.prototype.add=function(e){this.controls.push(e)},NavigationViewModel.prototype.remove=function(e){this.controls.remove(e)},NavigationViewModel.prototype.isLastControl=function(e){return e===this.controls[this.controls.length-1]};var vectorScratch$1=new Cartesian2;NavigationViewModel.prototype.handleMouseDown=function(e,t){if(this.terria.scene.mode===SceneMode$1.MORPHING)return!0;if(e.navigationLocked)return!0;var i=t.currentTarget,r=t.currentTarget.getBoundingClientRect(),n=r.width/2,a=new Cartesian2((r.right-r.left)/2,(r.bottom-r.top)/2),o=new Cartesian2(t.clientX-r.left,t.clientY-r.top),s=Cartesian2.subtract(o,a,vectorScratch$1),l=Cartesian2.magnitude(s)/n;if(l<50/145)orbit(this,i,s);else{if(!(l<1))return!0;rotate$1(this,i,s)}};var oldTransformScratch=new Matrix4,newTransformScratch=new Matrix4,centerScratch$7=new Cartesian3;function orbit(s,n,e){var l=s.terria.scene,t=l.screenSpaceCameraController;if(l.mode!==SceneMode$1.MORPHING&&t.enableInputs){if(s.navigationLocked)return!0;switch(l.mode){case SceneMode$1.COLUMBUS_VIEW:if(t.enableLook)break;if(!t.enableTranslate||!t.enableTilt)return;break;case SceneMode$1.SCENE3D:if(t.enableLook)break;if(!t.enableTilt||!t.enableRotate)return;break;case SceneMode$1.SCENE2D:if(!t.enableTranslate)return}document.removeEventListener("mousemove",s.orbitMouseMoveFunction,!1),document.removeEventListener("mouseup",s.orbitMouseUpFunction,!1),defined(s.orbitTickFunction)&&s.terria.clock.onTick.removeEventListener(s.orbitTickFunction),s.orbitMouseMoveFunction=void 0,s.orbitMouseUpFunction=void 0,s.orbitTickFunction=void 0,s.isOrbiting=!0,s.orbitLastTimestamp=getTimestamp$1();var u=l.camera;if(defined(s.terria.trackedEntity))s.orbitFrame=void 0,s.orbitIsLook=!1;else{var i=NavigationUtils.getCameraFocus(s.terria,!0,centerScratch$7);defined(i)?(s.orbitFrame=Transforms.eastNorthUpToFixedFrame(i,l.globe.ellipsoid,newTransformScratch),s.orbitIsLook=!1):(s.orbitFrame=Transforms.eastNorthUpToFixedFrame(u.positionWC,l.globe.ellipsoid,newTransformScratch),s.orbitIsLook=!0)}s.orbitTickFunction=function(e){var t,i=getTimestamp$1(),r=(i-s.orbitLastTimestamp)*(2.5*(s.orbitCursorOpacity-.5)/1e3),n=s.orbitCursorAngle+CesiumMath.PI_OVER_TWO,a=Math.cos(n)*r,o=Math.sin(n)*r;if(s.navigationLocked)return!0;defined(s.orbitFrame)&&(t=Matrix4.clone(u.transform,oldTransformScratch),u.lookAtTransform(s.orbitFrame)),l.mode===SceneMode$1.SCENE2D?u.move(new Cartesian3(a,o,0),Math.max(l.canvas.clientWidth,l.canvas.clientHeight)/100*u.positionCartographic.height*r):s.orbitIsLook?(u.look(Cartesian3.UNIT_Z,-a),u.look(u.right,-o)):(u.rotateLeft(a),u.rotateUp(o)),defined(s.orbitFrame)&&u.lookAtTransform(t),s.orbitLastTimestamp=i},s.orbitMouseMoveFunction=function(e){var t=n.getBoundingClientRect(),i=new Cartesian2((t.right-t.left)/2,(t.bottom-t.top)/2),r=new Cartesian2(e.clientX-t.left,e.clientY-t.top);a(Cartesian2.subtract(r,i,vectorScratch$1),t.width)},s.orbitMouseUpFunction=function(e){s.isOrbiting=!1,document.removeEventListener("mousemove",s.orbitMouseMoveFunction,!1),document.removeEventListener("mouseup",s.orbitMouseUpFunction,!1),defined(s.orbitTickFunction)&&s.terria.clock.onTick.removeEventListener(s.orbitTickFunction),s.orbitMouseMoveFunction=void 0,s.orbitMouseUpFunction=void 0,s.orbitTickFunction=void 0},document.addEventListener("mousemove",s.orbitMouseMoveFunction,!1),document.addEventListener("mouseup",s.orbitMouseUpFunction,!1),s.terria.clock.onTick.addEventListener(s.orbitTickFunction),a(e,n.getBoundingClientRect().width)}function a(e,t){var i=Math.atan2(-e.y,e.x);s.orbitCursorAngle=CesiumMath.zeroToTwoPi(i-CesiumMath.PI_OVER_TWO);var r=Cartesian2.magnitude(e),n=t/2,a=Math.min(r/n,1),o=.5*a*a+.5;s.orbitCursorOpacity=o}}function rotate$1(c,d,e){var t=c.terria.scene,i=t.camera,r=t.screenSpaceCameraController;if(t.mode!==SceneMode$1.MORPHING&&t.mode!==SceneMode$1.SCENE2D&&r.enableInputs){if(c.navigationLocked)return!0;if(r.enableLook||t.mode!==SceneMode$1.COLUMBUS_VIEW&&(t.mode!==SceneMode$1.SCENE3D||r.enableRotate)){if(document.removeEventListener("mousemove",c.rotateMouseMoveFunction,!1),document.removeEventListener("mouseup",c.rotateMouseUpFunction,!1),c.rotateMouseMoveFunction=void 0,c.rotateMouseUpFunction=void 0,c.isRotating=!0,c.rotateInitialCursorAngle=Math.atan2(-e.y,e.x),defined(c.terria.trackedEntity))c.rotateFrame=void 0,c.rotateIsLook=!1;else{var n=NavigationUtils.getCameraFocus(c.terria,!0,centerScratch$7);defined(n)&&(t.mode!==SceneMode$1.COLUMBUS_VIEW||r.enableLook||r.enableTranslate)?(c.rotateFrame=Transforms.eastNorthUpToFixedFrame(n,t.globe.ellipsoid,newTransformScratch),c.rotateIsLook=!1):(c.rotateFrame=Transforms.eastNorthUpToFixedFrame(i.positionWC,t.globe.ellipsoid,newTransformScratch),c.rotateIsLook=!0)}var a;defined(c.rotateFrame)&&(a=Matrix4.clone(i.transform,oldTransformScratch),i.lookAtTransform(c.rotateFrame)),c.rotateInitialCameraAngle=-i.heading,defined(c.rotateFrame)&&i.lookAtTransform(a),c.rotateMouseMoveFunction=function(e){var t,i=d.getBoundingClientRect(),r=new Cartesian2((i.right-i.left)/2,(i.bottom-i.top)/2),n=new Cartesian2(e.clientX-i.left,e.clientY-i.top),a=Cartesian2.subtract(n,r,vectorScratch$1),o=Math.atan2(-a.y,a.x)-c.rotateInitialCursorAngle,s=CesiumMath.zeroToTwoPi(c.rotateInitialCameraAngle-o),l=c.terria.scene.camera;defined(c.rotateFrame)&&(t=Matrix4.clone(l.transform,oldTransformScratch),l.lookAtTransform(c.rotateFrame));var u=-l.heading;l.rotateRight(s-u),defined(c.rotateFrame)&&l.lookAtTransform(t)},c.rotateMouseUpFunction=function(e){c.isRotating=!1,document.removeEventListener("mousemove",c.rotateMouseMoveFunction,!1),document.removeEventListener("mouseup",c.rotateMouseUpFunction,!1),c.rotateMouseMoveFunction=void 0,c.rotateMouseUpFunction=void 0},document.addEventListener("mousemove",c.rotateMouseMoveFunction,!1),document.addEventListener("mouseup",c.rotateMouseUpFunction,!1)}}}NavigationViewModel.prototype.handleDoubleClick=function(e,t){var i=e.terria.scene,r=i.camera,n=i.screenSpaceCameraController;if(i.mode===SceneMode$1.MORPHING||!n.enableInputs)return!0;if(e.navigationLocked)return!0;if(i.mode!==SceneMode$1.COLUMBUS_VIEW||n.enableTranslate){if(i.mode===SceneMode$1.SCENE3D||i.mode===SceneMode$1.COLUMBUS_VIEW){if(!n.enableLook)return;if(i.mode===SceneMode$1.SCENE3D&&!n.enableRotate)return}var a=NavigationUtils.getCameraFocus(e.terria,!0,centerScratch$7);if(defined(a)){var o=i.globe.ellipsoid.cartographicToCartesian(r.positionCartographic,new Cartesian3),s=i.globe.ellipsoid.geodeticSurfaceNormal(a),l=new BoundingSphere(a,0);r.flyToBoundingSphere(l,{offset:new HeadingPitchRange(0,CesiumMath.PI_OVER_TWO-Cartesian3.angleBetween(s,r.directionWC),Cartesian3.distance(o,a)),duration:1.5})}else this.controls[1].resetView()}},NavigationViewModel.create=function(e){var t=new NavigationViewModel(e);return t.show(e.container),t};var CesiumEvent=Event,CesiumNavigation=function(e){initialize$9.apply(this,arguments),this._onDestroyListeners=[]};function initialize$9(e,t){if(!defined(e))throw new DeveloperError("CesiumWidget or Viewer is required.");var i=defined(e.cesiumWidget)?e.cesiumWidget:e,r=document.createElement("div");r.className="Geoworld-widget-GeoworldNavigationContainer",i.container.appendChild(r),this.terria=e,this.terria.options=defined(t)?t:{},this.terria.afterWidgetChanged=new CesiumEvent,this.terria.beforeWidgetChanged=new CesiumEvent,this.container=r,defined(this.terria.options.enableDistanceLegend)&&!this.terria.options.enableDistanceLegend||(this.distanceLegendDiv=document.createElement("div"),r.appendChild(this.distanceLegendDiv),this.distanceLegendDiv.setAttribute("id","distanceLegendDiv"),this.distanceLegendViewModel=DistanceLegendViewModel.create({container:this.distanceLegendDiv,terria:this.terria,mapElement:r,enableDistanceLegend:!0})),defined(this.terria.options.enableZoomControls)&&!this.terria.options.enableZoomControls||defined(this.terria.options.enableCompass)&&!this.terria.options.enableCompass?!defined(this.terria.options.enableZoomControls)||this.terria.options.enableZoomControls||defined(this.terria.options.enableCompass)&&!this.terria.options.enableCompass?defined(this.terria.options.enableZoomControls)&&!this.terria.options.enableZoomControls||!defined(this.terria.options.enableCompass)||this.terria.options.enableCompass?defined(this.terria.options.enableZoomControls)&&!this.terria.options.enableZoomControls&&defined(this.terria.options.enableCompass)&&this.terria.options.enableCompass:(this.navigationDiv=document.createElement("div"),this.navigationDiv.setAttribute("id","navigationDiv"),r.appendChild(this.navigationDiv),this.navigationViewModel=NavigationViewModel.create({container:this.navigationDiv,terria:this.terria,enableZoomControls:!0,enableCompass:!1})):(this.navigationDiv=document.createElement("div"),this.navigationDiv.setAttribute("id","navigationDiv"),r.appendChild(this.navigationDiv),this.navigationViewModel=NavigationViewModel.create({container:this.navigationDiv,terria:this.terria,enableZoomControls:!1,enableCompass:!0})):(this.navigationDiv=document.createElement("div"),this.navigationDiv.setAttribute("id","navigationDiv"),r.appendChild(this.navigationDiv),this.navigationViewModel=NavigationViewModel.create({container:this.navigationDiv,terria:this.terria,enableZoomControls:!0,enableCompass:!0}))}function viewerGeoworldNavigationMixin(e,t){if(!defined(e))throw new DeveloperError("viewer is required.");var i;init(e,t).addOnDestroyListener((i=e,function(){delete i.cesiumNavigation})),Object.defineProperties(e,{cesiumNavigation:{configurable:!0,get:function(){return e.cesiumWidget.cesiumNavigation}}})}CesiumNavigation.prototype.distanceLegendViewModel=void 0,CesiumNavigation.prototype.navigationViewModel=void 0,CesiumNavigation.prototype.navigationDiv=void 0,CesiumNavigation.prototype.distanceLegendDiv=void 0,CesiumNavigation.prototype.terria=void 0,CesiumNavigation.prototype.container=void 0,CesiumNavigation.prototype._onDestroyListeners=void 0,CesiumNavigation.prototype._navigationLocked=!1,CesiumNavigation.prototype.setNavigationLocked=function(e){this._navigationLocked=e,this.navigationViewModel.setNavigationLocked(this._navigationLocked)},CesiumNavigation.prototype.getNavigationLocked=function(){return this._navigationLocked},CesiumNavigation.prototype.destroy=function(){defined(this.navigationViewModel)&&this.navigationViewModel.destroy(),defined(this.distanceLegendViewModel)&&this.distanceLegendViewModel.destroy(),defined(this.navigationDiv)&&this.navigationDiv.parentNode.removeChild(this.navigationDiv),delete this.navigationDiv,defined(this.distanceLegendDiv)&&this.distanceLegendDiv.parentNode.removeChild(this.distanceLegendDiv),delete this.distanceLegendDiv,defined(this.container)&&this.container.parentNode.removeChild(this.container),delete this.container;for(var e=0;e<this._onDestroyListeners.length;e++)this._onDestroyListeners[e]()},CesiumNavigation.prototype.addOnDestroyListener=function(e){"function"==typeof e&&this._onDestroyListeners.push(e)},viewerGeoworldNavigationMixin.mixinWidget=function(e,t){return init.apply(void 0,arguments)};var init=function(e,t){var i,r=new CesiumNavigation(e,t),n=defined(e.cesiumWidget)?e.cesiumWidget:e;return Object.defineProperties(n,{cesiumNavigation:{configurable:!0,get:function(){return r}}}),r.addOnDestroyListener((i=n,function(){delete i.cesiumNavigation})),r};function DDSTexture(e,t,i){var r=e._gl;this.id=t,this._size=i.imageBuffer.length,this._context=e,this._width=i.width,this._height=i.height,this._texture=null,this._internalFormat=i.internalFormat,this._wrapS=defaultValue(i.wrapS,TextureWrap$1.CLAMP_TO_EDGE),this._wrapT=defaultValue(i.wrapT,TextureWrap$1.CLAMP_TO_EDGE),this.id=t,this._target=r.TEXTURE_2D,this._texture=r.createTexture(),r.bindTexture(r.TEXTURE_2D,this._texture);var n=0,a=0,o=validateMipmap(i.imageBuffer,this._internalFormat,this._width,this._height),s=this._width,l=this._height;do{var u=PixelFormat$1.compressedTextureSizeInBytes(this._internalFormat,s,l),c=new Uint8Array(i.imageBuffer.buffer,i.imageBuffer.byteOffset+n,u);r.compressedTexImage2D(r.TEXTURE_2D,a++,this._internalFormat,s,l,0,c),s=Math.max(s>>1,1),l=Math.max(l>>1,1),n+=u}while(n<i.imageBuffer.length&&o);1<a?(r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR_MIPMAP_LINEAR)):(r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR)),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,this._wrapS),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,this._wrapT),r.bindTexture(r.TEXTURE_2D,null)}function validateMipmap(e,t,i,r){for(var n=e.length,a=i,o=r,s=0;;){if(s+=PixelFormat$1.compressedTextureSizeInBytes(t,a,o),o>>=1,0===(a>>=1)&&0===o)break;a=Math.max(a,1),o=Math.max(o,1)}return s===n}function MaterialPass(){this.ambientColor=new Color,this.diffuseColor=new Color,this.specularColor=new Color(0,0,0,0),this.shininess=50,this.bTransparentSorting=!1,this.textures=[]}DDSTexture.prototype.enable=function(){var e=this._context._gl;e.activeTexture(this._gl.TEXTURE0),e.bindTexture(this._target,this._texture)},DDSTexture.prototype.disable=function(){this._context._gl.bindTexture(this._target,null)},DDSTexture.prototype.isDestroyed=function(){return!1},DDSTexture.prototype.destroy=function(){this._context._gl.deleteTexture(this._texture),this._texture=null,this.id=0,destroyObject(this)},MaterialPass.prototype.isDestroyed=function(){return!1},MaterialPass.prototype.destroy=function(){return destroyObject(this)};var S3MTilesVS="attribute vec4 aPosition;\n attribute vec4 aTexCoord0;\n #ifdef TexCoord2\n attribute vec4 aTexCoord1;\n #endif\n varying vec4 vTexCoord;\n attribute vec4 aColor;\n varying vec4 vColor;\n void main()\n {\n vTexCoord.xy = aTexCoord0.xy;\n #ifdef TexCoord2\n vTexCoord.zw = aTexCoord1.xy;\n #endif\n vColor = aColor;\n gl_Position = czm_modelViewProjection * vec4(aPosition.xyz, 1.0);\n }\n ",S3MTilesFS="uniform sampler2D uTexture;\n #ifdef TexCoord2\n uniform sampler2D uTexture2;\n #endif\n uniform vec4 uDiffuseColor;\n uniform vec4 uAmbientColor;\n varying vec4 vColor;\n varying vec4 vTexCoord;\n void main()\n {\n vec4 color = vColor * texture2D(uTexture, vTexCoord.xy);\n #ifdef TexCoord2\n color *= texture2D(uTexture2, vTexCoord.zw);\n #endif\n gl_FragColor = czm_gammaCorrect(color);\n }\n ";function S3MCreateVertexJob(){this.context=void 0,this.model=void 0,this.index=void 0}function S3MCreateIndexBufferJob(){this.model=void 0,this.context=void 0,this.index=0}function RenderEntity(e){var t,i;for(this.layer=e.layer,this.vertexPackage=e.vertexPackage,this.arrIndexPackage=e.arrIndexPackage,this.vertexBufferToCreate=new Queue,this.indexBufferToCreate=new Queue,t=0,i=this.vertexPackage.vertexAttributes.length;t<i;t++)this.vertexBufferToCreate.enqueue(t);for(t=0,i=this.arrIndexPackage.length;t<i;t++)this.indexBufferToCreate.enqueue(t);this.boundingVolume=e.boundingVolume,this.material=e.material,this.modelMatrix=e.modelMatrix,this.shaderProgram=void 0,this.vertexArray=void 0,this.colorCommand=void 0,this.ready=!1}S3MCreateVertexJob.prototype.set=function(e,t,i){this.context=e,this.model=t,this.index=i},S3MCreateVertexJob.prototype.execute=function(){var e=this.context,t=this.index,i=this.model.vertexPackage,r=i.vertexAttributes[t];if(!defined(r))throw new DeveloperError("attribute is null");if(-1!==i.instanceIndex&&!defined(this.model._instanceBuffer)){if(!defined(i.instanceBuffer))throw new DeveloperError("instance buffer is null");this.model.instanceBuffer=Buffer$1.createVertexBuffer({context:e,typedArray:i.instanceBuffer,usage:BufferUsage$1.STATIC_DRAW})}1!==r.instanceDivisor?defined(r.vertexBuffer)||(r.vertexBuffer=Buffer$1.createVertexBuffer({context:e,typedArray:r.typedArray,usage:BufferUsage$1.STATIC_DRAW}),r.typedArray=null,delete r.typedArray):r.vertexBuffer=this.model.instanceBuffer},S3MCreateIndexBufferJob.prototype.set=function(e,t,i){this.model=t,this.context=e,this.index=i},S3MCreateIndexBufferJob.prototype.execute=function(){var e=this.context,t=this.model.arrIndexPackage[this.index],i=this.model.vertexPackage.verticesCount;if(!defined(t))throw new DeveloperError("index package is null");if(!defined(t.indexBuffer)){if(!defined(t.indicesTypedArray))throw new DeveloperError("index buffer is null");var r=IndexDatatype$1.UNSIGNED_SHORT;(1===t.indexType||i>=CesiumMath.SIXTY_FOUR_KILOBYTES)&&e.elementIndexUint&&(r=IndexDatatype$1.UNSIGNED_INT),t.indexBuffer=Buffer$1.createIndexBuffer({context:e,typedArray:t.indicesTypedArray,usage:BufferUsage$1.STATIC_DRAW,indexDatatype:r}),t.indicesTypedArray=null,delete t.indicesTypedArray}};var _vertexBufferJob=new S3MCreateVertexJob,_indexBufferJob=new S3MCreateIndexBufferJob;function createVertexBuffers(e,t){for(var i=e.layer.context,r=e.vertexBufferToCreate;r.length;){var n=r.peek();if(_vertexBufferJob.set(i,e,n),!t.jobScheduler.execute(_vertexBufferJob,JobType$1.BUFFER))break;r.dequeue()}}function createIndexBuffers(e,t){for(var i=e.layer.context,r=e.indexBufferToCreate;r.length;){var n=r.peek();if(_indexBufferJob.set(i,e,n),!t.jobScheduler.execute(_indexBufferJob,JobType$1.BUFFER))break;r.dequeue()}}function S3MCacheFileRenderEntity(e){RenderEntity.call(this,e)}function createShaderProgram$4(e,t,i){var r=new ShaderSource({sources:[S3MTilesVS]}),n=new ShaderSource({sources:[S3MTilesFS]});return defined(t.aNormal)&&(r.defines.push("VertexNormal"),n.defines.push("VertexNormal")),0<i.textures.length&&(r.defines.push("TexCoord"),n.defines.push("TexCoord")),2===i.textures.length&&(r.defines.push("TexCoord2"),n.defines.push("TexCoord2")),ShaderProgram.fromCache({context:e,vertexShaderSource:r,fragmentShaderSource:n,attributeLocations:t})}function getOpaqueRenderState$1(){return RenderState.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:DepthFunction$1.LESS_OR_EQUAL}})}function getTransparentRenderState(){return RenderState.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:DepthFunction$1.LESS_OR_EQUAL},blending:BlendingState$1.ALPHA_BLEND})}function getUniformMap(e){return{uTexture:function(){return e.textures[0]},uTextureWidth:function(){return e.textures[0]._width},uTexture2:function(){return e.textures[1]},uTexture2Width:function(){return e.textures[1]._width},uDiffuseColor:function(){return e.diffuseColor},uAmbientColor:function(){return e.ambientColor}}}RenderEntity.prototype.createBuffers=function(e){createVertexBuffers(this,e),createIndexBuffers(this,e)},RenderEntity.prototype.createCommand=DeveloperError.throwInstantiationError,RenderEntity.prototype.update=DeveloperError.throwInstantiationError,RenderEntity.prototype.isDestroyed=DeveloperError.throwInstantiationError,RenderEntity.prototype.destroy=DeveloperError.throwInstantiationError,S3MCacheFileRenderEntity.prototype=Object.create(RenderEntity.prototype),S3MCacheFileRenderEntity.prototype.constructor=RenderEntity,S3MCacheFileRenderEntity.prototype.createCommand=function(){if(!defined(this.colorCommand)){var e=this.layer.context,t=this.vertexPackage,i=this.arrIndexPackage,r=t.vertexAttributes,n=t.attrLocation;if(!(i.length<1)){var a=i[0],o=this.material;this.shaderProgram=createShaderProgram$4(e,n,o),this.vertexArray=new VertexArray({context:e,attributes:r,indexBuffer:a.indexBuffer}),this.colorCommand=new DrawCommand({primitiveType:a.primitiveType,modelMatrix:this.modelMatrix,boundingVolume:BoundingSphere.clone(this.boundingVolume),pickId:"vSecondColor",vertexArray:this.vertexArray,shaderProgram:this.shaderProgram,pass:o.bTransparentSorting?Pass$1.TRANSLUCENT:Pass$1.CESIUM_3D_TILE,renderState:o.bTransparentSorting?getTransparentRenderState():getOpaqueRenderState$1()}),this.colorCommand.uniformMap=getUniformMap(o),this.vertexPackage=null,this.arrIndexPackage=null,this.ready=!0}}},S3MCacheFileRenderEntity.prototype.update=function(e){if(!this.ready)return this.createBuffers(e),void this.createCommand(e);e.commandList.push(this.colorCommand)},S3MCacheFileRenderEntity.prototype.isDestroyed=function(){return!1},S3MCacheFileRenderEntity.prototype.destroy=function(){return this.shaderProgram=this.shaderProgram&&!this.shaderProgram.isDestroyed()&&this.shaderProgram.destroy(),this.vertexArray=this.vertexArray&&!this.vertexArray.isDestroyed()&&this.vertexArray.destroy(),this.colorCommand=void 0,this.vertexPackage=null,this.arrIndexPackage=null,destroyObject(this)};var S3MContentFactory={OSGBFile:function(e){return new S3MCacheFileRenderEntity(e)},OSGBCacheFile:function(e){return new S3MCacheFileRenderEntity(e)}},VertexCompressOptions={SVC_Vertex:1,SVC_Normal:2,SVC_VertexColor:4,SVC_SecondColor:8,SVC_TexutreCoord:16,SVC_TexutreCoordIsW:32},VertexCompressOption=Object.freeze(VertexCompressOptions);function S3MContentParser(){}function parseMaterial(e,t){for(var i={},r=t.materials.material,n=0,a=r.length;n<a;n++){var o=r[n].material,s=o.id,l=new MaterialPass;i[s]=l;var u=o.ambient;l.ambientColor=new Color(u.r,u.g,u.b,u.a);var c=o.diffuse;l.diffuseColor=new Color(c.r,c.g,c.b,c.a);var d=o.specular;l.specularColor=new Color(d.r,d.g,d.b,d.a),l.shininess=o.shininess,l.bTransparentSorting=o.transparentsorting;for(var h=o.textureunitstates,p=h.length,f=0;f<p;f++){var m=h[f].textureunitstate,g=m.id,y=0===m.addressmode.u?TextureWrap$1.REPEAT:TextureWrap$1.CLAMP_TO_EDGE,v=0===m.addressmode.v?TextureWrap$1.REPEAT:TextureWrap$1.CLAMP_TO_EDGE;l.texMatrix=Matrix4.unpack(m.texmodmatrix);var _=t.texturePackage[g];if(defined(_)&&0<_.imageBuffer.byteLength){_.wrapS=y,_.wrapT=v;var C=new DDSTexture(e,g,_);l.textures.push(C)}}}return i}function calcBoundingVolume(e,t){var i,r,n=new BoundingSphere,a=new Cartesian3,o=e.vertexAttributes[0],s=o.componentsPerAttribute,l=defined(e.nCompressOptions)&&(e.nCompressOptions&VertexCompressOption.SVC_Vertex)===VertexCompressOption.SVC_Vertex,u=1;r=l?(u=e.vertCompressConstant,i=new Cartesian3(e.minVerticesValue.x,e.minVerticesValue.y,e.minVerticesValue.z),new Uint16Array(o.typedArray.buffer,o.typedArray.byteOffset,o.typedArray.byteLength/2)):new Float32Array(o.typedArray.buffer,o.typedArray.byteOffset,o.typedArray.byteLength/4);for(var c=[],d=0;d<e.verticesCount;d++)Cartesian3.fromArray(r,s*d,a),l&&(a=Cartesian3.multiplyByScalar(a,u,a),a=Cartesian3.add(a,i,a)),c.push(Cartesian3.clone(a));return BoundingSphere.fromPoints(c,n),BoundingSphere.transform(n,t,n),c.length=0,n}function parseGeodes(e,t,i,r,n){for(var a={},o=r.geodes,s=0,l=o.length;s<l;s++){var u,c=o[s],d=c.matrix,h=Matrix4.multiply(e.modelMatrix,d,new Matrix4);defined(n.boundingVolume)&&(u=new BoundingSphere(n.boundingVolume.sphere.center,n.boundingVolume.sphere.radius),BoundingSphere.transform(u,e.modelMatrix,u));for(var p=c.skeletonNames,f=0,m=p.length;f<m;f++){var g,y=p[f],v=t.geoPackage[y],_=v.vertexPackage,C=v.arrIndexPackage,x=v.pickInfo;0<C.length&&(g=i[C[0].materialCode]);var b=defined(u)?u:calcBoundingVolume(_,h);a[y]=S3MContentFactory[e.fileType]({layer:e,vertexPackage:_,arrIndexPackage:C,pickInfo:x,modelMatrix:h,boundingVolume:b,material:g})}}if(!defined(n.boundingVolume)){var A=[];for(var S in a)a.hasOwnProperty(S)&&A.push(a[S].boundingVolume);n.boundingVolume=BoundingSphere.fromBoundingSpheres(A)}n.geoMap=a}function parsePagelods(e,t,i){for(var r=t.groupNode,n=[],a=0,o=r.pageLods.length;a<o;a++){var s={},l=r.pageLods[a];s.rangeMode=l.rangeMode,s.rangeDataList=l.childTile,s.rangeList=l.rangeList;var u=l.boundingSphere.center,c=l.boundingSphere.radius;""!==s.rangeDataList?s.boundingVolume={sphere:{center:new Cartesian3(u.x,u.y,u.z),radius:c}}:s.isLeafTile=!0,parseGeodes(e,t,i,l,s),n.push(s)}return n}function S3MLayerCache(){this._list=new DoublyLinkedList,this._sentinel=this._list.add(),this._trimTiles=!1}S3MContentParser.parse=function(e,t){if(defined(t))return parsePagelods(e,t,parseMaterial(e.context,t))},S3MLayerCache.prototype.reset=function(){this._list.splice(this._list.tail,this._sentinel)},S3MLayerCache.prototype.touch=function(e){var t=e.cacheNode;defined(t)&&this._list.splice(this._sentinel,t)},S3MLayerCache.prototype.add=function(e){defined(e.cacheNode)||(e.cacheNode=this._list.add(e))},S3MLayerCache.prototype.unloadTile=function(e,t,i){var r=t.cacheNode;defined(r)&&(this._list.remove(r),t.cacheNode=void 0,i(e,t))},S3MLayerCache.prototype.unloadTiles=function(e,t){var i=this._trimTiles;this._trimTiles=!1;for(var r=this._list,n=1024*e.maximumMemoryUsage*1024,a=this._sentinel,o=r.head;o!==a&&(e.totalMemoryUsageInBytes>n||i);){var s=o.item;o=o.next,s.isDestroyed()&&console.log(s),this.unloadTile(e,s,t)}},S3MLayerCache.prototype.trim=function(){this._trimTiles=!0};var ContentState={UNLOADED:0,LOADING:1,PARSING:2,READY:3,FAILED:4},ContentState$1=Object.freeze(ContentState);function S3MLayerScheduler(){this._stack=[]}function selectRootTiles(e,t,i){for(var r=t.length=0,n=e._rootTiles.length;r<n;r++){var a=e._rootTiles[r];a.updateVisibility(i),a.visible&&t.push(a)}}function sortComparator(e,t){return e.distanceToCamera-t.distanceToCamera}function updateChildren(e,t,i,r){var n,a=t.children,o=a.length;for(n=0;n<o;++n)a[n].updateVisibility(r);for(a.sort(sortComparator),n=0;n<o;++n){var s=a[n];s.visible&&i.push(s)}}function selectTile$1(e,t,i){t.renderable&&(e._selectedTiles.push(t),t.selectedFrame=i.frameNumber)}function loadTile$2(e,t,i){t.requestedFrame===i.frameNumber||t.contentState!==ContentState$1.UNLOADED||t.isLeafTile||(e._requestTiles.push(t),t.requestedFrame=i.frameNumber)}function touchTile$2(e,t,i){t.touchedFrame!==i.frameNumber&&(e._cache.touch(t),t.touchedFrame=i.frameNumber)}function traversal$2(e,t,i){for(;t.length;){var r=t.pop();r.visible&&(touchTile$2(e,r,i),r.canTraverse()?updateChildren(e,r,t,i):(selectTile$1(e,r,i),loadTile$2(e,r,i)))}}S3MLayerScheduler.prototype.scheduler=function(e,t){e._requestTiles.length=0,e._selectedTiles.length=0;var i=this._stack;selectRootTiles(e,i,t),traversal$2(e,i,t)};var tmp$d={};tmp$d=function a(o,s,l){function u(i,e){if(!s[i]){if(!o[i]){var t="function"==typeof require&&require;if(!e&&t)return t(i,!0);if(c)return c(i,!0);var r=new Error("Cannot find module '"+i+"'");throw r.code="MODULE_NOT_FOUND",r}var n=s[i]={exports:{}};o[i][0].call(n.exports,function(e){var t=o[i][1][e];return u(t||e)},n,n.exports,a,o,s,l)}return s[i].exports}for(var c="function"==typeof require&&require,e=0;e<l.length;e++)u(l[e]);return u}({1:[function(e,t,i){var r="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;i.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var i=t.shift();if(i){if("object"!=typeof i)throw new TypeError(i+"must be non-object");for(var r in i)i.hasOwnProperty(r)&&(e[r]=i[r])}}return e},i.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var n={arraySet:function(e,t,i,r,n){if(t.subarray&&e.subarray)e.set(t.subarray(i,i+r),n);else for(var a=0;a<r;a++)e[n+a]=t[i+a]},flattenChunks:function(e){var t,i,r,n,a,o;for(t=r=0,i=e.length;t<i;t++)r+=e[t].length;for(o=new Uint8Array(r),t=n=0,i=e.length;t<i;t++)a=e[t],o.set(a,n),n+=a.length;return o}},a={arraySet:function(e,t,i,r,n){for(var a=0;a<r;a++)e[n+a]=t[i+a]},flattenChunks:function(e){return[].concat.apply([],e)}};i.setTyped=function(e){e?(i.Buf8=Uint8Array,i.Buf16=Uint16Array,i.Buf32=Int32Array,i.assign(i,n)):(i.Buf8=Array,i.Buf16=Array,i.Buf32=Array,i.assign(i,a))},i.setTyped(r)},{}],2:[function(e,t,i){var l=e("./common"),n=!0,a=!0;try{String.fromCharCode.apply(null,[0])}catch(e){n=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){a=!1}for(var u=new l.Buf8(256),r=0;r<256;r++)u[r]=252<=r?6:248<=r?5:240<=r?4:224<=r?3:192<=r?2:1;function c(e,t){if(t<65537&&(e.subarray&&a||!e.subarray&&n))return String.fromCharCode.apply(null,l.shrinkBuf(e,t));for(var i="",r=0;r<t;r++)i+=String.fromCharCode(e[r]);return i}u[254]=u[254]=1,i.string2buf=function(e){var t,i,r,n,a,o=e.length,s=0;for(n=0;n<o;n++)55296==(64512&(i=e.charCodeAt(n)))&&n+1<o&&56320==(64512&(r=e.charCodeAt(n+1)))&&(i=65536+(i-55296<<10)+(r-56320),n++),s+=i<128?1:i<2048?2:i<65536?3:4;for(t=new l.Buf8(s),n=a=0;a<s;n++)55296==(64512&(i=e.charCodeAt(n)))&&n+1<o&&56320==(64512&(r=e.charCodeAt(n+1)))&&(i=65536+(i-55296<<10)+(r-56320),n++),i<128?t[a++]=i:(i<2048?t[a++]=192|i>>>6:(i<65536?t[a++]=224|i>>>12:(t[a++]=240|i>>>18,t[a++]=128|i>>>12&63),t[a++]=128|i>>>6&63),t[a++]=128|63&i);return t},i.buf2binstring=function(e){return c(e,e.length)},i.binstring2buf=function(e){for(var t=new l.Buf8(e.length),i=0,r=t.length;i<r;i++)t[i]=e.charCodeAt(i);return t},i.buf2string=function(e,t){var i,r,n,a,o=t||e.length,s=new Array(2*o);for(i=r=0;i<o;)if((n=e[i++])<128)s[r++]=n;else if(4<(a=u[n]))s[r++]=65533,i+=a-1;else{for(n&=2===a?31:3===a?15:7;1<a&&i<o;)n=n<<6|63&e[i++],a--;1<a?s[r++]=65533:n<65536?s[r++]=n:(n-=65536,s[r++]=55296|n>>10&1023,s[r++]=56320|1023&n)}return c(s,r)},i.utf8border=function(e,t){var i;for((t=t||e.length)>e.length&&(t=e.length),i=t-1;0<=i&&128==(192&e[i]);)i--;return i<0?t:0===i?t:i+u[e[i]]>t?i:t}},{"./common":1}],3:[function(e,t,i){t.exports=function(e,t,i,r){for(var n=65535&e|0,a=e>>>16&65535|0,o=0;0!==i;){for(i-=o=2e3<i?2e3:i;n=n+t[r++]|0,a=a+n|0,--o;);n%=65521,a%=65521}return n|a<<16|0}},{}],4:[function(e,t,i){t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],5:[function(e,t,i){var s=function(){for(var e,t=[],i=0;i<256;i++){e=i;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[i]=e}return t}();t.exports=function(e,t,i,r){var n=s,a=r+i;e^=-1;for(var o=r;o<a;o++)e=e>>>8^n[255&(e^t[o])];return-1^e}},{}],6:[function(e,t,i){t.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],7:[function(e,t,i){t.exports=function(e,t){var i,r,n,a,o,s,l,u,c,d,h,p,f,m,g,y,v,_,C,x,b,A,S,w,E;i=e.state,r=e.next_in,w=e.input,n=r+(e.avail_in-5),a=e.next_out,E=e.output,o=a-(t-e.avail_out),s=a+(e.avail_out-257),l=i.dmax,u=i.wsize,c=i.whave,d=i.wnext,h=i.window,p=i.hold,f=i.bits,m=i.lencode,g=i.distcode,y=(1<<i.lenbits)-1,v=(1<<i.distbits)-1;e:do{f<15&&(p+=w[r++]<<f,f+=8,p+=w[r++]<<f,f+=8),_=m[p&y];t:for(;;){if(p>>>=C=_>>>24,f-=C,0==(C=_>>>16&255))E[a++]=65535&_;else{if(!(16&C)){if(0==(64&C)){_=m[(65535&_)+(p&(1<<C)-1)];continue t}if(32&C){i.mode=12;break e}e.msg="invalid literal/length code",i.mode=30;break e}x=65535&_,(C&=15)&&(f<C&&(p+=w[r++]<<f,f+=8),x+=p&(1<<C)-1,p>>>=C,f-=C),f<15&&(p+=w[r++]<<f,f+=8,p+=w[r++]<<f,f+=8),_=g[p&v];i:for(;;){if(p>>>=C=_>>>24,f-=C,!(16&(C=_>>>16&255))){if(0==(64&C)){_=g[(65535&_)+(p&(1<<C)-1)];continue i}e.msg="invalid distance code",i.mode=30;break e}if(b=65535&_,f<(C&=15)&&(p+=w[r++]<<f,(f+=8)<C&&(p+=w[r++]<<f,f+=8)),l<(b+=p&(1<<C)-1)){e.msg="invalid distance too far back",i.mode=30;break e}if(p>>>=C,f-=C,(C=a-o)<b){if(c<(C=b-C)&&i.sane){e.msg="invalid distance too far back",i.mode=30;break e}if(S=h,(A=0)===d){if(A+=u-C,C<x){for(x-=C;E[a++]=h[A++],--C;);A=a-b,S=E}}else if(d<C){if(A+=u+d-C,(C-=d)<x){for(x-=C;E[a++]=h[A++],--C;);if(A=0,d<x){for(x-=C=d;E[a++]=h[A++],--C;);A=a-b,S=E}}}else if(A+=d-C,C<x){for(x-=C;E[a++]=h[A++],--C;);A=a-b,S=E}for(;2<x;)E[a++]=S[A++],E[a++]=S[A++],E[a++]=S[A++],x-=3;x&&(E[a++]=S[A++],1<x&&(E[a++]=S[A++]))}else{for(A=a-b;E[a++]=E[A++],E[a++]=E[A++],E[a++]=E[A++],2<(x-=3););x&&(E[a++]=E[A++],1<x&&(E[a++]=E[A++]))}break}}break}}while(r<n&&a<s);r-=x=f>>3,p&=(1<<(f-=x<<3))-1,e.next_in=r,e.next_out=a,e.avail_in=r<n?n-r+5:5-(r-n),e.avail_out=a<s?s-a+257:257-(a-s),i.hold=p,i.bits=f}},{}],8:[function(e,t,i){var M=e("../utils/common"),D=e("./adler32"),I=e("./crc32"),O=e("./inffast"),R=e("./inftrees"),L=1,N=2,k=0,B=-2,F=1,r=852,n=592;function V(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function a(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new M.Buf16(320),this.work=new M.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function o(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=F,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new M.Buf32(r),t.distcode=t.distdyn=new M.Buf32(n),t.sane=1,t.back=-1,k):B}function s(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,o(e)):B}function l(e,t){var i,r;return e&&e.state?(r=e.state,t<0?(i=0,t=-t):(i=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15<t)?B:(null!==r.window&&r.wbits!==t&&(r.window=null),r.wrap=i,r.wbits=t,s(e))):B}function u(e,t){var i,r;return e?(r=new a,(e.state=r).window=null,(i=l(e,t))!==k&&(e.state=null),i):B}var c,d,h=!0;function z(e){if(h){var t;for(c=new M.Buf32(512),d=new M.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(R(L,e.lens,0,288,c,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;R(N,e.lens,0,32,d,0,e.work,{bits:5}),h=!1}e.lencode=c,e.lenbits=9,e.distcode=d,e.distbits=5}function U(e,t,i,r){var n,a=e.state;return null===a.window&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new M.Buf8(a.wsize)),r>=a.wsize?(M.arraySet(a.window,t,i-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):(n=a.wsize-a.wnext,r<n&&(n=r),M.arraySet(a.window,t,i-r,n,a.wnext),(r-=n)?(M.arraySet(a.window,t,i-r,r,0),a.wnext=r,a.whave=a.wsize):(a.wnext+=n,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=n))),0}i.inflateReset=s,i.inflateReset2=l,i.inflateResetKeep=o,i.inflateInit=function(e){return u(e,15)},i.inflateInit2=u,i.inflate=function(e,t){var i,r,n,a,o,s,l,u,c,d,h,p,f,m,g,y,v,_,C,x,b,A,S,w,E=0,T=new M.Buf8(4),P=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return B;12===(i=e.state).mode&&(i.mode=13),o=e.next_out,n=e.output,l=e.avail_out,a=e.next_in,r=e.input,s=e.avail_in,u=i.hold,c=i.bits,d=s,h=l,A=k;e:for(;;)switch(i.mode){case F:if(0===i.wrap){i.mode=13;break}for(;c<16;){if(0===s)break e;s--,u+=r[a++]<<c,c+=8}if(2&i.wrap&&35615===u){i.check=0,T[0]=255&u,T[1]=u>>>8&255,i.check=I(i.check,T,2,0),c=u=0,i.mode=2;break}if(i.flags=0,i.head&&(i.head.done=!1),!(1&i.wrap)||(((255&u)<<8)+(u>>8))%31){e.msg="incorrect header check",i.mode=30;break}if(8!=(15&u)){e.msg="unknown compression method",i.mode=30;break}if(c-=4,b=8+(15&(u>>>=4)),0===i.wbits)i.wbits=b;else if(b>i.wbits){e.msg="invalid window size",i.mode=30;break}i.dmax=1<<b,e.adler=i.check=1,i.mode=512&u?10:12,c=u=0;break;case 2:for(;c<16;){if(0===s)break e;s--,u+=r[a++]<<c,c+=8}if(i.flags=u,8!=(255&i.flags)){e.msg="unknown compression method",i.mode=30;break}if(57344&i.flags){e.msg="unknown header flags set",i.mode=30;break}i.head&&(i.head.text=u>>8&1),512&i.flags&&(T[0]=255&u,T[1]=u>>>8&255,i.check=I(i.check,T,2,0)),c=u=0,i.mode=3;case 3:for(;c<32;){if(0===s)break e;s--,u+=r[a++]<<c,c+=8}i.head&&(i.head.time=u),512&i.flags&&(T[0]=255&u,T[1]=u>>>8&255,T[2]=u>>>16&255,T[3]=u>>>24&255,i.check=I(i.check,T,4,0)),c=u=0,i.mode=4;case 4:for(;c<16;){if(0===s)break e;s--,u+=r[a++]<<c,c+=8}i.head&&(i.head.xflags=255&u,i.head.os=u>>8),512&i.flags&&(T[0]=255&u,T[1]=u>>>8&255,i.check=I(i.check,T,2,0)),c=u=0,i.mode=5;case 5:if(1024&i.flags){for(;c<16;){if(0===s)break e;s--,u+=r[a++]<<c,c+=8}i.length=u,i.head&&(i.head.extra_len=u),512&i.flags&&(T[0]=255&u,T[1]=u>>>8&255,i.check=I(i.check,T,2,0)),c=u=0}else i.head&&(i.head.extra=null);i.mode=6;case 6:if(1024&i.flags&&(p=i.length,s<p&&(p=s),p&&(i.head&&(b=i.head.extra_len-i.length,i.head.extra||(i.head.extra=new Array(i.head.extra_len)),M.arraySet(i.head.extra,r,a,p,b)),512&i.flags&&(i.check=I(i.check,r,p,a)),s-=p,a+=p,i.length-=p),i.length))break e;i.length=0,i.mode=7;case 7:if(2048&i.flags){if(0===s)break e;for(p=0;b=r[a+p++],i.head&&b&&i.length<65536&&(i.head.name+=String.fromCharCode(b)),b&&p<s;);if(512&i.flags&&(i.check=I(i.check,r,p,a)),s-=p,a+=p,b)break e}else i.head&&(i.head.name=null);i.length=0,i.mode=8;case 8:if(4096&i.flags){if(0===s)break e;for(p=0;b=r[a+p++],i.head&&b&&i.length<65536&&(i.head.comment+=String.fromCharCode(b)),b&&p<s;);if(512&i.flags&&(i.check=I(i.check,r,p,a)),s-=p,a+=p,b)break e}else i.head&&(i.head.comment=null);i.mode=9;case 9:if(512&i.flags){for(;c<16;){if(0===s)break e;s--,u+=r[a++]<<c,c+=8}if(u!==(65535&i.check)){e.msg="header crc mismatch",i.mode=30;break}c=u=0}i.head&&(i.head.hcrc=i.flags>>9&1,i.head.done=!0),e.adler=i.check=0,i.mode=12;break;case 10:for(;c<32;){if(0===s)break e;s--,u+=r[a++]<<c,c+=8}e.adler=i.check=V(u),c=u=0,i.mode=11;case 11:if(0===i.havedict)return e.next_out=o,e.avail_out=l,e.next_in=a,e.avail_in=s,i.hold=u,i.bits=c,2;e.adler=i.check=1,i.mode=12;case 12:if(5===t||6===t)break e;case 13:if(i.last){u>>>=7&c,c-=7&c,i.mode=27;break}for(;c<3;){if(0===s)break e;s--,u+=r[a++]<<c,c+=8}switch(i.last=1&u,c-=1,3&(u>>>=1)){case 0:i.mode=14;break;case 1:if(z(i),i.mode=20,6!==t)break;u>>>=2,c-=2;break e;case 2:i.mode=17;break;case 3:e.msg="invalid block type",i.mode=30}u>>>=2,c-=2;break;case 14:for(u>>>=7&c,c-=7&c;c<32;){if(0===s)break e;s--,u+=r[a++]<<c,c+=8}if((65535&u)!=(u>>>16^65535)){e.msg="invalid stored block lengths",i.mode=30;break}if(i.length=65535&u,c=u=0,i.mode=15,6===t)break e;case 15:i.mode=16;case 16:if(p=i.length){if(s<p&&(p=s),l<p&&(p=l),0===p)break e;M.arraySet(n,r,a,p,o),s-=p,a+=p,l-=p,o+=p,i.length-=p;break}i.mode=12;break;case 17:for(;c<14;){if(0===s)break e;s--,u+=r[a++]<<c,c+=8}if(i.nlen=257+(31&u),u>>>=5,c-=5,i.ndist=1+(31&u),u>>>=5,c-=5,i.ncode=4+(15&u),u>>>=4,c-=4,286<i.nlen||30<i.ndist){e.msg="too many length or distance symbols",i.mode=30;break}i.have=0,i.mode=18;case 18:for(;i.have<i.ncode;){for(;c<3;){if(0===s)break e;s--,u+=r[a++]<<c,c+=8}i.lens[P[i.have++]]=7&u,u>>>=3,c-=3}for(;i.have<19;)i.lens[P[i.have++]]=0;if(i.lencode=i.lendyn,i.lenbits=7,S={bits:i.lenbits},A=R(0,i.lens,0,19,i.lencode,0,i.work,S),i.lenbits=S.bits,A){e.msg="invalid code lengths set",i.mode=30;break}i.have=0,i.mode=19;case 19:for(;i.have<i.nlen+i.ndist;){for(;E=i.lencode[u&(1<<i.lenbits)-1],y=E>>>16&255,v=65535&E,!((g=E>>>24)<=c);){if(0===s)break e;s--,u+=r[a++]<<c,c+=8}if(v<16)u>>>=g,c-=g,i.lens[i.have++]=v;else{if(16===v){for(w=g+2;c<w;){if(0===s)break e;s--,u+=r[a++]<<c,c+=8}if(u>>>=g,c-=g,0===i.have){e.msg="invalid bit length repeat",i.mode=30;break}b=i.lens[i.have-1],p=3+(3&u),u>>>=2,c-=2}else if(17===v){for(w=g+3;c<w;){if(0===s)break e;s--,u+=r[a++]<<c,c+=8}c-=g,b=0,p=3+(7&(u>>>=g)),u>>>=3,c-=3}else{for(w=g+7;c<w;){if(0===s)break e;s--,u+=r[a++]<<c,c+=8}c-=g,b=0,p=11+(127&(u>>>=g)),u>>>=7,c-=7}if(i.have+p>i.nlen+i.ndist){e.msg="invalid bit length repeat",i.mode=30;break}for(;p--;)i.lens[i.have++]=b}}if(30===i.mode)break;if(0===i.lens[256]){e.msg="invalid code -- missing end-of-block",i.mode=30;break}if(i.lenbits=9,S={bits:i.lenbits},A=R(L,i.lens,0,i.nlen,i.lencode,0,i.work,S),i.lenbits=S.bits,A){e.msg="invalid literal/lengths set",i.mode=30;break}if(i.distbits=6,i.distcode=i.distdyn,S={bits:i.distbits},A=R(N,i.lens,i.nlen,i.ndist,i.distcode,0,i.work,S),i.distbits=S.bits,A){e.msg="invalid distances set",i.mode=30;break}if(i.mode=20,6===t)break e;case 20:i.mode=21;case 21:if(6<=s&&258<=l){e.next_out=o,e.avail_out=l,e.next_in=a,e.avail_in=s,i.hold=u,i.bits=c,O(e,h),o=e.next_out,n=e.output,l=e.avail_out,a=e.next_in,r=e.input,s=e.avail_in,u=i.hold,c=i.bits,12===i.mode&&(i.back=-1);break}for(i.back=0;E=i.lencode[u&(1<<i.lenbits)-1],y=E>>>16&255,v=65535&E,!((g=E>>>24)<=c);){if(0===s)break e;s--,u+=r[a++]<<c,c+=8}if(y&&0==(240&y)){for(_=g,C=y,x=v;E=i.lencode[x+((u&(1<<_+C)-1)>>_)],y=E>>>16&255,v=65535&E,!(_+(g=E>>>24)<=c);){if(0===s)break e;s--,u+=r[a++]<<c,c+=8}u>>>=_,c-=_,i.back+=_}if(u>>>=g,c-=g,i.back+=g,i.length=v,0===y){i.mode=26;break}if(32&y){i.back=-1,i.mode=12;break}if(64&y){e.msg="invalid literal/length code",i.mode=30;break}i.extra=15&y,i.mode=22;case 22:if(i.extra){for(w=i.extra;c<w;){if(0===s)break e;s--,u+=r[a++]<<c,c+=8}i.length+=u&(1<<i.extra)-1,u>>>=i.extra,c-=i.extra,i.back+=i.extra}i.was=i.length,i.mode=23;case 23:for(;E=i.distcode[u&(1<<i.distbits)-1],y=E>>>16&255,v=65535&E,!((g=E>>>24)<=c);){if(0===s)break e;s--,u+=r[a++]<<c,c+=8}if(0==(240&y)){for(_=g,C=y,x=v;E=i.distcode[x+((u&(1<<_+C)-1)>>_)],y=E>>>16&255,v=65535&E,!(_+(g=E>>>24)<=c);){if(0===s)break e;s--,u+=r[a++]<<c,c+=8}u>>>=_,c-=_,i.back+=_}if(u>>>=g,c-=g,i.back+=g,64&y){e.msg="invalid distance code",i.mode=30;break}i.offset=v,i.extra=15&y,i.mode=24;case 24:if(i.extra){for(w=i.extra;c<w;){if(0===s)break e;s--,u+=r[a++]<<c,c+=8}i.offset+=u&(1<<i.extra)-1,u>>>=i.extra,c-=i.extra,i.back+=i.extra}if(i.offset>i.dmax){e.msg="invalid distance too far back",i.mode=30;break}i.mode=25;case 25:if(0===l)break e;if(p=h-l,i.offset>p){if((p=i.offset-p)>i.whave&&i.sane){e.msg="invalid distance too far back",i.mode=30;break}f=p>i.wnext?(p-=i.wnext,i.wsize-p):i.wnext-p,p>i.length&&(p=i.length),m=i.window}else m=n,f=o-i.offset,p=i.length;for(l<p&&(p=l),l-=p,i.length-=p;n[o++]=m[f++],--p;);0===i.length&&(i.mode=21);break;case 26:if(0===l)break e;n[o++]=i.length,l--,i.mode=21;break;case 27:if(i.wrap){for(;c<32;){if(0===s)break e;s--,u|=r[a++]<<c,c+=8}if(h-=l,e.total_out+=h,i.total+=h,h&&(e.adler=i.check=i.flags?I(i.check,n,h,o-h):D(i.check,n,h,o-h)),h=l,(i.flags?u:V(u))!==i.check){e.msg="incorrect data check",i.mode=30;break}c=u=0}i.mode=28;case 28:if(i.wrap&&i.flags){for(;c<32;){if(0===s)break e;s--,u+=r[a++]<<c,c+=8}if(u!==(4294967295&i.total)){e.msg="incorrect length check",i.mode=30;break}c=u=0}i.mode=29;case 29:A=1;break e;case 30:A=-3;break e;case 31:return-4;case 32:default:return B}return e.next_out=o,e.avail_out=l,e.next_in=a,e.avail_in=s,i.hold=u,i.bits=c,(i.wsize||h!==e.avail_out&&i.mode<30&&(i.mode<27||4!==t))&&U(e,e.output,e.next_out,h-e.avail_out),d-=e.avail_in,h-=e.avail_out,e.total_in+=d,e.total_out+=h,i.total+=h,i.wrap&&h&&(e.adler=i.check=i.flags?I(i.check,n,h,e.next_out-h):D(i.check,n,h,e.next_out-h)),e.data_type=i.bits+(i.last?64:0)+(12===i.mode?128:0)+(20===i.mode||15===i.mode?256:0),(0==d&&0===h||4===t)&&A===k&&(A=-5),A},i.inflateEnd=function(e){if(!e||!e.state)return B;var t=e.state;return t.window&&(t.window=null),e.state=null,k},i.inflateGetHeader=function(e,t){var i;return e&&e.state&&0!=(2&(i=e.state).wrap)?((i.head=t).done=!1,k):B},i.inflateSetDictionary=function(e,t){var i,r=t.length;return e&&e.state?0!==(i=e.state).wrap&&11!==i.mode?B:11===i.mode&&D(1,t,r,0)!==i.check?-3:U(e,t,r,r)?(i.mode=31,-4):(i.havedict=1,k):B},i.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":1,"./adler32":3,"./crc32":5,"./inffast":7,"./inftrees":9}],9:[function(e,t,i){var L=e("../utils/common"),N=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],k=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],B=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],F=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];t.exports=function(e,t,i,r,n,a,o,s){var l,u,c,d,h,p,f,m,g,y=s.bits,v=0,_=0,C=0,x=0,b=0,A=0,S=0,w=0,E=0,T=0,P=null,M=0,D=new L.Buf16(16),I=new L.Buf16(16),O=null,R=0;for(v=0;v<=15;v++)D[v]=0;for(_=0;_<r;_++)D[t[i+_]]++;for(b=y,x=15;1<=x&&0===D[x];x--);if(x<b&&(b=x),0===x)return n[a++]=20971520,n[a++]=20971520,s.bits=1,0;for(C=1;C<x&&0===D[C];C++);for(b<C&&(b=C),v=w=1;v<=15;v++)if(w<<=1,(w-=D[v])<0)return-1;if(0<w&&(0===e||1!==x))return-1;for(I[1]=0,v=1;v<15;v++)I[v+1]=I[v]+D[v];for(_=0;_<r;_++)0!==t[i+_]&&(o[I[t[i+_]]++]=_);if(p=0===e?(P=O=o,19):1===e?(P=N,M-=257,O=k,R-=257,256):(P=B,O=F,-1),v=C,h=a,S=_=T=0,c=-1,d=(E=1<<(A=b))-1,1===e&&852<E||2===e&&592<E)return 1;for(;;){for(f=v-S,g=o[_]<p?(m=0,o[_]):o[_]>p?(m=O[R+o[_]],P[M+o[_]]):(m=96,0),l=1<<v-S,C=u=1<<A;n[h+(T>>S)+(u-=l)]=f<<24|m<<16|g|0,0!==u;);for(l=1<<v-1;T&l;)l>>=1;if(0!==l?(T&=l-1,T+=l):T=0,_++,0==--D[v]){if(v===x)break;v=t[i+o[_]]}if(b<v&&(T&d)!==c){for(0===S&&(S=b),h+=C,w=1<<(A=v-S);A+S<x&&!((w-=D[A+S])<=0);)A++,w<<=1;if(E+=1<<A,1===e&&852<E||2===e&&592<E)return 1;n[c=T&d]=b<<24|A<<16|h-a|0}}return 0!==T&&(n[h+T]=v-S<<24|64<<16|0),s.bits=b,0}},{"../utils/common":1}],10:[function(e,t,i){t.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],11:[function(e,t,i){t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],"/lib/inflate.js":[function(e,t,i){var h=e("./zlib/inflate"),p=e("./utils/common"),f=e("./utils/strings"),m=e("./zlib/constants"),r=e("./zlib/messages"),n=e("./zlib/zstream"),a=e("./zlib/gzheader"),g=Object.prototype.toString;function o(e){if(!(this instanceof o))return new o(e);this.options=p.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&0<=t.windowBits&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(0<=t.windowBits&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),15<t.windowBits&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new n,this.strm.avail_out=0;var i=h.inflateInit2(this.strm,t.windowBits);if(i!==m.Z_OK)throw new Error(r[i]);this.header=new a,h.inflateGetHeader(this.strm,this.header)}function s(e,t){var i=new o(t);if(i.push(e,!0),i.err)throw i.msg||r[i.err];return i.result}o.prototype.push=function(e,t){var i,r,n,a,o,s,l=this.strm,u=this.options.chunkSize,c=this.options.dictionary,d=!1;if(this.ended)return!1;r=t===~~t?t:!0===t?m.Z_FINISH:m.Z_NO_FLUSH,"string"==typeof e?l.input=f.binstring2buf(e):"[object ArrayBuffer]"===g.call(e)?l.input=new Uint8Array(e):l.input=e,l.next_in=0,l.avail_in=l.input.length;do{if(0===l.avail_out&&(l.output=new p.Buf8(u),l.next_out=0,l.avail_out=u),(i=h.inflate(l,m.Z_NO_FLUSH))===m.Z_NEED_DICT&&c&&(s="string"==typeof c?f.string2buf(c):"[object ArrayBuffer]"===g.call(c)?new Uint8Array(c):c,i=h.inflateSetDictionary(this.strm,s)),i===m.Z_BUF_ERROR&&!0===d&&(i=m.Z_OK,d=!1),i!==m.Z_STREAM_END&&i!==m.Z_OK)return this.onEnd(i),!(this.ended=!0);l.next_out&&(0!==l.avail_out&&i!==m.Z_STREAM_END&&(0!==l.avail_in||r!==m.Z_FINISH&&r!==m.Z_SYNC_FLUSH)||("string"===this.options.to?(n=f.utf8border(l.output,l.next_out),a=l.next_out-n,o=f.buf2string(l.output,n),l.next_out=a,l.avail_out=u-a,a&&p.arraySet(l.output,l.output,n,a,0),this.onData(o)):this.onData(p.shrinkBuf(l.output,l.next_out)))),0===l.avail_in&&0===l.avail_out&&(d=!0)}while((0<l.avail_in||0===l.avail_out)&&i!==m.Z_STREAM_END);return i===m.Z_STREAM_END&&(r=m.Z_FINISH),r===m.Z_FINISH?(i=h.inflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===m.Z_OK):r!==m.Z_SYNC_FLUSH||(this.onEnd(m.Z_OK),!(l.avail_out=0))},o.prototype.onData=function(e){this.chunks.push(e)},o.prototype.onEnd=function(e){e===m.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=p.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},i.Inflate=o,i.inflate=s,i.inflateRaw=function(e,t){return(t=t||{}).raw=!0,s(e,t)},i.ungzip=s},{"./utils/common":1,"./utils/strings":2,"./zlib/constants":4,"./zlib/gzheader":6,"./zlib/inflate":8,"./zlib/messages":10,"./zlib/zstream":11}]},{},[])("/lib/inflate.js");var pako=tmp$d;function S3ModelParser(){}var S3MBVertexTag={SV_Unkown:0,SV_Standard:1,SV_Compressed:2};function unZip(e,t){var i=new Uint8Array(e,t);return pako.inflate(i).buffer}function parseString(e,t,i){var r=t.getUint32(i,!0);return i+=Uint32Array.BYTES_PER_ELEMENT,{string:getStringFromTypedArray(new Uint8Array(e,i,r)),bytesOffset:i+=r}}function parseGeode(e,t,i,r){for(var n={},a=[],o=new Array(16),s=0;s<16;s++)o[s]=t.getFloat64(i,!0),i+=Float64Array.BYTES_PER_ELEMENT;n.matrix=o,n.skeletonNames=a;var l=t.getUint32(i,!0);i+=Uint32Array.BYTES_PER_ELEMENT;for(s=0;s<l;s++){var u=parseString(e,t,i);a.push(u.string),i=u.bytesOffset}return r.push(n),i}function parsePageLOD(e,t,i,r){var n={};n.rangeList=t.getFloat32(i,!0),i+=Float32Array.BYTES_PER_ELEMENT,n.rangeMode=t.getUint16(i,!0),i+=Uint16Array.BYTES_PER_ELEMENT;var a={};a.x=t.getFloat64(i,!0),i+=Float64Array.BYTES_PER_ELEMENT,a.y=t.getFloat64(i,!0),i+=Float64Array.BYTES_PER_ELEMENT,a.z=t.getFloat64(i,!0),i+=Float64Array.BYTES_PER_ELEMENT;var o=t.getFloat64(i,!0);i+=Float64Array.BYTES_PER_ELEMENT,n.boundingSphere={center:a,radius:o};var s=parseString(e,t,i),l=s.string;i=s.bytesOffset;var u=l.indexOf("Geometry");if(-1!==u){var c=l.substring(u);l=l.replace(c,"")}n.childTile=l,n.geodes=[];var d=t.getUint32(i,!0);i+=Uint32Array.BYTES_PER_ELEMENT;for(var h=0;h<d;h++)i=parseGeode(e,t,i,n.geodes);return r.push(n),i}function parseGroupNode(e,t,i,r){var n={},a=[];t.getUint32(i,!0);i+=Uint32Array.BYTES_PER_ELEMENT;var o=t.getUint32(i,!0);i+=Uint32Array.BYTES_PER_ELEMENT;for(var s=0;s<o;s++)i=parsePageLOD(e,t,i,a);n.pageLods=a;var l=i%4;return 0!=l&&(i+=4-l),r.groupNode=n,i}function parseVertex(e,t,i,r){var n=t.getUint32(i,!0);if(r.verticesCount=n,(i+=Uint32Array.BYTES_PER_ELEMENT)<=0)return i;var a=t.getUint16(i,!0);i+=Uint16Array.BYTES_PER_ELEMENT;var o=t.getUint16(i,!0);o=a*Float32Array.BYTES_PER_ELEMENT,i+=Uint16Array.BYTES_PER_ELEMENT;var s=n*a*Float32Array.BYTES_PER_ELEMENT,l=new Uint8Array(e,i,s);i+=s;var u=r.vertexAttributes,c=r.attrLocation;return c.aPosition=u.length,u.push({index:c.aPosition,typedArray:l,componentsPerAttribute:a,componentDatatype:ComponentDatatype$1.FLOAT,offsetInBytes:0,strideInBytes:o,normalize:!1}),i}function parseNormal(e,t,i,r){var n=t.getUint32(i,!0);if(i+=Uint32Array.BYTES_PER_ELEMENT,n<=0)return i;var a=t.getUint16(i,!0);i+=Uint16Array.BYTES_PER_ELEMENT;var o=t.getUint16(i,!0);i+=Uint16Array.BYTES_PER_ELEMENT;var s=n*a*Float32Array.BYTES_PER_ELEMENT,l=new Uint8Array(e,i,s);i+=s;var u=r.vertexAttributes,c=r.attrLocation;return c.aNormal=u.length,u.push({index:c.aNormal,typedArray:l,componentsPerAttribute:a,componentDatatype:ComponentDatatype$1.FLOAT,offsetInBytes:0,strideInBytes:o,normalize:!1}),i}function parseVertexColor(e,t,i,r){var n=t.getUint32(i,!0);i+=Uint32Array.BYTES_PER_ELEMENT;var a,o=r.verticesCount;if(0<n){t.getUint16(i,!0);i+=Uint16Array.BYTES_PER_ELEMENT,i+=2*Uint8Array.BYTES_PER_ELEMENT;var s=n*Uint8Array.BYTES_PER_ELEMENT*4;a=new Uint8Array(e,i,s).slice(0,s),i+=s}else{a=new Uint8Array(4*o);for(var l=0;l<o;l++)a[4*l]=255,a[4*l+1]=255,a[4*l+2]=255,a[4*l+3]=255}var u=r.vertexAttributes,c=r.attrLocation;return c.aColor=u.length,u.push({index:c.aColor,typedArray:a,componentsPerAttribute:4,componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE,offsetInBytes:0,strideInBytes:4,normalize:!0}),r.vertexColor=a,i}function parseSecondColor(e,t,i,r){var n=t.getUint32(i,!0);if(i+=Uint32Array.BYTES_PER_ELEMENT,n<=0)return i;t.getUint16(i,!0);i+=Uint16Array.BYTES_PER_ELEMENT,i+=2*Uint8Array.BYTES_PER_ELEMENT;var a=n*Uint8Array.BYTES_PER_ELEMENT*4,o=new Uint8Array(e,i,a);i+=a;var s=r.vertexAttributes,l=r.attrLocation;return l.aSecondColor=s.length,s.push({index:l.aSecondColor,typedArray:o,componentsPerAttribute:4,componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE,offsetInBytes:0,strideInBytes:4,normalize:!0}),i}function parseTexCoord(e,t,i,r){var n=t.getUint16(i,!0);i+=Uint16Array.BYTES_PER_ELEMENT,i+=Uint16Array.BYTES_PER_ELEMENT;for(var a=0;a<n;a++){var o=t.getUint32(i,!0);i+=Uint32Array.BYTES_PER_ELEMENT;var s=t.getUint16(i,!0);i+=Uint16Array.BYTES_PER_ELEMENT;t.getUint16(i,!0);i+=Uint16Array.BYTES_PER_ELEMENT;var l=o*s*Float32Array.BYTES_PER_ELEMENT,u=new Uint8Array(e,i,l);i+=l;var c="aTexCoord"+a,d=r.vertexAttributes,h=r.attrLocation;h[c]=d.length,d.push({index:h[c],typedArray:u,componentsPerAttribute:s,componentDatatype:ComponentDatatype$1.FLOAT,offsetInBytes:0,strideInBytes:s*Float32Array.BYTES_PER_ELEMENT,normalize:!1})}return i}function parseInstanceInfo(e,t,i,r){var n=t.getUint16(i,!0);i+=Uint16Array.BYTES_PER_ELEMENT,i+=Uint16Array.BYTES_PER_ELEMENT;for(var a=r.vertexAttributes,o=r.attrLocation,s=0;s<n;s++){var l=t.getUint32(i,!0);i+=Uint32Array.BYTES_PER_ELEMENT;var u=t.getUint16(i,!0);i+=Uint16Array.BYTES_PER_ELEMENT;t.getUint16(i,!0);i+=Uint16Array.BYTES_PER_ELEMENT;var c=l*u*Float32Array.BYTES_PER_ELEMENT;if(17===u||29===u){var d=new Uint8Array(e,i,c);r.instanceCount=l,r.instanceMode=u,r.instanceBuffer=d,r.instanceIndex=1;var h,p=u*l*4,f=d.slice(0,p);r.vertexColorInstance=f,17===u?(h=17*Float32Array.BYTES_PER_ELEMENT,o.uv2=a.length,a.push({index:o.uv2,componentsPerAttribute:4,componentDatatype:ComponentDatatype$1.FLOAT,normalize:!1,offsetInBytes:0,strideInBytes:h,instanceDivisor:1}),o.uv3=a.length,a.push({index:o.uv3,componentsPerAttribute:4,componentDatatype:ComponentDatatype$1.FLOAT,normalize:!1,offsetInBytes:4*Float32Array.BYTES_PER_ELEMENT,strideInBytes:h,instanceDivisor:1}),o.uv4=a.length,a.push({index:o.uv4,componentsPerAttribute:4,componentDatatype:ComponentDatatype$1.FLOAT,normalize:!1,offsetInBytes:8*Float32Array.BYTES_PER_ELEMENT,strideInBytes:h,instanceDivisor:1}),o.uv5=a.length,a.push({index:o.uv5,componentsPerAttribute:4,componentDatatype:ComponentDatatype$1.FLOAT,normalize:!1,offsetInBytes:12*Float32Array.BYTES_PER_ELEMENT,strideInBytes:h,instanceDivisor:1}),o.uv6=a.length,a.push({index:o.uv6,componentsPerAttribute:4,componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE,normalize:!0,offsetInBytes:16*Float32Array.BYTES_PER_ELEMENT,strideInBytes:h,instanceDivisor:1})):29===u&&(h=29*Float32Array.BYTES_PER_ELEMENT,o.uv1=a.length,a.push({index:o.uv1,componentsPerAttribute:4,componentDatatype:ComponentDatatype$1.FLOAT,normalize:!1,offsetInBytes:0,strideInBytes:h,instanceDivisor:1,byteLength:c}),o.uv2=a.length,a.push({index:o.uv2,componentsPerAttribute:4,componentDatatype:ComponentDatatype$1.FLOAT,normalize:!1,offsetInBytes:4*Float32Array.BYTES_PER_ELEMENT,strideInBytes:h,instanceDivisor:1}),o.uv3=a.length,a.push({index:o.uv3,componentsPerAttribute:4,componentDatatype:ComponentDatatype$1.FLOAT,normalize:!1,offsetInBytes:8*Float32Array.BYTES_PER_ELEMENT,strideInBytes:h,instanceDivisor:1}),o.uv4=a.length,a.push({index:o.uv4,componentsPerAttribute:4,componentDatatype:ComponentDatatype$1.FLOAT,normalize:!1,offsetInBytes:12*Float32Array.BYTES_PER_ELEMENT,strideInBytes:h,instanceDivisor:1}),o.uv5=a.length,a.push({index:o.uv5,componentsPerAttribute:4,componentDatatype:ComponentDatatype$1.FLOAT,normalize:!1,offsetInBytes:16*Float32Array.BYTES_PER_ELEMENT,strideInBytes:h,instanceDivisor:1}),o.uv6=a.length,a.push({index:o.uv6,componentsPerAttribute:4,componentDatatype:ComponentDatatype$1.FLOAT,normalize:!1,offsetInBytes:20*Float32Array.BYTES_PER_ELEMENT,strideInBytes:h,instanceDivisor:1}),o.uv7=a.length,a.push({index:o.uv7,componentsPerAttribute:3,componentDatatype:ComponentDatatype$1.FLOAT,normalize:!1,offsetInBytes:24*Float32Array.BYTES_PER_ELEMENT,strideInBytes:h,instanceDivisor:1}),o.uv8=a.length,a.push({index:o.uv8,componentsPerAttribute:4,componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE,normalize:!0,offsetInBytes:27*Float32Array.BYTES_PER_ELEMENT,strideInBytes:h,instanceDivisor:1}),o.uv9=a.length,a.push({index:o.uv9,componentsPerAttribute:4,componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE,normalize:!0,offsetInBytes:28*Float32Array.BYTES_PER_ELEMENT,strideInBytes:h,instanceDivisor:1}))}else{p=l*u;r.instanceBounds=new Float32Array(p);for(var m=0;m<p;m++)r.instanceBounds[m]=t.getFloat32(i,!0)}i+=c}return i}function parseCompressVertex(e,t,i,r){var n=t.getUint32(i,!0);if(r.verticesCount=n,(i+=Uint32Array.BYTES_PER_ELEMENT)<=0)return i;var a=t.getUint16(i,!0);i+=Uint16Array.BYTES_PER_ELEMENT;var o=t.getUint16(i,!0);o=a*Int16Array.BYTES_PER_ELEMENT,i+=Uint16Array.BYTES_PER_ELEMENT;var s=t.getFloat32(i,!0);i+=Float32Array.BYTES_PER_ELEMENT;var l={};l.x=t.getFloat32(i,!0),i+=Float32Array.BYTES_PER_ELEMENT,l.y=t.getFloat32(i,!0),i+=Float32Array.BYTES_PER_ELEMENT,l.z=t.getFloat32(i,!0),i+=Float32Array.BYTES_PER_ELEMENT,l.w=t.getFloat32(i,!0),i+=Float32Array.BYTES_PER_ELEMENT,r.vertCompressConstant=s,r.minVerticesValue=l;var u=n*a*Int16Array.BYTES_PER_ELEMENT,c=new Uint8Array(e,i,u);i+=u;var d=r.vertexAttributes,h=r.attrLocation;return h.aPosition=d.length,d.push({index:h.aPosition,typedArray:c,componentsPerAttribute:a,componentDatatype:ComponentDatatype$1.SHORT,offsetInBytes:0,strideInBytes:o,normalize:!1}),i}function parseCompressNormal(e,t,i,r){var n=t.getUint32(i,!0);if(i+=Uint32Array.BYTES_PER_ELEMENT,n<=0)return i;t.getUint16(i,!0);i+=Uint16Array.BYTES_PER_ELEMENT;var a=t.getUint16(i,!0);i+=Uint16Array.BYTES_PER_ELEMENT;var o=2*n*Int16Array.BYTES_PER_ELEMENT,s=new Uint8Array(e,i,o);i+=o;var l=r.vertexAttributes,u=r.attrLocation;return u.aNormal=l.length,l.push({index:u.aNormal,typedArray:s,componentsPerAttribute:2,componentDatatype:ComponentDatatype$1.SHORT,offsetInBytes:0,strideInBytes:a,normalize:!1}),i}function parseCompressTexCoord(e,t,i,r){r.texCoordCompressConstant=[],r.minTexCoordValue=[];var n=t.getUint16(i,!0);i+=Uint16Array.BYTES_PER_ELEMENT,i+=Uint16Array.BYTES_PER_ELEMENT;for(var a=0;a<n;a++){var o=t.getUint8(i,!0);i+=Uint8Array.BYTES_PER_ELEMENT,i+=3*Uint8Array.BYTES_PER_ELEMENT;var s=t.getUint32(i,!0);i+=Uint32Array.BYTES_PER_ELEMENT;var l=t.getUint16(i,!0);i+=Uint16Array.BYTES_PER_ELEMENT;t.getUint16(i,!0);i+=Uint16Array.BYTES_PER_ELEMENT;var u=t.getFloat32(i,!0);i+=Float32Array.BYTES_PER_ELEMENT,r.texCoordCompressConstant.push(u);var c={};c.x=t.getFloat32(i,!0),i+=Float32Array.BYTES_PER_ELEMENT,c.y=t.getFloat32(i,!0),i+=Float32Array.BYTES_PER_ELEMENT,c.z=t.getFloat32(i,!0),i+=Float32Array.BYTES_PER_ELEMENT,c.w=t.getFloat32(i,!0),i+=Float32Array.BYTES_PER_ELEMENT,r.minTexCoordValue.push(c);var d=s*l*Int16Array.BYTES_PER_ELEMENT,h=new Uint8Array(e,i,d),p=(i+=d)%4;0!=p&&(i+=4-p);var f="aTexCoord"+a,m=r.vertexAttributes,g=r.attrLocation;if(g[f]=m.length,m.push({index:g[f],typedArray:h,componentsPerAttribute:l,componentDatatype:ComponentDatatype$1.SHORT,offsetInBytes:0,strideInBytes:l*Int16Array.BYTES_PER_ELEMENT,normalize:!1}),o){d=s*Float32Array.BYTES_PER_ELEMENT;var y=new Uint8Array(e,i,d);i+=d,r.texCoordZMatrix=!0,g[f="aTexCoordZ"+a]=m.length,m.push({index:g[f],typedArray:y,componentsPerAttribute:1,componentDatatype:ComponentDatatype$1.FLOAT,offsetInBytes:0,strideInBytes:Float32Array.BYTES_PER_ELEMENT,normalize:!1})}}return i}function parseStandardSkeleton(e,t,i,r){return i=parseInstanceInfo(e,t,i=parseTexCoord(e,t,i=parseSecondColor(e,t,i=parseVertexColor(e,t,i=parseNormal(e,t,i=parseVertex(e,t,i,r),r),r),r),r),r)}function parseCompressSkeleton(e,t,i,r){var n=t.getUint32(i,!0);return r.compressOptions=n,i+=Uint32Array.BYTES_PER_ELEMENT,i=(n&VertexCompressOption.SVC_Vertex)===VertexCompressOption.SVC_Vertex?parseCompressVertex(e,t,i,r):parseVertex(e,t,i,r),i=parseSecondColor(e,t,i=parseVertexColor(e,t,i=(n&VertexCompressOption.SVC_Normal)===VertexCompressOption.SVC_Normal?parseCompressNormal(e,t,i,r):parseNormal(e,t,i,r),r),r),i=(n&VertexCompressOption.SVC_TexutreCoord)===VertexCompressOption.SVC_TexutreCoord?parseCompressTexCoord(e,t,i,r):parseTexCoord(e,t,i,r),(n&VertexCompressOption.SVC_TexutreCoordIsW)===VertexCompressOption.SVC_TexutreCoordIsW&&(r.textureCoordIsW=!0),i=parseInstanceInfo(e,t,i,r)}function parseIndexPackage(e,t,i,r){var n=t.getUint32(i,!0);i+=Uint32Array.BYTES_PER_ELEMENT;for(var a=0;a<n;a++){var o={},s=t.getUint32(i,!0);i+=Uint32Array.BYTES_PER_ELEMENT;var l=t.getUint8(i,!0);i+=Uint8Array.BYTES_PER_ELEMENT;t.getUint8(i,!0);i+=Uint8Array.BYTES_PER_ELEMENT;var u=t.getUint8(i,!0);if(i+=Uint8Array.BYTES_PER_ELEMENT,i+=Uint8Array.BYTES_PER_ELEMENT,0<s){var c,d=null;1===l||3===l?(c=s*Uint32Array.BYTES_PER_ELEMENT,d=new Uint8Array(e,i,c)):(c=s*Uint16Array.BYTES_PER_ELEMENT,d=new Uint8Array(e,i,c),s%2!=0&&(c+=2)),o.indicesTypedArray=d,i+=c}o.indicesCount=s,o.indexType=l,o.primitiveType=u;var h=[],p=t.getUint32(i,!0);i+=Uint32Array.BYTES_PER_ELEMENT;for(var f=0;f<p;f++){var m=parseString(e,t,i),g=m.string;i=m.bytesOffset,h.push(g),o.materialCode=g}if(0!=i%4)i+=4-i%4;r.push(o)}return i}function parseSkeleton(e,t,i,r){t.getUint32(i,!0);i+=Uint32Array.BYTES_PER_ELEMENT;var n=t.getUint32(i,!0);i+=Uint32Array.BYTES_PER_ELEMENT;for(var a=0;a<n;a++){var o=parseString(e,t,i),s=o.string,l=(i=o.bytesOffset)%4;0!=l&&(i+=4-l);var u=t.getUint32(i,!0);i+=Int32Array.BYTES_PER_ELEMENT;var c={vertexAttributes:[],attrLocation:{},instanceCount:0,instanceMode:0,instanceIndex:-1};u===S3MBVertexTag.SV_Standard?i=parseStandardSkeleton(e,t,i,c):u===S3MBVertexTag.SV_Compressed&&(i=parseCompressSkeleton(e,t,i,c));var d=[];i=parseIndexPackage(e,t,i,d),r[s]={vertexPackage:c,arrIndexPackage:d}}return i+=t.getUint32(i,!0),i+=Uint32Array.BYTES_PER_ELEMENT}function parseTexturePackage(e,t,i,r){var n=t.getUint32(i,!0);i+=Uint32Array.BYTES_PER_ELEMENT;var a=t.getUint32(i,!0);i+=Uint32Array.BYTES_PER_ELEMENT;for(var o=0;o<a;o++){var s=parseString(e,t,i),l=s.string,u=(i=s.bytesOffset)%4;0!=u&&(i+=4-u);t.getUint32(i,!0);i+=Uint32Array.BYTES_PER_ELEMENT;var c=t.getUint32(i,!0);i+=Uint32Array.BYTES_PER_ELEMENT;var d=t.getUint32(i,!0);i+=Uint32Array.BYTES_PER_ELEMENT;var h=t.getUint32(i,!0);i+=Uint32Array.BYTES_PER_ELEMENT;n=t.getUint32(i,!0);i+=Uint32Array.BYTES_PER_ELEMENT;var p=t.getUint32(i,!0);i+=Uint32Array.BYTES_PER_ELEMENT;var f=new Uint8Array(e,i,n);i+=n,r[l]={id:l,width:c,height:d,compressType:h,nFormat:p,internalFormat:PixelFormat$1.RGBA_DXT5,imageBuffer:f}}return i}function parseMaterial$1(e,t,i,r){var n=t.getUint32(i,!0);i+=Uint32Array.BYTES_PER_ELEMENT;var a=getStringFromTypedArray(new Uint8Array(e,i,n));return i+=n,r.materials=JSON.parse(a),i}function parsePickInfo(e,t,i,r,n){if(1==(1&r)){t.getUint32(i,!0);i+=Uint32Array.BYTES_PER_ELEMENT;var a=t.getUint32(i,!0);i+=Uint32Array.BYTES_PER_ELEMENT;for(var o=0;o<a;o++){var s=parseString(e,t,i),l=s.string;i=s.bytesOffset;var u=t.getUint32(i,!0);i+=Uint32Array.BYTES_PER_ELEMENT;var c={};n[l].pickInfo=c;for(var d=n[l].vertexPackage.instanceIndex,h=0;h<u;h++){var p=t.getUint32(i,!0);i+=Uint32Array.BYTES_PER_ELEMENT;var f=t.getUint32(i,!0);i+=Uint32Array.BYTES_PER_ELEMENT;for(var m=[],g=0;g<f;g++){var y=t.getUint32(i,!0);i+=Uint32Array.BYTES_PER_ELEMENT;var v=1;-1===d&&(v=t.getUint32(i,!0),i+=Uint32Array.BYTES_PER_ELEMENT),m.push({vertexColorOffset:y,vertexColorCount:v})}c[p]=m}}}return i}function S3MTile(e,t,i,r,n,a,o){this.layer=e,this.parent=t,this.fileName=r,this.isLeafTile=defaultValue(o,!1),this.boundingVolume=this.createBoundingVolume(i,e.modelMatrix);var s=Resource.createIfNeeded(e._baseResource);if(defined(t))this.baseUri=t.baseUri;else{var l=new Resource(r);this.baseUri=l.getBaseUri()}this.contentResource=s.getDerivedResource({url:r}),this.serverKey=RequestScheduler.getServerKey(this.contentResource.getUrlComponent()),this.request=void 0,this.cacheNode=void 0,this.distanceToCamera=0,this.pixel=0,this.visibilityPlaneMask=0,this.visible=!1,this.children=[],this.lodRangeData=n,this.renderEntityMap=a,this.contentState=ContentState$1.UNLOADED,this.readerable=!1,this.touchedFrame=0,this.requestedFrame=0,this.selectedFrame=0,this.priority=0}S3ModelParser.parseBuffer=function(e){var t=0,i={version:void 0,groupNode:void 0,geoPackage:{},matrials:void 0,texturePackage:{}},r=new DataView(e);i.version=r.getFloat32(t,!0),t+=Float32Array.BYTES_PER_ELEMENT;r.getUint32(t,!0);var n=unZip(e,t+=Uint32Array.BYTES_PER_ELEMENT);t=0;var a=(r=new DataView(n)).getUint32(t,!0);return parsePickInfo(n,r,t=parseMaterial$1(n,r,t=parseTexturePackage(n,r,t=parseSkeleton(n,r,t=parseGroupNode(n,r,t+=Uint32Array.BYTES_PER_ELEMENT,i),i.geoPackage),i.texturePackage),i),a,i.geoPackage),i},Object.defineProperties(S3MTile.prototype,{renderable:{get:function(){return defined(this.renderEntityMap)}}});var scratchScale$d=new Cartesian3;function createSphere$1(e,t){var i=Cartesian3.clone(e.center),r=e.radius;i=Matrix4.multiplyByPoint(t,i,i);var n=Matrix4.getScale(t,scratchScale$d);return new TileBoundingSphere(i,r*=Cartesian3.maximumComponent(n))}function createBoundingBox(e,t){var i=new Cartesian3(e.min.x,e.min.y,e.min.z);Matrix4.multiplyByPoint(t,i,i);var r=new Cartesian3(e.max.x,e.max.y,e.max.z);Matrix4.multiplyByPoint(t,r,r);var n=BoundingSphere.fromCornerPoints(i,r,new BoundingSphere),a=n.center,o=n.radius,s=Matrix4.getScale(t,scratchScale$d);return new TileBoundingSphere(a,o*=Cartesian3.maximumComponent(s))}function getBoundingVolume$1(e,t){return e.boundingVolume}function createPriorityFunction$1(e){return function(){return e.priority}}function getContentFailedFunction$1(t){return function(e){t.contentState=ContentState$1.FAILED,t.contentReadyPromise.reject(e)}}function createChildren(e,t){for(var i=e.layer,r=t.length,n=0;n<r;n++){var a=t[n],o=a.boundingVolume,s=a.rangeDataList,l=new S3MTile(i,e,o,s=e.baseUri+s,a.rangeList,a.geoMap,a.isLeafTile);e.children.push(l),e.layer._cache.add(l)}}function S3MTilesLayer(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),Check.defined("options.url",e.url),Check.defined("options.context",e.context),this.context=e.context,this._url=void 0,this._basePath=void 0,this._baseResource=void 0,this.modelMatrix=void 0,this.fileType=void 0,this._position=void 0,this._rectangle=void 0,this._rootTiles=[],this._schuduler=new S3MLayerScheduler,this._requestTiles=[],this._selectedTiles=[],this._cache=new S3MLayerCache,this._maximumMemoryUsage=-1,this._totalMemoryUsageInBytes=0,this._readyPromise=when.defer(),this.loadConfig(e.url)}function sortRequestByPriority$1(e,t){return e.priority-t.priority}function requestTiles$1(e){var t=e._requestTiles,i=t.length;t.sort(sortRequestByPriority$1);for(var r=0;r<i;++r){t[r].requestContent()}}function updateTiles$1(e,t){for(var i=e._selectedTiles,r=i.length,n=0;n<r;n++)i[n].update(t)}function unloadTile$1(e,t){}function freeResource(e){e._cache.unloadTiles(e,unloadTile$1)}function removePrimitive(e,t,i){var r=t[e.id];if(defined(r)){var n=r.primitive;i.remove(n),n.isDestroyed()||n.destroy(),delete t[e.id]}}S3MTile.prototype.createBoundingVolume=function(e,t){return this.isLeafTile?new TileBoundingSphere(e.center,e.radius):defined(e.sphere)?createSphere$1(e.sphere,t):defined(e.box)?createBoundingBox(e.box,t):void 0},S3MTile.prototype.canTraverse=function(){return 0!==this.children.length&&!this.isLeafTile&&(!defined(this.lodRangeData)||this.pixel>this.lodRangeData)},S3MTile.prototype.getPixel=function(e){var t=this.boundingVolume,i=t.radius,r=t.center,n=Cartesian3.distance(e.camera.positionWC,r),a=e.context.drawingBufferHeight,o=.5*e.camera.frustum._fovy;return.5*a/Math.tan(o)*i/n},S3MTile.prototype.distanceToTile=function(e){return getBoundingVolume$1(this).distanceToCamera(e)},S3MTile.prototype.visibility=function(e,t){var i=getBoundingVolume$1(this);return e.cullingVolume.computeVisibilityWithPlaneMask(i,t)},S3MTile.prototype.updateVisibility=function(e){var t=this.parent,i=defined(t)?t.visibilityPlaneMask:CullingVolume.MASK_INDETERMINATE;this.distanceToCamera=this.distanceToTile(e),this.pixel=this.getPixel(e),this.visibilityPlaneMask=this.visibility(e,i),this.visible=this.visibilityPlaneMask!==CullingVolume.MASK_OUTSIDE},S3MTile.prototype.requestContent=function(){var r=this,e=(this.layer,this.contentResource.clone()),t=new Request({throttle:!0,throttleByServer:!0,type:RequestType$1.TILES3D,priorityFunction:createPriorityFunction$1(this),serverKey:this.serverKey});this.request=t,e.request=t;var i=e.fetchArrayBuffer();if(!defined(i))return!1;this.contentState=ContentState$1.LOADING,this.contentReadyPromise=when.defer();var n=getContentFailedFunction$1(this);return i.then(function(e){if(r.isDestroyed())n();else{var t=S3ModelParser.parseBuffer(e),i=S3MContentParser.parse(r.layer,t);createChildren(r,i),r.selectedFrame=0,r.contentState=ContentState$1.READY,r.contentReadyPromise.resolve(t)}}).otherwise(function(e){t.state!==RequestState$1.CANCELLED?n(e):r.contentState=ContentState$1.UNLOADED}),!0},S3MTile.prototype.update=function(e){var t=this.renderEntityMap;for(var i in t)t.hasOwnProperty(i)&&t[i].update(e)},S3MTile.prototype.free=function(){for(var e=0,t=this.children.length;e<t;e++){this.children[e].destroy()}this.children.length=0,this.contentState=ContentState$1.UNLOADED},S3MTile.prototype.isDestroyed=function(){return!1},S3MTile.prototype.destroy=function(){for(var e in this.renderEntityMap)this.renderEntityMap.hasOwnProperty(e)&&this.renderEntityMap[e].destroy();this.renderEntityMap=void 0;for(var t=0,i=this.children.length;t<i;t++){this.children[t].destroy()}return this.children.length=0,destroyObject(this)},Object.defineProperties(S3MTilesLayer.prototype,{ready:{get:function(){return 0<this._rootTiles.length}},readyPromise:{get:function(){return this._readyPromise}},rectangle:{get:function(){return this._rectangle}},totalMemoryUsageInBytes:{get:function(){return this._totalMemoryUsageInBytes},set:function(e){this._totalMemoryUsageInBytes=e}},maximumMemoryUsage:{get:function(){return this._maximumMemoryUsage},set:function(e){this._maximumMemoryUsage=e}}}),S3MTilesLayer.prototype.loadConfig=function(e){var c=this;when(e).then(function(e){var t,i=Resource.createIfNeeded(e);return t=i.getBaseUri(!0),c._url=i.url,c._basePath=t,(c._baseResource=i).fetchJson()}).then(function(e){var t=e.extensions;c.fileType=t["s3m:FileType"];var i=e.position.x,r=e.position.y,n=e.position.z;c._position=Cartesian3.fromDegrees(i,r,n),c.modelMatrix=Transforms.eastNorthUpToFixedFrame(c._position),c._rectangle=Rectangle.fromDegrees(e.geoBounds.left,e.geoBounds.bottom,e.geoBounds.right,e.geoBounds.top);for(var a=0,o=e.tiles.length;a<o;a++){var s=e.tiles[a].url,l={box:e.tiles[a].boundingbox},u=new S3MTile(c,void 0,l,s);c._cache.add(u),c._rootTiles.push(u)}c._readyPromise.resolve(c)}).otherwise(function(e){c._readyPromise.reject(e)})},S3MTilesLayer.prototype.prePassesUpdate=function(e){this.ready&&e.newFrame&&this._cache.reset()},S3MTilesLayer.prototype.update=function(e){this.ready&&(this._schuduler.scheduler(this,e),requestTiles$1(this),updateTiles$1(this,e),freeResource(this))};var RectangularSensorVS="attribute vec4 position;\nattribute vec3 normal;\nvarying vec3 v_position;\nvarying vec3 v_positionWC;\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvoid main()\n{\n gl_Position = czm_modelViewProjection * position;\n v_position = vec3(position);\n v_positionWC = (czm_model * position).xyz;\n v_positionEC = (czm_modelView * position).xyz;\n v_normalEC = czm_normal * normal;\n}\n",RectangularSensorFS='#ifdef GL_OES_standard_derivatives\n #extension GL_OES_standard_derivatives : enable\n#endif\nuniform bool u_showIntersection;\nuniform bool u_showThroughEllipsoid;\nuniform float u_radius;\nuniform float u_xHalfAngle;\nuniform float u_yHalfAngle;\nuniform float u_normalDirection;\nuniform float u_type;\nvarying vec3 v_position;\nvarying vec3 v_positionWC;\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvec4 getColor(float sensorRadius, vec3 pointEC)\n{\n czm_materialInput materialInput;\n vec3 pointMC = (czm_inverseModelView * vec4(pointEC, 1.0)).xyz;\n materialInput.st = sensor2dTextureCoordinates(sensorRadius, pointMC);\n materialInput.str = pointMC / sensorRadius;\n vec3 positionToEyeEC = -v_positionEC;\n materialInput.positionToEyeEC = positionToEyeEC;\n vec3 normalEC = normalize(v_normalEC);\n materialInput.normalEC = u_normalDirection * normalEC;\n czm_material material = czm_getMaterial(materialInput);\n return mix(czm_phong(normalize(positionToEyeEC), material,czm_lightDirectionEC), vec4(material.diffuse, material.alpha), 0.4);\n}\nbool isOnBoundary(float value, float epsilon)\n{\n float width = getIntersectionWidth();\n float tolerance = width * epsilon;\n#ifdef GL_OES_standard_derivatives\n float delta = max(abs(dFdx(value)), abs(dFdy(value)));\n float pixels = width * delta;\n float temp = abs(value);\n // There are a couple things going on here.\n // First we test the value at the current fragment to see if it is within the tolerance.\n // We also want to check if the value of an adjacent pixel is within the tolerance,\n // but we don\'t want to admit points that are obviously not on the surface.\n // For example, if we are looking for "value" to be close to 0, but value is 1 and the adjacent value is 2,\n // then the delta would be 1 and "temp - delta" would be "1 - 1" which is zero even though neither of\n // the points is close to zero.\n return temp < tolerance && temp < pixels || (delta < 10.0 * tolerance && temp - delta < tolerance && temp < pixels);\n#else\n return abs(value) < tolerance;\n#endif\n}\nvec4 shade(bool isOnBoundary)\n{\n if (u_showIntersection && isOnBoundary)\n {\n return getIntersectionColor();\n }\n if(u_type == 1.0){\n return getLineColor();\n }\n return getColor(u_radius, v_positionEC);\n}\nfloat ellipsoidSurfaceFunction(vec3 point)\n{\n vec3 scaled = czm_ellipsoidInverseRadii * point;\n return dot(scaled, scaled) - 1.0;\n}\nvoid main()\n{\n vec3 sensorVertexWC = czm_model[3].xyz; // (0.0, 0.0, 0.0) in model coordinates\n vec3 sensorVertexEC = czm_modelView[3].xyz; // (0.0, 0.0, 0.0) in model coordinates\n //vec3 pixDir = normalize(v_position);\n float positionX = v_position.x;\n float positionY = v_position.y;\n float positionZ = v_position.z;\n vec3 zDir = vec3(0.0, 0.0, 1.0);\n vec3 lineX = vec3(positionX, 0 ,positionZ);\n vec3 lineY = vec3(0, positionY, positionZ);\n float resX = dot(normalize(lineX), zDir);\n if(resX < cos(u_xHalfAngle)-0.00001){\n discard;\n }\n float resY = dot(normalize(lineY), zDir);\n if(resY < cos(u_yHalfAngle)-0.00001){\n discard;\n }\n // czm_ellipsoid ellipsoid = czm_getWgs84EllipsoidEC();\n float ellipsoidValue = ellipsoidSurfaceFunction(v_positionWC);\n // Occluded by the ellipsoid?\n\tif (!u_showThroughEllipsoid)\n\t{\n\t // Discard if in the ellipsoid\n\t // PERFORMANCE_IDEA: A coarse check for ellipsoid intersection could be done on the CPU first.\n\t if (ellipsoidValue < 0.0)\n\t {\n discard;\n\t }\n\t // Discard if in the sensor\'s shadow\n\t if (inSensorShadow(sensorVertexWC, v_positionWC))\n\t {\n\t discard;\n\t }\n }\n // Notes: Each surface functions should have an associated tolerance based on the floating point error.\n bool isOnEllipsoid = isOnBoundary(ellipsoidValue, czm_epsilon3);\n //isOnEllipsoid = false;\n //if((resX >= 0.8 && resX <= 0.81)||(resY >= 0.8 && resY <= 0.81)){\n /*if(false){\n gl_FragColor = vec4(1.0,0.0,0.0,1.0);\n }else{\n gl_FragColor = shade(isOnEllipsoid);\n }\n*/\n gl_FragColor = shade(isOnEllipsoid);\n}\n',RectangularSensor="uniform vec4 u_intersectionColor;\nuniform float u_intersectionWidth;\nuniform vec4 u_lineColor;\nbool inSensorShadow(vec3 coneVertexWC, vec3 pointWC)\n{\n // Diagonal matrix from the unscaled ellipsoid space to the scaled space. \n vec3 D = czm_ellipsoidInverseRadii;\n // Sensor vertex in the scaled ellipsoid space\n vec3 q = D * coneVertexWC;\n float qMagnitudeSquared = dot(q, q);\n float test = qMagnitudeSquared - 1.0;\n // Sensor vertex to fragment vector in the ellipsoid's scaled space\n vec3 temp = D * pointWC - q;\n float d = dot(temp, q);\n // Behind silhouette plane and inside silhouette cone\n return (d < -test) && (d / length(temp) < -sqrt(test));\n}\n///////////////////////////////////////////////////////////////////////////////\nvec4 getLineColor()\n{\n return u_lineColor;\n}\nvec4 getIntersectionColor()\n{\n return u_intersectionColor;\n}\nfloat getIntersectionWidth()\n{\n return u_intersectionWidth;\n}\nvec2 sensor2dTextureCoordinates(float sensorRadius, vec3 pointMC)\n{\n // (s, t) both in the range [0, 1]\n float t = pointMC.z / sensorRadius;\n float s = 1.0 + (atan(pointMC.y, pointMC.x) / czm_twoPi);\n s = s - floor(s);\n return vec2(s, t);\n}\n",RectangularSensorScanPlaneFS='#ifdef GL_OES_standard_derivatives\n #extension GL_OES_standard_derivatives : enable\n#endif\nuniform bool u_showIntersection;\nuniform bool u_showThroughEllipsoid;\nuniform float u_radius;\nuniform float u_xHalfAngle;\nuniform float u_yHalfAngle;\nuniform float u_normalDirection;\nuniform vec4 u_color;\nvarying vec3 v_position;\nvarying vec3 v_positionWC;\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvec4 getColor(float sensorRadius, vec3 pointEC)\n{\n czm_materialInput materialInput;\n vec3 pointMC = (czm_inverseModelView * vec4(pointEC, 1.0)).xyz;\n materialInput.st = sensor2dTextureCoordinates(sensorRadius, pointMC);\n materialInput.str = pointMC / sensorRadius;\n vec3 positionToEyeEC = -v_positionEC;\n materialInput.positionToEyeEC = positionToEyeEC;\n vec3 normalEC = normalize(v_normalEC);\n materialInput.normalEC = u_normalDirection * normalEC;\n czm_material material = czm_getMaterial(materialInput);\n material.diffuse = u_color.rgb;\n material.alpha = u_color.a;\n return mix(czm_phong(normalize(positionToEyeEC), material,czm_lightDirectionEC), vec4(material.diffuse, material.alpha), 0.4);\n}\nbool isOnBoundary(float value, float epsilon)\n{\n float width = getIntersectionWidth();\n float tolerance = width * epsilon;\n#ifdef GL_OES_standard_derivatives\n float delta = max(abs(dFdx(value)), abs(dFdy(value)));\n float pixels = width * delta;\n float temp = abs(value);\n // There are a couple things going on here.\n // First we test the value at the current fragment to see if it is within the tolerance.\n // We also want to check if the value of an adjacent pixel is within the tolerance,\n // but we don\'t want to admit points that are obviously not on the surface.\n // For example, if we are looking for "value" to be close to 0, but value is 1 and the adjacent value is 2,\n // then the delta would be 1 and "temp - delta" would be "1 - 1" which is zero even though neither of\n // the points is close to zero.\n return temp < tolerance && temp < pixels || (delta < 10.0 * tolerance && temp - delta < tolerance && temp < pixels);\n#else\n return abs(value) < tolerance;\n#endif\n}\nvec4 shade(bool isOnBoundary)\n{\n if (u_showIntersection && isOnBoundary)\n {\n return getIntersectionColor();\n }\nreturn getColor(u_radius, v_positionEC);\n}\nfloat ellipsoidSurfaceFunction(vec3 point)\n{\n vec3 scaled = czm_ellipsoidInverseRadii * point;\n return dot(scaled, scaled) - 1.0;\n}\nvoid main()\n{\n vec3 sensorVertexWC = czm_model[3].xyz; // (0.0, 0.0, 0.0) in model coordinates\n vec3 sensorVertexEC = czm_modelView[3].xyz; // (0.0, 0.0, 0.0) in model coordinates\n //vec3 pixDir = normalize(v_position);\n float positionX = v_position.x;\n float positionY = v_position.y;\n float positionZ = v_position.z;\n vec3 zDir = vec3(0.0, 0.0, 1.0);\n vec3 lineX = vec3(positionX, 0 ,positionZ);\n vec3 lineY = vec3(0, positionY, positionZ);\n float resX = dot(normalize(lineX), zDir);\n if(resX < cos(u_xHalfAngle) - 0.0001){\n discard;\n }\n float resY = dot(normalize(lineY), zDir);\n if(resY < cos(u_yHalfAngle)- 0.0001){\n discard;\n }\n // czm_ellipsoid ellipsoid = czm_getWgs84EllipsoidEC();\n float ellipsoidValue = ellipsoidSurfaceFunction(v_positionWC);\n // Occluded by the ellipsoid?\n\tif (!u_showThroughEllipsoid)\n\t{\n\t // Discard if in the ellipsoid\n\t // PERFORMANCE_IDEA: A coare check for ellipsoid intersection could be done on the CPU first.\n\t if (ellipsoidValue < 0.0)\n\t {\n\t discard;\n\t }\n\t // Discard if in the sensor\'s shadow\n\t if (inSensorShadow(sensorVertexWC, v_positionWC))\n\t {\ndiscard;\n}\n }\n // Notes: Each surface functions should have an associated tolerane based on the floating point error.\n bool isOnEllipsoid = isOnBoundary(ellipsoidValue, czm_epsilon3);\n gl_FragColor = shade(isOnEllipsoid);\n}\n',sin$3=Math.sin,cos$3=Math.cos,tan=Math.tan,atan=Math.atan,attributeLocations$5={position:0,normal:1};function RectangularSensorPrimitive(e){var t=this;e=defaultValue(e,defaultValue.EMPTY_OBJECT),this.show=defaultValue(e.show,!0),this.slice=defaultValue(e.slice,32),this.modelMatrix=Matrix4.clone(e.modelMatrix,new Matrix4),this._modelMatrix=new Matrix4,this._computedModelMatrix=new Matrix4,this._computedScanPlaneModelMatrix=new Matrix4,this.radius=defaultValue(e.radius,Number.POSITIVE_INFINITY),this._radius=void 0,this.xHalfAngle=defaultValue(e.xHalfAngle,0),this._xHalfAngle=void 0,this.yHalfAngle=defaultValue(e.yHalfAngle,0),this._yHalfAngle=void 0,this.lineColor=defaultValue(e.lineColor,Color.WHITE),this.showSectorLines=defaultValue(e.showSectorLines,!0),this.showSectorSegmentLines=defaultValue(e.showSectorSegmentLines,!0),this.showLateralSurfaces=defaultValue(e.showLateralSurfaces,!0),this.material=defined(e.material)?e.material:Material.fromType(Material.ColorType),this._material=void 0,this._translucent=void 0,this.lateralSurfaceMaterial=defined(e.lateralSurfaceMaterial)?e.lateralSurfaceMaterial:Material.fromType(Material.ColorType),this._lateralSurfaceMaterial=void 0,this._lateralSurfaceTranslucent=void 0,this.showDomeSurfaces=defaultValue(e.showDomeSurfaces,!0),this.domeSurfaceMaterial=defined(e.domeSurfaceMaterial)?e.domeSurfaceMaterial:Material.fromType(Material.ColorType),this._domeSurfaceMaterial=void 0,this.showDomeLines=defaultValue(e.showDomeLines,!0),this.showIntersection=defaultValue(e.showIntersection,!0),this.intersectionColor=defaultValue(e.intersectionColor,Color.WHITE),this.intersectionWidth=defaultValue(e.intersectionWidth,5),this.showThroughEllipsoid=defaultValue(e.showThroughEllipsoid,!1),this._showThroughEllipsoid=void 0,this.showScanPlane=defaultValue(e.showScanPlane,!0),this.scanPlaneColor=defaultValue(e.scanPlaneColor,Color.WHITE),this.scanPlaneMode=defaultValue(e.scanPlaneMode,"horizontal"),this.scanPlaneRate=defaultValue(e.scanPlaneRate,10),this._scanePlaneXHalfAngle=0,this._scanePlaneYHalfAngle=0,this._time=JulianDate.now(),this._boundingSphere=new BoundingSphere,this._boundingSphereWC=new BoundingSphere,this._sectorFrontCommand=new DrawCommand({owner:this,primitiveType:PrimitiveType$1.TRIANGLES,boundingVolume:this._boundingSphereWC}),this._sectorBackCommand=new DrawCommand({owner:this,primitiveType:PrimitiveType$1.TRIANGLES,boundingVolume:this._boundingSphereWC}),this._sectorVA=void 0,this._sectorLineCommand=new DrawCommand({owner:this,primitiveType:PrimitiveType$1.LINES,boundingVolume:this._boundingSphereWC}),this._sectorLineVA=void 0,this._sectorSegmentLineCommand=new DrawCommand({owner:this,primitiveType:PrimitiveType$1.LINES,boundingVolume:this._boundingSphereWC}),this._sectorSegmentLineVA=void 0,this._domeFrontCommand=new DrawCommand({owner:this,primitiveType:PrimitiveType$1.TRIANGLES,boundingVolume:this._boundingSphereWC}),this._domeBackCommand=new DrawCommand({owner:this,primitiveType:PrimitiveType$1.TRIANGLES,boundingVolume:this._boundingSphereWC}),this._domeVA=void 0,this._domeLineCommand=new DrawCommand({owner:this,primitiveType:PrimitiveType$1.LINES,boundingVolume:this._boundingSphereWC}),this._domeLineVA=void 0,this._scanPlaneFrontCommand=new DrawCommand({owner:this,primitiveType:PrimitiveType$1.TRIANGLES,boundingVolume:this._boundingSphereWC}),this._scanPlaneBackCommand=new DrawCommand({owner:this,primitiveType:PrimitiveType$1.TRIANGLES,boundingVolume:this._boundingSphereWC}),this._scanRadialCommand=void 0,this._colorCommands=[],this._frontFaceRS=void 0,this._backFaceRS=void 0,this._sp=void 0,this._uniforms={u_type:function(){return 0},u_xHalfAngle:function(){return t.xHalfAngle},u_yHalfAngle:function(){return t.yHalfAngle},u_radius:function(){return t.radius},u_showThroughEllipsoid:function(){return t.showThroughEllipsoid},u_showIntersection:function(){return t.showIntersection},u_intersectionColor:function(){return t.intersectionColor},u_intersectionWidth:function(){return t.intersectionWidth},u_normalDirection:function(){return 1},u_lineColor:function(){return t.lineColor}},this._scanUniforms={u_xHalfAngle:function(){return t._scanePlaneXHalfAngle},u_yHalfAngle:function(){return t._scanePlaneYHalfAngle},u_radius:function(){return t.radius},u_color:function(){return t.scanPlaneColor},u_showThroughEllipsoid:function(){return t.showThroughEllipsoid},u_showIntersection:function(){return t.showIntersection},u_intersectionColor:function(){return t.intersectionColor},u_intersectionWidth:function(){return t.intersectionWidth},u_normalDirection:function(){return 1},u_lineColor:function(){return t.lineColor}}}RectangularSensorPrimitive.prototype.update=function(e){var t=e.mode;if(this.show&&t===SceneMode$1.SCENE3D){var i=!1,r=!1,n=!1,a=this.xHalfAngle,o=this.yHalfAngle;if(a<0||o<0)throw new DeveloperError("halfAngle must be greater than or equal to zero.");if(0!==a&&0!==o){this._xHalfAngle===a&&this._yHalfAngle===o||(this._xHalfAngle=a,this._yHalfAngle=o,i=!0);var s=this.radius;if(s<0)throw new DeveloperError("this.radius must be greater than or equal to zero.");var l=!1;this._radius!==s&&(l=!0,this._radius=s,this._boundingSphere=new BoundingSphere(Cartesian3.ZERO,this.radius)),Matrix4.equals(this.modelMatrix,this._modelMatrix)&&!l||(Matrix4.clone(this.modelMatrix,this._modelMatrix),Matrix4.multiplyByUniformScale(this.modelMatrix,this.radius,this._computedModelMatrix),BoundingSphere.transform(this._boundingSphere,this.modelMatrix,this._boundingSphereWC));var u=this.showThroughEllipsoid;this._showThroughEllipsoid!==this.showThroughEllipsoid&&(this._showThroughEllipsoid=u,r=!0);var c=this.material;this._material!==c&&(this._material=c,n=r=!0);var d=c.isTranslucent();if(this._translucent!==d&&(this._translucent=d,r=!0),this.showScanPlane){var h=e.time,p=JulianDate.secondsDifference(h,this._time);p<0&&(this._time=JulianDate.clone(h,this._time));var f,m=Math.max(p%this.scanPlaneRate/this.scanPlaneRate,0);if("horizontal"===this.scanPlaneMode){var g=cos$3(f=2*o*m-o),y=tan(a),v=atan(g*y);this._scanePlaneXHalfAngle=v,this._scanePlaneYHalfAngle=f,Matrix3.fromRotationX(this._scanePlaneYHalfAngle,matrix3Scratch$2)}else{f=2*a*m-a;var _=tan(o),C=cos$3(f),x=atan(C*_);this._scanePlaneXHalfAngle=f,this._scanePlaneYHalfAngle=x,Matrix3.fromRotationY(this._scanePlaneXHalfAngle,matrix3Scratch$2)}Matrix4.multiplyByMatrix3(this.modelMatrix,matrix3Scratch$2,this._computedScanPlaneModelMatrix),Matrix4.multiplyByUniformScale(this._computedScanPlaneModelMatrix,this.radius,this._computedScanPlaneModelMatrix)}i&&createVertexArray$6(this,e),r&&createRenderState$6(this,u,d),n&&createShaderProgram$5(this,e,c),(r||n)&&createCommands$7(this,d);var b=e.commandList,A=e.passes,S=this._colorCommands;if(A.render)for(var w=0,E=S.length;w<E;w++){var T=S[w];b.push(T)}}}};var matrix3Scratch$2=new Matrix3,nScratch=new Cartesian3;function computeUnitPosiiton(e,t,i){for(var r=e.slice,n=cos$3(i),a=tan(i),o=cos$3(t),s=tan(t),l=atan(o*a),u=atan(n*s),c=[],d=0;d<r;d++){var h=2*l*d/(r-1)-l;c.push(new Cartesian3(0,sin$3(h),cos$3(h)))}var p=[];for(d=0;d<r;d++){h=2*u*d/(r-1)-u;p.push(new Cartesian3(sin$3(h),0,cos$3(h)))}return{zoy:c,zox:p}}function computeSectorPositions(e,t){var i=e.xHalfAngle,r=e.yHalfAngle,n=t.zoy,a=t.zox,o=[],s=Matrix3.fromRotationY(i,matrix3Scratch$2);return o.push(n.map(function(e){return Matrix3.multiplyByVector(s,e,new Cartesian3)})),s=Matrix3.fromRotationX(-r,matrix3Scratch$2),o.push(a.map(function(e){return Matrix3.multiplyByVector(s,e,new Cartesian3)}).reverse()),s=Matrix3.fromRotationY(-i,matrix3Scratch$2),o.push(n.map(function(e){return Matrix3.multiplyByVector(s,e,new Cartesian3)}).reverse()),s=Matrix3.fromRotationX(r,matrix3Scratch$2),o.push(a.map(function(e){return Matrix3.multiplyByVector(s,e,new Cartesian3)})),o}function createSectorVertexArray(e,t){for(var i=Array.prototype.concat.apply([],t).length-t.length,r=new Float32Array(18*i),n=0,a=0,o=t.length;a<o;a++){var s=t[a],l=Cartesian3.normalize(Cartesian3.cross(s[0],s[s.length-1],nScratch),nScratch),u=0;for(i=s.length-1;u<i;u++)r[n++]=0,r[n++]=0,r[n++]=0,r[n++]=-l.x,r[n++]=-l.y,r[n++]=-l.z,r[n++]=s[u].x,r[n++]=s[u].y,r[n++]=s[u].z,r[n++]=-l.x,r[n++]=-l.y,r[n++]=-l.z,r[n++]=s[u+1].x,r[n++]=s[u+1].y,r[n++]=s[u+1].z,r[n++]=-l.x,r[n++]=-l.y,r[n++]=-l.z}var c=Buffer$1.createVertexBuffer({context:e,typedArray:r,usage:BufferUsage$1.STATIC_DRAW}),d=6*Float32Array.BYTES_PER_ELEMENT;return new VertexArray({context:e,attributes:[{index:attributeLocations$5.position,vertexBuffer:c,componentsPerAttribute:3,componentDatatype:ComponentDatatype$1.FLOAT,offsetInBytes:0,strideInBytes:d},{index:attributeLocations$5.normal,vertexBuffer:c,componentsPerAttribute:3,componentDatatype:ComponentDatatype$1.FLOAT,offsetInBytes:3*Float32Array.BYTES_PER_ELEMENT,strideInBytes:d}]})}function createSectorLineVertexArray(e,t){for(var i=t.length,r=new Float32Array(9*i),n=0,a=0,o=t.length;a<o;a++){var s=t[a];r[n++]=0,r[n++]=0,r[n++]=0,r[n++]=s[0].x,r[n++]=s[0].y,r[n++]=s[0].z}var l=Buffer$1.createVertexBuffer({context:e,typedArray:r,usage:BufferUsage$1.STATIC_DRAW}),u=3*Float32Array.BYTES_PER_ELEMENT;return new VertexArray({context:e,attributes:[{index:attributeLocations$5.position,vertexBuffer:l,componentsPerAttribute:3,componentDatatype:ComponentDatatype$1.FLOAT,offsetInBytes:0,strideInBytes:u}]})}function createSectorSegmentLineVertexArray(e,t){for(var i=Array.prototype.concat.apply([],t).length-t.length,r=new Float32Array(9*i),n=0,a=0,o=t.length;a<o;a++){var s=t[a],l=0;for(i=s.length-1;l<i;l++)r[n++]=s[l].x,r[n++]=s[l].y,r[n++]=s[l].z,r[n++]=s[l+1].x,r[n++]=s[l+1].y,r[n++]=s[l+1].z}var u=Buffer$1.createVertexBuffer({context:e,typedArray:r,usage:BufferUsage$1.STATIC_DRAW}),c=3*Float32Array.BYTES_PER_ELEMENT;return new VertexArray({context:e,attributes:[{index:attributeLocations$5.position,vertexBuffer:u,componentsPerAttribute:3,componentDatatype:ComponentDatatype$1.FLOAT,offsetInBytes:0,strideInBytes:c}]})}function createDomeVertexArray(e){var t=EllipsoidGeometry.createGeometry(new EllipsoidGeometry({vertexFormat:VertexFormat.POSITION_ONLY,stackPartitions:32,slicePartitions:32}));return VertexArray.fromGeometry({context:e,geometry:t,attributeLocations:attributeLocations$5,bufferUsage:BufferUsage$1.STATIC_DRAW,interleave:!1})}function createDomeLineVertexArray(e){var t=EllipsoidOutlineGeometry.createGeometry(new EllipsoidOutlineGeometry({vertexFormat:VertexFormat.POSITION_ONLY,stackPartitions:32,slicePartitions:32}));return VertexArray.fromGeometry({context:e,geometry:t,attributeLocations:attributeLocations$5,bufferUsage:BufferUsage$1.STATIC_DRAW,interleave:!1})}function createScanPlaneVertexArray(e,t){for(var i=t.length-1,r=new Float32Array(9*i),n=0,a=0;a<i;a++)r[n++]=0,r[n++]=0,r[n++]=0,r[n++]=t[a].x,r[n++]=t[a].y,r[n++]=t[a].z,r[n++]=t[a+1].x,r[n++]=t[a+1].y,r[n++]=t[a+1].z;var o=Buffer$1.createVertexBuffer({context:e,typedArray:r,usage:BufferUsage$1.STATIC_DRAW}),s=3*Float32Array.BYTES_PER_ELEMENT;return new VertexArray({context:e,attributes:[{index:attributeLocations$5.position,vertexBuffer:o,componentsPerAttribute:3,componentDatatype:ComponentDatatype$1.FLOAT,offsetInBytes:0,strideInBytes:s}]})}function createVertexArray$6(e,t){var i=t.context,r=computeSectorPositions(e,computeUnitPosiiton(e,e.xHalfAngle,e.yHalfAngle));if(e.showLateralSurfaces&&(e._sectorVA=createSectorVertexArray(i,r)),e.showSectorLines&&(e._sectorLineVA=createSectorLineVertexArray(i,r)),e.showSectorSegmentLines&&(e._sectorSegmentLineVA=createSectorSegmentLineVertexArray(i,r)),e.showDomeSurfaces&&(e._domeVA=createDomeVertexArray(i)),e.showDomeLines&&(e._domeLineVA=createDomeLineVertexArray(i)),e.showScanPlane)if("horizontal"===e.scanPlaneMode){var n=computeUnitPosiiton(e,CesiumMath.PI_OVER_TWO,0);e._scanPlaneVA=createScanPlaneVertexArray(i,n.zox)}else{var a=computeUnitPosiiton(e,0,CesiumMath.PI_OVER_TWO);e._scanPlaneVA=createScanPlaneVertexArray(i,a.zoy)}}function createCommonShaderProgram(e,t,i){var r=t.context,n=RectangularSensorVS,a=new ShaderSource({sources:[RectangularSensor,i.shaderSource,RectangularSensorFS]});e._sp=ShaderProgram.replaceCache({context:r,shaderProgram:e._sp,vertexShaderSource:n,fragmentShaderSource:a,attributeLocations:attributeLocations$5});var o=new ShaderSource({sources:[RectangularSensor,i.shaderSource,RectangularSensorFS],pickColorQualifier:"uniform"});e._pickSP=ShaderProgram.replaceCache({context:r,shaderProgram:e._pickSP,vertexShaderSource:n,fragmentShaderSource:o,attributeLocations:attributeLocations$5})}function createScanPlaneShaderProgram(e,t,i){var r=t.context,n=RectangularSensorVS,a=new ShaderSource({sources:[RectangularSensor,i.shaderSource,RectangularSensorScanPlaneFS]});e._scanePlaneSP=ShaderProgram.replaceCache({context:r,shaderProgram:e._scanePlaneSP,vertexShaderSource:n,fragmentShaderSource:a,attributeLocations:attributeLocations$5})}function createShaderProgram$5(e,t,i){createCommonShaderProgram(e,t,i),e.showScanPlane&&createScanPlaneShaderProgram(e,t,i)}function createRenderState$6(e,t,i){i?(e._frontFaceRS=RenderState.fromCache({depthTest:{enabled:!t},depthMask:!1,blending:BlendingState$1.ALPHA_BLEND,cull:{enabled:!0,face:CullFace$1.BACK}}),e._backFaceRS=RenderState.fromCache({depthTest:{enabled:!t},depthMask:!1,blending:BlendingState$1.ALPHA_BLEND,cull:{enabled:!0,face:CullFace$1.FRONT}}),e._pickRS=RenderState.fromCache({depthTest:{enabled:!t},depthMask:!1,blending:BlendingState$1.ALPHA_BLEND})):(e._frontFaceRS=RenderState.fromCache({depthTest:{enabled:!t},depthMask:!0}),e._pickRS=RenderState.fromCache({depthTest:{enabled:!0},depthMask:!0}))}function createCommand$3(e,t,i,r,n,a,o,s,l,u,c,d){u&&i&&(i.vertexArray=o,i.renderState=n,i.shaderProgram=a,i.uniformMap=combine(s,e._material._uniforms),i.uniformMap.u_normalDirection=function(){return-1},i.pass=c,i.modelMatrix=l,e._colorCommands.push(i)),t.vertexArray=o,t.renderState=r,t.shaderProgram=a,t.uniformMap=combine(s,e._material._uniforms),d&&(t.uniformMap.u_type=function(){return 1}),t.pass=c,t.modelMatrix=l,e._colorCommands.push(t)}function createCommands$7(e,t){e._colorCommands.length=0;var i=t?Pass$1.TRANSLUCENT:Pass$1.OPAQUE;e.showLateralSurfaces&&createCommand$3(e,e._sectorFrontCommand,e._sectorBackCommand,e._frontFaceRS,e._backFaceRS,e._sp,e._sectorVA,e._uniforms,e._computedModelMatrix,t,i),e.showSectorLines&&createCommand$3(e,e._sectorLineCommand,void 0,e._frontFaceRS,e._backFaceRS,e._sp,e._sectorLineVA,e._uniforms,e._computedModelMatrix,t,i,!0),e.showSectorSegmentLines&&createCommand$3(e,e._sectorSegmentLineCommand,void 0,e._frontFaceRS,e._backFaceRS,e._sp,e._sectorSegmentLineVA,e._uniforms,e._computedModelMatrix,t,i,!0),e.showDomeSurfaces&&createCommand$3(e,e._domeFrontCommand,e._domeBackCommand,e._frontFaceRS,e._backFaceRS,e._sp,e._domeVA,e._uniforms,e._computedModelMatrix,t,i),e.showDomeLines&&createCommand$3(e,e._domeLineCommand,void 0,e._frontFaceRS,e._backFaceRS,e._sp,e._domeLineVA,e._uniforms,e._computedModelMatrix,t,i,!0),e.showScanPlane&&createCommand$3(e,e._scanPlaneFrontCommand,e._scanPlaneBackCommand,e._frontFaceRS,e._backFaceRS,e._scanePlaneSP,e._scanPlaneVA,e._scanUniforms,e._computedScanPlaneModelMatrix,t,i)}var matrix3Scratch$3=new Matrix3,cachedPosition=new Cartesian3,cachedGazePosition=new Cartesian3,cachedOrientation=new Quaternion,diffVectorScratch=new Cartesian3,orientationScratch$1=new Quaternion,RectangularSensorVisualizer=function(e,t){if(!defined(e))throw new DeveloperError("scene is required.");if(!defined(t))throw new DeveloperError("entityCollection is required.");t.collectionChanged.addEventListener(RectangularSensorVisualizer.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._hash={},this._entitiesToVisualize=new AssociativeArray,this._onCollectionChanged(t,t.values,[],[])};RectangularSensorVisualizer.prototype.update=function(e){if(!defined(e))throw new DeveloperError("time is required.");for(var t=this._entitiesToVisualize.values,i=this._hash,r=this._primitives,n=0,a=t.length;n<a;n++){var o,s,l,u,c=t[n],d=c._rectangularSensor,h=i[c.id],p=c.isShowing&&c.isAvailable(e)&&Property.getValueOrDefault(d._show,e,!0);if(p&&(o=Property.getValueOrUndefined(c._position,e,cachedPosition),C=Property.getValueOrUndefined(c._orientation,e,cachedOrientation),s=Property.getValueOrUndefined(d._radius,e),l=Property.getValueOrUndefined(d._xHalfAngle,e),u=Property.getValueOrUndefined(d._yHalfAngle,e),p=defined(o)&&defined(l)&&defined(u)),p){var f=defined(h)?h.primitive:void 0;defined(f)||((f=new RectangularSensorPrimitive).id=c,r.add(f),h={primitive:f,position:void 0,orientation:void 0},i[c.id]=h);var m=Property.getValueOrUndefined(d._gaze,e);if(defined(m)){var g=Property.getValueOrUndefined(m._position,e,cachedGazePosition);if(!defined(o)||!defined(g))continue;var y=Cartesian3.subtract(o,g,diffVectorScratch),v=Cartesian3.angleBetween(Cartesian3.UNIT_Z,y),_=Cartesian3.cross(Cartesian3.UNIT_Z,y,diffVectorScratch),C=Quaternion.fromAxisAngle(_,v-Math.PI,orientationScratch$1);s=Cartesian3.distance(o,g),f.modelMatrix=Matrix4.fromRotationTranslation(Matrix3.fromQuaternion(C,matrix3Scratch$3),o,f.modelMatrix)}else Cartesian3.equals(o,h.position)&&Quaternion.equals(C,h.orientation)||(defined(C)?(f.modelMatrix=Matrix4.fromRotationTranslation(Matrix3.fromQuaternion(C,matrix3Scratch$3),o,f.modelMatrix),h.position=Cartesian3.clone(o,h.position),h.orientation=Quaternion.clone(C,h.orientation)):(f.modelMatrix=Transforms.eastNorthUpToFixedFrame(o),h.position=Cartesian3.clone(o,h.position)));f.show=!0,f.gaze=m,f.radius=s,f.xHalfAngle=l,f.yHalfAngle=u,f.lineColor=Property.getValueOrDefault(d._lineColor,e,Color.WHITE),f.showSectorLines=Property.getValueOrDefault(d._showSectorLines,e,!0),f.showSectorSegmentLines=Property.getValueOrDefault(d._showSectorSegmentLines,e,!0),f.showLateralSurfaces=Property.getValueOrDefault(d._showLateralSurfaces,e,!0),f.material=MaterialProperty.getValue(e,d._material,f.material),f.showDomeSurfaces=Property.getValueOrDefault(d._showDomeSurfaces,e,!0),f.showDomeLines=Property.getValueOrDefault(d._showDomeLines,e,!0),f.showIntersection=Property.getValueOrDefault(d._showIntersection,e,!0),f.intersectionColor=Property.getValueOrDefault(d._intersectionColor,e,Color.WHITE),f.intersectionWidth=Property.getValueOrDefault(d._intersectionWidth,e,1),f.showThroughEllipsoid=Property.getValueOrDefault(d._showThroughEllipsoid,e,!0),f.scanPlaneMode=Property.getValueOrDefault(d._scanPlaneMode,e),f.scanPlaneColor=Property.getValueOrDefault(d._scanPlaneColor,e,Color.WHITE),f.showScanPlane=Property.getValueOrDefault(d._showScanPlane,e,!0),f.scanPlaneRate=Property.getValueOrDefault(d._scanPlaneRate,e,1)}else defined(h)&&(h.primitive.show=!1)}return!0},RectangularSensorVisualizer.prototype.isDestroyed=function(){return!1},RectangularSensorVisualizer.prototype.destroy=function(){for(var e=this._entitiesToVisualize.values,t=this._hash,i=this._primitives,r=e.length-1;-1<r;r--)removePrimitive(e[r],t,i);return destroyObject(this)},RectangularSensorVisualizer.prototype._onCollectionChanged=function(e,t,i,r){var n,a,o=this._entitiesToVisualize,s=this._hash,l=this._primitives;for(n=t.length-1;-1<n;n--)defined((a=t[n])._rectangularSensor)&&defined(a._position)&&o.set(a.id,a);for(n=r.length-1;-1<n;n--)defined((a=r[n])._rectangularSensor)&&defined(a._position)?o.set(a.id,a):(removePrimitive(a,s,l),o.remove(a.id));for(n=i.length-1;-1<n;n--)removePrimitive(a=i[n],s,l),o.remove(a.id)};var Sensor={},originalDefaultVisualizersCallback=DataSourceDisplay.defaultVisualizersCallback;DataSourceDisplay.defaultVisualizersCallback=function(e,t,i){var r=i.entities;return originalDefaultVisualizersCallback(e,t,i).concat([new RectangularSensorVisualizer(e,r)])};var DepthViewPacked="uniform sampler2D u_depthTexture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nfloat z_window = czm_unpackDepth(texture2D(u_depthTexture, v_textureCoordinates));\nz_window = czm_reverseLogDepth(z_window);\nfloat n_range = czm_depthRange.near;\nfloat f_range = czm_depthRange.far;\nfloat z_ndc = (2.0 * z_window - n_range - f_range) / (f_range - n_range);\nfloat scale = pow(z_ndc * 0.5 + 0.5, 8.0);\ngl_FragColor = vec4(mix(vec3(0.0), vec3(1.0), scale), 1.0);\n}\n",PostProcessRain="uniform sampler2D colorTexture;\nvarying vec2 v_textureCoordinates;\nfloat hash(float x)\n{\nreturn fract(sin(x*133.3)*13.13);\n}\nvoid main(void)\n{\nfloat time = czm_frameNumber / 60.0;\nvec2 resolution = czm_viewport.zw;\nvec2 uv=(gl_FragCoord.xy*2.-resolution.xy)/min(resolution.x,resolution.y);\nvec3 c=vec3(.6,.7,.8);\nfloat a=-.4;\nfloat si=sin(a),co=cos(a);\nuv*=mat2(co,-si,si,co);\nuv*=length(uv+vec2(0,4.9))*.3+1.;\nfloat v=1.-sin(hash(floor(uv.x*100.))*2.);\nfloat b=clamp(abs(sin(20.*time*v+uv.y*(5./(2.+v))))-.95,0.,1.)*20.;\nc*=v*b;\ngl_FragColor = mix(texture2D(colorTexture, v_textureCoordinates), vec4(c,1), 0.5);\n}\n",PostProcessSnow="uniform sampler2D colorTexture;\nvarying vec2 v_textureCoordinates;\nfloat snow(vec2 uv,float scale)\n{\nfloat time = czm_frameNumber / 60.0;\nfloat w=smoothstep(1.,0.,-uv.y*(scale/10.));if(w<.1)return 0.;\nuv+=time/scale;uv.y+=time*2./scale;uv.x+=sin(uv.y+time*.5)/scale;\nuv*=scale;vec2 s=floor(uv),f=fract(uv),p;float k=3.,d;\np=.5+.35*sin(11.*fract(sin((s+p+scale)*mat2(7,3,6,5))*5.))-f;d=length(p);k=min(d,k);\nk=smoothstep(0.,k,sin(f.x+f.y)*0.01);\nreturn k*w;\n}\nvoid main(void)\n{\nvec2 resolution = czm_viewport.zw;\nvec2 uv=(gl_FragCoord.xy*2.-resolution.xy)/min(resolution.x,resolution.y);\nvec3 finalColor=vec3(0);\nfloat c = 0.0;\nc+=snow(uv,30.)*.0;\nc+=snow(uv,20.)*.0;\nc+=snow(uv,15.)*.0;\nc+=snow(uv,10.);\nc+=snow(uv,8.);\nc+=snow(uv,6.);\nc+=snow(uv,5.);\nfinalColor=(vec3(c));\ngl_FragColor = mix(texture2D(colorTexture, v_textureCoordinates), vec4(finalColor,1), 0.5);\n}\n",SunShaft="varying vec2 v_textureCoordinates;\nuniform sampler2D colorTexture;\nconst float _BlurRadius = 5.0;\nconst int _Iteration = 30;\nconst float _SunScreenRadius = 0.3;\nconst float exposure = 1.0;\nconst float gamma = 2.2;\nvec4 getColor(vec2 p, vec2 sunCoord)\n{\nvec2 blurVector = (p - sunCoord) * _BlurRadius;\nvec4 acumulateColor = vec4(0, 0, 0, 0);\nvec2 texcoord = p;\nfor (int j = 0; j < _Iteration; j ++)\n{\nacumulateColor += texture2D(colorTexture, texcoord);\ntexcoord += blurVector;\n}\nvec4 color = acumulateColor / float(_Iteration);\nreturn color;\n}\nvoid main()\n{\nvec4 sunPos = czm_morphTime == 1.0 ? vec4(czm_sunPositionWC, 1.0) : vec4(czm_sunPositionColumbusView.zxy, 1.0);\nvec4 sunPositionEC = czm_view * sunPos;\nvec4 sunPositionWC = czm_eyeToWindowCoordinates(sunPositionEC);\nsunPos = czm_viewportOrthographic * vec4(sunPositionWC.xy, -sunPositionWC.z, 1.0);\nvec2 sunTexcoord = sunPos.xy * 0.5 + vec2(0.5);\ngl_FragColor = getColor(v_textureCoordinates, sunTexcoord);\n}\n",SunShaftHdr="varying vec2 v_textureCoordinates;\nuniform sampler2D colorTexture;\nconst float threshold = 0.5;\nvoid main()\n{\nvec4 fragColor = texture2D(colorTexture, v_textureCoordinates);\nfloat brightness = dot(fragColor.rgb, vec3(0.2126, 0.7152, 0.0722));\ngl_FragColor = brightness > threshold ? vec4(fragColor.rgb, 1.0) : vec4(0.0, 0.0, 0.0, 1.0);\n}\n";function removePipelineExtras(e){return ForEach.shader(e,function(e){removeExtras(e)}),ForEach.buffer(e,function(e){removeExtras(e)}),ForEach.image(e,function(e){removeExtras(e),ForEach.compressedImage(e,function(e){removeExtras(e)})}),removeExtras(e),e}function removeExtras(e){defined(e.extras)&&(defined(e.extras._pipeline)&&delete e.extras._pipeline,0===Object.keys(e.extras).length&&delete e.extras)}var svgNS$1="http://www.w3.org/2000/svg",xlinkNS="http://www.w3.org/1999/xlink",widgetForDrag,gradientEnabledColor0=Color.fromCssColorString("rgba(247,250,255,0.384)"),gradientEnabledColor1=Color.fromCssColorString("rgba(143,191,255,0.216)"),gradientEnabledColor2=Color.fromCssColorString("rgba(153,197,255,0.098)"),gradientEnabledColor3=Color.fromCssColorString("rgba(255,255,255,0.086)"),gradientDisabledColor0=Color.fromCssColorString("rgba(255,255,255,0.267)"),gradientDisabledColor1=Color.fromCssColorString("rgba(255,255,255,0)"),gradientKnobColor=Color.fromCssColorString("rgba(66,67,68,0.3)"),gradientPointerColor=Color.fromCssColorString("rgba(0,0,0,0.5)");function getElementColor(e){return Color.fromCssColorString(window.getComputedStyle(e).getPropertyValue("color"))}function svgFromObject(e){var t=document.createElementNS(svgNS$1,e.tagName);for(var i in e)if(e.hasOwnProperty(i)&&"tagName"!==i)if("children"===i){var r,n=e.children.length;for(r=0;r<n;++r)t.appendChild(svgFromObject(e.children[r]))}else 0===i.indexOf("xlink:")?t.setAttributeNS(xlinkNS,i.substring(6),e[i]):"textContent"===i?t.textContent=e[i]:t.setAttribute(i,e[i]);return t}function svgText(e,t,i){var r=document.createElementNS(svgNS$1,"text");r.setAttribute("x",e),r.setAttribute("y",t),r.setAttribute("class","cesium-animation-svgText");var n=document.createElementNS(svgNS$1,"tspan");return n.textContent=i,r.appendChild(n),r}function setShuttleRingPointer(e,t,i){e.setAttribute("transform","translate(100,100) rotate("+i+")"),t.setAttribute("transform","rotate("+i+")")}var makeColorStringScratch=new Color;function makeColorString(e,t){var i=t.alpha,r=1-i;return makeColorStringScratch.red=e.red*r+t.red*i,makeColorStringScratch.green=e.green*r+t.green*i,makeColorStringScratch.blue=e.blue*r+t.blue*i,makeColorStringScratch.toCssColorString()}function rectButton(e,t,i){return svgFromObject({tagName:"g",class:"cesium-animation-rectButton",transform:"translate("+e+","+t+")",children:[{tagName:"rect",class:"cesium-animation-buttonGlow",width:32,height:32,rx:2,ry:2},{tagName:"rect",class:"cesium-animation-buttonMain",width:32,height:32,rx:4,ry:4},{tagName:"use",class:"cesium-animation-buttonPath","xlink:href":i},{tagName:"title",textContent:""}]})}function wingButton(e,t,i){return svgFromObject({tagName:"g",class:"cesium-animation-rectButton",transform:"translate("+e+","+t+")",children:[{tagName:"use",class:"cesium-animation-buttonGlow","xlink:href":"#animation_pathWingButton"},{tagName:"use",class:"cesium-animation-buttonMain","xlink:href":"#animation_pathWingButton"},{tagName:"use",class:"cesium-animation-buttonPath","xlink:href":i},{tagName:"title",textContent:""}]})}function setShuttleRingFromMouseOrTouch(e,t){var i=e._viewModel,r=i.shuttleRingDragging;if(!r||widgetForDrag===e)if("mousedown"===t.type||r&&"mousemove"===t.type||"touchstart"===t.type&&1===t.touches.length||r&&"touchmove"===t.type&&1===t.touches.length){var n,a,o=e._centerX,s=e._centerY,l=e._svgNode.getBoundingClientRect();if(a="touchstart"===t.type||"touchmove"===t.type?(n=t.touches[0].clientX,t.touches[0].clientY):(n=t.clientX,t.clientY),!r&&(n>l.right||n<l.left||a<l.top||a>l.bottom))return;var u=e._shuttleRingPointer.getBoundingClientRect(),c=n-o-l.left,d=a-s-l.top,h=180*Math.atan2(d,c)/Math.PI+90;180<h&&(h-=360);var p=i.shuttleRingAngle;r||n<u.right&&n>u.left&&a>u.top&&a<u.bottom?(widgetForDrag=e,i.shuttleRingDragging=!0,i.shuttleRingAngle=h):h<p?i.slower():p<h&&i.faster(),t.preventDefault()}else e===widgetForDrag&&(widgetForDrag=void 0),i.shuttleRingDragging=!1}function SvgButton(e,t){this._viewModel=t,this.svgElement=e,this._enabled=void 0,this._toggled=void 0;var i=this;this._clickFunction=function(){var e=i._viewModel.command;e.canExecute&&e()},e.addEventListener("click",this._clickFunction,!0),this._subscriptions=[subscribeAndEvaluate(t,"toggled",this.setToggled,this),subscribeAndEvaluate(t,"tooltip",this.setTooltip,this),subscribeAndEvaluate(t.command,"canExecute",this.setEnabled,this)]}function Animation(e,t){e=getElement(e),this._viewModel=t,this._container=e,this._centerX=0,this._centerY=0,this._defsElement=void 0,this._svgNode=void 0,this._topG=void 0,this._lastHeight=void 0,this._lastWidth=void 0;var i=e.ownerDocument,r=document.createElement("style");r.textContent=".cesium-animation-rectButton .cesium-animation-buttonGlow { filter: url(#animation_blurred); }.cesium-animation-rectButton .cesium-animation-buttonMain { fill: url(#animation_buttonNormal); }.cesium-animation-buttonToggled .cesium-animation-buttonMain { fill: url(#animation_buttonToggled); }.cesium-animation-rectButton:hover .cesium-animation-buttonMain { fill: url(#animation_buttonHovered); }.cesium-animation-buttonDisabled .cesium-animation-buttonMain { fill: url(#animation_buttonDisabled); }.cesium-animation-shuttleRingG .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshGradient); }.cesium-animation-shuttleRingG:hover .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshHovered); }.cesium-animation-shuttleRingPointer { fill: url(#animation_shuttleRingPointerGradient); }.cesium-animation-shuttleRingPausePointer { fill: url(#animation_shuttleRingPointerPaused); }.cesium-animation-knobOuter { fill: url(#animation_knobOuter); }.cesium-animation-knobInner { fill: url(#animation_knobInner); }",i.head.insertBefore(r,i.head.childNodes[0]);var n=document.createElement("div");n.className="cesium-animation-theme",n.innerHTML='<div class="cesium-animation-themeNormal"></div><div class="cesium-animation-themeHover"></div><div class="cesium-animation-themeSelect"></div><div class="cesium-animation-themeDisabled"></div><div class="cesium-animation-themeKnob"></div><div class="cesium-animation-themePointer"></div><div class="cesium-animation-themeSwoosh"></div><div class="cesium-animation-themeSwooshHover"></div>',this._theme=n,this._themeNormal=n.childNodes[0],this._themeHover=n.childNodes[1],this._themeSelect=n.childNodes[2],this._themeDisabled=n.childNodes[3],this._themeKnob=n.childNodes[4],this._themePointer=n.childNodes[5],this._themeSwoosh=n.childNodes[6],this._themeSwooshHover=n.childNodes[7];var a=document.createElementNS(svgNS$1,"svg:svg");(this._svgNode=a).setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",xlinkNS);var o=document.createElementNS(svgNS$1,"g");this._topG=o,this._realtimeSVG=new SvgButton(wingButton(3,4,"#animation_pathClock"),t.playRealtimeViewModel),this._playReverseSVG=new SvgButton(rectButton(44,99,"#animation_pathPlayReverse"),t.playReverseViewModel),this._playForwardSVG=new SvgButton(rectButton(124,99,"#animation_pathPlay"),t.playForwardViewModel),this._pauseSVG=new SvgButton(rectButton(84,99,"#animation_pathPause"),t.pauseViewModel);var s=document.createElementNS(svgNS$1,"g");s.appendChild(this._realtimeSVG.svgElement),s.appendChild(this._playReverseSVG.svgElement),s.appendChild(this._playForwardSVG.svgElement),s.appendChild(this._pauseSVG.svgElement);var l=svgFromObject({tagName:"circle",class:"cesium-animation-shuttleRingBack",cx:100,cy:100,r:99});this._shuttleRingBackPanel=l;var u=svgFromObject({tagName:"g",class:"cesium-animation-shuttleRingSwoosh",children:[{tagName:"use",transform:"translate(100,97) scale(-1,1)","xlink:href":"#animation_pathSwooshFX"},{tagName:"use",transform:"translate(100,97)","xlink:href":"#animation_pathSwooshFX"},{tagName:"line",x1:100,y1:8,x2:100,y2:22}]});this._shuttleRingSwooshG=u,this._shuttleRingPointer=svgFromObject({tagName:"use",class:"cesium-animation-shuttleRingPointer","xlink:href":"#animation_pathPointer"});var c=svgFromObject({tagName:"g",transform:"translate(100,100)"});this._knobOuter=svgFromObject({tagName:"circle",class:"cesium-animation-knobOuter",cx:0,cy:0,r:71});var d=svgFromObject({tagName:"circle",class:"cesium-animation-knobInner",cx:0,cy:0,r:61});this._knobDate=svgText(0,-24,""),this._knobTime=svgText(0,-7,""),this._knobStatus=svgText(0,-41,"");var h=svgFromObject({tagName:"circle",class:"cesium-animation-blank",cx:0,cy:0,r:61}),p=document.createElementNS(svgNS$1,"g");p.setAttribute("class","cesium-animation-shuttleRingG"),e.appendChild(n),o.appendChild(p),o.appendChild(c),o.appendChild(s),p.appendChild(l),p.appendChild(u),p.appendChild(this._shuttleRingPointer),c.appendChild(this._knobOuter),c.appendChild(d),c.appendChild(this._knobDate),c.appendChild(this._knobTime),c.appendChild(this._knobStatus),c.appendChild(h),a.appendChild(o),e.appendChild(a);var f=this;function m(e){setShuttleRingFromMouseOrTouch(f,e)}this._mouseCallback=m,l.addEventListener("mousedown",m,!0),l.addEventListener("touchstart",m,!0),u.addEventListener("mousedown",m,!0),u.addEventListener("touchstart",m,!0),i.addEventListener("mousemove",m,!0),i.addEventListener("touchmove",m,!0),i.addEventListener("mouseup",m,!0),i.addEventListener("touchend",m,!0),i.addEventListener("touchcancel",m,!0),this._shuttleRingPointer.addEventListener("mousedown",m,!0),this._shuttleRingPointer.addEventListener("touchstart",m,!0),this._knobOuter.addEventListener("mousedown",m,!0),this._knobOuter.addEventListener("touchstart",m,!0);var g,y=this._knobTime.childNodes[0],v=this._knobDate.childNodes[0],_=this._knobStatus.childNodes[0];this._subscriptions=[subscribeAndEvaluate(t.pauseViewModel,"toggled",function(e){g!==e&&((g=e)?f._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPausePointer"):f._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPointer"))}),subscribeAndEvaluate(t,"shuttleRingAngle",function(e){setShuttleRingPointer(f._shuttleRingPointer,f._knobOuter,e)}),subscribeAndEvaluate(t,"dateLabel",function(e){v.textContent!==e&&(v.textContent=e)}),subscribeAndEvaluate(t,"timeLabel",function(e){y.textContent!==e&&(y.textContent=e)}),subscribeAndEvaluate(t,"multiplierLabel",function(e){_.textContent!==e&&(_.textContent=e)})],this.applyThemeChanges(),this.resize()}SvgButton.prototype.destroy=function(){this.svgElement.removeEventListener("click",this._clickFunction,!0);for(var e=this._subscriptions,t=0,i=e.length;t<i;t++)e[t].dispose();destroyObject(this)},SvgButton.prototype.isDestroyed=function(){return!1},SvgButton.prototype.setEnabled=function(e){if(this._enabled!==e){if(!(this._enabled=e))return void this.svgElement.setAttribute("class","cesium-animation-buttonDisabled");if(this._toggled)return void this.svgElement.setAttribute("class","cesium-animation-rectButton cesium-animation-buttonToggled");this.svgElement.setAttribute("class","cesium-animation-rectButton")}},SvgButton.prototype.setToggled=function(e){this._toggled!==e&&(this._toggled=e,this._enabled&&(e?this.svgElement.setAttribute("class","cesium-animation-rectButton cesium-animation-buttonToggled"):this.svgElement.setAttribute("class","cesium-animation-rectButton")))},SvgButton.prototype.setTooltip=function(e){this.svgElement.getElementsByTagName("title")[0].textContent=e},Object.defineProperties(Animation.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),Animation.prototype.isDestroyed=function(){return!1},Animation.prototype.destroy=function(){defined(this._observer)&&(this._observer.disconnect(),this._observer=void 0);var e=this._container.ownerDocument,t=this._mouseCallback;this._shuttleRingBackPanel.removeEventListener("mousedown",t,!0),this._shuttleRingBackPanel.removeEventListener("touchstart",t,!0),this._shuttleRingSwooshG.removeEventListener("mousedown",t,!0),this._shuttleRingSwooshG.removeEventListener("touchstart",t,!0),e.removeEventListener("mousemove",t,!0),e.removeEventListener("touchmove",t,!0),e.removeEventListener("mouseup",t,!0),e.removeEventListener("touchend",t,!0),e.removeEventListener("touchcancel",t,!0),this._shuttleRingPointer.removeEventListener("mousedown",t,!0),this._shuttleRingPointer.removeEventListener("touchstart",t,!0),this._knobOuter.removeEventListener("mousedown",t,!0),this._knobOuter.removeEventListener("touchstart",t,!0),this._container.removeChild(this._svgNode),this._container.removeChild(this._theme),this._realtimeSVG.destroy(),this._playReverseSVG.destroy(),this._playForwardSVG.destroy(),this._pauseSVG.destroy();for(var i=this._subscriptions,r=0,n=i.length;r<n;r++)i[r].dispose();return destroyObject(this)},Animation.prototype.resize=function(){var e=this._container.clientWidth,t=this._container.clientHeight;if(e!==this._lastWidth||t!==this._lastHeight){var i=this._svgNode,r=e,n=t;0===e&&0===t?(r=200,n=132):0===e?r=(n=t)/132*200:0===t&&(n=(r=e)/200*132);var a=r/200,o=n/132;i.style.cssText="width: "+r+"px; height: "+n+"px; position: absolute; bottom: 0; left: 0; overflow: hidden;",i.setAttribute("width",r),i.setAttribute("height",n),i.setAttribute("viewBox","0 0 "+r+" "+n),this._topG.setAttribute("transform","scale("+a+","+o+")"),this._centerX=Math.max(1,100*a),this._centerY=Math.max(1,100*o),this._lastHeight=e,this._lastWidth=t}},Animation.prototype.applyThemeChanges=function(){var e=this._container.ownerDocument;if(!e.body.contains(this._container)){if(defined(this._observer))return;var t=this;return t._observer=new MutationObserver(function(){e.body.contains(t._container)&&(t._observer.disconnect(),t._observer=void 0,t.applyThemeChanges())}),void t._observer.observe(e,{childList:!0,subtree:!0})}var i=getElementColor(this._themeNormal),r=getElementColor(this._themeHover),n=getElementColor(this._themeSelect),a=getElementColor(this._themeDisabled),o=getElementColor(this._themeKnob),s=getElementColor(this._themePointer),l=getElementColor(this._themeSwoosh),u=getElementColor(this._themeSwooshHover),c=svgFromObject({tagName:"defs",children:[{id:"animation_buttonNormal",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":makeColorString(i,gradientEnabledColor0)},{tagName:"stop",offset:"12%","stop-color":makeColorString(i,gradientEnabledColor1)},{tagName:"stop",offset:"46%","stop-color":makeColorString(i,gradientEnabledColor2)},{tagName:"stop",offset:"81%","stop-color":makeColorString(i,gradientEnabledColor3)}]},{id:"animation_buttonHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":makeColorString(r,gradientEnabledColor0)},{tagName:"stop",offset:"12%","stop-color":makeColorString(r,gradientEnabledColor1)},{tagName:"stop",offset:"46%","stop-color":makeColorString(r,gradientEnabledColor2)},{tagName:"stop",offset:"81%","stop-color":makeColorString(r,gradientEnabledColor3)}]},{id:"animation_buttonToggled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":makeColorString(n,gradientEnabledColor0)},{tagName:"stop",offset:"12%","stop-color":makeColorString(n,gradientEnabledColor1)},{tagName:"stop",offset:"46%","stop-color":makeColorString(n,gradientEnabledColor2)},{tagName:"stop",offset:"81%","stop-color":makeColorString(n,gradientEnabledColor3)}]},{id:"animation_buttonDisabled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":makeColorString(a,gradientDisabledColor0)},{tagName:"stop",offset:"75%","stop-color":makeColorString(a,gradientDisabledColor1)}]},{id:"animation_blurred",tagName:"filter",width:"200%",height:"200%",x:"-50%",y:"-50%",children:[{tagName:"feGaussianBlur",stdDeviation:4,in:"SourceGraphic"}]},{id:"animation_shuttleRingSwooshGradient",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":l.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":l.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":l.toCssColorString()}]},{id:"animation_shuttleRingSwooshHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":u.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":u.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":u.toCssColorString()}]},{id:"animation_shuttleRingPointerGradient",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":s.toCssColorString()},{tagName:"stop",offset:"40%","stop-color":s.toCssColorString()},{tagName:"stop",offset:"60%","stop-color":makeColorString(s,gradientPointerColor)},{tagName:"stop",offset:"100%","stop-color":makeColorString(s,gradientPointerColor)}]},{id:"animation_shuttleRingPointerPaused",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":"#CCC"},{tagName:"stop",offset:"40%","stop-color":"#CCC"},{tagName:"stop",offset:"60%","stop-color":"#555"},{tagName:"stop",offset:"100%","stop-color":"#555"}]},{id:"animation_knobOuter",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":makeColorString(o,gradientEnabledColor0)},{tagName:"stop",offset:"60%","stop-color":makeColorString(o,gradientKnobColor)},{tagName:"stop",offset:"85%","stop-color":makeColorString(o,gradientEnabledColor1)}]},{id:"animation_knobInner",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":makeColorString(o,gradientKnobColor)},{tagName:"stop",offset:"60%","stop-color":makeColorString(o,gradientEnabledColor0)},{tagName:"stop",offset:"85%","stop-color":makeColorString(o,gradientEnabledColor3)}]},{id:"animation_pathReset",tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M24.316,5.318,9.833,13.682,9.833,5.5,5.5,5.5,5.5,25.5,9.833,25.5,9.833,17.318,24.316,25.682z"},{id:"animation_pathPause",tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M13,5.5,7.5,5.5,7.5,25.5,13,25.5zM24.5,5.5,19,5.5,19,25.5,24.5,25.5z"},{id:"animation_pathPlay",tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z"},{id:"animation_pathPlayReverse",tagName:"path",transform:"translate(16,16) scale(-0.85,0.85) translate(-16,-16)",d:"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z"},{id:"animation_pathLoop",tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M24.249,15.499c-0.009,4.832-3.918,8.741-8.75,8.75c-2.515,0-4.768-1.064-6.365-2.763l2.068-1.442l-7.901-3.703l0.744,8.694l2.193-1.529c2.244,2.594,5.562,4.242,9.26,4.242c6.767,0,12.249-5.482,12.249-12.249H24.249zM15.499,6.75c2.516,0,4.769,1.065,6.367,2.764l-2.068,1.443l7.901,3.701l-0.746-8.693l-2.192,1.529c-2.245-2.594-5.562-4.245-9.262-4.245C8.734,3.25,3.25,8.734,3.249,15.499H6.75C6.758,10.668,10.668,6.758,15.499,6.75z"},{id:"animation_pathClock",tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-15.5)",d:"M15.5,2.374C8.251,2.375,2.376,8.251,2.374,15.5C2.376,22.748,8.251,28.623,15.5,28.627c7.249-0.004,13.124-5.879,13.125-13.127C28.624,8.251,22.749,2.375,15.5,2.374zM15.5,25.623C9.909,25.615,5.385,21.09,5.375,15.5C5.385,9.909,9.909,5.384,15.5,5.374c5.59,0.01,10.115,4.535,10.124,10.125C25.615,21.09,21.091,25.615,15.5,25.623zM8.625,15.5c-0.001-0.552-0.448-0.999-1.001-1c-0.553,0-1,0.448-1,1c0,0.553,0.449,1,1,1C8.176,16.5,8.624,16.053,8.625,15.5zM8.179,18.572c-0.478,0.277-0.642,0.889-0.365,1.367c0.275,0.479,0.889,0.641,1.365,0.365c0.479-0.275,0.643-0.887,0.367-1.367C9.27,18.461,8.658,18.297,8.179,18.572zM9.18,10.696c-0.479-0.276-1.09-0.112-1.366,0.366s-0.111,1.09,0.365,1.366c0.479,0.276,1.09,0.113,1.367-0.366C9.821,11.584,9.657,10.973,9.18,10.696zM22.822,12.428c0.478-0.275,0.643-0.888,0.366-1.366c-0.275-0.478-0.89-0.642-1.366-0.366c-0.479,0.278-0.642,0.89-0.366,1.367C21.732,12.54,22.344,12.705,22.822,12.428zM12.062,21.455c-0.478-0.275-1.089-0.111-1.366,0.367c-0.275,0.479-0.111,1.09,0.366,1.365c0.478,0.277,1.091,0.111,1.365-0.365C12.704,22.344,12.54,21.732,12.062,21.455zM12.062,9.545c0.479-0.276,0.642-0.888,0.366-1.366c-0.276-0.478-0.888-0.642-1.366-0.366s-0.642,0.888-0.366,1.366C10.973,9.658,11.584,9.822,12.062,9.545zM22.823,18.572c-0.48-0.275-1.092-0.111-1.367,0.365c-0.275,0.479-0.112,1.092,0.367,1.367c0.477,0.275,1.089,0.113,1.365-0.365C23.464,19.461,23.3,18.848,22.823,18.572zM19.938,7.813c-0.477-0.276-1.091-0.111-1.365,0.366c-0.275,0.48-0.111,1.091,0.366,1.367s1.089,0.112,1.366-0.366C20.581,8.702,20.418,8.089,19.938,7.813zM23.378,14.5c-0.554,0.002-1.001,0.45-1.001,1c0.001,0.552,0.448,1,1.001,1c0.551,0,1-0.447,1-1C24.378,14.949,23.929,14.5,23.378,14.5zM15.501,6.624c-0.552,0-1,0.448-1,1l-0.466,7.343l-3.004,1.96c-0.478,0.277-0.642,0.889-0.365,1.365c0.275,0.479,0.889,0.643,1.365,0.367l3.305-1.676C15.39,16.99,15.444,17,15.501,17c0.828,0,1.5-0.671,1.5-1.5l-0.5-7.876C16.501,7.072,16.053,6.624,15.501,6.624zM15.501,22.377c-0.552,0-1,0.447-1,1s0.448,1,1,1s1-0.447,1-1S16.053,22.377,15.501,22.377zM18.939,21.455c-0.479,0.277-0.643,0.889-0.366,1.367c0.275,0.477,0.888,0.643,1.366,0.365c0.478-0.275,0.642-0.889,0.366-1.365C20.028,21.344,19.417,21.18,18.939,21.455z"},{id:"animation_pathWingButton",tagName:"path",d:"m 4.5,0.5 c -2.216,0 -4,1.784 -4,4 l 0,24 c 0,2.216 1.784,4 4,4 l 13.71875,0 C 22.478584,27.272785 27.273681,22.511272 32.5,18.25 l 0,-13.75 c 0,-2.216 -1.784,-4 -4,-4 l -24,0 z"},{id:"animation_pathPointer",tagName:"path",d:"M-15,-65,-15,-55,15,-55,15,-65,0,-95z"},{id:"animation_pathSwooshFX",tagName:"path",d:"m 85,0 c 0,16.617 -4.813944,35.356 -13.131081,48.4508 h 6.099803 c 8.317138,-13.0948 13.13322,-28.5955 13.13322,-45.2124 0,-46.94483 -38.402714,-85.00262 -85.7743869,-85.00262 -1.0218522,0 -2.0373001,0.0241 -3.0506131,0.0589 45.958443,1.59437 82.723058,35.77285 82.723058,81.70532 z"}]});defined(this._defsElement)?this._svgNode.replaceChild(c,this._defsElement):this._svgNode.appendChild(c),this._defsElement=c};var monthNames=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],realtimeShuttleRingAngle=15,maxShuttleRingAngle=105;function numberComparator(e,t){return e-t}function getTypicalMultiplierIndex(e,t){var i=binarySearch(t,e,numberComparator);return i<0?~i:i}function angleToMultiplier(e,t){if(Math.abs(e)<=realtimeShuttleRingAngle)return e/realtimeShuttleRingAngle;var i,r=realtimeShuttleRingAngle,n=maxShuttleRingAngle;return 0<e?(i=(Math.log(t[t.length-1])-0)/(n-r),Math.exp(0+i*(e-r))):(i=(Math.log(-t[0])-0)/(n-r),-Math.exp(0+i*(Math.abs(e)-r)))}function multiplierToAngle(e,t,i){if(i.clockStep===ClockStep$1.SYSTEM_CLOCK)return realtimeShuttleRingAngle;if(Math.abs(e)<=1)return e*realtimeShuttleRingAngle;var r=t[t.length-1];r<e?e=r:e<-r&&(e=-r);var n,a=realtimeShuttleRingAngle,o=maxShuttleRingAngle;return 0<e?(n=(Math.log(r)-0)/(o-a),(Math.log(e)-0)/n+a):(n=(Math.log(-t[0])-0)/(o-a),-((Math.log(Math.abs(e))-0)/n+a))}function AnimationViewModel(e){var s=this;this._clockViewModel=e,this._allShuttleRingTicks=[],this._dateFormatter=AnimationViewModel.defaultDateFormatter,this._timeFormatter=AnimationViewModel.defaultTimeFormatter,this.shuttleRingDragging=!1,this.snapToTicks=!1,knockout.track(this,["_allShuttleRingTicks","_dateFormatter","_timeFormatter","shuttleRingDragging","snapToTicks"]),this._sortedFilteredPositiveTicks=[],this.setShuttleRingTicks(AnimationViewModel.defaultTicks),this.timeLabel=void 0,knockout.defineProperty(this,"timeLabel",function(){return s._timeFormatter(s._clockViewModel.currentTime,s)}),this.dateLabel=void 0,knockout.defineProperty(this,"dateLabel",function(){return s._dateFormatter(s._clockViewModel.currentTime,s)}),this.multiplierLabel=void 0,knockout.defineProperty(this,"multiplierLabel",function(){var e=s._clockViewModel;if(e.clockStep===ClockStep$1.SYSTEM_CLOCK)return"Today";var t=e.multiplier;return t%1==0?t.toFixed(0)+"x":t.toFixed(3).replace(/0{0,3}$/,"")+"x"}),this.shuttleRingAngle=void 0,knockout.defineProperty(this,"shuttleRingAngle",{get:function(){return multiplierToAngle(e.multiplier,s._allShuttleRingTicks,e)},set:function(e){e=Math.max(Math.min(e,maxShuttleRingAngle),-maxShuttleRingAngle);var t=s._allShuttleRingTicks,i=s._clockViewModel;if(i.clockStep=ClockStep$1.SYSTEM_CLOCK_MULTIPLIER,Math.abs(e)!==maxShuttleRingAngle){var r=angleToMultiplier(e,t);if(s.snapToTicks)r=t[getTypicalMultiplierIndex(r,t)];else if(0!==r){var n=Math.abs(r);if(100<n){var a=n.toFixed(0).length-2,o=Math.pow(10,a);r=Math.round(r/o)*o|0}else realtimeShuttleRingAngle<n?r=Math.round(r):1<n?r=+r.toFixed(1):0<n&&(r=+r.toFixed(2))}i.multiplier=r}else i.multiplier=0<e?t[t.length-1]:t[0]}}),this._canAnimate=void 0,knockout.defineProperty(this,"_canAnimate",function(){var e=s._clockViewModel,t=e.clockRange;if(s.shuttleRingDragging||t===ClockRange$1.UNBOUNDED)return!0;var i=e.multiplier,r=e.currentTime,n=e.startTime,a=!1;if(t===ClockRange$1.LOOP_STOP)a=JulianDate.greaterThan(r,n)||r.equals(n)&&0<i;else{var o=e.stopTime;a=JulianDate.greaterThan(r,n)&&JulianDate.lessThan(r,o)||r.equals(n)&&0<i||r.equals(o)&&i<0}return a||(e.shouldAnimate=!1),a}),this._isSystemTimeAvailable=void 0,knockout.defineProperty(this,"_isSystemTimeAvailable",function(){var e=s._clockViewModel;if(e.clockRange===ClockRange$1.UNBOUNDED)return!0;var t=e.systemTime;return JulianDate.greaterThanOrEquals(t,e.startTime)&&JulianDate.lessThanOrEquals(t,e.stopTime)}),this._isAnimating=void 0,knockout.defineProperty(this,"_isAnimating",function(){return s._clockViewModel.shouldAnimate&&(s._canAnimate||s.shuttleRingDragging)});var t=createCommand$2(function(){var e=s._clockViewModel;e.shouldAnimate?e.shouldAnimate=!1:s._canAnimate&&(e.shouldAnimate=!0)});this._pauseViewModel=new ToggleButtonViewModel(t,{toggled:knockout.computed(function(){return!s._isAnimating}),tooltip:"Pause"});var i=createCommand$2(function(){var e=s._clockViewModel,t=e.multiplier;0<t&&(e.multiplier=-t),e.shouldAnimate=!0});this._playReverseViewModel=new ToggleButtonViewModel(i,{toggled:knockout.computed(function(){return s._isAnimating&&e.multiplier<0}),tooltip:"Play Reverse"});var r=createCommand$2(function(){var e=s._clockViewModel,t=e.multiplier;t<0&&(e.multiplier=-t),e.shouldAnimate=!0});this._playForwardViewModel=new ToggleButtonViewModel(r,{toggled:knockout.computed(function(){return s._isAnimating&&0<e.multiplier&&e.clockStep!==ClockStep$1.SYSTEM_CLOCK}),tooltip:"Play Forward"});var n=createCommand$2(function(){s._clockViewModel.clockStep=ClockStep$1.SYSTEM_CLOCK},knockout.getObservable(this,"_isSystemTimeAvailable"));this._playRealtimeViewModel=new ToggleButtonViewModel(n,{toggled:knockout.computed(function(){return e.clockStep===ClockStep$1.SYSTEM_CLOCK}),tooltip:knockout.computed(function(){return s._isSystemTimeAvailable?"Today (real-time)":"Current time not in range"})}),this._slower=createCommand$2(function(){var e=s._clockViewModel,t=s._allShuttleRingTicks,i=getTypicalMultiplierIndex(e.multiplier,t)-1;0<=i&&(e.multiplier=t[i])}),this._faster=createCommand$2(function(){var e=s._clockViewModel,t=s._allShuttleRingTicks,i=getTypicalMultiplierIndex(e.multiplier,t)+1;i<t.length&&(e.multiplier=t[i])})}function BaseLayerPickerViewModel(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).globe,i=defaultValue(e.imageryProviderViewModels,[]),r=defaultValue(e.terrainProviderViewModels,[]);this._globe=t,this.imageryProviderViewModels=i.slice(0),this.terrainProviderViewModels=r.slice(0),this.dropDownVisible=!1,knockout.track(this,["imageryProviderViewModels","terrainProviderViewModels","dropDownVisible"]);var l=knockout.getObservable(this,"imageryProviderViewModels"),n=knockout.pureComputed(function(){var e,t=l(),i={};for(e=0;e<t.length;e++){var r=t[e],n=r.category;defined(i[n])?i[n].push(r):i[n]=[r]}var a=Object.keys(i),o=[];for(e=0;e<a.length;e++){var s=a[e];o.push({name:s,providers:i[s]})}return o});this._imageryProviders=n;var u=knockout.getObservable(this,"terrainProviderViewModels"),a=knockout.pureComputed(function(){var e,t=u(),i={};for(e=0;e<t.length;e++){var r=t[e],n=r.category;defined(i[n])?i[n].push(r):i[n]=[r]}var a=Object.keys(i),o=[];for(e=0;e<a.length;e++){var s=a[e];o.push({name:s,providers:i[s]})}return o});this._terrainProviders=a,this.buttonTooltip=void 0,knockout.defineProperty(this,"buttonTooltip",function(){var e=this.selectedImagery,t=this.selectedTerrain,i=defined(e)?e.name:void 0,r=defined(t)?t.name:void 0;return defined(i)&&defined(r)?i+"\n"+r:defined(i)?i:r}),this.buttonImageUrl=void 0,knockout.defineProperty(this,"buttonImageUrl",function(){var e=this.selectedImagery;if(defined(e))return e.iconUrl}),this.selectedImagery=void 0;var d=knockout.observable();this._currentImageryProviders=[],knockout.defineProperty(this,"selectedImagery",{get:function(){return d()},set:function(e){if(d()!==e){var t,i=this._currentImageryProviders,r=i.length,n=this._globe.imageryLayers,a=!1;for(t=0;t<r;t++)for(var o=n.length,s=0;s<o;s++){var l=n.get(s);if(l.imageryProvider===i[t]){n.remove(l),a=!0;break}}if(defined(e)){var u=e.creationCommand();if(Array.isArray(u)){for(t=u.length-1;0<=t;t--)n.addImageryProvider(u[t],0);this._currentImageryProviders=u.slice(0)}else if(this._currentImageryProviders=[u],a)n.addImageryProvider(u,0);else{var c=n.get(0);defined(c)&&n.remove(c),n.addImageryProvider(u,0)}}d(e),this.dropDownVisible=!1}else this.dropDownVisible=!1}}),this.selectedTerrain=void 0;var o=knockout.observable();knockout.defineProperty(this,"selectedTerrain",{get:function(){return o()},set:function(e){var t;o()!==e?(defined(e)&&(t=e.creationCommand()),this._globe.depthTestAgainstTerrain=!(t instanceof EllipsoidTerrainProvider),this._globe.terrainProvider=t,o(e),this.dropDownVisible=!1):this.dropDownVisible=!1}});var s=this;this._toggleDropDown=createCommand$2(function(){s.dropDownVisible=!s.dropDownVisible}),this.selectedImagery=defaultValue(e.selectedImageryProviderViewModel,i[0]),this.selectedTerrain=defaultValue(e.selectedTerrainProviderViewModel,r[0])}function BaseLayerPicker(e,t){e=getElement(e);var i=new BaseLayerPickerViewModel(t),r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button",r.setAttribute("data-bind","attr: { title: buttonTooltip },click: toggleDropDown"),e.appendChild(r);var n=document.createElement("img");n.setAttribute("draggable","false"),n.className="cesium-baseLayerPicker-selected",n.setAttribute("data-bind","attr: { src: buttonImageUrl }, visible: !!buttonImageUrl"),r.appendChild(n);var a=document.createElement("div");a.className="cesium-baseLayerPicker-dropDown",a.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-dropDown-visible" : dropDownVisible }'),e.appendChild(a);var o=document.createElement("div");o.className="cesium-baseLayerPicker-sectionTitle",o.setAttribute("data-bind","visible: imageryProviderViewModels.length > 0"),o.innerHTML="Imagery",a.appendChild(o);var s=document.createElement("div");s.className="cesium-baseLayerPicker-section",s.setAttribute("data-bind","foreach: _imageryProviders"),a.appendChild(s);var l=document.createElement("div");l.className="cesium-baseLayerPicker-category",s.appendChild(l);var u=document.createElement("div");u.className="cesium-baseLayerPicker-categoryTitle",u.setAttribute("data-bind","text: name"),l.appendChild(u);var c=document.createElement("div");c.className="cesium-baseLayerPicker-choices",c.setAttribute("data-bind","foreach: providers"),l.appendChild(c);var d=document.createElement("div");d.className="cesium-baseLayerPicker-item",d.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedImagery },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedImagery = $data; }'),c.appendChild(d);var h=document.createElement("img");h.className="cesium-baseLayerPicker-itemIcon",h.setAttribute("data-bind","attr: { src: iconUrl }"),h.setAttribute("draggable","false"),d.appendChild(h);var p=document.createElement("div");p.className="cesium-baseLayerPicker-itemLabel",p.setAttribute("data-bind","text: name"),d.appendChild(p);var f=document.createElement("div");f.className="cesium-baseLayerPicker-sectionTitle",f.setAttribute("data-bind","visible: terrainProviderViewModels.length > 0"),f.innerHTML="Terrain",a.appendChild(f);var m=document.createElement("div");m.className="cesium-baseLayerPicker-section",m.setAttribute("data-bind","foreach: _terrainProviders"),a.appendChild(m);var g=document.createElement("div");g.className="cesium-baseLayerPicker-category",m.appendChild(g);var y=document.createElement("div");y.className="cesium-baseLayerPicker-categoryTitle",y.setAttribute("data-bind","text: name"),g.appendChild(y);var v=document.createElement("div");v.className="cesium-baseLayerPicker-choices",v.setAttribute("data-bind","foreach: providers"),g.appendChild(v);var _=document.createElement("div");_.className="cesium-baseLayerPicker-item",_.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedTerrain },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedTerrain = $data; }'),v.appendChild(_);var C=document.createElement("img");C.className="cesium-baseLayerPicker-itemIcon",C.setAttribute("data-bind","attr: { src: iconUrl }"),C.setAttribute("draggable","false"),_.appendChild(C);var x=document.createElement("div");x.className="cesium-baseLayerPicker-itemLabel",x.setAttribute("data-bind","text: name"),_.appendChild(x),knockout.applyBindings(i,r),knockout.applyBindings(i,a),this._viewModel=i,this._container=e,this._element=r,this._dropPanel=a,this._closeDropDown=function(e){r.contains(e.target)||a.contains(e.target)||(i.dropDownVisible=!1)},FeatureDetection$1.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}function ProviderViewModel(e){var t=e.creationFunction;defined(t.canExecute)||(t=createCommand$2(t)),this._creationCommand=t,this.name=e.name,this.tooltip=e.tooltip,this.iconUrl=e.iconUrl,this._category=defaultValue(e.category,""),knockout.track(this,["name","tooltip","iconUrl"])}function createDefaultImageryProviderViewModels(){var e=[];return e.push(new ProviderViewModel({name:"Bing Maps Aerial",iconUrl:buildModuleUrl("Widgets/Images/ImageryProviders/bingAerial.png"),tooltip:"Bing Maps aerial imagery, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return createWorldImagery({style:IonWorldImageryStyle$1.AERIAL})}})),e.push(new ProviderViewModel({name:"Bing Maps Aerial with Labels",iconUrl:buildModuleUrl("Widgets/Images/ImageryProviders/bingAerialLabels.png"),tooltip:"Bing Maps aerial imagery with labels, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return createWorldImagery({style:IonWorldImageryStyle$1.AERIAL_WITH_LABELS})}})),e.push(new ProviderViewModel({name:"Bing Maps Roads",iconUrl:buildModuleUrl("Widgets/Images/ImageryProviders/bingRoads.png"),tooltip:"Bing Maps standard road maps, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return createWorldImagery({style:IonWorldImageryStyle$1.ROAD})}})),e.push(new ProviderViewModel({name:"Mapbox Satellite",tooltip:"Mapbox satellite imagery https://www.mapbox.com/maps/",iconUrl:buildModuleUrl("Widgets/Images/ImageryProviders/mapboxSatellite.png"),category:"Other",creationFunction:function(){return new MapboxStyleImageryProvider({styleId:"satellite-v9"})}})),e.push(new ProviderViewModel({name:"Mapbox Streets",tooltip:"Mapbox streets imagery https://www.mapbox.com/maps/",iconUrl:buildModuleUrl("Widgets/Images/ImageryProviders/mapboxTerrain.png"),category:"Other",creationFunction:function(){return new MapboxStyleImageryProvider({styleId:"satellite-streets-v11"})}})),e.push(new ProviderViewModel({name:"Mapbox Streets Classic",tooltip:"Mapbox streets basic imagery https://www.mapbox.com/maps/",iconUrl:buildModuleUrl("Widgets/Images/ImageryProviders/mapboxStreets.png"),category:"Other",creationFunction:function(){return new MapboxStyleImageryProvider({styleId:"streets-v11"})}})),e.push(new ProviderViewModel({name:"ESRI World Imagery",iconUrl:buildModuleUrl("Widgets/Images/ImageryProviders/esriWorldImagery.png"),tooltip:"World Imagery provides one meter or better satellite and aerial imagery in many parts of the world and lower resolution satellite imagery worldwide. The map includes NASA Blue Marble: Next Generation 500m resolution imagery at small scales (above 1:1,000,000), i-cubed 15m eSAT imagery at medium-to-large scales (down to 1:70,000) for the world, and USGS 15m Landsat imagery for Antarctica. The map features 0.3m resolution imagery in the continental United States and 0.6m resolution imagery in parts of Western Europe from DigitalGlobe. In other parts of the world, 1 meter resolution imagery is available from GeoEye IKONOS, i-cubed Nationwide Prime, Getmapping, AeroGRID, IGN Spain, and IGP Portugal. Additionally, imagery at different resolutions has been contributed by the GIS User Community.\nhttp://www.esri.com",category:"Other",creationFunction:function(){return new ArcGisMapServerImageryProvider({url:"https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer",enablePickFeatures:!1})}})),e.push(new ProviderViewModel({name:"ESRI World Street Map",iconUrl:buildModuleUrl("Widgets/Images/ImageryProviders/esriWorldStreetMap.png"),tooltip:"This worldwide street map presents highway-level data for the world. Street-level data includes the United States; much of Canada; Japan; most countries in Europe; Australia and New Zealand; India; parts of South America including Argentina, Brazil, Chile, Colombia, and Venezuela; Ghana; and parts of southern Africa including Botswana, Lesotho, Namibia, South Africa, and Swaziland.\nhttp://www.esri.com",category:"Other",creationFunction:function(){return new ArcGisMapServerImageryProvider({url:"https://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer",enablePickFeatures:!1})}})),e.push(new ProviderViewModel({name:"ESRI National Geographic",iconUrl:buildModuleUrl("Widgets/Images/ImageryProviders/esriNationalGeographic.png"),tooltip:"This web map contains the National Geographic World Map service. This map service is designed to be used as a general reference map for informational and educational purposes as well as a basemap by GIS professionals and other users for creating web maps and web mapping applications.\nhttp://www.esri.com",category:"Other",creationFunction:function(){return new ArcGisMapServerImageryProvider({url:"https://services.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer/",enablePickFeatures:!1})}})),e.push(new ProviderViewModel({name:"Open­Street­Map",iconUrl:buildModuleUrl("Widgets/Images/ImageryProviders/openStreetMap.png"),tooltip:"OpenStreetMap (OSM) is a collaborative project to create a free editable map of the world.\nhttp://www.openstreetmap.org",category:"Other",creationFunction:function(){return new OpenStreetMapImageryProvider({url:"https://a.tile.openstreetmap.org/"})}})),e.push(new ProviderViewModel({name:"Stamen Watercolor",iconUrl:buildModuleUrl("Widgets/Images/ImageryProviders/stamenWatercolor.png"),tooltip:"Reminiscent of hand drawn maps, Stamen watercolor maps apply raster effect area washes and organic edges over a paper texture to add warm pop to any map.\nhttp://maps.stamen.com",category:"Other",creationFunction:function(){return new OpenStreetMapImageryProvider({url:"https://stamen-tiles.a.ssl.fastly.net/watercolor/",credit:"Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA."})}})),e.push(new ProviderViewModel({name:"Stamen Toner",iconUrl:buildModuleUrl("Widgets/Images/ImageryProviders/stamenToner.png"),tooltip:"A high contrast black and white map.\nhttp://maps.stamen.com",category:"Other",creationFunction:function(){return new OpenStreetMapImageryProvider({url:"https://stamen-tiles.a.ssl.fastly.net/toner/",credit:"Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA."})}})),e.push(new ProviderViewModel({name:"Sentinel-2",iconUrl:buildModuleUrl("Widgets/Images/ImageryProviders/sentinel-2.png"),tooltip:"Sentinel-2 cloudless by EOX IT Services GmbH (Contains modified Copernicus Sentinel data 2016 and 2017).",category:"Cesium ion",creationFunction:function(){return new IonImageryProvider({assetId:3954})}})),e.push(new ProviderViewModel({name:"Blue Marble",iconUrl:buildModuleUrl("Widgets/Images/ImageryProviders/blueMarble.png"),tooltip:"Blue Marble Next Generation July, 2004 imagery from NASA.",category:"Cesium ion",creationFunction:function(){return new IonImageryProvider({assetId:3845})}})),e.push(new ProviderViewModel({name:"Earth at night",iconUrl:buildModuleUrl("Widgets/Images/ImageryProviders/earthAtNight.png"),tooltip:"The Earth at night, also known as The Black Marble, is a 500 meter resolution global composite imagery layer released by NASA.",category:"Cesium ion",creationFunction:function(){return new IonImageryProvider({assetId:3812})}})),e.push(new ProviderViewModel({name:"Natural Earth II",iconUrl:buildModuleUrl("Widgets/Images/ImageryProviders/naturalEarthII.png"),tooltip:"Natural Earth II, darkened for contrast.\nhttp://www.naturalearthdata.com/",category:"Cesium ion",creationFunction:function(){return new TileMapServiceImageryProvider({url:buildModuleUrl("Assets/Textures/NaturalEarthII")})}})),e}function createDefaultTerrainProviderViewModels(){var e=[];return e.push(new ProviderViewModel({name:"WGS84 Ellipsoid",iconUrl:buildModuleUrl("Widgets/Images/TerrainProviders/Ellipsoid.png"),tooltip:"WGS84 standard ellipsoid, also known as EPSG:4326",category:"Cesium ion",creationFunction:function(){return new EllipsoidTerrainProvider}})),e.push(new ProviderViewModel({name:"Cesium World Terrain",iconUrl:buildModuleUrl("Widgets/Images/TerrainProviders/CesiumWorldTerrain.png"),tooltip:"High-resolution global terrain tileset curated from several datasources and hosted by Cesium ion",category:"Cesium ion",creationFunction:function(){return createWorldTerrain({requestWaterMask:!0,requestVertexNormals:!0})}})),e}function getPickTileset(i){return function(e){var t=i._scene.pick(e.position);defined(t)&&t.primitive instanceof Cesium3DTileset&&(i.tileset=t.primitive),i.pickActive=!1}}function selectTilesetOnHover(i,e){e?i._eventHandler.setInputAction(function(e){var t=i._scene.pick(e.endPosition);defined(t)&&t.primitive instanceof Cesium3DTileset&&(i.tileset=t.primitive)},ScreenSpaceEventType$1.MOUSE_MOVE):(i._eventHandler.removeInputAction(ScreenSpaceEventType$1.MOUSE_MOVE),i.picking=i.picking)}AnimationViewModel.defaultDateFormatter=function(e,t){var i=JulianDate.toGregorianDate(e);return monthNames[i.month-1]+" "+i.day+" "+i.year},AnimationViewModel.defaultTicks=[.001,.002,.005,.01,.02,.05,.1,.25,.5,1,2,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,21600,43200,86400,172800,345600,604800],AnimationViewModel.defaultTimeFormatter=function(e,t){var i=JulianDate.toGregorianDate(e),r=Math.round(i.millisecond);return Math.abs(t._clockViewModel.multiplier)<1?sprintf("%02d:%02d:%02d.%03d",i.hour,i.minute,i.second,r):sprintf("%02d:%02d:%02d UTC",i.hour,i.minute,i.second)},AnimationViewModel.prototype.getShuttleRingTicks=function(){return this._sortedFilteredPositiveTicks.slice(0)},AnimationViewModel.prototype.setShuttleRingTicks=function(e){var t,i,r,n={},a=this._sortedFilteredPositiveTicks;for(t=a.length=0,i=e.length;t<i;++t)r=e[t],n.hasOwnProperty(r)||(n[r]=!0,a.push(r));a.sort(numberComparator);var o=[];for(t=(i=a.length)-1;0<=t;--t)0!==(r=a[t])&&o.push(-r);Array.prototype.push.apply(o,a),this._allShuttleRingTicks=o},Object.defineProperties(AnimationViewModel.prototype,{slower:{get:function(){return this._slower}},faster:{get:function(){return this._faster}},clockViewModel:{get:function(){return this._clockViewModel}},pauseViewModel:{get:function(){return this._pauseViewModel}},playReverseViewModel:{get:function(){return this._playReverseViewModel}},playForwardViewModel:{get:function(){return this._playForwardViewModel}},playRealtimeViewModel:{get:function(){return this._playRealtimeViewModel}},dateFormatter:{get:function(){return this._dateFormatter},set:function(e){this._dateFormatter=e}},timeFormatter:{get:function(){return this._timeFormatter},set:function(e){this._timeFormatter=e}}}),AnimationViewModel._maxShuttleRingAngle=maxShuttleRingAngle,AnimationViewModel._realtimeShuttleRingAngle=realtimeShuttleRingAngle,Object.defineProperties(BaseLayerPickerViewModel.prototype,{toggleDropDown:{get:function(){return this._toggleDropDown}},globe:{get:function(){return this._globe}}}),Object.defineProperties(BaseLayerPicker.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),BaseLayerPicker.prototype.isDestroyed=function(){return!1},BaseLayerPicker.prototype.destroy=function(){return FeatureDetection$1.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),knockout.cleanNode(this._element),knockout.cleanNode(this._dropPanel),this._container.removeChild(this._element),this._container.removeChild(this._dropPanel),destroyObject(this)},Object.defineProperties(ProviderViewModel.prototype,{creationCommand:{get:function(){return this._creationCommand}},category:{get:function(){return this._category}}});var stringOptions$1={maximumFractionDigits:3};function formatMemoryString$1(e){var t=e/1048576;return t<1?t.toLocaleString(void 0,stringOptions$1):Math.round(t).toLocaleString()}function getStatistics(e,t){if(!defined(e))return"";var i=t?e._statisticsPerPass[Cesium3DTilePass$1.PICK]:e._statisticsPerPass[Cesium3DTilePass$1.RENDER],r='<ul class="cesium-cesiumInspector-statistics">';return r+="<li><strong>Visited: </strong>"+i.visited.toLocaleString()+"</li><li><strong>Selected: </strong>"+i.selected.toLocaleString()+"</li><li><strong>Commands: </strong>"+i.numberOfCommands.toLocaleString()+"</li>",r+="</ul>",t||(r+='<ul class="cesium-cesiumInspector-statistics">',r+="<li><strong>Requests: </strong>"+i.numberOfPendingRequests.toLocaleString()+"</li><li><strong>Attempted: </strong>"+i.numberOfAttemptedRequests.toLocaleString()+"</li><li><strong>Processing: </strong>"+i.numberOfTilesProcessing.toLocaleString()+"</li><li><strong>Content Ready: </strong>"+i.numberOfTilesWithContentReady.toLocaleString()+"</li><li><strong>Total: </strong>"+i.numberOfTilesTotal.toLocaleString()+"</li>",r+="</ul>",r+='<ul class="cesium-cesiumInspector-statistics">',r+="<li><strong>Features Selected: </strong>"+i.numberOfFeaturesSelected.toLocaleString()+"</li><li><strong>Features Loaded: </strong>"+i.numberOfFeaturesLoaded.toLocaleString()+"</li><li><strong>Points Selected: </strong>"+i.numberOfPointsSelected.toLocaleString()+"</li><li><strong>Points Loaded: </strong>"+i.numberOfPointsLoaded.toLocaleString()+"</li><li><strong>Triangles Selected: </strong>"+i.numberOfTrianglesSelected.toLocaleString()+"</li>",r+="</ul>",r+='<ul class="cesium-cesiumInspector-statistics">',r+="<li><strong>Tiles styled: </strong>"+i.numberOfTilesStyled.toLocaleString()+"</li><li><strong>Features styled: </strong>"+i.numberOfFeaturesStyled.toLocaleString()+"</li>",r+="</ul>",r+='<ul class="cesium-cesiumInspector-statistics">',r+="<li><strong>Children Union Culled: </strong>"+i.numberOfTilesCulledWithChildrenUnion.toLocaleString()+"</li>",r+="</ul>",r+='<ul class="cesium-cesiumInspector-statistics">',r+="<li><strong>Geometry Memory (MB): </strong>"+formatMemoryString$1(i.geometryByteLength)+"</li><li><strong>Texture Memory (MB): </strong>"+formatMemoryString$1(i.texturesByteLength)+"</li><li><strong>Batch Table Memory (MB): </strong>"+formatMemoryString$1(i.batchTableByteLength)+"</li>",r+="</ul>"),r}var colorBlendModes=[{text:"Highlight",value:Cesium3DTileColorBlendMode$1.HIGHLIGHT},{text:"Replace",value:Cesium3DTileColorBlendMode$1.REPLACE},{text:"Mix",value:Cesium3DTileColorBlendMode$1.MIX}],highlightColor$1=new Color(1,1,0,.4),scratchColor$m=new Color,oldColor=new Color;function Cesium3DTilesInspectorViewModel(r,e){var n=this,t=r.canvas;this._eventHandler=new ScreenSpaceEventHandler(t),this._scene=r,this._performanceContainer=e,this._canvas=t,this._performanceDisplay=new PerformanceDisplay({container:e}),this._statisticsText="",this._pickStatisticsText="",this._editorError="",this.performance=!1,this.showStatistics=!0,this.showPickStatistics=!0,this.inspectorVisible=!0,this.tilesetVisible=!1,this.displayVisible=!1,this.updateVisible=!1,this.loggingVisible=!1,this.styleVisible=!1,this.tileDebugLabelsVisible=!1,this.optimizationVisible=!1,this.styleString="{}",this._tileset=void 0,this._feature=void 0,this._tile=void 0,knockout.track(this,["performance","inspectorVisible","_statisticsText","_pickStatisticsText","_editorError","showPickStatistics","showStatistics","tilesetVisible","displayVisible","updateVisible","loggingVisible","styleVisible","optimizationVisible","tileDebugLabelsVisible","styleString","_feature","_tile"]),this._properties=knockout.observable({}),this.properties=[],knockout.defineProperty(this,"properties",function(){var e=[],t=n._properties();for(var i in t)t.hasOwnProperty(i)&&e.push(i);return e});var i=knockout.observable();knockout.defineProperty(this,"dynamicScreenSpaceError",{get:function(){return i()},set:function(e){i(e),defined(n._tileset)&&(n._tileset.dynamicScreenSpaceError=e)}}),this.dynamicScreenSpaceError=!1;var a=knockout.observable();knockout.defineProperty(this,"colorBlendMode",{get:function(){return a()},set:function(e){a(e),defined(n._tileset)&&(n._tileset.colorBlendMode=e,n._scene.requestRender())}}),this.colorBlendMode=Cesium3DTileColorBlendMode$1.HIGHLIGHT;var o=knockout.observable();knockout.defineProperty(this,"picking",{get:function(){return o()},set:function(e){o(e),e?n._eventHandler.setInputAction(function(e){var t=r.pick(e.endPosition);if(t instanceof Cesium3DTileFeature?(n.feature=t,n.tile=t.content.tile):defined(t)&&defined(t.content)?(n.feature=void 0,n.tile=t.content.tile):(n.feature=void 0,n.tile=void 0),defined(n._tileset)){var i;if(p&&defined(t)&&defined(t.content))r.pickPositionSupported&&defined(i=r.pickPosition(e.endPosition))&&(n._tileset.debugPickPosition=i),n._tileset.debugPickedTile=t.content.tile;else n._tileset.debugPickedTile=void 0;n._scene.requestRender()}},ScreenSpaceEventType$1.MOUSE_MOVE):(n.feature=void 0,n.tile=void 0,n._eventHandler.removeInputAction(ScreenSpaceEventType$1.MOUSE_MOVE))}}),this.picking=!0;var s=knockout.observable();knockout.defineProperty(this,"colorize",{get:function(){return s()},set:function(e){s(e),defined(n._tileset)&&(n._tileset.debugColorizeTiles=e,n._scene.requestRender())}}),this.colorize=!1;var l=knockout.observable();knockout.defineProperty(this,"wireframe",{get:function(){return l()},set:function(e){l(e),defined(n._tileset)&&(n._tileset.debugWireframe=e,n._scene.requestRender())}}),this.wireframe=!1;var u=knockout.observable();knockout.defineProperty(this,"showBoundingVolumes",{get:function(){return u()},set:function(e){u(e),defined(n._tileset)&&(n._tileset.debugShowBoundingVolume=e,n._scene.requestRender())}}),this.showBoundingVolumes=!1;var c=knockout.observable();knockout.defineProperty(this,"showContentBoundingVolumes",{get:function(){return c()},set:function(e){c(e),defined(n._tileset)&&(n._tileset.debugShowContentBoundingVolume=e,n._scene.requestRender())}}),this.showContentBoundingVolumes=!1;var d=knockout.observable();knockout.defineProperty(this,"showRequestVolumes",{get:function(){return d()},set:function(e){d(e),defined(n._tileset)&&(n._tileset.debugShowViewerRequestVolume=e,n._scene.requestRender())}}),this.showRequestVolumes=!1;var h=knockout.observable();knockout.defineProperty(this,"freezeFrame",{get:function(){return h()},set:function(e){h(e),defined(n._tileset)&&(n._tileset.debugFreezeFrame=e,n._scene.debugShowFrustumPlanes=e,n._scene.requestRender())}}),this.freezeFrame=!1;var p=knockout.observable();knockout.defineProperty(this,"showOnlyPickedTileDebugLabel",{get:function(){return p()},set:function(e){p(e),defined(n._tileset)&&(n._tileset.debugPickedTileLabelOnly=e,n._scene.requestRender())}}),this.showOnlyPickedTileDebugLabel=!1;var f=knockout.observable();knockout.defineProperty(this,"showGeometricError",{get:function(){return f()},set:function(e){f(e),defined(n._tileset)&&(n._tileset.debugShowGeometricError=e,n._scene.requestRender())}}),this.showGeometricError=!1;var m=knockout.observable();knockout.defineProperty(this,"showRenderingStatistics",{get:function(){return m()},set:function(e){m(e),defined(n._tileset)&&(n._tileset.debugShowRenderingStatistics=e,n._scene.requestRender())}}),this.showRenderingStatistics=!1;var g=knockout.observable();knockout.defineProperty(this,"showMemoryUsage",{get:function(){return g()},set:function(e){g(e),defined(n._tileset)&&(n._tileset.debugShowMemoryUsage=e,n._scene.requestRender())}}),this.showMemoryUsage=!1;var y=knockout.observable();knockout.defineProperty(this,"showUrl",{get:function(){return y()},set:function(e){y(e),defined(n._tileset)&&(n._tileset.debugShowUrl=e,n._scene.requestRender())}}),this.showUrl=!1;var v=knockout.observable();knockout.defineProperty(this,"maximumScreenSpaceError",{get:function(){return v()},set:function(e){e=Number(e),isNaN(e)||(v(e),defined(n._tileset)&&(n._tileset.maximumScreenSpaceError=e))}}),this.maximumScreenSpaceError=16;var _=knockout.observable();knockout.defineProperty(this,"dynamicScreenSpaceErrorDensity",{get:function(){return _()},set:function(e){e=Number(e),isNaN(e)||(_(e),defined(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=e))}}),this.dynamicScreenSpaceErrorDensity=.00278,this.dynamicScreenSpaceErrorDensitySliderValue=void 0,knockout.defineProperty(this,"dynamicScreenSpaceErrorDensitySliderValue",{get:function(){return Math.pow(_(),1/6)},set:function(e){_(Math.pow(e,6))}});var C=knockout.observable();knockout.defineProperty(this,"dynamicScreenSpaceErrorFactor",{get:function(){return C()},set:function(e){e=Number(e),isNaN(e)||(C(e),defined(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorFactor=e))}}),this.dynamicScreenSpaceErrorFactor=4;var x=getPickTileset(this),b=knockout.observable();knockout.defineProperty(this,"pickActive",{get:function(){return b()},set:function(e){b(e),e?n._eventHandler.setInputAction(x,ScreenSpaceEventType$1.LEFT_CLICK):n._eventHandler.removeInputAction(ScreenSpaceEventType$1.LEFT_CLICK)}});var A=knockout.observable();knockout.defineProperty(this,"pointCloudShading",{get:function(){return A()},set:function(e){A(e),defined(n._tileset)&&(n._tileset.pointCloudShading.attenuation=e)}}),this.pointCloudShading=!1;var S=knockout.observable();knockout.defineProperty(this,"geometricErrorScale",{get:function(){return S()},set:function(e){e=Number(e),isNaN(e)||(S(e),defined(n._tileset)&&(n._tileset.pointCloudShading.geometricErrorScale=e))}}),this.geometricErrorScale=1;var w=knockout.observable();knockout.defineProperty(this,"maximumAttenuation",{get:function(){return w()},set:function(e){e=Number(e),isNaN(e)||(w(e),defined(n._tileset)&&(n._tileset.pointCloudShading.maximumAttenuation=0===e?void 0:e))}}),this.maximumAttenuation=0;var E=knockout.observable();knockout.defineProperty(this,"baseResolution",{get:function(){return E()},set:function(e){e=Number(e),isNaN(e)||(E(e),defined(n._tileset)&&(n._tileset.pointCloudShading.baseResolution=0===e?void 0:e))}}),this.baseResolution=0;var T=knockout.observable();knockout.defineProperty(this,"eyeDomeLighting",{get:function(){return T()},set:function(e){T(e),defined(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLighting=e)}}),this.eyeDomeLighting=!1;var P=knockout.observable();knockout.defineProperty(this,"eyeDomeLightingStrength",{get:function(){return P()},set:function(e){e=Number(e),isNaN(e)||(P(e),defined(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingStrength=e))}}),this.eyeDomeLightingStrength=1;var M=knockout.observable();knockout.defineProperty(this,"eyeDomeLightingRadius",{get:function(){return M()},set:function(e){e=Number(e),isNaN(e)||(M(e),defined(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingRadius=e))}}),this.eyeDomeLightingRadius=1,this.pickActive=!1;var D=knockout.observable();knockout.defineProperty(this,"skipLevelOfDetail",{get:function(){return D()},set:function(e){D(e),defined(n._tileset)&&(n._tileset.skipLevelOfDetail=e)}}),this.skipLevelOfDetail=!0;var I=knockout.observable();knockout.defineProperty(this,"skipScreenSpaceErrorFactor",{get:function(){return I()},set:function(e){e=Number(e),isNaN(e)||(I(e),defined(n._tileset)&&(n._tileset.skipScreenSpaceErrorFactor=e))}}),this.skipScreenSpaceErrorFactor=16;var O=knockout.observable();knockout.defineProperty(this,"baseScreenSpaceError",{get:function(){return O()},set:function(e){e=Number(e),isNaN(e)||(O(e),defined(n._tileset)&&(n._tileset.baseScreenSpaceError=e))}}),this.baseScreenSpaceError=1024;var R=knockout.observable();knockout.defineProperty(this,"skipLevels",{get:function(){return R()},set:function(e){e=Number(e),isNaN(e)||(R(e),defined(n._tileset)&&(n._tileset.skipLevels=e))}}),this.skipLevels=1;var L=knockout.observable();knockout.defineProperty(this,"immediatelyLoadDesiredLevelOfDetail",{get:function(){return L()},set:function(e){L(e),defined(n._tileset)&&(n._tileset.immediatelyLoadDesiredLevelOfDetail=e)}}),this.immediatelyLoadDesiredLevelOfDetail=!1;var N=knockout.observable();knockout.defineProperty(this,"loadSiblings",{get:function(){return N()},set:function(e){N(e),defined(n._tileset)&&(n._tileset.loadSiblings=e)}}),this.loadSiblings=!1,this._style=void 0,this._shouldStyle=!1,this._definedProperties=["properties","dynamicScreenSpaceError","colorBlendMode","picking","colorize","wireframe","showBoundingVolumes","showContentBoundingVolumes","showRequestVolumes","freezeFrame","maximumScreenSpaceError","dynamicScreenSpaceErrorDensity","baseScreenSpaceError","skipScreenSpaceErrorFactor","skipLevelOfDetail","skipLevels","immediatelyLoadDesiredLevelOfDetail","loadSiblings","dynamicScreenSpaceErrorDensitySliderValue","dynamicScreenSpaceErrorFactor","pickActive","showOnlyPickedTileDebugLabel","showGeometricError","showRenderingStatistics","showMemoryUsage","showUrl","pointCloudShading","geometricErrorScale","maximumAttenuation","baseResolution","eyeDomeLighting","eyeDomeLightingStrength","eyeDomeLightingRadius"],this._removePostRenderEvent=r.postRender.addEventListener(function(){n._update()}),defined(this._tileset)||selectTilesetOnHover(this,!0)}function hasFeatures(e){if(0<e.featuresLength)return!0;var t=e.innerContents;if(defined(t)){for(var i=t.length,r=0;r<i;++r)if(!hasFeatures(t[r]))return!1;return!0}return!1}function Cesium3DTilesInspector(e,t){e=getElement(e);var i=document.createElement("div"),r=document.createElement("div");r.setAttribute("data-bind","visible: performance");var n=new Cesium3DTilesInspectorViewModel(t,r);this._viewModel=n,this._container=e,this._element=i;var a=document.createElement("div");a.textContent="3D Tiles Inspector",a.className="cesium-cesiumInspector-button",a.setAttribute("data-bind","click: toggleInspector"),i.appendChild(a),i.className="cesium-cesiumInspector cesium-3DTilesInspector",i.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : inspectorVisible, "cesium-cesiumInspector-hidden" : !inspectorVisible}'),e.appendChild(i);var o=document.createElement("div");(this._panel=o).className="cesium-cesiumInspector-dropDown",i.appendChild(o);var s=InspectorShared.createSection,l=InspectorShared.createCheckbox,u=s(o,"Tileset","tilesetVisible","toggleTileset"),c=s(o,"Display","displayVisible","toggleDisplay"),d=s(o,"Update","updateVisible","toggleUpdate"),h=s(o,"Logging","loggingVisible","toggleLogging"),p=s(o,"Tile Debug Labels","tileDebugLabelsVisible","toggleTileDebugLabels"),f=s(o,"Style","styleVisible","toggleStyle"),m=s(o,"Optimization","optimizationVisible","toggleOptimization"),g=document.createElement("div");g.className="field-group";var y=document.createElement("label");y.className="field-label",y.appendChild(document.createTextNode("Properties: "));var v=document.createElement("div");v.setAttribute("data-bind","text: properties"),g.appendChild(y),g.appendChild(v),u.appendChild(g),u.appendChild(makeButton("togglePickTileset","Pick Tileset","pickActive")),u.appendChild(makeButton("trimTilesCache","Trim Tiles Cache")),u.appendChild(l("Enable Picking","picking")),c.appendChild(l("Colorize","colorize")),c.appendChild(l("Wireframe","wireframe")),c.appendChild(l("Bounding Volumes","showBoundingVolumes")),c.appendChild(l("Content Volumes","showContentBoundingVolumes")),c.appendChild(l("Request Volumes","showRequestVolumes")),c.appendChild(l("Point Cloud Shading","pointCloudShading"));var _=document.createElement("div");_.setAttribute("data-bind","visible: pointCloudShading"),_.appendChild(makeRangeInput("geometricErrorScale",0,2,.01,"Geometric Error Scale")),_.appendChild(makeRangeInput("maximumAttenuation",0,32,1,"Maximum Attenuation")),_.appendChild(makeRangeInput("baseResolution",0,1,.01,"Base Resolution")),_.appendChild(l("Eye Dome Lighting (EDL)","eyeDomeLighting")),c.appendChild(_);var C=document.createElement("div");C.setAttribute("data-bind","visible: eyeDomeLighting"),C.appendChild(makeRangeInput("eyeDomeLightingStrength",0,2,.1,"EDL Strength")),C.appendChild(makeRangeInput("eyeDomeLightingRadius",0,4,.1,"EDL Radius")),_.appendChild(C),d.appendChild(l("Freeze Frame","freezeFrame")),d.appendChild(l("Dynamic Screen Space Error","dynamicScreenSpaceError"));var x=document.createElement("div");x.appendChild(makeRangeInput("maximumScreenSpaceError",0,128,1,"Maximum Screen Space Error")),d.appendChild(x);var b=document.createElement("div");b.setAttribute("data-bind","visible: dynamicScreenSpaceError"),b.appendChild(makeRangeInput("dynamicScreenSpaceErrorDensitySliderValue",0,1,.005,"Screen Space Error Density","dynamicScreenSpaceErrorDensity")),b.appendChild(makeRangeInput("dynamicScreenSpaceErrorFactor",1,10,.1,"Screen Space Error Factor")),d.appendChild(b),h.appendChild(l("Performance","performance")),h.appendChild(r),h.appendChild(l("Statistics","showStatistics"));var A=document.createElement("div");A.className="cesium-3dTilesInspector-statistics",A.setAttribute("data-bind","html: statisticsText, visible: showStatistics"),h.appendChild(A),h.appendChild(l("Pick Statistics","showPickStatistics"));var S=document.createElement("div");S.className="cesium-3dTilesInspector-statistics",S.setAttribute("data-bind","html: pickStatisticsText, visible: showPickStatistics"),h.appendChild(S);var w=document.createElement("div");f.appendChild(w),w.appendChild(document.createTextNode("Color Blend Mode: "));var E=document.createElement("select");E.setAttribute("data-bind",'options: colorBlendModes, optionsText: "text", optionsValue: "value", value: colorBlendMode'),w.appendChild(E);var T=document.createElement("textarea");T.setAttribute("data-bind","textInput: styleString, event: { keydown: styleEditorKeyPress }"),w.className="cesium-cesiumInspector-styleEditor",w.appendChild(T);var P=makeButton("compileStyle","Compile (Ctrl+Enter)");w.appendChild(P);var M=document.createElement("div");M.className="cesium-cesiumInspector-error",M.setAttribute("data-bind","text: editorError"),w.appendChild(M),p.appendChild(l("Show Picked Only","showOnlyPickedTileDebugLabel")),p.appendChild(l("Geometric Error","showGeometricError")),p.appendChild(l("Rendering Statistics","showRenderingStatistics")),p.appendChild(l("Memory Usage (MB)","showMemoryUsage")),p.appendChild(l("Url","showUrl")),m.appendChild(l("Skip Tile LODs","skipLevelOfDetail"));var D=document.createElement("div");D.appendChild(makeRangeInput("skipScreenSpaceErrorFactor",1,50,1,"Skip SSE Factor")),m.appendChild(D);var I=document.createElement("div");I.appendChild(makeRangeInput("baseScreenSpaceError",0,4096,1,"SSE before skipping LOD")),m.appendChild(I);var O=document.createElement("div");O.appendChild(makeRangeInput("skipLevels",0,10,1,"Min. levels to skip")),m.appendChild(O),m.appendChild(l("Load only tiles that meet the max SSE.","immediatelyLoadDesiredLevelOfDetail")),m.appendChild(l("Load siblings of visible tiles","loadSiblings")),knockout.applyBindings(n,i)}function makeRangeInput(e,t,i,r,n,a){a=defaultValue(a,e);var o=document.createElement("input");o.setAttribute("data-bind","value: "+a),o.type="number";var s=document.createElement("input");s.type="range",s.min=t,s.max=i,s.step=r,s.setAttribute("data-bind",'valueUpdate: "input", value: '+e);var l=document.createElement("div");l.appendChild(s);var u=document.createElement("div");return u.className="cesium-cesiumInspector-slider",u.appendChild(document.createTextNode(n)),u.appendChild(o),u.appendChild(l),u}function makeButton(e,t,i){var r=document.createElement("button");r.type="button",r.textContent=t,r.className="cesium-cesiumInspector-pickButton";var n="click: "+e;return defined(i)&&(n+=', css: {"cesium-cesiumInspector-pickButtonHighlight" : '+i+"}"),r.setAttribute("data-bind",n),r}function frustumStatisticsToString(e){var t;if(defined(e)){t="Command Statistics";var i=e.commandsInFrustums;for(var r in i)if(i.hasOwnProperty(r)){var n,a=parseInt(r,10);if(7===a)n="1, 2 and 3";else{for(var o=[],s=2;0<=s;s--){var l=Math.pow(2,s);l<=a&&(o.push(s+1),a-=l)}n=o.reverse().join(" and ")}t+="<br>    "+i[r]+" in frustum "+n}t+="<br>Total: "+e.totalCommands}return t}function boundDepthFrustum(e,t,i){var r=Math.min(i,t);return r=Math.max(r,e)}Object.defineProperties(Cesium3DTilesInspectorViewModel.prototype,{scene:{get:function(){return this._scene}},performanceContainer:{get:function(){return this._performanceContainer}},statisticsText:{get:function(){return this._statisticsText}},pickStatisticsText:{get:function(){return this._pickStatisticsText}},colorBlendModes:{get:function(){return colorBlendModes}},editorError:{get:function(){return this._editorError}},tileset:{get:function(){return this._tileset},set:function(e){if(this._tileset=e,this._style=void 0,this.styleString="{}",this.feature=void 0,this.tile=void 0,defined(e)){var t=this;e.readyPromise.then(function(e){t.isDestroyed()||t._properties(e.properties)});for(var i=["colorize","wireframe","showBoundingVolumes","showContentBoundingVolumes","showRequestVolumes","freezeFrame","showOnlyPickedTileDebugLabel","showGeometricError","showRenderingStatistics","showMemoryUsage","showUrl"],r=i.length,n=0;n<r;++n){var a=i[n];this[a]=this[a]}this.maximumScreenSpaceError=e.maximumScreenSpaceError,this.dynamicScreenSpaceError=e.dynamicScreenSpaceError,this.dynamicScreenSpaceErrorDensity=e.dynamicScreenSpaceErrorDensity,this.dynamicScreenSpaceErrorFactor=e.dynamicScreenSpaceErrorFactor,this.colorBlendMode=e.colorBlendMode,this.skipLevelOfDetail=e.skipLevelOfDetail,this.skipScreenSpaceErrorFactor=e.skipScreenSpaceErrorFactor,this.baseScreenSpaceError=e.baseScreenSpaceError,this.skipLevels=e.skipLevels,this.immediatelyLoadDesiredLevelOfDetail=e.immediatelyLoadDesiredLevelOfDetail,this.loadSiblings=e.loadSiblings;var o=e.pointCloudShading;this.pointCloudShading=o.attenuation,this.geometricErrorScale=o.geometricErrorScale,this.maximumAttenuation=o.maximumAttenuation?o.maximumAttenuation:0,this.baseResolution=o.baseResolution?o.baseResolution:0,this.eyeDomeLighting=o.eyeDomeLighting,this.eyeDomeLightingStrength=o.eyeDomeLightingStrength,this.eyeDomeLightingRadius=o.eyeDomeLightingRadius,this._scene.requestRender()}else this._properties({});this._statisticsText=getStatistics(e,!1),this._pickStatisticsText=getStatistics(e,!0),selectTilesetOnHover(this,!1)}},feature:{get:function(){return this._feature},set:function(e){if(this._feature!==e){var t=this._feature;defined(t)&&!t.content.isDestroyed()&&(!this.colorize&&defined(this._style)?t.color=defined(this._style.color)?this._style.color.evaluateColor(t,scratchColor$m):Color.WHITE:t.color=oldColor,this._scene.requestRender()),defined(e)&&(Color.clone(e.color,oldColor),e.color=highlightColor$1,this._scene.requestRender()),this._feature=e}}},tile:{get:function(){return this._tile},set:function(e){if(this._tile!==e){var t=this._tile;!defined(t)||t.isDestroyed()||hasFeatures(t.content)||(t.color=oldColor,this._scene.requestRender()),defined(e)&&!hasFeatures(e.content)&&(Color.clone(e.color,oldColor),e.color=highlightColor$1,this._scene.requestRender()),this._tile=e}}}}),Cesium3DTilesInspectorViewModel.prototype.togglePickTileset=function(){this.pickActive=!this.pickActive},Cesium3DTilesInspectorViewModel.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible},Cesium3DTilesInspectorViewModel.prototype.toggleTileset=function(){this.tilesetVisible=!this.tilesetVisible},Cesium3DTilesInspectorViewModel.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible},Cesium3DTilesInspectorViewModel.prototype.toggleUpdate=function(){this.updateVisible=!this.updateVisible},Cesium3DTilesInspectorViewModel.prototype.toggleLogging=function(){this.loggingVisible=!this.loggingVisible},Cesium3DTilesInspectorViewModel.prototype.toggleStyle=function(){this.styleVisible=!this.styleVisible},Cesium3DTilesInspectorViewModel.prototype.toggleTileDebugLabels=function(){this.tileDebugLabelsVisible=!this.tileDebugLabelsVisible},Cesium3DTilesInspectorViewModel.prototype.toggleOptimization=function(){this.optimizationVisible=!this.optimizationVisible},Cesium3DTilesInspectorViewModel.prototype.trimTilesCache=function(){defined(this._tileset)&&this._tileset.trimLoadedTiles()},Cesium3DTilesInspectorViewModel.prototype.compileStyle=function(){var e=this._tileset;if(defined(e)&&this.styleString!==JSON.stringify(e.style)){this._editorError="";try{0===this.styleString.length&&(this.styleString="{}"),this._style=new Cesium3DTileStyle(JSON.parse(this.styleString)),this._shouldStyle=!0,this._scene.requestRender()}catch(e){this._editorError=e.toString()}this.feature=this._feature,this.tile=this._tile}},Cesium3DTilesInspectorViewModel.prototype.styleEditorKeyPress=function(e,t){if(9===t.keyCode){t.preventDefault();var i,r=t.target,n=r.selectionStart,a=r.selectionEnd,o=a,s=r.value.slice(n,a).split("\n"),l=s.length;if(t.shiftKey)for(i=0;i<l;++i)" "===s[i][0]&&(" "===s[i][1]?(s[i]=s[i].substr(2),o-=2):(s[i]=s[i].substr(1),o-=1));else for(i=0;i<l;++i)s[i]=" "+s[i],o+=2;var u=s.join("\n");r.value=r.value.slice(0,n)+u+r.value.slice(a),r.selectionStart=n!==a?n:o,r.selectionEnd=o}else!t.ctrlKey||10!==t.keyCode&&13!==t.keyCode||this.compileStyle();return!0},Cesium3DTilesInspectorViewModel.prototype._update=function(){var e=this._tileset;if(this.performance&&this._performanceDisplay.update(),defined(e)){if(e.isDestroyed())return this.tile=void 0,this.feature=void 0,void(this.tileset=void 0);var t=e.style;this._style!==e.style&&(this._shouldStyle?(e.style=this._style,this._shouldStyle=!1):(this._style=t,this.styleString=JSON.stringify(t.style,null," ")))}this.showStatistics&&(this._statisticsText=getStatistics(e,!1),this._pickStatisticsText=getStatistics(e,!0))},Cesium3DTilesInspectorViewModel.prototype.isDestroyed=function(){return!1},Cesium3DTilesInspectorViewModel.prototype.destroy=function(){this._eventHandler.destroy(),this._removePostRenderEvent();var t=this;return this._definedProperties.forEach(function(e){knockout.getObservable(t,e).dispose()}),destroyObject(this)},Cesium3DTilesInspectorViewModel.getStatistics=getStatistics,Object.defineProperties(Cesium3DTilesInspector.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),Cesium3DTilesInspector.prototype.isDestroyed=function(){return!1},Cesium3DTilesInspector.prototype.destroy=function(){return knockout.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),destroyObject(this)};var scratchPickRay=new Ray,scratchPickCartesian$1=new Cartesian3;function CesiumInspectorViewModel(e,t){var d=this,i=e.canvas,r=new ScreenSpaceEventHandler(i);this._eventHandler=r,this._scene=e,this._canvas=i,this._primitive=void 0,this._tile=void 0,this._modelMatrixPrimitive=void 0,this._performanceDisplay=void 0,this._performanceContainer=t;var n,h=this._scene.globe;function a(e){var t=d._scene.pick({x:e.position.x,y:e.position.y});defined(t)&&(d.primitive=defined(t.collection)?t.collection:t.primitive),d._scene.requestRender(),d.pickPrimitiveActive=!1}function o(e){var t,i=h.ellipsoid,r=d._scene.camera.getPickRay(e.position,scratchPickRay),n=h.pick(r,d._scene,scratchPickCartesian$1);if(defined(n))for(var a=i.cartesianToCartographic(n),o=h._surface.tileProvider._tilesToRenderByTextureCount,s=0;!t&&s<o.length;++s){var l=o[s];if(defined(l))for(var u=0;!t&&u<l.length;++u){var c=l[u];Rectangle.contains(c.rectangle,a)&&(t=c)}}d.tile=t,d.pickTileActive=!1}h.depthTestAgainstTerrain=!0,this.frustums=!1,this.frustumPlanes=!1,this.performance=!1,this.shaderCacheText="",this.primitiveBoundingSphere=!1,this.primitiveReferenceFrame=!1,this.filterPrimitive=!1,this.tileBoundingSphere=!1,this.filterTile=!1,this.wireframe=!1,this.globeDepth=!1,this.pickDepth=!1,this.depthFrustum=1,this._numberOfFrustums=1,this.suspendUpdates=!1,this.tileCoordinates=!1,this.frustumStatisticText=!1,this.tileText="",this.hasPickedPrimitive=!1,this.hasPickedTile=!1,this.pickPrimitiveActive=!1,this.pickTileActive=!1,this.dropDownVisible=!0,this.generalVisible=!0,this.primitivesVisible=!1,this.terrainVisible=!1,this.depthFrustumText="",knockout.track(this,["frustums","frustumPlanes","performance","shaderCacheText","primitiveBoundingSphere","primitiveReferenceFrame","filterPrimitive","tileBoundingSphere","filterTile","wireframe","globeDepth","pickDepth","depthFrustum","suspendUpdates","tileCoordinates","frustumStatisticText","tileText","hasPickedPrimitive","hasPickedTile","pickPrimitiveActive","pickTileActive","dropDownVisible","generalVisible","primitivesVisible","terrainVisible","depthFrustumText"]),this._toggleDropDown=createCommand$2(function(){d.dropDownVisible=!d.dropDownVisible}),this._toggleGeneral=createCommand$2(function(){d.generalVisible=!d.generalVisible}),this._togglePrimitives=createCommand$2(function(){d.primitivesVisible=!d.primitivesVisible}),this._toggleTerrain=createCommand$2(function(){d.terrainVisible=!d.terrainVisible}),this._frustumsSubscription=knockout.getObservable(this,"frustums").subscribe(function(e){d._scene.debugShowFrustums=e,d._scene.requestRender()}),this._frustumPlanesSubscription=knockout.getObservable(this,"frustumPlanes").subscribe(function(e){d._scene.debugShowFrustumPlanes=e,d._scene.requestRender()}),this._performanceSubscription=knockout.getObservable(this,"performance").subscribe(function(e){e?d._performanceDisplay=new PerformanceDisplay({container:d._performanceContainer}):d._performanceContainer.innerHTML=""}),this._showPrimitiveBoundingSphere=createCommand$2(function(){return d._primitive.debugShowBoundingVolume=d.primitiveBoundingSphere,d._scene.requestRender(),!0}),this._primitiveBoundingSphereSubscription=knockout.getObservable(this,"primitiveBoundingSphere").subscribe(function(){d._showPrimitiveBoundingSphere()}),this._showPrimitiveReferenceFrame=createCommand$2(function(){if(d.primitiveReferenceFrame){var e=d._primitive.modelMatrix;d._modelMatrixPrimitive=new DebugModelMatrixPrimitive({modelMatrix:e}),d._scene.primitives.add(d._modelMatrixPrimitive)}else defined(d._modelMatrixPrimitive)&&(d._scene.primitives.remove(d._modelMatrixPrimitive),d._modelMatrixPrimitive=void 0);return d._scene.requestRender(),!0}),this._primitiveReferenceFrameSubscription=knockout.getObservable(this,"primitiveReferenceFrame").subscribe(function(){d._showPrimitiveReferenceFrame()}),this._doFilterPrimitive=createCommand$2(function(){return d.filterPrimitive?d._scene.debugCommandFilter=function(e){return!(!defined(d._modelMatrixPrimitive)||e.owner!==d._modelMatrixPrimitive._primitive)||!!defined(d._primitive)&&(e.owner===d._primitive||e.owner===d._primitive._billboardCollection||e.owner.primitive===d._primitive)}:d._scene.debugCommandFilter=void 0,!0}),this._filterPrimitiveSubscription=knockout.getObservable(this,"filterPrimitive").subscribe(function(){d._doFilterPrimitive(),d._scene.requestRender()}),this._wireframeSubscription=knockout.getObservable(this,"wireframe").subscribe(function(e){h._surface.tileProvider._debug.wireframe=e,d._scene.requestRender()}),this._globeDepthSubscription=knockout.getObservable(this,"globeDepth").subscribe(function(e){d._scene.debugShowGlobeDepth=e,d._scene.requestRender()}),this._pickDepthSubscription=knockout.getObservable(this,"pickDepth").subscribe(function(e){d._scene.debugShowPickDepth=e,d._scene.requestRender()}),this._depthFrustumSubscription=knockout.getObservable(this,"depthFrustum").subscribe(function(e){d._scene.debugShowDepthFrustum=e,d._scene.requestRender()}),this._incrementDepthFrustum=createCommand$2(function(){var e=d.depthFrustum+1;return d.depthFrustum=boundDepthFrustum(1,d._numberOfFrustums,e),d._scene.requestRender(),!0}),this._decrementDepthFrustum=createCommand$2(function(){var e=d.depthFrustum-1;return d.depthFrustum=boundDepthFrustum(1,d._numberOfFrustums,e),d._scene.requestRender(),!0}),this._suspendUpdatesSubscription=knockout.getObservable(this,"suspendUpdates").subscribe(function(e){(h._surface._debug.suspendLodUpdate=e)||(d.filterTile=!1)}),this._showTileCoordinates=createCommand$2(function(){return d.tileCoordinates&&!defined(n)?n=e.imageryLayers.addImageryProvider(new TileCoordinatesImageryProvider({tilingScheme:e.terrainProvider.tilingScheme})):!d.tileCoordinates&&defined(n)&&(e.imageryLayers.remove(n),n=void 0),!0}),this._tileCoordinatesSubscription=knockout.getObservable(this,"tileCoordinates").subscribe(function(){d._showTileCoordinates(),d._scene.requestRender()}),this._tileBoundingSphereSubscription=knockout.getObservable(this,"tileBoundingSphere").subscribe(function(){d._showTileBoundingSphere(),d._scene.requestRender()}),this._showTileBoundingSphere=createCommand$2(function(){return d.tileBoundingSphere?h._surface.tileProvider._debug.boundingSphereTile=d._tile:h._surface.tileProvider._debug.boundingSphereTile=void 0,d._scene.requestRender(),!0}),this._doFilterTile=createCommand$2(function(){return d.filterTile?(d.suspendUpdates=!0,h._surface._tilesToRender=[],defined(d._tile)&&d._tile.renderable&&h._surface._tilesToRender.push(d._tile)):d.suspendUpdates=!1,!0}),this._filterTileSubscription=knockout.getObservable(this,"filterTile").subscribe(function(){d.doFilterTile(),d._scene.requestRender()}),this._pickPrimitive=createCommand$2(function(){d.pickPrimitiveActive=!d.pickPrimitiveActive}),this._pickPrimitiveActiveSubscription=knockout.getObservable(this,"pickPrimitiveActive").subscribe(function(e){e?r.setInputAction(a,ScreenSpaceEventType$1.LEFT_CLICK):r.removeInputAction(ScreenSpaceEventType$1.LEFT_CLICK)}),this._pickTile=createCommand$2(function(){d.pickTileActive=!d.pickTileActive}),this._pickTileActiveSubscription=knockout.getObservable(this,"pickTileActive").subscribe(function(e){e?r.setInputAction(o,ScreenSpaceEventType$1.LEFT_CLICK):r.removeInputAction(ScreenSpaceEventType$1.LEFT_CLICK)}),this._removePostRenderEvent=e.postRender.addEventListener(function(){d._update()})}function CesiumInspector(e,t){e=getElement(e);var i=document.createElement("div"),r=new CesiumInspectorViewModel(t,i);this._viewModel=r,this._container=e;var n=document.createElement("div");this._element=n;var a=document.createElement("div");a.textContent="Cesium Inspector",a.className="cesium-cesiumInspector-button",a.setAttribute("data-bind","click: toggleDropDown"),n.appendChild(a),n.className="cesium-cesiumInspector",n.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : dropDownVisible, "cesium-cesiumInspector-hidden" : !dropDownVisible }'),e.appendChild(this._element);var o=document.createElement("div");(this._panel=o).className="cesium-cesiumInspector-dropDown",n.appendChild(o);var s=InspectorShared.createSection,l=InspectorShared.createCheckbox,u=s(o,"General","generalVisible","toggleGeneral"),c=l("Show Frustums","frustums"),d=document.createElement("div");d.className="cesium-cesiumInspector-frustumStatistics",d.setAttribute("data-bind","visible: frustums, html: frustumStatisticText"),c.appendChild(d),u.appendChild(c),u.appendChild(l("Show Frustum Planes","frustumPlanes")),u.appendChild(l("Performance Display","performance")),i.className="cesium-cesiumInspector-performanceDisplay",u.appendChild(i);var h=document.createElement("div");h.className="cesium-cesiumInspector-shaderCache",h.setAttribute("data-bind","html: shaderCacheText"),u.appendChild(h);var p=document.createElement("div");u.appendChild(p);var f=document.createElement("span");f.setAttribute("data-bind",'html: "     Frustum:"'),p.appendChild(f);var m=document.createElement("span");m.setAttribute("data-bind","text: depthFrustumText"),p.appendChild(m);var g=document.createElement("input");g.type="button",g.value="-",g.className="cesium-cesiumInspector-pickButton",g.setAttribute("data-bind","click: decrementDepthFrustum"),p.appendChild(g);var y=document.createElement("input");y.type="button",y.value="+",y.className="cesium-cesiumInspector-pickButton",y.setAttribute("data-bind","click: incrementDepthFrustum"),p.appendChild(y);var v=s(o,"Primitives","primitivesVisible","togglePrimitives"),_=document.createElement("div");_.className="cesium-cesiumInspector-pickSection",v.appendChild(_);var C=document.createElement("input");C.type="button",C.value="Pick a primitive",C.className="cesium-cesiumInspector-pickButton",C.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickPrimitiveActive}, click: pickPrimitive');var x=document.createElement("div");x.className="cesium-cesiumInspector-center",x.appendChild(C),_.appendChild(x),_.appendChild(l("Show bounding sphere","primitiveBoundingSphere","hasPickedPrimitive")),_.appendChild(l("Show reference frame","primitiveReferenceFrame","hasPickedPrimitive")),this._primitiveOnly=l("Show only selected","filterPrimitive","hasPickedPrimitive"),_.appendChild(this._primitiveOnly);var b=s(o,"Terrain","terrainVisible","toggleTerrain"),A=document.createElement("div");A.className="cesium-cesiumInspector-pickSection",b.appendChild(A);var S=document.createElement("input");S.type="button",S.value="Pick a tile",S.className="cesium-cesiumInspector-pickButton",S.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickTileActive}, click: pickTile'),(x=document.createElement("div")).appendChild(S),x.className="cesium-cesiumInspector-center",A.appendChild(x);var w=document.createElement("div");A.appendChild(w);var E=document.createElement("input");E.type="button",E.value="Parent",E.className="cesium-cesiumInspector-pickButton",E.setAttribute("data-bind","click: selectParent");var T=document.createElement("input");T.type="button",T.value="NW",T.className="cesium-cesiumInspector-pickButton",T.setAttribute("data-bind","click: selectNW");var P=document.createElement("input");P.type="button",P.value="NE",P.className="cesium-cesiumInspector-pickButton",P.setAttribute("data-bind","click: selectNE");var M=document.createElement("input");M.type="button",M.value="SW",M.className="cesium-cesiumInspector-pickButton",M.setAttribute("data-bind","click: selectSW");var D=document.createElement("input");D.type="button",D.value="SE",D.className="cesium-cesiumInspector-pickButton",D.setAttribute("data-bind","click: selectSE");var I=document.createElement("div");I.className="cesium-cesiumInspector-tileText",w.className="cesium-cesiumInspector-frustumStatistics",w.appendChild(I),w.setAttribute("data-bind","visible: hasPickedTile"),I.setAttribute("data-bind","html: tileText");var O=document.createElement("div");O.className="cesium-cesiumInspector-relativeText",O.textContent="Select relative:",w.appendChild(O);var R=document.createElement("table"),L=document.createElement("tr"),N=document.createElement("tr"),k=document.createElement("td");k.appendChild(E);var B=document.createElement("td");B.appendChild(T);var F=document.createElement("td");F.appendChild(P),L.appendChild(k),L.appendChild(B),L.appendChild(F);var V=document.createElement("td"),z=document.createElement("td");z.appendChild(M);var U=document.createElement("td");U.appendChild(D),N.appendChild(V),N.appendChild(z),N.appendChild(U),R.appendChild(L),R.appendChild(N),w.appendChild(R),A.appendChild(l("Show bounding volume","tileBoundingSphere","hasPickedTile")),A.appendChild(l("Show only selected","filterTile","hasPickedTile")),b.appendChild(l("Wireframe","wireframe")),b.appendChild(l("Suspend LOD update","suspendUpdates")),b.appendChild(l("Show tile coordinates","tileCoordinates")),knockout.applyBindings(r,this._element)}function getDefaultSkyBoxUrl(e){return buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_"+e+".jpg")}function startRenderLoop(a){a._renderLoopRunning=!0;var o=0;requestAnimationFramePolyFill(function e(t){if(!a.isDestroyed())if(a._useDefaultRenderLoop)try{var i=a._targetFrameRate;if(defined(i)){var r=1e3/i,n=t-o;r<n&&(a.resize(),a.render(),o=t-n%r),requestAnimationFramePolyFill(e)}else a.resize(),a.render(),requestAnimationFramePolyFill(e)}catch(e){a._useDefaultRenderLoop=!1,a._renderLoopRunning=!1,a._showRenderLoopErrors&&a.showErrorPanel("An error occurred while rendering. Rendering has stopped.",void 0,e)}else a._renderLoopRunning=!1})}function configurePixelRatio(e){var t=e._useBrowserRecommendedResolution?1:window.devicePixelRatio;return t*=e._resolutionScale,defined(e._scene)&&(e._scene.pixelRatio=t),t}function configureCanvasSize(e){var t=e._canvas,i=t.clientWidth,r=t.clientHeight,n=configurePixelRatio(e);e._canvasClientWidth=i,e._canvasClientHeight=r,i*=n,r*=n,t.width=i,t.height=r,e._canRender=0!==i&&0!==r,e._lastDevicePixelRatio=window.devicePixelRatio}function configureCameraFrustum(e){var t=e._canvas,i=t.width,r=t.height;if(0!==i&&0!==r){var n=e._scene.camera.frustum;defined(n.aspectRatio)?n.aspectRatio=i/r:(n.top=n.right*(r/i),n.bottom=-n.top)}}function CesiumWidget(e,t){e=getElement(e),t=defaultValue(t,defaultValue.EMPTY_OBJECT);var i=document.createElement("div");i.className="cesium-widget",e.appendChild(i);var r=document.createElement("canvas"),n=FeatureDetection$1.supportsImageRenderingPixelated();function a(){r!==r.ownerDocument.activeElement&&r.ownerDocument.activeElement.blur()}(this._supportsImageRenderingPixelated=n)&&(r.style.imageRendering=FeatureDetection$1.imageRenderingValue()),r.oncontextmenu=function(){return!1},r.onselectstart=function(){return!1},r.addEventListener("mousedown",a),r.addEventListener("pointerdown",a),i.appendChild(r);var o=document.createElement("div");o.className="cesium-widget-credits";var s=defined(t.creditContainer)?getElement(t.creditContainer):i;s.appendChild(o);var l=defined(t.creditViewport)?getElement(t.creditViewport):i,u=defaultValue(t.showRenderLoopErrors,!0),c=defaultValue(t.useBrowserRecommendedResolution,!0);this._element=i,this._container=e,this._canvas=r,this._canvasClientWidth=0,this._canvasClientHeight=0,this._lastDevicePixelRatio=0,this._creditViewport=l,this._creditContainer=s,this._innerCreditContainer=o,this._canRender=!1,this._renderLoopRunning=!1,this._showRenderLoopErrors=u,this._resolutionScale=1,this._useBrowserRecommendedResolution=c,this._forceResize=!1,this._clock=defined(t.clock)?t.clock:new Clock,configureCanvasSize(this);try{var d=new Scene({canvas:r,contextOptions:t.contextOptions,creditContainer:o,creditViewport:l,mapProjection:t.mapProjection,orderIndependentTranslucency:t.orderIndependentTranslucency,scene3DOnly:defaultValue(t.scene3DOnly,!1),terrainExaggeration:t.terrainExaggeration,shadows:t.shadows,mapMode2D:t.mapMode2D,requestRenderMode:t.requestRenderMode,maximumRenderTimeChange:t.maximumRenderTimeChange});(this._scene=d).camera.constrainedAxis=Cartesian3.UNIT_Z,configurePixelRatio(this),configureCameraFrustum(this);var h=defaultValue(d.mapProjection.ellipsoid,Ellipsoid.WGS84),p=t.globe;defined(p)||(p=new Globe(h)),!1!==p&&(d.globe=p,d.globe.shadows=defaultValue(t.terrainShadows,ShadowMode$1.RECEIVE_ONLY));var f=t.skyBox;defined(f)||(f=new SkyBox({sources:{positiveX:getDefaultSkyBoxUrl("px"),negativeX:getDefaultSkyBoxUrl("mx"),positiveY:getDefaultSkyBoxUrl("py"),negativeY:getDefaultSkyBoxUrl("my"),positiveZ:getDefaultSkyBoxUrl("pz"),negativeZ:getDefaultSkyBoxUrl("mz")}})),!1!==f&&(d.skyBox=f,d.sun=new Sun,d.moon=new Moon);var m=t.skyAtmosphere;defined(m)||(m=new SkyAtmosphere(h)),!1!==m&&(d.skyAtmosphere=m);var g=!1!==t.globe&&t.imageryProvider;defined(g)||(g=createWorldImagery()),!1!==g&&d.imageryLayers.addImageryProvider(g),defined(t.terrainProvider)&&!1!==t.globe&&(d.terrainProvider=t.terrainProvider),this._screenSpaceEventHandler=new ScreenSpaceEventHandler(r),defined(t.sceneMode)&&(t.sceneMode===SceneMode$1.SCENE2D&&this._scene.morphTo2D(0),t.sceneMode===SceneMode$1.COLUMBUS_VIEW&&this._scene.morphToColumbusView(0)),this._useDefaultRenderLoop=void 0,this.useDefaultRenderLoop=defaultValue(t.useDefaultRenderLoop,!0),this._targetFrameRate=void 0,this.targetFrameRate=t.targetFrameRate;var y=this;d.renderError.addEventListener(function(e,t){if(y._useDefaultRenderLoop=!1,y._renderLoopRunning=!1,y._showRenderLoopErrors){y.showErrorPanel("An error occurred while rendering. Rendering has stopped.",void 0,t)}})}catch(e){if(u){this.showErrorPanel("Error constructing CesiumWidget.",'Visit <a href="http://get.webgl.org">http://get.webgl.org</a> to verify that your web browser and hardware support WebGL. Consider trying a different web browser or updating your video drivers. Detailed error information is below:',e)}throw e}}function FullscreenButtonViewModel(e,t){defined(t)||(t=document.body),t=getElement(t);var i=this,r=knockout.observable(Fullscreen.fullscreen),n=knockout.observable(Fullscreen.enabled),a=t.ownerDocument;this.isFullscreen=void 0,knockout.defineProperty(this,"isFullscreen",{get:function(){return r()}}),this.isFullscreenEnabled=void 0,knockout.defineProperty(this,"isFullscreenEnabled",{get:function(){return n()},set:function(e){n(e&&Fullscreen.enabled)}}),this.tooltip=void 0,knockout.defineProperty(this,"tooltip",function(){return this.isFullscreenEnabled?r()?"Exit full screen":"Full screen":"Full screen unavailable"}),this._command=createCommand$2(function(){Fullscreen.fullscreen?Fullscreen.exitFullscreen():Fullscreen.requestFullscreen(i._fullscreenElement)},knockout.getObservable(this,"isFullscreenEnabled")),this._fullscreenElement=defaultValue(getElement(e),a.body),this._callback=function(){r(Fullscreen.fullscreen)},a.addEventListener(Fullscreen.changeEventName,this._callback)}Object.defineProperties(CesiumInspectorViewModel.prototype,{scene:{get:function(){return this._scene}},performanceContainer:{get:function(){return this._performanceContainer}},toggleDropDown:{get:function(){return this._toggleDropDown}},showPrimitiveBoundingSphere:{get:function(){return this._showPrimitiveBoundingSphere}},showPrimitiveReferenceFrame:{get:function(){return this._showPrimitiveReferenceFrame}},doFilterPrimitive:{get:function(){return this._doFilterPrimitive}},incrementDepthFrustum:{get:function(){return this._incrementDepthFrustum}},decrementDepthFrustum:{get:function(){return this._decrementDepthFrustum}},showTileCoordinates:{get:function(){return this._showTileCoordinates}},showTileBoundingSphere:{get:function(){return this._showTileBoundingSphere}},doFilterTile:{get:function(){return this._doFilterTile}},toggleGeneral:{get:function(){return this._toggleGeneral}},togglePrimitives:{get:function(){return this._togglePrimitives}},toggleTerrain:{get:function(){return this._toggleTerrain}},pickPrimitive:{get:function(){return this._pickPrimitive}},pickTile:{get:function(){return this._pickTile}},selectParent:{get:function(){var e=this;return createCommand$2(function(){e.tile=e.tile.parent})}},selectNW:{get:function(){var e=this;return createCommand$2(function(){e.tile=e.tile.northwestChild})}},selectNE:{get:function(){var e=this;return createCommand$2(function(){e.tile=e.tile.northeastChild})}},selectSW:{get:function(){var e=this;return createCommand$2(function(){e.tile=e.tile.southwestChild})}},selectSE:{get:function(){var e=this;return createCommand$2(function(){e.tile=e.tile.southeastChild})}},primitive:{get:function(){return this._primitive},set:function(e){var t=this._primitive;e!==t&&(this.hasPickedPrimitive=!0,defined(t)&&(t.debugShowBoundingVolume=!1),this._scene.debugCommandFilter=void 0,defined(this._modelMatrixPrimitive)&&(this._scene.primitives.remove(this._modelMatrixPrimitive),this._modelMatrixPrimitive=void 0),(this._primitive=e).show=!1,setTimeout(function(){e.show=!0},50),this.showPrimitiveBoundingSphere(),this.showPrimitiveReferenceFrame(),this.doFilterPrimitive())}},tile:{get:function(){return this._tile},set:function(e){if(defined(e)){if(this.hasPickedTile=!0,e!==this._tile){this.tileText="L: "+e.level+" X: "+e.x+" Y: "+e.y,this.tileText+="<br>SW corner: "+e.rectangle.west+", "+e.rectangle.south,this.tileText+="<br>NE corner: "+e.rectangle.east+", "+e.rectangle.north;var t=e.data;defined(t)&&defined(t.tileBoundingRegion)?this.tileText+="<br>Min: "+t.tileBoundingRegion.minimumHeight+" Max: "+t.tileBoundingRegion.maximumHeight:this.tileText+="<br>(Tile is not loaded)"}this._tile=e,this.showTileBoundingSphere(),this.doFilterTile()}else this.hasPickedTile=!1,this._tile=void 0}}}),CesiumInspectorViewModel.prototype._update=function(){this.frustums&&(this.frustumStatisticText=frustumStatisticsToString(this._scene.debugFrustumStatistics));var e=this._scene.numberOfFrustums;this._numberOfFrustums=e,this.depthFrustum=boundDepthFrustum(1,e,this.depthFrustum),this.depthFrustumText=this.depthFrustum+" of "+e,this.performance&&this._performanceDisplay.update(),this.primitiveReferenceFrame&&(this._modelMatrixPrimitive.modelMatrix=this._primitive.modelMatrix),this.shaderCacheText="Cached shaders: "+this._scene.context.shaderCache.numberOfShaders},CesiumInspectorViewModel.prototype.isDestroyed=function(){return!1},CesiumInspectorViewModel.prototype.destroy=function(){return this._eventHandler.destroy(),this._removePostRenderEvent(),this._frustumsSubscription.dispose(),this._frustumPlanesSubscription.dispose(),this._performanceSubscription.dispose(),this._primitiveBoundingSphereSubscription.dispose(),this._primitiveReferenceFrameSubscription.dispose(),this._filterPrimitiveSubscription.dispose(),this._wireframeSubscription.dispose(),this._globeDepthSubscription.dispose(),this._pickDepthSubscription.dispose(),this._depthFrustumSubscription.dispose(),this._suspendUpdatesSubscription.dispose(),this._tileCoordinatesSubscription.dispose(),this._tileBoundingSphereSubscription.dispose(),this._filterTileSubscription.dispose(),this._pickPrimitiveActiveSubscription.dispose(),this._pickTileActiveSubscription.dispose(),destroyObject(this)},Object.defineProperties(CesiumInspector.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),CesiumInspector.prototype.isDestroyed=function(){return!1},CesiumInspector.prototype.destroy=function(){return knockout.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),destroyObject(this)},Object.defineProperties(CesiumWidget.prototype,{container:{get:function(){return this._container}},canvas:{get:function(){return this._canvas}},creditContainer:{get:function(){return this._creditContainer}},creditViewport:{get:function(){return this._creditViewport}},scene:{get:function(){return this._scene}},imageryLayers:{get:function(){return this._scene.imageryLayers}},terrainProvider:{get:function(){return this._scene.terrainProvider},set:function(e){this._scene.terrainProvider=e}},camera:{get:function(){return this._scene.camera}},clock:{get:function(){return this._clock}},screenSpaceEventHandler:{get:function(){return this._screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._targetFrameRate},set:function(e){this._targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._useDefaultRenderLoop},set:function(e){this._useDefaultRenderLoop!==e&&(this._useDefaultRenderLoop=e)&&!this._renderLoopRunning&&startRenderLoop(this)}},resolutionScale:{get:function(){return this._resolutionScale},set:function(e){this._resolutionScale!==e&&(this._resolutionScale=e,this._forceResize=!0)}},useBrowserRecommendedResolution:{get:function(){return this._useBrowserRecommendedResolution},set:function(e){this._useBrowserRecommendedResolution!==e&&(this._useBrowserRecommendedResolution=e,this._forceResize=!0)}}}),CesiumWidget.prototype.showErrorPanel=function(e,t,i){var r=this._element,n=document.createElement("div");n.className="cesium-widget-errorPanel";var a=document.createElement("div");a.className="cesium-widget-errorPanel-content",n.appendChild(a);var o=document.createElement("div");o.className="cesium-widget-errorPanel-header",o.appendChild(document.createTextNode(e)),a.appendChild(o);var s=document.createElement("div");function l(){s.style.maxHeight=Math.max(Math.round(.9*r.clientHeight-100),30)+"px"}if(s.className="cesium-widget-errorPanel-scroll",a.appendChild(s),l(),defined(window.addEventListener)&&window.addEventListener("resize",l,!1),defined(t)){var u=document.createElement("div");u.className="cesium-widget-errorPanel-message",u.innerHTML="<p>"+t+"</p>",s.appendChild(u)}var c="(no error details available)";defined(i)&&(c=formatError(i));var d=document.createElement("div");d.className="cesium-widget-errorPanel-message",d.appendChild(document.createTextNode(c)),s.appendChild(d);var h=document.createElement("div");h.className="cesium-widget-errorPanel-buttonPanel",a.appendChild(h);var p=document.createElement("button");p.setAttribute("type","button"),p.className="cesium-button",p.appendChild(document.createTextNode("OK")),p.onclick=function(){defined(l)&&defined(window.removeEventListener)&&window.removeEventListener("resize",l,!1),r.removeChild(n)},h.appendChild(p),r.appendChild(n),"undefined"!=typeof console&&console.error(e+"\n"+t+"\n"+c)},CesiumWidget.prototype.isDestroyed=function(){return!1},CesiumWidget.prototype.destroy=function(){this._scene=this._scene&&this._scene.destroy(),this._container.removeChild(this._element),this._creditContainer.removeChild(this._innerCreditContainer),destroyObject(this)},CesiumWidget.prototype.resize=function(){var e=this._canvas;!this._forceResize&&this._canvasClientWidth===e.clientWidth&&this._canvasClientHeight===e.clientHeight&&this._lastDevicePixelRatio===window.devicePixelRatio||(this._forceResize=!1,configureCanvasSize(this),configureCameraFrustum(this),this._scene.requestRender())},CesiumWidget.prototype.render=function(){if(this._canRender){this._scene.initializeFrame();var e=this._clock.tick();this._scene.render(e)}else this._clock.tick()},Object.defineProperties(FullscreenButtonViewModel.prototype,{fullscreenElement:{get:function(){return this._fullscreenElement},set:function(e){this._fullscreenElement=e}},command:{get:function(){return this._command}}}),FullscreenButtonViewModel.prototype.isDestroyed=function(){return!1},FullscreenButtonViewModel.prototype.destroy=function(){document.removeEventListener(Fullscreen.changeEventName,this._callback),destroyObject(this)};var enterFullScreenPath="M 83.96875 17.5625 L 83.96875 17.59375 L 76.65625 24.875 L 97.09375 24.96875 L 76.09375 45.96875 L 81.9375 51.8125 L 102.78125 30.9375 L 102.875 51.15625 L 110.15625 43.875 L 110.1875 17.59375 L 83.96875 17.5625 z M 44.125 17.59375 L 17.90625 17.625 L 17.9375 43.90625 L 25.21875 51.1875 L 25.3125 30.96875 L 46.15625 51.8125 L 52 45.96875 L 31 25 L 51.4375 24.90625 L 44.125 17.59375 z M 46.0625 76.03125 L 25.1875 96.875 L 25.09375 76.65625 L 17.8125 83.9375 L 17.8125 110.21875 L 44 110.25 L 51.3125 102.9375 L 30.90625 102.84375 L 51.875 81.875 L 46.0625 76.03125 z M 82 76.15625 L 76.15625 82 L 97.15625 103 L 76.71875 103.0625 L 84.03125 110.375 L 110.25 110.34375 L 110.21875 84.0625 L 102.9375 76.8125 L 102.84375 97 L 82 76.15625 z",exitFullScreenPath="M 104.34375 17.5625 L 83.5 38.4375 L 83.40625 18.21875 L 76.125 25.5 L 76.09375 51.78125 L 102.3125 51.8125 L 102.3125 51.78125 L 109.625 44.5 L 89.1875 44.40625 L 110.1875 23.40625 L 104.34375 17.5625 z M 23.75 17.59375 L 17.90625 23.4375 L 38.90625 44.4375 L 18.5 44.53125 L 25.78125 51.8125 L 52 51.78125 L 51.96875 25.53125 L 44.6875 18.25 L 44.625 38.46875 L 23.75 17.59375 z M 25.6875 76.03125 L 18.375 83.3125 L 38.78125 83.40625 L 17.8125 104.40625 L 23.625 110.25 L 44.5 89.375 L 44.59375 109.59375 L 51.875 102.3125 L 51.875 76.0625 L 25.6875 76.03125 z M 102.375 76.15625 L 76.15625 76.1875 L 76.1875 102.4375 L 83.46875 109.71875 L 83.5625 89.53125 L 104.40625 110.375 L 110.25 104.53125 L 89.25 83.53125 L 109.6875 83.46875 L 102.375 76.15625 z";function FullscreenButton(e,t){var i=new FullscreenButtonViewModel(t,e=getElement(e));i._exitFullScreenPath=exitFullScreenPath,i._enterFullScreenPath=enterFullScreenPath;var r=document.createElement("button");r.type="button",r.className="cesium-button cesium-fullscreenButton",r.setAttribute("data-bind","attr: { title: tooltip },click: command,enable: isFullscreenEnabled,cesiumSvgPath: { path: isFullscreen ? _exitFullScreenPath : _enterFullScreenPath, width: 128, height: 128 }"),e.appendChild(r),knockout.applyBindings(i,r),this._container=e,this._viewModel=i,this._element=r}Object.defineProperties(FullscreenButton.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),FullscreenButton.prototype.isDestroyed=function(){return!1},FullscreenButton.prototype.destroy=function(){return this._viewModel.destroy(),knockout.cleanNode(this._element),this._container.removeChild(this._element),destroyObject(this)};var DEFAULT_HEIGHT=1e3;function GeocoderViewModel(e){defined(e.geocoderServices)?this._geocoderServices=e.geocoderServices:this._geocoderServices=[new CartographicGeocoderService,new IonGeocoderService({scene:e.scene})],this._viewContainer=e.container,this._scene=e.scene,this._flightDuration=e.flightDuration,this._searchText="",this._isSearchInProgress=!1,this._geocodePromise=void 0,this._complete=new Event,this._suggestions=[],this._selectedSuggestion=void 0,this._showSuggestions=!0,this._handleArrowDown=handleArrowDown,this._handleArrowUp=handleArrowUp;var a=this;this._suggestionsVisible=knockout.pureComputed(function(){var e=0<knockout.getObservable(a,"_suggestions")().length,t=knockout.getObservable(a,"_showSuggestions")();return e&&t}),this._searchCommand=createCommand$2(function(e){if(e=defaultValue(e,GeocodeType$1.SEARCH),a._focusTextbox=!1,defined(a._selectedSuggestion))return a.activateSuggestion(a._selectedSuggestion),!1;a.hideSuggestions(),a.isSearchInProgress?cancelGeocode(a):geocode(a,a._geocoderServices,e)}),this.deselectSuggestion=function(){a._selectedSuggestion=void 0},this.handleKeyDown=function(e,t){var i="ArrowDown"===t.key||"Down"===t.key||40===t.keyCode,r="ArrowUp"===t.key||"Up"===t.key||38===t.keyCode;return(i||r)&&t.preventDefault(),!0},this.handleKeyUp=function(e,t){var i="ArrowDown"===t.key||"Down"===t.key||40===t.keyCode,r="ArrowUp"===t.key||"Up"===t.key||38===t.keyCode,n="Enter"===t.key||13===t.keyCode;return r?handleArrowUp(a):i?handleArrowDown(a):n&&a._searchCommand(),!0},this.activateSuggestion=function(e){a.hideSuggestions(),a._searchText=e.displayName;var t=e.destination;clearSuggestions(a),a.destinationFound(a,t)},this.hideSuggestions=function(){a._showSuggestions=!1,a._selectedSuggestion=void 0},this.showSuggestions=function(){a._showSuggestions=!0},this.handleMouseover=function(e,t){e!==a._selectedSuggestion&&(a._selectedSuggestion=e)},this.keepExpanded=!1,this.autoComplete=defaultValue(e.autocomplete,!0),this.destinationFound=defaultValue(e.destinationFound,GeocoderViewModel.flyToDestination),this._focusTextbox=!1,knockout.track(this,["_searchText","_isSearchInProgress","keepExpanded","_suggestions","_selectedSuggestion","_showSuggestions","_focusTextbox"]);var t=knockout.getObservable(this,"_searchText");t.extend({rateLimit:{timeout:500}}),this._suggestionSubscription=t.subscribe(function(){GeocoderViewModel._updateSearchSuggestions(a)}),this.isSearchInProgress=void 0,knockout.defineProperty(this,"isSearchInProgress",{get:function(){return this._isSearchInProgress}}),this.searchText=void 0,knockout.defineProperty(this,"searchText",{get:function(){return this.isSearchInProgress?"Searching...":this._searchText},set:function(e){this._searchText=e}}),this.flightDuration=void 0,knockout.defineProperty(this,"flightDuration",{get:function(){return this._flightDuration},set:function(e){this._flightDuration=e}})}function handleArrowUp(e){if(0!==e._suggestions.length){var t,i=e._suggestions.indexOf(e._selectedSuggestion);-1!==i&&0!==i?(t=i-1,e._selectedSuggestion=e._suggestions[t],GeocoderViewModel._adjustSuggestionsScroll(e,t)):e._selectedSuggestion=void 0}}function handleArrowDown(e){if(0!==e._suggestions.length){var t=e._suggestions.length,i=(e._suggestions.indexOf(e._selectedSuggestion)+1)%t;e._selectedSuggestion=e._suggestions[i],GeocoderViewModel._adjustSuggestionsScroll(e,i)}}function computeFlyToLocationForCartographic(t,e){return defined(defined(e)?e.availability:void 0)?sampleTerrainMostDetailed(e,[t]).then(function(e){return(t=e[0]).height+=DEFAULT_HEIGHT,t}):(t.height+=DEFAULT_HEIGHT,when.resolve(t))}function flyToDestination(e,t){var i,r=e._scene,n=r.mapProjection.ellipsoid,a=r.camera,o=r.terrainProvider,s=t;t instanceof Rectangle?CesiumMath.equalsEpsilon(t.south,t.north,CesiumMath.EPSILON7)&&CesiumMath.equalsEpsilon(t.east,t.west,CesiumMath.EPSILON7)?t=Rectangle.center(t):i=computeFlyToLocationForRectangle(t,r):t=n.cartesianToCartographic(t),defined(i)||(i=computeFlyToLocationForCartographic(t,o)),i.then(function(e){s=n.cartographicToCartesian(e)}).always(function(){a.flyTo({destination:s,complete:function(){e._complete.raiseEvent()},duration:e._flightDuration,endTransform:Matrix4.IDENTITY})})}function chainPromise(e,t,i,r){return e.then(function(e){return defined(e)&&"fulfilled"===e.state&&0<e.value.length?e:t.geocode(i,r).then(function(e){return{state:"fulfilled",value:e}}).otherwise(function(e){return{state:"rejected",reason:e}})})}function geocode(i,e,t){var r=i._searchText;if(hasOnlyWhitespace(r))i.showSuggestions();else{i._isSearchInProgress=!0;for(var n=when.resolve(),a=0;a<e.length;a++)n=chainPromise(n,e[a],r,t);(i._geocodePromise=n).then(function(e){if(!n.cancel){i._isSearchInProgress=!1;var t=e.value;if("fulfilled"===e.state&&defined(t)&&0<t.length)return i._searchText=t[0].displayName,void i.destinationFound(i,t[0].destination);i._searchText=r+" (not found)"}})}}function adjustSuggestionsScroll(e,t){var i=getElement(e._viewContainer),r=i.getElementsByClassName("search-results")[0],n=i.getElementsByTagName("li")[t];if(0!==t){var a=n.offsetTop;a+n.clientHeight>r.clientHeight?r.scrollTop=a+n.clientHeight:a<r.scrollTop&&(r.scrollTop=a)}else r.scrollTop=0}function cancelGeocode(e){e._isSearchInProgress=!1,defined(e._geocodePromise)&&(e._geocodePromise.cancel=!0,e._geocodePromise=void 0)}function hasOnlyWhitespace(e){return/^\s*$/.test(e)}function clearSuggestions(e){knockout.getObservable(e,"_suggestions").removeAll()}function updateSearchSuggestions(r){if(r.autoComplete){var i=r._searchText;if(clearSuggestions(r),!hasOnlyWhitespace(i)){var t=when.resolve([]);r._geocoderServices.forEach(function(e){t=t.then(function(t){return 5<=t.length?t:e.geocode(i,GeocodeType$1.AUTOCOMPLETE).then(function(e){return t=t.concat(e)})})}),t.then(function(e){for(var t=r._suggestions,i=0;i<e.length;i++)t.push(e[i])})}}}Object.defineProperties(GeocoderViewModel.prototype,{complete:{get:function(){return this._complete}},scene:{get:function(){return this._scene}},search:{get:function(){return this._searchCommand}},selectedSuggestion:{get:function(){return this._selectedSuggestion}},suggestions:{get:function(){return this._suggestions}}}),GeocoderViewModel.prototype.destroy=function(){this._suggestionSubscription.dispose()},GeocoderViewModel.flyToDestination=flyToDestination,GeocoderViewModel._updateSearchSuggestions=updateSearchSuggestions,GeocoderViewModel._adjustSuggestionsScroll=adjustSuggestionsScroll;var startSearchPath="M29.772,26.433l-7.126-7.126c0.96-1.583,1.523-3.435,1.524-5.421C24.169,8.093,19.478,3.401,13.688,3.399C7.897,3.401,3.204,8.093,3.204,13.885c0,5.789,4.693,10.481,10.484,10.481c1.987,0,3.839-0.563,5.422-1.523l7.128,7.127L29.772,26.433zM7.203,13.885c0.006-3.582,2.903-6.478,6.484-6.486c3.579,0.008,6.478,2.904,6.484,6.486c-0.007,3.58-2.905,6.476-6.484,6.484C10.106,20.361,7.209,17.465,7.203,13.885z",stopSearchPath="M24.778,21.419 19.276,15.917 24.777,10.415 21.949,7.585 16.447,13.087 10.945,7.585 8.117,10.415 13.618,15.917 8.116,21.419 10.946,24.248 16.447,18.746 21.948,24.248z";function Geocoder(e){var i=getElement(e.container),r=new GeocoderViewModel(e);r._startSearchPath=startSearchPath,r._stopSearchPath=stopSearchPath;var t=document.createElement("form");t.setAttribute("data-bind","submit: search");var n=document.createElement("input");n.type="search",n.className="cesium-geocoder-input",n.setAttribute("placeholder","Enter an address or landmark..."),n.setAttribute("data-bind",'textInput: searchText,disable: isSearchInProgress,event: { keyup: handleKeyUp, keydown: handleKeyDown, mouseover: deselectSuggestion },css: { "cesium-geocoder-input-wide" : keepExpanded || searchText.length > 0 },hasFocus: _focusTextbox'),this._onTextBoxFocus=function(){setTimeout(function(){n.select()},0)},n.addEventListener("focus",this._onTextBoxFocus,!1),t.appendChild(n),this._textBox=n;var a=document.createElement("span");a.className="cesium-geocoder-searchButton",a.setAttribute("data-bind","click: search,cesiumSvgPath: { path: isSearchInProgress ? _stopSearchPath : _startSearchPath, width: 32, height: 32 }"),t.appendChild(a),i.appendChild(t);var o=document.createElement("div");o.className="search-results",o.setAttribute("data-bind","visible: _suggestionsVisible");var s=document.createElement("ul");s.setAttribute("data-bind","foreach: _suggestions");var l=document.createElement("li");s.appendChild(l),l.setAttribute("data-bind","text: $data.displayName, click: $parent.activateSuggestion, event: { mouseover: $parent.handleMouseover}, css: { active: $data === $parent._selectedSuggestion }"),o.appendChild(s),i.appendChild(o),knockout.applyBindings(r,t),knockout.applyBindings(r,o),this._container=i,this._searchSuggestionsContainer=o,this._viewModel=r,this._form=t,this._onInputBegin=function(e){var t=e.target;"function"==typeof e.composedPath&&(t=e.composedPath()[0]),i.contains(t)||(r._focusTextbox=!1,r.hideSuggestions())},this._onInputEnd=function(e){r._focusTextbox=!0,r.showSuggestions()},FeatureDetection$1.supportsPointerEvents()?(document.addEventListener("pointerdown",this._onInputBegin,!0),i.addEventListener("pointerup",this._onInputEnd,!0),i.addEventListener("pointercancel",this._onInputEnd,!0)):(document.addEventListener("mousedown",this._onInputBegin,!0),i.addEventListener("mouseup",this._onInputEnd,!0),document.addEventListener("touchstart",this._onInputBegin,!0),i.addEventListener("touchend",this._onInputEnd,!0),i.addEventListener("touchcancel",this._onInputEnd,!0))}function HomeButtonViewModel(e,t){this._scene=e,this._duration=t;var i=this;this._command=createCommand$2(function(){i._scene.camera.flyHome(i._duration)}),this.tooltip="View Home",knockout.track(this,["tooltip"])}function HomeButton(e,t,i){e=getElement(e);var r=new HomeButtonViewModel(t,i);r._svgPath="M14,4l-10,8.75h20l-4.25-3.7188v-4.6562h-2.812v2.1875l-2.938-2.5625zm-7.0938,9.906v10.094h14.094v-10.094h-14.094zm2.1876,2.313h3.3122v4.25h-3.3122v-4.25zm5.8442,1.281h3.406v6.438h-3.406v-6.438z";var n=document.createElement("button");n.type="button",n.className="cesium-button cesium-toolbar-button cesium-home-button",n.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 28, height: 28 }"),e.appendChild(n),knockout.applyBindings(r,n),this._container=e,this._viewModel=r,this._element=n}Object.defineProperties(Geocoder.prototype,{container:{get:function(){return this._container}},searchSuggestionsContainer:{get:function(){return this._searchSuggestionsContainer}},viewModel:{get:function(){return this._viewModel}}}),Geocoder.prototype.isDestroyed=function(){return!1},Geocoder.prototype.destroy=function(){var e=this._container;return FeatureDetection$1.supportsPointerEvents()?(document.removeEventListener("pointerdown",this._onInputBegin,!0),e.removeEventListener("pointerup",this._onInputEnd,!0)):(document.removeEventListener("mousedown",this._onInputBegin,!0),e.removeEventListener("mouseup",this._onInputEnd,!0),document.removeEventListener("touchstart",this._onInputBegin,!0),e.removeEventListener("touchend",this._onInputEnd,!0)),this._viewModel.destroy(),knockout.cleanNode(this._form),knockout.cleanNode(this._searchSuggestionsContainer),e.removeChild(this._form),e.removeChild(this._searchSuggestionsContainer),this._textBox.removeEventListener("focus",this._onTextBoxFocus,!1),destroyObject(this)},Object.defineProperties(HomeButtonViewModel.prototype,{scene:{get:function(){return this._scene}},command:{get:function(){return this._command}},duration:{get:function(){return this._duration},set:function(e){this._duration=e}}}),Object.defineProperties(HomeButton.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),HomeButton.prototype.isDestroyed=function(){return!1},HomeButton.prototype.destroy=function(){return knockout.cleanNode(this._element),this._container.removeChild(this._element),destroyObject(this)};var cameraEnabledPath="M 13.84375 7.03125 C 11.412798 7.03125 9.46875 8.975298 9.46875 11.40625 L 9.46875 11.59375 L 2.53125 7.21875 L 2.53125 24.0625 L 9.46875 19.6875 C 9.4853444 22.104033 11.423165 24.0625 13.84375 24.0625 L 25.875 24.0625 C 28.305952 24.0625 30.28125 22.087202 30.28125 19.65625 L 30.28125 11.40625 C 30.28125 8.975298 28.305952 7.03125 25.875 7.03125 L 13.84375 7.03125 z",cameraDisabledPath="M 27.34375 1.65625 L 5.28125 27.9375 L 8.09375 30.3125 L 30.15625 4.03125 L 27.34375 1.65625 z M 13.84375 7.03125 C 11.412798 7.03125 9.46875 8.975298 9.46875 11.40625 L 9.46875 11.59375 L 2.53125 7.21875 L 2.53125 24.0625 L 9.46875 19.6875 C 9.4724893 20.232036 9.5676108 20.7379 9.75 21.21875 L 21.65625 7.03125 L 13.84375 7.03125 z M 28.21875 7.71875 L 14.53125 24.0625 L 25.875 24.0625 C 28.305952 24.0625 30.28125 22.087202 30.28125 19.65625 L 30.28125 11.40625 C 30.28125 9.8371439 29.456025 8.4902779 28.21875 7.71875 z";function InfoBoxViewModel(){this._cameraClicked=new Event,this._closeClicked=new Event,this.maxHeight=500,this.enableCamera=!1,this.isCameraTracking=!1,this.showInfo=!1,this.titleText="",this.description="",knockout.track(this,["showInfo","titleText","description","maxHeight","enableCamera","isCameraTracking"]),this._loadingIndicatorHtml='<div class="cesium-infoBox-loadingContainer"><span class="cesium-infoBox-loading"></span></div>',this.cameraIconPath=void 0,knockout.defineProperty(this,"cameraIconPath",{get:function(){return!this.enableCamera||this.isCameraTracking?cameraDisabledPath:cameraEnabledPath}}),knockout.defineProperty(this,"_bodyless",{get:function(){return!defined(this.description)||0===this.description.length}})}function InfoBox(e){e=getElement(e);var l=document.createElement("div");l.className="cesium-infoBox",l.setAttribute("data-bind",'css: { "cesium-infoBox-visible" : showInfo, "cesium-infoBox-bodyless" : _bodyless }'),e.appendChild(l);var t=document.createElement("div");t.className="cesium-infoBox-title",t.setAttribute("data-bind","text: titleText"),l.appendChild(t);var i=document.createElement("button");i.type="button",i.className="cesium-button cesium-infoBox-camera",i.setAttribute("data-bind",'attr: { title: "Focus camera on object" },click: function () { cameraClicked.raiseEvent(this); },enable: enableCamera,cesiumSvgPath: { path: cameraIconPath, width: 32, height: 32 }'),l.appendChild(i);var r=document.createElement("button");r.type="button",r.className="cesium-infoBox-close",r.setAttribute("data-bind","click: function () { closeClicked.raiseEvent(this); }"),r.innerHTML="×",l.appendChild(r);var u=document.createElement("iframe");u.className="cesium-infoBox-iframe",u.setAttribute("sandbox","allow-same-origin allow-popups allow-forms"),u.setAttribute("data-bind","style : { maxHeight : maxHeightOffset(40) }"),u.setAttribute("allowfullscreen",!0),l.appendChild(u);var n=new InfoBoxViewModel;knockout.applyBindings(n,l),this._container=e,this._element=l,this._frame=u,this._viewModel=n,this._descriptionSubscription=void 0;var a=this;u.addEventListener("load",function(){var e=u.contentDocument,t=e.createElement("link");t.href=buildModuleUrl("Widgets/InfoBox/InfoBoxDescription.css"),t.rel="stylesheet",t.type="text/css";var s=e.createElement("div");s.className="cesium-infoBox-description",e.head.appendChild(t),e.body.appendChild(s),a._descriptionSubscription=subscribeAndEvaluate(n,"description",function(e){u.style.height="5px",s.innerHTML=e;var t=null,i=s.firstElementChild;if(null!==i&&1===s.childNodes.length){var r=window.getComputedStyle(i);if(null!==r){var n=r["background-color"],a=Color.fromCssColorString(n);defined(a)&&0!==a.alpha&&(t=r["background-color"])}}l.style["background-color"]=t;var o=s.getBoundingClientRect().height;u.style.height=o+"px"})}),u.setAttribute("src","about:blank")}InfoBoxViewModel.prototype.maxHeightOffset=function(e){return this.maxHeight-e+"px"},Object.defineProperties(InfoBoxViewModel.prototype,{cameraClicked:{get:function(){return this._cameraClicked}},closeClicked:{get:function(){return this._closeClicked}}}),Object.defineProperties(InfoBox.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}},frame:{get:function(){return this._frame}}}),InfoBox.prototype.isDestroyed=function(){return!1},InfoBox.prototype.destroy=function(){var e=this._container;return knockout.cleanNode(this._element),e.removeChild(this._element),defined(this._descriptionSubscription)&&this._descriptionSubscription.dispose(),destroyObject(this)};var boundingSphereScratch$2=new BoundingSphere;function getDefaultSkyBoxUrl$1(e){return buildModuleUrl("Assets/Textures/SkyBox/skyBox_"+e+".jpg")}function startRenderLoop$1(a){a._renderLoopRunning=!0;var o=0;requestAnimationFramePolyFill(function e(t){if(!a.isDestroyed())if(a._useDefaultRenderLoop)try{var i=a._targetFrameRate;if(defined(i)){var r=1e3/i,n=t-o;r<n&&(a.resize(),a.render(),o=t-n%r),requestAnimationFramePolyFill(e)}else a.resize(),a.render(),requestAnimationFramePolyFill(e)}catch(e){a._useDefaultRenderLoop=!1,a._renderLoopRunning=!1,a._showRenderLoopErrors&&a.showErrorPanel("An error occurred while rendering. Rendering has stopped.",void 0,e)}else a._renderLoopRunning=!1})}function configureCanvasSize$1(e){var t=e._canvas,i=t.clientWidth,r=t.clientHeight,n=e._resolutionScale;e._supportsImageRenderingPixelated||(n*=defaultValue(window.devicePixelRatio,1)),e._canvasWidth=i,e._canvasHeight=r,i*=n,r*=n,t.width=i,t.height=r,e._canRender=0!==i&&0!==r}function configureCameraFrustum$1(e){var t=e._canvas,i=t.width,r=t.height;if(0!==i&&0!==r){var n=e._scene.camera.frustum;defined(n.aspectRatio)?n.aspectRatio=i/r:(n.top=n.right*(r/i),n.bottom=-n.top)}}function MapWidget(e,t){e=getElement(e),t=defaultValue(t,{});var i=document.createElement("div");i.className="map-widget",e.appendChild(i);var r=document.createElement("canvas");r.setAttribute("id","mapRenderCanvas");var n=FeatureDetection$1.supportsImageRenderingPixelated();(this._supportsImageRenderingPixelated=n)&&(r.style.imageRendering=FeatureDetection$1.imageRenderingValue()),r.oncontextmenu=function(){return!1},r.onselectstart=function(){return!1},i.appendChild(r);var a=document.createElement("div");a.className="map-widget-message-pannel";var o=defined(t.creditContainer)?getElement(t.creditContainer):i;o.appendChild(a);var s=defined(t.creditViewport)?getElement(t.creditViewport):i,l=defaultValue(t.showRenderLoopErrors,!0);this._element=i,this._container=e,this._canvas=r,this._canvasWidth=0,this._canvasHeight=0,this._creditViewport=s,this._creditContainer=o,this._innerCreditContainer=a,this._canRender=!1,this._renderLoopRunning=!1,this._showRenderLoopErrors=l,this._resolutionScale=1,this._forceResize=!1,this._clock=defined(t.clock)?t.clock:new Clock,this._trackedEntityChanged=new Event,configureCanvasSize$1(this);try{var u=new Scene({canvas:r,contextOptions:t.contextOptions,creditContainer:a,creditViewport:s,mapProjection:t.mapProjection,orderIndependentTranslucency:t.orderIndependentTranslucency,scene3DOnly:defaultValue(t.scene3DOnly,!1),terrainExaggeration:t.terrainExaggeration,shadows:t.shadows,mapMode2D:t.mapMode2D,requestRenderMode:t.requestRenderMode,maximumRenderTimeChange:t.maximumRenderTimeChange});(this._scene=u).camera.constrainedAxis=Cartesian3.UNIT_Z,configureCameraFrustum$1(this);var c=null;c="CGCS2000"===t.ellipsoidCoordinates?defaultValue(u.mapProjection.ellipsoid,Ellipsoid.CGCS2000):defaultValue(u.mapProjection.ellipsoid,Ellipsoid.WGS84);var d=t.globe;defined(d)||(d=new Globe(c)),!1!==d&&(u.globe=d,u.globe.shadows=defaultValue(t.terrainShadows,ShadowMode$1.RECEIVE_ONLY));var h=t.skyBox;defined(h)||(h=new SkyBox({sources:{positiveX:getDefaultSkyBoxUrl$1("px"),negativeX:getDefaultSkyBoxUrl$1("mx"),positiveY:getDefaultSkyBoxUrl$1("py"),negativeY:getDefaultSkyBoxUrl$1("my"),positiveZ:getDefaultSkyBoxUrl$1("pz"),negativeZ:getDefaultSkyBoxUrl$1("mz")}})),!1!==h&&(u.skyBox=h,u.sun=new Sun,u.moon=new Moon);var p=t.skyAtmosphere;defined(p)||(p=new SkyAtmosphere(c)),!1!==p&&(u.skyAtmosphere=p);var f=!1!==t.globe&&t.imageryProvider;if(defined(f)||(f=createWorldImagery()),!1!==f)for(var m=0;m<f.length;m++)u.imageryLayers.addImageryProvider(f[m]);defined(t.terrainProvider)&&!1!==t.globe&&(u.terrainProvider=t.terrainProvider),this._screenSpaceEventHandler=new ScreenSpaceEventHandler(r,!1),defined(t.sceneMode)&&(t.sceneMode===SceneMode$1.SCENE2D&&this._scene.morphTo2D(0),t.sceneMode===SceneMode$1.COLUMBUS_VIEW&&this._scene.morphToColumbusView(0)),this._useDefaultRenderLoop=void 0,this.useDefaultRenderLoop=defaultValue(t.useDefaultRenderLoop,!0),this._targetFrameRate=void 0,this.targetFrameRate=t.targetFrameRate;var g=this;u.renderError.addEventListener(function(e,t){if(g._useDefaultRenderLoop=!1,g._renderLoopRunning=!1,g._showRenderLoopErrors){g.showErrorPanel("An error occurred while rendering. Rendering has stopped.",void 0,t)}})}catch(e){if(l){this.showErrorPanel("Error constructing MapWedget.",'Visit <a href="http://get.webgl.org">http://get.webgl.org</a> to verify that your web browser and hardware support WebGL. Consider trying a different web browser or updating your video drivers. Detailed error information is below:',e)}throw e}}function zoomToOrFly(i,e,t,r){cancelZoom(i);var n=when.defer();return i._zoomPromise=n,i._zoomIsFlight=r,i._zoomOptions=t,when(e,function(e){if(i._zoomPromise===n)if(e instanceof ImageryLayer)e.getViewableRectangle().then(function(e){return computeFlyToLocationForRectangle(e,i.scene)}).then(function(e){i._zoomPromise===n&&(i._zoomTarget=e)});else if(e instanceof Cesium3DTileset)i._zoomTarget=e;else if(e instanceof Model)i._zoomTarget=e;else if(e instanceof TimeDynamicPointCloud)i._zoomTarget=e;else if(e.isLoading&&defined(e.loadingEvent))var t=e.loadingEvent.addEventListener(function(){t(),i._zoomPromise===n&&(i._zoomTarget=e.entities.values.slice(0))});else isArrayFunction(e)?i._zoomTarget=e.slice(0):(defined((e=defaultValue(e.values,e)).entities)&&(e=e.entities.values),isArrayFunction(e)?i._zoomTarget=e.slice(0):i._zoomTarget=[e])}),i.scene.requestRender(),n.promise}function clearZoom(e){e._zoomPromise=void 0,e._zoomTarget=void 0,e._zoomOptions=void 0}function cancelZoom(e){var t=e._zoomPromise;defined(t)&&(clearZoom(e),t.resolve(!1))}function updateZoomTarget(e){var t=e.coreMap,i=t._zoomTarget;if(defined(i)&&t.scene.mode!==SceneMode$1.MORPHING){var r,n,a=t.scene,o=a.camera,s=t._zoomPromise,l=defaultValue(t._zoomOptions,{});if(i instanceof Cesium3DTileset||i instanceof Model)return i.readyPromise.then(function(){var e=i.boundingSphere;defined(l.offset)||(l.offset=new HeadingPitchRange(0,-.5,e.radius)),r={offset:l.offset,duration:l.duration,maximumHeight:l.maximumHeight,complete:function(){s.resolve(!0)},cancel:function(){s.resolve(!1)}},t._zoomIsFlight?o.flyToBoundingSphere(i.boundingSphere,r):(o.viewBoundingSphere(e,l.offset),o.lookAtTransform(Matrix4.IDENTITY),s.resolve(!0)),clearZoom(t)});if(i instanceof TimeDynamicPointCloud)return i.readyPromise.then(function(){var e=i.boundingSphere;defined(l.offset)||(l.offset=new HeadingPitchRange(0,-.5,e.radius)),r={offset:l.offset,duration:l.duration,maximumHeight:l.maximumHeight,complete:function(){s.resolve(!0)},cancel:function(){s.resolve(!1)}},t._zoomIsFlight?o.flyToBoundingSphere(e,r):(o.viewBoundingSphere(e,l.offset),o.lookAtTransform(Matrix4.IDENTITY),s.resolve(!0)),clearZoom(t)});if(i instanceof Cartographic)return r={destination:a.mapProjection.ellipsoid.cartographicToCartesian(i),duration:l.duration,maximumHeight:l.maximumHeight,complete:function(){s.resolve(!0)},cancel:function(){s.resolve(!1)}},t._zoomIsFlight?o.flyTo(r):(o.setView(r),s.resolve(!0)),void clearZoom(t);for(var u=i,c=[],d=0,h=u.length;d<h;d++){var p=e._dataSourceDisplay.getBoundingSphere(u[d],!1,boundingSphereScratch$2);if(p===BoundingSphereState$1.PENDING)return;p!==BoundingSphereState$1.FAILED&&c.push(BoundingSphere.clone(boundingSphereScratch$2))}0!==c.length?(t.trackedEntity=void 0,n=BoundingSphere.fromBoundingSpheres(c),t._zoomIsFlight?(clearZoom(t),o.flyToBoundingSphere(n,{duration:l.duration,maximumHeight:l.maximumHeight,complete:function(){s.resolve(!0)},cancel:function(){s.resolve(!1)},offset:l.offset})):(o.viewBoundingSphere(n,l.offset),o.lookAtTransform(Matrix4.IDENTITY),clearZoom(t),s.resolve(!0))):cancelZoom(t)}}function updateTrackedEntity(e){var t=e.coreMap;if(t._needTrackedEntityUpdate){var i=t.trackedEntity,r=t.clock.currentTime;if(defined(Property.getValueOrUndefined(i.position,r))){var n=t.scene,a=e._dataSourceDisplay.getBoundingSphere(i,!1,boundingSphereScratch$2);if(a!==BoundingSphereState$1.PENDING){var o=n.mode;o!==SceneMode$1.COLUMBUS_VIEW&&o!==SceneMode$1.SCENE2D||(n.screenSpaceCameraController.enableTranslate=!1),o!==SceneMode$1.COLUMBUS_VIEW&&o!==SceneMode$1.SCENE3D||(n.screenSpaceCameraController.enableTilt=!1);var s=a!==BoundingSphereState$1.FAILED?boundingSphereScratch$2:void 0;console.info(s),t._entityView=new EntityView(i,n,n.mapProjection.ellipsoid),t._entityView.update(r,s),t._needTrackedEntityUpdate=!1}}}}function NavigationHelpButtonViewModel(){this.showInstructions=!1;var e=this;this._command=createCommand$2(function(){e.showInstructions=!e.showInstructions}),this._showClick=createCommand$2(function(){e._touch=!1}),this._showTouch=createCommand$2(function(){e._touch=!0}),this._touch=!1,this.tooltip="Navigation Instructions",knockout.track(this,["tooltip","showInstructions","_touch"])}function NavigationHelpButton(e){var t=getElement(e.container),i=new NavigationHelpButtonViewModel,r=defaultValue(e.instructionsInitiallyVisible,!1);i.showInstructions=r,i._svgPath="M16,1.466C7.973,1.466,1.466,7.973,1.466,16c0,8.027,6.507,14.534,14.534,14.534c8.027,0,14.534-6.507,14.534-14.534C30.534,7.973,24.027,1.466,16,1.466z M17.328,24.371h-2.707v-2.596h2.707V24.371zM17.328,19.003v0.858h-2.707v-1.057c0-3.19,3.63-3.696,3.63-5.963c0-1.034-0.924-1.826-2.134-1.826c-1.254,0-2.354,0.924-2.354,0.924l-1.541-1.915c0,0,1.519-1.584,4.137-1.584c2.487,0,4.796,1.54,4.796,4.136C21.156,16.208,17.328,16.627,17.328,19.003z";var n=document.createElement("span");n.className="cesium-navigationHelpButton-wrapper",t.appendChild(n);var a=document.createElement("button");a.type="button",a.className="cesium-button cesium-toolbar-button cesium-navigation-help-button",a.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 32, height: 32 }"),n.appendChild(a);var o=document.createElement("div");o.className="cesium-navigation-help",o.setAttribute("data-bind",'css: { "cesium-navigation-help-visible" : showInstructions}'),n.appendChild(o);var s=document.createElement("button");s.type="button",s.className="cesium-navigation-button cesium-navigation-button-left",s.setAttribute("data-bind",'click: showClick, css: {"cesium-navigation-button-selected": !_touch, "cesium-navigation-button-unselected": _touch}');var l=document.createElement("img");l.src=buildModuleUrl("Widgets/Images/NavigationHelp/Mouse.svg"),l.className="cesium-navigation-button-icon",l.style.width="25px",l.style.height="25px",s.appendChild(l),s.appendChild(document.createTextNode("Mouse"));var u=document.createElement("button");u.type="button",u.className="cesium-navigation-button cesium-navigation-button-right",u.setAttribute("data-bind",'click: showTouch, css: {"cesium-navigation-button-selected": _touch, "cesium-navigation-button-unselected": !_touch}');var c=document.createElement("img");c.src=buildModuleUrl("Widgets/Images/NavigationHelp/Touch.svg"),c.className="cesium-navigation-button-icon",c.style.width="25px",c.style.height="25px",u.appendChild(c),u.appendChild(document.createTextNode("Touch")),o.appendChild(s),o.appendChild(u);var d=document.createElement("div");d.className="cesium-click-navigation-help cesium-navigation-help-instructions",d.setAttribute("data-bind",'css: { "cesium-click-navigation-help-visible" : !_touch}'),d.innerHTML=' <table> <tr> <td><img src="'+buildModuleUrl("Widgets/Images/NavigationHelp/MouseLeft.svg")+'" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-pan">Pan view</div> <div class="cesium-navigation-help-details">Left click + drag</div> </td> </tr> <tr> <td><img src="'+buildModuleUrl("Widgets/Images/NavigationHelp/MouseRight.svg")+'" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-zoom">Zoom view</div> <div class="cesium-navigation-help-details">Right click + drag, or</div> <div class="cesium-navigation-help-details">Mouse wheel scroll</div> </td> </tr> <tr> <td><img src="'+buildModuleUrl("Widgets/Images/NavigationHelp/MouseMiddle.svg")+'" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-rotate">Rotate view</div> <div class="cesium-navigation-help-details">Middle click + drag, or</div> <div class="cesium-navigation-help-details">CTRL + Left/Right click + drag</div> </td> </tr> </table>',o.appendChild(d);var h=document.createElement("div");h.className="cesium-touch-navigation-help cesium-navigation-help-instructions",h.setAttribute("data-bind",'css: { "cesium-touch-navigation-help-visible" : _touch}'),h.innerHTML=' <table> <tr> <td><img src="'+buildModuleUrl("Widgets/Images/NavigationHelp/TouchDrag.svg")+'" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-pan">Pan view</div> <div class="cesium-navigation-help-details">One finger drag</div> </td> </tr> <tr> <td><img src="'+buildModuleUrl("Widgets/Images/NavigationHelp/TouchZoom.svg")+'" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-zoom">Zoom view</div> <div class="cesium-navigation-help-details">Two finger pinch</div> </td> </tr> <tr> <td><img src="'+buildModuleUrl("Widgets/Images/NavigationHelp/TouchTilt.svg")+'" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-rotate">Tilt view</div> <div class="cesium-navigation-help-details">Two finger drag, same direction</div> </td> </tr> <tr> <td><img src="'+buildModuleUrl("Widgets/Images/NavigationHelp/TouchRotate.svg")+'" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-tilt">Rotate view</div> <div class="cesium-navigation-help-details">Two finger drag, opposite direction</div> </td> </tr> </table>',o.appendChild(h),knockout.applyBindings(i,n),this._container=t,this._viewModel=i,this._wrapper=n,this._closeInstructions=function(e){n.contains(e.target)||(i.showInstructions=!1)},FeatureDetection$1.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeInstructions,!0):(document.addEventListener("mousedown",this._closeInstructions,!0),document.addEventListener("touchstart",this._closeInstructions,!0))}function PerformanceWatchdogViewModel(e){this._scene=e.scene,this.lowFrameRateMessage=defaultValue(e.lowFrameRateMessage,"This application appears to be performing poorly on your system. Please try using a different web browser or updating your video drivers."),this.lowFrameRateMessageDismissed=!1,this.showingLowFrameRateMessage=!1,knockout.track(this,["lowFrameRateMessage","lowFrameRateMessageDismissed","showingLowFrameRateMessage"]);var t=this;this._dismissMessage=createCommand$2(function(){t.showingLowFrameRateMessage=!1,t.lowFrameRateMessageDismissed=!0});var i=FrameRateMonitor.fromScene(e.scene);this._unsubscribeLowFrameRate=i.lowFrameRate.addEventListener(function(){t.lowFrameRateMessageDismissed||(t.showingLowFrameRateMessage=!0)}),this._unsubscribeNominalFrameRate=i.nominalFrameRate.addEventListener(function(){t.showingLowFrameRateMessage=!1})}function PerformanceWatchdog(e){var t=getElement(e.container),i=new PerformanceWatchdogViewModel(e),r=document.createElement("div");r.className="cesium-performance-watchdog-message-area",r.setAttribute("data-bind","visible: showingLowFrameRateMessage");var n=document.createElement("button");n.setAttribute("type","button"),n.className="cesium-performance-watchdog-message-dismiss",n.innerHTML="×",n.setAttribute("data-bind","click: dismissMessage"),r.appendChild(n);var a=document.createElement("div");a.className="cesium-performance-watchdog-message",a.setAttribute("data-bind","html: lowFrameRateMessage"),r.appendChild(a),t.appendChild(r),knockout.applyBindings(i,r),this._container=t,this._viewModel=i,this._element=r}function ProjectionPickerViewModel(e){this._scene=e,this._orthographic=e.camera.frustum instanceof OrthographicFrustum,this._flightInProgress=!1,this.dropDownVisible=!1,this.tooltipPerspective="Perspective Projection",this.tooltipOrthographic="Orthographic Projection",this.selectedTooltip=void 0,this.sceneMode=e.mode,knockout.track(this,["_orthographic","_flightInProgress","sceneMode","dropDownVisible","tooltipPerspective","tooltipOrthographic"]);var n=this;knockout.defineProperty(this,"selectedTooltip",function(){return n._orthographic?n.tooltipOrthographic:n.tooltipPerspective}),this._toggleDropDown=createCommand$2(function(){n.sceneMode===SceneMode$1.SCENE2D||n._flightInProgress||(n.dropDownVisible=!n.dropDownVisible)}),this._eventHelper=new EventHelper,this._eventHelper.add(e.morphComplete,function(e,t,i,r){n.sceneMode=i,n._orthographic=i===SceneMode$1.SCENE2D||n._scene.camera.frustum instanceof OrthographicFrustum}),this._eventHelper.add(e.preRender,function(){n._flightInProgress=defined(e.camera._currentFlight)}),this._switchToPerspective=createCommand$2(function(){n.sceneMode!==SceneMode$1.SCENE2D&&(n._scene.camera.switchToPerspectiveFrustum(),n._orthographic=!1,n.dropDownVisible=!1)}),this._switchToOrthographic=createCommand$2(function(){n.sceneMode!==SceneMode$1.SCENE2D&&(n._scene.camera.switchToOrthographicFrustum(),n._orthographic=!0,n.dropDownVisible=!1)}),this._sceneMode=SceneMode$1}Object.defineProperties(MapWidget.prototype,{container:{get:function(){return this._container}},canvas:{get:function(){return this._canvas}},creditContainer:{get:function(){return this._creditContainer}},creditViewport:{get:function(){return this._creditViewport}},scene:{get:function(){return this._scene}},imageryLayers:{get:function(){return this._scene.imageryLayers}},terrainProvider:{get:function(){return this._scene.terrainProvider},set:function(e){this._scene.terrainProvider=e}},camera:{get:function(){return this._scene.camera}},clock:{get:function(){return this._clock}},screenSpaceEventHandler:{get:function(){return this._screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._targetFrameRate},set:function(e){this._targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._useDefaultRenderLoop},set:function(e){this._useDefaultRenderLoop!==e&&(this._useDefaultRenderLoop=e)&&!this._renderLoopRunning&&startRenderLoop$1(this)}},resolutionScale:{get:function(){return this._resolutionScale},set:function(e){this._resolutionScale=e,this._forceResize=!0}},trackedEntityChanged:{get:function(){return this._trackedEntityChanged}},trackedEntity:{get:function(){return this._trackedEntity},set:function(e){if(this._trackedEntity!==e){this._trackedEntity=e,cancelZoom(this);var t=this.scene,i=t.mode;defined(e)&&defined(e.position)?this._needTrackedEntityUpdate=!0:(this._needTrackedEntityUpdate=!1,i!==SceneMode$1.COLUMBUS_VIEW&&i!==SceneMode$1.SCENE2D||(t.screenSpaceCameraController.enableTranslate=!0),i!==SceneMode$1.COLUMBUS_VIEW&&i!==SceneMode$1.SCENE3D||(t.screenSpaceCameraController.enableTilt=!0),this._entityView=void 0,this.camera.lookAtTransform(Matrix4.IDENTITY)),this._trackedEntityChanged.raiseEvent(e),this.scene.requestRender()}}}}),MapWidget.prototype.showErrorPanel=function(e,t,i){var r=this._element,n=document.createElement("div");n.className="map-widget-errorPanel";var a=document.createElement("div");a.className="map-widget-errorPanel-content",n.appendChild(a);var o=document.createElement("div");o.className="map-widget-errorPanel-header",o.appendChild(document.createTextNode(e)),a.appendChild(o);var s=document.createElement("div");function l(){s.style.maxHeight=Math.max(Math.round(.9*r.clientHeight-100),30)+"px"}if(s.className="map-widget-errorPanel-scroll",a.appendChild(s),l(),defined(window.addEventListener)&&window.addEventListener("resize",l,!1),defined(t)){var u=document.createElement("div");u.className="map-widget-errorPanel-message",u.innerHTML="<p>"+t+"</p>",s.appendChild(u)}var c="(no error details available)";defined(i)&&(c=formatError(i));var d=document.createElement("div");d.className="map-widget-errorPanel-message",d.appendChild(document.createTextNode(c)),s.appendChild(d);var h=document.createElement("div");h.className="map-widget-errorPanel-buttonPanel",a.appendChild(h);var p=document.createElement("button");p.setAttribute("type","button"),p.className="map-button",p.appendChild(document.createTextNode("OK")),p.onclick=function(){defined(l)&&defined(window.removeEventListener)&&window.removeEventListener("resize",l,!1),r.removeChild(n)},h.appendChild(p),r.appendChild(n),"undefined"!=typeof console&&console.error(e+"\n"+t+"\n"+c)},MapWidget.prototype.isDestroyed=function(){return!1},MapWidget.prototype.destroy=function(){this._scene=this._scene&&this._scene.destroy(),this._container.removeChild(this._element),this._creditContainer.removeChild(this._innerCreditContainer),destroyObject(this)},MapWidget.prototype.resize=function(){var e=this._canvas,t=e.clientWidth,i=e.clientHeight;!this._forceResize&&this._canvasWidth===t&&this._canvasHeight===i||(this._forceResize=!1,configureCanvasSize$1(this),configureCameraFrustum$1(this),this._scene.requestRender())},MapWidget.prototype.render=function(){if(this._canRender){this._scene.initializeFrame();var e=this._clock.tick();this._scene.render(e)}else this._clock.tick()},MapWidget.prototype.flyTo=function(e,t){return zoomToOrFly(this,e,t,!0)},MapWidget.prototype._postRender=function(){updateZoomTarget(this),updateTrackedEntity(this)},MapWidget.prototype._onTick=function(){var e=this.coreMap,t=e.clock.currentTime,i=e._entityView;if(defined(i)){var r=e._trackedEntity;this._dataSourceDisplay.getBoundingSphere(r,!1,boundingSphereScratch$2)===BoundingSphereState$1.DONE&&i.update(t,boundingSphereScratch$2)}},Object.defineProperties(NavigationHelpButtonViewModel.prototype,{command:{get:function(){return this._command}},showClick:{get:function(){return this._showClick}},showTouch:{get:function(){return this._showTouch}}}),Object.defineProperties(NavigationHelpButton.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),NavigationHelpButton.prototype.isDestroyed=function(){return!1},NavigationHelpButton.prototype.destroy=function(){return FeatureDetection$1.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeInstructions,!0):(document.removeEventListener("mousedown",this._closeInstructions,!0),document.removeEventListener("touchstart",this._closeInstructions,!0)),knockout.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),destroyObject(this)},Object.defineProperties(PerformanceWatchdogViewModel.prototype,{scene:{get:function(){return this._scene}},dismissMessage:{get:function(){return this._dismissMessage}}}),PerformanceWatchdogViewModel.prototype.destroy=function(){return this._unsubscribeLowFrameRate(),this._unsubscribeNominalFrameRate(),destroyObject(this)},Object.defineProperties(PerformanceWatchdog.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),PerformanceWatchdog.prototype.isDestroyed=function(){return!1},PerformanceWatchdog.prototype.destroy=function(){return this._viewModel.destroy(),knockout.cleanNode(this._element),this._container.removeChild(this._element),destroyObject(this)},Object.defineProperties(ProjectionPickerViewModel.prototype,{scene:{get:function(){return this._scene}},toggleDropDown:{get:function(){return this._toggleDropDown}},switchToPerspective:{get:function(){return this._switchToPerspective}},switchToOrthographic:{get:function(){return this._switchToOrthographic}},isOrthographicProjection:{get:function(){return this._orthographic}}}),ProjectionPickerViewModel.prototype.isDestroyed=function(){return!1},ProjectionPickerViewModel.prototype.destroy=function(){this._eventHelper.removeAll(),destroyObject(this)};var perspectivePath="M 28.15625,10.4375 9.125,13.21875 13.75,43.25 41.75,55.09375 50.8125,37 54.5,11.9375 z m 0.125,3 19.976451,0.394265 L 43.03125,16.875 22.6875,14.28125 z M 50.971746,15.705477 47.90625,36.03125 42.53125,46 44.84375,19.3125 z M 12.625,16.03125 l 29.15625,3.6875 -2.65625,31 L 16.4375,41.125 z",orthographicPath="m 31.560594,6.5254438 -20.75,12.4687502 0.1875,24.5625 22.28125,11.8125 19.5,-12 0.65625,-0.375 0,-0.75 0.0312,-23.21875 z m 0.0625,3.125 16.65625,9.5000002 -16.125,10.28125 -17.34375,-9.71875 z m 18.96875,11.1875002 0.15625,20.65625 -17.46875,10.59375 0.15625,-20.28125 z m -37.0625,1.25 17.21875,9.625 -0.15625,19.21875 -16.9375,-9 z";function ProjectionPicker(e,t){e=getElement(e);var i=new ProjectionPickerViewModel(t);i._perspectivePath=perspectivePath,i._orthographicPath=orthographicPath;var r=document.createElement("span");r.className="cesium-projectionPicker-wrapper cesium-toolbar-button",e.appendChild(r);var n=document.createElement("button");n.type="button",n.className="cesium-button cesium-toolbar-button",n.setAttribute("data-bind",'css: { "cesium-projectionPicker-buttonPerspective": !_orthographic, "cesium-projectionPicker-buttonOrthographic": _orthographic, "cesium-button-disabled" : sceneMode === _sceneMode.SCENE2D || _flightInProgress, "cesium-projectionPicker-selected": dropDownVisible },attr: { title: selectedTooltip },click: toggleDropDown'),n.innerHTML='\x3c!-- ko cesiumSvgPath: { path: _perspectivePath, width: 64, height: 64, css: "cesium-projectionPicker-iconPerspective" } --\x3e\x3c!-- /ko --\x3e\x3c!-- ko cesiumSvgPath: { path: _orthographicPath, width: 64, height: 64, css: "cesium-projectionPicker-iconOrthographic" } --\x3e\x3c!-- /ko --\x3e',r.appendChild(n);var a=document.createElement("button");a.type="button",a.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",a.setAttribute("data-bind",'css: { "cesium-projectionPicker-visible" : (dropDownVisible && _orthographic), "cesium-projectionPicker-none" : !_orthographic, "cesium-projectionPicker-hidden" : !dropDownVisible },attr: { title: tooltipPerspective },click: switchToPerspective,cesiumSvgPath: { path: _perspectivePath, width: 64, height: 64 }'),r.appendChild(a);var o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",o.setAttribute("data-bind",'css: { "cesium-projectionPicker-visible" : (dropDownVisible && !_orthographic), "cesium-projectionPicker-none" : _orthographic, "cesium-projectionPicker-hidden" : !dropDownVisible},attr: { title: tooltipOrthographic },click: switchToOrthographic,cesiumSvgPath: { path: _orthographicPath, width: 64, height: 64 }'),r.appendChild(o),knockout.applyBindings(i,r),this._viewModel=i,this._container=e,this._wrapper=r,this._closeDropDown=function(e){r.contains(e.target)||(i.dropDownVisible=!1)},FeatureDetection$1.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}function SceneModePickerViewModel(e,t){this._scene=e;var n=this;this._eventHelper=new EventHelper,this._eventHelper.add(e.morphStart,function(e,t,i,r){n.sceneMode=i,n.dropDownVisible=!1}),this._duration=defaultValue(t,2),this.sceneMode=e.mode,this.dropDownVisible=!1,this.tooltip2D="2D",this.tooltip3D="3D",this.tooltipColumbusView="Columbus View",knockout.track(this,["sceneMode","dropDownVisible","tooltip2D","tooltip3D","tooltipColumbusView"]),this.selectedTooltip=void 0,knockout.defineProperty(this,"selectedTooltip",function(){var e=n.sceneMode;return e===SceneMode$1.SCENE2D?n.tooltip2D:e===SceneMode$1.SCENE3D?n.tooltip3D:n.tooltipColumbusView}),this._toggleDropDown=createCommand$2(function(){n.dropDownVisible=!n.dropDownVisible}),this._morphTo2D=createCommand$2(function(){e.morphTo2D(n._duration)}),this._morphTo3D=createCommand$2(function(){e.morphTo3D(n._duration)}),this._morphToColumbusView=createCommand$2(function(){e.morphToColumbusView(n._duration)}),this._sceneMode=SceneMode$1}Object.defineProperties(ProjectionPicker.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),ProjectionPicker.prototype.isDestroyed=function(){return!1},ProjectionPicker.prototype.destroy=function(){return this._viewModel.destroy(),FeatureDetection$1.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),knockout.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),destroyObject(this)},Object.defineProperties(SceneModePickerViewModel.prototype,{scene:{get:function(){return this._scene}},duration:{get:function(){return this._duration},set:function(e){this._duration=e}},toggleDropDown:{get:function(){return this._toggleDropDown}},morphTo2D:{get:function(){return this._morphTo2D}},morphTo3D:{get:function(){return this._morphTo3D}},morphToColumbusView:{get:function(){return this._morphToColumbusView}}}),SceneModePickerViewModel.prototype.isDestroyed=function(){return!1},SceneModePickerViewModel.prototype.destroy=function(){this._eventHelper.removeAll(),destroyObject(this)};var globePath="m 32.401392,4.9330437 c -7.087603,0 -14.096095,2.884602 -19.10793,7.8946843 -5.0118352,5.010083 -7.9296167,11.987468 -7.9296167,19.072999 0,7.085531 2.9177815,14.097848 7.9296167,19.107931 4.837653,4.835961 11.541408,7.631372 18.374354,7.82482 0.05712,0.01231 0.454119,0.139729 0.454119,0.139729 l 0.03493,-0.104797 c 0.08246,7.84e-4 0.162033,0.03493 0.244525,0.03493 0.08304,0 0.161515,-0.03414 0.244526,-0.03493 l 0.03493,0.104797 c 0,0 0.309474,-0.129487 0.349323,-0.139729 6.867765,-0.168094 13.582903,-2.965206 18.444218,-7.82482 2.558195,-2.5573 4.551081,-5.638134 5.903547,-8.977584 1.297191,-3.202966 2.02607,-6.661489 2.02607,-10.130347 0,-6.237309 -2.366261,-12.31219 -6.322734,-17.116794 -0.0034,-0.02316 0.0049,-0.04488 0,-0.06986 -0.01733,-0.08745 -0.104529,-0.278855 -0.104797,-0.279458 -5.31e-4,-0.0012 -0.522988,-0.628147 -0.523984,-0.62878 -3.47e-4,-2.2e-4 -0.133444,-0.03532 -0.244525,-0.06987 C 51.944299,13.447603 51.751076,13.104317 51.474391,12.827728 46.462556,7.8176457 39.488996,4.9330437 32.401392,4.9330437 z m -2.130866,3.5281554 0.104797,9.6762289 c -4.111695,-0.08361 -7.109829,-0.423664 -9.257041,-0.943171 1.198093,-2.269271 2.524531,-4.124404 3.91241,-5.414496 2.167498,-2.0147811 3.950145,-2.8540169 5.239834,-3.3185619 z m 2.794579,0 c 1.280302,0.4754953 3.022186,1.3285948 5.065173,3.2486979 1.424667,1.338973 2.788862,3.303645 3.982275,5.728886 -2.29082,0.403367 -5.381258,0.621049 -8.942651,0.698645 L 33.065105,8.4611991 z m 5.728886,0.2445256 c 4.004072,1.1230822 7.793098,3.1481363 10.724195,6.0782083 0.03468,0.03466 0.07033,0.06991 0.104797,0.104797 -0.45375,0.313891 -0.923054,0.663002 -1.956205,1.082899 -0.647388,0.263114 -1.906242,0.477396 -2.829511,0.733577 -1.382296,-2.988132 -3.027146,-5.368585 -4.785716,-7.0213781 -0.422866,-0.397432 -0.835818,-0.6453247 -1.25756,-0.9781032 z m -15.33525,0.7685092 c -0.106753,0.09503 -0.207753,0.145402 -0.31439,0.244526 -1.684973,1.5662541 -3.298068,3.8232211 -4.680919,6.5672591 -0.343797,-0.14942 -1.035052,-0.273198 -1.292493,-0.419186 -0.956528,-0.542427 -1.362964,-1.022024 -1.537018,-1.292493 -0.0241,-0.03745 -0.01868,-0.0401 -0.03493,-0.06986 2.250095,-2.163342 4.948824,-3.869984 7.859752,-5.0302421 z m -9.641296,7.0912431 c 0.464973,0.571618 0.937729,1.169056 1.956205,1.746612 0.349907,0.198425 1.107143,0.335404 1.537018,0.523983 -1.20166,3.172984 -1.998037,7.051901 -2.165798,11.772162 C 14.256557,30.361384 12.934823,30.161483 12.280427,29.90959 10.644437,29.279855 9.6888882,28.674891 9.1714586,28.267775 8.6540289,27.860658 8.6474751,27.778724 8.6474751,27.778724 l -0.069864,0.03493 C 9.3100294,23.691285 11.163248,19.798527 13.817445,16.565477 z m 37.552149,0.523984 c 2.548924,3.289983 4.265057,7.202594 4.890513,11.318043 -0.650428,0.410896 -1.756876,1.001936 -3.563088,1.606882 -1.171552,0.392383 -3.163859,0.759153 -4.960377,1.117832 -0.04367,-4.752703 -0.784809,-8.591423 -1.88634,-11.807094 0.917574,-0.263678 2.170552,-0.486495 2.864443,-0.76851 1.274693,-0.518066 2.003942,-1.001558 2.654849,-1.467153 z m -31.439008,2.619917 c 2.487341,0.672766 5.775813,1.137775 10.479669,1.222628 l 0.104797,10.689263 0,0.03493 0,0.733577 c -5.435005,-0.09059 -9.512219,-0.519044 -12.610536,-1.117831 0.106127,-4.776683 0.879334,-8.55791 2.02607,-11.562569 z m 23.264866,0.31439 c 1.073459,3.067541 1.833795,6.821314 1.816476,11.702298 -3.054474,0.423245 -7.062018,0.648559 -11.702298,0.698644 l 0,-0.838373 -0.104796,-10.654331 c 4.082416,-0.0864 7.404468,-0.403886 9.990618,-0.908238 z M 8.2632205,30.922625 c 0.7558676,0.510548 1.5529563,1.013339 3.0041715,1.57195 0.937518,0.360875 2.612202,0.647642 3.91241,0.978102 0.112814,3.85566 0.703989,7.107756 1.606883,9.920754 -1.147172,-0.324262 -2.644553,-0.640648 -3.423359,-0.978102 -1.516688,-0.657177 -2.386627,-1.287332 -2.864443,-1.71168 -0.477816,-0.424347 -0.489051,-0.489051 -0.489051,-0.489051 L 9.8002387,40.319395 C 8.791691,37.621767 8.1584238,34.769583 8.1584238,31.900727 c 0,-0.330153 0.090589,-0.648169 0.1047967,-0.978102 z m 48.2763445,0.419186 c 0.0047,0.188973 0.06986,0.36991 0.06986,0.558916 0,2.938869 -0.620228,5.873558 -1.676747,8.628261 -0.07435,0.07583 -0.06552,0.07411 -0.454119,0.349323 -0.606965,0.429857 -1.631665,1.042044 -3.318562,1.676747 -1.208528,0.454713 -3.204964,0.850894 -5.135038,1.25756 0.84593,-2.765726 1.41808,-6.005357 1.606883,-9.815957 2.232369,-0.413371 4.483758,-0.840201 5.938479,-1.327425 1.410632,-0.472457 2.153108,-0.89469 2.96924,-1.327425 z m -38.530252,2.864443 c 3.208141,0.56697 7.372279,0.898588 12.575603,0.978103 l 0.174662,9.885821 c -4.392517,-0.06139 -8.106722,-0.320566 -10.863925,-0.803441 -1.051954,-2.664695 -1.692909,-6.043794 -1.88634,-10.060483 z m 26.793022,0.31439 c -0.246298,3.923551 -0.877762,7.263679 -1.816476,9.885822 -2.561957,0.361954 -5.766249,0.560708 -9.431703,0.62878 l -0.174661,-9.815957 c 4.491734,-0.04969 8.334769,-0.293032 11.42284,-0.698645 z M 12.035901,44.860585 c 0.09977,0.04523 0.105535,0.09465 0.209594,0.139729 1.337656,0.579602 3.441099,1.058072 5.589157,1.537018 1.545042,3.399208 3.548524,5.969402 5.589157,7.789888 -3.034411,-1.215537 -5.871615,-3.007978 -8.174142,-5.309699 -1.245911,-1.245475 -2.271794,-2.662961 -3.213766,-4.156936 z m 40.69605,0 c -0.941972,1.493975 -1.967855,2.911461 -3.213765,4.156936 -2.74253,2.741571 -6.244106,4.696717 -9.955686,5.868615 0.261347,-0.241079 0.507495,-0.394491 0.768509,-0.663713 1.674841,-1.727516 3.320792,-4.181056 4.645987,-7.265904 2.962447,-0.503021 5.408965,-1.122293 7.161107,-1.781544 0.284034,-0.106865 0.337297,-0.207323 0.593848,-0.31439 z m -31.404076,2.305527 c 2.645807,0.376448 5.701178,0.649995 9.466635,0.698645 l 0.139729,7.789888 c -1.38739,-0.480844 -3.316218,-1.29837 -5.659022,-3.388427 -1.388822,-1.238993 -2.743668,-3.0113 -3.947342,-5.100106 z m 20.365491,0.104797 c -1.04872,2.041937 -2.174337,3.779068 -3.353494,4.995309 -1.853177,1.911459 -3.425515,2.82679 -4.611055,3.353494 l -0.139729,-7.789887 c 3.13091,-0.05714 5.728238,-0.278725 8.104278,-0.558916 z",flatMapPath="m 2.9825053,17.550598 0,1.368113 0,26.267766 0,1.368113 1.36811,0 54.9981397,0 1.36811,0 0,-1.368113 0,-26.267766 0,-1.368113 -1.36811,0 -54.9981397,0 -1.36811,0 z m 2.73623,2.736226 10.3292497,0 0,10.466063 -10.3292497,0 0,-10.466063 z m 13.0654697,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 10.32926,0 0,10.466063 -10.32926,0 0,-10.466063 z m -41.9326497,13.202288 10.3292497,0 0,10.329252 -10.3292497,0 0,-10.329252 z m 13.0654697,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 10.32926,0 0,10.329252 -10.32926,0 0,-10.329252 z",columbusViewPath="m 14.723969,17.675598 -0.340489,0.817175 -11.1680536,26.183638 -0.817175,1.872692 2.076986,0 54.7506996,0 2.07698,0 -0.81717,-1.872692 -11.16805,-26.183638 -0.34049,-0.817175 -0.91933,0 -32.414586,0 -0.919322,0 z m 1.838643,2.723916 6.196908,0 -2.928209,10.418977 -7.729111,0 4.460412,-10.418977 z m 9.02297,0 4.903049,0 0,10.418977 -7.831258,0 2.928209,-10.418977 z m 7.626964,0 5.584031,0 2.62176,10.418977 -8.205791,0 0,-10.418977 z m 8.410081,0 5.51593,0 4.46042,10.418977 -7.38863,0 -2.58772,-10.418977 z m -30.678091,13.142892 8.103649,0 -2.89416,10.282782 -9.6018026,0 4.3923136,-10.282782 z m 10.929711,0 8.614384,0 0,10.282782 -11.508544,0 2.89416,-10.282782 z m 11.338299,0 8.852721,0 2.58772,10.282782 -11.440441,0 0,-10.282782 z m 11.678781,0 7.86531,0 4.39231,10.282782 -9.6699,0 -2.58772,-10.282782 z";function SceneModePicker(e,t,i){e=getElement(e);var r=new SceneModePickerViewModel(t,i);r._globePath=globePath,r._flatMapPath=flatMapPath,r._columbusViewPath=columbusViewPath;var n=document.createElement("span");n.className="cesium-sceneModePicker-wrapper cesium-toolbar-button",e.appendChild(n);var a=document.createElement("button");a.type="button",a.className="cesium-button cesium-toolbar-button",a.setAttribute("data-bind",'css: { "cesium-sceneModePicker-button2D": sceneMode === _sceneMode.SCENE2D, "cesium-sceneModePicker-button3D": sceneMode === _sceneMode.SCENE3D, "cesium-sceneModePicker-buttonColumbusView": sceneMode === _sceneMode.COLUMBUS_VIEW, "cesium-sceneModePicker-selected": dropDownVisible },attr: { title: selectedTooltip },click: toggleDropDown'),a.innerHTML='\x3c!-- ko cesiumSvgPath: { path: _globePath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon3D" } --\x3e\x3c!-- /ko --\x3e\x3c!-- ko cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon2D" } --\x3e\x3c!-- /ko --\x3e\x3c!-- ko cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-iconColumbusView" } --\x3e\x3c!-- /ko --\x3e',n.appendChild(a);var o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",o.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE3D)) || (!dropDownVisible && (sceneMode === _sceneMode.SCENE3D)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE3D, "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip3D },click: morphTo3D,cesiumSvgPath: { path: _globePath, width: 64, height: 64 }'),n.appendChild(o);var s=document.createElement("button");s.type="button",s.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",s.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE2D)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE2D, "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip2D },click: morphTo2D,cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64 }'),n.appendChild(s);var l=document.createElement("button");l.type="button",l.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",l.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.COLUMBUS_VIEW)) || (!dropDownVisible && (sceneMode === _sceneMode.COLUMBUS_VIEW)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.COLUMBUS_VIEW, "cesium-sceneModePicker-hidden" : !dropDownVisible},attr: { title: tooltipColumbusView },click: morphToColumbusView,cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64 }'),n.appendChild(l),knockout.applyBindings(r,n),this._viewModel=r,this._container=e,this._wrapper=n,this._closeDropDown=function(e){n.contains(e.target)||(r.dropDownVisible=!1)},FeatureDetection$1.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(SceneModePicker.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),SceneModePicker.prototype.isDestroyed=function(){return!1},SceneModePicker.prototype.destroy=function(){return this._viewModel.destroy(),FeatureDetection$1.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),knockout.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),destroyObject(this)};var screenSpacePos=new Cartesian2,offScreen="-1000px";function SelectionIndicatorViewModel(i,e,t){this._scene=i,this._screenPositionX=offScreen,this._screenPositionY=offScreen,this._tweens=i.tweens,this._container=defaultValue(t,document.body),this._selectionIndicatorElement=e,this._scale=1,this.position=void 0,this.showSelection=!1,knockout.track(this,["position","_screenPositionX","_screenPositionY","_scale","showSelection"]),this.isVisible=void 0,knockout.defineProperty(this,"isVisible",{get:function(){return this.showSelection&&defined(this.position)}}),knockout.defineProperty(this,"_transform",{get:function(){return"scale("+this._scale+")"}}),this.computeScreenSpacePosition=function(e,t){return SceneTransforms.wgs84ToWindowCoordinates(i,e,t)}}function SelectionIndicator(e,t){e=getElement(e),this._container=e;var i=document.createElement("div");i.className="cesium-selection-wrapper",i.setAttribute("data-bind",'style: { "top" : _screenPositionY, "left" : _screenPositionX },css: { "cesium-selection-wrapper-visible" : isVisible }'),e.appendChild(i),this._element=i;var r="http://www.w3.org/2000/svg",n=document.createElementNS(r,"svg:svg");n.setAttribute("width",160),n.setAttribute("height",160),n.setAttribute("viewBox","0 0 160 160");var a=document.createElementNS(r,"g");a.setAttribute("transform","translate(80,80)"),n.appendChild(a);var o=document.createElementNS(r,"path");o.setAttribute("data-bind","attr: { transform: _transform }"),o.setAttribute("d","M -34 -34 L -34 -11.25 L -30 -15.25 L -30 -30 L -15.25 -30 L -11.25 -34 L -34 -34 z M 11.25 -34 L 15.25 -30 L 30 -30 L 30 -15.25 L 34 -11.25 L 34 -34 L 11.25 -34 z M -34 11.25 L -34 34 L -11.25 34 L -15.25 30 L -30 30 L -30 15.25 L -34 11.25 z M 34 11.25 L 30 15.25 L 30 30 L 15.25 30 L 11.25 34 L 34 34 L 34 11.25 z"),a.appendChild(o),i.appendChild(n);var s=new SelectionIndicatorViewModel(t,this._element,this._container);this._viewModel=s,knockout.applyBindings(this._viewModel,this._element)}function TimelineHighlightRange(e,t,i){this._color=e,this._height=t,this._base=defaultValue(i,0)}function TimelineTrack(e,t,i,r){this.interval=e,this.height=t,this.color=i||new Color(.5,.5,.5,1),this.backgroundColor=r||new Color(0,0,0,0)}SelectionIndicatorViewModel.prototype.update=function(){if(this.showSelection&&defined(this.position)){var e=this.computeScreenSpacePosition(this.position,screenSpacePos);if(defined(e)){var t=this._container,i=t.parentNode.clientWidth,r=t.parentNode.clientHeight,n=this._selectionIndicatorElement.clientWidth,a=.5*n;e.x=Math.min(Math.max(e.x,-n),i+n)-a,e.y=Math.min(Math.max(e.y,-n),r+n)-a,this._screenPositionX=Math.floor(e.x+.25)+"px",this._screenPositionY=Math.floor(e.y+.25)+"px"}else this._screenPositionX=offScreen,this._screenPositionY=offScreen}},SelectionIndicatorViewModel.prototype.animateAppear=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:2,stopValue:1,duration:.8,easingFunction:EasingFunction$1.EXPONENTIAL_OUT})},SelectionIndicatorViewModel.prototype.animateDepart=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:this._scale,stopValue:1.5,duration:.8,easingFunction:EasingFunction$1.EXPONENTIAL_OUT})},Object.defineProperties(SelectionIndicatorViewModel.prototype,{container:{get:function(){return this._container}},selectionIndicatorElement:{get:function(){return this._selectionIndicatorElement}},scene:{get:function(){return this._scene}}}),Object.defineProperties(SelectionIndicator.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),SelectionIndicator.prototype.isDestroyed=function(){return!1},SelectionIndicator.prototype.destroy=function(){var e=this._container;return knockout.cleanNode(this._element),e.removeChild(this._element),destroyObject(this)},TimelineHighlightRange.prototype.getHeight=function(){return this._height},TimelineHighlightRange.prototype.getBase=function(){return this._base},TimelineHighlightRange.prototype.getStartTime=function(){return this._start},TimelineHighlightRange.prototype.getStopTime=function(){return this._stop},TimelineHighlightRange.prototype.setRange=function(e,t){this._start=e,this._stop=t},TimelineHighlightRange.prototype.render=function(e){var t="";if(this._start&&this._stop&&this._color){var i=JulianDate.secondsDifference(this._start,e.epochJulian),r=Math.round(e.timeBarWidth*e.getAlpha(i)),n=JulianDate.secondsDifference(this._stop,e.epochJulian),a=Math.round(e.timeBarWidth*e.getAlpha(n))-r;r<0&&(a+=r,r=0),r+a>e.timeBarWidth&&(a=e.timeBarWidth-r),0<a&&(t='<span class="cesium-timeline-highlight" style="left: '+r.toString()+"px; width: "+a.toString()+"px; bottom: "+this._base.toString()+"px; height: "+this._height+"px; background-color: "+this._color+';"></span>')}return t},TimelineTrack.prototype.render=function(e,t){var i=this.interval.start,r=this.interval.stop,n=t.startJulian,a=JulianDate.addSeconds(t.startJulian,t.duration,new JulianDate);if(JulianDate.lessThan(i,n)&&JulianDate.greaterThan(r,a))e.fillStyle=this.color.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height);else if(JulianDate.lessThanOrEquals(i,a)&&JulianDate.greaterThanOrEquals(r,n)){var o,s,l;for(o=0;o<t.timeBarWidth;++o){var u=JulianDate.addSeconds(t.startJulian,o/t.timeBarWidth*t.duration,new JulianDate);!defined(s)&&JulianDate.greaterThanOrEquals(u,i)?s=o:!defined(l)&&JulianDate.greaterThanOrEquals(u,r)&&(l=o)}e.fillStyle=this.backgroundColor.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height),defined(s)&&(defined(l)||(l=t.timeBarWidth),e.fillStyle=this.color.toCssColorString(),e.fillRect(s,t.y,Math.max(l-s,1),this.height))}};var timelineWheelDelta=1e12,timelineMouseMode={none:0,scrub:1,slide:2,zoom:3,touchOnly:4},timelineTouchMode={none:0,scrub:1,slideZoom:2,singleTap:3,ignore:4},timelineTicScales=[.001,.002,.005,.01,.02,.05,.1,.25,.5,1,2,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,21600,43200,86400,172800,345600,604800,1296e3,2592e3,5184e3,7776e3,15552e3,31536e3,63072e3,126144e3,15768e4,31536e4,63072e4,126144e4,15768e5,31536e5,63072e5,126144e5,15768e6,31536e6],timelineMonthNames=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Timeline(e,t){var i=(e=getElement(e)).ownerDocument;this.container=e;var r=i.createElement("div");r.className="cesium-timeline-main",e.appendChild(r),this._topDiv=r,this._endJulian=void 0,this._epochJulian=void 0,this._lastXPos=void 0,this._scrubElement=void 0,this._startJulian=void 0,this._timeBarSecondsSpan=void 0,this._clock=t,this._scrubJulian=t.currentTime,this._mainTicSpan=-1,this._mouseMode=timelineMouseMode.none,this._touchMode=timelineTouchMode.none,this._touchState={centerX:0,spanX:0},this._mouseX=0,this._timelineDrag=0,this._timelineDragLocation=void 0,this._lastHeight=void 0,this._lastWidth=void 0,this._topDiv.innerHTML='<div class="cesium-timeline-bar"></div><div class="cesium-timeline-trackContainer"><canvas class="cesium-timeline-tracks" width="10" height="1"></canvas></div><div class="cesium-timeline-needle"></div><span class="cesium-timeline-ruler"></span>',this._timeBarEle=this._topDiv.childNodes[0],this._trackContainer=this._topDiv.childNodes[1],this._trackListEle=this._topDiv.childNodes[1].childNodes[0],this._needleEle=this._topDiv.childNodes[2],this._rulerEle=this._topDiv.childNodes[3],this._context=this._trackListEle.getContext("2d"),this._trackList=[],this._highlightRanges=[],this.zoomTo(t.startTime,t.stopTime),this._onMouseDown=createMouseDownCallback(this),this._onMouseUp=createMouseUpCallback(this),this._onMouseMove=createMouseMoveCallback(this),this._onMouseWheel=createMouseWheelCallback(this),this._onTouchStart=createTouchStartCallback(this),this._onTouchMove=createTouchMoveCallback(this),this._onTouchEnd=createTouchEndCallback(this);var n=this._timeBarEle;i.addEventListener("mouseup",this._onMouseUp,!1),i.addEventListener("mousemove",this._onMouseMove,!1),n.addEventListener("mousedown",this._onMouseDown,!1),n.addEventListener("DOMMouseScroll",this._onMouseWheel,!1),n.addEventListener("mousewheel",this._onMouseWheel,!1),n.addEventListener("touchstart",this._onTouchStart,!1),n.addEventListener("touchmove",this._onTouchMove,!1),n.addEventListener("touchend",this._onTouchEnd,!1),n.addEventListener("touchcancel",this._onTouchEnd,!1),this._topDiv.oncontextmenu=function(){return!1},t.onTick.addEventListener(this.updateFromClock,this),this.updateFromClock()}function twoDigits(e){return e<10?"0"+e.toString():e.toString()}function createMouseDownCallback(t){return function(e){t._mouseMode!==timelineMouseMode.touchOnly&&(0===e.button?(t._mouseMode=timelineMouseMode.scrub,t._scrubElement&&(t._scrubElement.style.backgroundPosition="-16px 0"),t._onMouseMove(e)):(t._mouseX=e.clientX,2===e.button?t._mouseMode=timelineMouseMode.zoom:t._mouseMode=timelineMouseMode.slide)),e.preventDefault()}}function createMouseUpCallback(t){return function(e){t._mouseMode=timelineMouseMode.none,t._scrubElement&&(t._scrubElement.style.backgroundPosition="0 0"),t._timelineDrag=0,t._timelineDragLocation=void 0}}function createMouseMoveCallback(n){return function(e){var t;if(n._mouseMode===timelineMouseMode.scrub){e.preventDefault();var i=e.clientX-n._topDiv.getBoundingClientRect().left;i<0?(n._timelineDragLocation=0,n._timelineDrag=-.01*n._timeBarSecondsSpan):i>n._topDiv.clientWidth?(n._timelineDragLocation=n._topDiv.clientWidth,n._timelineDrag=.01*n._timeBarSecondsSpan):(n._timelineDragLocation=void 0,n._setTimeBarTime(i,i*n._timeBarSecondsSpan/n._topDiv.clientWidth))}else if(n._mouseMode===timelineMouseMode.slide){if(t=n._mouseX-e.clientX,n._mouseX=e.clientX,0!==t){var r=t*n._timeBarSecondsSpan/n._topDiv.clientWidth;n.zoomTo(JulianDate.addSeconds(n._startJulian,r,new JulianDate),JulianDate.addSeconds(n._endJulian,r,new JulianDate))}}else n._mouseMode===timelineMouseMode.zoom&&(t=n._mouseX-e.clientX,n._mouseX=e.clientX,0!==t&&n.zoomFrom(Math.pow(1.01,t)))}}function createMouseWheelCallback(i){return function(e){var t=e.wheelDeltaY||e.wheelDelta||-e.detail;t/=timelineWheelDelta=Math.max(Math.min(Math.abs(t),timelineWheelDelta),1),i.zoomFrom(Math.pow(1.05,-t))}}function createTouchStartCallback(a){return function(e){var t,i,r=e.touches.length,n=a._topDiv.getBoundingClientRect().left;e.preventDefault(),a._mouseMode=timelineMouseMode.touchOnly,1===r?(t=JulianDate.secondsDifference(a._scrubJulian,a._startJulian),i=Math.round(t*a._topDiv.clientWidth/a._timeBarSecondsSpan+n),Math.abs(e.touches[0].clientX-i)<50?(a._touchMode=timelineTouchMode.scrub,a._scrubElement&&(a._scrubElement.style.backgroundPosition=1===r?"-16px 0":"0 0")):(a._touchMode=timelineTouchMode.singleTap,a._touchState.centerX=e.touches[0].clientX-n)):2===r?(a._touchMode=timelineTouchMode.slideZoom,a._touchState.centerX=.5*(e.touches[0].clientX+e.touches[1].clientX)-n,a._touchState.spanX=Math.abs(e.touches[0].clientX-e.touches[1].clientX)):a._touchMode=timelineTouchMode.ignore}}function createTouchEndCallback(r){return function(e){var t=e.touches.length,i=r._topDiv.getBoundingClientRect().left;r._touchMode===timelineTouchMode.singleTap?(r._touchMode=timelineTouchMode.scrub,r._onTouchMove(e)):r._touchMode===timelineTouchMode.scrub&&r._onTouchMove(e),r._mouseMode=timelineMouseMode.touchOnly,1!==t?r._touchMode=0<t?timelineTouchMode.ignore:timelineTouchMode.none:r._touchMode===timelineTouchMode.slideZoom&&(r._touchState.centerX=e.touches[0].clientX-i),r._scrubElement&&(r._scrubElement.style.backgroundPosition="0 0")}}function createTouchMoveCallback(u){return function(e){var t,i,r,n,a,o,s=1,l=u._topDiv.getBoundingClientRect().left;u._touchMode===timelineTouchMode.singleTap&&(u._touchMode=timelineTouchMode.slideZoom),u._mouseMode=timelineMouseMode.touchOnly,u._touchMode===timelineTouchMode.scrub?(e.preventDefault(),1===e.changedTouches.length&&0<=(i=e.changedTouches[0].clientX-l)&&i<=u._topDiv.clientWidth&&u._setTimeBarTime(i,i*u._timeBarSecondsSpan/u._topDiv.clientWidth)):u._touchMode===timelineTouchMode.slideZoom&&(2===(r=e.touches.length)?(n=.5*(e.touches[0].clientX+e.touches[1].clientX)-l,a=Math.abs(e.touches[0].clientX-e.touches[1].clientX)):1===r&&(n=e.touches[0].clientX-l,a=0),defined(n)&&(o=0<a&&0<u._touchState.spanX?(s=u._touchState.spanX/a,JulianDate.addSeconds(u._startJulian,(u._touchState.centerX*u._timeBarSecondsSpan-n*u._timeBarSecondsSpan*s)/u._topDiv.clientWidth,new JulianDate)):(t=u._touchState.centerX-n,JulianDate.addSeconds(u._startJulian,t*u._timeBarSecondsSpan/u._topDiv.clientWidth,new JulianDate)),u.zoomTo(o,JulianDate.addSeconds(o,u._timeBarSecondsSpan*s,new JulianDate)),u._touchState.centerX=n,u._touchState.spanX=a))}}function lockScreen(e){var t=!1,i=window.screen;return defined(i)&&(defined(i.lockOrientation)?t=i.lockOrientation(e):defined(i.mozLockOrientation)?t=i.mozLockOrientation(e):defined(i.msLockOrientation)?t=i.msLockOrientation(e):defined(i.orientation&&i.orientation.lock)&&(t=i.orientation.lock(e))),t}function unlockScreen(){var e=window.screen;defined(e)&&(defined(e.unlockOrientation)?e.unlockOrientation():defined(e.mozUnlockOrientation)?e.mozUnlockOrientation():defined(e.msUnlockOrientation)?e.msUnlockOrientation():defined(e.orientation&&e.orientation.unlock)&&e.orientation.unlock())}function toggleVR(e,t,i,r){r()||(i()?(t.useWebVR=!1,e._locked&&(unlockScreen(),e._locked=!1),e._noSleep.disable(),Fullscreen.exitFullscreen(),i(!1)):(Fullscreen.fullscreen||Fullscreen.requestFullscreen(e._vrElement),e._noSleep.enable(),e._locked||(e._locked=lockScreen("landscape")),i(t.useWebVR=!0)))}function VRButtonViewModel(e,t){var i=this,r=knockout.observable(Fullscreen.enabled),n=knockout.observable(!1);this.isVRMode=void 0,knockout.defineProperty(this,"isVRMode",{get:function(){return n()}}),this.isVREnabled=void 0,knockout.defineProperty(this,"isVREnabled",{get:function(){return r()},set:function(e){r(e&&Fullscreen.enabled)}}),this.tooltip=void 0,knockout.defineProperty(this,"tooltip",function(){return r()?n()?"Exit VR mode":"Enter VR mode":"VR mode is unavailable"});var a=knockout.observable(!1);this._isOrthographic=void 0,knockout.defineProperty(this,"_isOrthographic",{get:function(){return a()}}),this._eventHelper=new EventHelper,this._eventHelper.add(e.preRender,function(){a(e.camera.frustum instanceof OrthographicFrustum)}),this._locked=!1,this._noSleep=new NoSleep,this._command=createCommand$2(function(){toggleVR(i,e,n,a)},knockout.getObservable(this,"isVREnabled")),this._vrElement=defaultValue(getElement(t),document.body),this._callback=function(){!Fullscreen.fullscreen&&n()&&(e.useWebVR=!1,i._locked&&(unlockScreen(),i._locked=!1),i._noSleep.disable(),n(!1))},document.addEventListener(Fullscreen.changeEventName,this._callback)}Timeline.prototype.addEventListener=function(e,t,i){this._topDiv.addEventListener(e,t,i)},Timeline.prototype.removeEventListener=function(e,t,i){this._topDiv.removeEventListener(e,t,i)},Timeline.prototype.isDestroyed=function(){return!1},Timeline.prototype.destroy=function(){this._clock.onTick.removeEventListener(this.updateFromClock,this);var e=this.container.ownerDocument;e.removeEventListener("mouseup",this._onMouseUp,!1),e.removeEventListener("mousemove",this._onMouseMove,!1);var t=this._timeBarEle;t.removeEventListener("mousedown",this._onMouseDown,!1),t.removeEventListener("DOMMouseScroll",this._onMouseWheel,!1),t.removeEventListener("mousewheel",this._onMouseWheel,!1),t.removeEventListener("touchstart",this._onTouchStart,!1),t.removeEventListener("touchmove",this._onTouchMove,!1),t.removeEventListener("touchend",this._onTouchEnd,!1),t.removeEventListener("touchcancel",this._onTouchEnd,!1),this.container.removeChild(this._topDiv),destroyObject(this)},Timeline.prototype.addHighlightRange=function(e,t,i){var r=new TimelineHighlightRange(e,t,i);return this._highlightRanges.push(r),this.resize(),r},Timeline.prototype.addTrack=function(e,t,i,r){var n=new TimelineTrack(e,t,i,r);return this._trackList.push(n),this._lastHeight=void 0,this.resize(),n},Timeline.prototype.zoomTo=function(e,t){if(this._startJulian=e,this._endJulian=t,this._timeBarSecondsSpan=JulianDate.secondsDifference(t,e),this._clock&&this._clock.clockRange!==ClockRange$1.UNBOUNDED){var i=this._clock.startTime,r=this._clock.stopTime,n=JulianDate.secondsDifference(r,i),a=JulianDate.secondsDifference(i,this._startJulian),o=JulianDate.secondsDifference(r,this._endJulian);this._timeBarSecondsSpan>=n?(this._timeBarSecondsSpan=n,this._startJulian=this._clock.startTime,this._endJulian=this._clock.stopTime):0<a?(this._endJulian=JulianDate.addSeconds(this._endJulian,a,new JulianDate),this._startJulian=i,this._timeBarSecondsSpan=JulianDate.secondsDifference(this._endJulian,this._startJulian)):o<0&&(this._startJulian=JulianDate.addSeconds(this._startJulian,o,new JulianDate),this._endJulian=r,this._timeBarSecondsSpan=JulianDate.secondsDifference(this._endJulian,this._startJulian))}this._makeTics();var s=document.createEvent("Event");s.initEvent("setzoom",!0,!0),s.startJulian=this._startJulian,s.endJulian=this._endJulian,s.epochJulian=this._epochJulian,s.totalSpan=this._timeBarSecondsSpan,s.mainTicSpan=this._mainTicSpan,this._topDiv.dispatchEvent(s)},Timeline.prototype.zoomFrom=function(e){var t=JulianDate.secondsDifference(this._scrubJulian,this._startJulian);1<e||t<0||t>this._timeBarSecondsSpan?t=.5*this._timeBarSecondsSpan:t+=t-.5*this._timeBarSecondsSpan;var i=this._timeBarSecondsSpan-t;this.zoomTo(JulianDate.addSeconds(this._startJulian,t-t*e,new JulianDate),JulianDate.addSeconds(this._endJulian,i*e-i,new JulianDate))},Timeline.prototype.makeLabel=function(e){var t=JulianDate.toGregorianDate(e),i=t.millisecond,r=" UTC";if(0<i&&this._timeBarSecondsSpan<3600){for(r=Math.floor(i).toString();r.length<3;)r="0"+r;r="."+r}return timelineMonthNames[t.month-1]+" "+t.day+" "+t.year+" "+twoDigits(t.hour)+":"+twoDigits(t.minute)+":"+twoDigits(t.second)+r},Timeline.prototype.smallestTicInPixels=7,Timeline.prototype._makeTics=function(){var e,t=this._timeBarEle,i=JulianDate.secondsDifference(this._scrubJulian,this._startJulian),r=Math.round(i*this._topDiv.clientWidth/this._timeBarSecondsSpan),n=r-8,a=this;this._needleEle.style.left=r.toString()+"px";var o="",s=31536e6,l=0,u=this._timeBarSecondsSpan;u<.01?(u=.01,this._timeBarSecondsSpan=.01,this._endJulian=JulianDate.addSeconds(this._startJulian,.01,new JulianDate)):s<u&&(u=s,this._timeBarSecondsSpan=s,this._endJulian=JulianDate.addSeconds(this._startJulian,s,new JulianDate));var c=this._timeBarEle.clientWidth;c<10&&(c=10);var d,h=this._startJulian,p=Math.min(u/c*1e-5,.4),f=JulianDate.toGregorianDate(h);d=31536e4<u?JulianDate.fromDate(new Date(Date.UTC(100*Math.floor(f.year/100),0))):31536e3<u?JulianDate.fromDate(new Date(Date.UTC(10*Math.floor(f.year/10),0))):86400<u?JulianDate.fromDate(new Date(Date.UTC(f.year,0))):JulianDate.fromDate(new Date(Date.UTC(f.year,f.month,f.day)));var m=JulianDate.secondsDifference(this._startJulian,JulianDate.addSeconds(d,p,new JulianDate)),g=m+u;function y(e){return Math.floor(m/e)*e}function v(e,t){return Math.ceil(e/t+.5)*t}function _(e){return(e-m)/u}function C(e,t){return e-t*Math.round(e/t)}this._epochJulian=d,this._rulerEle.innerHTML=this.makeLabel(JulianDate.addSeconds(this._endJulian,-.01,new JulianDate));var x=this._rulerEle.offsetWidth+20;x<30&&(x=180);var b=l;l-=1e-10;var A={startTime:m,startJulian:h,epochJulian:d,duration:u,timeBarWidth:c,getAlpha:_};this._highlightRanges.forEach(function(e){o+=e.render(A)});var S=0,w=0,E=0,T=x/c;1<T&&(T=1),T*=this._timeBarSecondsSpan;var P,M=-1,D=-1,I=timelineTicScales.length;for(P=0;P<I;++P){var O=timelineTicScales[P];if(++M,T<(S=O)&&l<O)break;D<0&&c*(O/this._timeBarSecondsSpan)>=this.smallestTicInPixels&&(D=M)}if(0<M){for(;0<M;)if(--M,Math.abs(C(S,timelineTicScales[M]))<1e-5){timelineTicScales[M]>=l&&(w=timelineTicScales[M]);break}if(0<=D)for(;D<M;){if(Math.abs(C(w,timelineTicScales[D]))<1e-5&&timelineTicScales[D]>=l){E=timelineTicScales[D];break}++D}}1e-10<(l=b)&&E<1e-5&&1e-10<Math.abs(l-S)&&(E=l)<=S+1e-10&&(w=0);var R,L=-999999;if(3<=c*(E/this._timeBarSecondsSpan))for(e=y(E);e<=g;e=v(e,E))o+='<span class="cesium-timeline-ticTiny" style="left: '+Math.round(c*_(e)).toString()+'px;"></span>';if(3<=c*(w/this._timeBarSecondsSpan))for(e=y(w);e<=g;e=v(e,w))o+='<span class="cesium-timeline-ticSub" style="left: '+Math.round(c*_(e)).toString()+'px;"></span>';if(2<=c*(S/this._timeBarSecondsSpan)){g+=this._mainTicSpan=S,e=y(S);for(var N=JulianDate.computeTaiMinusUtc(d);e<=g;){var k=JulianDate.addSeconds(h,e-m,new JulianDate);if(2.1<S){var B=JulianDate.computeTaiMinusUtc(k);.1<Math.abs(B-N)&&(e+=B-N,k=JulianDate.addSeconds(h,e-m,new JulianDate))}var F=Math.round(c*_(e)),V=this.makeLabel(k);this._rulerEle.innerHTML=V,(R=this._rulerEle.offsetWidth)<10&&(R=x);var z=F-(R/2-1);L<z?(L=z+R+5,o+='<span class="cesium-timeline-ticMain" style="left: '+F.toString()+'px;"></span><span class="cesium-timeline-ticLabel" style="left: '+z.toString()+'px;">'+V+"</span>"):o+='<span class="cesium-timeline-ticSub" style="left: '+F.toString()+'px;"></span>',e=v(e,S)}}else this._mainTicSpan=-1;o+='<span class="cesium-timeline-icon16" style="left:'+n+'px;bottom:0;background-position: 0 0;"></span>',t.innerHTML=o,this._scrubElement=t.lastChild,this._context.clearRect(0,0,this._trackListEle.width,this._trackListEle.height),A.y=0,this._trackList.forEach(function(e){e.render(a._context,A),A.y+=e.height})},Timeline.prototype.updateFromClock=function(){this._scrubJulian=this._clock.currentTime;var e=this._scrubElement;if(defined(this._scrubElement)){var t=JulianDate.secondsDifference(this._scrubJulian,this._startJulian),i=Math.round(t*this._topDiv.clientWidth/this._timeBarSecondsSpan);this._lastXPos!==i&&(this._lastXPos=i,e.style.left=i-8+"px",this._needleEle.style.left=i+"px")}defined(this._timelineDragLocation)&&(this._setTimeBarTime(this._timelineDragLocation,this._timelineDragLocation*this._timeBarSecondsSpan/this._topDiv.clientWidth),this.zoomTo(JulianDate.addSeconds(this._startJulian,this._timelineDrag,new JulianDate),JulianDate.addSeconds(this._endJulian,this._timelineDrag,new JulianDate)))},Timeline.prototype._setTimeBarTime=function(e,t){if(e=Math.round(e),this._scrubJulian=JulianDate.addSeconds(this._startJulian,t,new JulianDate),this._scrubElement){var i=e-8;this._scrubElement.style.left=i.toString()+"px",this._needleEle.style.left=e.toString()+"px"}var r=document.createEvent("Event");r.initEvent("settime",!0,!0),r.clientX=e,r.timeSeconds=t,r.timeJulian=this._scrubJulian,r.clock=this._clock,this._topDiv.dispatchEvent(r)},Timeline.prototype.resize=function(){var e=this.container.clientWidth,t=this.container.clientHeight;if(e!==this._lastWidth||t!==this._lastHeight){this._trackContainer.style.height=t+"px";var i=1;this._trackList.forEach(function(e){i+=e.height}),this._trackListEle.style.height=i.toString()+"px",this._trackListEle.width=this._trackListEle.clientWidth,this._trackListEle.height=i,this._makeTics(),this._lastXPos=void 0,this._lastWidth=e,this._lastHeight=t}},Object.defineProperties(VRButtonViewModel.prototype,{vrElement:{get:function(){return this._vrElement},set:function(e){this._vrElement=e}},command:{get:function(){return this._command}}}),VRButtonViewModel.prototype.isDestroyed=function(){return!1},VRButtonViewModel.prototype.destroy=function(){this._eventHelper.removeAll(),document.removeEventListener(Fullscreen.changeEventName,this._callback),destroyObject(this)};var enterVRPath="M 5.3125 6.375 C 4.008126 6.375 2.96875 7.4141499 2.96875 8.71875 L 2.96875 19.5 C 2.96875 20.8043 4.008126 21.875 5.3125 21.875 L 13.65625 21.875 C 13.71832 20.0547 14.845166 18.59375 16.21875 18.59375 C 17.592088 18.59375 18.71881 20.0552 18.78125 21.875 L 27.09375 21.875 C 28.398125 21.875 29.4375 20.8043 29.4375 19.5 L 29.4375 8.71875 C 29.4375 7.4141499 28.398125 6.375 27.09375 6.375 L 5.3125 6.375 z M 9.625 10.4375 C 11.55989 10.4375 13.125 12.03385 13.125 13.96875 C 13.125 15.90365 11.55989 17.46875 9.625 17.46875 C 7.69011 17.46875 6.125 15.90365 6.125 13.96875 C 6.125 12.03385 7.69011 10.4375 9.625 10.4375 z M 22.46875 10.4375 C 24.40364 10.4375 25.96875 12.03385 25.96875 13.96875 C 25.96875 15.90365 24.40364 17.46875 22.46875 17.46875 C 20.53386 17.46875 18.96875 15.90365 18.96875 13.96875 C 18.96875 12.03385 20.53386 10.4375 22.46875 10.4375 z",exitVRPath="M 25.770585,2.4552065 C 15.72282,13.962707 10.699956,19.704407 8.1768352,22.580207 c -1.261561,1.4379 -1.902282,2.1427 -2.21875,2.5 -0.141624,0.1599 -0.208984,0.2355 -0.25,0.2813 l 0.6875,0.75 c 10e-5,-10e-5 0.679191,0.727 0.6875,0.7187 0.01662,-0.016 0.02451,-0.024 0.03125,-0.031 0.01348,-0.014 0.04013,-0.038 0.0625,-0.062 0.04474,-0.05 0.120921,-0.1315 0.28125,-0.3126 0.320657,-0.3619 0.956139,-1.0921 2.2187499,-2.5312 2.5252219,-2.8781 7.5454589,-8.6169 17.5937499,-20.1250005 l -1.5,-1.3125 z m -20.5624998,3.9063 c -1.304375,0 -2.34375,1.0391 -2.34375,2.3437 l 0,10.8125005 c 0,1.3043 1.039375,2.375 2.34375,2.375 l 2.25,0 c 1.9518039,-2.2246 7.4710958,-8.5584 13.5624998,-15.5312005 l -15.8124998,0 z m 21.1249998,0 c -1.855467,2.1245 -2.114296,2.4005 -3.59375,4.0936995 1.767282,0.1815 3.15625,1.685301 3.15625,3.500001 0,1.9349 -1.56511,3.5 -3.5,3.5 -1.658043,0 -3.043426,-1.1411 -3.40625,-2.6875 -1.089617,1.2461 -2.647139,2.9988 -3.46875,3.9375 0.191501,-0.062 0.388502,-0.094 0.59375,-0.094 1.373338,0 2.50006,1.4614 2.5625,3.2812 l 8.3125,0 c 1.304375,0 2.34375,-1.0707 2.34375,-2.375 l 0,-10.8125005 c 0,-1.3046 -1.039375,-2.3437 -2.34375,-2.3437 l -0.65625,0 z M 9.5518351,10.423906 c 1.9348899,0 3.4999999,1.596401 3.4999999,3.531301 0,1.9349 -1.56511,3.5 -3.4999999,3.5 -1.9348899,0 -3.4999999,-1.5651 -3.4999999,-3.5 0,-1.9349 1.56511,-3.531301 3.4999999,-3.531301 z m 4.2187499,10.312601 c -0.206517,0.2356 -0.844218,0.9428 -1.03125,1.1562 l 0.8125,0 c 0.01392,-0.4081 0.107026,-0.7968 0.21875,-1.1562 z";function VRButton(e,t,i){e=getElement(e);var r=new VRButtonViewModel(t,i);r._exitVRPath=exitVRPath,r._enterVRPath=enterVRPath;var n=document.createElement("button");n.type="button",n.className="cesium-button cesium-vrButton",n.setAttribute("data-bind",'css: { "cesium-button-disabled" : _isOrthographic }, attr: { title: tooltip },click: command,enable: isVREnabled,cesiumSvgPath: { path: isVRMode ? _exitVRPath : _enterVRPath, width: 32, height: 32 }'),e.appendChild(n),knockout.applyBindings(r,n),this._container=e,this._viewModel=r,this._element=n}Object.defineProperties(VRButton.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),VRButton.prototype.isDestroyed=function(){return!1},VRButton.prototype.destroy=function(){return this._viewModel.destroy(),knockout.cleanNode(this._element),this._container.removeChild(this._element),destroyObject(this)};var boundingSphereScratch$3=new BoundingSphere;function onTimelineScrubfunction(e){var t=e.clock;t.currentTime=e.timeJulian,t.shouldAnimate=!1}function pickEntity(e,t){var i=e.scene.pick(t.position);if(defined(i)){var r=defaultValue(i.id,i.primitive.id);if(r instanceof Entity)return r}if(defined(e.scene.globe))return pickImageryLayerFeature(e,t.position)}function trackDataSourceClock(e,t,i){if(defined(i)){var r=i.clock;defined(r)&&(r.getValue(t),defined(e)&&(e.updateFromClock(),e.zoomTo(r.startTime,r.stopTime)))}}var cartesian3Scratch$4=new Cartesian3;function pickImageryLayerFeature(n,e){var t=n.scene,i=t.camera.getPickRay(e),r=t.imageryLayers.pickImageryLayerFeatures(i,t);if(defined(r)){var a=new Entity({id:"Loading...",description:"Loading feature information..."});return when(r,function(e){if(n.selectedEntity===a)if(defined(e)&&0!==e.length){var t=e[0],i=new Entity({id:t.name,description:t.description});if(defined(t.position)){var r=n.scene.globe.ellipsoid.cartographicToCartesian(t.position,cartesian3Scratch$4);i.position=new ConstantPositionProperty(r)}n.selectedEntity=i}else n.selectedEntity=createNoFeaturesEntity()},function(){n.selectedEntity===a&&(n.selectedEntity=createNoFeaturesEntity())}),a}}function createNoFeaturesEntity(){return new Entity({id:"None",description:"No features found."})}function enableVRUI(e,t){var i=e._geocoder,r=e._homeButton,n=e._sceneModePicker,a=e._projectionPicker,o=e._baseLayerPicker,s=e._animation,l=e._timeline,u=e._fullscreenButton,c=e._infoBox,d=e._selectionIndicator,h=t?"hidden":"visible";if(defined(i)&&(i.container.style.visibility=h),defined(r)&&(r.container.style.visibility=h),defined(n)&&(n.container.style.visibility=h),defined(a)&&(a.container.style.visibility=h),defined(o)&&(o.container.style.visibility=h),defined(s)&&(s.container.style.visibility=h),defined(l)&&(l.container.style.visibility=h),defined(u)&&u.viewModel.isFullscreenEnabled&&(u.container.style.visibility=h),defined(c)&&(c.container.style.visibility=h),defined(d)&&(d.container.style.visibility=h),e._container){var p=t||!defined(u)?0:u.container.clientWidth;e._vrButton.container.style.right=p+"px",e.forceResize()}}function Viewer(e,t){e=getElement(e);var i=!(defined((t=defaultValue(t,defaultValue.EMPTY_OBJECT)).globe)&&!1===t.globe||defined(t.baseLayerPicker)&&!1===t.baseLayerPicker),r=this,n=document.createElement("div");n.className="cesium-viewer",e.appendChild(n);var a=document.createElement("div");a.className="cesium-viewer-cesiumWidgetContainer",n.appendChild(a);var o=document.createElement("div");o.className="cesium-viewer-bottom",n.appendChild(o);var s,l,u=defaultValue(t.scene3DOnly,!1),c=!1;defined(t.clockViewModel)?s=(l=t.clockViewModel).clock:(l=new ClockViewModel(s=new Clock),c=!0),defined(t.shouldAnimate)&&(s.shouldAnimate=t.shouldAnimate);var d=new CesiumWidget(a,{imageryProvider:!i&&!defined(t.imageryProvider)&&void 0,clock:s,skyBox:t.skyBox,skyAtmosphere:t.skyAtmosphere,sceneMode:t.sceneMode,mapProjection:t.mapProjection,globe:t.globe,orderIndependentTranslucency:t.orderIndependentTranslucency,contextOptions:t.contextOptions,useDefaultRenderLoop:t.useDefaultRenderLoop,targetFrameRate:t.targetFrameRate,showRenderLoopErrors:t.showRenderLoopErrors,useBrowserRecommendedResolution:t.useBrowserRecommendedResolution,creditContainer:defined(t.creditContainer)?t.creditContainer:o,creditViewport:t.creditViewport,scene3DOnly:u,terrainExaggeration:t.terrainExaggeration,shadows:t.shadows,terrainShadows:t.terrainShadows,mapMode2D:t.mapMode2D,requestRenderMode:t.requestRenderMode,maximumRenderTimeChange:t.maximumRenderTimeChange}),h=t.dataSources,p=!1;defined(h)||(h=new DataSourceCollection,p=!0);var f,m,g=d.scene,y=new DataSourceDisplay({scene:g,dataSourceCollection:h}),v=new EventHelper;if(v.add(s.onTick,Viewer.prototype._onTick,this),v.add(g.morphStart,Viewer.prototype._clearTrackedObject,this),!defined(t.selectionIndicator)||!1!==t.selectionIndicator){var _=document.createElement("div");_.className="cesium-viewer-selectionIndicatorContainer",n.appendChild(_),f=new SelectionIndicator(_,g)}if(!defined(t.infoBox)||!1!==t.infoBox){var C=document.createElement("div");C.className="cesium-viewer-infoBoxContainer",n.appendChild(C);var x=(m=new InfoBox(C)).viewModel;v.add(x.cameraClicked,Viewer.prototype._onInfoBoxCameraClicked,this),v.add(x.closeClicked,Viewer.prototype._onInfoBoxClockClicked,this)}var b,A,S,w,E,T,P,M,D,I,O,R,L,N,k,B=document.createElement("div");if(B.className="cesium-viewer-toolbar",n.appendChild(B),!defined(t.geocoder)||!1!==t.geocoder){var F,V=document.createElement("div");V.className="cesium-viewer-geocoderContainer",B.appendChild(V),defined(t.geocoder)&&"boolean"!=typeof t.geocoder&&(F=Array.isArray(t.geocoder)?t.geocoder:[t.geocoder]),b=new Geocoder({container:V,geocoderServices:F,scene:g}),v.add(b.viewModel.search.beforeExecute,Viewer.prototype._clearObjects,this)}if(defined(t.homeButton)&&!1===t.homeButton||(A=new HomeButton(B,g),defined(b)&&v.add(A.viewModel.command.afterExecute,function(){var e=b.viewModel;e.searchText="",e.isSearchInProgress&&e.search()}),v.add(A.viewModel.command.beforeExecute,Viewer.prototype._clearTrackedObject,this)),u||defined(t.sceneModePicker)&&!1===t.sceneModePicker||(S=new SceneModePicker(B,g)),t.projectionPicker&&(w=new ProjectionPicker(B,g)),i){var z=defaultValue(t.imageryProviderViewModels,createDefaultImageryProviderViewModels()),U=defaultValue(t.terrainProviderViewModels,createDefaultTerrainProviderViewModels());E=new BaseLayerPicker(B,{globe:g.globe,imageryProviderViewModels:z,selectedImageryProviderViewModel:t.selectedImageryProviderViewModel,terrainProviderViewModels:U,selectedTerrainProviderViewModel:t.selectedTerrainProviderViewModel}),T=B.getElementsByClassName("cesium-baseLayerPicker-dropDown")[0]}if(defined(t.imageryProvider)&&!1!==t.imageryProvider&&(i&&(E.viewModel.selectedImagery=void 0),g.imageryLayers.removeAll(),g.imageryLayers.addImageryProvider(t.imageryProvider)),defined(t.terrainProvider)&&(i&&(E.viewModel.selectedTerrain=void 0),g.terrainProvider=t.terrainProvider),!defined(t.navigationHelpButton)||!1!==t.navigationHelpButton){var G=!0;try{if(defined(window.localStorage)){var $=window.localStorage.getItem("cesium-hasSeenNavHelp");defined($)&&Boolean($)?G=!1:window.localStorage.setItem("cesium-hasSeenNavHelp","true")}}catch(e){}P=new NavigationHelpButton({container:B,instructionsInitiallyVisible:defaultValue(t.navigationInstructionsInitiallyVisible,G)})}if(!defined(t.animation)||!1!==t.animation){var H=document.createElement("div");H.className="cesium-viewer-animationContainer",n.appendChild(H),M=new Animation(H,new AnimationViewModel(l))}if(!defined(t.timeline)||!1!==t.timeline){var W=document.createElement("div");W.className="cesium-viewer-timelineContainer",n.appendChild(W),(D=new Timeline(W,s)).addEventListener("settime",onTimelineScrubfunction,!1),D.zoomTo(s.startTime,s.stopTime)}if(defined(t.fullscreenButton)&&!1===t.fullscreenButton||((R=document.createElement("div")).className="cesium-viewer-fullscreenContainer",n.appendChild(R),O=subscribeAndEvaluate((I=new FullscreenButton(R,t.fullscreenElement)).viewModel,"isFullscreenEnabled",function(e){R.style.display=e?"block":"none",defined(D)&&(D.container.style.right=R.clientWidth+"px",D.resize())})),t.vrButton){var j=document.createElement("div");j.className="cesium-viewer-vrContainer",n.appendChild(j),N=subscribeAndEvaluate((L=new VRButton(j,g,t.fullScreenElement)).viewModel,"isVREnabled",function(e){j.style.display=e?"block":"none",defined(I)&&(j.style.right=R.clientWidth+"px"),defined(D)&&(D.container.style.right=j.clientWidth+"px",D.resize())}),k=subscribeAndEvaluate(L.viewModel,"isVRMode",function(e){enableVRUI(r,e)})}this._baseLayerPickerDropDown=T,this._fullscreenSubscription=O,this._vrSubscription=N,this._vrModeSubscription=k,this._dataSourceChangedListeners={},this._automaticallyTrackDataSourceClocks=defaultValue(t.automaticallyTrackDataSourceClocks,!0),this._container=e,this._bottomContainer=o,this._element=n,this._cesiumWidget=d,this._selectionIndicator=f,this._infoBox=m,this._dataSourceCollection=h,this._destroyDataSourceCollection=p,this._dataSourceDisplay=y,this._clockViewModel=l,this._destroyClockViewModel=c,this._toolbar=B,this._homeButton=A,this._sceneModePicker=S,this._projectionPicker=w,this._baseLayerPicker=E,this._navigationHelpButton=P,this._animation=M,this._timeline=D,this._fullscreenButton=I,this._vrButton=L,this._geocoder=b,this._eventHelper=v,this._lastWidth=0,this._lastHeight=0,this._allowDataSourcesToSuspendAnimation=!0,this._entityView=void 0,this._enableInfoOrSelection=defined(m)||defined(f),this._clockTrackedDataSource=void 0,this._trackedEntity=void 0,this._needTrackedEntityUpdate=!1,this._selectedEntity=void 0,this._clockTrackedDataSource=void 0,this._zoomIsFlight=!1,this._zoomTarget=void 0,this._zoomPromise=void 0,this._zoomOptions=void 0,this._selectedEntityChanged=new Event,this._trackedEntityChanged=new Event,knockout.track(this,["_trackedEntity","_selectedEntity","_clockTrackedDataSource"]),v.add(h.dataSourceAdded,Viewer.prototype._onDataSourceAdded,this),v.add(h.dataSourceRemoved,Viewer.prototype._onDataSourceRemoved,this),v.add(g.postUpdate,Viewer.prototype.resize,this),v.add(g.postRender,Viewer.prototype._postRender,this);for(var q=h.length,Q=0;Q<q;Q++)this._dataSourceAdded(h,h.get(Q));this._dataSourceAdded(void 0,y.defaultDataSource),v.add(h.dataSourceAdded,Viewer.prototype._dataSourceAdded,this),v.add(h.dataSourceRemoved,Viewer.prototype._dataSourceRemoved,this),d.screenSpaceEventHandler.setInputAction(function(e){r.selectedEntity=pickEntity(r,e)},ScreenSpaceEventType$1.LEFT_CLICK),d.screenSpaceEventHandler.setInputAction(function(e){var t=pickEntity(r,e);defined(t)?Property.getValueOrUndefined(t.position,r.clock.currentTime)?r.trackedEntity=t:r.zoomTo(t):defined(r.trackedEntity)&&(r.trackedEntity=void 0)},ScreenSpaceEventType$1.LEFT_DOUBLE_CLICK)}function zoomToOrFly$1(i,e,t,r){cancelZoom$1(i);var n=when.defer();return i._zoomPromise=n,i._zoomIsFlight=r,i._zoomOptions=t,when(e,function(e){if(i._zoomPromise===n)if(e instanceof ImageryLayer)e.getViewableRectangle().then(function(e){return computeFlyToLocationForRectangle(e,i.scene)}).then(function(e){i._zoomPromise===n&&(i._zoomTarget=e)});else if(e instanceof Cesium3DTileset)i._zoomTarget=e;else if(e instanceof TimeDynamicPointCloud)i._zoomTarget=e;else if(e.isLoading&&defined(e.loadingEvent))var t=e.loadingEvent.addEventListener(function(){t(),i._zoomPromise===n&&(i._zoomTarget=e.entities.values.slice(0))});else Array.isArray(e)?i._zoomTarget=e.slice(0):(defined((e=defaultValue(e.values,e)).entities)&&(e=e.entities.values),Array.isArray(e)?i._zoomTarget=e.slice(0):i._zoomTarget=[e])}),i.scene.requestRender(),n.promise}function clearZoom$1(e){e._zoomPromise=void 0,e._zoomTarget=void 0,e._zoomOptions=void 0}function cancelZoom$1(e){var t=e._zoomPromise;defined(t)&&(clearZoom$1(e),t.resolve(!1))}function updateZoomTarget$1(t){var i=t._zoomTarget;if(defined(i)&&t.scene.mode!==SceneMode$1.MORPHING){var r,e,n=t.scene,a=n.camera,o=t._zoomPromise,s=defaultValue(t._zoomOptions,{});if(i instanceof Cesium3DTileset)return i.readyPromise.then(function(){var e=i.boundingSphere;defined(s.offset)||(s.offset=new HeadingPitchRange(0,-.5,e.radius)),r={offset:s.offset,duration:s.duration,maximumHeight:s.maximumHeight,complete:function(){o.resolve(!0)},cancel:function(){o.resolve(!1)}},t._zoomIsFlight?a.flyToBoundingSphere(i.boundingSphere,r):(a.viewBoundingSphere(e,s.offset),a.lookAtTransform(Matrix4.IDENTITY),o.resolve(!0)),clearZoom$1(t)});if(i instanceof TimeDynamicPointCloud)return i.readyPromise.then(function(){var e=i.boundingSphere;defined(s.offset)||(s.offset=new HeadingPitchRange(0,-.5,e.radius)),r={offset:s.offset,duration:s.duration,maximumHeight:s.maximumHeight,complete:function(){o.resolve(!0)},cancel:function(){o.resolve(!1)}},t._zoomIsFlight?a.flyToBoundingSphere(e,r):(a.viewBoundingSphere(e,s.offset),a.lookAtTransform(Matrix4.IDENTITY),o.resolve(!0)),clearZoom$1(t)});if(i instanceof Cartographic)return r={destination:n.mapProjection.ellipsoid.cartographicToCartesian(i),duration:s.duration,maximumHeight:s.maximumHeight,complete:function(){o.resolve(!0)},cancel:function(){o.resolve(!1)}},t._zoomIsFlight?a.flyTo(r):(a.setView(r),o.resolve(!0)),void clearZoom$1(t);for(var l=i,u=[],c=0,d=l.length;c<d;c++){var h=t._dataSourceDisplay.getBoundingSphere(l[c],!1,boundingSphereScratch$3);if(h===BoundingSphereState$1.PENDING)return;h!==BoundingSphereState$1.FAILED&&u.push(BoundingSphere.clone(boundingSphereScratch$3))}0!==u.length?(t.trackedEntity=void 0,e=BoundingSphere.fromBoundingSpheres(u),t._zoomIsFlight?(clearZoom$1(t),a.flyToBoundingSphere(e,{duration:s.duration,maximumHeight:s.maximumHeight,complete:function(){o.resolve(!0)},cancel:function(){o.resolve(!1)},offset:s.offset})):(a.viewBoundingSphere(e,s.offset),a.lookAtTransform(Matrix4.IDENTITY),clearZoom$1(t),o.resolve(!0))):cancelZoom$1(t)}}function updateTrackedEntity$1(e){if(e._needTrackedEntityUpdate){var t=e._trackedEntity,i=e.clock.currentTime;if(defined(Property.getValueOrUndefined(t.position,i))){var r=e.scene,n=e._dataSourceDisplay.getBoundingSphere(t,!1,boundingSphereScratch$3);if(n!==BoundingSphereState$1.PENDING){var a=r.mode;a!==SceneMode$1.COLUMBUS_VIEW&&a!==SceneMode$1.SCENE2D||(r.screenSpaceCameraController.enableTranslate=!1),a!==SceneMode$1.COLUMBUS_VIEW&&a!==SceneMode$1.SCENE3D||(r.screenSpaceCameraController.enableTilt=!1);var o=n!==BoundingSphereState$1.FAILED?boundingSphereScratch$3:void 0;e._entityView=new EntityView(t,r,r.mapProjection.ellipsoid),e._entityView.update(i,o),e._needTrackedEntityUpdate=!1}}}}function viewerCesium3DTilesInspectorMixin(e){var t=document.createElement("div");t.className="cesium-viewer-cesium3DTilesInspectorContainer",e.container.appendChild(t);var i=new Cesium3DTilesInspector(t,e.scene);Object.defineProperties(e,{cesium3DTilesInspector:{get:function(){return i}}})}function viewerCesiumInspectorMixin(e){var t=document.createElement("div");t.className="cesium-viewer-cesiumInspectorContainer",e.container.appendChild(t);var i=new CesiumInspector(t,e.scene);Object.defineProperties(e,{cesiumInspector:{get:function(){return i}}})}function viewerDragDropMixin(o,e){e=defaultValue(e,defaultValue.EMPTY_OBJECT);var t=!0,i=defaultValue(e.flyToOnDrop,!0),r=new Event,s=defaultValue(e.clearOnDrop,!0),n=defaultValue(e.dropTarget,o.container),l=defaultValue(e.clampToGround,!0),u=e.proxy;function a(e){stop(e),s&&(o.entities.removeAll(),o.dataSources.removeAll());for(var t=e.dataTransfer.files,i=t.length,r=0;r<i;r++){var n=t[r],a=new FileReader;a.onload=createOnLoadCallback(o,n,u,l),a.onerror=createDropErrorCallback(o,n),a.readAsText(n)}}n=getElement(n),Object.defineProperties(o,{dropTarget:{get:function(){return n},set:function(e){unsubscribe(n,a),subscribe(n=e,a)}},dropEnabled:{get:function(){return t},set:function(e){e!==t&&(e?subscribe(n,a):unsubscribe(n,a),t=e)}},dropError:{get:function(){return r}},clearOnDrop:{get:function(){return s},set:function(e){s=e}},flyToOnDrop:{get:function(){return i},set:function(e){i=e}},proxy:{get:function(){return u},set:function(e){u=e}},clampToGround:{get:function(){return l},set:function(e){l=e}}}),subscribe(n,a),o.destroy=wrapFunction(o,o.destroy,function(){o.dropEnabled=!1}),o._handleDrop=a}function stop(e){e.stopPropagation(),e.preventDefault()}function unsubscribe(e,t){var i=e;defined(i)&&(i.removeEventListener("drop",t,!1),i.removeEventListener("dragenter",stop,!1),i.removeEventListener("dragover",stop,!1),i.removeEventListener("dragexit",stop,!1))}function subscribe(e,t){e.addEventListener("drop",t,!1),e.addEventListener("dragenter",stop,!1),e.addEventListener("dragover",stop,!1),e.addEventListener("dragexit",stop,!1)}function createOnLoadCallback(r,n,a,o){var s=r.scene;return function(e){var t=n.name;try{var i;if(/\.czml$/i.test(t))i=CzmlDataSource.load(JSON.parse(e.target.result),{sourceUri:t});else if(/\.geojson$/i.test(t)||/\.json$/i.test(t)||/\.topojson$/i.test(t))i=GeoJsonDataSource.load(JSON.parse(e.target.result),{sourceUri:t,clampToGround:o});else{if(!/\.(kml|kmz)$/i.test(t))return void r.dropError.raiseEvent(r,t,"Unrecognized file: "+t);i=KmlDataSource.load(n,{sourceUri:t,proxy:a,camera:s.camera,canvas:s.canvas,clampToGround:o})}defined(i)&&r.dataSources.add(i).then(function(e){r.flyToOnDrop&&r.flyTo(e)}).otherwise(function(e){r.dropError.raiseEvent(r,t,e)})}catch(e){r.dropError.raiseEvent(r,t,e)}}}function createDropErrorCallback(t,i){return function(e){t.dropError.raiseEvent(t,i.name,e.target.error)}}function viewerPerformanceWatchdogMixin(e,t){t=defaultValue(t,defaultValue.EMPTY_OBJECT);var i=new PerformanceWatchdog({scene:e.scene,container:e.bottomContainer,lowFrameRateMessage:t.lowFrameRateMessage});Object.defineProperties(e,{performanceWatchdog:{get:function(){return i}}})}Object.defineProperties(Viewer.prototype,{container:{get:function(){return this._container}},bottomContainer:{get:function(){return this._bottomContainer}},cesiumWidget:{get:function(){return this._cesiumWidget}},selectionIndicator:{get:function(){return this._selectionIndicator}},infoBox:{get:function(){return this._infoBox}},geocoder:{get:function(){return this._geocoder}},homeButton:{get:function(){return this._homeButton}},sceneModePicker:{get:function(){return this._sceneModePicker}},projectionPicker:{get:function(){return this._projectionPicker}},baseLayerPicker:{get:function(){return this._baseLayerPicker}},navigationHelpButton:{get:function(){return this._navigationHelpButton}},animation:{get:function(){return this._animation}},timeline:{get:function(){return this._timeline}},fullscreenButton:{get:function(){return this._fullscreenButton}},vrButton:{get:function(){return this._vrButton}},dataSourceDisplay:{get:function(){return this._dataSourceDisplay}},entities:{get:function(){return this._dataSourceDisplay.defaultDataSource.entities}},dataSources:{get:function(){return this._dataSourceCollection}},canvas:{get:function(){return this._cesiumWidget.canvas}},scene:{get:function(){return this._cesiumWidget.scene}},shadows:{get:function(){return this.scene.shadowMap.enabled},set:function(e){this.scene.shadowMap.enabled=e}},terrainShadows:{get:function(){return this.scene.globe.shadows},set:function(e){this.scene.globe.shadows=e}},shadowMap:{get:function(){return this.scene.shadowMap}},imageryLayers:{get:function(){return this.scene.imageryLayers}},terrainProvider:{get:function(){return this.scene.terrainProvider},set:function(e){this.scene.terrainProvider=e}},camera:{get:function(){return this.scene.camera}},postProcessStages:{get:function(){return this.scene.postProcessStages}},clock:{get:function(){return this._clockViewModel.clock}},clockViewModel:{get:function(){return this._clockViewModel}},screenSpaceEventHandler:{get:function(){return this._cesiumWidget.screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._cesiumWidget.targetFrameRate},set:function(e){this._cesiumWidget.targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._cesiumWidget.useDefaultRenderLoop},set:function(e){this._cesiumWidget.useDefaultRenderLoop=e}},resolutionScale:{get:function(){return this._cesiumWidget.resolutionScale},set:function(e){this._cesiumWidget.resolutionScale=e}},useBrowserRecommendedResolution:{get:function(){return this._cesiumWidget.useBrowserRecommendedResolution},set:function(e){this._cesiumWidget.useBrowserRecommendedResolution=e}},allowDataSourcesToSuspendAnimation:{get:function(){return this._allowDataSourcesToSuspendAnimation},set:function(e){this._allowDataSourcesToSuspendAnimation=e}},trackedEntity:{get:function(){return this._trackedEntity},set:function(e){if(this._trackedEntity!==e){this._trackedEntity=e,cancelZoom$1(this);var t=this.scene,i=t.mode;defined(e)&&defined(e.position)?this._needTrackedEntityUpdate=!0:(this._needTrackedEntityUpdate=!1,i!==SceneMode$1.COLUMBUS_VIEW&&i!==SceneMode$1.SCENE2D||(t.screenSpaceCameraController.enableTranslate=!0),i!==SceneMode$1.COLUMBUS_VIEW&&i!==SceneMode$1.SCENE3D||(t.screenSpaceCameraController.enableTilt=!0),this._entityView=void 0,this.camera.lookAtTransform(Matrix4.IDENTITY)),this._trackedEntityChanged.raiseEvent(e),this.scene.requestRender()}}},selectedEntity:{get:function(){return this._selectedEntity},set:function(e){if(this._selectedEntity!==e){this._selectedEntity=e;var t=defined(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;defined(e)?defined(t)&&t.animateAppear():defined(t)&&t.animateDepart(),this._selectedEntityChanged.raiseEvent(e)}}},selectedEntityChanged:{get:function(){return this._selectedEntityChanged}},trackedEntityChanged:{get:function(){return this._trackedEntityChanged}},clockTrackedDataSource:{get:function(){return this._clockTrackedDataSource},set:function(e){this._clockTrackedDataSource!==e&&(this._clockTrackedDataSource=e,trackDataSourceClock(this._timeline,this.clock,e))}}}),Viewer.prototype.extend=function(e,t){e(this,t)},Viewer.prototype.resize=function(){var e=this._cesiumWidget,t=this._container,i=t.clientWidth,r=t.clientHeight,n=defined(this._animation),a=defined(this._timeline);if(e.resize(),i!==this._lastWidth||r!==this._lastHeight){var o=r-125,s=this._baseLayerPickerDropDown;if(defined(s)&&(s.style.maxHeight=o+"px"),defined(this._geocoder))this._geocoder.searchSuggestionsContainer.style.maxHeight=o+"px";defined(this._infoBox)&&(this._infoBox.viewModel.maxHeight=o);var l,u=this._timeline,c=0,d=0,h=0;if(n&&"hidden"!==window.getComputedStyle(this._animation.container).visibility){var p=this._lastWidth;l=this._animation.container,900<i?(c=169,p<=900&&(l.style.width="169px",l.style.height="112px",this._animation.resize())):600<=i?(c=136,(p<600||900<p)&&(l.style.width="136px",l.style.height="90px",this._animation.resize())):(c=106,(600<p||0===p)&&(l.style.width="106px",l.style.height="70px",this._animation.resize())),d=c+5}if(a&&"hidden"!==window.getComputedStyle(this._timeline.container).visibility){var f=this._fullscreenButton,m=this._vrButton,g=u.container,y=g.style;h=g.clientHeight+3,y.left=c+"px";var v=0;defined(f)&&(v+=f.container.clientWidth),defined(m)&&(v+=m.container.clientWidth),y.right=v+"px",u.resize()}this._bottomContainer.style.left=d+"px",this._bottomContainer.style.bottom=h+"px",this._lastWidth=i,this._lastHeight=r}},Viewer.prototype.forceResize=function(){this._lastWidth=0,this.resize()},Viewer.prototype.render=function(){this._cesiumWidget.render()},Viewer.prototype.isDestroyed=function(){return!1},Viewer.prototype.destroy=function(){var e;this.screenSpaceEventHandler.removeInputAction(ScreenSpaceEventType$1.LEFT_CLICK),this.screenSpaceEventHandler.removeInputAction(ScreenSpaceEventType$1.LEFT_DOUBLE_CLICK);var t=this.dataSources,i=t.length;for(e=0;e<i;e++)this._dataSourceRemoved(t,t.get(e));return this._dataSourceRemoved(void 0,this._dataSourceDisplay.defaultDataSource),this._container.removeChild(this._element),this._element.removeChild(this._toolbar),this._eventHelper.removeAll(),defined(this._geocoder)&&(this._geocoder=this._geocoder.destroy()),defined(this._homeButton)&&(this._homeButton=this._homeButton.destroy()),defined(this._sceneModePicker)&&(this._sceneModePicker=this._sceneModePicker.destroy()),defined(this._projectionPicker)&&(this._projectionPicker=this._projectionPicker.destroy()),defined(this._baseLayerPicker)&&(this._baseLayerPicker=this._baseLayerPicker.destroy()),defined(this._animation)&&(this._element.removeChild(this._animation.container),this._animation=this._animation.destroy()),defined(this._timeline)&&(this._timeline.removeEventListener("settime",onTimelineScrubfunction,!1),this._element.removeChild(this._timeline.container),this._timeline=this._timeline.destroy()),defined(this._fullscreenButton)&&(this._fullscreenSubscription.dispose(),this._element.removeChild(this._fullscreenButton.container),this._fullscreenButton=this._fullscreenButton.destroy()),defined(this._vrButton)&&(this._vrSubscription.dispose(),this._vrModeSubscription.dispose(),this._element.removeChild(this._vrButton.container),this._vrButton=this._vrButton.destroy()),defined(this._infoBox)&&(this._element.removeChild(this._infoBox.container),this._infoBox=this._infoBox.destroy()),defined(this._selectionIndicator)&&(this._element.removeChild(this._selectionIndicator.container),this._selectionIndicator=this._selectionIndicator.destroy()),this._destroyClockViewModel&&(this._clockViewModel=this._clockViewModel.destroy()),this._dataSourceDisplay=this._dataSourceDisplay.destroy(),this._cesiumWidget=this._cesiumWidget.destroy(),this._destroyDataSourceCollection&&(this._dataSourceCollection=this._dataSourceCollection.destroy()),destroyObject(this)},Viewer.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(Viewer.prototype._onEntityCollectionChanged,this)},Viewer.prototype._dataSourceRemoved=function(e,t){var i=t.entities;i.collectionChanged.removeEventListener(Viewer.prototype._onEntityCollectionChanged,this),defined(this.trackedEntity)&&i.getById(this.trackedEntity.id)===this.trackedEntity&&(this.trackedEntity=void 0),defined(this.selectedEntity)&&i.getById(this.selectedEntity.id)===this.selectedEntity&&(this.selectedEntity=void 0)},Viewer.prototype._onTick=function(e){var t=e.currentTime,i=this._dataSourceDisplay.update(t);this._allowDataSourcesToSuspendAnimation&&(this._clockViewModel.canAnimate=i);var r,n=this._entityView;if(defined(n)){var a=this._trackedEntity;this._dataSourceDisplay.getBoundingSphere(a,!1,boundingSphereScratch$3)===BoundingSphereState$1.DONE&&n.update(t,boundingSphereScratch$3)}var o=!1,s=this.selectedEntity,l=defined(s)&&this._enableInfoOrSelection;l&&s.isShowing&&s.isAvailable(t)&&(this._dataSourceDisplay.getBoundingSphere(s,!0,boundingSphereScratch$3)!==BoundingSphereState$1.FAILED?r=boundingSphereScratch$3.center:defined(s.position)&&(r=s.position.getValue(t,r)),o=defined(r));var u=defined(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;defined(u)&&(u.position=Cartesian3.clone(r,u.position),u.showSelection=l&&o,u.update());var c=defined(this._infoBox)?this._infoBox.viewModel:void 0;defined(c)&&(c.showInfo=l,c.enableCamera=o,c.isCameraTracking=this.trackedEntity===this.selectedEntity,l?(c.titleText=defaultValue(s.name,s.id),c.description=Property.getValueOrDefault(s.description,t,"")):(c.titleText="",c.description=""))},Viewer.prototype._onEntityCollectionChanged=function(e,t,i){for(var r=i.length,n=0;n<r;n++){var a=i[n];this.trackedEntity===a&&(this.trackedEntity=void 0),this.selectedEntity===a&&(this.selectedEntity=void 0)}},Viewer.prototype._onInfoBoxCameraClicked=function(e){e.isCameraTracking&&this.trackedEntity===this.selectedEntity?this.trackedEntity=void 0:defined(this.selectedEntity.position)?this.trackedEntity=this.selectedEntity:this.zoomTo(this.selectedEntity)},Viewer.prototype._clearTrackedObject=function(){this.trackedEntity=void 0},Viewer.prototype._onInfoBoxClockClicked=function(e){this.selectedEntity=void 0},Viewer.prototype._clearObjects=function(){this.trackedEntity=void 0,this.selectedEntity=void 0},Viewer.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&trackDataSourceClock(this.timeline,this.clock,e)},Viewer.prototype._onDataSourceAdded=function(e,t){this._automaticallyTrackDataSourceClocks&&(this.clockTrackedDataSource=t);var i=t.entities.id,r=this._eventHelper.add(t.changedEvent,Viewer.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[i]=r},Viewer.prototype._onDataSourceRemoved=function(e,t){var i=this.clockTrackedDataSource===t,r=t.entities.id;if(this._dataSourceChangedListeners[r](),this._dataSourceChangedListeners[r]=void 0,i){var n=e.length;this._automaticallyTrackDataSourceClocks&&0<n?this.clockTrackedDataSource=e.get(n-1):this.clockTrackedDataSource=void 0}},Viewer.prototype.zoomTo=function(e,t){return zoomToOrFly$1(this,e,{offset:t},!1)},Viewer.prototype.flyTo=function(e,t){return zoomToOrFly$1(this,e,t,!0)},Viewer.prototype._postRender=function(){updateZoomTarget$1(this),updateTrackedEntity$1(this)};var S3MCompressType={encNONE:0,enrS3TCDXTN:14,enrPVRTPF_PVRTC2:19,enrPVRTPF_PVRTC:20,enrPVRTPF_PVRTC_4bpp:21,enrPVRTPF_ETC1:22},S3MCompressType$1=Object.freeze(S3MCompressType),S3MPixelFormat={LUMINANCE_8:1,LUMINANCE_16:2,ALPHA:3,ALPHA_4_LUMINANCE_4:4,LUMINANCE_ALPHA:5,RGB_565:6,BGR565:7,RGB:10,BGR:11,ARGB:12,ABGR:13,BGRA:14,WEBP:25,RGBA:28,DXT1:17,DXT2:18,DXT3:19,DXT4:20,DXT5:21},S3MPixelFormat$1=Object.freeze(S3MPixelFormat);function ConicArcSensorGraphics(e){this._angle=void 0,this._angleSubscription=void 0,this._radius=void 0,this._radiusSubscription=void 0,this._stack=void 0,this._stackSubscription=void 0,this._slice=void 0,this._sliceSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._show=void 0,this._showSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._definitionChanged=new Event,this._gaze=void 0,this._gazeSubscription=void 0,this.merge(defaultValue(e,defaultValue.EMPTY_OBJECT))}function createConstantPositionProperty$1(e){return new ConstantPositionProperty(e)}function createPositionPropertyDescriptor$1(e){return createPropertyDescriptor(e,void 0,createConstantPositionProperty$1)}function ConicArcSensor(e){e=e||{},this._position=void 0,this._orientation=void 0,this._show=void 0;var t=e.conicArcSensor;t instanceof ConicArcSensorGraphics||(t=new ConicArcSensorGraphics(t)),this._conicArcSensor=t,this._distanceDisplayCondition=new DistanceDisplayCondition,this._geometry=void 0,this._outlineGeometry=void 0,this._definitionChanged=new Event,this.merge(e)}Object.defineProperties(ConicArcSensorGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),material:createMaterialPropertyDescriptor("material"),fill:createPropertyDescriptor("fill"),shadows:createPropertyDescriptor("shadows"),distanceDisplayCondition:createPropertyDescriptor("distanceDisplayCondition")}),ConicArcSensorGraphics.prototype.clone=function(e){return defined(e)?(e.angle=this.angle,e.radius=this.radius,e.stack=this.stack,e.slice=this.slice,e.show=this.show,e.material=this.material,e.color=this.color,e.fill=this.fill,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.gaze=this.gaze,e):new ConicArcSensorGraphics(this)},ConicArcSensorGraphics.prototype.merge=function(e){this.angle=defaultValue(this.angle,e.angle),this.radius=defaultValue(this.radius,e.radius),this.stack=defaultValue(this.stack,e.stack),this.slice=defaultValue(this.slice,e.slice),this.show=defaultValue(this.show,e.show),this.color=defaultValue(this.color,e.color),this.material=defaultValue(this.material,e.material),this.fill=defaultValue(this.fill,e.fill),this.outline=defaultValue(this.outline,e.outline),this.outlineColor=defaultValue(this.outlineColor,e.outlineColor),this.outlineWidth=defaultValue(this.outlineWidth,e.outlineWidth),this.shadows=defaultValue(this.shadows,e.shadows),this.distanceDisplayCondition=defaultValue(this.distanceDisplayCondition,e.distanceDisplayCondition),this.gaze=defaultValue(this.gaze,e.gaze)},Object.defineProperties(ConicArcSensor.prototype,{position:createPositionPropertyDescriptor$1("position"),orientation:createPropertyDescriptor("orientation"),show:createPropertyDescriptor("show")}),ConicArcSensor.prototype.merge=function(e){this.position=e.position,this.orientation=e.orientation,this.show=e.show},ConicArcSensor.prototype.gazeAt=function(e){e instanceof Entity&&(this._conicArcSensor.gaze=e)};var cos$4=Math.cos,sin$4=Math.sin;function ConicArcSensorGeometry(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).angle,i=e.radius,r=Math.round(defaultValue(e.stackPartitions,12)),n=Math.round(defaultValue(e.slicePartitions,64)),a=defaultValue(e.vertexFormat,VertexFormat.DEFAULT);this._angle=t,this._radius=i,this._stackPartitions=r,this._slicePartitions=n,this._vertexFormat=a}ConicArcSensorGeometry.fromDimensions=function(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).angle,i=e.radius;e.height;return new ConicArcSensorGeometry({angle:t,radius:i,stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,vertexFormat:e.vertexFormat})},ConicArcSensorGeometry.createGeometry=function(e){console.time("createGeometry");var t,i=e._angle,r=e._radius,n=e._stackPartitions+1,a=e._slicePartitions+1,o=e._vertexFormat,s=new GeometryAttributes,l=3*(a-1)+6*(a-1)*(n-2)+1*(a-1)*3,u=n*a,c=IndexDatatype$1.createTypedArray(u,l),d=new Float64Array(3*u+3*(a-1)*3);if(o.position){for(var h=0,p=new Array(a),f=new Array(a),m=0;m<a;m++){var g=CesiumMath.TWO_PI*m/(a-1);p[m]=cos$4(g),f[m]=sin$4(g),d[h++]=0,d[h++]=0,d[h++]=-r}for(m=1;m<n;m++)for(var y=i*m/(n-1),v=sin$4(y),_=r*v,C=r*v,x=r*cos$4(y),b=0;b<a;b++)d[h++]=p[b]*_,d[h++]=f[b]*C,d[h++]=-x;t=h;for(m=0;m<a-1;m++)d[h++]=0,d[h++]=0,d[h++]=0,d[h++]=d[t-3*(a-m-1)],d[h++]=d[t-3*(a-m-1)+1],d[h++]=d[t-3*(a-m-1)+2],d[h++]=d[t-3*(a-m)],d[h++]=d[t-3*(a-m)+1],d[h++]=d[t-3*(a-m)+2];s.position=new GeometryAttribute({componentDatatype:ComponentDatatype$1.DOUBLE,componentsPerAttribute:3,values:d})}var A,S,w=0;for(b=0;b<a-1;b++)c[w++]=a+b,c[w++]=a+b+1,c[w++]=b+1;for(m=1;m<n-1;m++)for(A=m*a,S=(m+1)*a,b=0;b<a-1;b++)c[w++]=S+b,c[w++]=S+b+1,c[w++]=A+b+1,c[w++]=S+b,c[w++]=A+b+1,c[w++]=A+b;m=0;for(var E=3*(a-1);m<E;m++)c[w++]=m+t/3;var T=new Geometry({attributes:s,indices:c,primitiveType:PrimitiveType$1.TRIANGLES,boundingSphere:new BoundingSphere(Cartesian3.ZERO,r)});return T=GeometryPipeline.computeNormal(T),console.timeEnd("createGeometry"),T};var cos$5=Math.cos,sin$5=Math.sin;function ConicArcSensorOutlineGeometry(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).angle,i=e.radius,r=Math.round(defaultValue(e.stackPartitions,10)),n=Math.round(defaultValue(e.slicePartitions,8)),a=Math.round(defaultValue(e.subdivisions,128));this._angle=t,this._radius=i,this._stackPartitions=r,this._slicePartitions=n,this._subdivisions=a}function ConicArcSensorCollection(e){var t=this;if(!defined(e))throw new DeveloperError("viewer is required.");var i=(this._earthCtrl=e).coreMap.scene;this._scene=i;var r=e.coreMap.clock;this._clock=r,this._primitives=i.primitives,this._primitive=void 0,this._outlinePrimitive=void 0,this._conicArcSensorCollection=[],r.onTick.addEventListener(function(){t.update()})}ConicArcSensorOutlineGeometry.createGeometry=function(e){var t=e._angle,i=e._radius;if(!(i<=0||t<=0)){var r,n,a,o,s,l,u=e._stackPartitions,c=e._slicePartitions,d=e._subdivisions,h=d*(u+c-1),p=h-c+2,f=new Float64Array(3*p),m=IndexDatatype$1.createTypedArray(p,2*h),g=0,y=new Array(d),v=new Array(d);for(r=0;r<d;r++)a=CesiumMath.TWO_PI*r/d,y[r]=cos$5(a),v[r]=sin$5(a);for(r=1;r<u;r++)for(s=cos$5(o=t*r/(u-1)),l=sin$5(o),n=0;n<d;n++)f[g++]=i*y[n]*l,f[g++]=i*v[n]*l,f[g++]=-i*s;for(y.length=c,v.length=c,r=0;r<c;r++)a=CesiumMath.TWO_PI*r/c,y[r]=cos$5(a),v[r]=sin$5(a);for(f[g++]=0,f[g++]=0,f[g++]=-i,r=1;r<d;r++)for(s=cos$5(o=t*r/d),l=sin$5(o),n=0;n<c;n++)f[g++]=i*y[n]*l,f[g++]=i*v[n]*l,f[g++]=-i*s;for(r=g=0;r<u-1;++r){var _=r*d;for(n=0;n<d-1;++n)m[g++]=_+n,m[g++]=_+n+1;m[g++]=_+d-1,m[g++]=_}var C=d*(u-1);for(n=1;n<c+1;++n)m[g++]=C,m[g++]=C+n;for(r=0;r<d-2;++r){var x=r*c+1+C,b=(r+1)*c+1+C;for(n=0;n<c-1;++n)m[g++]=b+n,m[g++]=x+n;m[g++]=b+c-1,m[g++]=x+c-1}return new Geometry({attributes:new GeometryAttributes({position:new GeometryAttribute({componentDatatype:ComponentDatatype$1.DOUBLE,componentsPerAttribute:3,values:f})}),indices:m,primitiveType:PrimitiveType$1.LINES,boundingSphere:new BoundingSphere(Cartesian3.ZERO,i)})}};var matrix3Scratch$4=new Matrix3,matrix4Scratch$2=new Matrix4,positionScratch$d=new Cartesian3,targetPositionScratch=new Cartesian3,diffVectorScratch$1=new Cartesian3,orientationScratch$2=new Quaternion;function RectangularSensorGraphics(e){this._show=void 0,this._radius=void 0,this._xHalfAngle=void 0,this._yHalfAngle=void 0,this._lineColor=void 0,this._showSectorLines=void 0,this._showSectorSegmentLines=void 0,this._showLateralSurfaces=void 0,this._material=void 0,this._showDomeSurfaces=void 0,this._showDomeLines=void 0,this._showIntersection=void 0,this._intersectionColor=void 0,this._intersectionWidth=void 0,this._showThroughEllipsoid=void 0,this._gaze=void 0,this._showScanPlane=void 0,this._scanPlaneColor=void 0,this._scanPlaneMode=void 0,this._scanPlaneRate=void 0,this._definitionChanged=new Event,this.merge(defaultValue(e,defaultValue.EMPTY_OBJECT))}function callAndWrap(e,t,i){try{return e(t,i)}catch(e){return when.reject(e)}}function createTaskProcessorWorker(n){var a;return function(e){var t=e.data,i=[],r={id:t.id,result:void 0,error:void 0};return when(callAndWrap(n,t.parameters,i)).then(function(e){r.result=e}).otherwise(function(e){e instanceof Error?r.error={name:e.name,message:e.message,stack:e.stack}:r.error=e}).always(function(){defined(a)||(a=defaultValue(self.webkitPostMessage,self.postMessage)),t.canTransferArrayBuffer||(i.length=0);try{a(r,i)}catch(e){r.result=void 0,r.error="postMessage failed with error: "+formatError(e)+"\n with responseMessage: "+JSON.stringify(r),a(r)}})}}ConicArcSensorCollection.prototype.add=function(e){return e instanceof ConicArcSensor||(e=new ConicArcSensor(e)),this._conicArcSensorCollection.push(e),e},ConicArcSensorCollection.prototype.remove=function(e){var t=this._conicArcSensorCollection.indexOf(e);-1!==t&&this._conicArcSensorCollection.splice(t,1)},ConicArcSensorCollection.prototype.removeAll=function(){this._conicArcSensorCollection.length=0},ConicArcSensorCollection.prototype.update=function(){var e=this._clock.currentTime,t=this._conicArcSensorCollection,i=this._primitives,r=this._primitive,n=this._outlinePrimitive,a=[],o=[];defined(r)&&i.removeAndDestroy(r),defined(n)&&i.removeAndDestroy(n);for(var s=0,l=t.length;s<l;s++){var u=t[s],c=u._conicArcSensor;if(Property.getValueOrDefault(c.show,e,!0)){var d=c.angle,h=c.radius,p=c.stack,f=c.slice;if(defined(d))if(Property.getValueOrDefault(u.show,e,!0)){var m=Property.getValueOrUndefined(u.position,e,positionScratch$d);if(defined(m)){var g,y=c.gaze;if(defined(y)){var v=Property.getValueOrUndefined(y.position,e,targetPositionScratch);if(!defined(m)||!defined(v))continue;var _=Cartesian3.subtract(m,v,diffVectorScratch$1),C=Cartesian3.angleBetween(Cartesian3.UNIT_Z,_),x=Cartesian3.cross(Cartesian3.UNIT_Z,_,diffVectorScratch$1),b=Quaternion.fromAxisAngle(x,C,orientationScratch$2),A=Cartesian3.distance(m,v);h=1,g=Matrix4.fromRotationTranslation(Matrix3.multiplyByScalar(Matrix3.fromQuaternion(b,matrix3Scratch$4),A,matrix3Scratch$4),m,matrix4Scratch$2)}else{g=defined(b=Property.getValueOrUndefined(u.orientation,e,orientationScratch$2))?Matrix4.fromRotationTranslation(Matrix3.fromQuaternion(b,matrix3Scratch$4),m,matrix4Scratch$2):Transforms.eastNorthUpToFixedFrame(m,void 0,matrix4Scratch$2)}if(defined(g)){var S,w=u._geometry;if(!defined(w))S=new ConicArcSensorGeometry({vertexFormat:VertexFormat.POSITION_AND_NORMAL,angle:d,radius:h,stackPartitions:p,slicePartitions:f}),u._geometry=ConicArcSensorGeometry.createGeometry(S),w=u._geometry;var E=c.color,T=c.outline,P=c.outlineWidth;defined(P)||(P=1);var M=c.outlineColor;defined(M)||(M=Color.WHITE);var D=new GeometryInstance({geometry:w,modelMatrix:g,attributes:{color:ColorGeometryInstanceAttribute.fromColor(E)}});if(a.push(D),T){var I,O=u._outlineGeometry;if(!defined(O))I=new ConicArcSensorOutlineGeometry({vertexFormat:VertexFormat.POSITION_ONLY,angle:d,radius:h}),u._outlineGeometry=ConicArcSensorOutlineGeometry.createGeometry(I),O=u._outlineGeometry;D=new GeometryInstance({geometry:O,modelMatrix:g,attributes:{color:ColorGeometryInstanceAttribute.fromColor(M)}});o.push(D)}}}}}}0<a.length&&(this._primitive=this._primitives.add(new Primitive({asynchronous:!1,geometryInstances:a,appearance:new PerInstanceColorAppearance({flat:!1,translucent:!0,closed:!0})}))),0<o.length&&(this._outlinePrimitive=this._primitives.add(new Primitive({asynchronous:!1,geometryInstances:o,appearance:new PerInstanceColorAppearance({flat:!0,translucent:!0,renderState:{lineWidth:this._scene.clampLineWidth(P)}})})))},Object.defineProperties(RectangularSensorGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),radius:createPropertyDescriptor("radius"),xHalfAngle:createPropertyDescriptor("xHalfAngle"),yHalfAngle:createPropertyDescriptor("yHalfAngle"),lineColor:createPropertyDescriptor("lineColor"),showSectorLines:createPropertyDescriptor("showSectorLines"),showSectorSegmentLines:createPropertyDescriptor("showSectorSegmentLines"),showLateralSurfaces:createPropertyDescriptor("showLateralSurfaces"),material:createMaterialPropertyDescriptor("material"),showDomeSurfaces:createPropertyDescriptor("showDomeSurfaces"),showDomeLines:createPropertyDescriptor("showDomeLines "),showIntersection:createPropertyDescriptor("showIntersection"),intersectionColor:createPropertyDescriptor("intersectionColor"),intersectionWidth:createPropertyDescriptor("intersectionWidth"),showThroughEllipsoid:createPropertyDescriptor("showThroughEllipsoid"),gaze:createPropertyDescriptor("gaze"),showScanPlane:createPropertyDescriptor("showScanPlane"),scanPlaneColor:createPropertyDescriptor("scanPlaneColor"),scanPlaneMode:createPropertyDescriptor("scanPlaneMode"),scanPlaneRate:createPropertyDescriptor("scanPlaneRate")}),RectangularSensorGraphics.prototype.clone=function(e){return defined(e)||(e=new RectangularSensorGraphics),e.show=this.show,e.radius=this.radius,e.xHalfAngle=this.xHalfAngle,e.yHalfAngle=this.yHalfAngle,e.lineColor=this.lineColor,e.showSectorLines=this.showSectorLines,e.showSectorSegmentLines=this.showSectorSegmentLines,e.showLateralSurfaces=this.showLateralSurfaces,e.material=this.material,e.showDomeSurfaces=this.showDomeSurfaces,e.showDomeLines=this.showDomeLines,e.showIntersection=this.showIntersection,e.intersectionColor=this.intersectionColor,e.intersectionWidth=this.intersectionWidth,e.showThroughEllipsoid=this.showThroughEllipsoid,e.gaze=this.gaze,e.showScanPlane=this.showScanPlane,e.scanPlaneColor=this.scanPlaneColor,e.scanPlaneMode=this.scanPlaneMode,e.scanPlaneRate=this.scanPlaneRate,e},RectangularSensorGraphics.prototype.merge=function(e){if(!defined(e))throw new DeveloperError("source is required.");this.show=defaultValue(this.show,e.show),this.radius=defaultValue(this.radius,e.radius),this.xHalfAngle=defaultValue(this.xHalfAngle,e.xHalfAngle),this.yHalfAngle=defaultValue(this.yHalfAngle,e.yHalfAngle),this.lineColor=defaultValue(this.lineColor,e.lineColor),this.showSectorLines=defaultValue(this.showSectorLines,e.showSectorLines),this.showSectorSegmentLines=defaultValue(this.showSectorSegmentLines,e.showSectorSegmentLines),this.showLateralSurfaces=defaultValue(this.showLateralSurfaces,e.showLateralSurfaces),this.material=defaultValue(this.material,e.material),this.showDomeSurfaces=defaultValue(this.showDomeSurfaces,e.showDomeSurfaces),this.showDomeLines=defaultValue(this.showDomeLines,e.showDomeLines),this.showIntersection=defaultValue(this.showIntersection,e.showIntersection),this.intersectionColor=defaultValue(this.intersectionColor,e.intersectionColor),this.intersectionWidth=defaultValue(this.intersectionWidth,e.intersectionWidth),this.showThroughEllipsoid=defaultValue(this.showThroughEllipsoid,e.showThroughEllipsoid),this.gaze=defaultValue(this.gaze,e.gaze),this.showScanPlane=defaultValue(this.showScanPlane,e.showScanPlane),this.scanPlaneColor=defaultValue(this.scanPlaneColor,e.scanPlaneColor),this.scanPlaneMode=defaultValue(this.scanPlaneMode,e.scanPlaneMode),this.scanPlaneRate=defaultValue(this.scanPlaneRate,e.scanPlaneRate)};var VERSION="2.1.10";exports.Animation=Animation,exports.AnimationViewModel=AnimationViewModel,exports.Appearance=Appearance,exports.ApproximateTerrainHeights=ApproximateTerrainHeights,exports.ArcGISTiledElevationTerrainProvider=ArcGISTiledElevationTerrainProvider,exports.ArcGisMapServerImageryProvider=ArcGisMapServerImageryProvider,exports.ArcType=ArcType$1,exports.AssociativeArray=AssociativeArray,exports.AttributeCompression=AttributeCompression,exports.AttributeType=AttributeType$1,exports.AutoExposure=AutoExposure,exports.Autolinker=Autolinker,exports.AutomaticUniforms=AutomaticUniforms,exports.Axis=Axis$1,exports.AxisAlignedBoundingBox=AxisAlignedBoundingBox,exports.Base64Encoder=Base64Encoder,exports.BaseLayerPicker=BaseLayerPicker,exports.BaseLayerPickerViewModel=BaseLayerPickerViewModel,exports.BatchTable=BatchTable,exports.Batched3DModel3DTileContent=Batched3DModel3DTileContent,exports.Billboard=Billboard,exports.BillboardCollection=BillboardCollection,exports.BillboardGraphics=BillboardGraphics,exports.BillboardVisualizer=BillboardVisualizer,exports.BingMapsApi=BingMapsApi,exports.BingMapsGeocoderService=BingMapsGeocoderService,exports.BingMapsImageryProvider=BingMapsImageryProvider,exports.BingMapsStyle=BingMapsStyle$1,exports.BlendEquation=BlendEquation$1,exports.BlendFunction=BlendFunction$1,exports.BlendOption=BlendOption$1,exports.BlendingState=BlendingState$1,exports.BoundingRectangle=BoundingRectangle,exports.BoundingSphere=BoundingSphere,exports.BoundingSphereState=BoundingSphereState$1,exports.BoxEmitter=BoxEmitter,exports.BoxGeometry=BoxGeometry,exports.BoxGeometryUpdater=BoxGeometryUpdater,exports.BoxGraphics=BoxGraphics,exports.BoxOutlineGeometry=BoxOutlineGeometry,exports.BrdfLutGenerator=BrdfLutGenerator,exports.Buffer=Buffer$1,exports.BufferUsage=BufferUsage$1,exports.CallbackProperty=CallbackProperty,exports.Camera=Camera,exports.CameraEventAggregator=CameraEventAggregator,exports.CameraEventType=CameraEventType$1,exports.CameraFlightPath=CameraFlightPath,exports.Cartesian2=Cartesian2,exports.Cartesian3=Cartesian3,exports.Cartesian4=Cartesian4,exports.Cartographic=Cartographic,exports.CartographicGeocoderService=CartographicGeocoderService,exports.CatmullRomSpline=CatmullRomSpline,exports.Cesium3DTile=Cesium3DTile,exports.Cesium3DTileBatchTable=Cesium3DTileBatchTable,exports.Cesium3DTileColorBlendMode=Cesium3DTileColorBlendMode$1,exports.Cesium3DTileContent=Cesium3DTileContent,exports.Cesium3DTileContentFactory=Cesium3DTileContentFactory,exports.Cesium3DTileContentState=Cesium3DTileContentState$1,exports.Cesium3DTileFeature=Cesium3DTileFeature,exports.Cesium3DTileFeatureTable=Cesium3DTileFeatureTable,exports.Cesium3DTileOptimizationHint=Cesium3DTileOptimizationHint$1,exports.Cesium3DTileOptimizations=Cesium3DTileOptimizations,exports.Cesium3DTilePass=Cesium3DTilePass$1,exports.Cesium3DTilePassState=Cesium3DTilePassState,exports.Cesium3DTilePointFeature=Cesium3DTilePointFeature,exports.Cesium3DTileRefine=Cesium3DTileRefine$1,exports.Cesium3DTileStyle=Cesium3DTileStyle,exports.Cesium3DTileStyleEngine=Cesium3DTileStyleEngine,exports.Cesium3DTilesInspector=Cesium3DTilesInspector,exports.Cesium3DTilesInspectorViewModel=Cesium3DTilesInspectorViewModel,exports.Cesium3DTileset=Cesium3DTileset,exports.Cesium3DTilesetCache=Cesium3DTilesetCache,exports.Cesium3DTilesetGraphics=Cesium3DTilesetGraphics,exports.Cesium3DTilesetHeatmap=Cesium3DTilesetHeatmap,exports.Cesium3DTilesetMostDetailedTraversal=Cesium3DTilesetMostDetailedTraversal,exports.Cesium3DTilesetStatistics=Cesium3DTilesetStatistics,exports.Cesium3DTilesetTraversal=Cesium3DTilesetTraversal,exports.Cesium3DTilesetVisualizer=Cesium3DTilesetVisualizer,exports.CesiumInspector=CesiumInspector,exports.CesiumInspectorViewModel=CesiumInspectorViewModel,exports.CesiumNavigation=CesiumNavigation,exports.CesiumTerrainProvider=CesiumTerrainProvider,exports.CesiumWidget=CesiumWidget,exports.Check=Check,exports.CheckerboardMaterialProperty=CheckerboardMaterialProperty,exports.CircleEmitter=CircleEmitter,exports.CircleGeometry=CircleGeometry,exports.CircleOutlineGeometry=CircleOutlineGeometry,exports.CircleWaveMaterialProperty=CircleWaveMaterialProperty,exports.ClassificationModel=ClassificationModel,exports.ClassificationPrimitive=ClassificationPrimitive,exports.ClassificationType=ClassificationType$1,exports.ClearCommand=ClearCommand,exports.ClippingPlane=ClippingPlane,exports.ClippingPlaneCollection=ClippingPlaneCollection,exports.Clock=Clock,exports.ClockRange=ClockRange$1,exports.ClockStep=ClockStep$1,exports.ClockViewModel=ClockViewModel,exports.CollectionSource=CollectionSource,exports.Color=Color,exports.ColorBlendMode=ColorBlendMode$1,exports.ColorGeometryInstanceAttribute=ColorGeometryInstanceAttribute,exports.ColorMaterialProperty=ColorMaterialProperty,exports.Command=Command,exports.ComponentDatatype=ComponentDatatype$1,exports.Composite3DTileContent=Composite3DTileContent,exports.CompositeEntityCollection=CompositeEntityCollection,exports.CompositeMaterialProperty=CompositeMaterialProperty,exports.CompositePositionProperty=CompositePositionProperty,exports.CompositeProperty=CompositeProperty,exports.CompressedTextureBuffer=CompressedTextureBuffer,exports.ComputeCommand=ComputeCommand,exports.ComputeEngine=ComputeEngine,exports.ComputeRegionBox=computeRegionBoundingBox,exports.ConditionsExpression=ConditionsExpression,exports.ConeEmitter=ConeEmitter,exports.ConicArcSensor=ConicArcSensor,exports.ConicArcSensorCollection=ConicArcSensorCollection,exports.ConicArcSensorGeometry=ConicArcSensorGeometry,exports.ConicArcSensorGraphics=ConicArcSensorGraphics,exports.ConicArcSensorOutlineGeometry=ConicArcSensorOutlineGeometry,exports.ConstantPositionProperty=ConstantPositionProperty,exports.ConstantProperty=ConstantProperty,exports.ContentState=ContentState$1,exports.Context=Context,exports.ContextLimits=ContextLimits,exports.CoplanarPolygonGeometry=CoplanarPolygonGeometry,exports.CoplanarPolygonGeometryLibrary=CoplanarPolygonGeometryLibrary,exports.CoplanarPolygonOutlineGeometry=CoplanarPolygonOutlineGeometry,exports.CornerType=CornerType$1,exports.CorridorGeometry=CorridorGeometry,exports.CorridorGeometryLibrary=CorridorGeometryLibrary,exports.CorridorGeometryUpdater=CorridorGeometryUpdater,exports.CorridorGraphics=CorridorGraphics,exports.CorridorOutlineGeometry=CorridorOutlineGeometry,exports.Credit=Credit,exports.CreditDisplay=CreditDisplay,exports.CubeMap=CubeMap,exports.CubeMapFace=CubeMapFace,exports.CubicRealPolynomial=CubicRealPolynomial,exports.CullFace=CullFace$1,exports.CullingVolume=CullingVolume,exports.CustomDataSource=CustomDataSource,exports.CylinderGeometry=CylinderGeometry,exports.CylinderGeometryLibrary=CylinderGeometryLibrary,exports.CylinderGeometryUpdater=CylinderGeometryUpdater,exports.CylinderGraphics=CylinderGraphics,exports.CylinderOutlineGeometry=CylinderOutlineGeometry,exports.CzmlDataSource=CzmlDataSource,exports.DDSTexture=DDSTexture,exports.DataSource=DataSource,exports.DataSourceClock=DataSourceClock,exports.DataSourceCollection=DataSourceCollection,exports.DataSourceDisplay=DataSourceDisplay,exports.DebugAppearance=DebugAppearance,exports.DebugCameraPrimitive=DebugCameraPrimitive,exports.DebugModelMatrixPrimitive=DebugModelMatrixPrimitive,exports.DefaultProxy=DefaultProxy,exports.DepthFunction=DepthFunction$1,exports.DepthPlane=DepthPlane,exports.DerivedCommand=DerivedCommand,exports.DeveloperError=DeveloperError,exports.DeviceOrientationCameraController=DeviceOrientationCameraController,exports.DirectionalLight=DirectionalLight,exports.DiscardEmptyTileImagePolicy=DiscardEmptyTileImagePolicy,exports.DiscardMissingTileImagePolicy=DiscardMissingTileImagePolicy,exports.DistanceDisplayCondition=DistanceDisplayCondition,exports.DistanceDisplayConditionGeometryInstanceAttribute=DistanceDisplayConditionGeometryInstanceAttribute,exports.DistanceLegendViewModel=DistanceLegendViewModel,exports.DoublyLinkedList=DoublyLinkedList,exports.DracoLoader=DracoLoader,exports.DrawCommand=DrawCommand,exports.DynamicGeometryBatch=DynamicGeometryBatch,exports.DynamicGeometryUpdater=DynamicGeometryUpdater,exports.ECharts=echarts,exports.EarthOrientationParameters=EarthOrientationParameters,exports.EarthOrientationParametersSample=EarthOrientationParametersSample,exports.EasingFunction=EasingFunction$1,exports.EllipseGeometry=EllipseGeometry,exports.EllipseGeometryLibrary=EllipseGeometryLibrary,exports.EllipseGeometryUpdater=EllipseGeometryUpdater,exports.EllipseGraphics=EllipseGraphics,exports.EllipseOutlineGeometry=EllipseOutlineGeometry,exports.Ellipsoid=Ellipsoid,exports.EllipsoidGeodesic=EllipsoidGeodesic,exports.EllipsoidGeometry=EllipsoidGeometry,exports.EllipsoidGeometryUpdater=EllipsoidGeometryUpdater,exports.EllipsoidGraphics=EllipsoidGraphics,exports.EllipsoidOutlineGeometry=EllipsoidOutlineGeometry,exports.EllipsoidPrimitive=EllipsoidPrimitive,exports.EllipsoidRhumbLine=EllipsoidRhumbLine,exports.EllipsoidSurfaceAppearance=EllipsoidSurfaceAppearance,exports.EllipsoidTangentPlane=EllipsoidTangentPlane,exports.EllipsoidTerrainProvider=EllipsoidTerrainProvider,exports.EllipsoidalOccluder=EllipsoidalOccluder,exports.Empty3DTileContent=Empty3DTileContent,exports.EncodedCartesian3=EncodedCartesian3,exports.Entity=Entity,exports.EntityCluster=EntityCluster,exports.EntityCollection=EntityCollection,exports.EntityView=EntityView,exports.Event=Event,exports.EventHelper=EventHelper,exports.ExpandByTerra=ExpandByTerra,exports.Expression=Expression,exports.ExpressionNodeType=ExpressionNodeType$1,exports.ExtrapolationType=ExtrapolationType$1,exports.FXAA3_11=FXAA3_11,exports.FeatureDataProvider=FeatureDataProvider,exports.FeatureDetection=FeatureDetection$1,exports.FeatureJsonData=FeatureJsonData,exports.FisheyeProjectionMap=FisheyeProjectionMap,exports.FisheyeProjectionMapShader=FisheyeProjectionMapShader,exports.FlowEcharts=FlowEcharts,exports.Fog=Fog,exports.ForEach=ForEach,exports.FrameRateMonitor=FrameRateMonitor,exports.FrameState=FrameState,exports.Framebuffer=Framebuffer,exports.FrustumCommands=FrustumCommands,exports.FrustumGeometry=FrustumGeometry,exports.FrustumOutlineGeometry=FrustumOutlineGeometry,exports.Fullscreen=Fullscreen,exports.FullscreenButton=FullscreenButton,exports.FullscreenButtonViewModel=FullscreenButtonViewModel,exports.GWBaiduImageryProvider=GWBaiduImageryProvider,exports.GeoJsonDataSource=GeoJsonDataSource,exports.GeocodeType=GeocodeType$1,exports.Geocoder=Geocoder,exports.GeocoderService=GeocoderService,exports.GeocoderViewModel=GeocoderViewModel,exports.GeographicProjection=GeographicProjection,exports.GeographicTilingScheme=GeographicTilingScheme,exports.Geometry=Geometry,exports.Geometry3DTileContent=Geometry3DTileContent,exports.GeometryAttribute=GeometryAttribute,exports.GeometryAttributes=GeometryAttributes,exports.GeometryInstance=GeometryInstance,exports.GeometryInstanceAttribute=GeometryInstanceAttribute,exports.GeometryOffsetAttribute=GeometryOffsetAttribute$1,exports.GeometryPipeline=GeometryPipeline,exports.GeometryType=GeometryType$1,exports.GeometryUpdater=GeometryUpdater,exports.GeometryVisualizer=GeometryVisualizer,exports.GetFeatureInfoFormat=GetFeatureInfoFormat,exports.GifImageProperty=GifImageProperty,exports.Globe=Globe,exports.GlobeDepth=GlobeDepth,exports.GlobeSurfaceShaderSet=GlobeSurfaceShaderSet,exports.GlobeSurfaceTile=GlobeSurfaceTile,exports.GlobeSurfaceTileProvider=GlobeSurfaceTileProvider,exports.GoogleEarthEnterpriseImageryProvider=GoogleEarthEnterpriseImageryProvider,exports.GoogleEarthEnterpriseMapsProvider=GoogleEarthEnterpriseMapsProvider,exports.GoogleEarthEnterpriseMetadata=GoogleEarthEnterpriseMetadata,exports.GoogleEarthEnterpriseTerrainData=GoogleEarthEnterpriseTerrainData,exports.GoogleEarthEnterpriseTerrainProvider=GoogleEarthEnterpriseTerrainProvider,exports.GoogleEarthEnterpriseTileInformation=GoogleEarthEnterpriseTileInformation,exports.GregorianDate=GregorianDate,exports.GridImageryProvider=GridImageryProvider,exports.GridMaterialProperty=GridMaterialProperty,exports.GroundGeometryUpdater=GroundGeometryUpdater,exports.GroundPolylineGeometry=GroundPolylineGeometry,exports.GroundPolylinePrimitive=GroundPolylinePrimitive,exports.GroundPrimitive=GroundPrimitive,exports.GwBufferAnalysis=GwBufferAnalysis,exports.HeadingPitchRange=HeadingPitchRange,exports.HeadingPitchRoll=HeadingPitchRoll,exports.Heap=Heap,exports.HeightReference=HeightReference$1,exports.HeightmapEncoding=HeightmapEncoding$1,exports.HeightmapTerrainData=HeightmapTerrainData,exports.HeightmapTessellator=HeightmapTessellator,exports.HermitePolynomialApproximation=HermitePolynomialApproximation,exports.HermiteSpline=HermiteSpline,exports.HomeButton=HomeButton,exports.HomeButtonViewModel=HomeButtonViewModel,exports.HorizontalOrigin=HorizontalOrigin$1,exports.Iau2000Orientation=Iau2000Orientation,exports.Iau2006XysData=Iau2006XysData,exports.Iau2006XysSample=Iau2006XysSample,exports.IauOrientationAxes=IauOrientationAxes,exports.IauOrientationParameters=IauOrientationParameters,exports.ImageMaterialProperty=ImageMaterialProperty,exports.Imagery=Imagery,exports.ImageryLayer=ImageryLayer,exports.ImageryLayerCollection=ImageryLayerCollection,exports.ImageryLayerFeatureInfo=ImageryLayerFeatureInfo,exports.ImageryProvider=ImageryProvider,exports.ImagerySplitDirection=ImagerySplitDirection$1,exports.ImageryState=ImageryState$1,exports.IndexDatatype=IndexDatatype$1,exports.InfoBox=InfoBox,exports.InfoBoxViewModel=InfoBoxViewModel,exports.InspectorShared=InspectorShared,exports.Instanced3DModel3DTileContent=Instanced3DModel3DTileContent,exports.InterpolationAlgorithm=InterpolationAlgorithm,exports.Intersect=Intersect$1,exports.IntersectionTests=IntersectionTests,exports.Intersections2D=Intersections2D,exports.Interval=Interval,exports.InvertClassification=InvertClassification,exports.Ion=Ion,exports.IonGeocoderService=IonGeocoderService,exports.IonImageryProvider=IonImageryProvider,exports.IonResource=IonResource,exports.IonWorldImageryStyle=IonWorldImageryStyle$1,exports.Iso8601=Iso8601,exports.JobScheduler=JobScheduler,exports.JobType=JobType$1,exports.JulianDate=JulianDate,exports.KeyboardEventModifier=KeyboardEventModifier$1,exports.KmlCamera=KmlCamera,exports.KmlDataSource=KmlDataSource,exports.KmlLookAt=KmlLookAt,exports.KmlTour=KmlTour,exports.KmlTourFlyTo=KmlTourFlyTo,exports.KmlTourWait=KmlTourWait,exports.Label=Label,exports.LabelCollection=LabelCollection,exports.LabelGraphics=LabelGraphics,exports.LabelStyle=LabelStyle$1,exports.LabelVisualizer=LabelVisualizer,exports.LagrangePolynomialApproximation=LagrangePolynomialApproximation,exports.LeapSecond=LeapSecond,exports.LercDecode=LercDecode,exports.Light=Light,exports.LinearApproximation=LinearApproximation,exports.LinearSampler=LinearSampler,exports.LinearSpline=LinearSpline,exports.MVTImageryProvider=MVTImageryProvider,exports.ManagedArray=ManagedArray,exports.MapMode2D=MapMode2D$1,exports.MapProjection=MapProjection,exports.MapWidget=MapWidget,exports.MapboxApi=MapboxApi,exports.MapboxImageryProvider=MapboxImageryProvider,exports.MapboxStyleImageryProvider=MapboxStyleImageryProvider,exports.Material=Material,exports.MaterialAppearance=MaterialAppearance,exports.MaterialPass=MaterialPass,exports.MaterialProperty=MaterialProperty,exports.Math=CesiumMath,exports.Matrix2=Matrix2,exports.Matrix3=Matrix3,exports.Matrix4=Matrix4,exports.MipmapHint=MipmapHint$1,exports.Model=Model,exports.ModelAnimation=ModelAnimation,exports.ModelAnimationCache=ModelAnimationCache,exports.ModelAnimationCollection=ModelAnimationCollection,exports.ModelAnimationLoop=ModelAnimationLoop$1,exports.ModelAnimationState=ModelAnimationState,exports.ModelGraphics=ModelGraphics,exports.ModelInstance=ModelInstance,exports.ModelInstanceCollection=ModelInstanceCollection,exports.ModelLoadResources=ModelLoadResources,exports.ModelMaterial=ModelMaterial,exports.ModelMesh=ModelMesh,exports.ModelNode=ModelNode,exports.ModelUtility=ModelUtility,exports.ModelVisualizer=ModelVisualizer,exports.Moon=Moon,exports.MultiResourceImageryProvider=MultiResourceImageryProvider,exports.MultiResourceTerrainProvider=MultiResourceTerrainProvider,exports.NavigationControl=NavigationControl,exports.NavigationHelpButton=NavigationHelpButton,exports.NavigationHelpButtonViewModel=NavigationHelpButtonViewModel,exports.NavigationUtils=NavigationUtils,exports.NavigationViewModel=NavigationViewModel,exports.NearFarScalar=NearFarScalar,exports.NeverTileDiscardPolicy=NeverTileDiscardPolicy,exports.NoSleep=NoSleep,exports.NodeTransformationProperty=NodeTransformationProperty,exports.OIT=OIT,exports.Occluder=Occluder,exports.OctahedralProjectedCubeMap=OctahedralProjectedCubeMap,exports.OffsetGeometryInstanceAttribute=OffsetGeometryInstanceAttribute,exports.OpenCageGeocoderService=OpenCageGeocoderService,exports.OpenStreetMapImageryProvider=OpenStreetMapImageryProvider,exports.OrderedGroundPrimitiveCollection=OrderedGroundPrimitiveCollection,exports.OrientedBoundingBox=OrientedBoundingBox,exports.OrthographicFrustum=OrthographicFrustum,exports.OrthographicOffCenterFrustum=OrthographicOffCenterFrustum,exports.Packable=Packable,exports.PackableForInterpolation=PackableForInterpolation,exports.Particle=Particle,exports.ParticleBurst=ParticleBurst,exports.ParticleEmitter=ParticleEmitter,exports.ParticleSystem=ParticleSystem,exports.Pass=Pass$1,exports.PassState=PassState,exports.PathGraphics=PathGraphics,exports.PathVisualizer=PathVisualizer,exports.PeliasGeocoderService=PeliasGeocoderService,exports.PerInstanceColorAppearance=PerInstanceColorAppearance,exports.PerformanceDisplay=PerformanceDisplay,exports.PerformanceWatchdog=PerformanceWatchdog,exports.PerformanceWatchdogViewModel=PerformanceWatchdogViewModel,exports.PerspectiveFrustum=PerspectiveFrustum,exports.PerspectiveOffCenterFrustum=PerspectiveOffCenterFrustum,exports.PerspectiveProjectionMap=PerspectiveProjectionMap,exports.PerspectiveProjectionMapShader=PerspectiveProjectionMapShader,exports.PerspectiveProjectionMapWithDepth=PerspectiveProjectionMapWithDepth,exports.PerspectiveProjectionMapWithDepthShader=PerspectiveProjectionMapWithDepthShader,exports.PickDepth=PickDepth,exports.PickDepthFramebuffer=PickDepthFramebuffer,exports.PickFramebuffer=PickFramebuffer,exports.Picking=Picking,exports.PinBuilder=PinBuilder,exports.PixelDatatype=PixelDatatype$1,exports.PixelFormat=PixelFormat$1,exports.Plane=Plane,exports.PlaneGeometry=PlaneGeometry,exports.PlaneGeometryUpdater=PlaneGeometryUpdater,exports.PlaneGraphics=PlaneGraphics,exports.PlaneOutlineGeometry=PlaneOutlineGeometry,exports.PointCloud=PointCloud,exports.PointCloud3DTileContent=PointCloud3DTileContent,exports.PointCloudEyeDomeLighting=PointCloudEyeDomeLighting,exports.PointCloudShading=PointCloudShading,exports.PointGraphics=PointGraphics,exports.PointPrimitive=PointPrimitive,exports.PointPrimitiveCollection=PointPrimitiveCollection,exports.PointVisualizer=PointVisualizer,exports.PolygonGeometry=PolygonGeometry,exports.PolygonGeometryLibrary=PolygonGeometryLibrary,exports.PolygonGeometryUpdater=PolygonGeometryUpdater,exports.PolygonGraphics=PolygonGraphics,exports.PolygonHierarchy=PolygonHierarchy,exports.PolygonOutlineGeometry=PolygonOutlineGeometry,exports.PolygonPipeline=PolygonPipeline,exports.Polyline=Polyline,exports.PolylineArrowMaterialProperty=PolylineArrowMaterialProperty,exports.PolylineCollection=PolylineCollection,exports.PolylineColorAppearance=PolylineColorAppearance,exports.PolylineDashMaterialProperty=PolylineDashMaterialProperty,exports.PolylineGeometry=PolylineGeometry,exports.PolylineGeometryUpdater=PolylineGeometryUpdater,exports.PolylineGlowMaterialProperty=PolylineGlowMaterialProperty,exports.PolylineGraphics=PolylineGraphics,exports.PolylineMaterialAppearance=PolylineMaterialAppearance,exports.PolylineOutlineMaterialProperty=PolylineOutlineMaterialProperty,exports.PolylinePipeline=PolylinePipeline,exports.PolylineTrailLinkMaterialProperty=PolylineTrailLinkMaterialProperty,exports.PolylineVisualizer=PolylineVisualizer,exports.PolylineVolumeGeometry=PolylineVolumeGeometry,exports.PolylineVolumeGeometryLibrary=PolylineVolumeGeometryLibrary,exports.PolylineVolumeGeometryUpdater=PolylineVolumeGeometryUpdater,exports.PolylineVolumeGraphics=PolylineVolumeGraphics,exports.PolylineVolumeOutlineGeometry=PolylineVolumeOutlineGeometry,exports.PositionProperty=PositionProperty,exports.PositionPropertyArray=PositionPropertyArray,exports.PostProcessStage=PostProcessStage,exports.PostProcessStageCollection=PostProcessStageCollection,exports.PostProcessStageComposite=PostProcessStageComposite,exports.PostProcessStageLibrary=PostProcessStageLibrary,exports.PostProcessStageSampleMode=PostProcessStageSampleMode,exports.PostProcessStageTextureCache=PostProcessStageTextureCache,exports.Primitive=Primitive,exports.PrimitiveCollection=PrimitiveCollection,exports.PrimitivePipeline=PrimitivePipeline,exports.PrimitiveState=PrimitiveState$1,exports.PrimitiveType=PrimitiveType$1,exports.ProjectionPicker=ProjectionPicker,exports.ProjectionPickerViewModel=ProjectionPickerViewModel,exports.Property=Property,exports.PropertyArray=PropertyArray,exports.PropertyBag=PropertyBag,exports.ProviderViewModel=ProviderViewModel,exports.QuadraticRealPolynomial=QuadraticRealPolynomial,exports.QuadtreeOccluders=QuadtreeOccluders,exports.QuadtreePrimitive=QuadtreePrimitive,exports.QuadtreeTile=QuadtreeTile,exports.QuadtreeTileLoadState=QuadtreeTileLoadState$1,exports.QuadtreeTileProvider=QuadtreeTileProvider,exports.QuantizedMeshTerrainData=QuantizedMeshTerrainData,exports.QuarticRealPolynomial=QuarticRealPolynomial,exports.Quaternion=Quaternion,exports.QuaternionSpline=QuaternionSpline,exports.Queue=Queue,exports.RasterizeHtml=RasterizeHTML,exports.Ray=Ray,exports.Rectangle=Rectangle,exports.RectangleCollisionChecker=RectangleCollisionChecker,exports.RectangleGeometry=RectangleGeometry,exports.RectangleGeometryLibrary=RectangleGeometryLibrary,exports.RectangleGeometryUpdater=RectangleGeometryUpdater,exports.RectangleGraphics=RectangleGraphics,exports.RectangleOutlineGeometry=RectangleOutlineGeometry,exports.RectangularSensor=RectangularSensor,exports.RectangularSensorFS=RectangularSensorFS,exports.RectangularSensorGraphics=RectangularSensorGraphics,exports.RectangularSensorPrimitive=RectangularSensorPrimitive,exports.RectangularSensorScanPlaneFS=RectangularSensorScanPlaneFS,exports.RectangularSensorVS=RectangularSensorVS,exports.RectangularSensorVisualizer=RectangularSensorVisualizer,exports.ReferenceFrame=ReferenceFrame$1,exports.ReferenceProperty=ReferenceProperty,exports.RenderEntity=RenderEntity,exports.RenderObjectFactory=RenderObjectFactory,exports.RenderState=RenderState,exports.Renderbuffer=Renderbuffer,exports.RenderbufferFormat=RenderbufferFormat$1,exports.Request=Request,exports.RequestErrorEvent=RequestErrorEvent,exports.RequestScheduler=RequestScheduler,exports.RequestState=RequestState$1,exports.RequestType=RequestType$1,exports.ResetViewNavigationControl=ResetViewNavigationControl,exports.Resource=Resource,exports.Rotation=Rotation,exports.RuntimeError=RuntimeError,exports.S3MCacheFileRenderEntity=S3MCacheFileRenderEntity,exports.S3MCompressType=S3MCompressType$1,exports.S3MContentFactory=S3MContentFactory,exports.S3MContentParser=S3MContentParser,exports.S3MCreateIndexJob=S3MCreateIndexBufferJob,exports.S3MCreateVertexJob=S3MCreateVertexJob,exports.S3MLayerCache=S3MLayerCache,exports.S3MLayerScheduler=S3MLayerScheduler,exports.S3MPixelFormat=S3MPixelFormat$1,exports.S3MTile=S3MTile,exports.S3MTilesFS=S3MTilesFS,exports.S3MTilesLayer=S3MTilesLayer,exports.S3MTilesVS=S3MTilesVS,exports.S3ModelParser=S3ModelParser,exports.SDFSettings=SDFSettings$1,exports.SampledPositionProperty=SampledPositionProperty,exports.SampledProperty=SampledProperty,exports.Sampler=Sampler,exports.ScaledPositionProperty=ScaledPositionProperty,exports.Scene=Scene,exports.SceneFramebuffer=SceneFramebuffer,exports.SceneMode=SceneMode$1,exports.SceneModePicker=SceneModePicker,exports.SceneModePickerViewModel=SceneModePickerViewModel,exports.SceneTransforms=SceneTransforms,exports.SceneTransitioner=SceneTransitioner,exports.ScreenSpaceCameraController=ScreenSpaceCameraController,exports.ScreenSpaceEventHandler=ScreenSpaceEventHandler,exports.ScreenSpaceEventType=ScreenSpaceEventType$1,exports.SelectionIndicator=SelectionIndicator,exports.SelectionIndicatorViewModel=SelectionIndicatorViewModel,exports.Sensor=Sensor,exports.ShaderCache=ShaderCache,exports.ShaderProgram=ShaderProgram,exports.ShaderSource=ShaderSource,exports.ShadowMap=ShadowMap,exports.ShadowMapShader=ShadowMapShader,exports.ShadowMode=ShadowMode$1,exports.ShadowVolumeAppearance=ShadowVolumeAppearance,exports.ShowGeometryInstanceAttribute=ShowGeometryInstanceAttribute,exports.Simon1994PlanetaryPositions=Simon1994PlanetaryPositions,exports.SimplePolylineGeometry=SimplePolylineGeometry,exports.SingleTileImageryProvider=SingleTileImageryProvider,exports.SkyAtmosphere=SkyAtmosphere,exports.SkyBox=SkyBox,exports.SphereEmitter=SphereEmitter,exports.SphereGeometry=SphereGeometry,exports.SphereOutlineGeometry=SphereOutlineGeometry,exports.Spherical=Spherical,exports.Spline=Spline,exports.StaticGeometryColorBatch=StaticGeometryColorBatch,exports.StaticGeometryPerMaterialBatch=StaticGeometryPerMaterialBatch,exports.StaticGroundGeometryColorBatch=StaticGroundGeometryColorBatch,exports.StaticGroundGeometryPerMaterialBatch=StaticGroundGeometryPerMaterialBatch,exports.StaticGroundPolylinePerMaterialBatch=StaticGroundPolylinePerMaterialBatch,exports.StaticOutlineGeometryBatch=StaticOutlineGeometryBatch,exports.StencilConstants=StencilConstants$1,exports.StencilFunction=StencilFunction$1,exports.StencilOperation=StencilOperation$1,exports.StripeMaterialProperty=StripeMaterialProperty,exports.StripeOrientation=StripeOrientation$1,exports.StyleExpression=StyleExpression,exports.Sun=Sun,exports.SunLight=SunLight,exports.SunPostProcess=SunPostProcess,exports.SvgPathBindingHandler=SvgPathBindingHandler,exports.TaskProcessor=TaskProcessor,exports.TerrainData=TerrainData,exports.TerrainEncoding=TerrainEncoding,exports.TerrainFillMesh=TerrainFillMesh,exports.TerrainMesh=TerrainMesh,exports.TerrainOffsetProperty=TerrainOffsetProperty,exports.TerrainProvider=TerrainProvider,exports.TerrainQuantization=TerrainQuantization$1,exports.TerrainState=TerrainState$2,exports.Texture=Texture,exports.TextureAtlas=TextureAtlas,exports.TextureCache=TextureCache,exports.TextureMagnificationFilter=TextureMagnificationFilter$1,exports.TextureMinificationFilter=TextureMinificationFilter$1,exports.TextureWrap=TextureWrap$1,exports.TileAvailability=TileAvailability,exports.TileBoundingRegion=TileBoundingRegion,exports.TileBoundingSphere=TileBoundingSphere,exports.TileBoundingVolume=TileBoundingVolume,exports.TileCoordinatesImageryProvider=TileCoordinatesImageryProvider,exports.TileDiscardPolicy=TileDiscardPolicy,exports.TileEdge=TileEdge,exports.TileImagery=TileImagery,exports.TileMapServiceImageryProvider=TileMapServiceImageryProvider,exports.TileOrientedBoundingBox=TileOrientedBoundingBox,exports.TileProviderError=TileProviderError,exports.TileReplacementQueue=TileReplacementQueue,exports.TileSelectionResult=TileSelectionResult,exports.TileState=TileState$1,exports.Tileset3DTileContent=Tileset3DTileContent,exports.TilingScheme=TilingScheme,exports.TimeConstants=TimeConstants$1,exports.TimeDynamicImagery=TimeDynamicImagery,exports.TimeDynamicPointCloud=TimeDynamicPointCloud,exports.TimeInterval=TimeInterval,exports.TimeIntervalCollection=TimeIntervalCollection,exports.TimeIntervalCollectionPositionProperty=TimeIntervalCollectionPositionProperty,exports.TimeIntervalCollectionProperty=TimeIntervalCollectionProperty,exports.TimeStandard=TimeStandard$1,exports.Timeline=Timeline,exports.TimelineHighlightRange=TimelineHighlightRange,exports.TimelineTrack=TimelineTrack,exports.Tipsify=Tipsify,exports.ToggleButtonViewModel=ToggleButtonViewModel,exports.Tonemapper=Tonemapper$1,exports.Transforms=Transforms,exports.TranslationRotationScale=TranslationRotationScale,exports.TridiagonalSystemSolver=TridiagonalSystemSolver,exports.TrustedServers=TrustedServers,exports.Tween=TWEEN,exports.TweenCollection=TweenCollection,exports.UniformState=UniformState,exports.Uri=URI,exports.UrlTemplateImageryProvider=UrlTemplateImageryProvider,exports.UserInterfaceControl=UserInterfaceControl,exports.Utils=Utils,exports.VERSION=VERSION,exports.VRButton=VRButton,exports.VRButtonViewModel=VRButtonViewModel,exports.VRTheWorldTerrainProvider=VRTheWorldTerrainProvider,exports.Vector3DTileBatch=Vector3DTileBatch,exports.Vector3DTileContent=Vector3DTileContent,exports.Vector3DTileGeometry=Vector3DTileGeometry,exports.Vector3DTilePoints=Vector3DTilePoints,exports.Vector3DTilePolygons=Vector3DTilePolygons,exports.Vector3DTilePolylines=Vector3DTilePolylines,exports.Vector3DTilePrimitive=Vector3DTilePrimitive,exports.VelocityOrientationProperty=VelocityOrientationProperty,exports.VelocityVectorProperty=VelocityVectorProperty,exports.VertexArray=VertexArray,exports.VertexArrayFacade=VertexArrayFacade,exports.VertexCompressOption=VertexCompressOption,exports.VertexFormat=VertexFormat,exports.VerticalOrigin=VerticalOrigin$1,exports.VideoSynchronizer=VideoSynchronizer,exports.View=View,exports.ViewShedMap=ViewShedMap,exports.ViewShedMapShader=ViewShedMapShader,exports.Viewer=Viewer,exports.ViewportQuad=ViewportQuad,exports.Visibility=Visibility$1,exports.Visualizer=Visualizer,exports.WallGeometry=WallGeometry,exports.WallGeometryLibrary=WallGeometryLibrary,exports.WallGeometryUpdater=WallGeometryUpdater,exports.WallGraphics=WallGraphics,exports.WallOutlineGeometry=WallOutlineGeometry,exports.WaterFS=waterFS,exports.WaterMaterialProperty=WaterMaterialProperty,exports.WebGLConstants=WebGLConstants$1,exports.WebMapServiceImageryProvider=WebMapServiceImageryProvider,exports.WebMapTileServiceImageryProvider=WebMapTileServiceImageryProvider,exports.WebMercatorProjection=WebMercatorProjection,exports.WebMercatorTilingScheme=WebMercatorTilingScheme,exports.WeightSpline=WeightSpline,exports.WindingOrder=WindingOrder$1,exports.ZoomNavigationControl=ZoomNavigationControl,exports._shadersAcesTonemappingStage=AcesTonemapping,exports._shadersAdditiveBlend=AdditiveBlend,exports._shadersAdjustTranslucentFS=AdjustTranslucentFS,exports._shadersAllMaterialAppearanceFS=AllMaterialAppearanceFS,exports._shadersAllMaterialAppearanceVS=AllMaterialAppearanceVS,exports._shadersAmbientOcclusionGenerate=AmbientOcclusionGenerate,exports._shadersAmbientOcclusionModulate=AmbientOcclusionModulate,exports._shadersAspectRampMaterial=AspectRampMaterial,exports._shadersBasicMaterialAppearanceFS=BasicMaterialAppearanceFS,exports._shadersBasicMaterialAppearanceVS=BasicMaterialAppearanceVS,exports._shadersBillboardCollectionFS=BillboardCollectionFS,exports._shadersBillboardCollectionVS=BillboardCollectionVS,exports._shadersBlackAndWhite=BlackAndWhite,exports._shadersBloomComposite=BloomComposite,exports._shadersBrdfLutGeneratorFS=BrdfLutGeneratorFS,exports._shadersBrightPass=BrightPass,exports._shadersBrightness=Brightness,exports._shadersBumpMapMaterial=BumpMapMaterial,exports._shadersCheckFloatTexturePrecisionFS=CheckFloatTexturePrecisionFS,exports._shadersCheckerboardMaterial=CheckerboardMaterial,exports._shadersCompositeOITFS=CompositeOITFS,exports._shadersContrastBias=ContrastBias,exports._shadersCzmBuiltins=CzmBuiltins,exports._shadersDepthOfField=DepthOfField,exports._shadersDepthPlaneFS=DepthPlaneFS,exports._shadersDepthPlaneVS=DepthPlaneVS,exports._shadersDepthView=DepthView,exports._shadersDepthViewPacked=DepthViewPacked,exports._shadersDotMaterial=DotMaterial,exports._shadersEdgeDetection=EdgeDetection,exports._shadersElevationContourMaterial=ElevationContourMaterial,exports._shadersElevationRampMaterial=ElevationRampMaterial,exports._shadersEllipsoidFS=EllipsoidFS,exports._shadersEllipsoidSurfaceAppearanceFS=EllipsoidSurfaceAppearanceFS,exports._shadersEllipsoidSurfaceAppearanceVS=EllipsoidSurfaceAppearanceVS,exports._shadersEllipsoidVS=EllipsoidVS,exports._shadersFXAA=FXAA,exports._shadersFadeMaterial=FadeMaterial,exports._shadersFilmicTonemapping=FilmicTonemapping,exports._shadersGaussianBlur1D=GaussianBlur1D,exports._shadersGaussianBlur1DSun=GaussianBlur1DSun,exports._shadersGlobeFS=GlobeFS,exports._shadersGlobeVS=GlobeVS,exports._shadersGridMaterial=GridMaterial,exports._shadersGroundAtmosphere=GroundAtmosphere,exports._shadersHSBToRGB=czm_HSBToRGB,exports._shadersHSLToRGB=czm_HSLToRGB,exports._shadersLensFlare=LensFlare,exports._shadersModifiedReinhardTonemapping=ModifiedReinhardTonemapping,exports._shadersNightVision=NightVision,exports._shadersNormalMapMaterial=NormalMapMaterial,exports._shadersOctahedralProjectionAtlasFS=OctahedralProjectionAtlasFS,exports._shadersOctahedralProjectionFS=OctahedralProjectionFS,exports._shadersOctahedralProjectionVS=OctahedralProjectionVS,exports._shadersPassThrough=PassThrough,exports._shadersPassThroughDepth=PassThroughDepth,exports._shadersPerInstanceColorAppearanceFS=PerInstanceColorAppearanceFS,exports._shadersPerInstanceColorAppearanceVS=PerInstanceColorAppearanceVS,exports._shadersPerInstanceFlatColorAppearanceFS=PerInstanceFlatColorAppearanceFS,exports._shadersPerInstanceFlatColorAppearanceVS=PerInstanceFlatColorAppearanceVS,exports._shadersPointCloudEyeDomeLighting=PointCloudEyeDomeLightingShader,exports._shadersPointPrimitiveCollectionFS=PointPrimitiveCollectionFS,exports._shadersPointPrimitiveCollectionVS=PointPrimitiveCollectionVS,exports._shadersPolylineArrowMaterial=PolylineArrowMaterial,exports._shadersPolylineColorAppearanceVS=PolylineColorAppearanceVS,exports._shadersPolylineCommon=PolylineCommon,exports._shadersPolylineDashMaterial=PolylineDashMaterial,exports._shadersPolylineFS=PolylineFS,exports._shadersPolylineGlowMaterial=PolylineGlowMaterial,exports._shadersPolylineMaterialAppearanceVS=PolylineMaterialAppearanceVS,exports._shadersPolylineOutlineMaterial=PolylineOutlineMaterial,exports._shadersPolylineShadowVolumeFS=PolylineShadowVolumeFS,exports._shadersPolylineShadowVolumeMorphFS=PolylineShadowVolumeMorphFS,exports._shadersPolylineShadowVolumeMorphVS=PolylineShadowVolumeMorphVS,exports._shadersPolylineShadowVolumeVS=PolylineShadowVolumeVS,exports._shadersPolylineVS=PolylineVS,exports._shadersPostProcessRain=PostProcessRain,exports._shadersPostProcessSnow=PostProcessSnow,exports._shadersRGBToHSB=czm_RGBToHSB,exports._shadersRGBToHSL=czm_RGBToHSL,exports._shadersRGBToXYZ=czm_RGBToXYZ,exports._shadersReinhardTonemapping=ReinhardTonemapping,exports._shadersReprojectWebMercatorFS=ReprojectWebMercatorFS,exports._shadersReprojectWebMercatorVS=ReprojectWebMercatorVS,exports._shadersRimLightingMaterial=RimLightingMaterial,exports._shadersShadowVolumeAppearanceFS=ShadowVolumeAppearanceFS,exports._shadersShadowVolumeAppearanceVS=ShadowVolumeAppearanceVS,exports._shadersShadowVolumeFS=ShadowVolumeFS,exports._shadersSilhouette=Silhouette,exports._shadersSkyAtmosphereFS=SkyAtmosphereFS,exports._shadersSkyAtmosphereVS=SkyAtmosphereVS,exports._shadersSkyBoxFS=SkyBoxFS,exports._shadersSkyBoxVS=SkyBoxVS,exports._shadersSlopeRampMaterial=SlopeRampMaterial,exports._shadersStripeMaterial=StripeMaterial,exports._shadersSunFS=SunFS,exports._shadersSunShaft=SunShaft,exports._shadersSunShaftHdr=SunShaftHdr,exports._shadersSunShaftModulate=SunShaftModulate,exports._shadersSunTextureFS=SunTextureFS,exports._shadersSunTextureFS_v2=SunTextureFS_v2,exports._shadersSunVS=SunVS,exports._shadersSunVisibleFS=SunVisibleFS,exports._shadersSunVisibleShaft=SunVisibleShaft,exports._shadersSunVisibleVS=SunVisibleVS,exports._shadersTexturedMaterialAppearanceFS=TexturedMaterialAppearanceFS,exports._shadersTexturedMaterialAppearanceVS=TexturedMaterialAppearanceVS,exports._shadersVector3DTilePolylinesVS=Vector3DTilePolylinesVS,exports._shadersVectorTileVS=VectorTileVS,exports._shadersViewportQuadFS=ViewportQuadFS,exports._shadersViewportQuadVS=ViewportQuadVS,exports._shadersWater=WaterMaterial,exports._shadersXYZToRGB=czm_XYZToRGB,exports._shadersacesTonemapping=czm_acesTonemapping,exports._shadersalphaWeight=czm_alphaWeight,exports._shadersantialias=czm_antialias,exports._shadersapproximateSphericalCoordinates=czm_approximateSphericalCoordinates,exports._shadersbranchFreeTernary=czm_branchFreeTernary,exports._shaderscascadeColor=czm_cascadeColor,exports._shaderscascadeDistance=czm_cascadeDistance,exports._shaderscascadeMatrix=czm_cascadeMatrix,exports._shaderscascadeWeights=czm_cascadeWeights;exports._shaderscolumbusViewMorph=czm_columbusViewMorph,exports._shaderscomputePosition=czm_computePosition,exports._shaderscosineAndSine=czm_cosineAndSine,exports._shadersdecompressTextureCoordinates=czm_decompressTextureCoordinates,exports._shadersdegreesPerRadian=czm_degreesPerRadian,exports._shadersdepthClampFarPlane=czm_depthClampFarPlane,exports._shadersdepthRange=czm_depthRange,exports._shadersdepthRangeStruct=czm_depthRangeStruct,exports._shaderseastNorthUpToEyeCoordinates=czm_eastNorthUpToEyeCoordinates,exports._shadersellipsoidContainsPoint=czm_ellipsoidContainsPoint,exports._shadersellipsoidInverseRadii=czm_ellipsoidInverseRadii,exports._shadersellipsoidRadii=czm_ellipsoidRadii,exports._shadersellipsoidWgs84TextureCoordinates=czm_ellipsoidWgs84TextureCoordinates,exports._shadersepsilon1=czm_epsilon1,exports._shadersepsilon2=czm_epsilon2,exports._shadersepsilon3=czm_epsilon3,exports._shadersepsilon4=czm_epsilon4,exports._shadersepsilon5=czm_epsilon5,exports._shadersepsilon6=czm_epsilon6,exports._shadersepsilon7=czm_epsilon7,exports._shadersequalsEpsilon=czm_equalsEpsilon,exports._shaderseyeOffset=czm_eyeOffset,exports._shaderseyeToWindowCoordinates=czm_eyeToWindowCoordinates,exports._shadersfastApproximateAtan=czm_fastApproximateAtan,exports._shadersfog=czm_fog,exports._shadersgammaCorrect=czm_gammaCorrect,exports._shadersgeodeticSurfaceNormal=czm_geodeticSurfaceNormal,exports._shadersgetDefaultMaterial=czm_getDefaultMaterial,exports._shadersgetLambertDiffuse=czm_getLambertDiffuse,exports._shadersgetSpecular=czm_getSpecular,exports._shadersgetWaterNoise=czm_getWaterNoise,exports._shadershue=czm_hue,exports._shadersinfinity=czm_infinity,exports._shadersinverseGamma=czm_inverseGamma,exports._shadersisEmpty=czm_isEmpty,exports._shadersisFull=czm_isFull,exports._shaderslatitudeToWebMercatorFraction=czm_latitudeToWebMercatorFraction,exports._shaderslineDistance=czm_lineDistance,exports._shadersluminance=czm_luminance,exports._shadersmaterial=czm_material,exports._shadersmaterialInput=czm_materialInput,exports._shadersmetersPerPixel=czm_metersPerPixel,exports._shadersmodelToWindowCoordinates=czm_modelToWindowCoordinates,exports._shadersmultiplyWithColorBalance=czm_multiplyWithColorBalance,exports._shadersnearFarScalar=czm_nearFarScalar,exports._shadersoctDecode=czm_octDecode,exports._shadersoneOverPi=czm_oneOverPi,exports._shadersoneOverTwoPi=czm_oneOverTwoPi,exports._shaderspackDepth=czm_packDepth,exports._shaderspassCesium3DTile=czm_passCesium3DTile,exports._shaderspassCesium3DTileClassification=czm_passCesium3DTileClassification,exports._shaderspassCesium3DTileClassificationIgnoreShow=czm_passCesium3DTileClassificationIgnoreShow,exports._shaderspassClassification=czm_passClassification,exports._shaderspassCompute=czm_passCompute,exports._shaderspassEnvironment=czm_passEnvironment,exports._shaderspassGlobe=czm_passGlobe,exports._shaderspassOpaque=czm_passOpaque,exports._shaderspassOverlay=czm_passOverlay,exports._shaderspassTerrainClassification=czm_passTerrainClassification,exports._shaderspassTranslucent=czm_passTranslucent,exports._shadersphong=czm_phong,exports._shaderspi=czm_pi,exports._shaderspiOverFour=czm_piOverFour,exports._shaderspiOverSix=czm_piOverSix,exports._shaderspiOverThree=czm_piOverThree,exports._shaderspiOverTwo=czm_piOverTwo,exports._shadersplaneDistance=czm_planeDistance,exports._shaderspointAlongRay=czm_pointAlongRay,exports._shadersradiansPerDegree=czm_radiansPerDegree,exports._shadersray=czm_ray,exports._shadersrayEllipsoidIntersectionInterval=czm_rayEllipsoidIntersectionInterval,exports._shadersraySegment=czm_raySegment,exports._shadersreadDepth=czm_readDepth,exports._shadersreverseLogDepth=czm_reverseLogDepth,exports._shaderssampleOctahedralProjection=czm_sampleOctahedralProjection,exports._shaderssaturation=czm_saturation,exports._shaderssceneMode2D=czm_sceneMode2D,exports._shaderssceneMode3D=czm_sceneMode3D,exports._shaderssceneModeColumbusView=czm_sceneModeColumbusView,exports._shaderssceneModeMorphing=czm_sceneModeMorphing,exports._shadersshadowDepthCompare=czm_shadowDepthCompare,exports._shadersshadowParameters=czm_shadowParameters,exports._shadersshadowVisibility=czm_shadowVisibility,exports._shaderssignNotZero=czm_signNotZero,exports._shaderssolarRadius=czm_solarRadius,exports._shaderssphericalHarmonics=czm_sphericalHarmonics,exports._shaderstangentToEyeSpaceMatrix=czm_tangentToEyeSpaceMatrix,exports._shadersthreePiOver2=czm_threePiOver2,exports._shaderstransformPlane=czm_transformPlane,exports._shaderstranslateRelativeToEye=czm_translateRelativeToEye,exports._shaderstranslucentPhong=czm_translucentPhong,exports._shaderstranspose=czm_transpose,exports._shaderstwoPi=czm_twoPi,exports._shadersunpackDepth=czm_unpackDepth,exports._shadersunpackFloat=czm_unpackFloat,exports._shadersvertexLogDepth=czm_vertexLogDepth,exports._shaderswebMercatorMaxLatitude=czm_webMercatorMaxLatitude,exports._shaderswindowToEyeCoordinates=czm_windowToEyeCoordinates,exports._shaderswriteDepthClampedToFarPlane=czm_writeDepthClampedToFarPlane,exports._shaderswriteLogDepth=czm_writeLogDepth,exports.addBuffer=addBuffer,exports.addDefaults=addDefaults,exports.addExtensionsRequired=addExtensionsRequired,exports.addExtensionsUsed=addExtensionsUsed,exports.addPipelineExtras=addPipelineExtras,exports.addToArray=addToArray,exports.appendForwardSlash=appendForwardSlash,exports.arrayFill=arrayFill,exports.arrayRemoveDuplicates=arrayRemoveDuplicates,exports.arraySlice=arraySlice,exports.barycentricCoordinates=barycentricCoordinates,exports.binarySearch=binarySearch,exports.bitmap_sdf=calcSDF,exports.buildModuleUrl=buildModuleUrl,exports.cancelAnimationFrame=cancelAnimationFramePolyfill,exports.checkFloatTexturePrecision=checkFloatTexturePrecision,exports.clone=clone,exports.combine=combine,exports.computeFlyToLocationForRectangle=computeFlyToLocationForRectangle,exports.createBillboardPointCallback=createBillboardPointCallback,exports.createCommand=createCommand$2,exports.createDefaultImageryProviderViewModels=createDefaultImageryProviderViewModels,exports.createDefaultTerrainProviderViewModels=createDefaultTerrainProviderViewModels,exports.createFragmentFromTemplate=createFragmentFromTemplate,exports.createGuid=createGuid,exports.createMaterialPropertyDescriptor=createMaterialPropertyDescriptor,exports.createPropertyDescriptor=createPropertyDescriptor,exports.createRawPropertyDescriptor=createRawPropertyDescriptor,exports.createTangentSpaceDebugPrimitive=createTangentSpaceDebugPrimitive,exports.createTaskProcessorWorker=createTaskProcessorWorker,exports.createUniform=createUniform$1,exports.createUniformArray=createUniformArray,exports.createWorldImagery=createWorldImagery,exports.createWorldTerrain=createWorldTerrain,exports.decodeGoogleEarthEnterpriseData=decodeGoogleEarthEnterpriseData,exports.defaultValue=defaultValue,exports.defined=defined,exports.deprecationWarning=deprecationWarning,exports.destroyObject=destroyObject,exports.earcut_2_2_1=earcut,exports.echarts=echarts,exports.exportKml=exportKml,exports.findAccessorMinMax=findAccessorMinMax,exports.formatError=formatError,exports.freezeRenderState=freezeRenderState,exports.getAbsoluteUri=getAbsoluteUri,exports.getAccessorByteStride=getAccessorByteStride,exports.getBaseUri=getBaseUri,exports.getBinaryAccessor=getBinaryAccessor,exports.getClipAndStyleCode=getClipAndStyleCode,exports.getClippingFunction=getClippingFunction,exports.getComponentReader=getComponentReader,exports.getElement=getElement,exports.getExtensionFromUri=getExtensionFromUri,exports.getFilenameFromUri=getFilenameFromUri,exports.getImagePixels=getImagePixels,exports.getMagic=getMagic,exports.getStringFromTypedArray=getStringFromTypedArray,exports.getTimestamp=getTimestamp$1,exports.graphemesplitter=GraphemeSplitter,exports.hasExtension=hasExtension,exports.heightReferenceOnEntityPropertyChanged=heightReferenceOnEntityPropertyChanged,exports.isArray=isArrayFunction,exports.isBitSet=isBitSet,exports.isBlobUri=isBlobUri,exports.isCrossOriginUrl=isCrossOriginUrl,exports.isDataUri=isDataUri,exports.isLeapYear=isLeapYear,exports.jsep=jsep,exports.kdbush=kdbush,exports.knockout=knockout,exports.knockout_3_5_1=knockout,exports.knockout_es5=knockout_es5,exports.libgif=SuperGif,exports.loadAndExecuteScript=loadAndExecuteScript,exports.loadCRN=loadCRN,exports.loadCubeMap=loadCubeMap,exports.loadDDS=loadDDS$1,exports.loadImageFromTypedArray=loadImageFromTypedArray,exports.loadKTX=loadKTX,exports.loadView=loadView,exports.mapbox_gl=tmp$6,exports.measureText=measureText,exports.mergeSort=mergeSort,exports.mersenne_twister=MersenneTwister,exports.modernizeShader=modernizeShader,exports.moveTechniqueRenderStates=moveTechniqueRenderStates,exports.moveTechniquesToExtension=moveTechniquesToExtension,exports.numberOfComponentsForType=numberOfComponentsForType,exports.objectToQuery=objectToQuery,exports.oneTimeWarning=oneTimeWarning,exports.parseGlb=parseGlb,exports.parseResponseHeaders=parseResponseHeaders,exports.pointInsideTriangle=pointInsideTriangle,exports.processModelMaterialsCommon=processModelMaterialsCommon,exports.processPbrMaterials=processPbrMaterials,exports.protobuf_minimal=protobuf,exports.purify=purify,exports.queryToObject=queryToObject,exports.quickselect=quickselect,exports.rasterizeHTML_allinone=RasterizeHTML,exports.rbush=rbush,exports.readAccessorPacked=readAccessorPacked,exports.removeExtensionsRequired=removeExtensionsRequired,exports.removeExtensionsUsed=removeExtensionsUsed,exports.removePipelineExtras=removePipelineExtras,exports.removeUnusedElements=removeUnusedElements,exports.remove_primitive=removePrimitive,exports.requestAnimationFrame=requestAnimationFramePolyFill,exports.sampleTerrain=sampleTerrain,exports.sampleTerrainMostDetailed=sampleTerrainMostDetailed,exports.scaleToGeodeticSurface=scaleToGeodeticSurface,exports.sprintf=sprintf,exports.subdivideArray=subdivideArray,exports.subscribeAndEvaluate=subscribeAndEvaluate,exports.svgCompassGyro=svgCompassGyro,exports.svgCompassOuterRing=svgCompassOuterRing,exports.svgCompassRotationMarker=svgCompassRotationMarker,exports.svgReset=svgReset,exports.topojson=topojson,exports.turf_min=turf,exports.updateAccessorComponentTypes=updateAccessorComponentTypes,exports.updateVersion=updateVersion,exports.viewerCesium3DTilesInspectorMixin=viewerCesium3DTilesInspectorMixin,exports.viewerCesiumInspectorMixin=viewerCesiumInspectorMixin,exports.viewerDragDropMixin=viewerDragDropMixin,exports.viewerGeoworldNavigationMixin=viewerGeoworldNavigationMixin,exports.viewerPerformanceWatchdogMixin=viewerPerformanceWatchdogMixin,exports.webGLConstantToGlslType=webGLConstantToGlslType,exports.when=when,exports.wrapFunction=wrapFunction,exports.writeTextToCanvas=writeTextToCanvas,exports.zip=zip,Object.defineProperty(exports,"__esModule",{value:!0})});